diff --git a/Keyboard/index.html b/Keyboard/index.html new file mode 100644 index 0000000..14a4a14 --- /dev/null +++ b/Keyboard/index.html @@ -0,0 +1,330 @@ + + + + + + + + + Augmented Virtual Keyboard + + + + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + diff --git a/Keyboard/script.js b/Keyboard/script.js new file mode 100644 index 0000000..8c238e9 --- /dev/null +++ b/Keyboard/script.js @@ -0,0 +1,26 @@ +/*! +Parts of this script are from the TurboWarp Packager , licensed as follows: +Copyright (C) 2021-2024 Thomas Weber + +The Source Code Form of this program is available under the terms of the +Mozilla Public License, v. 2.0. You can obtain a copy of the license at +https://www.mozilla.org/en-US/MPL/2.0/. + +Parts of this script are from Scratch , licensed as follows: +Copyright (c) 2016, Massachusetts Institute of Technology +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/*! For license information please see scaffolding-min.js.LICENSE.txt */ +!function(e){function t(t){for(var n,i,s=t[0],o=t[1],a=0,c=[];a=e.length?void(M>T,C[I]=D,C[D++]=I;D{if("string"!=typeof e)return!1;for(let t=0;tr?1:0}return n===1/0&&r===1/0||n===-1/0&&r===-1/0?0:n-r}static isInt(e){return"number"==typeof e?!!isNaN(e)||e===Math.floor(e):"boolean"==typeof e||"string"==typeof e&&e.indexOf(".")<0}static get LIST_INVALID(){return"INVALID"}static get LIST_ALL(){return"ALL"}static toListIndex(e,t,n){if("number"!=typeof e){if("all"===e)return n?s.LIST_ALL:s.LIST_INVALID;if("last"===e)return t>0?t:s.LIST_INVALID;if("random"===e||"any"===e)return t>0?1+Math.floor(Math.random()*t):s.LIST_INVALID}return(e=Math.floor(s.toNumber(e)))<1||e>t?s.LIST_INVALID:e}}e.exports=s},function(e,t){e.exports={BOOLEAN:"Boolean",BUTTON:"button",LABEL:"label",COMMAND:"command",CONDITIONAL:"conditional",EVENT:"event",HAT:"hat",LOOP:"loop",REPORTER:"reporter",XML:"xml"}},function(e,t){e.exports={ANGLE:"angle",BOOLEAN:"Boolean",COLOR:"color",NUMBER:"number",STRING:"string",MATRIX:"matrix",NOTE:"note",IMAGE:"image",COSTUME:"costume",SOUND:"sound"}},function(e,t){e.exports=class{static degToRad(e){return e*Math.PI/180}static radToDeg(e){return 180*e/Math.PI}static clamp(e,t,n){return Math.min(Math.max(e,t),n)}static wrapClamp(e,t,n){const r=n-t+1;return e-Math.floor((e-t)/r)*r}static tan(e){switch(e%=360){case-270:case 90:return 1/0;case-90:case 270:return-1/0;default:return Math.round(1e10*Math.tan(Math.PI*e/180))/1e10}}static reducedSortOrdering(e){const t=e.slice(0).sort(((e,t)=>e-t));return e.map((e=>t.indexOf(e)))}static inclusiveRandIntWithout(e,t,n){const r=t-e,i=e+Math.floor(Math.random()*r);return i>=n?i+1:i}static scale(e,t,n,r,i){return(e-t)/(n-t)*(i-r)+r}}},function(e,t,n){"use strict";var r=n(130),i=n(131),s=n(68),o=n(67),a=n(66);function l(e,t){return Object.keys(t).forEach((function(n){e[n]=t[n]})),e}e.exports=function e(){var t=l({},a),n="en",c={},u=function(e){return e},d=null,h="warning",p={};function m(e,t,s){var o="string"==typeof e?e:e.default,a=y(o,"object"==typeof e&&e.id||u(o),s||n);return(a.format||(a.format=i(r(a.message),s||n,p)))(t)}m.rich=function(e,t,s){var o="string"==typeof e?e:e.default,a=y(o,"object"==typeof e&&e.id||u(o),s||n);return(a.toParts||(a.toParts=i.toParts(r(a.message,{tagsType:f}),s||n,p)))(t)};var f="<>";function g(e,t){var n=e[2];return function(e,t){var r="object"==typeof n?function(e,t){return Object.keys(e).reduce((function(n,r){return n[r]=e[r](t),n}),{})}(n,t):n;return"function"==typeof e?e(r):e}}function y(e,t,n){var r=o(n,c)||"en",i=c[r]||(c[r]={}),s=i[t];if("string"==typeof s&&(s=i[t]={message:s}),!s){var a='Translation for "'+t+'" in "'+r+'" is missing';if("warning"===h)"undefined"!=typeof console&&console.warn(a);else if("ignore"!==h)throw new Error(a);var l="function"==typeof d?d(e,t,r)||e:d||e;s=i[t]={message:l}}return s}function b(e,t,r,i,a){"object"==typeof r&&"object"!=typeof i&&(a=i,i=r,r=0);var l=o(a||n,s),c=l&&s[l][e]||v;return i["="+ +t]||i[c(t-r)]||i.other}function v(){return"other"}return p[f]=g,m.setup=function(e){return(e=e||{}).locale&&(n=e.locale),"translations"in e&&(c=e.translations||{}),e.generateId&&(u=e.generateId),"missingReplacement"in e&&(d=e.missingReplacement),e.missingTranslation&&(h=e.missingTranslation),e.formats&&(e.formats.number&&l(t.number,e.formats.number),e.formats.date&&l(t.date,e.formats.date),e.formats.time&&l(t.time,e.formats.time)),e.types&&((p=e.types)[f]=g),{locale:n,translations:c,generateId:u,missingReplacement:d,missingTranslation:h,formats:t,types:p}},m.number=function(e,r,i){var s=r&&t.number[r]||t.parseNumberPattern(r)||t.number.default;return new Intl.NumberFormat(i||n,s).format(e)},m.date=function(e,r,i){var s=r&&t.date[r]||t.parseDatePattern(r)||t.date.default;return new Intl.DateTimeFormat(i||n,s).format(e)},m.time=function(e,r,i){var s=r&&t.time[r]||t.parseDatePattern(r)||t.time.default;return new Intl.DateTimeFormat(i||n,s).format(e)},m.select=function(e,t){return t[e]||t.other},m.custom=function(e,t,n,r){return e[1]in p?p[e[1]](e,t)(n,r):n},m.plural=b.bind(null,"cardinal"),m.selectordinal=b.bind(null,"ordinal"),m.namespace=e,m}()},function(e,t,n){const r=n(1);class i{static withoutTrailingDigits(e){let t=e.length-1;for(;t>=0&&"0123456789".indexOf(e.charAt(t))>-1;)t--;return e.slice(0,t+1)}static unusedName(e,t){if(t.indexOf(e)<0)return e;e=i.withoutTrailingDigits(e);let n=2;for(;t.indexOf(e+n)>=0;)n++;return e+n}static splitFirst(e,t){const n=e.indexOf(t);return n>=0?[e.substring(0,n),e.substring(n+1)]:[e,null]}static stringify(e){return JSON.stringify(e,((e,t)=>"number"!=typeof t||t!==1/0&&t!==-1/0&&!isNaN(t)?t:0))}static replaceUnsafeChars(e){if("string"!=typeof e){if(!Array.isArray(e))return r.error("Unexpected input recieved in replaceUnsafeChars"),e;e=String(e)}return e.replace(/[<>&'"]/g,(e=>{switch(e){case"<":return"lt";case">":return"gt";case"&":return"amp";case"'":return"apos";case'"':return"quot"}}))}}e.exports=i},function(e,t){const n="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";e.exports=function(){const e=n.length,t=[];for(let r=0;r<20;r++)t[r]=n.charAt(Math.random()*e);return t.join("")}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){const r=n(8),i=n(32);class s{constructor(e,t,n,i){switch(this.id=e||r(),this.name=t,this.type=n,this.isCloud=i,this.type){case s.SCALAR_TYPE:this.value=0;break;case s.LIST_TYPE:this.value=[];break;case s.BROADCAST_MESSAGE_TYPE:this.value=this.name;break;default:throw new Error("Invalid variable type: ".concat(this.type))}}toXML(e){return e=!0===e,'').concat(i(this.name),"")}static get SCALAR_TYPE(){return""}static get LIST_TYPE(){return"list"}static get BROADCAST_MESSAGE_TYPE(){return"broadcast_msg"}}e.exports=s},function(e,t,n){var r;"undefined"!=typeof self&&self,r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t,n){"use strict";t.__esModule=!0,t.copyExistingProperties=function(e,t){Object.keys(t).forEach((function(n){t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&(t[n]=e[n])}))},t.copyNamedProperties=function(e,t,n){e.forEach((function(e){var r=t[e];void 0!==r&&(n[e]=r)}))},t.isBuffer=function(e,t){return o||(o=e.createBuffer()),t instanceof o.constructor},t.isRenderbuffer=function(e,t){return a||(a=e.createRenderbuffer()),t instanceof a.constructor},t.isShader=function(e,t){return l||(l=e.createShader(e.VERTEX_SHADER)),t instanceof l.constructor},t.isTexture=function(e,t){return c||(c=e.createTexture()),t instanceof c.constructor},t.isSampler=function(e,t){if(!u){if(!e.createSampler)return!1;u=e.createSampler()}return t instanceof u.constructor},t.warn=t.error=void 0;var r,i=(r=n(2))&&r.__esModule?r:{default:r},s=i.default.console&&i.default.console.error&&"function"==typeof i.default.console.error?i.default.console.error.bind(i.default.console):function(){};t.error=s;var o,a,l,c,u,d=i.default.console&&i.default.console.warn&&"function"==typeof i.default.console.warn?i.default.console.warn.bind(i.default.console):function(){};t.warn=d},function(e,t,n){"use strict";t.__esModule=!0,t.getGLTypeForTypedArray=function(e){if(e instanceof Int8Array)return s;if(e instanceof Uint8Array)return o;if(e instanceof Uint8ClampedArray)return o;if(e instanceof Int16Array)return a;if(e instanceof Uint16Array)return l;if(e instanceof Int32Array)return c;if(e instanceof Uint32Array)return u;if(e instanceof Float32Array)return d;throw"unsupported typed array type"},t.getGLTypeForTypedArrayType=function(e){if(e===Int8Array)return s;if(e===Uint8Array)return o;if(e===Uint8ClampedArray)return o;if(e===Int16Array)return a;if(e===Uint16Array)return l;if(e===Int32Array)return c;if(e===Uint32Array)return u;if(e===Float32Array)return d;throw"unsupported typed array type"},t.getTypedArrayTypeForGLType=function(e){var t=h[e];if(!t)throw"unknown gl type";return t},t.isArrayBuffer=void 0;var r,i=(r=n(2))&&r.__esModule?r:{default:r},s=5120,o=5121,a=5122,l=5123,c=5124,u=5125,d=5126,h={},p=h;p[s]=Int8Array,p[o]=Uint8Array,p[a]=Int16Array,p[l]=Uint16Array,p[c]=Int32Array,p[u]=Uint32Array,p[d]=Float32Array,p[32819]=Uint16Array,p[32820]=Uint16Array,p[33635]=Uint16Array,p[5131]=Uint16Array,p[33640]=Uint32Array,p[35899]=Uint32Array,p[35902]=Uint32Array,p[36269]=Uint32Array,p[34042]=Uint32Array;var m=i.default.SharedArrayBuffer?function(e){return e&&e.buffer&&(e.buffer instanceof ArrayBuffer||e.buffer instanceof i.default.SharedArrayBuffer)}:function(e){return e&&e.buffer&&e.buffer instanceof ArrayBuffer};t.isArrayBuffer=m},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};t.default=r},function(e,t,n){"use strict";t.__esModule=!0,t.add=function(e,t,n){return(n=n||new r(3))[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n},t.copy=function(e,t){return(t=t||new r(3))[0]=e[0],t[1]=e[1],t[2]=e[2],t},t.create=function(e,t,n){var i=new r(3);return e&&(i[0]=e),t&&(i[1]=t),n&&(i[2]=n),i},t.cross=function(e,t,n){n=n||new r(3);var i=e[2]*t[0]-e[0]*t[2],s=e[0]*t[1]-e[1]*t[0];return n[0]=e[1]*t[2]-e[2]*t[1],n[1]=i,n[2]=s,n},t.distance=function(e,t){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)},t.distanceSq=function(e,t){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i},t.divide=function(e,t,n){return(n=n||new r(3))[0]=e[0]/t[0],n[1]=e[1]/t[1],n[2]=e[2]/t[2],n},t.divScalar=function(e,t,n){return(n=n||new r(3))[0]=e[0]/t,n[1]=e[1]/t,n[2]=e[2]/t,n},t.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},t.lerp=function(e,t,n,i){return(i=i||new r(3))[0]=(1-n)*e[0]+n*t[0],i[1]=(1-n)*e[1]+n*t[1],i[2]=(1-n)*e[2]+n*t[2],i},t.length=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])},t.lengthSq=function(e){return e[0]*e[0]+e[1]*e[1]+e[2]*e[2]},t.mulScalar=function(e,t,n){return(n=n||new r(3))[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n},t.multiply=function(e,t,n){return(n=n||new r(3))[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n},t.negate=function(e,t){return(t=t||new r(3))[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},t.normalize=function(e,t){t=t||new r(3);var n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=Math.sqrt(n);return i>1e-5?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=0,t[1]=0,t[2]=0),t},t.setDefaultType=function(e){var t=r;return r=e,t},t.subtract=function(e,t,n){return(n=n||new r(3))[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n};var r=Float32Array},function(e,t,n){"use strict";t.__esModule=!0,t.isWebGL1=function(e){return!e.texStorage2D},t.isWebGL2=function(e){return!!e.texStorage2D},t.glEnumToString=void 0;var r,i,s=(r={},i={},function(e,t){return function(e){var t=e.constructor.name;if(!r[t]){for(var n in e)if("number"==typeof e[n]){var s=i[e[n]];i[e[n]]=s?"".concat(s," | ").concat(n):n}r[t]=!0}}(e),i[t]||"0x"+t.toString(16)});t.glEnumToString=s},function(e,t,n){"use strict";t.__esModule=!0,t.createAttributeSetters=H,t.createProgram=L,t.createProgramFromScripts=function(e,t,n,r,i){for(var s=N(n,r,i),o=[],a=0;a=0?I.FRAGMENT_SHADER:e.indexOf("vert")>=0?I.VERTEX_SHADER:void 0}function P(e,t){t.forEach((function(t){e.deleteShader(t)}))}function L(e,t,n,r,i){for(var o=N(n,r,i),a=[],l=[],c=0;c1&&"[0]"===r.name.substr(-3),a=r.type,l=f[a];if(!l)throw"unknown type: 0x"+a.toString(16);if(l.bindPoint){var c=n;n+=r.size,i=o?l.arraySetter(e,a,c,s,r.size):l.setter(e,a,c,s,r.size)}else i=l.arraySetter&&o?l.arraySetter(e,s):l.setter(e,s);return i.location=s,i}for(var i={},s=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),o=0;o0)throw"numComponents "+s+" not correct for length "+i;return o}(t),n},t.createBufferFromArray=b,t.createBufferFromTypedArray=l,t.createBufferInfoFromArrays=function(e,t){var n={attribs:g(e,t)},i=t.indices;if(i){var s=f(i,"indices");n.indices=l(e,s,e.ELEMENT_ARRAY_BUFFER),n.numElements=s.length,n.elementType=r.getGLTypeForTypedArray(s)}else n.numElements=function(e,t){var n,r;for(r=0;r0)throw"Can not guess numComponents for attribute '"+e+"'. Tried "+n+" but "+t+" values is not evenly divisible by "+n+". You should specify it.";return n}function m(e,t){return e.numComponents||e.size||p(t,u(e).length)}function f(e,t){if(r.isArrayBuffer(e))return e;if(r.isArrayBuffer(e.data))return e.data;Array.isArray(e)&&(e={data:e});var n=e.type;return n||(n=c(t)?Uint16Array:Float32Array),new n(e.data)}function g(e,t){var n={};return Object.keys(t).forEach((function(i){if(!c(i)){var s,a,u,d,h,g=t[i],y=g.attrib||g.name||g.attribName||o.attribPrefix+i;if("number"==typeof g||"number"==typeof g.data){h=g.data||g;var b=g.type||Float32Array,v=h*b.BYTES_PER_ELEMENT;a=r.getGLTypeForTypedArrayType(b),u=void 0!==g.normalize?g.normalize:(w=b)===Int8Array||w===Uint8Array,d=g.numComponents||g.size||p(i,h),s=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,v,g.drawType||e.STATIC_DRAW)}else{var S=f(g,i);s=l(e,S,void 0,g.drawType),a=r.getGLTypeForTypedArray(S),u=void 0!==g.normalize?g.normalize:function(e){return e instanceof Int8Array||e instanceof Uint8Array}(S),d=m(g,i),h=S.length}n[y]={buffer:s,numComponents:d,type:a,normalize:u,stride:g.stride||0,offset:g.offset||0,divisor:void 0===g.divisor?void 0:g.divisor,drawType:g.drawType}}var w})),e.bindBuffer(e.ARRAY_BUFFER,null),n}var y=["position","positions","a_position"];function b(e,t,n){var r="indices"===n?e.ELEMENT_ARRAY_BUFFER:e.ARRAY_BUFFER;return l(e,f(t,n),r)}},function(e,t,n){"use strict";t.__esModule=!0,t.setTextureDefaults_=function(e){o.copyExistingProperties(e,c),e.textureColor&&q(e.textureColor)},t.createSampler=$,t.createSamplers=function(e,t){var n={};return Object.keys(t).forEach((function(r){n[r]=$(e,t[r])})),n},t.setSamplerParameters=J,t.createTexture=me,t.setEmptyTexture=pe,t.setTextureFromArray=he,t.loadTextureFromUrl=ce,t.setTextureFromElement=ie,t.setTextureFilteringForSize=ee,t.setTextureParameters=Z,t.setDefaultTextureColor=q,t.createTextures=function(e,t,n){n=n||se;var r=0,i=[],s={},o={};function a(){0===r&&setTimeout((function(){n(i.length?i:void 0,s,o)}),0)}return Object.keys(t).forEach((function(n){var l,c,u=t[n];("string"==typeof(c=u.src)||Array.isArray(c)&&"string"==typeof c[0])&&(l=function(e,t,s){o[n]=s,--r,e&&i.push(e),a()},++r),s[n]=me(e,u,l)})),a(),s},t.resizeTexture=function(e,t,n,r,i){r=r||n.width,i=i||n.height;var s=n.target||e.TEXTURE_2D;e.bindTexture(s,t);var o,a=n.level||0,l=n.internalFormat||n.format||e.RGBA,c=F(l),d=n.format||c.format,h=n.src;if(o=h&&(u(h)||Array.isArray(h)&&"number"==typeof h[0])?n.type||V(e,h,c.type):n.type||c.type,s===e.TEXTURE_CUBE_MAP)for(var p=0;p<6;++p)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+p,a,l,r,i,0,d,o,null);else e.texImage2D(s,a,l,r,i,0,d,o,null)},t.getNumComponentsForFormat=function(e){var t=L[e];if(!t)throw"unknown format: "+e;return t.numColorComponents},t.getBytesPerElementForInternalFormat=j;var r,i=l(n(4)),s=l(n(1)),o=l(n(0)),a=(r=n(2))&&r.__esModule?r:{default:r};function l(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}var c={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},u=s.isArrayBuffer,d=a.default.document&&a.default.document.createElement?a.default.document.createElement("canvas").getContext("2d"):null,h=6406,p=6407,m=6408,f=6409,g=6410,y=6402,b=34041,v=5120,S=5121,w=5122,k=5123,x=5124,T=5125,E=5126,A=5131,C=36193,I=33640,O=33319,M=33320,N=6403,R=36244,D=36248,P=36249,L={},B=L;B[6406]={numColorComponents:1},B[6409]={numColorComponents:1},B[6410]={numColorComponents:2},B[p]={numColorComponents:3},B[m]={numColorComponents:4},B[N]={numColorComponents:1},B[36244]={numColorComponents:1},B[O]={numColorComponents:2},B[33320]={numColorComponents:2},B[p]={numColorComponents:3},B[36248]={numColorComponents:3},B[m]={numColorComponents:4},B[36249]={numColorComponents:4},B[6402]={numColorComponents:1},B[34041]={numColorComponents:2};var z={},U=z;function j(e,t){var n=z[e];if(!n)throw"unknown internal format";var r=n.bytesPerElementMap[t];if(void 0===r)throw"unknown internal format";return r}function F(e){var t=z[e];if(!t)throw"unknown internal format";return{format:t.textureFormat,type:Array.isArray(t.type)?t.type[0]:t.type}}function W(e){return!(e&e-1)}function V(e,t,n){return u(t)?s.getGLTypeForTypedArray(t):n||e.UNSIGNED_BYTE}function G(e,t,n,r,i){if(i%1!=0)throw"can't guess dimensions";if(n||r){if(r){if(!n&&(n=i/r)%1)throw"can't guess dimensions"}else if((r=i/n)%1)throw"can't guess dimensions"}else{var s=Math.sqrt(i/(t===e.TEXTURE_CUBE_MAP?6:1));s%1==0?(n=s,r=s):(n=i,r=1)}return{width:n,height:r}}function q(e){c.textureColor=new Uint8Array([255*e[0],255*e[1],255*e[2],255*e[3]])}U[6406]={textureFormat:h,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[S,A,C,E]},U[6409]={textureFormat:f,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[S,A,C,E]},U[6410]={textureFormat:g,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[S,A,C,E]},U[p]={textureFormat:p,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[S,A,C,E,33635]},U[m]={textureFormat:m,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[S,A,C,E,32819,32820]},U[33321]={textureFormat:N,colorRenderable:!0,textureFilterable:!0,bytesPerElement:1,type:S},U[36756]={textureFormat:N,colorRenderable:!1,textureFilterable:!0,bytesPerElement:1,type:v},U[33325]={textureFormat:N,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[E,A]},U[33326]={textureFormat:N,colorRenderable:!1,textureFilterable:!1,bytesPerElement:4,type:E},U[33330]={textureFormat:R,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:S},U[33329]={textureFormat:R,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:v},U[33332]={textureFormat:R,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:k},U[33331]={textureFormat:R,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:w},U[33334]={textureFormat:R,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:T},U[33333]={textureFormat:R,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:x},U[33323]={textureFormat:O,colorRenderable:!0,textureFilterable:!0,bytesPerElement:2,type:S},U[36757]={textureFormat:O,colorRenderable:!1,textureFilterable:!0,bytesPerElement:2,type:v},U[33327]={textureFormat:O,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[E,A]},U[33328]={textureFormat:O,colorRenderable:!1,textureFilterable:!1,bytesPerElement:8,type:E},U[33336]={textureFormat:M,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:S},U[33335]={textureFormat:M,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:v},U[33338]={textureFormat:M,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:k},U[33337]={textureFormat:M,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:w},U[33340]={textureFormat:M,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:T},U[33339]={textureFormat:M,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:x},U[32849]={textureFormat:p,colorRenderable:!0,textureFilterable:!0,bytesPerElement:3,type:S},U[35905]={textureFormat:p,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:S},U[36194]={textureFormat:p,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[S,33635]},U[36758]={textureFormat:p,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:v},U[35898]={textureFormat:p,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[E,A,35899]},U[35901]={textureFormat:p,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[E,A,35902]},U[34843]={textureFormat:p,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[E,A]},U[34837]={textureFormat:p,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:E},U[36221]={textureFormat:D,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:S},U[36239]={textureFormat:D,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:v},U[36215]={textureFormat:D,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:k},U[36233]={textureFormat:D,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:w},U[36209]={textureFormat:D,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:T},U[36227]={textureFormat:D,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:x},U[32856]={textureFormat:m,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:S},U[35907]={textureFormat:m,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:S},U[36759]={textureFormat:m,colorRenderable:!1,textureFilterable:!0,bytesPerElement:4,type:v},U[32855]={textureFormat:m,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[S,32820,I]},U[32854]={textureFormat:m,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[S,32819]},U[32857]={textureFormat:m,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:I},U[34842]={textureFormat:m,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[E,A]},U[34836]={textureFormat:m,colorRenderable:!1,textureFilterable:!1,bytesPerElement:16,type:E},U[36220]={textureFormat:P,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:S},U[36238]={textureFormat:P,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:v},U[36975]={textureFormat:P,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:I},U[36214]={textureFormat:P,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:k},U[36232]={textureFormat:P,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:w},U[36226]={textureFormat:P,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:x},U[36208]={textureFormat:P,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:T},U[33189]={textureFormat:y,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[k,T]},U[33190]={textureFormat:y,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:T},U[36012]={textureFormat:y,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:E},U[35056]={textureFormat:b,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:34042},U[36013]={textureFormat:b,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:36269},Object.keys(U).forEach((function(e){var t=U[e];if(t.bytesPerElementMap={},Array.isArray(t.bytesPerElement))t.bytesPerElement.forEach((function(e,n){var r=t.type[n];t.bytesPerElementMap[r]=e}));else{var n=t.type;t.bytesPerElementMap[n]=t.bytesPerElement}}));var Y={};function H(e,t){void 0!==t.colorspaceConversion&&(Y.colorspaceConversion=e.getParameter(e.UNPACK_COLORSPACE_CONVERSION_WEBGL),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.colorspaceConversion)),void 0!==t.premultiplyAlpha&&(Y.premultiplyAlpha=e.getParameter(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha)),void 0!==t.flipY&&(Y.flipY=e.getParameter(e.UNPACK_FLIP_Y_WEBGL),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY))}function _(e,t){void 0!==t.colorspaceConversion&&e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,Y.colorspaceConversion),void 0!==t.premultiplyAlpha&&e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Y.premultiplyAlpha),void 0!==t.flipY&&e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,Y.flipY)}function K(e){Y.unpackAlignment=e.getParameter(e.UNPACK_ALIGNMENT),i.isWebGL2(e)&&(Y.unpackRowLength=e.getParameter(e.UNPACK_ROW_LENGTH),Y.unpackImageHeight=e.getParameter(e.UNPACK_IMAGE_HEIGHT),Y.unpackSkipPixels=e.getParameter(e.UNPACK_SKIP_PIXELS),Y.unpackSkipRows=e.getParameter(e.UNPACK_SKIP_ROWS),Y.unpackSkipImages=e.getParameter(e.UNPACK_SKIP_IMAGES))}function Q(e){e.pixelStorei(e.UNPACK_ALIGNMENT,Y.unpackAlignment),i.isWebGL2(e)&&(e.pixelStorei(e.UNPACK_ROW_LENGTH,Y.unpackRowLength),e.pixelStorei(e.UNPACK_IMAGE_HEIGHT,Y.unpackImageHeight),e.pixelStorei(e.UNPACK_SKIP_PIXELS,Y.unpackSkipPixels),e.pixelStorei(e.UNPACK_SKIP_ROWS,Y.unpackSkipRows),e.pixelStorei(e.UNPACK_SKIP_IMAGES,Y.unpackSkipImages))}function X(e,t,n,r){r.minMag&&(n.call(e,t,e.TEXTURE_MIN_FILTER,r.minMag),n.call(e,t,e.TEXTURE_MAG_FILTER,r.minMag)),r.min&&n.call(e,t,e.TEXTURE_MIN_FILTER,r.min),r.mag&&n.call(e,t,e.TEXTURE_MAG_FILTER,r.mag),r.wrap&&(n.call(e,t,e.TEXTURE_WRAP_S,r.wrap),n.call(e,t,e.TEXTURE_WRAP_T,r.wrap),(t===e.TEXTURE_3D||o.isSampler(e,t))&&n.call(e,t,e.TEXTURE_WRAP_R,r.wrap)),r.wrapR&&n.call(e,t,e.TEXTURE_WRAP_R,r.wrapR),r.wrapS&&n.call(e,t,e.TEXTURE_WRAP_S,r.wrapS),r.wrapT&&n.call(e,t,e.TEXTURE_WRAP_T,r.wrapT),r.minLod&&n.call(e,t,e.TEXTURE_MIN_LOD,r.minLod),r.maxLod&&n.call(e,t,e.TEXTURE_MAX_LOD,r.maxLod),r.baseLevel&&n.call(e,t,e.TEXTURE_BASE_LEVEL,r.baseLevel),r.maxLevel&&n.call(e,t,e.TEXTURE_MAX_LEVEL,r.maxLevel)}function Z(e,t,n){var r=n.target||e.TEXTURE_2D;e.bindTexture(r,t),X(e,r,e.texParameteri,n)}function J(e,t,n){X(e,t,e.samplerParameteri,n)}function $(e,t){var n=e.createSampler();return J(e,n,t),n}function ee(e,t,n,r,s,o,a){n=n||c.textureOptions,o=o||e.RGBA,a=a||e.UNSIGNED_BYTE;var l=n.target||e.TEXTURE_2D;if(r=r||n.width,s=s||n.height,e.bindTexture(l,t),function(e,t,n,r){if(!i.isWebGL2(e))return W(t)&&W(n);var s=z[r];if(!s)throw"unknown internal format";return s.colorRenderable&&s.textureFilterable}(e,r,s,o))e.generateMipmap(l);else{var u=function(e){var t=z[e];if(!t)throw"unknown internal format";return t.textureFilterable}(o)?e.LINEAR:e.NEAREST;e.texParameteri(l,e.TEXTURE_MIN_FILTER,u),e.texParameteri(l,e.TEXTURE_MAG_FILTER,u),e.texParameteri(l,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(l,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}}function te(e){return!0===e.auto||void 0===e.auto&&void 0===e.level}function ne(e,t){return(t=t||{}).cubeFaceOrder||[e.TEXTURE_CUBE_MAP_POSITIVE_X,e.TEXTURE_CUBE_MAP_NEGATIVE_X,e.TEXTURE_CUBE_MAP_POSITIVE_Y,e.TEXTURE_CUBE_MAP_NEGATIVE_Y,e.TEXTURE_CUBE_MAP_POSITIVE_Z,e.TEXTURE_CUBE_MAP_NEGATIVE_Z]}function re(e,t){var n=ne(e,t).map((function(e,t){return{face:e,ndx:t}}));return n.sort((function(e,t){return e.face-t.face})),n}function ie(e,t,n,r){var i=(r=r||c.textureOptions).target||e.TEXTURE_2D,s=r.level||0,o=n.width,l=n.height,u=r.internalFormat||r.format||e.RGBA,h=F(u),p=r.format||h.format,m=r.type||h.type;if(H(e,r),e.bindTexture(i,t),i===e.TEXTURE_CUBE_MAP){var f,g,y=n.width,b=n.height;if(y/6===b)f=b,g=[0,0,1,0,2,0,3,0,4,0,5,0];else if(b/6===y)f=y,g=[0,0,0,1,0,2,0,3,0,4,0,5];else if(y/3==b/2)f=y/3,g=[0,0,1,0,2,0,0,1,1,1,2,1];else{if(y/2!=b/3)throw"can't figure out cube map from element: "+(n.src?n.src:n.nodeName);f=y/2,g=[0,0,1,0,0,1,1,1,0,2,1,2]}d?(d.canvas.width=f,d.canvas.height=f,o=f,l=f,re(e,r).forEach((function(t){var r=g[2*t.ndx+0]*f,i=g[2*t.ndx+1]*f;d.drawImage(n,r,i,f,f,0,0,f,f),e.texImage2D(t.face,s,u,p,m,d.canvas)})),d.canvas.width=1,d.canvas.height=1):a.default.createImageBitmap&&(o=f,l=f,re(e,r).forEach((function(c){var d=g[2*c.ndx+0]*f,h=g[2*c.ndx+1]*f;e.texImage2D(c.face,s,u,f,f,0,p,m,null),a.default.createImageBitmap(n,d,h,f,f,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then((function(n){H(e,r),e.bindTexture(i,t),e.texImage2D(c.face,s,u,p,m,n),_(e,r),te(r)&&ee(e,t,r,o,l,u,m)}))})))}else if(i===e.TEXTURE_3D||i===e.TEXTURE_2D_ARRAY){var v=Math.min(n.width,n.height),S=Math.max(n.width,n.height),w=S/v;if(w%1!=0)throw"can not compute 3D dimensions of element";var k=n.width===S?1:0,x=n.height===S?1:0;K(e),e.pixelStorei(e.UNPACK_ALIGNMENT,1),e.pixelStorei(e.UNPACK_ROW_LENGTH,n.width),e.pixelStorei(e.UNPACK_IMAGE_HEIGHT,0),e.pixelStorei(e.UNPACK_SKIP_IMAGES,0),e.texImage3D(i,s,u,v,v,v,0,p,m,null);for(var T=0;T=0?b(r,t):n.indexOf("tan")>=0||n.indexOf("binorm")>=0?g(r,t):n.indexOf("norm")>=0&&y(r,t)})),e}function S(e,t,n){return e=e||2,{position:{numComponents:2,data:[(t=t||0)+-1*(e*=.5),(n=n||0)+-1*e,t+1*e,n+-1*e,t+-1*e,n+1*e,t+1*e,n+1*e]},normal:[0,0,1,0,0,1,0,0,1,0,0,1],texcoord:[0,0,1,0,0,1,1,1],indices:[0,1,2,2,1,3]}}function w(e,t,n,r,i){e=e||1,t=t||1,n=n||1,r=r||1,i=i||o.identity();for(var s=(n+1)*(r+1),a=h(3,s),l=h(3,s),c=h(2,s),u=0;u<=r;u++)for(var d=0;d<=n;d++){var p=d/n,m=u/r;a.push(e*p-.5*e,0,t*m-.5*t),l.push(0,1,0),c.push(p,m)}for(var f=n+1,g=h(3,n*r*2,Uint16Array),y=0;y 0");r=r||0,s=s||0;for(var a=(i=i||Math.PI)-r,l=(o=o||2*Math.PI)-s,c=(t+1)*(n+1),u=h(3,c),d=h(3,c),p=h(2,c),m=0;m<=n;m++)for(var f=0;f<=t;f++){var g=f/t,y=m/n,b=l*g,v=a*y,S=Math.sin(b),w=Math.cos(b),k=Math.sin(v),x=w*k,T=Math.cos(v),E=S*k;u.push(e*x,e*T,e*E),d.push(x,T,E),p.push(1-g,y)}for(var A=t+1,C=h(3,t*n*2,Uint16Array),I=0;Ii?(x=n,k=1,T=t):T=e+w/i*(t-e),-2!==w&&w!==i+2||(T=0,k=0),x-=n/2;for(var E=0;Ei?0:A*b,w<0?-1:w>i?1:v,w<0||w>i?0:C*b),m.push(E/r,1-k)}}for(var I=0;I 0");var l=(o=o||1)-(s=s||0),c=2*(i+1)*4,u=h(3,c),d=h(3,c),p=h(2,c);function m(e,t,n){return e+(t-e)*n}function f(t,n,o,c,h,f){for(var g=0;g<=i;g++){var y=n/1,b=g/i,v=2*(y-.5),S=(s+b*l)*Math.PI,w=Math.sin(S),k=Math.cos(S),x=m(e,t,w),T=v*r,E=k*e,A=w*x;u.push(T,E,A);var C=a.add(a.multiply([0,w,k],o),c);d.push(C),p.push(y*h+f,b)}}for(var g=0;g<2;g++){var y=2*(g/1-.5);f(t,g,[1,1,1],[0,0,0],1,0),f(t,g,[0,0,0],[y,0,0],0,0),f(n,g,[1,1,1],[0,0,0],1,0),f(n,g,[0,0,0],[y,0,0],0,1)}var b=h(3,2*i*4,Uint16Array);function v(e,t){for(var n=0;n0&&g!==t){var S=u+(g+1),w=u+g,k=u+g-p,x=u+(g+1)-p;c.push(S,w,k),c.push(S,k,x)}}u+=t+1}return{position:o,normal:a,texcoord:l,indices:c}}function R(e){return function(t){var n=e.apply(this,Array.prototype.slice.call(arguments,1));return r.createBuffersFromArrays(t,n)}}function D(e){return function(t){var n=e.apply(null,Array.prototype.slice.call(arguments,1));return r.createBufferInfoFromArrays(t,n)}}var P=["numComponents","size","type","normalize","stride","offset","attrib","name","attribName"];function L(e,t,n,r){r=r||0;for(var i=e.length,s=0;s0&&void 0!==arguments[0]?arguments[0]:n.nowObj;this.startTime=0,this.nowObj=e}static get USE_PERFORMANCE(){return!1}static get legacyDateCode(){return{now:function(){return(new Date).getTime()}}}static get nowObj(){return n.USE_PERFORMANCE&&"undefined"!=typeof self&&self.performance&&"now"in self.performance?self.performance:Date.now?Date:n.legacyDateCode}time(){return this.nowObj.now()}start(){this.startTime=this.nowObj.now()}timeElapsed(){return this.nowObj.now()-this.startTime}setTimeout(e,n){return t.setTimeout(e,n)}clearTimeout(e){t.clearTimeout(e)}}e.exports=n}).call(this,n(9))},function(e,t,n){function r(){}n(260).mixin(r),r.prototype.write=function(e,t,n){this.emit("item",e,t,n)},r.prototype.end=function(){this.emit("end"),this.removeAllListeners()},r.prototype.pipe=function(e){var t=this;function n(){e.write.apply(e,Array.prototype.slice.call(arguments))}function r(){!e._isStdio&&e.end()}return t.emit("unpipe",e),e.emit("pipe",t),t.on("item",n),t.on("end",r),t.when("unpipe",(function(i){var s=i===e||void 0===i;return s&&(t.removeListener("item",n),t.removeListener("end",r),e.emit("unpipe")),s})),e},r.prototype.unpipe=function(e){return this.emit("unpipe",e),this},r.prototype.format=function(e){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},r.mixin=function(e){var t,n=r.prototype;for(t in n)n.hasOwnProperty(t)&&(e.prototype[t]=n[t])},e.exports=r},function(e,t,n){const r=n(136),i=n(138);class s{static base64ToUint8Array(e){const t=r(e),n=t.length,i=new Uint8Array(n);for(let e=0;e1&&(r+=t);const i=n.inputs[r];return void 0===i?null:i.block}getOpcode(e){return void 0===e?null:e.opcode}getFields(e){return void 0===e?null:e.fields}getInputs(e){if(void 0===e)return null;let t=this._cache.inputs[e.id];if(void 0!==t)return t;t={};for(const n in e.inputs)n.substring(0,m.BRANCH_INPUT_PREFIX.length)!==m.BRANCH_INPUT_PREFIX&&(t[n]=e.inputs[n]);return this._cache.inputs[e.id]=t,t}getMutation(e){return void 0===e?null:e.mutation}getTopLevelScript(e){let t=this._blocks[e];if(void 0===t)return null;for(;null!==t.parent;)t=this._blocks[t.parent];return t.id}getProcedureDefinition(e){const t=this._cache.procedureDefinitions[e];if(void 0!==t)return t;for(const t in this._blocks){if(!Object.prototype.hasOwnProperty.call(this._blocks,t))continue;const n=this._blocks[t];if("procedures_definition"===n.opcode){const r=this._getCustomBlockInternal(n);if(r&&r.mutation.proccode===e)return this._cache.procedureDefinitions[e]=t,t}}return this._cache.procedureDefinitions[e]=null,null}getProcedureParamNamesAndIds(e){return this.getProcedureParamNamesIdsAndDefaults(e).slice(0,2)}getProcedureParamNamesIdsAndDefaults(e){const t=this._cache.procedureParamNames[e];if(void 0!==t)return t;for(const t in this._blocks){if(!Object.prototype.hasOwnProperty.call(this._blocks,t))continue;const n=this._blocks[t];if("procedures_prototype"===n.opcode&&n.mutation.proccode===e){const t=JSON.parse(n.mutation.argumentnames),r=JSON.parse(n.mutation.argumentids),i=JSON.parse(n.mutation.argumentdefaults);return this._cache.procedureParamNames[e]=[t,r,i],this._cache.procedureParamNames[e]}}const n=this.runtime.getAddonBlock(e);return n?(this._cache.procedureParamNames[e]=n.namesIdsDefaults,n.namesIdsDefaults):(this._cache.procedureParamNames[e]=null,null)}populateProcedureCache(){if(!this._cache.proceduresPopulated){for(const e in this._blocks){if(!Object.prototype.hasOwnProperty.call(this._blocks,e))continue;const t=this._blocks[e];if("procedures_prototype"!==t.opcode){if("procedures_definition"===t.opcode){const n=this._getCustomBlockInternal(t);if(n){const t=n.mutation.proccode;this._cache.procedureDefinitions[t]||(this._cache.procedureDefinitions[t]=e);continue}}}else{const e=t.mutation.proccode;if(!this._cache.procedureParamNames[e]){const n=JSON.parse(t.mutation.argumentnames),r=JSON.parse(t.mutation.argumentids),i=JSON.parse(t.mutation.argumentdefaults);this._cache.procedureParamNames[e]=[n,r,i]}}}this._cache.proceduresPopulated=!0}}duplicate(){const e=new m(this.runtime,this.forceNoGlow);return e._blocks=a.simple(this._blocks),e._scripts=a.simple(this._scripts),e}blocklyListen(e){if("object"!=typeof e)return;if("string"!=typeof e.blockId&&"string"!=typeof e.varId&&"string"!=typeof e.commentId)return;const t=this.runtime.getTargetForStage(),n=this.runtime.getEditingTarget();if("stackclick"!==e.element)switch(e.type){case"create":{const t=r(e);for(let e=0;ee.isOriginal));for(const t of n)if(t.lookupVariableByNameAndType(e.varName,e.varType,!0))return;t.createVariable(e.varId,e.varName,e.varType,e.isCloud),this.emitProjectChanged()}break;case"var_rename":if(n&&Object.prototype.hasOwnProperty.call(n.variables,e.varId))n.renameVariable(e.varId,e.newName),n.blocks.updateBlocksAfterVarRename(e.varId,e.newName);else{t.renameVariable(e.varId,e.newName);const n=this.runtime.targets;for(let t=0;t0&&"data_variable"!==t.opcode&&"data_listcontents"!==t.opcode){const e=p(t.id,t.fields);let n=this.runtime.monitorBlocks.getBlock(e);n||(n=JSON.parse(JSON.stringify(t)),n.id=e,this.runtime.monitorBlocks.createBlock(n)),t=n}const n=t.isMonitored;t.isMonitored=e.value;let r=!1;"data_variable"===t.opcode?r=!this.runtime.getTargetForStage().variables[t.fields.VARIABLE.id]:"data_listcontents"===t.opcode&&(r=!this.runtime.getTargetForStage().variables[t.fields.LIST.id]);const i=r||Object.prototype.hasOwnProperty.call(this.runtime.monitorBlockInfo,t.opcode)&&this.runtime.monitorBlockInfo[t.opcode].isSpriteSpecific;t.targetId=i?t.targetId||this.runtime.getEditingTarget().id:null,n&&!t.isMonitored?this.runtime.requestHideMonitor(t.id):!n&&t.isMonitored&&(this.runtime.requestShowMonitor(t.id)||this.runtime.requestAddMonitor(o({id:t.id,targetId:t.targetId,spriteName:t.targetId?this.runtime.getTargetById(t.targetId).getName():null,opcode:t.opcode,params:this._getBlockParams(t),value:"",mode:"data_listcontents"===t.opcode?"list":"default"})));break}}this.emitProjectChanged(),this.resetCache()}}moveBlock(e){if(!Object.prototype.hasOwnProperty.call(this._blocks,e.id))return;const t=this._blocks[e.id];let n=!1;if(e.newCoordinate&&(n=t.x!==e.newCoordinate.x||t.y!==e.newCoordinate.y,t.x=e.newCoordinate.x,t.y=e.newCoordinate.y),void 0!==e.oldParent){const t=this._blocks[e.oldParent];void 0!==e.oldInput&&t.inputs[e.oldInput].block===e.id?t.inputs[e.oldInput].block=null:t.next===e.id&&(t.next=null),this._blocks[e.id].parent=null,n=!0}if(void 0===e.newParent)this._addScript(e.id);else{if(this._deleteScript(e.id),void 0===e.newInput)this._blocks[e.newParent].next=e.id;else{let t=null;Object.prototype.hasOwnProperty.call(this._blocks[e.newParent].inputs,e.newInput)&&(t=this._blocks[e.newParent].inputs[e.newInput].shadow),this._blocks[e.id].shadow&&(t=e.id),this._blocks[e.newParent].inputs[e.newInput]={name:e.newInput,block:e.id,shadow:t}}this._blocks[e.id].parent=e.newParent,n=!0}this.resetCache(),n&&this.emitProjectChanged()}runAllMonitored(e){null===this._cache._monitored&&(this._cache._monitored=Object.keys(this._blocks).filter((e=>this.getBlock(e).isMonitored)).map((t=>{const n=this.getBlock(t).targetId;return{blockId:t,target:n?e.getTargetById(n):null}})));const t=this._cache._monitored;for(let n=0;nthis.deleteBlock(e)))}getAllVariableAndListReferences(e,t){const n=e||this._blocks,r=Object.create(null);for(const e in n){let i=null,s=null;if(n[e].fields.VARIABLE?(i=n[e].fields.VARIABLE,s=h.SCALAR_TYPE):n[e].fields.LIST?(i=n[e].fields.LIST,s=h.LIST_TYPE):t&&n[e].fields.BROADCAST_OPTION&&(i=n[e].fields.BROADCAST_OPTION,s=h.BROADCAST_MESSAGE_TYPE),i){const e=i.id;r[e]?r[e].push({referencingField:i,type:s}):r[e]=[{referencingField:i,type:s}]}}return r}updateBlocksAfterVarRename(e,t){const n=this._blocks;for(const r in n){let i=null;if(n[r].fields.VARIABLE?i=n[r].fields.VARIABLE:n[r].fields.LIST&&(i=n[r].fields.LIST),i){e===i.id&&(i.value=t)}}}updateTargetSpecificBlocks(e){const t=this._blocks;for(const n in t)e&&"event_whenthisspriteclicked"===t[n].opcode?t[n].opcode="event_whenstageclicked":e||"event_whenstageclicked"!==t[n].opcode||(t[n].opcode="event_whenthisspriteclicked")}updateAssetName(e,t,n){let r;if("costume"===n)r=this._getCostumeField.bind(this);else if("sound"===n)r=this._getSoundField.bind(this);else if("backdrop"===n)r=this._getBackdropField.bind(this);else{if("sprite"!==n)return;r=this._getSpriteField.bind(this)}const i=this._blocks;for(const n in i){const i=r(n);i&&i.value===e&&(i.value=t)}this.resetCache()}updateSensingOfReference(e,t,n){const r=this._blocks;let i=!1;for(const s in r){const o=r[s];if("sensing_of"===o.opcode&&o.fields.PROPERTY.value===e&&o.inputs.OBJECT.block===o.inputs.OBJECT.shadow){this.getBlock(o.inputs.OBJECT.block).fields.OBJECT.value===n&&(o.fields.PROPERTY.value=t,i=!0)}}return i&&this.resetCache(),i}_getCostumeField(e){const t=this.getBlock(e);return t&&Object.prototype.hasOwnProperty.call(t.fields,"COSTUME")?t.fields.COSTUME:null}_getSoundField(e){const t=this.getBlock(e);return t&&Object.prototype.hasOwnProperty.call(t.fields,"SOUND_MENU")?t.fields.SOUND_MENU:null}_getBackdropField(e){const t=this.getBlock(e);return t&&Object.prototype.hasOwnProperty.call(t.fields,"BACKDROP")?t.fields.BACKDROP:null}_getSpriteField(e){const t=this.getBlock(e);if(!t)return null;const n=["TOWARDS","TO","OBJECT","VIDEOONMENU2","DISTANCETOMENU","TOUCHINGOBJECTMENU","CLONE_OPTION"];for(let e=0;ethis.blockToXML(t,e))).join()}blockToXML(e,t){const n=this._blocks[e];if(!n)return;const r=n.shadow?"shadow":"block";let i="<".concat(r,'\n id="').concat(s(n.id),'"\n type="').concat(s(n.opcode),'"\n ').concat(n.topLevel?'x="'.concat(n.x,'" y="').concat(n.y,'"'):"","\n >");const o=n.comment;o&&(t?Object.prototype.hasOwnProperty.call(t,o)?i+=t[o].toXML():d.warn("Could not find comment with id: ".concat(o," in provided comment descriptions.")):d.warn("Cannot serialize comment with id: ".concat(o,"; no comment descriptions provided."))),n.mutation&&(i+=this.mutationToXML(n.mutation));for(const e in n.inputs){if(!Object.prototype.hasOwnProperty.call(n.inputs,e))continue;const r=n.inputs[e];(r.block||r.shadow)&&(i+=''),r.block&&(i+=this.blockToXML(r.block,t)),r.shadow&&r.shadow!==r.block&&(i+=this.blockToXML(r.shadow,t)),i+="")}for(const e in n.fields){if(!Object.prototype.hasOwnProperty.call(n.fields,e))continue;const t=n.fields[e];i+='".concat(a,"")}return n.next&&(i+="".concat(this.blockToXML(n.next,t),"")),i+=""),i}mutationToXML(e){let t="<".concat(e.tagName);for(const n in e){if("children"===n||"tagName"===n)continue;let r="string"==typeof e[n]?s(e[n]):e[n];"blockInfo"===n&&(r=s(JSON.stringify(e[n]))),t+=" ".concat(n,'="').concat(r,'"')}t+=">";for(let n=0;n"),t}_getBlockParams(e){const t={};for(const n in e.fields)t[n]=e.fields[n].value;for(const n in e.inputs){const r=this._blocks[e.inputs[n].block];for(const e in r.fields)t[e]=r.fields[e].value}return t}_getCustomBlockInternal(e){if(e.inputs&&e.inputs.custom_block)return this._blocks[e.inputs.custom_block.block]}_addScript(e){this._scripts.indexOf(e)>-1||(this._scripts.push(e),this._blocks[e].topLevel=!0)}_deleteScript(e){const t=this._scripts.indexOf(e);t>-1&&this._scripts.splice(t,1),this._blocks[e]&&(this._blocks[e].topLevel=!1)}}c.getCached=function(e,t,n){let r=e._cache._executeCached[t];if(void 0!==r)return r;const i=e.getBlock(t);return void 0===i?null:(r=void 0===n?{id:t,opcode:e.getOpcode(i),fields:e.getFields(i),inputs:e.getInputs(i),mutation:e.getMutation(i)}:new n(e,{id:t,opcode:e.getOpcode(i),fields:e.getFields(i),inputs:e.getInputs(i),mutation:e.getMutation(i)}),e._cache._executeCached[t]=r,r)};const f=u._RuntimeScriptCache;u.getScripts=function(e,t){let n=e._cache.scripts[t];if(!n){n=e._cache.scripts[t]=[];const r=e._scripts;for(let i=0;i0&&this.scanner.lookupType(-1)===i?this.scanner.tokenIndex>1?this.scanner.getTokenStart(this.scanner.tokenIndex-1):this.scanner.firstCharOffset:this.scanner.tokenStart}function c(){return 0}e.exports={name:"Raw",structure:{value:String},parse:function(e,t,n){var r,i=this.scanner.getTokenStart(e);return this.scanner.skip(this.scanner.getRawLength(e,t||c)),r=n&&this.scanner.tokenStart>i?l.call(this):this.scanner.tokenStart,{type:"Raw",loc:this.getLocation(i,r),value:this.scanner.source.substring(i,r)}},generate:function(e){this.chunk(e.value)},mode:{default:c,leftCurlyBracket:function(e){return e===o?1:0},leftCurlyBracketOrSemicolon:function(e){return e===o||e===s?1:0},exclamationMarkOrSemicolon:function(e,t,n){return e===a&&33===t.charCodeAt(n)||e===s?1:0},semicolonIncluded:function(e){return e===s?2:0}}}},function(e,t,n){"use strict";(function(e){var r=n(122),i=n(123),s=n(124);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(r)return W(e).length;t=(""+t).toLowerCase(),r=!0}}function f(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){var s,o=1,a=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var u=-1;for(s=n;sa&&(n=a-l),s=n;s>=0;s--){for(var d=!0,h=0;hi&&(r=i):r=i;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o>8,i=n%256,s.push(i),s.push(r);return s}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:128==(192&(s=e[i+1]))&&(l=(31&c)<<6|63&s)>127&&(u=l);break;case 3:s=e[i+1],o=e[i+2],128==(192&s)&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:s=e[i+1],o=e[i+2],a=e[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=d}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},l.prototype.compare=function(e,t,n,r,i){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),a=Math.min(s,o),c=this.slice(r,i),u=e.slice(t,n),d=0;di)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return k(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function I(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",s=t;sn)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,i,s){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function P(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function L(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function B(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(e,t,n,r,s){return s||B(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,s){return s||B(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,s=0;++s=(i*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,s=this[e+--r];r>0&&(i*=256);)s+=this[e+--r]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},l.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,s=0;for(this[t]=255&e;++s=0&&(s*=256);)this[t+i]=e/s&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):L(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o|0)-a&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(s<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function V(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(9))},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,s=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}y(e,t,s,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&y(e,"error",t,n)}(e,i,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,s,o,a;if(c(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,a=l,console&&console.warn&&console.warn(a)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function m(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)s(l,this,t);else{var c=l.length,u=g(l,c);for(n=0;n=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return m(this,e,!0)},a.prototype.rawListeners=function(e){return m(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t){function n(e){return{prev:null,next:null,data:e}}function r(e,t,n){var r;return null!==s?(r=s,s=s.cursor,r.prev=t,r.next=n,r.cursor=e.cursor):r={prev:t,next:n,cursor:e.cursor},e.cursor=r,r}function i(e){var t=e.cursor;e.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=s,s=t}var s=null,o=function(){this.cursor=null,this.head=null,this.tail=null};o.createItem=n,o.prototype.createItem=n,o.prototype.updateCursors=function(e,t,n,r){for(var i=this.cursor;null!==i;)i.prev===e&&(i.prev=t),i.next===n&&(i.next=r),i=i.cursor},o.prototype.getSize=function(){for(var e=0,t=this.head;t;)e++,t=t.next;return e},o.prototype.fromArray=function(e){var t=null;this.head=null;for(var r=0;r>2,a=(3&t)<<4|n>>4,l=1>6:64,c=2>4,n=(15&o)<<4|(a=s.indexOf(e.charAt(c++)))>>2,r=(3&a)<<6|(l=s.indexOf(e.charAt(c++))),h[u++]=t,64!==a&&(h[u++]=n),64!==l&&(h[u++]=r);return h}},{"./support":30,"./utils":32}],2:[function(e,t,n){"use strict";var r=e("./external"),i=e("./stream/DataWorker"),s=e("./stream/Crc32Probe"),o=e("./stream/DataLengthProbe");function a(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}a.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(e,t,n){return e.pipe(new s).pipe(new o("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new o("compressedSize")).withStreamInfo("compression",t)},t.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var r=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){"use strict";var r=e("./utils"),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==r.getTypeOf(e)?function(e,t,n,r){var s=i,o=r+n;e^=-1;for(var a=r;a>>8^s[255&(e^t[a])];return~e}(0|t,e,e.length,0):function(e,t,n,r){var s=i,o=r+n;e^=-1;for(var a=r;a>>8^s[255&(e^t.charCodeAt(a))];return~e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){"use strict";var r=null;r="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),s=e("./utils"),o=e("./stream/GenericWorker"),a=r?"uint8array":"array";function l(e,t){o.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",s.inherits(l,o),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,e.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new l("Deflate",e)},n.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){"use strict";function r(e,t){var n,r="";for(n=0;n>>=8;return r}function i(e,t,n,i,o,u){var d,h,p=e.file,m=e.compression,f=u!==a.utf8encode,g=s.transformTo("string",u(p.name)),y=s.transformTo("string",a.utf8encode(p.name)),b=p.comment,v=s.transformTo("string",u(b)),S=s.transformTo("string",a.utf8encode(b)),w=y.length!==p.name.length,k=S.length!==b.length,x="",T="",E="",A=p.dir,C=p.date,I={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(I.crc32=e.crc32,I.compressedSize=e.compressedSize,I.uncompressedSize=e.uncompressedSize);var O=0;t&&(O|=8),f||!w&&!k||(O|=2048);var M=0,N=0;A&&(M|=16),"UNIX"===o?(N=798,M|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,A)):(N=20,M|=function(e){return 63&(e||0)}(p.dosPermissions)),d=C.getUTCHours(),d<<=6,d|=C.getUTCMinutes(),d<<=5,d|=C.getUTCSeconds()/2,h=C.getUTCFullYear()-1980,h<<=4,h|=C.getUTCMonth()+1,h<<=5,h|=C.getUTCDate(),w&&(T=r(1,1)+r(l(g),4)+y,x+="up"+r(T.length,2)+T),k&&(E=r(1,1)+r(l(v),4)+S,x+="uc"+r(E.length,2)+E);var R="";return R+="\n\0",R+=r(O,2),R+=m.magic,R+=r(d,2),R+=r(h,2),R+=r(I.crc32,4),R+=r(I.compressedSize,4),R+=r(I.uncompressedSize,4),R+=r(g.length,2),R+=r(x.length,2),{fileRecord:c.LOCAL_FILE_HEADER+R+g+x,dirRecord:c.CENTRAL_FILE_HEADER+r(N,2)+R+r(v.length,2)+"\0\0\0\0"+r(M,4)+r(i,4)+g+x+v}}var s=e("../utils"),o=e("../stream/GenericWorker"),a=e("../utf8"),l=e("../crc32"),c=e("../signature");function u(e,t,n,r){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return c.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){"use strict";var r=e("./Uint8ArrayReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){"use strict";var r=e("./DataReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){"use strict";var r=e("./ArrayReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){"use strict";var r=e("../utils"),i=e("../support"),s=e("./ArrayReader"),o=e("./StringReader"),a=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new a(e):i.uint8array?new l(r.transformTo("uint8array",e)):new s(r.transformTo("array",e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict";n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,n){"use strict";var r=e("./GenericWorker"),i=e("../utils");function s(e){r.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(s,r),s.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){"use strict";var r=e("./GenericWorker"),i=e("../crc32");function s(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(s,r),s.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){"use strict";var r=e("../utils"),i=e("./GenericWorker");function s(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(s,i),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){"use strict";var r=e("../utils"),i=e("./GenericWorker");function s(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}r.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){"use strict";function r(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n "+e:e}},t.exports=r},{}],29:[function(e,n,r){"use strict";var i=e("../utils"),s=e("./ConvertWorker"),o=e("./GenericWorker"),a=e("../base64"),l=e("../support"),c=e("../external"),u=null;if(l.nodestream)try{u=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function d(e,n){return new c.Promise((function(r,s){var o=[],l=e._internalType,c=e._outputType,u=e._mimeType;e.on("data",(function(e,t){o.push(e),n&&n(t)})).on("error",(function(e){o=[],s(e)})).on("end",(function(){try{var e=function(e,t,n){switch(e){case"blob":return i.newBlob(i.transformTo("arraybuffer",t),n);case"base64":return a.encode(t);default:return i.transformTo(e,t)}}(c,function(e,n){var r,i=0,s=null,o=0;for(r=0;r>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,i,s,o=e.length,l=new Array(2*o);for(t=n=0;t>10&1023,l[n++]=56320|1023&i)}return l.length!==n&&(l.subarray?l=l.subarray(0,n):l.length=n),r.applyFromCharCode(l)}(e=r.transformTo(i.uint8array?"uint8array":"array",e))},r.inherits(c,o),c.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var s=t;(t=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),t.set(s,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}(t),l=t;o!==t.length&&(i.uint8array?(l=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(l=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(l),meta:e.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=c,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,r){"use strict";var i=e("./support"),s=e("./base64"),o=e("./nodejsUtils"),a=e("./external");function l(e){return e}function c(e,t){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n>10&1023,c[r++]=56320|1023&i)}return l(c,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){for(var i=65535&e,s=e>>>16&65535,o=0;0!==n;){for(n-=o=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var s=r,o=i+n;e^=-1;for(var a=i;a>>8^s[255&(e^t[a])];return~e}},{}],46:[function(e,t,n){"use strict";var r,i=e("../utils/common"),s=e("./trees"),o=e("./adler32"),a=e("./crc32"),l=e("./messages"),c=0,u=4,d=0,h=-2,p=-1,m=4,f=2,g=8,y=9,b=286,v=30,S=19,w=2*b+1,k=15,x=3,T=258,E=T+x+1,A=42,C=113,I=1,O=2,M=3,N=4;function R(e,t){return e.msg=l[t],t}function D(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),0!==n&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function B(e,t){s._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,L(e.strm)}function z(e,t){e.pending_buf[e.pending++]=t}function U(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function j(e,t){var n,r,i=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,l=e.strstart>e.w_size-E?e.strstart-(e.w_size-E):0,c=e.window,u=e.w_mask,d=e.prev,h=e.strstart+T,p=c[s+o-1],m=c[s+o];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(n=t)+o]===m&&c[n+o-1]===p&&c[n]===c[s]&&c[++n]===c[s+1]){s+=2,n++;do{}while(c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&sl&&0!=--i);return o<=e.lookahead?o:e.lookahead}function F(e){var t,n,r,s,l,c,u,d,h,p,m=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-E)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);s+=m}if(0===e.strm.avail_in)break;if(c=e.strm,u=e.window,d=e.strstart+e.lookahead,p=void 0,(h=s)<(p=c.avail_in)&&(p=h),n=0===p?0:(c.avail_in-=p,i.arraySet(u,c.input,c.next_in,p,d),1===c.state.wrap?c.adler=o(c.adler,u,p,d):2===c.state.wrap&&(c.adler=a(c.adler,u,p,d)),c.next_in+=p,c.total_in+=p,p),e.lookahead+=n,e.lookahead+e.insert>=x)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(r=s._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-x,r=s._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(F(e),0===e.lookahead&&t===c)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,B(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-E&&(B(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===u?(B(e,!0),0===e.strm.avail_out?M:N):(e.strstart>e.block_start&&(B(e,!1),e.strm.avail_out),I)})),new G(4,4,8,4,W),new G(4,5,16,8,W),new G(4,6,32,32,W),new G(4,4,16,16,V),new G(8,16,32,32,V),new G(8,16,128,128,V),new G(8,32,128,256,V),new G(32,128,258,1024,V),new G(32,258,258,4096,V)],n.deflateInit=function(e,t){return _(e,t,g,15,8,0)},n.deflateInit2=_,n.deflateReset=H,n.deflateResetKeep=Y,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?h:(e.state.gzhead=t,d):h},n.deflate=function(e,t){var n,i,o,l;if(!e||!e.state||5>8&255),z(i,i.gzhead.time>>16&255),z(i,i.gzhead.time>>24&255),z(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),z(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(z(i,255&i.gzhead.extra.length),z(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=a(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(z(i,0),z(i,0),z(i,0),z(i,0),z(i,0),z(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),z(i,3),i.status=C);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(p|=32),p+=31-p%31,i.status=C,U(i,p),0!==i.strstart&&(U(i,e.adler>>>16),U(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),L(e),o=i.pending,i.pending!==i.pending_buf_size));)z(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),L(e),o=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindexo&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),L(e),o=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindexo&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),0===l&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&L(e),i.pending+2<=i.pending_buf_size&&(z(i,255&e.adler),z(i,e.adler>>8&255),e.adler=0,i.status=C)):i.status=C),0!==i.pending){if(L(e),0===e.avail_out)return i.last_flush=-1,d}else if(0===e.avail_in&&D(t)<=D(n)&&t!==u)return R(e,-5);if(666===i.status&&0!==e.avail_in)return R(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==c&&666!==i.status){var m=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(F(e),0===e.lookahead)){if(t===c)return I;break}if(e.match_length=0,n=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(B(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===u?(B(e,!0),0===e.strm.avail_out?M:N):e.last_lit&&(B(e,!1),0===e.strm.avail_out)?I:O}(i,t):3===i.strategy?function(e,t){for(var n,r,i,o,a=e.window;;){if(e.lookahead<=T){if(F(e),e.lookahead<=T&&t===c)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(n=s._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(B(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===u?(B(e,!0),0===e.strm.avail_out?M:N):e.last_lit&&(B(e,!1),0===e.strm.avail_out)?I:O}(i,t):r[i.level].func(i,t);if(m!==M&&m!==N||(i.status=666),m===I||m===M)return 0===e.avail_out&&(i.last_flush=-1),d;if(m===O&&(1===t?s._tr_align(i):5!==t&&(s._tr_stored_block(i,0,0,!1),3===t&&(P(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),L(e),0===e.avail_out))return i.last_flush=-1,d}return t!==u?d:i.wrap<=0?1:(2===i.wrap?(z(i,255&e.adler),z(i,e.adler>>8&255),z(i,e.adler>>16&255),z(i,e.adler>>24&255),z(i,255&e.total_in),z(i,e.total_in>>8&255),z(i,e.total_in>>16&255),z(i,e.total_in>>24&255)):(U(i,e.adler>>>16),U(i,65535&e.adler)),L(e),0=n.w_size&&(0===a&&(P(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),l=e.avail_in,c=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,F(n);n.lookahead>=x;){for(r=n.strstart,s=n.lookahead-(x-1);n.ins_h=(n.ins_h<>>=S=v>>>24,m-=S,0==(S=v>>>16&255))A[s++]=65535&v;else{if(!(16&S)){if(!(64&S)){v=f[(65535&v)+(p&(1<>>=S,m-=S),m<15&&(p+=E[r++]<>>=S=v>>>24,m-=S,!(16&(S=v>>>16&255))){if(!(64&S)){v=g[(65535&v)+(p&(1<>>=S,m-=S,(S=s-o)>3,p&=(1<<(m-=w<<3))-1,e.next_in=r,e.next_out=s,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=h,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function b(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,y(e)):d}function v(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(s=o.wsize-o.wnext)&&(s=i),r.arraySet(o.window,t,n-i,s,o.wnext),(i-=s)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=s(n.check,F,2,0),w=S=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&S)<<8)+(S>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&S)){e.msg="unknown compression method",n.mode=30;break}if(w-=4,L=8+(15&(S>>>=4)),0===n.wbits)n.wbits=L;else if(L>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(F[0]=255&S,F[1]=S>>>8&255,n.check=s(n.check,F,2,0)),w=S=0,n.mode=3;case 3:for(;w<32;){if(0===b)break e;b--,S+=p[g++]<>>8&255,F[2]=S>>>16&255,F[3]=S>>>24&255,n.check=s(n.check,F,4,0)),w=S=0,n.mode=4;case 4:for(;w<16;){if(0===b)break e;b--,S+=p[g++]<>8),512&n.flags&&(F[0]=255&S,F[1]=S>>>8&255,n.check=s(n.check,F,2,0)),w=S=0,n.mode=5;case 5:if(1024&n.flags){for(;w<16;){if(0===b)break e;b--,S+=p[g++]<>>8&255,n.check=s(n.check,F,2,0)),w=S=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(b<(A=n.length)&&(A=b),A&&(n.head&&(L=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,A,L)),512&n.flags&&(n.check=s(n.check,p,A,g)),b-=A,g+=A,n.length-=A),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===b)break e;for(A=0;L=p[g+A++],n.head&&L&&n.length<65536&&(n.head.name+=String.fromCharCode(L)),L&&A>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;w<32;){if(0===b)break e;b--,S+=p[g++]<>>=7&w,w-=7&w,n.mode=27;break}for(;w<3;){if(0===b)break e;b--,S+=p[g++]<>>=1)){case 0:n.mode=14;break;case 1:if(T(n),n.mode=20,6!==t)break;S>>>=2,w-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}S>>>=2,w-=2;break;case 14:for(S>>>=7&w,w-=7&w;w<32;){if(0===b)break e;b--,S+=p[g++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&S,w=S=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(A=n.length){if(b>>=5,w-=5,n.ndist=1+(31&S),S>>>=5,w-=5,n.ncode=4+(15&S),S>>>=4,w-=4,286>>=3,w-=3}for(;n.have<19;)n.lens[W[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,z={bits:n.lenbits},B=a(0,n.lens,0,19,n.lencode,0,n.work,z),n.lenbits=z.bits,B){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,N=65535&j,!((O=j>>>24)<=w);){if(0===b)break e;b--,S+=p[g++]<>>=O,w-=O,n.lens[n.have++]=N;else{if(16===N){for(U=O+2;w>>=O,w-=O,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}L=n.lens[n.have-1],A=3+(3&S),S>>>=2,w-=2}else if(17===N){for(U=O+3;w>>=O)),S>>>=3,w-=3}else{for(U=O+7;w>>=O)),S>>>=7,w-=7}if(n.have+A>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;A--;)n.lens[n.have++]=L}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,z={bits:n.lenbits},B=a(l,n.lens,0,n.nlen,n.lencode,0,n.work,z),n.lenbits=z.bits,B){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,z={bits:n.distbits},B=a(c,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,z),n.distbits=z.bits,B){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=b&&258<=v){e.next_out=y,e.avail_out=v,e.next_in=g,e.avail_in=b,n.hold=S,n.bits=w,o(e,x),y=e.next_out,m=e.output,v=e.avail_out,g=e.next_in,p=e.input,b=e.avail_in,S=n.hold,w=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;M=(j=n.lencode[S&(1<>>16&255,N=65535&j,!((O=j>>>24)<=w);){if(0===b)break e;b--,S+=p[g++]<>R)])>>>16&255,N=65535&j,!(R+(O=j>>>24)<=w);){if(0===b)break e;b--,S+=p[g++]<>>=R,w-=R,n.back+=R}if(S>>>=O,w-=O,n.back+=O,n.length=N,0===M){n.mode=26;break}if(32&M){n.back=-1,n.mode=12;break}if(64&M){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&M,n.mode=22;case 22:if(n.extra){for(U=n.extra;w>>=n.extra,w-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;M=(j=n.distcode[S&(1<>>16&255,N=65535&j,!((O=j>>>24)<=w);){if(0===b)break e;b--,S+=p[g++]<>R)])>>>16&255,N=65535&j,!(R+(O=j>>>24)<=w);){if(0===b)break e;b--,S+=p[g++]<>>=R,w-=R,n.back+=R}if(S>>>=O,w-=O,n.back+=O,64&M){e.msg="invalid distance code",n.mode=30;break}n.offset=N,n.extra=15&M,n.mode=24;case 24:if(n.extra){for(U=n.extra;w>>=n.extra,w-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===v)break e;if(A=x-v,n.offset>A){if((A=n.offset-A)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}C=A>n.wnext?(A-=n.wnext,n.wsize-A):n.wnext-A,A>n.length&&(A=n.length),I=n.window}else I=m,C=y-n.offset,A=n.length;for(vb?(S=z[U+d[T]],D[P+d[T]]):(S=96,0),p=1<>O)+(m-=p)]=v<<24|S<<16|w,0!==m;);for(p=1<>=1;if(0!==p?(R&=p-1,R+=p):R=0,T++,0==--L[x]){if(x===A)break;x=t[n+d[T]]}if(C>>7)]}function z(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function U(e,t,n){e.bi_valid>f-n?(e.bi_buf|=t<>f-e.bi_valid,e.bi_valid+=n-f):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function W(e,t,n){var r,i,s=new Array(m+1),o=0;for(r=1;r<=m;r++)s[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=F(s[a]++,a))}}function V(e){var t;for(t=0;t>1;1<=n;n--)Y(e,s,n);for(i=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Y(e,s,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,s[2*i]=s[2*n]+s[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,s[2*n+1]=s[2*r+1]=i,e.heap[1]=i++,Y(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,s,o,a,l=t.dyn_tree,c=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,f=t.stat_desc.extra_base,g=t.stat_desc.max_length,y=0;for(s=0;s<=m;s++)e.bl_count[s]=0;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n>=7;r>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return i;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return s;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=o&&(o=a)):o=a=n+5,n+4<=o&&-1!==t?Z(e,t,n,r):4===e.strategy||a===o?(U(e,2+(r?1:0),3),H(e,E,A)):(U(e,4+(r?1:0),3),function(e,t,n,r){var i;for(U(e,t-257,5),U(e,n-1,5),U(e,r-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(I[n]+c+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){U(e,2,3),j(e,y,E),function(e){16===e.bi_valid?(z(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){!function(e,t){"use strict";if(!e.setImmediate){var n,r,s,o,a=1,l={},c=!1,u=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,n="[object process]"==={}.toString.call(e.process)?function(e){i.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(o="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",m,!1):e.attachEvent("onmessage",m),function(t){e.postMessage(o+t,"*")}):e.MessageChannel?((s=new MessageChannel).port1.onmessage=function(e){p(e.data)},function(e){s.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(r=u.documentElement,function(e){var t=u.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(p,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r>24&255;return{r:e>>16&255,g:e>>8&255,b:255&e,a:t>0?t:255}}static hexToRgb(e){e.startsWith("#")&&(e=e.substring(1));const t=parseInt(e,16);if(isNaN(t))return null;if(6===e.length)return{r:t>>16&255,g:t>>8&255,b:255&t};if(3===e.length){const e=t>>8&15,n=t>>4&15,r=15&t;return{r:e<<4|e,g:n<<4|n,b:r<<4|r}}return null}static rgbToHex(e){return n.decimalToHex(n.rgbToDecimal(e))}static rgbToDecimal(e){return(e.r<<16)+(e.g<<8)+e.b}static hexToDecimal(e){return n.rgbToDecimal(n.hexToRgb(e))}static hsvToRgb(e){let t=e.h%360;t<0&&(t+=360);const n=Math.max(0,Math.min(e.s,1)),r=Math.max(0,Math.min(e.v,1)),i=Math.floor(t/60),s=t/60-i,o=r*(1-n),a=r*(1-n*s),l=r*(1-n*(1-s));let c,u,d;switch(i){default:case 0:c=r,u=l,d=o;break;case 1:c=a,u=r,d=o;break;case 2:c=o,u=r,d=l;break;case 3:c=o,u=a,d=r;break;case 4:c=l,u=o,d=r;break;case 5:c=r,u=o,d=a}return{r:Math.floor(255*c),g:Math.floor(255*u),b:Math.floor(255*d)}}static rgbToHsv(e){const t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(Math.min(t,n),r),s=Math.max(Math.max(t,n),r);let o=0,a=0;if(i!==s){o=60*((t===i?3:n===i?5:1)-(t===i?n-r:n===i?r-t:t-n)/(s-i))%360,a=(s-i)/s}return{h:o,s:a,v:s}}static mixRgb(e,t,n){if(n<=0)return e;if(n>=1)return t;const r=1-n;return{r:r*e.r+n*t.r,g:r*e.g+n*t.g,b:r*e.b+n*t.b}}}e.exports=n},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return o(e)?e:_(e)}function r(e){return a(e)?e:K(e)}function i(e){return l(e)?e:Q(e)}function s(e){return o(e)&&!c(e)?e:X(e)}function o(e){return!(!e||!e[d])}function a(e){return!(!e||!e[h])}function l(e){return!(!e||!e[p])}function c(e){return a(e)||l(e)}function u(e){return!(!e||!e[m])}t(r,n),t(i,n),t(s,n),n.isIterable=o,n.isKeyed=a,n.isIndexed=l,n.isAssociative=c,n.isOrdered=u,n.Keyed=r,n.Indexed=i,n.Set=s;var d="@@__IMMUTABLE_ITERABLE__@@",h="@@__IMMUTABLE_KEYED__@@",p="@@__IMMUTABLE_INDEXED__@@",m="@@__IMMUTABLE_ORDERED__@@",f="delete",g=5,y=1<>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?A(e)+t:t}function I(){return!0}function O(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function M(e,t){return R(e,t,0)}function N(e,t){return R(e,t,t)}function R(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var D=0,P=1,L=2,B="function"==typeof Symbol&&Symbol.iterator,z="@@iterator",U=B||z;function j(e){this.next=e}function F(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function W(){return{value:void 0,done:!0}}function V(e){return!!Y(e)}function G(e){return e&&"function"==typeof e.next}function q(e){var t=Y(e);return t&&t.call(e)}function Y(e){var t=e&&(B&&e[B]||e[z]);if("function"==typeof t)return t}function H(e){return e&&"number"==typeof e.length}function _(e){return null==e?oe():o(e)?e.toSeq():ce(e)}function K(e){return null==e?oe().toKeyedSeq():o(e)?a(e)?e.toSeq():e.fromEntrySeq():ae(e)}function Q(e){return null==e?oe():o(e)?a(e)?e.entrySeq():e.toIndexedSeq():le(e)}function X(e){return(null==e?oe():o(e)?a(e)?e.entrySeq():e:le(e)).toSetSeq()}j.prototype.toString=function(){return"[Iterator]"},j.KEYS=D,j.VALUES=P,j.ENTRIES=L,j.prototype.inspect=j.prototype.toSource=function(){return this.toString()},j.prototype[U]=function(){return this},t(_,n),_.of=function(){return _(arguments)},_.prototype.toSeq=function(){return this},_.prototype.toString=function(){return this.__toString("Seq {","}")},_.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},_.prototype.__iterate=function(e,t){return de(this,e,t,!0)},_.prototype.__iterator=function(e,t){return he(this,e,t,!0)},t(K,_),K.prototype.toKeyedSeq=function(){return this},t(Q,_),Q.of=function(){return Q(arguments)},Q.prototype.toIndexedSeq=function(){return this},Q.prototype.toString=function(){return this.__toString("Seq [","]")},Q.prototype.__iterate=function(e,t){return de(this,e,t,!1)},Q.prototype.__iterator=function(e,t){return he(this,e,t,!1)},t(X,_),X.of=function(){return X(arguments)},X.prototype.toSetSeq=function(){return this},_.isSeq=se,_.Keyed=K,_.Set=X,_.Indexed=Q;var Z,J,$,ee="@@__IMMUTABLE_SEQ__@@";function te(e){this._array=e,this.size=e.length}function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function ie(e){this._iterator=e,this._iteratorCache=[]}function se(e){return!(!e||!e[ee])}function oe(){return Z||(Z=new te([]))}function ae(e){var t=Array.isArray(e)?new te(e).fromEntrySeq():G(e)?new ie(e).fromEntrySeq():V(e)?new re(e).fromEntrySeq():"object"==typeof e?new ne(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function le(e){var t=ue(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ce(e){var t=ue(e)||"object"==typeof e&&new ne(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function ue(e){return H(e)?new te(e):G(e)?new ie(e):V(e)?new re(e):void 0}function de(e,t,n,r){var i=e._cache;if(i){for(var s=i.length-1,o=0;o<=s;o++){var a=i[n?s-o:o];if(!1===t(a[1],r?a[0]:o,e))return o+1}return o}return e.__iterateUncached(t,n)}function he(e,t,n,r){var i=e._cache;if(i){var s=i.length-1,o=0;return new j((function(){var e=i[n?s-o:o];return o++>s?W():F(t,r?e[0]:o-1,e[1])}))}return e.__iteratorUncached(t,n)}function pe(e,t){return t?me(t,e,"",{"":e}):fe(e)}function me(e,t,n,r){return Array.isArray(t)?e.call(r,n,Q(t).map((function(n,r){return me(e,n,r,t)}))):ge(t)?e.call(r,n,K(t).map((function(n,r){return me(e,n,r,t)}))):t}function fe(e){return Array.isArray(e)?Q(e).map(fe).toList():ge(e)?K(e).map(fe).toMap():e}function ge(e){return e&&(e.constructor===Object||void 0===e.constructor)}function ye(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function be(e,t){if(e===t)return!0;if(!o(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||a(e)!==a(t)||l(e)!==l(t)||u(e)!==u(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!c(e);if(u(e)){var r=e.entries();return t.every((function(e,t){var i=r.next().value;return i&&ye(i[1],e)&&(n||ye(i[0],t))}))&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var s=e;e=t,t=s}var d=!0,h=t.__iterate((function(t,r){if(n?!e.has(t):i?!ye(t,e.get(r,v)):!ye(e.get(r,v),t))return d=!1,!1}));return d&&e.size===h}function ve(e,t){if(!(this instanceof ve))return new ve(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(J)return J;J=this}}function Se(e,t){if(!e)throw new Error(t)}function we(e,t,n){if(!(this instanceof we))return new we(e,t,n);if(Se(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),tr?W():F(e,i,n[t?r-i++:i++])}))},t(ne,K),ne.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},ne.prototype.has=function(e){return this._object.hasOwnProperty(e)},ne.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,s=0;s<=i;s++){var o=r[t?i-s:s];if(!1===e(n[o],o,this))return s+1}return s},ne.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,s=0;return new j((function(){var o=r[t?i-s:s];return s++>i?W():F(e,o,n[o])}))},ne.prototype[m]=!0,t(re,Q),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=q(this._iterable),r=0;if(G(n))for(var i;!(i=n.next()).done&&!1!==e(i.value,r++,this););return r},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=q(this._iterable);if(!G(n))return new j(W);var r=0;return new j((function(){var t=n.next();return t.done?t:F(e,r++,t.value)}))},t(ie,Q),ie.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,i=this._iteratorCache,s=0;s=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return F(e,i,r[i++])}))},t(ve,Q),ve.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},ve.prototype.get=function(e,t){return this.has(e)?this._value:t},ve.prototype.includes=function(e){return ye(this._value,e)},ve.prototype.slice=function(e,t){var n=this.size;return O(e,t,n)?this:new ve(this._value,N(t,n)-M(e,n))},ve.prototype.reverse=function(){return this},ve.prototype.indexOf=function(e){return ye(this._value,e)?0:-1},ve.prototype.lastIndexOf=function(e){return ye(this._value,e)?this.size:-1},ve.prototype.__iterate=function(e,t){for(var n=0;n=0&&t=0&&nn?W():F(e,s++,o)}))},we.prototype.equals=function(e){return e instanceof we?this._start===e._start&&this._end===e._end&&this._step===e._step:be(this,e)},t(ke,n),t(xe,ke),t(Te,ke),t(Ee,ke),ke.Keyed=xe,ke.Indexed=Te,ke.Set=Ee;var Ae="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function Ce(e){return e>>>1&1073741824|3221225471&e}function Ie(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return Ce(n)}if("string"===t)return e.length>je?Oe(e):Me(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return Ne(e);if("function"==typeof e.toString)return Me(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function Oe(e){var t=Ve[e];return void 0===t&&(t=Me(e),We===Fe&&(We=0,Ve={}),We++,Ve[e]=t),t}function Me(e){for(var t=0,n=0;n0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}var Le,Be="function"==typeof WeakMap;Be&&(Le=new WeakMap);var ze=0,Ue="__immutablehash__";"function"==typeof Symbol&&(Ue=Symbol(Ue));var je=16,Fe=255,We=0,Ve={};function Ge(e){Se(e!==1/0,"Cannot perform this action with an infinite size.")}function qe(e){return null==e?it():Ye(e)&&!u(e)?e:it().withMutations((function(t){var n=r(e);Ge(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function Ye(e){return!(!e||!e[_e])}t(qe,xe),qe.of=function(){var t=e.call(arguments,0);return it().withMutations((function(e){for(var n=0;n=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}}))},qe.prototype.toString=function(){return this.__toString("Map {","}")},qe.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},qe.prototype.set=function(e,t){return st(this,e,t)},qe.prototype.setIn=function(e,t){return this.updateIn(e,v,(function(){return t}))},qe.prototype.remove=function(e){return st(this,e,v)},qe.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return v}))},qe.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},qe.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=gt(this,kn(e),t,n);return r===v?void 0:r},qe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):it()},qe.prototype.merge=function(){return ht(this,void 0,arguments)},qe.prototype.mergeWith=function(t){return ht(this,t,e.call(arguments,1))},qe.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,it(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},qe.prototype.mergeDeep=function(){return ht(this,pt,arguments)},qe.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return ht(this,mt(t),n)},qe.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,it(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},qe.prototype.sort=function(e){return Vt(dn(this,e))},qe.prototype.sortBy=function(e,t){return Vt(dn(this,t,e))},qe.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},qe.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new T)},qe.prototype.asImmutable=function(){return this.__ensureOwner()},qe.prototype.wasAltered=function(){return this.__altered},qe.prototype.__iterator=function(e,t){return new et(this,e,t)},qe.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},qe.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?rt(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},qe.isMap=Ye;var He,_e="@@__IMMUTABLE_MAP__@@",Ke=qe.prototype;function Qe(e,t){this.ownerID=e,this.entries=t}function Xe(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function Ze(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Je(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function $e(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function et(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&nt(e._root)}function tt(e,t){return F(e,t[0],t[1])}function nt(e,t){return{node:e,index:0,__prev:t}}function rt(e,t,n,r){var i=Object.create(Ke);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function it(){return He||(He=rt(0))}function st(e,t,n){var r,i;if(e._root){var s=k(S),o=k(w);if(r=ot(e._root,e.__ownerID,0,void 0,t,n,s,o),!o.value)return e;i=e.size+(s.value?n===v?-1:1:0)}else{if(n===v)return e;i=1,r=new Qe(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?rt(i,r):it()}function ot(e,t,n,r,i,s,o,a){return e?e.update(t,n,r,i,s,o,a):s===v?e:(x(a),x(o),new $e(t,r,[i,s]))}function at(e){return e.constructor===$e||e.constructor===Je}function lt(e,t,n,r,i){if(e.keyHash===r)return new Je(t,r,[e.entry,i]);var s,o=(0===n?e.keyHash:e.keyHash>>>n)&b,a=(0===n?r:r>>>n)&b;return new Xe(t,1<>>=1)o[a]=1&n?t[s++]:void 0;return o[r]=i,new Ze(e,s+1,o)}function ht(e,t,n){for(var i=[],s=0;s>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function bt(e,t,n,r){var i=r?e:E(e);return i[t]=n,i}function vt(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var s=new Array(i),o=0,a=0;a=wt)return ct(e,l,r,i);var h=e&&e===this.ownerID,p=h?l:E(l);return d?a?c===u-1?p.pop():p[c]=p.pop():p[c]=[r,i]:p.push([r,i]),h?(this.entries=p,this):new Qe(e,p)}},Xe.prototype.get=function(e,t,n,r){void 0===t&&(t=Ie(n));var i=1<<((0===e?t:t>>>e)&b),s=this.bitmap;return s&i?this.nodes[yt(s&i-1)].get(e+g,t,n,r):r},Xe.prototype.update=function(e,t,n,r,i,s,o){void 0===n&&(n=Ie(r));var a=(0===t?n:n>>>t)&b,l=1<=kt)return dt(e,h,c,a,m);if(u&&!m&&2===h.length&&at(h[1^d]))return h[1^d];if(u&&m&&1===h.length&&at(m))return m;var f=e&&e===this.ownerID,y=u?m?c:c^l:c|l,S=u?m?bt(h,d,m,f):St(h,d,f):vt(h,d,m,f);return f?(this.bitmap=y,this.nodes=S,this):new Xe(e,y,S)},Ze.prototype.get=function(e,t,n,r){void 0===t&&(t=Ie(n));var i=(0===e?t:t>>>e)&b,s=this.nodes[i];return s?s.get(e+g,t,n,r):r},Ze.prototype.update=function(e,t,n,r,i,s,o){void 0===n&&(n=Ie(r));var a=(0===t?n:n>>>t)&b,l=i===v,c=this.nodes,u=c[a];if(l&&!u)return this;var d=ot(u,e,t+g,n,r,i,s,o);if(d===u)return this;var h=this.count;if(u){if(!d&&--h0&&r=0&&e>>t&b;if(r>=this.array.length)return new It([],e);var i,s=0===r;if(t>0){var o=this.array[r];if((i=o&&o.removeBefore(e,t-g,n))===o&&s)return this}if(s&&!i)return this;var a=zt(this,e);if(!s)for(var l=0;l>>t&b;if(i>=this.array.length)return this;if(t>0){var s=this.array[i];if((r=s&&s.removeAfter(e,t-g,n))===s&&i===this.array.length-1)return this}var o=zt(this,e);return o.array.splice(i+1),r&&(o.array[i]=r),o};var Ot,Mt,Nt={};function Rt(e,t){var n=e._origin,r=e._capacity,i=Wt(r),s=e._tail;return o(e._root,e._level,0);function o(e,t,n){return 0===t?a(e,n):l(e,t,n)}function a(e,o){var a=o===i?s&&s.array:e&&e.array,l=o>n?0:n-o,c=r-o;return c>y&&(c=y),function(){if(l===c)return Nt;var e=t?--c:l++;return a&&a[e]}}function l(e,i,s){var a,l=e&&e.array,c=s>n?0:n-s>>i,u=1+(r-s>>i);return u>y&&(u=y),function(){for(;;){if(a){var e=a();if(e!==Nt)return e;a=null}if(c===u)return Nt;var n=t?--u:c++;a=o(l&&l[n],i-g,s+(n<=e.size||t<0)return e.withMutations((function(e){t<0?jt(e,t).set(0,n):jt(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,i=e._root,s=k(w);return t>=Wt(e._capacity)?r=Bt(r,e.__ownerID,0,t,n,s):i=Bt(i,e.__ownerID,e._level,t,n,s),s.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):Dt(e._origin,e._capacity,e._level,i,r):e}function Bt(e,t,n,r,i,s){var o,a=r>>>n&b,l=e&&a0){var c=e&&e.array[a],u=Bt(c,t,n-g,r,i,s);return u===c?e:((o=zt(e,t)).array[a]=u,o)}return l&&e.array[a]===i?e:(x(s),o=zt(e,t),void 0===i&&a===o.array.length-1?o.array.pop():o.array[a]=i,o)}function zt(e,t){return t&&e&&t===e.ownerID?e:new It(e?e.array.slice():[],t)}function Ut(e,t){if(t>=Wt(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&b],r-=g;return n}}function jt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new T,i=e._origin,s=e._capacity,o=i+t,a=void 0===n?s:n<0?s+n:i+n;if(o===i&&a===s)return e;if(o>=a)return e.clear();for(var l=e._level,c=e._root,u=0;o+u<0;)c=new It(c&&c.array.length?[void 0,c]:[],r),u+=1<<(l+=g);u&&(o+=u,i+=u,a+=u,s+=u);for(var d=Wt(s),h=Wt(a);h>=1<d?new It([],r):p;if(p&&h>d&&og;y-=g){var v=d>>>y&b;f=f.array[v]=zt(f.array[v],r)}f.array[d>>>g&b]=p}if(a=h)o-=h,a-=h,l=g,c=null,m=m&&m.removeBefore(r,0,o);else if(o>i||h>>l&b;if(S!==h>>>l&b)break;S&&(u+=(1<i&&(c=c.removeBefore(r,l,o-u)),c&&hs&&(s=c.size),o(l)||(c=c.map((function(e){return pe(e)}))),r.push(c)}return s>e.size&&(e=e.setSize(s)),ft(e,t,r)}function Wt(e){return e>>g<=y&&o.size>=2*s.size?(r=(i=o.filter((function(e,t){return void 0!==e&&a!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=s.remove(t),i=a===o.size-1?o.pop():o.set(a,void 0))}else if(l){if(n===o.get(a)[1])return e;r=s,i=o.set(a,[t,n])}else r=s.set(t,o.size),i=o.set(o.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):qt(r,i)}function _t(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Kt(e){this._iter=e,this.size=e.size}function Qt(e){this._iter=e,this.size=e.size}function Xt(e){this._iter=e,this.size=e.size}function Zt(e){var t=vn(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Sn,t.__iterateUncached=function(t,n){var r=this;return e.__iterate((function(e,n){return!1!==t(n,e,r)}),n)},t.__iteratorUncached=function(t,n){if(t===L){var r=e.__iterator(t,n);return new j((function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(t===P?D:P,n)},t}function Jt(e,t,n){var r=vn(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var s=e.get(r,v);return s===v?i:t.call(n,s,r,e)},r.__iterateUncached=function(r,i){var s=this;return e.__iterate((function(e,i,o){return!1!==r(t.call(n,e,i,o),i,s)}),i)},r.__iteratorUncached=function(r,i){var s=e.__iterator(L,i);return new j((function(){var i=s.next();if(i.done)return i;var o=i.value,a=o[0];return F(r,a,t.call(n,o[1],a,e),i)}))},r}function $t(e,t){var n=vn(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Zt(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Sn,n.__iterate=function(t,n){var r=this;return e.__iterate((function(e,n){return t(e,n,r)}),!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function en(e,t,n,r){var i=vn(e);return r&&(i.has=function(r){var i=e.get(r,v);return i!==v&&!!t.call(n,i,r,e)},i.get=function(r,i){var s=e.get(r,v);return s!==v&&t.call(n,s,r,e)?s:i}),i.__iterateUncached=function(i,s){var o=this,a=0;return e.__iterate((function(e,s,l){if(t.call(n,e,s,l))return a++,i(e,r?s:a-1,o)}),s),a},i.__iteratorUncached=function(i,s){var o=e.__iterator(L,s),a=0;return new j((function(){for(;;){var s=o.next();if(s.done)return s;var l=s.value,c=l[0],u=l[1];if(t.call(n,u,c,e))return F(i,r?c:a++,u,s)}}))},i}function tn(e,t,n){var r=qe().asMutable();return e.__iterate((function(i,s){r.update(t.call(n,i,s,e),0,(function(e){return e+1}))})),r.asImmutable()}function nn(e,t,n){var r=a(e),i=(u(e)?Vt():qe()).asMutable();e.__iterate((function(s,o){i.update(t.call(n,s,o,e),(function(e){return(e=e||[]).push(r?[o,s]:s),e}))}));var s=bn(e);return i.map((function(t){return fn(e,s(t))}))}function rn(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),O(t,n,i))return e;var s=M(t,i),o=N(n,i);if(s!=s||o!=o)return rn(e.toSeq().cacheResult(),t,n,r);var a,l=o-s;l==l&&(a=l<0?0:l);var c=vn(e);return c.size=0===a?a:e.size&&a||void 0,!r&&se(e)&&a>=0&&(c.get=function(t,n){return(t=C(this,t))>=0&&ta)return W();var e=i.next();return r||t===P?e:F(t,l-1,t===D?void 0:e.value[1],e)}))},c}function sn(e,t,n){var r=vn(e);return r.__iterateUncached=function(r,i){var s=this;if(i)return this.cacheResult().__iterate(r,i);var o=0;return e.__iterate((function(e,i,a){return t.call(n,e,i,a)&&++o&&r(e,i,s)})),o},r.__iteratorUncached=function(r,i){var s=this;if(i)return this.cacheResult().__iterator(r,i);var o=e.__iterator(L,i),a=!0;return new j((function(){if(!a)return W();var e=o.next();if(e.done)return e;var i=e.value,l=i[0],c=i[1];return t.call(n,c,l,s)?r===L?e:F(r,l,c,e):(a=!1,W())}))},r}function on(e,t,n,r){var i=vn(e);return i.__iterateUncached=function(i,s){var o=this;if(s)return this.cacheResult().__iterate(i,s);var a=!0,l=0;return e.__iterate((function(e,s,c){if(!a||!(a=t.call(n,e,s,c)))return l++,i(e,r?s:l-1,o)})),l},i.__iteratorUncached=function(i,s){var o=this;if(s)return this.cacheResult().__iterator(i,s);var a=e.__iterator(L,s),l=!0,c=0;return new j((function(){var e,s,u;do{if((e=a.next()).done)return r||i===P?e:F(i,c++,i===D?void 0:e.value[1],e);var d=e.value;s=d[0],u=d[1],l&&(l=t.call(n,u,s,o))}while(l);return i===L?e:F(i,s,u,e)}))},i}function an(e,t){var n=a(e),i=[e].concat(t).map((function(e){return o(e)?n&&(e=r(e)):e=n?ae(e):le(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===i.length)return e;if(1===i.length){var s=i[0];if(s===e||n&&a(s)||l(e)&&l(s))return s}var c=new te(i);return n?c=c.toKeyedSeq():l(e)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=i.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),c}function ln(e,t,n){var r=vn(e);return r.__iterateUncached=function(r,i){var s=0,a=!1;function l(e,c){var u=this;e.__iterate((function(e,i){return(!t||c0}function mn(e,t,r){var i=vn(e);return i.size=new te(r).map((function(e){return e.size})).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(P,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var s=r.map((function(e){return e=n(e),q(i?e.reverse():e)})),o=0,a=!1;return new j((function(){var n;return a||(n=s.map((function(e){return e.next()})),a=n.some((function(e){return e.done}))),a?W():F(e,o++,t.apply(null,n.map((function(e){return e.value}))))}))},i}function fn(e,t){return se(e)?t:e.constructor(t)}function gn(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function yn(e){return Ge(e.size),A(e)}function bn(e){return a(e)?r:l(e)?i:s}function vn(e){return Object.create((a(e)?K:l(e)?Q:X).prototype)}function Sn(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):_.prototype.cacheResult.call(this)}function wn(e,t){return e>t?1:e=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Kn(e,t)},Gn.prototype.pushAll=function(e){if(0===(e=i(e)).size)return this;Ge(e.size);var t=this.size,n=this._head;return e.reverse().forEach((function(e){t++,n={value:e,next:n}})),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Kn(t,n)},Gn.prototype.pop=function(){return this.slice(1)},Gn.prototype.unshift=function(){return this.push.apply(this,arguments)},Gn.prototype.unshiftAll=function(e){return this.pushAll(e)},Gn.prototype.shift=function(){return this.pop.apply(this,arguments)},Gn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Qn()},Gn.prototype.slice=function(e,t){if(O(e,t,this.size))return this;var n=M(e,this.size);if(N(t,this.size)!==this.size)return Te.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Kn(r,i)},Gn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Kn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Gn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Gn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new j((function(){if(r){var t=r.value;return r=r.next,F(e,n++,t)}return W()}))},Gn.isStack=qn;var Yn,Hn="@@__IMMUTABLE_STACK__@@",_n=Gn.prototype;function Kn(e,t,n,r){var i=Object.create(_n);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Qn(){return Yn||(Yn=Kn(0))}function Xn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}_n[Hn]=!0,_n.withMutations=Ke.withMutations,_n.asMutable=Ke.asMutable,_n.asImmutable=Ke.asImmutable,_n.wasAltered=Ke.wasAltered,n.Iterator=j,Xn(n,{toArray:function(){Ge(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new Kt(this)},toJS:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new _t(this,!0)},toMap:function(){return qe(this.toKeyedSeq())},toObject:function(){Ge(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return Vt(this.toKeyedSeq())},toOrderedSet:function(){return zn(a(this)?this.valueSeq():this)},toSet:function(){return On(a(this)?this.valueSeq():this)},toSetSeq:function(){return new Qt(this)},toSeq:function(){return l(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Gn(a(this)?this.valueSeq():this)},toList:function(){return Tt(a(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return fn(this,an(this,e.call(arguments,0)))},includes:function(e){return this.some((function(t){return ye(t,e)}))},entries:function(){return this.__iterator(L)},every:function(e,t){Ge(this.size);var n=!0;return this.__iterate((function(r,i,s){if(!e.call(t,r,i,s))return n=!1,!1})),n},filter:function(e,t){return fn(this,en(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return Ge(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Ge(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator(D)},map:function(e,t){return fn(this,Jt(this,e,t))},reduce:function(e,t,n){var r,i;return Ge(this.size),arguments.length<2?i=!0:r=t,this.__iterate((function(t,s,o){i?(i=!1,r=t):r=e.call(n,r,t,s,o)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return fn(this,$t(this,!0))},slice:function(e,t){return fn(this,rn(this,e,t,!0))},some:function(e,t){return!this.every(tr(e),t)},sort:function(e){return fn(this,dn(this,e))},values:function(){return this.__iterator(P)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return A(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return tn(this,e,t)},equals:function(e){return be(this,e)},entrySeq:function(){var e=this;if(e._cache)return new te(e._cache);var t=e.toSeq().map(er).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(tr(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate((function(n,i,s){if(e.call(t,n,i,s))return r=[i,n],!1})),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(I)},flatMap:function(e,t){return fn(this,cn(this,e,t))},flatten:function(e){return fn(this,ln(this,e,!0))},fromEntrySeq:function(){return new Xt(this)},get:function(e,t){return this.find((function(t,n){return ye(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,i=kn(e);!(n=i.next()).done;){var s=n.value;if((r=r&&r.get?r.get(s,v):v)===v)return t}return r},groupBy:function(e,t){return nn(this,e,t)},has:function(e){return this.get(e,v)!==v},hasIn:function(e){return this.getIn(e,v)!==v},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return ye(t,e)}))},keySeq:function(){return this.toSeq().map($n).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return hn(this,e)},maxBy:function(e,t){return hn(this,t,e)},min:function(e){return hn(this,e?nr(e):sr)},minBy:function(e,t){return hn(this,t?nr(t):sr,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return fn(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return fn(this,on(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(tr(e),t)},sortBy:function(e,t){return fn(this,dn(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return fn(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return fn(this,sn(this,e,t))},takeUntil:function(e,t){return this.takeWhile(tr(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=or(this))}});var Zn=n.prototype;Zn[d]=!0,Zn[U]=Zn.values,Zn.__toJS=Zn.toArray,Zn.__toStringMapper=rr,Zn.inspect=Zn.toSource=function(){return this.toString()},Zn.chain=Zn.flatMap,Zn.contains=Zn.includes,Xn(r,{flip:function(){return fn(this,Zt(this))},mapEntries:function(e,t){var n=this,r=0;return fn(this,this.toSeq().map((function(i,s){return e.call(t,[s,i],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return fn(this,this.toSeq().flip().map((function(r,i){return e.call(t,r,i,n)})).flip())}});var Jn=r.prototype;function $n(e,t){return t}function er(e,t){return[t,e]}function tr(e){return function(){return!e.apply(this,arguments)}}function nr(e){return function(){return-e.apply(this,arguments)}}function rr(e){return"string"==typeof e?JSON.stringify(e):String(e)}function ir(){return E(arguments)}function sr(e,t){return et?-1:0}function or(e){if(e.size===1/0)return 0;var t=u(e),n=a(e),r=t?1:0;return ar(e.__iterate(n?t?function(e,t){r=31*r+lr(Ie(e),Ie(t))|0}:function(e,t){r=r+lr(Ie(e),Ie(t))|0}:t?function(e){r=31*r+Ie(e)|0}:function(e){r=r+Ie(e)|0}),r)}function ar(e,t){return t=Ae(t,3432918353),t=Ae(t<<15|t>>>-15,461845907),t=Ae(t<<13|t>>>-13,5),t=Ae((t=t+3864292196^e)^t>>>16,2246822507),t=Ce((t=Ae(t^t>>>13,3266489909))^t>>>16)}function lr(e,t){return e^t+2654435769+(e<<6)+(e>>2)}return Jn[h]=!0,Jn[U]=Zn.entries,Jn.__toJS=Zn.toObject,Jn.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+rr(e)},Xn(i,{toKeyedSeq:function(){return new _t(this,!1)},filter:function(e,t){return fn(this,en(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return fn(this,$t(this,!1))},slice:function(e,t){return fn(this,rn(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=M(e,e<0?this.count():this.size);var r=this.slice(0,e);return fn(this,1===n?r:r.concat(E(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return fn(this,ln(this,e,!1))},get:function(e,t){return(e=C(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=C(this,e))>=0&&(void 0!==this.size?this.size===1/0||e0&&void 0!==arguments[0]?arguments[0]:this.warpMode;return this.reset(),this.warpMode=Boolean(e),this}static create(e){const t=i.pop();return void 0!==t?(t.warpMode=Boolean(e),t):new s(e)}static release(e){void 0!==e&&i.push(e.reset())}}class o{constructor(e){this.topBlock=e,this.stack=[],this.stackFrames=[],this.status=0,this.isKilled=!1,this.target=null,this.blockContainer=null,this.requestScriptGlowInFrame=!1,this.blockGlowInFrame=null,this.warpTimer=null,this.justReported=null,this.triedToCompile=!1,this.isCompiled=!1,this.timer=null,this.generator=null,this.procedures=null,this.executableHat=!1}static get STATUS_RUNNING(){return 0}static get STATUS_PROMISE_WAIT(){return 1}static get STATUS_YIELD(){return 2}static get STATUS_YIELD_TICK(){return 3}static get STATUS_DONE(){return 4}static getIdFromTargetAndBlock(e,t){return"".concat(e.id,"&").concat(t)}getId(){return o.getIdFromTargetAndBlock(this.target,this.topBlock)}pushStack(e){if(this.stack.push(e),this.stack.length>this.stackFrames.length){const e=this.stackFrames[this.stackFrames.length-1];this.stackFrames.push(s.create(void 0!==e&&e.warpMode))}}reuseStackForNextBlock(e){this.stack[this.stack.length-1]=e,this.stackFrames[this.stackFrames.length-1].reuse()}popStack(){return s.release(this.stackFrames.pop()),this.stack.pop()}stopThisScript(){let e=this.peekStack();for(;null!==e;){const t=this.target.blocks.getBlock(e);if(this.peekStackFrame().waitingReporter)break;if(void 0!==t&&"procedures_call"===t.opcode){this.goToNextBlock();break}this.popStack(),e=this.peekStack()}0===this.stack.length&&(this.requestScriptGlowInFrame=!1,this.status=o.STATUS_DONE)}peekStack(){return this.stack.length>0?this.stack[this.stack.length-1]:null}peekStackFrame(){return this.stackFrames.length>0?this.stackFrames[this.stackFrames.length-1]:null}peekParentStackFrame(){return this.stackFrames.length>1?this.stackFrames[this.stackFrames.length-2]:null}pushReportedValue(e){this.justReported=void 0===e?null:e}initParams(){const e=this.peekStackFrame();null===e.params&&(e.params={})}pushParam(e,t){this.peekStackFrame().params[e]=t}getParam(e){for(let t=this.stackFrames.length-1;t>=0;t--){const n=this.stackFrames[t];if(null!==n.params)return Object.prototype.hasOwnProperty.call(n.params,e)?n.params[e]:null}return null}getAllparams(){return this.peekStackFrame().params}atStackTop(){return this.peekStack()===this.topBlock}goToNextBlock(){const e=this.target.blocks.getNextBlock(this.peekStack());this.reuseStackForNextBlock(e)}isRecursiveCall(e){let t=5;for(let n=this.stackFrames.length-1-1;n>=0;n--){const r=this.target.blocks.getBlock(this.stackFrames[n].op.id);if("procedures_call"===r.opcode&&r.mutation.proccode===e)return!0;if(--t<0)return!1}return!1}tryCompile(){if(!this.blockContainer)return;const e=n(210);this.triedToCompile=!0;const t=!this.stackClick,i=this.topBlock,s=this.blockContainer.getBlock(i)?this.blockContainer:this.target.runtime.flyoutBlocks,o=t&&s.getCachedCompileResult(i);if(o&&!o.success)return;let a;if(o)a=o.value;else try{a=e(this),t&&s.cacheCompileResult(i,a)}catch(e){return r.error("cannot compile script",this.target.getName(),e),t&&s.cacheCompileError(i,e),void this.target.runtime.emitCompileError(this.target,e)}this.procedures={};for(const e of Object.keys(a.procedures))this.procedures[e]=a.procedures[e](this);this.generator=a.startingFunction(this)(),this.executableHat=a.executableHat,this.blockContainer.forceNoGlow||(this.blockGlowInFrame=this.topBlock,this.requestScriptGlowInFrame=!0),this.isCompiled=!0}}o._StackFrame=s,e.exports=o},function(e,t,n){var r=n(93),i=r.isDigit,s=r.isHexDigit,o=r.isUppercaseLetter,a=r.isName,l=r.isWhiteSpace,c=r.isValidEscape;function u(e,t){return te.length)return!1;for(var i=t;i=0&&l(e.charCodeAt(t));t--);return t+1},findWhiteSpaceEnd:function(e,t){for(;t{if(!t.extensionManager)return null;const n=t.extensionManager.getExtensionURLs(),r={};for(const t of e){const e=n[t];"string"==typeof e&&(r[t]=e)}return 0===Object.keys(r).length?null:r},O=function(e){const t=Object.create(null),n=new Set;for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;t[r]=E(e[r]);const i=C(e[r].opcode);i&&n.add(i)}for(const e in t){const n=t[e];t[e]=A(n,t)}for(const e in t){const n=t[e];Array.isArray(n)&&[w,k].indexOf(n[0])<0&&(c.warn("Found an unexpected top level primitive with block ID: ".concat(e,"; deleting it from serialized blocks.")),delete t[e])}return[t,Array.from(n)]},M=function(e){const t=Object.create(null);t.name=e.name;const n=e.broken||e;return t.bitmapResolution=n.bitmapResolution,t.dataFormat=n.dataFormat.toLowerCase(),t.assetId=n.assetId,t.md5ext=n.md5,t.rotationCenterX=n.rotationCenterX,t.rotationCenterY=n.rotationCenterY,t},N=function(e){const t=Object.create(null);t.name=e.name;const n=e.broken||e;return t.assetId=n.assetId,t.dataFormat=n.dataFormat.toLowerCase(),t.format=n.format,t.rate=n.rate,t.sampleCount=n.sampleCount,t.md5ext=n.md5,t},R=e=>"number"==typeof e||"string"==typeof e||"boolean"==typeof e,D=e=>{if(Array.isArray(e)){let t=null;for(let n=0;nT?(i.text=r.text.substring(0,T),i.extraText=r.text.substring(T)):i.text=r.text,t[n]=i}return t}(e.comments),(e.currentCostume<0||e.currentCostume>=e.costumes.length)&&(c.warn("currentCostume property for target ".concat(e.name," is out of range")),e.currentCostume=d.clamp(e.currentCostume,0,e.costumes.length-1)),n.currentCostume=e.currentCostume,n.costumes=e.costumes.map(M),n.sounds=e.sounds.map(N),Object.prototype.hasOwnProperty.call(e,"volume")&&(n.volume=e.volume),Object.prototype.hasOwnProperty.call(e,"layerOrder")&&(n.layerOrder=e.layerOrder),n.isStage?(Object.prototype.hasOwnProperty.call(e,"tempo")&&(n.tempo=e.tempo),Object.prototype.hasOwnProperty.call(e,"videoTransparency")&&(n.videoTransparency=e.videoTransparency),Object.prototype.hasOwnProperty.call(e,"videoState")&&(n.videoState=e.videoState),Object.prototype.hasOwnProperty.call(e,"textToSpeechLanguage")&&(n.textToSpeechLanguage=e.textToSpeechLanguage)):(n.visible=e.visible,n.x=e.x,n.y=e.y,n.size=e.size,n.direction=e.direction,n.draggable=e.draggable,n.rotationStyle=e.rotationStyle),r.forEach((e=>{t.add(e)})),n},L=(e,t)=>{const n={};let r=!0;for(const[i,s]of Object.entries(e))t.has(i)&&null!=s&&(r=!1,n[i]=e[i]);return r?null:n},B=function(e,t,n,r){if(!Array.isArray(e))return e;const i=Object.create(null),o=u();switch(i.id=o,i.next=null,i.parent=t,i.shadow=n,i.inputs=Object.create(null),e[0]){case 4:i.opcode="math_number",i.fields={NUM:{name:"NUM",value:e[1]}},i.topLevel=!1;break;case 5:i.opcode="math_positive_number",i.fields={NUM:{name:"NUM",value:e[1]}},i.topLevel=!1;break;case 6:i.opcode="math_whole_number",i.fields={NUM:{name:"NUM",value:e[1]}},i.topLevel=!1;break;case 7:i.opcode="math_integer",i.fields={NUM:{name:"NUM",value:e[1]}},i.topLevel=!1;break;case 8:i.opcode="math_angle",i.fields={NUM:{name:"NUM",value:e[1]}},i.topLevel=!1;break;case 9:i.opcode="colour_picker",i.fields={COLOUR:{name:"COLOUR",value:e[1]}},i.topLevel=!1;break;case 10:i.opcode="text",i.fields={TEXT:{name:"TEXT",value:e[1]}},i.topLevel=!1;break;case 11:i.opcode="event_broadcast_menu",i.fields={BROADCAST_OPTION:{name:"BROADCAST_OPTION",value:e[1],id:e[2],variableType:s.BROADCAST_MESSAGE_TYPE}},i.topLevel=!1;break;case w:i.opcode="data_variable",i.fields={VARIABLE:{name:"VARIABLE",value:e[1],id:e[2],variableType:s.SCALAR_TYPE}},e.length>3&&(i.topLevel=!0,i.x=e[3],i.y=e[4]);break;case k:i.opcode="data_listcontents",i.fields={LIST:{name:"LIST",value:e[1],id:e[2],variableType:s.LIST_TYPE}},e.length>3&&(i.topLevel=!0,i.x=e[3],i.y=e[4]);break;default:return c.error("Found unknown primitive type during deserialization: ".concat(JSON.stringify(e))),null}return r[o]=i,o},z=function(e,t,n){const r={};for(const i in e){if(!v.call(e,i))continue;const s=e[i];if(!Array.isArray(s))continue;let o=null,a=null;const l=s[0];1===l?o=a=B(s[1],t,!0,n):2===l?o=B(s[1],t,!1,n):(o=B(s[1],t,!1,n),a=B(s[2],t,!0,n)),r[i]={name:i,block:o,shadow:a}}return r},U=function(e){const t={};for(const n in e){if(!v.call(e,n))continue;const r=e[n];Array.isArray(r)&&(t[n]={name:n,value:r[0]},r.length>1&&(t[n].id=r[1]),"BROADCAST_OPTION"===n?t[n].variableType=s.BROADCAST_MESSAGE_TYPE:"VARIABLE"===n?t[n].variableType=s.SCALAR_TYPE:"LIST"===n&&(t[n].variableType=s.LIST_TYPE))}return t},j=function(e){for(const t in e){if(!Object.prototype.hasOwnProperty.call(e,t))continue;const n=e[t];Array.isArray(n)?(delete e[t],B(n,null,!1,e)):(n.id=t,n.inputs=z(n.inputs,t,e),n.fields=U(n.fields))}return e};e.exports={serialize:function(e,t){let{allowOptimization:n=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Object.create(null),i=new Set,s=t?[e.getTargetById(t)]:e.targets.filter((e=>e.isOriginal)),o=function(e){const t=e.map((e=>e.getLayerOrder()));return d.reducedSortOrdering(t)}(s),a=s.map((e=>e.toJSON()));e.renderer&&!t&&a.forEach(((e,t)=>{e.layerOrder=o[t]}));const l=a.map((e=>P(e,i))).map(((e,t)=>{const n=s[t],r=L(n.extensionStorage,i);return r&&(e.extensionStorage=r),e})),c=e.fontManager.serializeJSON();if(t){const t=l[0];i.size&&(t.extensions=Array.from(i));const n=I(i,e);return n&&(t.extensionURLs=n),c&&(t.customFonts=c),l[0]}const u=L(e.extensionStorage,i);u&&(r.extensionStorage=u),r.targets=l,r.monitors=function(e,t,n){const r=(t.stageWidth-480)/2,i=(t.stageHeight-360)/2;return e.valueSeq().filter((e=>{const t=C(e.opcode);return!t||!!e.visible&&(n.add(t),!0)})).map((e=>{const t={id:e.id,mode:e.mode,opcode:e.opcode,params:e.params,spriteName:e.spriteName,value:Array.isArray(e.value)?[]:0,width:e.width,height:e.height,x:e.x-r,y:e.y-i,visible:e.visible};return"list"!==e.mode&&(t.sliderMin=e.sliderMin,t.sliderMax=e.sliderMax,t.isDiscrete=e.isDiscrete),t})).toArray()}(e.getMonitorState(),e,i),r.extensions=Array.from(i);const h=I(i,e);h&&(r.extensionURLs=h),c&&(r.customFonts=c);const p=Object.create(null);return p.semver="3.0.0",p.vm="0.2.0",e.origin&&(p.origin=e.origin),p.agent="",r.meta=p,n&&m(r),r},deserialize:function(e,t,n,u){const m={extensionIDs:new Set,extensionURLs:new Map};if(e.meta&&e.meta.origin?t.origin=e.meta.origin:t.origin=null,e.extensionURLs)for(const[t,n]of Object.entries(e.extensionURLs))m.extensionURLs.set(t,n);let v;v=e.customFonts?t.fontManager.deserialize(e.customFonts,n,u):Promise.resolve();const S=((u?[e]:e.targets)||[]).map(((e,t)=>Object.assign(e,{targetPaneOrder:t}))).sort(((e,t)=>e.layerOrder-t.layerOrder)),w=e.monitors||[];return v.then((()=>S.map((e=>function(e,t,n){if(!Object.prototype.hasOwnProperty.call(e,"name"))return Promise.resolve(null);const r={costumePromises:null,soundPromises:null,soundBank:t.audioEngine&&t.audioEngine.createBank()};return r.costumePromises=(e.costumes||[]).map((e=>{const r={asset:e.asset,assetId:e.assetId,skinId:null,name:e.name,bitmapResolution:e.bitmapResolution,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY},i=e.dataFormat||e.assetType&&e.assetType.runtimeFormat||"png",s=Object.prototype.hasOwnProperty.call(e,"md5ext")?e.md5ext:"".concat(e.assetId,".").concat(i);return r.md5=s,r.dataFormat=i,t.wrapAssetRequest(y(r,t,n).then((()=>f(s,r,t))))})),r.soundPromises=(e.sounds||[]).map((e=>{const i={assetId:e.assetId,format:e.format,rate:e.rate,sampleCount:e.sampleCount,name:e.name,md5:e.md5ext,dataFormat:e.dataFormat,data:null};return t.wrapAssetRequest(b(i,t,n).then((()=>g(i,t,r.soundBank))))})),r}(e,t,n))))).then((e=>Promise.resolve(e))).then((e=>Promise.all(S.map(((n,a)=>function(e,t,n,a,c){if(!Object.prototype.hasOwnProperty.call(e,"name"))return Promise.resolve(null);const u=new r(t),h=new i(u,t);if(Object.prototype.hasOwnProperty.call(e,"name")&&(h.name=e.name),Object.prototype.hasOwnProperty.call(e,"blocks")){j(e.blocks);for(const t in e.blocks){if(!Object.prototype.hasOwnProperty.call(e.blocks,t))continue;const r=e.blocks[t];u.createBlock(r);const i=C(r.opcode);i&&n.extensionIDs.add(i)}}const{costumePromises:p}=c,{soundBank:m,soundPromises:f}=c,g=h.createClone(e.isStage?l.BACKGROUND_LAYER:l.SPRITE_LAYER);if(Object.prototype.hasOwnProperty.call(e,"tempo")&&(g.tempo=e.tempo),Object.prototype.hasOwnProperty.call(e,"volume")&&(g.volume=e.volume),Object.prototype.hasOwnProperty.call(e,"videoTransparency")&&(g.videoTransparency=e.videoTransparency),Object.prototype.hasOwnProperty.call(e,"videoState")&&(g.videoState=e.videoState),Object.prototype.hasOwnProperty.call(e,"textToSpeechLanguage")&&(g.textToSpeechLanguage=e.textToSpeechLanguage),Object.prototype.hasOwnProperty.call(e,"variables"))for(const n in e.variables){const r=e.variables[n],i=3===r.length&&r[2]&&e.isStage&&t.canAddCloudVariable(),o=new s(n,r[0],s.SCALAR_TYPE,i);i&&t.addCloudVariable(),o.value=r[1],g.variables[o.id]=o}if(Object.prototype.hasOwnProperty.call(e,"lists"))for(const t in e.lists){const n=e.lists[t],r=new s(t,n[0],s.LIST_TYPE,!1);r.value=n[1],g.variables[r.id]=r}if(Object.prototype.hasOwnProperty.call(e,"broadcasts"))for(const t in e.broadcasts){const n=e.broadcasts[t],r=new s(t,n,s.BROADCAST_MESSAGE_TYPE,!1);g.variables[r.id]=r}if(Object.prototype.hasOwnProperty.call(e,"comments"))for(const t in e.comments){const n=e.comments[t],r=new o(t,n.text+("string"==typeof n.extraText?n.extraText:""),n.x,n.y,n.width,n.height,n.minimized);n.blockId&&(r.blockId=n.blockId),g.comments[r.id]=r}return Object.prototype.hasOwnProperty.call(e,"x")&&(g.x=e.x),Object.prototype.hasOwnProperty.call(e,"y")&&(g.y=e.y),Object.prototype.hasOwnProperty.call(e,"direction")&&(g.direction=d.wrapClamp(e.direction,-179,180)),Object.prototype.hasOwnProperty.call(e,"size")&&(g.size=e.size),Object.prototype.hasOwnProperty.call(e,"visible")&&(g.visible=e.visible),Object.prototype.hasOwnProperty.call(e,"currentCostume")&&(g.currentCostume=d.clamp(e.currentCostume,0,e.costumes.length-1)),Object.prototype.hasOwnProperty.call(e,"rotationStyle")&&(g.rotationStyle=e.rotationStyle),Object.prototype.hasOwnProperty.call(e,"isStage")&&(g.isStage=e.isStage),Object.prototype.hasOwnProperty.call(e,"targetPaneOrder")&&(g.targetPaneOrder=e.targetPaneOrder),Object.prototype.hasOwnProperty.call(e,"draggable")&&(g.draggable=e.draggable),Object.prototype.hasOwnProperty.call(e,"extensionStorage")&&(g.extensionStorage=e.extensionStorage),Promise.all(p).then((e=>{h.costumes=e})),Promise.all(f).then((e=>{h.sounds=e,h.soundBank=m||null})),Promise.all(p.concat(f)).then((()=>g))}(n,t,m,0,e[a])))))).then((e=>e.map(((e,t)=>(e.layerOrder=t,e))).sort(((e,t)=>e.targetPaneOrder-t.targetPaneOrder)).map((e=>(delete e.targetPaneOrder,e))))).then((e=>function(e){const t=p.getAllVarRefsForTargets(e,!0);e.forEach((e=>{Object.keys(e.variables).forEach((t=>{const n=h.replaceUnsafeChars(t);n!==t&&(e.variables[t].id=n,e.variables[n]=e.variables[t],delete e.variables[t])}))}));for(const e in t){const n=h.replaceUnsafeChars(e);e!==n&&p.updateVariableIdentifiers(t[e],n)}return e}(e))).then((n=>(w.map((e=>function(e,t,n,r){const i=(t.stageWidth-480)/2,o=(t.stageHeight-360)/2;if(e.x+=i,e.y+=o,e.x=d.clamp(e.x,0,t.stageWidth),e.y=d.clamp(e.y,0,t.stageHeight),e.spriteName){const t=n.filter((t=>t.sprite.name===e.spriteName));t&&t.length>0?e.targetId=t[0].id:c.warn("Tried to deserialize sprite specific monitor ".concat(e.opcode," but could not find sprite ").concat(e.spriteName,"."))}const l=t.monitorBlockInfo[e.opcode];if("data_listcontents"===e.opcode){const t=e.targetId?n.find((t=>t.id===e.targetId)):n.find((e=>e.isStage));t&&Object.prototype.hasOwnProperty.call(t.variables,e.id)&&(e.params.LIST=t.variables[e.id].name)}const u={};for(const t in e.params){const n={name:t,value:e.params[t]};u[t]=n}"data_variable"!==e.opcode&&"data_listcontents"!==e.opcode&&l&&l.isSpriteSpecific?e.id=l.getId(e.targetId,u):e.id=h.replaceUnsafeChars(e.id);const p=t.monitorBlocks._blocks[e.id];if(p)p.isMonitored=e.visible,p.targetId=e.targetId;else{const n={id:e.id,opcode:e.opcode,inputs:{},fields:u,topLevel:!0,next:null,parent:null,shadow:!1,x:0,y:0,isMonitored:e.visible,targetId:e.targetId};if("data_variable"===e.opcode){const t=n.fields.VARIABLE;t.id=e.id,t.variableType=s.SCALAR_TYPE}else if("data_listcontents"===e.opcode){const t=n.fields.LIST;t.id=e.id,t.variableType=s.LIST_TYPE}t.monitorBlocks.createBlock(n);const i=C(n.opcode);i&&r.extensionIDs.add(i)}t.requestAddMonitor(a(e))}(e,t,n,m))),Object.prototype.hasOwnProperty.call(e,"extensionStorage")&&(t.extensionStorage=e.extensionStorage),n))).then((e=>({targets:e,extensions:m})))},deserializeBlocks:j,serializeBlocks:O,deserializeStandaloneBlocks:e=>{if((e=JSON.parse(JSON.stringify(e))).extensionURLs){const t=new Map;for(const[n,r]of Object.entries(e.extensionURLs))t.set(n,r);return{blocks:e.blocks,extensionURLs:t}}return{blocks:e,extensionURLs:new Map}},serializeStandaloneBlocks:(e,t)=>{const n=new Set;for(const t of e){const e=C(t.opcode);e&&n.add(e)}const r=I(n,t);return r?{blocks:e,extensionURLs:r}:e},getExtensionIdForOpcode:C}},function(e,t,n){const r=n(11),i=n(38),s=n(394);e.exports=class{constructor(e,t){this._renderer=t,this._id=e,this._rotationCenter=r.v3.create(0,0),this._texture=null,this._uniforms={u_skinSize:[0,0],u_skin:null},this._silhouette=new s,this.private=!1}dispose(){this._id=i.ID_NONE}get id(){return this._id}get rotationCenter(){return this._rotationCenter}get size(){return[0,0]}useNearest(e,t){return!0}calculateRotationCenter(){return[this.size[0]/2,this.size[1]/2]}getTexture(e){return this._emptyImageTexture}getFenceBounds(e,t){return e.getAABB(t)}getUniforms(e){return this._uniforms.u_skin=this.getTexture(e),this._uniforms.u_skinSize=this.size,this._uniforms}emitWasAltered(){this._renderer.skinWasAltered(this)}updateSilhouette(){this._silhouette.unlazy()}_setTexture(e){const t=this._renderer.gl;t.bindTexture(t.TEXTURE_2D,this._texture),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),this._silhouette.update(e)}setEmptyImageData(){if(this._texture=null,!this._emptyImageData){this._emptyImageData=new ImageData(1,1);const e=this._renderer.gl,t={auto:!0,wrap:e.CLAMP_TO_EDGE,src:this._emptyImageData};this._emptyImageTexture=r.createTexture(e,t)}this._rotationCenter[0]=0,this._rotationCenter[1]=0,this._silhouette.update(this._emptyImageData),this.emitWasAltered()}isTouchingNearest(e){return this._silhouette.isTouchingNearest(e)}isTouchingLinear(e){return this._silhouette.isTouchingLinear(e)}}},function(e,t,n){const r=n(11);class i{constructor(e){this._gl=e,this._shaderCache={};for(const e in i.DRAW_MODE)Object.prototype.hasOwnProperty.call(i.DRAW_MODE,e)&&(this._shaderCache[e]=[])}getShader(e,t){const n=this._shaderCache[e];e===i.DRAW_MODE.silhouette&&(t&=~(i.EFFECT_INFO.color.mask|i.EFFECT_INFO.brightness.mask));let r=n[t];return r||(r=n[t]=this._buildShader(e,t)),r}_buildShader(e,t){const s=i.EFFECTS.length,o=["#define DRAW_MODE_".concat(e)];for(let e=0;ee/200%1,shapeChanges:!1},fisheye:{uniformName:"u_fisheye",mask:2,converter:e=>Math.max(0,(e+100)/100),shapeChanges:!0},whirl:{uniformName:"u_whirl",mask:4,converter:e=>-e*Math.PI/180,shapeChanges:!0},pixelate:{uniformName:"u_pixelate",mask:8,converter:e=>Math.abs(e)/10,shapeChanges:!0},mosaic:{uniformName:"u_mosaic",mask:16,converter:e=>(e=Math.round((Math.abs(e)+10)/10),Math.max(1,Math.min(e,512))),shapeChanges:!0},brightness:{uniformName:"u_brightness",mask:32,converter:e=>Math.max(-100,Math.min(e,100))/100,shapeChanges:!1},ghost:{uniformName:"u_ghost",mask:64,converter:e=>1-Math.max(0,Math.min(e,100))/100,shapeChanges:!1}},i.EFFECTS=Object.keys(i.EFFECT_INFO),i.DRAW_MODE={default:"default",straightAlpha:"straightAlpha",silhouette:"silhouette",colorMask:"colorMask",line:"line",background:"background"},e.exports=i},function(e,t,n){const r=n(69);e.exports=class extends r{constructor(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;super(),this._socket=e.getScratchLinkSocket("BLE"),this._socket.setOnOpen(this.requestPeripheral.bind(this)),this._socket.setOnClose(this.handleDisconnectError.bind(this)),this._socket.setOnError(this._handleRequestError.bind(this)),this._socket.setHandleMessage(this._handleMessage.bind(this)),this._sendMessage=this._socket.sendMessage.bind(this._socket),this._availablePeripherals={},this._connectCallback=r,this._connected=!1,this._characteristicDidChangeCallback=null,this._resetCallback=i,this._discoverTimeoutID=null,this._extensionId=t,this._peripheralOptions=n,this._runtime=e,this._socket.open()}requestPeripheral(){this._availablePeripherals={},this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID),this._discoverTimeoutID=window.setTimeout(this._handleDiscoverTimeout.bind(this),15e3),this.sendRemoteRequest("discover",this._peripheralOptions).catch((e=>{this._handleRequestError(e)}))}connectPeripheral(e){this.sendRemoteRequest("connect",{peripheralId:e}).then((()=>{this._connected=!0,this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED),this._connectCallback()})).catch((e=>{this._handleRequestError(e)}))}disconnect(){this._connected&&(this._connected=!1),this._socket.isOpen()&&this._socket.close(),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID),this._runtime.emit(this._runtime.constructor.PERIPHERAL_DISCONNECTED)}isConnected(){return this._connected}startNotifications(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r={serviceId:e,characteristicId:t};return this._characteristicDidChangeCallback=n,this.sendRemoteRequest("startNotifications",r).catch((e=>{this.handleDisconnectError(e)}))}read(e,t){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const r={serviceId:e,characteristicId:t};return arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&(r.startNotifications=!0),n&&(this._characteristicDidChangeCallback=n),this.sendRemoteRequest("read",r).catch((e=>{this.handleDisconnectError(e)}))}write(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const s={serviceId:e,characteristicId:t,message:n};return r&&(s.encoding=r),null!==i&&(s.withResponse=i),this.sendRemoteRequest("write",s).catch((e=>{this.handleDisconnectError(e)}))}didReceiveCall(e,t){switch(e){case"didDiscoverPeripheral":this._availablePeripherals[t.peripheralId]=t,this._runtime.emit(this._runtime.constructor.PERIPHERAL_LIST_UPDATE,this._availablePeripherals),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID);break;case"userDidPickPeripheral":this._availablePeripherals[t.peripheralId]=t,this._runtime.emit(this._runtime.constructor.USER_PICKED_PERIPHERAL,this._availablePeripherals),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID);break;case"userDidNotPickPeripheral":this._runtime.emit(this._runtime.constructor.PERIPHERAL_SCAN_TIMEOUT),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID);break;case"characteristicDidChange":this._characteristicDidChangeCallback&&this._characteristicDidChangeCallback(t.message);break;case"ping":return 42}}handleDisconnectError(){this._connected&&(this.disconnect(),this._resetCallback&&this._resetCallback(),this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTION_LOST_ERROR,{message:"Scratch lost connection to",extensionId:this._extensionId}))}_handleRequestError(){this._runtime.emit(this._runtime.constructor.PERIPHERAL_REQUEST_ERROR,{message:"Scratch lost connection to",extensionId:this._extensionId})}_handleDiscoverTimeout(){this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID),this._runtime.emit(this._runtime.constructor.PERIPHERAL_SCAN_TIMEOUT)}}},function(e,t,n){const r=n(1);e.exports=function(e){if("string"!=typeof e){if(!Array.isArray(e))return r.error("Unexpected input recieved in replaceUnsafeChars"),e;e=String(e)}return e.replace(/[<>&'"]/g,(e=>{switch(e){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case'"':return"""}}))}},function(e,t,n){const r=n(7),i=n(1),s=function(e,t,n,r){return e.assetId=t.assetId,n.audioEngine?n.audioEngine.decodeSoundPlayer(Object.assign({},e,{data:t.data})).then((t=>{e.soundId=t.id;const i=t.buffer;return e.rate=i.sampleRate,e.sampleCount=i.length,null!==r&&r.addSoundPlayer(t),n.isPackaged&&(e.asset=null),e})):(i.warn("No audio engine present; cannot load sound asset: ",e.md5),Promise.resolve(e))},o=function(e,t,n){const r=e.asset,i=e.assetId,o=e.sampleCount,a=e.rate,l=e.format,c=e.dataFormat;return e.assetId=t.storage.defaultAssetId.Sound,e.asset=t.storage.get(e.assetId),e.md5="".concat(e.assetId,".").concat(e.asset.dataFormat),s(e,e.asset,t,n).then((e=>(e.broken={},e.broken.assetId=i,e.broken.md5="".concat(i,".").concat(c),e.broken.asset=r,e.broken.sampleCount=o,e.broken.rate=a,e.broken.format=l,e.broken.dataFormat=c,e)))};e.exports={loadSound:function(e,t,n){if(!t.storage)return i.warn("No storage module present; cannot load sound asset: ",e.md5),Promise.resolve(e);const a=r.splitFirst(e.md5,"."),l=a[0],c=a[1].toLowerCase();return e.dataFormat=c,(e.asset&&Promise.resolve(e.asset)||t.storage.load(t.storage.AssetType.Sound,l,c)).then((r=>(e.asset=r,r?s(e,r,t,n):(i.warn("Failed to find sound data: ",e.md5),o(e,t,n))))).catch((r=>(i.warn("Failed to load sound: ".concat(e.md5," with error: ").concat(r)),o(e,t,n))))},loadSoundFromAsset:s}},function(e,t,n){const r=n(7),i=n(1),s=n(83),{loadSvgString:o,serializeSvgToString:a}=n(35),{parseVectorMetadata:l}=n(103),c=function(e,t,n,r){return new Promise((i=>{let s=e.asset.decodeText();if(void 0===n){const t=l(s);t&&(n=t,e.rotationCenterX=n[0],e.rotationCenterY=n[1])}if(r&&2===r){const n=a(o(s,!0));if(s!==n){s=n;const r=t.storage;e.asset.encodeTextData(n,r.DataFormat.SVG,!0),e.assetId=e.asset.assetId,e.md5="".concat(e.assetId,".").concat(e.dataFormat)}}e.skinId=t.renderer.createSVGSkin(s,n),e.size=t.renderer.getSkinSize(e.skinId),n||(n=t.renderer.getSkinRotationCenter(e.skinId),e.rotationCenterX=n[0],e.rotationCenterY=n[1],e.bitmapResolution=1),t.isPackaged&&(e.asset=null),i(e)}))},u=new class{constructor(){this.pool=[],this.clearSoon=null}clear(){this.clearSoon||(this.clearSoon=new Promise((e=>setTimeout(e,1e3))).then((()=>{this.pool.length=0,this.clearSoon=null})))}create(){return this.pool.pop()||document.createElement("canvas")}release(e){this.clear(),this.pool.push(e)}},d=e=>new Promise(((t,n)=>{const r=new Image;r.onload=function(){t(r),r.onload=null,r.onerror=null},r.onerror=function(){n(new Error("Costume load failed. Asset could not be read.")),r.onload=null,r.onerror=null},r.src=e})),h=new s((async e=>{let t;for(let n=0;n<3;n++)try{if("function"==typeof createImageBitmap){const t=await createImageBitmap(new Blob([e.data.buffer],{type:e.assetType.contentType}));if(!t)throw new Error("createImageBitmap resolved with ".concat(t));return t}return await d(e.encodeDataURI())}catch(e){t||(t=e),i.warn(e),await new Promise((e=>setTimeout(e,2e3*Math.random())))}throw t}),25),p=function(e,t,n){return function(e,t,n){return e&&e.asset?t.v2BitmapAdapter?Promise.all([e.asset,e.textLayerAsset].map((e=>e?h.do(e):null))).then((r=>{let[i,s]=r;if(!i)throw new Error("Loading bitmap costume base failed.");const o=1===e.bitmapResolution?2:1;let a,l;if(s){l=u.create(),l.width=i.width,l.height=i.height;const e=l.getContext("2d");e.drawImage(i,0,0),e.drawImage(s,0,0),a=l}else a=i;return 1!==o&&(a=t.v2BitmapAdapter.resize(a,a.width*o,a.height*o),l&&u.release(l)),a.reusable=!1,n&&(n[0]=n[0]*o,n[1]=n[1]*o,e.rotationCenterX=n[0],e.rotationCenterY=n[1]),e.bitmapResolution=2,delete e.textLayerMD5,delete e.textLayerAsset,{image:a,rotationCenter:n,assetMatchesBase:1===o&&!s}})).finally((()=>{delete e.textLayerMD5,delete e.textLayerAsset})):Promise.reject("No V2 Bitmap adapter present."):Promise.reject("Costume load failed. Assets were missing.")}(e,t,n).then((n=>(n.assetMatchesBase||function(n){if(!t.v2BitmapAdapter)return Promise.reject("No V2 Bitmap adapter present.");const r=t.storage;e.asset=r.createAsset(r.AssetType.ImageBitmap,r.DataFormat.PNG,t.v2BitmapAdapter.convertDataURIToBinary(n),null,!0),e.dataFormat=r.DataFormat.PNG,e.assetId=e.asset.assetId,e.md5="".concat(e.assetId,".").concat(e.dataFormat)}((e=>{if(e instanceof HTMLCanvasElement)return e.toDataURL();const t=u.create();t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0);const n=t.toDataURL();return u.release(t),n})(n.image)),n))).then((n=>{let r,{image:i,rotationCenter:s}=n;s&&(r=[s[0]/2,s[1]/2]),e.skinId=t.renderer.createBitmapSkin(i,e.bitmapResolution,r);const o=t.renderer.getSkinSize(e.skinId);return e.size=[2*o[0],2*o[1]],s||(s=t.renderer.getSkinRotationCenter(e.skinId),e.rotationCenterX=2*s[0],e.rotationCenterY=2*s[1],e.bitmapResolution=2),t.isPackaged&&(e.asset=null),e}))},m=function(e,t){const n=e.asset,r=e.assetId,i=e.rotationCenterX,s=e.rotationCenterY,o=e.bitmapResolution,a=e.dataFormat,l=t.storage.AssetType,u=e.dataFormat===l.ImageVector.runtimeFormat;e.assetId=u?t.storage.defaultAssetId.ImageVector:t.storage.defaultAssetId.ImageBitmap,e.asset=t.storage.get(e.assetId),e.md5="".concat(e.assetId,".").concat(e.asset.dataFormat);return(u?c(e,t):p(e,t)).then((e=>(e.broken={},e.broken.assetId=r,e.broken.md5="".concat(r,".").concat(a),e.broken.asset=n,e.broken.dataFormat=a,e.broken.rotationCenterX=i,e.broken.rotationCenterY=s,e.broken.bitmapResolution=o,e)))},f=function(e,t,n){e.assetId=e.asset.assetId;if(!t.renderer)return i.warn("No rendering module present; cannot load costume: ",e.name),Promise.resolve(e);const r=t.storage.AssetType;let s;return"number"!=typeof e.rotationCenterX||isNaN(e.rotationCenterX)||"number"!=typeof e.rotationCenterY||isNaN(e.rotationCenterY)||(s=[e.rotationCenterX,e.rotationCenterY]),e.asset.assetType.runtimeFormat===r.ImageVector.runtimeFormat?c(e,t,s,n).catch((n=>(i.warn("Error loading vector image: ".concat(n)),m(e,t)))):p(e,t,s).catch((n=>(i.warn("Error loading bitmap image: ".concat(n)),m(e,t))))};e.exports={loadCostume:function(e,t,n,s){const o=r.splitFirst(e,"."),a=o[0],l=o[1].toLowerCase();if(t.dataFormat=l,t.asset)return f(t,n,s);if(!n.storage)return i.warn("No storage module present; cannot load costume asset: ",e),Promise.resolve(t);if(!n.storage.defaultAssetId)return i.warn("No default assets found"),Promise.resolve(t);const c=n.storage.AssetType,u="svg"===l?c.ImageVector:c.ImageBitmap,d=n.storage.load(u,a,l);let h;return h=t.textLayerMD5?n.storage.load(c.ImageBitmap,t.textLayerMD5,"png"):Promise.resolve(null),Promise.all([d,h]).then((e=>e[0]?(t.asset=e[0],e[1]&&(t.textLayerAsset=e[1]),f(t,n,s)):m(t,n))).catch((e=>(i.warn("Error loading costume: ",e),m(t,n))))},loadCostumeFromAsset:f}},function(e,t,n){const r=n(254),i=n(276),s=n(91),o=n(85),a=n(278),l=n(90),c=n(53),u=n(87);e.exports={BitmapAdapter:i,convertFonts:u,inlineSvgFonts:s,loadSvgString:o,sanitizeSvg:a,serializeSvgToString:l,SvgElement:c,SVGRenderer:r}},function(e,t,n){var r=n(37),i=r.TYPE,s=r.NAME,o=n(27).cmpStr,a=i.EOF,l=i.WhiteSpace,c=i.Comment,u=16777215,d=24,h=function(){this.offsetAndType=null,this.balance=null,this.reset()};h.prototype={reset:function(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset},lookupType:function(e){return(e+=this.tokenIndex)>d:a},lookupOffset:function(e){return(e+=this.tokenIndex)0?e>d,this.source,i)){case 1:break e;case 2:r++;break e;default:this.balance[n]===r&&(r=n),i=this.offsetAndType[r]&u}return r-this.tokenIndex},isBalanceEdge:function(e){return this.balance[this.tokenIndex]>d===l;e++,t++);t>0&&this.skip(t)},skipSC:function(){for(;this.tokenType===l||this.tokenType===c;)this.next()},skip:function(e){var t=this.tokenIndex+e;t>d,this.tokenEnd=t&u):(this.tokenIndex=this.tokenCount,this.next())},next:function(){var e=this.tokenIndex+1;e>d,this.tokenEnd=e&u):(this.tokenIndex=this.tokenCount,this.eof=!0,this.tokenType=a,this.tokenStart=this.tokenEnd=this.source.length)},forEachToken(e){for(var t=0,n=this.firstCharOffset;t>d,r,s,t)}},dump(){var e=new Array(this.tokenCount);return this.forEachToken(((t,n,r,i)=>{e[i]={idx:i,type:s[t],chunk:this.source.substring(n,r),balance:this.balance[i]}})),e}},e.exports=h},function(e,t){var n={EOF:0,Ident:1,Function:2,AtKeyword:3,Hash:4,String:5,BadString:6,Url:7,BadUrl:8,Delim:9,Number:10,Percentage:11,Dimension:12,WhiteSpace:13,CDO:14,CDC:15,Colon:16,Semicolon:17,Comma:18,LeftSquareBracket:19,RightSquareBracket:20,LeftParenthesis:21,RightParenthesis:22,LeftCurlyBracket:23,RightCurlyBracket:24,Comment:25},r=Object.keys(n).reduce((function(e,t){return e[n[t]]=t,e}),{});e.exports={TYPE:n,NAME:r}},function(e,t){e.exports={ID_NONE:-1,Events:{UseHighQualityRenderChanged:"UseHighQualityRenderChanged",AllowPrivateSkinAccessChanged:"AllowPrivateSkinAccessChanged",NativeSizeChanged:"NativeSizeChanged"}}},function(e,t,n){const r=n(42);r.enable(),e.exports=r("scratch-audioengine")},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__;(function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(384),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t){return new Md5(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t>2]|=e[s]<>6,l[i++]=128|63&r):r<55296||r>=57344?(l[i++]=224|r>>12,l[i++]=128|r>>6&63,l[i++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++s)),l[i++]=240|r>>18,l[i++]=128|r>>12&63,l[i++]=128|r>>6&63,l[i++]=128|63&r);else for(i=this.start;s>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(a[i>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=64?(this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,r,i,s,o=this.blocks;this.first?t=((t=((e=((e=o[0]-680876937)<<7|e>>>25)-271733879|0)^(n=((n=(-271733879^(r=((r=(-1732584194^2004318071&e)+o[1]-117830708)<<12|r>>>20)+e|0)&(-271733879^e))+o[2]-1126478375)<<17|n>>>15)+r|0)&(r^e))+o[3]-1316259209)<<22|t>>>10)+n|0:(e=this.h0,t=this.h1,n=this.h2,t=((t+=((e=((e+=((r=this.h3)^t&(n^r))+o[0]-680876936)<<7|e>>>25)+t|0)^(n=((n+=(t^(r=((r+=(n^e&(t^n))+o[1]-389564586)<<12|r>>>20)+e|0)&(e^t))+o[2]+606105819)<<17|n>>>15)+r|0)&(r^e))+o[3]-1044525330)<<22|t>>>10)+n|0),t=((t+=((e=((e+=(r^t&(n^r))+o[4]-176418897)<<7|e>>>25)+t|0)^(n=((n+=(t^(r=((r+=(n^e&(t^n))+o[5]+1200080426)<<12|r>>>20)+e|0)&(e^t))+o[6]-1473231341)<<17|n>>>15)+r|0)&(r^e))+o[7]-45705983)<<22|t>>>10)+n|0,t=((t+=((e=((e+=(r^t&(n^r))+o[8]+1770035416)<<7|e>>>25)+t|0)^(n=((n+=(t^(r=((r+=(n^e&(t^n))+o[9]-1958414417)<<12|r>>>20)+e|0)&(e^t))+o[10]-42063)<<17|n>>>15)+r|0)&(r^e))+o[11]-1990404162)<<22|t>>>10)+n|0,t=((t+=((e=((e+=(r^t&(n^r))+o[12]+1804603682)<<7|e>>>25)+t|0)^(n=((n+=(t^(r=((r+=(n^e&(t^n))+o[13]-40341101)<<12|r>>>20)+e|0)&(e^t))+o[14]-1502002290)<<17|n>>>15)+r|0)&(r^e))+o[15]+1236535329)<<22|t>>>10)+n|0,t=((t+=((r=((r+=(t^n&((e=((e+=(n^r&(t^n))+o[1]-165796510)<<5|e>>>27)+t|0)^t))+o[6]-1069501632)<<9|r>>>23)+e|0)^e&((n=((n+=(e^t&(r^e))+o[11]+643717713)<<14|n>>>18)+r|0)^r))+o[0]-373897302)<<20|t>>>12)+n|0,t=((t+=((r=((r+=(t^n&((e=((e+=(n^r&(t^n))+o[5]-701558691)<<5|e>>>27)+t|0)^t))+o[10]+38016083)<<9|r>>>23)+e|0)^e&((n=((n+=(e^t&(r^e))+o[15]-660478335)<<14|n>>>18)+r|0)^r))+o[4]-405537848)<<20|t>>>12)+n|0,t=((t+=((r=((r+=(t^n&((e=((e+=(n^r&(t^n))+o[9]+568446438)<<5|e>>>27)+t|0)^t))+o[14]-1019803690)<<9|r>>>23)+e|0)^e&((n=((n+=(e^t&(r^e))+o[3]-187363961)<<14|n>>>18)+r|0)^r))+o[8]+1163531501)<<20|t>>>12)+n|0,t=((t+=((r=((r+=(t^n&((e=((e+=(n^r&(t^n))+o[13]-1444681467)<<5|e>>>27)+t|0)^t))+o[2]-51403784)<<9|r>>>23)+e|0)^e&((n=((n+=(e^t&(r^e))+o[7]+1735328473)<<14|n>>>18)+r|0)^r))+o[12]-1926607734)<<20|t>>>12)+n|0,t=((t+=((s=(r=((r+=((i=t^n)^(e=((e+=(i^r)+o[5]-378558)<<4|e>>>28)+t|0))+o[8]-2022574463)<<11|r>>>21)+e|0)^e)^(n=((n+=(s^t)+o[11]+1839030562)<<16|n>>>16)+r|0))+o[14]-35309556)<<23|t>>>9)+n|0,t=((t+=((s=(r=((r+=((i=t^n)^(e=((e+=(i^r)+o[1]-1530992060)<<4|e>>>28)+t|0))+o[4]+1272893353)<<11|r>>>21)+e|0)^e)^(n=((n+=(s^t)+o[7]-155497632)<<16|n>>>16)+r|0))+o[10]-1094730640)<<23|t>>>9)+n|0,t=((t+=((s=(r=((r+=((i=t^n)^(e=((e+=(i^r)+o[13]+681279174)<<4|e>>>28)+t|0))+o[0]-358537222)<<11|r>>>21)+e|0)^e)^(n=((n+=(s^t)+o[3]-722521979)<<16|n>>>16)+r|0))+o[6]+76029189)<<23|t>>>9)+n|0,t=((t+=((s=(r=((r+=((i=t^n)^(e=((e+=(i^r)+o[9]-640364487)<<4|e>>>28)+t|0))+o[12]-421815835)<<11|r>>>21)+e|0)^e)^(n=((n+=(s^t)+o[15]+530742520)<<16|n>>>16)+r|0))+o[2]-995338651)<<23|t>>>9)+n|0,t=((t+=((r=((r+=(t^((e=((e+=(n^(t|~r))+o[0]-198630844)<<6|e>>>26)+t|0)|~n))+o[7]+1126891415)<<10|r>>>22)+e|0)^((n=((n+=(e^(r|~t))+o[14]-1416354905)<<15|n>>>17)+r|0)|~e))+o[5]-57434055)<<21|t>>>11)+n|0,t=((t+=((r=((r+=(t^((e=((e+=(n^(t|~r))+o[12]+1700485571)<<6|e>>>26)+t|0)|~n))+o[3]-1894986606)<<10|r>>>22)+e|0)^((n=((n+=(e^(r|~t))+o[10]-1051523)<<15|n>>>17)+r|0)|~e))+o[1]-2054922799)<<21|t>>>11)+n|0,t=((t+=((r=((r+=(t^((e=((e+=(n^(t|~r))+o[8]+1873313359)<<6|e>>>26)+t|0)|~n))+o[15]-30611744)<<10|r>>>22)+e|0)^((n=((n+=(e^(r|~t))+o[6]-1560198380)<<15|n>>>17)+r|0)|~e))+o[13]+1309151649)<<21|t>>>11)+n|0,t=((t+=((r=((r+=(t^((e=((e+=(n^(t|~r))+o[4]-145523070)<<6|e>>>26)+t|0)|~n))+o[11]-1120210379)<<10|r>>>22)+e|0)^((n=((n+=(e^(r|~t))+o[2]+718787259)<<15|n>>>17)+r|0)|~e))+o[9]-343485551)<<21|t>>>11)+n|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=n-1732584194|0,this.h3=r+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+n|0,this.h3=this.h3+r|0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,r="",i=this.array(),s=0;s<15;)e=i[s++],t=i[s++],n=i[s++],r+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=i[s],r+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()}).call(this,__webpack_require__(41),__webpack_require__(9))},function(e,t){var n,r,i=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var l,c=[],u=!1,d=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&p())}function p(){if(!u){var e=a(h);u=!0;for(var t=c.length;t;){for(l=c,c=[];++d1)for(var n=1;n{const t=t=>c(e?`${e} ${t}`:t),n=e?[`${i}${e}${r}`]:[];return t.debug=t.log=console.debug.bind(console,...n,s),t.info=console.log.bind(console,...n,o),t.warn=t.warning=console.warn.bind(console,...n,a),t.error=console.error.bind(console,...n,l),t};c.enable=c.disable=()=>{},e.exports=c},function(e,t){e.exports={SPRITE:"sprite",STAGE:"stage"}},function(e,t,n){const r=n(14);e.exports=class{constructor(e){this._maxTokens=e,this._refillInterval=1e3/e,this._count=this._maxTokens,this._timer=new r,this._timer.start(),this._lastUpdateTime=this._timer.timeElapsed()}okayToSend(){const e=this._timer.timeElapsed(),t=e-this._lastUpdateTime,n=Math.floor(t/this._refillInterval);return n>0&&(this._lastUpdateTime=e),this._count=Math.min(this._maxTokens,this._count+n),this._count>0&&(this._count--,!0)}}},function(e,t,n){(function(t){let n=t.fetch;e.exports={fetchWithTimeout:(e,t,r)=>{let i=null;const s=window.AbortController?new window.AbortController:null,o=s?s.signal:null;return Promise.race([n(e,Object.assign({signal:o},t)).then((e=>(clearTimeout(i),e)),(e=>{throw clearTimeout(i),e})),new Promise(((e,t)=>{i=setTimeout((()=>{s&&s.abort(),t(new Error("Fetch timed out after ".concat(r," ms")))}),r)}))])},setFetch:e=>{n=e}}}).call(this,n(9))},function(e,t,n){const{Record:r}=n(25),i=r({id:null,spriteName:null,targetId:null,opcode:null,value:null,params:null,mode:"default",sliderMin:0,sliderMax:100,isDiscrete:!0,x:null,y:null,width:0,height:0,visible:!0});e.exports=i},function(e,t){e.exports=function(e,t){let n="";for(const e in t){let r=t[e].value;"CURRENTMENU"===e&&(r=r.toLowerCase()),n+="_".concat(r)}return"".concat(e).concat(n)}},function(e,t,n){const r=n(2),i=n(7),s=n(3),o=n(10),a=n(1),{IntermediateScript:l,IntermediateRepresentation:c}=n(77),u=n(211),d="",h="list",p=(e,t)=>({scope:e,id:t.id,name:t.name,isCloud:t.isCloud}),m=e=>e.substring(1);class f{constructor(e){this.thread=e,this.target=e.target,this.blocks=e.blockContainer,this.runtime=this.target.runtime,this.stage=this.runtime.getTargetForStage(),this.script=new l,this.script.warpTimer=this.target.runtime.compilerOptions.warpTimer,this.variableCache={},this.usesTimer=!1}setProcedureVariant(e){const t=m(e);this.script.procedureCode=t,this.script.isProcedure=!0,this.script.yields=!1;const n=this.blocks.getProcedureParamNamesIdsAndDefaults(t);if(null===n)throw new Error("IR: cannot find procedure: ".concat(e));const[r,i,s]=n;this.script.arguments=r}enableWarp(){this.script.isWarp=!0}getBlockById(e){return this.blocks.getBlock(e)||this.blocks.runtime.flyoutBlocks.getBlock(e)}getBlockInfo(e){const[t,n]=i.splitFirst(e,"_");if(!t||!n)return null;const r=this.runtime._blockInfo.find((e=>e.id===t));if(!r)return null;const s=r.blocks.find((e=>e.info.opcode===n));return s||null}descendInputOfBlock(e,t){const n=e.inputs[t];if(!n)return a.warn("IR: ".concat(e.opcode,": missing input ").concat(t),e),{kind:"constant",value:0};const r=n.block,i=this.getBlockById(r);return i?this.descendInput(i):(a.warn("IR: ".concat(e.opcode,": could not find input ").concat(t," with ID ").concat(r)),{kind:"constant",value:0})}descendInput(e){switch(e.opcode){case"colour_picker":return{kind:"constant",value:e.fields.COLOUR.value};case"math_angle":case"math_integer":case"math_number":case"math_positive_number":case"math_whole_number":return{kind:"constant",value:e.fields.NUM.value};case"text":return{kind:"constant",value:e.fields.TEXT.value};case"argument_reporter_string_number":{const t=e.fields.VALUE.value,n=this.script.arguments.lastIndexOf(t);return-1===n&&"last key pressed"===t.toLowerCase()?{kind:"tw.lastKeyPressed"}:-1===n?{kind:"constant",value:0}:{kind:"args.stringNumber",index:n}}case"argument_reporter_boolean":{const t=e.fields.VALUE.value,n=this.script.arguments.lastIndexOf(t);return-1===n?"is compiled?"===t.toLowerCase()||"is turbowarp?"===t.toLowerCase()?{kind:"constant",value:!0}:{kind:"constant",value:0}:{kind:"args.boolean",index:n}}case"control_get_counter":return{kind:"counter.get"};case"data_variable":return{kind:"var.get",variable:this.descendVariable(e,"VARIABLE",d)};case"data_itemoflist":return{kind:"list.get",list:this.descendVariable(e,"LIST",h),index:this.descendInputOfBlock(e,"INDEX")};case"data_lengthoflist":return{kind:"list.length",list:this.descendVariable(e,"LIST",h)};case"data_listcontainsitem":return{kind:"list.contains",list:this.descendVariable(e,"LIST",h),item:this.descendInputOfBlock(e,"ITEM")};case"data_itemnumoflist":return{kind:"list.indexOf",list:this.descendVariable(e,"LIST",h),item:this.descendInputOfBlock(e,"ITEM")};case"data_listcontents":return{kind:"list.contents",list:this.descendVariable(e,"LIST",h)};case"event_broadcast_menu":{const t=e.fields.BROADCAST_OPTION,n=this.target.lookupBroadcastMsg(t.id,t.value);return{kind:"constant",value:n?n.name:""}}case"looks_backdropnumbername":return"number"===e.fields.NUMBER_NAME.value?{kind:"looks.backdropNumber"}:{kind:"looks.backdropName"};case"looks_costumenumbername":return"number"===e.fields.NUMBER_NAME.value?{kind:"looks.costumeNumber"}:{kind:"looks.costumeName"};case"looks_size":return{kind:"looks.size"};case"motion_direction":return{kind:"motion.direction"};case"motion_xposition":return{kind:"motion.x"};case"motion_yposition":return{kind:"motion.y"};case"operator_add":return{kind:"op.add",left:this.descendInputOfBlock(e,"NUM1"),right:this.descendInputOfBlock(e,"NUM2")};case"operator_and":return{kind:"op.and",left:this.descendInputOfBlock(e,"OPERAND1"),right:this.descendInputOfBlock(e,"OPERAND2")};case"operator_contains":return{kind:"op.contains",string:this.descendInputOfBlock(e,"STRING1"),contains:this.descendInputOfBlock(e,"STRING2")};case"operator_divide":return{kind:"op.divide",left:this.descendInputOfBlock(e,"NUM1"),right:this.descendInputOfBlock(e,"NUM2")};case"operator_equals":return{kind:"op.equals",left:this.descendInputOfBlock(e,"OPERAND1"),right:this.descendInputOfBlock(e,"OPERAND2")};case"operator_gt":return{kind:"op.greater",left:this.descendInputOfBlock(e,"OPERAND1"),right:this.descendInputOfBlock(e,"OPERAND2")};case"operator_join":return{kind:"op.join",left:this.descendInputOfBlock(e,"STRING1"),right:this.descendInputOfBlock(e,"STRING2")};case"operator_length":return{kind:"op.length",string:this.descendInputOfBlock(e,"STRING")};case"operator_letter_of":return{kind:"op.letterOf",letter:this.descendInputOfBlock(e,"LETTER"),string:this.descendInputOfBlock(e,"STRING")};case"operator_lt":return{kind:"op.less",left:this.descendInputOfBlock(e,"OPERAND1"),right:this.descendInputOfBlock(e,"OPERAND2")};case"operator_mathop":{const t=this.descendInputOfBlock(e,"NUM");switch(e.fields.OPERATOR.value.toLowerCase()){case"abs":return{kind:"op.abs",value:t};case"floor":return{kind:"op.floor",value:t};case"ceiling":return{kind:"op.ceiling",value:t};case"sqrt":return{kind:"op.sqrt",value:t};case"sin":return{kind:"op.sin",value:t};case"cos":return{kind:"op.cos",value:t};case"tan":return{kind:"op.tan",value:t};case"asin":return{kind:"op.asin",value:t};case"acos":return{kind:"op.acos",value:t};case"atan":return{kind:"op.atan",value:t};case"ln":return{kind:"op.ln",value:t};case"log":return{kind:"op.log",value:t};case"e ^":return{kind:"op.e^",value:t};case"10 ^":return{kind:"op.10^",value:t};default:return{kind:"constant",value:0}}}case"operator_mod":return{kind:"op.mod",left:this.descendInputOfBlock(e,"NUM1"),right:this.descendInputOfBlock(e,"NUM2")};case"operator_multiply":return{kind:"op.multiply",left:this.descendInputOfBlock(e,"NUM1"),right:this.descendInputOfBlock(e,"NUM2")};case"operator_not":return{kind:"op.not",operand:this.descendInputOfBlock(e,"OPERAND")};case"operator_or":return{kind:"op.or",left:this.descendInputOfBlock(e,"OPERAND1"),right:this.descendInputOfBlock(e,"OPERAND2")};case"operator_random":{const t=this.descendInputOfBlock(e,"FROM"),n=this.descendInputOfBlock(e,"TO");if("constant"===t.kind&&"constant"===n.kind){const e=t.value,i=n.value,s=r.toNumber(e),o=r.toNumber(i);return s===o?{kind:"constant",value:s}:r.isInt(e)&&r.isInt(i)?{kind:"op.random",low:s<=o?t:n,high:s<=o?n:t,useInts:!0,useFloats:!1}:{kind:"op.random",low:s<=o?t:n,high:s<=o?n:t,useInts:!1,useFloats:!0}}if("constant"===t.kind){if(!r.isInt(r.toNumber(t.value)))return{kind:"op.random",low:t,high:n,useInts:!1,useFloats:!0}}else if("constant"===n.kind&&!r.isInt(r.toNumber(n.value)))return{kind:"op.random",low:t,high:n,useInts:!1,useFloats:!0};return{kind:"op.random",low:t,high:n,useInts:!1,useFloats:!1}}case"operator_round":return{kind:"op.round",value:this.descendInputOfBlock(e,"NUM")};case"operator_subtract":return{kind:"op.subtract",left:this.descendInputOfBlock(e,"NUM1"),right:this.descendInputOfBlock(e,"NUM2")};case"procedures_call":return this.descendProcedure(e);case"sensing_answer":return{kind:"sensing.answer"};case"sensing_coloristouchingcolor":return{kind:"sensing.colorTouchingColor",target:this.descendInputOfBlock(e,"COLOR2"),mask:this.descendInputOfBlock(e,"COLOR")};case"sensing_current":switch(e.fields.CURRENTMENU.value.toLowerCase()){case"year":return{kind:"sensing.year"};case"month":return{kind:"sensing.month"};case"date":return{kind:"sensing.date"};case"dayofweek":return{kind:"sensing.dayofweek"};case"hour":return{kind:"sensing.hour"};case"minute":return{kind:"sensing.minute"};case"second":return{kind:"sensing.second"}}return{kind:"constant",value:0};case"sensing_dayssince2000":return{kind:"sensing.daysSince2000"};case"sensing_distanceto":return{kind:"sensing.distance",target:this.descendInputOfBlock(e,"DISTANCETOMENU")};case"sensing_keypressed":return{kind:"keyboard.pressed",key:this.descendInputOfBlock(e,"KEY_OPTION")};case"sensing_mousedown":return{kind:"mouse.down"};case"sensing_mousex":return{kind:"mouse.x"};case"sensing_mousey":return{kind:"mouse.y"};case"sensing_of":return{kind:"sensing.of",property:e.fields.PROPERTY.value,object:this.descendInputOfBlock(e,"OBJECT")};case"sensing_timer":return this.usesTimer=!0,{kind:"timer.get"};case"sensing_touchingcolor":return{kind:"sensing.touchingColor",color:this.descendInputOfBlock(e,"COLOR")};case"sensing_touchingobject":return{kind:"sensing.touching",object:this.descendInputOfBlock(e,"TOUCHINGOBJECTMENU")};case"sensing_username":return{kind:"sensing.username"};case"sound_sounds_menu":return{kind:"constant",value:e.fields.SOUND_MENU.value};case"tw_getLastKeyPressed":return{kind:"tw.lastKeyPressed"};default:{if(this.runtime.getOpcodeFunction(e.opcode)){if(u.inputs.includes(e.opcode))return this.descendCompatLayer(e);const t=this.getBlockInfo(e.opcode);if(t){const n=t.info.blockType;if(n===s.REPORTER||n===s.BOOLEAN)return this.descendCompatLayer(e)}}const t=Object.keys(e.inputs),n=Object.keys(e.fields);if(0===t.length&&1===n.length)return{kind:"constant",value:e.fields[n[0]].value};throw a.warn("IR: Unknown input: ".concat(e.opcode),e),new Error("IR: Unknown input: ".concat(e.opcode))}}}descendStackedBlock(e){switch(e.opcode){case"control_all_at_once":return{kind:"control.if",condition:{kind:"constant",value:!0},whenTrue:this.descendSubstack(e,"SUBSTACK"),whenFalse:[]};case"control_clear_counter":return{kind:"counter.clear"};case"control_create_clone_of":return{kind:"control.createClone",target:this.descendInputOfBlock(e,"CLONE_OPTION")};case"control_delete_this_clone":return this.script.yields=!0,{kind:"control.deleteClone"};case"control_forever":return this.analyzeLoop(),{kind:"control.while",condition:{kind:"constant",value:!0},do:this.descendSubstack(e,"SUBSTACK")};case"control_for_each":return this.analyzeLoop(),{kind:"control.for",variable:this.descendVariable(e,"VARIABLE",d),count:this.descendInputOfBlock(e,"VALUE"),do:this.descendSubstack(e,"SUBSTACK")};case"control_if":return{kind:"control.if",condition:this.descendInputOfBlock(e,"CONDITION"),whenTrue:this.descendSubstack(e,"SUBSTACK"),whenFalse:[]};case"control_if_else":return{kind:"control.if",condition:this.descendInputOfBlock(e,"CONDITION"),whenTrue:this.descendSubstack(e,"SUBSTACK"),whenFalse:this.descendSubstack(e,"SUBSTACK2")};case"control_incr_counter":return{kind:"counter.increment"};case"control_repeat":return this.analyzeLoop(),{kind:"control.repeat",times:this.descendInputOfBlock(e,"TIMES"),do:this.descendSubstack(e,"SUBSTACK")};case"control_repeat_until":{this.analyzeLoop(),this.usesTimer=!1;const t=this.descendInputOfBlock(e,"CONDITION"),n=this.usesTimer;return n&&(this.script.yields=!0),{kind:"control.while",condition:{kind:"op.not",operand:t},do:this.descendSubstack(e,"SUBSTACK"),warpTimer:n}}case"control_stop":{const t=e.fields.STOP_OPTION.value;return"all"===t?(this.script.yields=!0,{kind:"control.stopAll"}):"other scripts in sprite"===t||"other scripts in stage"===t?{kind:"control.stopOthers"}:"this script"===t?{kind:"control.stopScript"}:{kind:"noop"}}case"control_wait":return this.script.yields=!0,{kind:"control.wait",seconds:this.descendInputOfBlock(e,"DURATION")};case"control_wait_until":return this.script.yields=!0,{kind:"control.waitUntil",condition:this.descendInputOfBlock(e,"CONDITION")};case"control_while":return this.analyzeLoop(),{kind:"control.while",condition:this.descendInputOfBlock(e,"CONDITION"),do:this.descendSubstack(e,"SUBSTACK"),warpTimer:!1};case"data_addtolist":return{kind:"list.add",list:this.descendVariable(e,"LIST",h),item:this.descendInputOfBlock(e,"ITEM")};case"data_changevariableby":{const t=this.descendVariable(e,"VARIABLE",d);return{kind:"var.set",variable:t,value:{kind:"op.add",left:{kind:"var.get",variable:t},right:this.descendInputOfBlock(e,"VALUE")}}}case"data_deletealloflist":return{kind:"list.deleteAll",list:this.descendVariable(e,"LIST",h)};case"data_deleteoflist":{const t=this.descendInputOfBlock(e,"INDEX");return"constant"===t.kind&&"all"===t.value?{kind:"list.deleteAll",list:this.descendVariable(e,"LIST",h)}:{kind:"list.delete",list:this.descendVariable(e,"LIST",h),index:t}}case"data_hidelist":return{kind:"list.hide",list:this.descendVariable(e,"LIST",h)};case"data_hidevariable":return{kind:"var.hide",variable:this.descendVariable(e,"VARIABLE",d)};case"data_insertatlist":return{kind:"list.insert",list:this.descendVariable(e,"LIST",h),index:this.descendInputOfBlock(e,"INDEX"),item:this.descendInputOfBlock(e,"ITEM")};case"data_replaceitemoflist":return{kind:"list.replace",list:this.descendVariable(e,"LIST",h),index:this.descendInputOfBlock(e,"INDEX"),item:this.descendInputOfBlock(e,"ITEM")};case"data_setvariableto":return{kind:"var.set",variable:this.descendVariable(e,"VARIABLE",d),value:this.descendInputOfBlock(e,"VALUE")};case"data_showlist":return{kind:"list.show",list:this.descendVariable(e,"LIST",h)};case"data_showvariable":return{kind:"var.show",variable:this.descendVariable(e,"VARIABLE",d)};case"event_broadcast":return{kind:"event.broadcast",broadcast:this.descendInputOfBlock(e,"BROADCAST_INPUT")};case"event_broadcastandwait":return this.script.yields=!0,{kind:"event.broadcastAndWait",broadcast:this.descendInputOfBlock(e,"BROADCAST_INPUT")};case"looks_changeeffectby":return{kind:"looks.changeEffect",effect:e.fields.EFFECT.value.toLowerCase(),value:this.descendInputOfBlock(e,"CHANGE")};case"looks_changesizeby":return{kind:"looks.changeSize",size:this.descendInputOfBlock(e,"CHANGE")};case"looks_cleargraphiceffects":return{kind:"looks.clearEffects"};case"looks_goforwardbackwardlayers":return"forward"===e.fields.FORWARD_BACKWARD.value?{kind:"looks.forwardLayers",layers:this.descendInputOfBlock(e,"NUM")}:{kind:"looks.backwardLayers",layers:this.descendInputOfBlock(e,"NUM")};case"looks_gotofrontback":return"front"===e.fields.FRONT_BACK.value?{kind:"looks.goToFront"}:{kind:"looks.goToBack"};case"looks_hide":return{kind:"looks.hide"};case"looks_nextbackdrop":return{kind:"looks.nextBackdrop"};case"looks_nextcostume":return{kind:"looks.nextCostume"};case"looks_seteffectto":return{kind:"looks.setEffect",effect:e.fields.EFFECT.value.toLowerCase(),value:this.descendInputOfBlock(e,"VALUE")};case"looks_setsizeto":return{kind:"looks.setSize",size:this.descendInputOfBlock(e,"SIZE")};case"looks_show":return{kind:"looks.show"};case"looks_switchbackdropto":return{kind:"looks.switchBackdrop",backdrop:this.descendInputOfBlock(e,"BACKDROP")};case"looks_switchcostumeto":return{kind:"looks.switchCostume",costume:this.descendInputOfBlock(e,"COSTUME")};case"motion_changexby":return{kind:"motion.changeX",dx:this.descendInputOfBlock(e,"DX")};case"motion_changeyby":return{kind:"motion.changeY",dy:this.descendInputOfBlock(e,"DY")};case"motion_gotoxy":return{kind:"motion.setXY",x:this.descendInputOfBlock(e,"X"),y:this.descendInputOfBlock(e,"Y")};case"motion_ifonedgebounce":return{kind:"motion.ifOnEdgeBounce"};case"motion_movesteps":return{kind:"motion.step",steps:this.descendInputOfBlock(e,"STEPS")};case"motion_pointindirection":return{kind:"motion.setDirection",direction:this.descendInputOfBlock(e,"DIRECTION")};case"motion_setrotationstyle":return{kind:"motion.setRotationStyle",style:e.fields.STYLE.value};case"motion_setx":return{kind:"motion.setX",x:this.descendInputOfBlock(e,"X")};case"motion_sety":return{kind:"motion.setY",y:this.descendInputOfBlock(e,"Y")};case"motion_turnleft":return{kind:"motion.setDirection",direction:{kind:"op.subtract",left:{kind:"motion.direction"},right:this.descendInputOfBlock(e,"DEGREES")}};case"motion_turnright":return{kind:"motion.setDirection",direction:{kind:"op.add",left:{kind:"motion.direction"},right:this.descendInputOfBlock(e,"DEGREES")}};case"pen_clear":return{kind:"pen.clear"};case"pen_changePenColorParamBy":return{kind:"pen.changeParam",param:this.descendInputOfBlock(e,"COLOR_PARAM"),value:this.descendInputOfBlock(e,"VALUE")};case"pen_changePenHueBy":return{kind:"pen.legacyChangeHue",hue:this.descendInputOfBlock(e,"HUE")};case"pen_changePenShadeBy":return{kind:"pen.legacyChangeShade",shade:this.descendInputOfBlock(e,"SHADE")};case"pen_penDown":return{kind:"pen.down"};case"pen_penUp":return{kind:"pen.up"};case"pen_setPenColorParamTo":return{kind:"pen.setParam",param:this.descendInputOfBlock(e,"COLOR_PARAM"),value:this.descendInputOfBlock(e,"VALUE")};case"pen_setPenColorToColor":return{kind:"pen.setColor",color:this.descendInputOfBlock(e,"COLOR")};case"pen_setPenHueToNumber":return{kind:"pen.legacySetHue",hue:this.descendInputOfBlock(e,"HUE")};case"pen_setPenShadeToNumber":return{kind:"pen.legacySetShade",shade:this.descendInputOfBlock(e,"SHADE")};case"pen_setPenSizeTo":return{kind:"pen.setSize",size:this.descendInputOfBlock(e,"SIZE")};case"pen_changePenSizeBy":return{kind:"pen.changeSize",size:this.descendInputOfBlock(e,"SIZE")};case"pen_stamp":return{kind:"pen.stamp"};case"procedures_call":{const t=e.mutation.proccode;if(e.mutation.return){const t=this.descendVisualReport(e);if(t)return t}return"tw:debugger;"===t?{kind:"tw.debugger"}:this.descendProcedure(e)}case"procedures_return":return{kind:"procedures.return",value:this.descendInputOfBlock(e,"VALUE")};case"sensing_resettimer":return{kind:"timer.reset"};default:{if(this.runtime.getOpcodeFunction(e.opcode)){if(u.stacked.includes(e.opcode))return this.descendCompatLayer(e);const t=this.getBlockInfo(e.opcode);if(t){const n=t.info.blockType;if(n===s.COMMAND||n===s.CONDITIONAL||n===s.LOOP)return this.descendCompatLayer(e)}}const t=this.descendVisualReport(e);if(t)return t;throw a.warn("IR: Unknown stacked block: ".concat(e.opcode),e),new Error("IR: Unknown stacked block: ".concat(e.opcode))}}}descendSubstack(e,t){const n=e.inputs[t];if(!n)return[];const r=n.block;return this.walkStack(r)}walkStack(e){const t=[];let n=e;for(;null!==n;){const e=this.getBlockById(n);if(!e)break;const r=this.descendStackedBlock(e);t.push(r),n=e.next}return t}descendVariable(e,t,n){const r=e.fields[t],i=r.id;if(Object.prototype.hasOwnProperty.call(this.variableCache,i))return this.variableCache[i];const s=this._descendVariable(i,r.value,n);return this.variableCache[i]=s,s}_descendVariable(e,t,n){const r=this.target,i=this.stage;if(Object.prototype.hasOwnProperty.call(r.variables,e))return p("target",r.variables[e]);if(!r.isStage&&i&&Object.prototype.hasOwnProperty.call(i.variables,e))return p("stage",i.variables[e]);for(const e in r.variables)if(Object.prototype.hasOwnProperty.call(r.variables,e)){const i=r.variables[e];if(i.name===t&&i.type===n)return p("target",i)}if(!r.isStage&&i)for(const e in i.variables)if(Object.prototype.hasOwnProperty.call(i.variables,e)){const r=i.variables[e];if(r.name===t&&r.type===n)return p("stage",r)}const s=new o(e,t,n,!1);if(r.variables[e]=s,r.sprite)for(const i of r.sprite.clones)Object.prototype.hasOwnProperty.call(i.variables,e)||(i.variables[e]=new o(e,t,n,!1));return p("target",s)}descendProcedure(e){const t=e.mutation.proccode,n=this.blocks.getProcedureParamNamesIdsAndDefaults(t);if(null===n)return{kind:"noop"};const[r,i,s]=n;if(this.runtime.getAddonBlock(t)){this.script.yields=!0;const n={};for(let t=0;t0;){this.compilingProcedures=this.proceduresToCompile,this.proceduresToCompile=new Map;for(const[e,n]of this.compilingProcedures.entries())if(t[e]){const n=t[e];this.procedures[e]=n,this.addProcedureDependencies(n.dependedProcedures)}else{const r="W"===e.charAt(0),i=new f(this.thread);i.setProcedureVariant(e),r&&i.enableWarp();const s=this.generateScriptTree(i,n);this.procedures[e]=s,t[e]=s}}for(;this.analyzeScript(e););const n=new c;return n.entry=e,n.procedures=this.procedures,n}}}},function(e,t,n){const r={Timer:n(14),Cast:n(2),log:n(1),blockUtility:n(213),thread:null};let i="";const s={};i+="let stuckCounter = 0;\nconst isStuck = () => {\n // The real time is not checked on every call for performance.\n stuckCounter++;\n if (stuckCounter === 100) {\n stuckCounter = 0;\n return globalState.thread.target.runtime.sequencer.timer.timeElapsed() > 500;\n }\n return false;\n};",s.startHats="const startHats = (requestedHat, optMatchFields) => {\n const thread = globalState.thread;\n const threads = thread.target.runtime.startHats(requestedHat, optMatchFields);\n return threads;\n}",s.waitThreads="const waitThreads = function*(threads) {\n const thread = globalState.thread;\n const runtime = thread.target.runtime;\n\n while (true) {\n // determine whether any threads are running\n let anyRunning = false;\n for (let i = 0; i < threads.length; i++) {\n if (runtime.threads.indexOf(threads[i]) !== -1) {\n anyRunning = true;\n break;\n }\n }\n if (!anyRunning) {\n // all threads are finished, can resume\n return;\n }\n\n let allWaiting = true;\n for (let i = 0; i < threads.length; i++) {\n if (!runtime.isWaitingThread(threads[i])) {\n allWaiting = false;\n break;\n }\n }\n if (allWaiting) {\n thread.status = 3; // STATUS_YIELD_TICK\n }\n\n yield;\n }\n}",s.executeInCompatibilityLayer="let hasResumedFromPromise = false;\nconst waitPromise = function*(promise) {\n const thread = globalState.thread;\n let returnValue;\n\n // enter STATUS_PROMISE_WAIT and yield\n // this will stop script execution until the promise handlers reset the thread status\n // because promise handlers might execute immediately, configure thread.status here\n thread.status = 1; // STATUS_PROMISE_WAIT\n\n promise\n .then(value => {\n returnValue = value;\n thread.status = 0; // STATUS_RUNNING\n }, error => {\n thread.status = 0; // STATUS_RUNNING\n globalState.log.warn('Promise rejected in compiled script:', error);\n });\n\n yield;\n\n return returnValue;\n};\nconst isPromise = value => (\n // see engine/execute.js\n value !== null &&\n typeof value === 'object' &&\n typeof value.then === 'function'\n);\nconst executeInCompatibilityLayer = function*(inputs, blockFunction, isWarp, useFlags, blockId, branchInfo) {\n const thread = globalState.thread;\n const blockUtility = globalState.blockUtility;\n const stackFrame = branchInfo ? branchInfo.stackFrame : {};\n\n const finish = (returnValue) => {\n if (branchInfo) {\n if (typeof returnValue === 'undefined' && blockUtility._startedBranch) {\n branchInfo.isLoop = blockUtility._startedBranch[1];\n return blockUtility._startedBranch[0];\n }\n branchInfo.isLoop = branchInfo.defaultIsLoop;\n return returnValue;\n }\n return returnValue;\n };\n\n const executeBlock = () => {\n blockUtility.init(thread, blockId, stackFrame);\n return blockFunction(inputs, blockUtility);\n };\n\n let returnValue = executeBlock();\n if (isPromise(returnValue)) {\n returnValue = finish(yield* waitPromise(returnValue));\n if (useFlags) hasResumedFromPromise = true;\n return returnValue;\n }\n\n if (thread.status === 1 /* STATUS_PROMISE_WAIT */) {\n // Something external is forcing us to stop\n yield;\n // Make up a return value because whatever is forcing us to stop can't specify one\n return '';\n }\n\n while (thread.status === 2 /* STATUS_YIELD */ || thread.status === 3 /* STATUS_YIELD_TICK */) {\n // Yielded threads will run next iteration.\n if (thread.status === 2 /* STATUS_YIELD */) {\n thread.status = 0; // STATUS_RUNNING\n // Yield back to the event loop when stuck or not in warp mode.\n if (!isWarp || isStuck()) {\n yield;\n }\n } else {\n // status is STATUS_YIELD_TICK, always yield to the event loop\n yield;\n }\n\n returnValue = executeBlock();\n if (isPromise(returnValue)) {\n returnValue = finish(yield* waitPromise(returnValue));\n if (useFlags) hasResumedFromPromise = true;\n return returnValue;\n }\n\n if (thread.status === 1 /* STATUS_PROMISE_WAIT */) {\n yield;\n return finish('');\n }\n }\n\n // todo: do we have to do anything extra if status is STATUS_DONE?\n\n return finish(returnValue);\n}",s.createBranchInfo="const createBranchInfo = (isLoop) => ({\n defaultIsLoop: isLoop,\n isLoop: false,\n branch: 0,\n stackFrame: {}\n});",s.retire="const retire = () => {\n const thread = globalState.thread;\n thread.target.runtime.sequencer.retireThread(thread);\n}",s.toBoolean="const toBoolean = value => {\n if (typeof value === 'boolean') {\n return value;\n }\n if (typeof value === 'string') {\n if (value === '' || value === '0' || value.toLowerCase() === 'false') {\n return false;\n }\n return true;\n }\n return !!value;\n}",s.limitPrecision="const limitPrecision = value => {\n const rounded = Math.round(value);\n const delta = value - rounded;\n return (Math.abs(delta) < 1e-9) ? rounded : value;\n}",i+="const isNotActuallyZero = val => {\n if (typeof val !== 'string') return false;\n for (let i = 0; i < val.length; i++) {\n const code = val.charCodeAt(i);\n if (code === 48 || code === 9) {\n return false;\n }\n }\n return true;\n};",i+="const compareEqualSlow = (v1, v2) => {\n const n1 = +v1;\n if (isNaN(n1) || (n1 === 0 && isNotActuallyZero(v1))) return ('' + v1).toLowerCase() === ('' + v2).toLowerCase();\n const n2 = +v2;\n if (isNaN(n2) || (n2 === 0 && isNotActuallyZero(v2))) return ('' + v1).toLowerCase() === ('' + v2).toLowerCase();\n return n1 === n2;\n};\nconst compareEqual = (v1, v2) => (typeof v1 === 'number' && typeof v2 === 'number' && !isNaN(v1) && !isNaN(v2) || v1 === v2) ? v1 === v2 : compareEqualSlow(v1, v2);",s.compareGreaterThan="const compareGreaterThanSlow = (v1, v2) => {\n let n1 = +v1;\n let n2 = +v2;\n if (n1 === 0 && isNotActuallyZero(v1)) {\n n1 = NaN;\n } else if (n2 === 0 && isNotActuallyZero(v2)) {\n n2 = NaN;\n }\n if (isNaN(n1) || isNaN(n2)) {\n const s1 = ('' + v1).toLowerCase();\n const s2 = ('' + v2).toLowerCase();\n return s1 > s2;\n }\n return n1 > n2;\n};\nconst compareGreaterThan = (v1, v2) => typeof v1 === 'number' && typeof v2 === 'number' && !isNaN(v1) ? v1 > v2 : compareGreaterThanSlow(v1, v2)",s.compareLessThan="const compareLessThanSlow = (v1, v2) => {\n let n1 = +v1;\n let n2 = +v2;\n if (n1 === 0 && isNotActuallyZero(v1)) {\n n1 = NaN;\n } else if (n2 === 0 && isNotActuallyZero(v2)) {\n n2 = NaN;\n }\n if (isNaN(n1) || isNaN(n2)) {\n const s1 = ('' + v1).toLowerCase();\n const s2 = ('' + v2).toLowerCase();\n return s1 < s2;\n }\n return n1 < n2;\n};\nconst compareLessThan = (v1, v2) => typeof v1 === 'number' && typeof v2 === 'number' && !isNaN(v2) ? v1 < v2 : compareLessThanSlow(v1, v2)",s.randomInt="const randomInt = (low, high) => low + Math.floor(Math.random() * ((high + 1) - low))",s.randomFloat="const randomFloat = (low, high) => (Math.random() * (high - low)) + low",s.timer="const timer = () => {\n const t = new globalState.Timer({\n now: () => globalState.thread.target.runtime.currentMSecs\n });\n t.start();\n return t;\n}",s.daysSince2000="const daysSince2000 = () => (Date.now() - 946684800000) / (24 * 60 * 60 * 1000)",s.distance="const distance = menu => {\n const thread = globalState.thread;\n if (thread.target.isStage) return 10000;\n\n let targetX = 0;\n let targetY = 0;\n if (menu === '_mouse_') {\n targetX = thread.target.runtime.ioDevices.mouse.getScratchX();\n targetY = thread.target.runtime.ioDevices.mouse.getScratchY();\n } else {\n const distTarget = thread.target.runtime.getSpriteTargetByName(menu);\n if (!distTarget) return 10000;\n targetX = distTarget.x;\n targetY = distTarget.y;\n }\n\n const dx = thread.target.x - targetX;\n const dy = thread.target.y - targetY;\n return Math.sqrt((dx * dx) + (dy * dy));\n}",i+="const listIndexSlow = (index, length) => {\n if (index === 'last') {\n return length - 1;\n } else if (index === 'random' || index === 'any') {\n if (length > 0) {\n return (Math.random() * length) | 0;\n }\n return -1;\n }\n index = (+index || 0) | 0;\n if (index < 1 || index > length) {\n return -1;\n }\n return index - 1;\n};\nconst listIndex = (index, length) => {\n if (typeof index !== 'number') {\n return listIndexSlow(index, length);\n }\n index = index | 0;\n return index < 1 || index > length ? -1 : index - 1;\n};",s.listGet="const listGet = (list, idx) => {\n const index = listIndex(idx, list.length);\n if (index === -1) {\n return '';\n }\n return list[index];\n}",s.listReplace="const listReplace = (list, idx, value) => {\n const index = listIndex(idx, list.value.length);\n if (index === -1) {\n return;\n }\n list.value[index] = value;\n list._monitorUpToDate = false;\n}",s.listInsert="const listInsert = (list, idx, value) => {\n const index = listIndex(idx, list.value.length + 1);\n if (index === -1) {\n return;\n }\n list.value.splice(index, 0, value);\n list._monitorUpToDate = false;\n}",s.listDelete="const listDelete = (list, idx) => {\n if (idx === 'all') {\n list.value = [];\n return;\n }\n const index = listIndex(idx, list.value.length);\n if (index === -1) {\n return;\n }\n list.value.splice(index, 1);\n list._monitorUpToDate = false;\n}",s.listContains="const listContains = (list, item) => {\n // TODO: evaluate whether indexOf is worthwhile here\n if (list.value.indexOf(item) !== -1) {\n return true;\n }\n for (let i = 0; i < list.value.length; i++) {\n if (compareEqual(list.value[i], item)) {\n return true;\n }\n }\n return false;\n}",s.listIndexOf="const listIndexOf = (list, item) => {\n for (let i = 0; i < list.value.length; i++) {\n if (compareEqual(list.value[i], item)) {\n return i + 1;\n }\n }\n return 0;\n}",s.listContents="const listContents = list => {\n for (let i = 0; i < list.value.length; i++) {\n const listItem = list.value[i];\n // this is an intentional break from what scratch 3 does to address our automatic string -> number conversions\n // it fixes more than it breaks\n if ((listItem + '').length !== 1) {\n return list.value.join(' ');\n }\n }\n return list.value.join('');\n}",s.colorToList="const colorToList = color => globalState.Cast.toRgbColorList(color)",s.mod="const mod = (n, modulus) => {\n let result = n % modulus;\n if (result / modulus < 0) result += modulus;\n return result;\n}",s.tan="const tan = (angle) => {\n switch (angle % 360) {\n case -270: case 90: return Infinity;\n case -90: case 270: return -Infinity;\n }\n return Math.round(Math.tan((Math.PI * angle) / 180) * 1e10) / 1e10;\n}",s.yieldThenCall="const yieldThenCall = function* (callback, ...args) {\n yield;\n return callback(...args);\n}",s.yieldThenCallGenerator="const yieldThenCallGenerator = function* (callback, ...args) {\n yield;\n return yield* callback(...args);\n}";const o=e=>{r.thread=e,e.generator.next()},a=[];o.scopedEval=e=>{const t=(e=>{let t="let stuckCounter = 0;\nconst isStuck = () => {\n // The real time is not checked on every call for performance.\n stuckCounter++;\n if (stuckCounter === 100) {\n stuckCounter = 0;\n return globalState.thread.target.runtime.sequencer.timer.timeElapsed() > 500;\n }\n return false;\n};const isNotActuallyZero = val => {\n if (typeof val !== 'string') return false;\n for (let i = 0; i < val.length; i++) {\n const code = val.charCodeAt(i);\n if (code === 48 || code === 9) {\n return false;\n }\n }\n return true;\n};const compareEqualSlow = (v1, v2) => {\n const n1 = +v1;\n if (isNaN(n1) || (n1 === 0 && isNotActuallyZero(v1))) return ('' + v1).toLowerCase() === ('' + v2).toLowerCase();\n const n2 = +v2;\n if (isNaN(n2) || (n2 === 0 && isNotActuallyZero(v2))) return ('' + v1).toLowerCase() === ('' + v2).toLowerCase();\n return n1 === n2;\n};\nconst compareEqual = (v1, v2) => (typeof v1 === 'number' && typeof v2 === 'number' && !isNaN(v1) && !isNaN(v2) || v1 === v2) ? v1 === v2 : compareEqualSlow(v1, v2);const listIndexSlow = (index, length) => {\n if (index === 'last') {\n return length - 1;\n } else if (index === 'random' || index === 'any') {\n if (length > 0) {\n return (Math.random() * length) | 0;\n }\n return -1;\n }\n index = (+index || 0) | 0;\n if (index < 1 || index > length) {\n return -1;\n }\n return index - 1;\n};\nconst listIndex = (index, length) => {\n if (typeof index !== 'number') {\n return listIndexSlow(index, length);\n }\n index = index | 0;\n return index < 1 || index > length ? -1 : index - 1;\n};";for(const n of Object.keys(s))e.includes(n)&&(t+="".concat(s[n],";"));return t+="return ".concat(e),t})(e);try{return new Function("globalState",t)(r)}catch(e){throw r.log.error("was unable to compile script",t),e}},o.runtimeFunctions=s,o.saveGlobalState=()=>{a.push(r.thread)},o.restoreGlobalState=()=>{r.thread=a.pop()},e.exports=o},function(e,t,n){const r=n(5),i=n(7),s=n(2),o=n(12),a=n(253),l=n(13);class c extends a{constructor(e,t){super(t,e.blocks),this.sprite=e,this.renderer=null,this.runtime&&(this.renderer=this.runtime.renderer),this.drawableID=null,this.dragging=!1,this.effects={color:0,fisheye:0,whirl:0,pixelate:0,mosaic:0,brightness:0,ghost:0},this.isOriginal=!0,this.isStage=!1,this.x=0,this.y=0,this.direction=90,this.draggable=!1,this.visible=!0,this.size=100,this.currentCostume=0,this.rotationStyle=c.ROTATION_STYLE_ALL_AROUND,this.volume=100,this.tempo=60,this.videoTransparency=50,this.videoState=c.VIDEO_STATE.ON,this.textToSpeechLanguage=null,this.onTargetMoved=null,this.onTargetVisualChange=null,this.interpolationData=null}initDrawable(e){this.renderer&&(this.drawableID=this.renderer.createDrawable(e)),this.isOriginal||this.runtime.startHats("control_start_as_clone",null,this)}get audioPlayer(){console.warn("get audioPlayer deprecated, please update to use .sprite.soundBank methods"),console.warn(new Error("stack for debug").stack);const e=this.sprite.soundBank,t={playSound:t=>e.play(this,t)};return Object.defineProperty(this,"audioPlayer",{configurable:!1,enumerable:!0,writable:!1,value:t}),t}initAudio(){}static get ROTATION_STYLE_ALL_AROUND(){return"all around"}static get ROTATION_STYLE_LEFT_RIGHT(){return"left-right"}static get ROTATION_STYLE_NONE(){return"don't rotate"}static get VIDEO_STATE(){return{OFF:"off",ON:"on",ON_FLIPPED:"on-flipped"}}emitVisualChange(){this.onTargetVisualChange&&this.onTargetVisualChange(this)}setXY(e,t,n){if(this.isStage)return;if(this.dragging&&!n)return;const r=this.x,i=this.y;if(this.renderer){const n=this.runtime.runtimeOptions.fencing?this.renderer.getFencedPositionOfDrawable(this.drawableID,[e,t]):[e,t];this.x=n[0],this.y=n[1],this.renderer.updateDrawablePosition(this.drawableID,n),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())}else this.x=e,this.y=t;this.onTargetMoved&&this.onTargetMoved(this,r,i,n),this.runtime.requestTargetsUpdate(this)}_getRenderedDirectionAndScale(){let e=this.direction,t=[this.size,this.size];if(this.rotationStyle===c.ROTATION_STYLE_NONE)e=90;else if(this.rotationStyle===c.ROTATION_STYLE_LEFT_RIGHT){e=90;t=[(this.direction<0?-1:1)*this.size,this.size]}return{direction:e,scale:t}}setDirection(e){if(!this.isStage&&isFinite(e)){if(this.direction=r.wrapClamp(e,-179,180),this.renderer){const{direction:e,scale:t}=this._getRenderedDirectionAndScale();this.renderer.updateDrawableDirectionScale(this.drawableID,e,t),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())}this.runtime.requestTargetsUpdate(this)}}setDraggable(e){this.isStage||(this.draggable=!!e,this.runtime.requestTargetsUpdate(this))}setVisible(e){this.isStage||(this.visible=!!e,this.renderer&&(this.renderer.updateDrawableVisible(this.drawableID,this.visible),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())),this.runtime.requestTargetsUpdate(this))}setSize(e){if(!this.isStage){if(this.renderer){const t=this.renderer.getCurrentSkinSize(this.drawableID),n=t[0],i=t[1],s=this.runtime.runtimeOptions.fencing,o=s?Math.min(1,Math.max(5/n,5/i)):0,a=s?Math.min(1.5*this.runtime.stageWidth/n,1.5*this.runtime.stageHeight/i):1/0;this.size=100*r.clamp(e/100,o,a);const{direction:l,scale:c}=this._getRenderedDirectionAndScale();this.renderer.updateDrawableDirectionScale(this.drawableID,l,c),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())}else this.size=e;this.runtime.requestTargetsUpdate(this)}}setEffect(e,t){Object.prototype.hasOwnProperty.call(this.effects,e)&&(this.effects[e]=t,this.renderer&&(this.renderer.updateDrawableEffect(this.drawableID,e,t),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())))}clearEffects(){for(const e in this.effects)Object.prototype.hasOwnProperty.call(this.effects,e)&&(this.effects[e]=0);if(this.renderer){for(const e in this.effects)Object.prototype.hasOwnProperty.call(this.effects,e)&&this.renderer.updateDrawableEffect(this.drawableID,e,0);this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())}}setCostume(e){if((e=Math.round(e))!==1/0&&e!==-1/0&&e||(e=0),this.currentCostume=r.wrapClamp(e,0,this.sprite.costumes.length-1),this.renderer){const e=this.sprite.costumes[this.currentCostume];this.renderer.updateDrawableSkinId(this.drawableID,e.skinId),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())}this.runtime.requestTargetsUpdate(this)}addCostume(e,t){"number"!=typeof t||isNaN(t)?this.sprite.addCostumeAt(e,this.sprite.costumes.length):this.sprite.addCostumeAt(e,t)}renameCostume(e,t){const n=this.sprite.costumes.filter(((t,n)=>e!==n)).map((e=>e.name)),r=this.getCostumes()[e].name,s=i.unusedName(t,n);if(this.getCostumes()[e].name=s,this.isStage){const e=this.runtime.targets;for(let t=0;t=t)return null;const n=this.sprite.deleteCostumeAt(e);return e===this.currentCostume&&e===t-1?this.setCostume(e-1):ee.name));e.name=i.unusedName(e.name,n),"number"!=typeof t||isNaN(t)?this.sprite.sounds.push(e):this.sprite.sounds.splice(t,0,e)}renameSound(e,t){const n=this.sprite.sounds.filter(((t,n)=>e!==n)).map((e=>e.name)),r=this.sprite.sounds[e].name,s=i.unusedName(t,n);this.sprite.sounds[e].name=s,this.blocks.updateAssetName(r,s,"sound")}deleteSound(e){if(e<0||e>=this.sprite.sounds.length)return null;const t=this.sprite.sounds.splice(e,1)[0];return this.runtime.requestTargetsUpdate(this),t}setRotationStyle(e){if(e===c.ROTATION_STYLE_NONE?this.rotationStyle=c.ROTATION_STYLE_NONE:e===c.ROTATION_STYLE_ALL_AROUND?this.rotationStyle=c.ROTATION_STYLE_ALL_AROUND:e===c.ROTATION_STYLE_LEFT_RIGHT&&(this.rotationStyle=c.ROTATION_STYLE_LEFT_RIGHT),this.renderer){const{direction:e,scale:t}=this._getRenderedDirectionAndScale();this.renderer.updateDrawableDirectionScale(this.drawableID,e,t),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw())}this.runtime.requestTargetsUpdate(this)}getCostumeIndexByName(e){const t=this.getCostumes();for(let n=0;ne/2||n.top>t/2||n.bottom<-t/2)return!0}return!1}isTouchingSprite(e){e=s.toString(e);const t=this.runtime.getSpriteTargetByName(e);if(!t||!this.renderer)return!1;const n=t.sprite.clones.filter((e=>!e.dragging)).map((e=>e.drawableID));return this.renderer.isTouchingDrawables(this.drawableID,n)}isTouchingColor(e){return!!this.renderer&&this.renderer.isTouchingColor(this.drawableID,e)}colorIsTouchingColor(e,t){return!!this.renderer&&this.renderer.isTouchingColor(this.drawableID,e,t)}getLayerOrder(){return this.renderer?this.renderer.getDrawableOrder(this.drawableID):null}goToFront(){this.renderer&&this.renderer.setDrawableOrder(this.drawableID,1/0,l.SPRITE_LAYER),this.runtime.setExecutablePosition(this,1/0)}goToBack(){this.renderer&&this.renderer.setDrawableOrder(this.drawableID,-1/0,l.SPRITE_LAYER,!1),this.runtime.setExecutablePosition(this,-1/0)}goForwardLayers(e){this.renderer&&this.renderer.setDrawableOrder(this.drawableID,e,l.SPRITE_LAYER,!0),this.runtime.moveExecutable(this,e)}goBackwardLayers(e){this.renderer&&this.renderer.setDrawableOrder(this.drawableID,-e,l.SPRITE_LAYER,!0),this.runtime.moveExecutable(this,-e)}goBehindOther(e){if(this.renderer){const t=this.renderer.setDrawableOrder(e.drawableID,0,l.SPRITE_LAYER,!0);this.renderer.setDrawableOrder(this.drawableID,t,l.SPRITE_LAYER)}const t=this.runtime.executableTargets.indexOf(e);this.runtime.setExecutablePosition(this,t)}keepInFence(e,t,n){let r=n;r||(r={left:-this.runtime.stageWidth/2,right:this.runtime.stageWidth/2,top:this.runtime.stageHeight/2,bottom:-this.runtime.stageHeight/2});const i=this.getBounds();if(!i)return;i.left+=e-this.x,i.right+=e-this.x,i.top+=t-this.y,i.bottom+=t-this.y;let s=0,o=0;return i.leftr.right&&(s+=r.right-i.right),i.top>r.top&&(o+=r.top-i.top),i.bottom{const t=e.createClone();return t.x=400*(Math.random()-.5)/2,t.y=300*(Math.random()-.5)/2,t.direction=this.direction,t.draggable=this.draggable,t.visible=this.visible,t.size=this.size,t.currentCostume=this.currentCostume,t.rotationStyle=this.rotationStyle,t.effects=JSON.parse(JSON.stringify(this.effects)),t.variables=this.duplicateVariables(t.blocks),t.updateAllDrawableProperties(),t}))}onGreenFlag(){this.clearEffects()}onStopAll(){this.clearEffects()}postSpriteInfo(e){const t=Object.prototype.hasOwnProperty.call(e,"force")?e.force:null,n=Object.prototype.hasOwnProperty.call(e,"x"),r=Object.prototype.hasOwnProperty.call(e,"y");(n||r)&&this.setXY(n?e.x:this.x,r?e.y:this.y,t),Object.prototype.hasOwnProperty.call(e,"direction")&&this.setDirection(e.direction),Object.prototype.hasOwnProperty.call(e,"draggable")&&this.setDraggable(e.draggable),Object.prototype.hasOwnProperty.call(e,"rotationStyle")&&this.setRotationStyle(e.rotationStyle),Object.prototype.hasOwnProperty.call(e,"visible")&&this.setVisible(e.visible),Object.prototype.hasOwnProperty.call(e,"size")&&this.setSize(e.size)}startDrag(){this.dragging=!0}stopDrag(){this.dragging=!1}toJSON(){const e=this.getCostumes();return{id:this.id,name:this.getName(),isStage:this.isStage,x:this.x,y:this.y,size:this.size,direction:this.direction,draggable:this.draggable,currentCostume:this.currentCostume,costume:e[this.currentCostume],costumeCount:e.length,visible:this.visible,rotationStyle:this.rotationStyle,comments:this.comments,blocks:this.blocks._blocks,variables:this.variables,costumes:e,sounds:this.getSounds(),textToSpeechLanguage:this.textToSpeechLanguage,tempo:this.tempo,volume:this.volume,videoTransparency:this.videoTransparency,videoState:this.videoState}}dispose(){this.isOriginal||this.runtime.changeCloneCounter(-1),this.runtime.stopForTarget(this),this.runtime.removeExecutable(this),this.sprite.removeClone(this),this.renderer&&null!==this.drawableID&&(this.renderer.destroyDrawable(this.drawableID,this.isStage?l.BACKGROUND_LAYER:l.SPRITE_LAYER),this.visible&&(this.emitVisualChange(),this.runtime.requestRedraw()))}}e.exports=c},function(e,t,n){const r=n(8),i=n(32);class s{constructor(e,t,n,i,o,a,l){this.id=e||r(),this.text=t,this.x=n,this.y=i,this.width=Math.max(Number(o),s.MIN_WIDTH),this.height=Math.max(Number(a),s.MIN_HEIGHT),this.minimized=l||!1,this.blockId=null}toXML(){return'').concat(i(this.text),"")}static get MIN_WIDTH(){return 20}static get MIN_HEIGHT(){return 20}static get DEFAULT_WIDTH(){return 100}static get DEFAULT_HEIGHT(){return 100}}e.exports=s},function(e,t,n){const r=n(50),i=n(17),{loadSoundFromAsset:s}=n(33),{loadCostumeFromAsset:o}=n(34),a=n(104),l=n(7),c=n(13);class u{constructor(e,t){this.runtime=t,e||(e=new i(t)),this.blocks=e,this.name="",this.costumes_=[],this.sounds=[],this.clones=[],this.soundBank=null,this.runtime&&this.runtime.audioEngine&&(this.soundBank=this.runtime.audioEngine.createBank())}set costumes(e){this.costumes_=[];for(const t of e)this.addCostumeAt(t,this.costumes_.length)}get costumes(){return this.costumes_}addCostumeAt(e,t){e.name||(e.name="");const n=this.costumes_.map((e=>e.name));e.name=l.unusedName(e.name,n),this.costumes_.splice(t,0,e)}deleteCostumeAt(e){return this.costumes.splice(e,1)[0]}createClone(e){const t=new r(this,this.runtime);if(t.isOriginal=0===this.clones.length,this.clones.push(t),t.initAudio(),t.isOriginal){const n="string"==typeof e?e:c.SPRITE_LAYER;t.initDrawable(n),this.runtime.fireTargetWasCreated(t)}else this.runtime.fireTargetWasCreated(t,this.clones[0]);return t}removeClone(e){this.runtime.fireTargetWasRemoved(e);const t=this.clones.indexOf(e);t>=0&&this.clones.splice(t,1)}duplicate(){const e=new u(null,this.runtime),t=this.blocks._blocks,n=Object.keys(t).map((e=>t[e])),r=JSON.parse(JSON.stringify(n));a(r),r.forEach((t=>{e.blocks.createBlock(t)}));const i=this.runtime.targets.map((e=>e.sprite.name));e.name=l.unusedName(this.name,i);const c=[];return e.costumes=this.costumes_.map((e=>{const t=Object.assign({},e);return c.push(o(t,this.runtime)),t})),e.sounds=this.sounds.map((t=>{const n=Object.assign({},t),r=t.asset;return c.push(s(n,r,this.runtime,e.soundBank)),n})),Promise.all(c).then((()=>e))}dispose(){this.soundBank&&this.soundBank.dispose()}}e.exports=u},function(e,t){class n{static get svg(){return"http://www.w3.org/2000/svg"}static get xmlns(){return"http://www.w3.org/2000/xmlns"}static get xlink(){return"http://www.w3.org/1999/xlink"}static attributeNamespace(){return{href:n.xlink,xlink:n.xmlns,xmlns:`${n.xmlns}/`,"xmlns:xlink":`${n.xmlns}/`}}static create(e,t,r){return n.set(document.createElementNS(n.svg,e),t,r)}static get(e,t){const r=n.attributeNamespace[t],i=r?e.getAttributeNS(r,t):e.getAttribute(t);return"null"===i?null:i}static set(e,t,r){for(const i in t){let s=t[i];const o=n.attributeNamespace[i];"number"==typeof s&&r&&(s=r.number(s)),o?e.setAttributeNS(o,i,s):e.setAttribute(i,s)}return e}}e.exports=n},function(e,t){e.exports=function(e,t){var n=Object.create(SyntaxError.prototype),r=new Error;return n.name=e,n.message=t,Object.defineProperty(n,"stack",{get:function(){return(r.stack||"").replace(/^(.+\n){1,3}/,e+": "+t+"\n")}}),n}},function(e,t){function n(e){return e}function r(e,t,n,i){var s,o;switch(e.type){case"Group":s=function(e,t,n,i){var s=" "===e.combinator||i?e.combinator:" "+e.combinator+" ",o=e.terms.map((function(e){return r(e,t,n,i)})).join(s);return(e.explicit||n)&&(o=(i||","===o[0]?"[":"[ ")+o+(i?"]":" ]")),o}(e,t,n,i)+(e.disallowEmpty?"!":"");break;case"Multiplier":return r(e.term,t,n,i)+t(0===(o=e).min&&0===o.max?"*":0===o.min&&1===o.max?"?":1===o.min&&0===o.max?o.comma?"#":"+":1===o.min&&1===o.max?"":(o.comma?"#":"")+(o.min===o.max?"{"+o.min+"}":"{"+o.min+","+(0!==o.max?o.max:"")+"}"),e);case"Type":s="<"+e.name+(e.opts?t(function(e){if("Range"===e.type)return" ["+(null===e.min?"-∞":e.min)+","+(null===e.max?"∞":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}(e.opts),e.opts):"")+">";break;case"Property":s="<'"+e.name+"'>";break;case"Keyword":s=e.name;break;case"AtKeyword":s="@"+e.name;break;case"Function":s=e.name+"(";break;case"String":case"Token":s=e.value;break;case"Comma":s=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(s,e)}e.exports=function(e,t){var i=n,s=!1,o=!1;return"function"==typeof t?i=t:t&&(s=Boolean(t.forceBraces),o=Boolean(t.compact),"function"==typeof t.decorate&&(i=t.decorate)),r(e,i,s,o)}},function(e,t){var n=Object.prototype.hasOwnProperty,r=Object.create(null),i=Object.create(null),s=45;function o(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===s&&e.charCodeAt(t+1)===s}function a(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===s&&e.charCodeAt(t+1)!==s){var n=e.indexOf("-",t+2);if(-1!==n)return e.substring(t,n+1)}return""}e.exports={keyword:function(e){if(n.call(r,e))return r[e];var t=e.toLowerCase();if(n.call(r,t))return r[e]=r[t];var i=o(t,0),s=i?"":a(t,0);return r[e]=Object.freeze({basename:t.substr(s.length),name:t,vendor:s,prefix:s,custom:i})},property:function(e){if(n.call(i,e))return i[e];var t=e,r=e[0];"/"===r?r="/"===e[1]?"//":"/":"_"!==r&&"*"!==r&&"$"!==r&&"#"!==r&&"+"!==r&&"&"!==r&&(r="");var s=o(t,r.length);if(!s&&(t=t.toLowerCase(),n.call(i,t)))return i[e]=i[t];var l=s?"":a(t,r.length),c=t.substr(0,r.length+l.length);return i[e]=Object.freeze({basename:t.substr(c.length),name:t.substr(r.length),hack:r,vendor:l,prefix:c,custom:s})},isCustomProperty:o,vendorPrefix:a}},function(e,t,n){var r=n(286),i=9,s=10,o=12,a=13,l=32,c=33,u=35,d=38,h=39,p=40,m=41,f=42,g=43,y=44,b=45,v=60,S=62,w=63,k=64,x=91,T=93,E=123,A=124,C=125,I=8734,O=function(e){for(var t="function"==typeof Uint32Array?new Uint32Array(128):new Array(128),n=0;n<128;n++)t[n]=e(String.fromCharCode(n))?1:0;return t}((function(e){return/[a-zA-Z0-9\-]/.test(e)})),M={" ":1,"&&":2,"||":3,"|":4};function N(e){return e.substringToPos(e.findWsEnd(e.pos))}function R(e){for(var t=e.pos;t=128||0===O[n])break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function D(e){for(var t=e.pos;t57)break}return e.pos===t&&e.error("Expect a number"),e.substringToPos(t)}function P(e){var t=e.str.indexOf("'",e.pos+1);return-1===t&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(t+1)}function L(e){var t,n=null;return e.eat(E),t=D(e),e.charCode()===y?(e.pos++,e.charCode()!==C&&(n=D(e))):n=t,e.eat(C),{min:Number(t),max:n?Number(n):0}}function B(e,t){var n=function(e){var t=null,n=!1;switch(e.charCode()){case f:e.pos++,t={min:0,max:0};break;case g:e.pos++,t={min:1,max:0};break;case w:e.pos++,t={min:0,max:1};break;case u:e.pos++,n=!0,t=e.charCode()===E?L(e):{min:1,max:0};break;case E:t=L(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}(e);return null!==n?(n.term=t,n):t}function z(e){var t=e.peek();return""===t?null:{type:"Token",value:t}}function U(e){var t,n=null;return e.eat(v),t=R(e),e.charCode()===p&&e.nextCharCode()===m&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===x&&(N(e),n=function(e){var t=null,n=null,r=1;return e.eat(x),e.charCode()===b&&(e.peek(),r=-1),-1==r&&e.charCode()===I?e.peek():t=r*Number(D(e)),N(e),e.eat(y),N(e),e.charCode()===I?e.peek():(r=1,e.charCode()===b&&(e.peek(),r=-1),n=r*Number(D(e))),e.eat(T),null===t&&null===n?null:{type:"Range",min:t,max:n}}(e)),e.eat(S),B(e,{type:"Type",name:t,opts:n})}function j(e,t){function n(e,t){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:!1}}for(t=Object.keys(t).sort((function(e,t){return M[e]-M[t]}));t.length>0;){for(var r=t.shift(),i=0,s=0;i1&&(e.splice(s,i-s,n(e.slice(s,i),r)),i=s+1),s=-1))}-1!==s&&t.length&&e.splice(s,i-s,n(e.slice(s,i),r))}return r}function F(e){for(var t,n=[],r={},i=null,s=e.pos;t=W(e);)"Spaces"!==t.type&&("Combinator"===t.type?(null!==i&&"Combinator"!==i.type||(e.pos=s,e.error("Unexpected combinator")),r[t.value]=!0):null!==i&&"Combinator"!==i.type&&(r[" "]=!0,n.push({type:"Combinator",value:" "})),n.push(t),i=t,s=e.pos);return null!==i&&"Combinator"===i.type&&(e.pos-=s,e.error("Unexpected combinator")),{type:"Group",terms:n,combinator:j(n,r)||" ",disallowEmpty:!1,explicit:!1}}function W(e){var t=e.charCode();if(t<128&&1===O[t])return function(e){var t;return t=R(e),e.charCode()===p?(e.pos++,{type:"Function",name:t}):B(e,{type:"Keyword",name:t})}(e);switch(t){case T:break;case x:return B(e,function(e){var t;return e.eat(x),t=F(e),e.eat(T),t.explicit=!0,e.charCode()===c&&(e.pos++,t.disallowEmpty=!0),t}(e));case v:return e.nextCharCode()===h?function(e){var t;return e.eat(v),e.eat(h),t=R(e),e.eat(h),e.eat(S),B(e,{type:"Property",name:t})}(e):U(e);case A:return{type:"Combinator",value:e.substringToPos(e.nextCharCode()===A?e.pos+2:e.pos+1)};case d:return e.pos++,e.eat(d),{type:"Combinator",value:"&&"};case y:return e.pos++,{type:"Comma"};case h:return B(e,{type:"String",value:P(e)});case l:case i:case s:case a:case o:return{type:"Spaces",value:N(e)};case k:return(t=e.nextCharCode())<128&&1===O[t]?(e.pos++,{type:"AtKeyword",name:R(e)}):z(e);case f:case g:case w:case u:case c:break;case E:if((t=e.nextCharCode())<48||t>57)return z(e);break;default:return z(e)}}function V(e){var t=new r(e),n=F(t);return t.pos!==e.length&&t.error("Unexpected input"),1===n.terms.length&&"Group"===n.terms[0].type&&(n=n.terms[0]),n}V("[a&&#|<'c'>*||e() f{2} /,(% g#{1,2} h{2,})]!"),e.exports=V},function(e,t){t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function i(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function s(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function o(e){var n=e,r=i(e);if(r){if(!r.path)return e;n=r.path}for(var o,a=t.isAbsolute(n),l=n.split(/\/+/),c=0,u=l.length-1;u>=0;u--)"."===(o=l[u])?l.splice(u,1):".."===o?c++:c>0&&(""===o?(l.splice(u+1,c),c=0):(l.splice(u,2),c--));return""===(n=l.join("/"))&&(n=a?"/":"."),r?(r.path=n,s(r)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=i(t),a=i(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),s(n);if(n||t.match(r))return t;if(a&&!a.host&&!a.path)return a.host=t,s(a);var l="/"===t.charAt(0)?t:o(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=l,s(a)):l}t.urlParse=i,t.urlGenerate=s,t.normalize=o,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var l=!("__proto__"in Object.create(null));function c(e){return e}function u(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function d(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=l?c:function(e){return u(e)?"$"+e:e},t.fromSetString=l?c:function(e){return u(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=d(e.source,t.source);return 0!==r||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)||n||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=e.generatedLine-t.generatedLine)?r:d(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||n||0!==(r=d(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:d(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=d(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:d(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=i(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var l=r.path.lastIndexOf("/");l>=0&&(r.path=r.path.substring(0,l+1))}t=a(s(r),t)}return o(t)}},function(e,t,n){e.exports={AnPlusB:n(313),Atrule:n(314),AtrulePrelude:n(315),AttributeSelector:n(316),Block:n(317),Brackets:n(318),CDC:n(319),CDO:n(320),ClassSelector:n(321),Combinator:n(322),Comment:n(323),Declaration:n(324),DeclarationList:n(325),Dimension:n(326),Function:n(327),Hash:n(328),Identifier:n(329),IdSelector:n(330),MediaFeature:n(331),MediaQuery:n(332),MediaQueryList:n(333),Nth:n(334),Number:n(335),Operator:n(336),Parentheses:n(337),Percentage:n(338),PseudoClassSelector:n(339),PseudoElementSelector:n(340),Ratio:n(341),Raw:n(18),Rule:n(342),Selector:n(343),SelectorList:n(344),String:n(345),StyleSheet:n(346),TypeSelector:n(347),UnicodeRange:n(348),Url:n(349),Value:n(350),WhiteSpace:n(351)}},function(e,t){e.exports=class{constructor(e,t,n){this.audioEngine=e,this.audioPlayer=t,this.lastEffect=n,this.value=this.DEFAULT_VALUE,this.initialized=!1,this.inputNode=null,this.outputNode=null,this.target=null}get name(){throw new Error("".concat(this.constructor.name,".name is not implemented"))}get DEFAULT_VALUE(){return 0}get _isPatch(){return this.initialized&&(this.value!==this.DEFAULT_VALUE||null===this.audioPlayer)}getInputNode(){return this._isPatch?this.inputNode:this.target.getInputNode()}initialize(){throw new Error("".concat(this.constructor.name,".initialize is not implemented."))}_set(){throw new Error("".concat(this.constructor.name,"._set is not implemented."))}set(e){this.initialized||this.initialize();const t=this._isPatch;t&&(this._lastPatch=this.audioEngine.currentTime),e!==this.value&&this._set(e),this._isPatch!==t&&null!==this.target&&this.connect(this.target)}update(){}clear(){this.set(this.DEFAULT_VALUE)}connect(e){if(null===e)throw new Error("target may not be null");const t=e=>{if(e)return e===this||t(e.target)};if(t(e))throw new Error("Effect cannot connect to itself");this.target=e,null!==this.outputNode&&this.outputNode.disconnect(),(this._isPatch||this._lastPatch+this.audioEngine.DECAY_DURATION * {\n position: absolute;\n}\n.sc-scaled-overlays-outer {\n overflow: hidden;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.sc-scaled-overlays-inner {\n transform-origin: top left;\n}\n.sc-root * {\n box-sizing: border-box;\n}\n.sc-canvas {\n width: 100%;\n height: 100%;\n}\n\n.sc-question-root {\n bottom: 0;\n width: 100%;\n color: black;\n pointer-events: all;\n}\n.sc-question-inner {\n margin: 0.5rem;\n border: 1px solid hsla(0, 0%, 0%, 0.15);\n border-radius: 0.5rem;\n border-width: 2px;\n padding: 1rem;\n background: white;\n}\n.sc-question-text {\n font-size: 12px;\n padding-bottom: 8px;\n font-weight: bold;\n}\n.sc-question-input-outer {\n position: relative;\n}\n.sc-question-input {\n width: 100%;\n height: 2rem;\n padding: 0 12px;\n font-size: 10px;\n border-width: 1px;\n border-style: solid;\n border-color: hsla(0, 0%, 0%, 0.15);\n border-radius: 2rem;\n outline: none;\n transition: 0.25s ease-out;\n box-shadow: none;\n overflow: hidden;\n text-overflow: ellipsis;\n color: inherit;\n}\n.sc-question-input:focus {\n border-color: var(--sc-accent-color);\n box-shadow: 0px 0px 0px 3px var(--sc-accent-color-transparent);\n}\n.sc-question-input:hover {\n border-color: var(--sc-accent-color);\n}\n.sc-question-submit-button {\n top: 4px;\n right: 4px;\n width: 24px;\n height: 24px;\n position: absolute;\n outline: none;\n border: none;\n padding: 2px;\n margin: 0;\n border-radius: 100%;\n background: none;\n cursor: pointer;\n color: white;\n background-color: var(--sc-accent-color);\n background-image: url('+c+');\n overflow: hidden;\n}\n.sc-question-submit-button:focus {\n outline: 2px solid black;\n}\n.sc-question-submit-button-image {\n width: 100%;\n height: 100%;\n}\n\n.sc-monitor-overlay {\n\n}\n.sc-monitor-root {\n position: absolute;\n top: 0;\n left: 0;\n background: hsla(215, 100%, 95%, 1);\n color: #575e75;\n border: 1px solid hsla(0, 0%, 0%, 0.15);\n border-radius: 4px;\n font-size: 12px;\n overflow: hidden;\n user-select: none;\n -webkit-user-select: none;\n display: flex;\n flex-direction: column;\n pointer-events: all;\n}\n.sc-monitor-inner {\n display: flex;\n flex-direction: column;\n padding: 3px;\n}\n.sc-monitor-row {\n display: flex;\n flex-direction: row;\n}\n.sc-monitor-label {\n font-weight: bold;\n text-align: center;\n margin: 0 5px;\n white-space: nowrap;\n}\n.sc-monitor-slider {\n margin: 0;\n width: 100%;\n}\n.sc-monitor-value {\n min-width: 40px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n color: white;\n margin: 0 5px;\n border-radius: 4px;\n padding: 0 2px;\n white-space: pre-wrap;\n background-color: #0fbd8c;\n}\n.sc-monitor-root[data-opcode^="motion_"] .sc-monitor-value-color {\n background-color: #4c97ff;\n}\n.sc-monitor-root[data-opcode^="sensing_"] .sc-monitor-value-color {\n background-color: #5cb1d6;\n}\n.sc-monitor-root[data-opcode^="data_"] .sc-monitor-value-color {\n background-color: #ff8c1a;\n}\n.sc-monitor-root[data-opcode^="looks_"] .sc-monitor-value-color {\n background-color: #9966ff;\n}\n.sc-monitor-root[data-opcode^="sound_"] .sc-monitor-value-color {\n background-color: #cf63cf;\n}\n.sc-monitor-large-value {\n min-height: 1.4rem;\n min-width: 3rem;\n padding: 0.1rem 0.25rem;\n text-align: center;\n color: white;\n font-size: 1rem;\n white-space: pre-wrap;\n}\n\n.sc-monitor-list-label {\n background-color: white;\n text-align: center;\n font-weight: bold;\n border-bottom: 1px solid hsla(0, 0%, 0%, 0.15);\n padding: 3px;\n}\n.sc-monitor-list-footer {\n display: flex;\n background-color: white;\n text-align: center;\n font-weight: bold;\n padding: 3px;\n}\n.sc-monitor-list-footer-text {\n text-align: center;\n flex-grow: 1;\n}\n.sc-monitor-row-delete, .sc-monitor-list-add {\n font-weight: bold;\n background: none;\n border: none;\n outline: none;\n font-family: inherit;\n color: inherit;\n cursor: pointer;\n margin: 0;\n padding: 0;\n}\n.sc-monitor-rows-outer {\n flex-grow: 1;\n}\n.sc-monitor-rows-inner {\n height: 100%;\n overflow-y: auto;\n overflow-x: hidden;\n position: relative;\n}\n.sc-monitor-rows-endpoint {\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n height: 1px;\n pointer-events: none;\n}\n\n.sc-monitor-row-root {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n justify-content: space-around;\n align-items: center;\n padding: 2px;\n width: 100%;\n}\n.sc-monitor-row-index {\n font-weight: bold;\n color: hsla(225, 15%, 40%, 1);\n margin: 0 3px;\n}\n.sc-monitor-row-value-outer {\n display: flex;\n align-items: center;\n min-width: 40px;\n height: 22px;\n border: 1px solid hsla(0, 0%, 0%, 0.15);\n background-color: #fc662c;\n color: white;\n margin: 0 3px;\n border-radius: calc(0.5rem / 2);\n flex-grow: 1;\n}\n.sc-monitor-row-value-editing .sc-monitor-row-value-outer {\n background-color: #e25c28;\n}\n.sc-monitor-row-value-inner {\n padding: 3px 5px;\n width: 100%;\n color: inherit;\n background: none;\n border: none;\n font: inherit;\n outline: none;\n overflow: hidden;\n text-overflow: ellipsis;\n user-select: text;\n -webkit-user-select: text;\n white-space: pre;\n}\n.sc-monitor-row-value-editing .sc-monitor-row-value-inner {\n padding-right: 0;\n}\n.sc-monitor-row-delete {\n display: none;\n font-size: 150%;\n padding: 0 2px;\n}\n.sc-monitor-row-value-editing .sc-monitor-row-delete {\n display: block;\n}\n.sc-monitor-empty {\n text-align: center;\n padding: 5px;\n}\n\n.sc-controls-bar {\n transform: translateY(-100%);\n display: flex;\n width: 100%;\n justify-content: space-between;\n flex-wrap: nowrap;\n}\n.sc-controls-bar > * {\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n}\n\n.sc-context-menu {\n position: absolute;\n color: black;\n box-shadow: 0px 0px 5px 1px hsla(0, 0%, 0%, 0.25);\n min-width: 130px;\n opacity: 0;\n transition: .2s opacity;\n}\n.sc-context-menu-item {\n display: block;\n width: 100%;\n background-color: white;\n border: none;\n border-radius: 0;\n cursor: pointer;\n text-align: left;\n font-family: inherit;\n font-size: 0.85em;\n padding: 8px 12px;\n margin: 0;\n transition: .1s background-color, .1s color;\n}\n.sc-context-menu-item:focus {\n outline: 2px solid black;\n}\n.sc-context-menu-item:hover,\n.sc-context-menu-item:active {\n color: white;\n background-color: var(--sc-accent-color);\n}\n.sc-context-menu-item:first-child {\n border-radius: 4px 4px 0 0;\n}\n.sc-context-menu-item:last-child {\n border-radius: 0 0 4px 4px;\n}\n\n.sc-dropping {\n background-color: var(--sc-accent-color-transparent);\n}\n',""]),l.locals={root:"sc-root",layers:"sc-layers","scaled-overlays-outer":"sc-scaled-overlays-outer",scaledOverlaysOuter:"sc-scaled-overlays-outer","scaled-overlays-inner":"sc-scaled-overlays-inner",scaledOverlaysInner:"sc-scaled-overlays-inner",canvas:"sc-canvas","question-root":"sc-question-root",questionRoot:"sc-question-root","question-inner":"sc-question-inner",questionInner:"sc-question-inner","question-text":"sc-question-text",questionText:"sc-question-text","question-input-outer":"sc-question-input-outer",questionInputOuter:"sc-question-input-outer","question-input":"sc-question-input",questionInput:"sc-question-input","question-submit-button":"sc-question-submit-button",questionSubmitButton:"sc-question-submit-button","question-submit-button-image":"sc-question-submit-button-image",questionSubmitButtonImage:"sc-question-submit-button-image","monitor-overlay":"sc-monitor-overlay",monitorOverlay:"sc-monitor-overlay","monitor-root":"sc-monitor-root",monitorRoot:"sc-monitor-root","monitor-inner":"sc-monitor-inner",monitorInner:"sc-monitor-inner","monitor-row":"sc-monitor-row",monitorRow:"sc-monitor-row","monitor-label":"sc-monitor-label",monitorLabel:"sc-monitor-label","monitor-slider":"sc-monitor-slider",monitorSlider:"sc-monitor-slider","monitor-value":"sc-monitor-value",monitorValue:"sc-monitor-value","monitor-value-color":"sc-monitor-value-color",monitorValueColor:"sc-monitor-value-color","monitor-large-value":"sc-monitor-large-value",monitorLargeValue:"sc-monitor-large-value","monitor-list-label":"sc-monitor-list-label",monitorListLabel:"sc-monitor-list-label","monitor-list-footer":"sc-monitor-list-footer",monitorListFooter:"sc-monitor-list-footer","monitor-list-footer-text":"sc-monitor-list-footer-text",monitorListFooterText:"sc-monitor-list-footer-text","monitor-row-delete":"sc-monitor-row-delete",monitorRowDelete:"sc-monitor-row-delete","monitor-list-add":"sc-monitor-list-add",monitorListAdd:"sc-monitor-list-add","monitor-rows-outer":"sc-monitor-rows-outer",monitorRowsOuter:"sc-monitor-rows-outer","monitor-rows-inner":"sc-monitor-rows-inner",monitorRowsInner:"sc-monitor-rows-inner","monitor-rows-endpoint":"sc-monitor-rows-endpoint",monitorRowsEndpoint:"sc-monitor-rows-endpoint","monitor-row-root":"sc-monitor-row-root",monitorRowRoot:"sc-monitor-row-root","monitor-row-index":"sc-monitor-row-index",monitorRowIndex:"sc-monitor-row-index","monitor-row-value-outer":"sc-monitor-row-value-outer",monitorRowValueOuter:"sc-monitor-row-value-outer","monitor-row-value-editing":"sc-monitor-row-value-editing",monitorRowValueEditing:"sc-monitor-row-value-editing","monitor-row-value-inner":"sc-monitor-row-value-inner",monitorRowValueInner:"sc-monitor-row-value-inner","monitor-empty":"sc-monitor-empty",monitorEmpty:"sc-monitor-empty","controls-bar":"sc-controls-bar",controlsBar:"sc-controls-bar","context-menu":"sc-context-menu",contextMenu:"sc-context-menu","context-menu-item":"sc-context-menu-item",contextMenuItem:"sc-context-menu-item",dropping:"sc-dropping"},t.a=l},function(e,t,n){const r=n(127);e.exports=r},function(e,t,n){"use strict";(function(e){!function(e){function t(){}function n(){}var r=String.fromCharCode,i={}.toString,s=i.call(e.SharedArrayBuffer),o=i(),a=e.Uint8Array,l=a||Array,c=a?ArrayBuffer:l,u=c.isView||function(e){return e&&"length"in e},d=i.call(c.prototype);c=n.prototype;var h=e.TextEncoder,p=new(a?Uint16Array:l)(32);t.prototype.decode=function(e){if(!u(e)){var t=i.call(e);if(t!==d&&t!==s&&t!==o)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");e=a?new l(e):e||[]}for(var n,c,h,m=t="",f=0,g=0|e.length,y=g-32|0,b=0,v=0,S=0,w=-1;f>4){case 15:if(2!=(h=255&e[f=f+1|0])>>6||247>6?v+4|0:24,c=c+256&768;case 13:case 12:b<<=6,b|=(31&c)<<6|63&(h=255&e[f=f+1|0]),v=v+7|0,f>6&&b>>v&&1114112>b?(c=b,0<=(b=b-65536|0)&&(w=55296+(b>>10)|0,c=56320+(1023&b)|0,31>S?(p[S]=w,S=S+1|0,w=-1):(h=w,w=c,c=h))):(f=f-(c>>=8)-1|0,c=65533),b=v=0,n=f<=y?32:g-f|0;default:p[S]=c;continue;case 11:case 10:case 9:case 8:}p[S]=65533}if(m+=r(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15],p[16],p[17],p[18],p[19],p[20],p[21],p[22],p[23],p[24],p[25],p[26],p[27],p[28],p[29],p[30],p[31]),32>S&&(m=m.slice(0,S-32|0)),f>>31,w=-1,m.length=o)r[i]=o;else{if(2047>=o)r[i]=192|o>>6;else{e:{if(55296<=o)if(56319>=o){var c=0|e.charCodeAt(t=t+1|0);if(56320<=c&&57343>=c){if(65535<(o=(o<<10)+c-56613888|0)){r[i]=240|o>>18,r[i=i+1|0]=128|o>>12&63,r[i=i+1|0]=128|o>>6&63,r[i=i+1|0]=128|63&o;continue}break e}o=65533}else 57343>=o&&(o=65533);!s&&t<<1>12,r[i=i+1|0]=128|o>>6&63}r[i=i+1|0]=128|63&o}}return a?r.subarray(0,i):r.slice(0,i)},h||(e.TextDecoder=t,e.TextEncoder=n)}(""+void 0==typeof e?""+void 0==typeof self?this:self:e)}).call(this,n(9))},function(e,t,n){const r=n(128),i=n(1);e.exports=new class extends r{constructor(){super(),this.services={},this.workerClass="undefined"==typeof Worker?null:Worker,this.workers=[]}callSync(e,t){const{provider:n,isRemote:r}=this._getServiceProvider(e);if(n){if(r)throw new Error("Cannot use 'callSync' on remote provider for service ".concat(e,"."));for(var i=arguments.length,s=new Array(i>2?i-2:0),o=2;o{i.error("Could not handshake with worker: ".concat(e))}))):i.warn("Central dispatch ignoring attempt to add duplicate worker")}_getServiceProvider(e){const t=this.services[e];return t&&{provider:t,isRemote:Boolean(this.workerClass&&t instanceof this.workerClass||t.isRemote)}}_onDispatchMessage(e,t){let n;if("setService"===t.method)n=this.setService(t.args[0],e);else i.error("Central dispatch received message for unknown method: ".concat(t.method));return n}}},function(e,t,n){const r=n(6);e.exports=function(e,t,n){return e&&e.id&&e.default?r(e,t,n):e}},function(e,t){var n="long",r="short",i="narrow",s="numeric",o="2-digit";e.exports={number:{decimal:{style:"decimal"},integer:{style:"decimal",maximumFractionDigits:0},currency:{style:"currency",currency:"USD"},percent:{style:"percent"},default:{style:"decimal"}},date:{short:{month:s,day:s,year:o},medium:{month:r,day:s,year:s},long:{month:n,day:s,year:s},full:{month:n,day:s,year:s,weekday:n},default:{month:r,day:s,year:s}},time:{short:{hour:s,minute:s},medium:{hour:s,minute:s,second:s},long:{hour:s,minute:s,second:s,timeZoneName:r},full:{hour:s,minute:s,second:s,timeZoneName:r},default:{hour:s,minute:s,second:s}},duration:{default:{hours:{minimumIntegerDigits:1,maximumFractionDigits:0},minutes:{minimumIntegerDigits:2,maximumFractionDigits:0},seconds:{minimumIntegerDigits:2,maximumFractionDigits:3}}},parseNumberPattern:function(e){if(e){var t={},n=e.match(/\b[A-Z]{3}\b/i),r=e.replace(/[^¤]/g,"").length;if(!r&&n&&(r=1),r?(t.style="currency",t.currencyDisplay=1===r?"symbol":2===r?"code":"name",t.currency=n?n[0].toUpperCase():"USD"):e.indexOf("%")>=0&&(t.style="percent"),!/[@#0]/.test(e))return t.style?t:void 0;if(t.useGrouping=e.indexOf(",")>=0,/E\+?[@#0]+/i.test(e)||e.indexOf("@")>=0){var i=e.replace(/E\+?[@#0]+|[^@#0]/gi,"");t.minimumSignificantDigits=Math.min(Math.max(i.replace(/[^@0]/g,"").length,1),21),t.maximumSignificantDigits=Math.min(Math.max(i.length,1),21)}else{for(var s=e.replace(/[^#0.]/g,"").split("."),o=s[0],a=o.length-1;"0"===o[a];)--a;t.minimumIntegerDigits=Math.min(Math.max(o.length-1-a,1),21);var l=s[1]||"";for(a=0;"0"===l[a];)++a;for(t.minimumFractionDigits=Math.min(Math.max(a,0),20);"#"===l[a];)++a;t.maximumFractionDigits=Math.min(Math.max(a,0),20)}return t}},parseDatePattern:function(e){if(e){for(var t={},a=0;a{this._openRequests[n]={resolve:e,reject:t}}));return this._sendRequest(e,t,n),r}sendRemoteNotification(e,t){this._sendRequest(e,t)}didReceiveCall(){throw new Error("Must override didReceiveCall")}_sendMessage(){throw new Error("Must override _sendMessage")}_sendRequest(e,t,n){const r={jsonrpc:"2.0",method:e,params:t};null!==n&&(r.id=n),this._sendMessage(r)}_handleMessage(e){if("2.0"!==e.jsonrpc)throw new Error("Bad or missing JSON-RPC version in message: ".concat(e));Object.prototype.hasOwnProperty.call(e,"method")?this._handleRequest(e):this._handleResponse(e)}_sendResponse(e,t,n){const r={jsonrpc:"2.0",id:e};n?r.error=n:r.result=t||null,this._sendMessage(r)}_handleResponse(e){const{result:t,error:n,id:r}=e,i=this._openRequests[r];delete this._openRequests[r],i&&(n?i.reject(n):i.resolve(t))}_handleRequest(e){const{method:t,params:n,id:r}=e,i=this.didReceiveCall(t,n);null!=r&&Promise.resolve(i).then((e=>{this._sendResponse(r,e)}),(e=>{this._sendResponse(r,null,e)}))}}},function(e){e.exports=JSON.parse('{"menuMap":{"cs":[{"code":"cs","name":"čeština"}],"da":[{"code":"da","name":"Dansk"}],"gl":[{"code":"gl","name":"galego"}],"sl":[{"code":"sl","name":"slovenščina"}],"fr":[{"code":"fr","name":"Français"}],"hu":[{"code":"hu","name":"magyar"}],"uk":[{"code":"uk","name":"українська"}],"zh-tw":[{"code":"zh-tw","name":"中文(繁體)"}],"pt":[{"code":"pt","name":"Portuguese"}],"pt-br":[{"code":"pt","name":"Português"}],"tr":[{"code":"tr","name":"Türkçe"}],"ga":[{"code":"ga","name":"Gaeilge"}],"th":[{"code":"th","name":"ภาษาไทย"}],"ja":[{"code":"ja","name":"日本語"}],"ja-hira":[{"code":"ja","name":"日本語"}],"nl":[{"code":"nl","name":"Nederlands"}],"gd":[{"code":"gd","name":"Gàidhlig"}],"nb":[{"code":"nb","name":"norsk"}],"de":[{"code":"de","name":"Deutsch"}],"he":[{"code":"he","name":"עברית"}],"sk":[{"code":"sk","name":"slovenčina"}],"zu":[{"code":"zu","name":"isiZulu"}],"ru":[{"code":"ru","name":"русский"}],"pl":[{"code":"pl","name":"polski"}],"am":[{"code":"am","name":"አማርኛ"}],"az":[{"code":"az","name":"Azərbaycan dili"}],"hr":[{"code":"hr","name":"hrvatski"}],"fa":[{"code":"fa","name":"فارسی"}],"mi":[{"code":"mi","name":"Māori"}],"el":[{"code":"el","name":"Ελληνικά"}],"is":[{"code":"is","name":"íslenska"}],"fi":[{"code":"fi","name":"suomi"}],"eu":[{"code":"eu","name":"euskara"}],"ca":[{"code":"ca","name":"català"}],"lv":[{"code":"lv","name":"latviešu"}],"id":[{"code":"id","name":"Indonesia"}],"es":[{"code":"es","name":"español"}],"es-419":[{"code":"es","name":"español"}],"et":[{"code":"et","name":"eesti"}],"cy":[{"code":"cy","name":"Cymraeg"}],"zh-cn":[{"code":"zh-cn","name":"中文(简体)"}],"bg":[{"code":"bg","name":"български"}],"ar":[{"code":"ar","name":"العربية"}],"en":[{"code":"en","name":"English"}],"sr":[{"code":"sr","name":"српски"}],"sv":[{"code":"sv","name":"svenska"}],"ro":[{"code":"ro","name":"Română"}],"lt":[{"code":"lt","name":"lietuvių"}],"ko":[{"code":"ko","name":"한국어"}],"it":[{"code":"it","name":"Italiano"}],"vi":[{"code":"vi","name":"Tiếng Việt"}]},"nameMap":{"albánština":"sq","amharština":"am","angličtina":"en","arabština":"ar","arménština":"hy","ázerbájdžánština":"az","barmština":"my","baskičtina":"eu","běloruština":"be","bulharština":"bg","čeština":"cs","čínština (tradiční)":"zh-tw","čínština (zjednodušená)":"zh-cn","dánština":"da","esperanto":"eo","estonština":"et","finština":"fi","francouzština":"fr","galicijština":"gl","haitská kreolština":"ht","hebrejština":"he","hindština":"hi","holandština":"nl","chorvatština":"hr","indonéština":"id","irština":"ga","islandština":"is","italština":"it","japonština":"ja","kannadština":"kn","katalánština":"ca","korejština":"ko","kurdština":"ku","latina":"la","litevština":"lt","lotyština":"lv","maďarština":"hu","makedonština":"mk","malajálamština":"ml","malajština":"ms","maltština":"mt","maorština":"mi","marátština":"mr","mongolština":"mn","němčina":"de","norština":"nb","perština":"fa","polština":"pl","portugalština":"pt","rumunština":"ro","ruština":"ru","řečtina":"el","skotská gaelština":"gd","slovenština":"sk","slovinština":"sl","srbština":"sr","španělština":"es","švédština":"sv","telužština":"te","thajština":"th","turečtina":"tr","ukrajinština":"uk","uzbečtina":"uz","velština":"cy","vietnamština":"vi","zulu":"zu","albansk":"sq","amharisk":"am","arabisk":"ar","armensk":"hy","aserbajdsjansk":"az","baskisk":"eu","bulgarsk":"bg","burmesisk":"my","dansk":"da","engelsk":"en","estisk":"et","finsk":"fi","fransk":"fr","galicisk":"gl","græsk":"el","haitisk kreolsk":"ht","hebraisk":"he","hindi":"hi","hollandsk":"nl","hviderussisk":"be","indonesisk":"id","irsk":"ga","islandsk":"is","italiensk":"it","japansk":"ja","kannada":"kn","katalansk":"ca","kinesisk (forenklet)":"zh-cn","kinesisk (traditionelt)":"zh-tw","koreansk":"ko","kroatisk":"hr","kurdisk":"ku","latin":"la","lettisk":"lv","litauisk":"lt","makedonsk":"mk","malajisk":"ms","malayalam":"ml","maltesisk":"mt","maori":"mi","marathi":"mr","mongolsk":"mn","norsk":"nb","persisk":"fa","polsk":"pl","portugisisk":"pt","rumænsk":"ro","russisk":"ru","serbisk":"sr","skotsk gælisk":"gd","slovakisk":"sk","slovensk":"sl","spansk":"es","svensk":"sv","telugu":"te","thailandsk":"th","tjekkisk":"cs","tyrkisk":"tr","tysk":"de","ukrainsk":"uk","ungarsk":"hu","usbekisk":"uz","vietnamesisk":"vi","walisisk":"cy","acerbaixano":"az","albanés":"sq","alemán":"de","amárico":"am","árabe":"ar","armenio":"hy","bielorruso":"be","birmano":"my","búlgaro":"bg","canarés":"kn","catalán":"ca","checo":"cs","chinés (simplificado)":"zh-cn","chinés (tradicional)":"zh-tw","coreano":"ko","crioulo haitiano":"ht","croata":"hr","curdo":"ku","dinamarqués":"da","eslovaco":"sk","esloveno":"sl","español":"es","estoniano":"et","éuscaro":"eu","finés":"fi","francés":"fr","gaélico escocés":"gd","galego":"gl","galés":"cy","grego":"el","hebreo":"he","húngaro":"hu","indonesio":"id","inglés":"en","irlandés":"ga","islandés":"is","italiano":"it","latín":"la","letón":"lv","lituano":"lt","macedonio":"mk","malabar":"ml","malaio":"ms","maltés":"mt","maorí":"mi","mongol":"mn","neerlandés":"nl","noruegués":"nb","persa":"fa","polaco":"pl","portugués":"pt","romanés":"ro","ruso":"ru","serbio":"sr","sueco":"sv","tailandés":"th","telugú":"te","turco":"tr","ucraíno":"uk","usbeco":"uz","vietnamita":"vi","xaponés":"ja","zulú":"zu","albanščina":"sq","amharščina":"am","angleščina":"en","arabščina":"ar","armenščina":"hy","azerbajdžanščina":"az","baskovščina":"eu","beloruščina":"be","bolgarščina":"bg","burmanščina":"my","češčina":"cs","danščina":"da","estonščina":"et","finščina":"fi","francoščina":"fr","galicijščina":"gl","grščina":"el","haitijska kreolščina":"ht","hebrejščina":"he","hindijščina":"hi","hrvaščina":"hr","indonezijščina":"id","irščina":"ga","islandščina":"is","italijanščina":"it","japonščina":"ja","kanareščina":"kn","katalonščina":"ca","kitajščina (poenostavljena)":"zh-cn","kitajščina (tradicionalna)":"zh-tw","korejščina":"ko","kurdščina":"ku","latinščina":"la","latvijščina":"lv","litovščina":"lt","madžarščina":"hu","makedonščina":"mk","malajalščina":"ml","malajščina":"ms","malteščina":"mt","maorščina":"mi","maratščina":"mr","mongolščina":"mn","nemščina":"de","nizozemščina":"nl","norveščina":"nb","perzijščina":"fa","poljščina":"pl","portugalščina":"pt","romunščina":"ro","ruščina":"ru","slovaščina":"sk","slovenščina":"sl","srbščina":"sr","škotska gelščina":"gd","španščina":"es","švedščina":"sv","tajščina":"th","teluščina":"te","turščina":"tr","ukrajinščina":"uk","uzbeščina":"uz","valižanščina":"cy","vietnamščina":"vi","zulujščina":"zu","albanais":"sq","allemand":"de","amharique":"am","anglais":"en","arabe":"ar","arménien":"hy","azéri":"az","basque":"eu","biélorusse":"be","birman":"my","bulgare":"bg","catalan":"ca","chinois (simplifié)":"zh-cn","chinois (traditionnel)":"zh-tw","coréen":"ko","créole haïtien":"ht","croate":"hr","danois":"da","espagnol":"es","espéranto":"eo","estonien":"et","finnois":"fi","français":"fr","gaélique (écosse)":"gd","galicien":"gl","gallois":"cy","grec":"el","hébreu":"he","hongrois":"hu","indonésien":"id","irlandais":"ga","islandais":"is","italien":"it","japonais":"ja","kurde":"ku","letton":"lv","lituanien":"lt","macédonien":"mk","malaisien":"ms","maltais":"mt","néerlandais":"nl","norvégien":"nb","ouzbek":"uz","persan":"fa","polonais":"pl","portugais":"pt","roumain":"ro","russe":"ru","serbe":"sr","slovaque":"sk","slovène":"sl","suédois":"sv","tchèque":"cs","thaï":"th","turc":"tr","ukrainien":"uk","vietnamien":"vi","zoulou":"zu","albán":"sq","amhara":"am","angol":"en","arab":"ar","azeri":"az","baszk":"eu","belorusz":"be","bolgár":"bg","burmai":"my","cseh":"cs","dán":"da","eszperantó":"eo","észt":"et","finn":"fi","francia":"fr","galíciai":"gl","görög":"el","haiti kreol":"ht","héber":"he","holland":"nl","horvát":"hr","indonéz":"id","ír":"ga","izlandi":"is","japán":"ja","katalán":"ca","kínai (egyszerűsített)":"zh-cn","kínai (hagyományos)":"zh-tw","koreai":"ko","kurd":"ku","lengyel":"pl","lett":"lv","litván":"lt","macedón":"mk","magyar":"hu","maláj":"ms","malajálam":"ml","máltai":"mt","maráthi":"mr","német":"de","norvég":"nb","olasz":"it","orosz":"ru","örmény":"hy","perzsa":"fa","portugál":"pt","román":"ro","skót-gael":"gd","spanyol":"es","svéd":"sv","szerb":"sr","szlovák":"sk","szlovén":"sl","thai":"th","török":"tr","ukrán":"uk","üzbég":"uz","vietnami":"vi","walesi":"cy","азербайджанська":"az","албанська":"sq","амхарська":"am","англійська":"en","арабська":"ar","баскська":"eu","білоруська":"be","бірманська":"my","болгарська":"bg","в’єтнамська":"vi","валлійська":"cy","вірменська":"hy","гаїтянська креольська":"ht","гінді":"hi","грецька":"el","ґалісійська":"gl","данська":"da","есперанто":"eo","естонська":"et","зулу":"zu","іврит":"he","індонезійська":"id","ірландська":"ga","ісландська":"is","іспанська":"es","італійська":"it","каннада":"kn","каталанська":"ca","китайська (спрощена)":"zh-cn","китайська (традиційна)":"zh-tw","корейська":"ko","курдська":"ku","латинська":"la","латиська":"lv","литовська":"lt","македонська":"mk","малайська":"ms","малаялам":"ml","мальтійська":"mt","маорі":"mi","маратхі":"mr","монгольська":"mn","нідерландська":"nl","німецька":"de","норвезька":"nb","перська":"fa","польська":"pl","португальська":"pt","російська":"ru","румунська":"ro","сербська":"sr","словацька":"sk","словенська":"sl","тайська":"th","телуґу":"te","турецька":"tr","угорська":"hu","узбецька":"uz","українська":"uk","фінська":"fi","французька":"fr","хорватська":"hr","чеська":"cs","шведська":"sv","шотландська (ґельська)":"gd","японська":"ja","土耳其文":"tr","中文(繁體)":"zh-tw","中文(簡體)":"zh-cn","丹麥文":"da","巴斯克文":"eu","日文":"ja","毛利文":"mi","世界語":"eo","加里西亞文":"gl","加泰羅尼亞文":"ca","卡納達文":"kn","白俄羅斯文":"be","立陶宛文":"lt","冰島文":"is","匈牙利文":"hu","印尼文":"id","印度文":"hi","西班牙文":"es","克羅埃西亞文":"hr","希伯來文":"he","希臘文":"el","亞美尼亞文":"hy","亞塞拜然文":"az","拉丁文":"la","拉脫維亞文":"lv","法文":"fr","波斯文":"fa","波蘭文":"pl","芬蘭文":"fi","阿姆哈拉文":"am","阿拉伯文":"ar","阿爾巴尼亞文":"sq","俄文":"ru","保加利亞文":"bg","南非祖魯文":"zu","威爾斯文":"cy","英文":"en","庫德文":"ku","挪威文":"nb","泰文":"th","泰盧固文":"te","海地克里奧文":"ht","烏克蘭文":"uk","烏茲別克文":"uz","馬耳他文":"mt","馬來文":"ms","馬其頓文":"mk","馬拉地文":"mr","馬拉雅拉姆文":"ml","捷克文":"cs","荷蘭文":"nl","斯洛伐克文":"sk","斯洛維尼亞文":"sl","越南文":"vi","塞爾維亞文":"sr","愛沙尼亞文":"et","愛爾蘭文":"ga","瑞典文":"sv","義大利文":"it","葡萄牙文":"pt","蒙古文":"mn","德文":"de","緬甸文":"my","韓文":"ko","羅馬尼亞文":"ro","蘇格蘭的蓋爾文":"gd","अझरबैजानी":"az","अम्हारिक":"am","अरबी":"ar","अर्मेनियन":"hy","अल्बानियन":"sq","आइसलँडिक":"is","आयरिश":"ga","इंग्रजी":"en","इंडोनेशियन":"id","इटालियन":"it","उझ्बेक":"uz","एस्टोनियन":"et","एस्परँटो":"eo","कन्नड":"kn","कुर्दिश (कुर्मांजी)":"ku","कॅटलान":"ca","कोरियन":"ko","क्रोएशियन":"hr","गॅलिशियन":"gl","ग्रीक":"el","चीनी (पारंपारिक)":"zh-tw","चीनी (सरलीकृत)":"zh-cn","जपानी":"ja","जर्मन":"de","झुलु":"zu","झेक":"cs","डच":"nl","डॅनिश":"da","तुर्की":"tr","तेलगू":"te","थाई":"th","नॉर्वेजियन":"nb","पोर्तुगीज":"pt","पोलिश":"pl","फारसी":"fa","फिन्निश":"fi","फ्रेंच":"fr","बल्गेरियन":"bg","बास्क":"eu","बेलारुशियन":"be","मंगोलियन":"mn","मराठी":"mr","मलय":"ms","मल्याळम":"ml","माओरी":"mi","माल्टीज":"mt","मॅसेडोनियन":"mk","म्यानमार (बर्मीज)":"my","युक्रेनियन":"uk","रशियन":"ru","रोमानियन":"ro","लाट्वियन":"lv","लिथुआनियन":"lt","लॅटिन":"la","वेल्श":"cy","व्हिएतनामी":"vi","सर्बियन":"sr","स्कॉट्स गेलिक":"gd","स्पॅनिश":"es","स्लोव्हाक":"sk","स्लोव्हेनियन":"sl","स्वीडिश":"sv","हंगेरियन":"hu","हिन्दी":"hi","हिब्रू":"he","हैतीयन क्रेओल":"ht","albanian":"sq","amharic":"am","arabic":"ar","armenian":"hy","azerbaijani":"az","belarusian":"be","bulgarian":"bg","chinese (simplified)":"zh-cn","chinese (traditional)":"zh-tw","croatian":"hr","czech":"cs","danish":"da","dutch":"nl","english":"en","estonian":"et","finnish":"fi","french":"fr","galician":"gl","german":"de","greek":"el","haitian creole":"ht","hebrew":"he","hungarian":"hu","icelandic":"is","indonesian":"id","irish":"ga","italian":"it","japanese":"ja","korean":"ko","kurdish (kurmanji)":"ku","latvian":"lv","lithuanian":"lt","macedonian":"mk","malay":"ms","maltese":"mt","mongolian":"mn","myanmar (burmese)":"my","norwegian":"nb","persian":"fa","polish":"pl","portuguese":"pt","romanian":"ro","russian":"ru","scots gaelic":"gd","serbian":"sr","slovak":"sk","slovenian":"sl","spanish":"es","swedish":"sv","turkish":"tr","ukrainian":"uk","uzbek":"uz","vietnamese":"vi","welsh":"cy","albanês":"sq","alemão":"de","armênio":"hy","azerbaijano":"az","basco":"eu","bielo-russo":"be","birmanês":"my","canarês":"kn","catalão":"ca","chinês (simplificado)":"zh-cn","chinês (tradicional)":"zh-tw","dinamarquês":"da","espanhol":"es","finlandês":"fi","francês":"fr","gaélico escocês":"gd","galês":"cy","hebraico":"he","holandês":"nl","indonésio":"id","inglês":"en","irlandês":"ga","islandês":"is","japonês":"ja","latim":"la","letão":"lv","macedônio":"mk","malaiala":"ml","maltês":"mt","marata":"mr","norueguês":"nb","polonês":"pl","português":"pt","romeno":"ro","russo":"ru","sérvio":"sr","tailandês":"th","tcheco":"cs","telugo":"te","ucraniano":"uk","uzbeque":"uz","almanca":"de","arapça":"ar","arnavutça":"sq","azerice":"az","baskça":"eu","belarusça":"be","bulgarca":"bg","burmaca":"my","çekçe":"cs","çince (basitleştirilmiş)":"zh-cn","çince (geleneksel)":"zh-tw","danca":"da","endonezya dili":"id","ermenice":"hy","esperantoca":"eo","estonyaca":"et","farsça":"fa","felemenkçe":"nl","fince":"fi","fransızca":"fr","galce":"cy","galiçyaca":"gl","habeşçe":"am","haiti creole dili":"ht","hırvatça":"hr","hintçe":"hi","i̇branice":"he","i̇ngilizce":"en","i̇rlandaca":"ga","i̇spanyolca":"es","i̇sveççe":"sv","i̇talyanca":"it","i̇zlandaca":"is","japonca":"ja","katalanca":"ca","korece":"ko","kuzey i̇skoç dili":"gd","kürtçe":"ku","latince":"la","lehçe":"pl","letonca":"lv","litvanca":"lt","macarca":"hu","makedonca":"mk","malezya dili":"ms","malta dili":"mt","maori dili":"mi","moğolca":"mn","norveççe":"nb","özbekçe":"uz","portekizce":"pt","romence":"ro","rusça":"ru","sırpça":"sr","slovakça":"sk","slovence":"sl","tay dili":"th","telugu dili":"te","türkçe":"tr","ukraynaca":"uk","vietnamca":"vi","yunanca":"el","airméinis":"hy","albáinis":"sq","amárais":"am","araibis":"ar","asarbaiseáinis":"az","bascais":"eu","bealarúisis":"be","béarla":"en","breatnais":"cy","bulgáiris":"bg","cannadais":"kn","catalóinis":"ca","coirdis (curmainsis)":"ku","cóiréis":"ko","criól háítí":"ht","cróitis":"hr","danmhairgis":"da","eabhrais":"he","eastóinis":"et","fionlainnis":"fi","fraincis":"fr","gaeilge":"ga","gaeilge na halban":"gd","gailísis":"gl","gearmáinis":"de","gréigis":"el","hiondúis":"hi","indinéisis":"id","iodáilis":"it","ioruais":"nb","íoslainnis":"is","laidin":"la","laitvis":"lv","liotuáinis":"lt","macadóinis":"mk","maenmar (burmais)":"my","mailéalaimis":"ml","malaeis":"ms","máltais":"mt","maorais":"mi","maraitis":"mr","mongóilis":"mn","ollainnis":"nl","peirsis":"fa","polainnis":"pl","portaingéilis":"pt","rómáinis":"ro","rúisis":"ru","seapáinis":"ja","seicis":"cs","seirbis":"sr","sínis (simplithe)":"zh-cn","sínis (traidisiúnta)":"zh-tw","slóivéinis":"sl","slóvaicis":"sk","spáinnis":"es","sualainnis":"sv","súlúis":"zu","téalainnis":"th","teileagúis":"te","tuircis":"tr","úcráinis":"uk","úisbéiceastáinis":"uz","ungáiris":"hu","vítneaimis":"vi","ภาษากรีก":"el","ภาษากันนาดา":"kn","ภาษากาลิเชียน":"gl","ภาษาเกลิกในสก็อต":"gd","ภาษาเกาหลี":"ko","ภาษาคาตาลัน":"ca","ภาษาเคิร์ด":"ku","ภาษาโครเอเชีย":"hr","ภาษาจีน (ดั้งเดิม)":"zh-tw","ภาษาจีน (แบบย่อ)":"zh-cn","ภาษาเช็ก":"cs","ภาษาซูลู":"zu","ภาษาเซอร์เบียน":"sr","ภาษาญี่ปุ่น":"ja","ภาษาดัตช์":"nl","ภาษาเดนมาร์ก":"da","ภาษาตุรกี":"tr","ภาษาเตลูกู":"te","ภาษาไทย":"th","ภาษานอร์เวย์":"nb","ภาษาบัลกาเรีย":"bg","ภาษาบาสก์":"eu","ภาษาเบลารูเชียน":"be","ภาษาเปอร์เซีย":"fa","ภาษาโปรตุเกส":"pt","ภาษาโปแลนด์":"pl","ภาษาฝรั่งเศส":"fr","ภาษาฟินแลนด์":"fi","ภาษามองโกเลีย":"mn","ภาษามัลทีส":"mt","ภาษามาซีโดเนีย":"mk","ภาษามาราฐี":"mr","ภาษามาลายาลัม":"ml","ภาษามาเลย์":"ms","ภาษาเมารี":"mi","ภาษาเมียนมา (พม่า)":"my","ภาษายูเครน":"uk","ภาษาเยอรมัน":"de","ภาษารัสเซีย":"ru","ภาษาโรมาเนีย":"ro","ภาษาละติน":"la","ภาษาลัทเวีย":"lv","ภาษาลิทัวเนีย":"lt","ภาษาเวลส์":"cy","ภาษาเวียดนาม":"vi","ภาษาสเปน":"es","ภาษาสโลวัก":"sk","ภาษาสโลเวเนีย":"sl","ภาษาสวีเดน":"sv","ภาษาอังกฤษ":"en","ภาษาอัมฮาริก":"am","ภาษาอัลบาเนีย":"sq","ภาษาอาร์เซอร์ไบจัน":"az","ภาษาอาร์เมเนีย":"hy","ภาษาอาหรับ":"ar","ภาษาอิตาลี":"it","ภาษาอินโดนีเซีย":"id","ภาษาอุสเบกิสถาน":"uz","ภาษาเอสโทเนีย":"et","ภาษาเอสเปอแรนโต":"eo","ภาษาไอซ์แลนดิก":"is","ภาษาไอริช":"ga","ภาษาฮังการี":"hu","ภาษาฮินดี":"hi","ภาษาฮิบรู":"he","ภาษาเฮติครีโอล":"ht","アイスランド語":"is","アイルランド語":"ga","アゼルバイジャン語":"az","アムハラ語":"am","アラビア語":"ar","アルバニア語":"sq","アルメニア語":"hy","イタリア語":"it","インドネシア語":"id","ウェールズ語":"cy","ウクライナ語":"uk","ウズベク語":"uz","エストニア語":"et","エスペラント語":"eo","オランダ語":"nl","カタルーニャ語":"ca","ガリシア語":"gl","カンナダ語":"kn","ギリシャ語":"el","クルド語":"ku","クロアチア語":"hr","スウェーデン語":"sv","ズールー語":"zu","スコットランド ゲール語":"gd","スペイン語":"es","スロバキア語":"sk","スロベニア語":"sl","セルビア語":"sr","タイ語":"th","チェコ語":"cs","テルグ語":"te","デンマーク語":"da","ドイツ語":"de","トルコ語":"tr","ノルウェー語":"nb","ハイチ語":"ht","バスク語":"eu","ハンガリー語":"hu","ヒンディー語":"hi","フィンランド語":"fi","フランス語":"fr","ブルガリア語":"bg","ベトナム語":"vi","ヘブライ語":"he","ベラルーシ語":"be","ペルシャ語":"fa","ポーランド語":"pl","ポルトガル語":"pt","マオリ語":"mi","マケドニア語":"mk","マラーティー語":"mr","マラヤーラム語":"ml","マルタ語":"mt","マレー語":"ms","ミャンマー語":"my","モンゴル語":"mn","ラテン語":"la","ラトビア語":"lv","リトアニア語":"lt","ルーマニア語":"ro","ロシア語":"ru","英語":"en","韓国語":"ko","中国語(簡体)":"zh-cn","中国語(繁体)":"zh-tw","日本語":"ja","albanees":"sq","amharisch":"am","arabisch":"ar","armeens":"hy","azerbeidzjaans":"az","baskisch":"eu","birmaans":"my","bulgaars":"bg","catalaans":"ca","chinees (traditioneel)":"zh-tw","chinees (vereenvoudigd)":"zh-cn","deens":"da","duits":"de","engels":"en","ests":"et","fins":"fi","frans":"fr","galicisch":"gl","grieks":"el","haïtiaans creools":"ht","hebreeuws":"he","hongaars":"hu","iers":"ga","ijslands":"is","indonesisch":"id","italiaans":"it","japans":"ja","koerdisch":"ku","koreaans":"ko","kroatisch":"hr","latijn":"la","lets":"lv","litouws":"lt","macedonisch":"mk","maleis":"ms","maltees":"mt","mongools":"mn","nederlands":"nl","noors":"nb","oekraïens":"uk","oezbeeks":"uz","perzisch":"fa","pools":"pl","portugees":"pt","roemeens":"ro","russisch":"ru","schots keltisch":"gd","servisch":"sr","slovaaks":"sk","sloveens":"sl","spaans":"es","tsjechisch":"cs","turks":"tr","vietnamees":"vi","wels":"cy","wit-russisch":"be","zoeloe":"zu","zweeds":"sv","airmeinis":"hy","albàinis":"sq","amtharais":"am","arabais":"ar","asarbaideànais":"az","basgais":"eu","bealaruisis":"be","beurla":"en","bhiet-namais":"vi","bulgarais":"bg","cànan nan tàidh":"th","catalanais":"ca","coirèanais":"ko","crìtheol haidhti":"ht","cròthaisis":"hr","cuimris":"cy","cùrdais (kurmanji)":"ku","duitsis":"nl","eabhra":"he","eadailtis":"it","eastoinis":"et","fionnlannais":"fi","fraingis":"fr","gàidhlig":"gd","gailìsis":"gl","gearmailtis":"de","grèigis":"el","hindis":"hi","innd-innsis":"id","innis-tìlis":"is","laideann":"la","laitbheis":"lv","liotuainis":"lt","malaidhis":"ms","māori":"mi","masadonais":"mk","miànmar (burmais)":"my","mongolais":"mn","nirribhis":"nb","pòlainnis":"pl","portagailis":"pt","romàinis":"ro","ruisis":"ru","seacais":"cs","seapanais":"ja","sèirbis":"sr","sìonais (seann-nòsach)":"zh-tw","sìonais (sìmplichte)":"zh-cn","slòbhacais":"sk","slòbhainis":"sl","spàinntis":"es","suainis":"sv","turcais":"tr","ucràinis":"uk","ungairis":"hu","usbagais":"uz","farsi":"fa","galisisk":"gl","gresk":"el","hviterussisk":"be","kinesisk (tradisjonell)":"zh-tw","kreol (haiti)":"ht","latvisk":"lv","malayisk":"ms","nederlandsk":"nl","rumensk":"ro","tsjekkisk":"cs","albanisch":"sq","armenisch":"hy","aserbaidschanisch":"az","birmanisch":"my","bulgarisch":"bg","chinesisch (traditionell)":"zh-tw","chinesisch (vereinfacht)":"zh-cn","dänisch":"da","deutsch":"de","englisch":"en","estnisch":"et","finnisch":"fi","französisch":"fr","galizisch":"gl","griechisch":"el","haitianisch":"ht","hebräisch":"he","irisch":"ga","isländisch":"is","italienisch":"it","japanisch":"ja","katalanisch":"ca","koreanisch":"ko","kurdisch (kurmandschi)":"ku","lateinisch":"la","lettisch":"lv","litauisch":"lt","malaysisch":"ms","maltesisch":"mt","mazedonisch":"mk","mongolisch":"mn","niederländisch":"nl","norwegisch":"nb","persisch":"fa","polnisch":"pl","portugiesisch":"pt","rumänisch":"ro","schottisch-gälisch":"gd","schwedisch":"sv","serbisch":"sr","slowakisch":"sk","slowenisch":"sl","spanisch":"es","thailändisch":"th","tschechisch":"cs","türkisch":"tr","ukrainisch":"uk","ungarisch":"hu","usbekisch":"uz","vietnamesisch":"vi","walisisch":"cy","weißrussisch":"be","ကနာဒါ":"kn","ကာ့ဒ် (ကာမန်ဂျီ)":"ku","ကိုရီးယား":"ko","ကက်တလန်":"ca","ခရိုအေးရှား":"hr","ချက်":"cs","ဂရိ":"el","ဂယ်လိရှ":"gl","ဂျပန်":"ja","ဂျာမန်":"de","စကော့ ဂေးလစ်":"gd","စပိန်":"es","ဆလိုဗေးနီးယား":"sl","ဆလိုဗက်":"sk","ဆားဘီးယား":"sr","ဆွီဒင်":"sv","ဇူးလူး":"zu","တရုတ် (ရိုးရာ)":"zh-tw","တရုတ် (အလွယ်)":"zh-cn","တူ​ရ​ကီ":"tr","တယ်လူဂူ":"te","ထိုင်း":"th","ဒတ်ချ်":"nl","ဒိန်းမတ်":"da","နော်ဝေ":"nb","ပါရှန်":"fa","ပေါ်တူဂီ":"pt","ပိုလန်":"pl","ပြင်သစ်":"fr","ဖင်လန်":"fi","ဗီယက်နမ်":"vi","ဘာ့စ်":"eu","ဘူဂေးရီးယား":"bg","ဘယ်လာရုစ်":"be","မလေယာလမ်":"ml","မလေး":"ms","မာရာသီ":"mr","မော်ရီ":"mi","မော်လတာ":"mt","မက်ဆီဒိုးနီးယား":"mk","မြန်မာ (မြန်မာ)":"my","မွန်ဂိုလီးယား":"mn","ယူ​က​ရိန်း​":"uk","ရုရှား":"ru","ရိုမေးနီးယား":"ro","လက်တင်":"la","လစ်သူယေးနီးယား":"lt","လတ်ဗီယာ":"lv","ဝေလ":"cy","ဟီဘရူး":"he","ဟေတီ ခရီအိုး":"ht","ဟင်ဒီ":"hi","ဟန်ဂေရီ":"hu","အဇာဘိုင်ဂျန်":"az","အာမေးနီးယား":"hy","အာရေဗျ":"ar","အီတလီ":"it","ဥဇဘက်":"uz","အက်စတိုးနီးယား":"et","အက်စ်ပဲရန်တို":"eo","အိုက်စလန်":"is","အင်္ဂလိပ်":"en","အင်ဒိုနီးရှား":"id","အိုင်းရစ်ရှ်":"ga","အမ်ဟဲရစ်ခ်":"am","အယ်လ်ဘေးနီးယား":"sq","אוזבקית":"uz","אוקראינית":"uk","אזרית":"az","איטלקית":"it","אינדונזית":"id","איסלנדית":"is","אירית":"ga","אלבנית":"sq","אמהרית":"am","אנגלית":"en","אסטונית":"et","אספרנטו":"eo","ארמנית":"hy","באסקית":"eu","בולגרית":"bg","בורמזית":"my","בלארוסית":"be","גליציאנית":"gl","גרמנית":"de","דנית":"da","הולנדית":"nl","הונגרית":"hu","הינדי":"hi","וולשית":"cy","וייטנאמית":"vi","זולו":"zu","טורקית":"tr","טלוגו":"te","יוונית":"el","יפנית":"ja","כורדית":"ku","לטווית":"lv","לטינית":"la","ליטאית":"lt","מאורית":"mi","מאלאיאלם":"ml","מאלזית":"ms","מאראתי":"mr","מונגולית":"mn","מלטית":"mt","מקדונית":"mk","נורווגית":"nb","סינית (מסורתית)":"zh-tw","סינית (פשוטה)":"zh-cn","סלובנית":"sl","סלובקית":"sk","ספרדית":"es","סקוטית גאלית":"gd","סרבית":"sr","עברית":"he","ערבית":"ar","פולנית":"pl","פורטוגזית":"pt","פינית":"fi","פרסית":"fa","צ\'כית":"cs","צרפתית":"fr","קאנאדה":"kn","קוריאנית":"ko","קטלאנית":"ca","קרואטית":"hr","קריאולית האיטית":"ht","רומנית":"ro","רוסית":"ru","שוודית":"sv","תאילנדית":"th","азербејџански":"az","албански":"sq","амхарски":"am","англиски":"en","арапски":"ar","баскиски":"eu","белоруски":"be","бугарски":"bg","бурмански":"my","велшки":"cy","виетнамски":"vi","галициски":"gl","германски":"de","грчки":"el","дански":"da","ерменски":"hy","естонски":"et","индонезиски":"id","ирски":"ga","исландски":"is","италијански":"it","јапонски":"ja","канада":"kn","каталонски":"ca","кинески (поедноставен)":"zh-cn","кинески (традиционален)":"zh-tw","корејски":"ko","курдски":"ku","латвиски":"lv","латински":"la","литвански":"lt","македонски":"mk","малајалам":"ml","малајски":"ms","малтешки":"mt","маорски":"mi","маратхи":"mr","монголски":"mn","норвешки":"nb","персиски":"fa","полски":"pl","португалски":"pt","романски":"ro","руски":"ru","словачки":"sk","словенечки":"sl","српски":"sr","тајландски":"th","телугу":"te","турски":"tr","узбечки":"uz","украински":"uk","унгарски":"hu","фински":"fi","француски":"fr","хаитски креолски":"ht","хебрејски":"he","хиндиски":"hi","холандски":"nl","хрватски":"hr","чешки":"cs","шведски":"sv","шкотски галски":"gd","шпански":"es","ಅಜರ್ಬೈಜಾನಿ":"az","ಅಮಹಾರಿಕ್":"am","ಅರಬ್ಬಿ":"ar","ಆರ್ಮೇನಿಯನ್":"hy","ಆಲ್ಬೇನಿಯನ್":"sq","ಇಂಗ್ಲಿಷ್‌‌":"en","ಇಂಡೋನೇಷಿಯನ್":"id","ಇಟಾಲಿಯನ್":"it","ಉಜ್ಬೆಕ್":"uz","ಎಸ್ಟೋನಿಯನ್":"et","ಎಸ್ಪೆರಾಂಟೋ":"eo","ಐರಿಷ್":"ga","ಐಸ್‌ಲ್ಯಾಂಡಿಕ್‌":"is","ಕನ್ನಡ":"kn","ಕುರ್ದಿಶ್":"ku","ಕೊರಿಯನ್":"ko","ಕ್ಯಾಟಲನ್":"ca","ಕ್ರೊಯೇಷಿಯನ್":"hr","ಗ್ಯಾಲೀಷಿಯನ್":"gl","ಗ್ರೀಕ್":"el","ಚೀನಿ (ಸರಳೀಕೃತ)":"zh-cn","ಚೀನಿ (ಸಾಂಪ್ರದಾಯಿಕ)":"zh-tw","ಜಪಾನಿ":"ja","ಜರ್ಮನ್":"de","ಜುಲು":"zu","ಝೆಕ್‌":"cs","ಟರ್ಕಿಷ್":"tr","ಡಚ್":"nl","ಡ್ಯಾನಿಷ್":"da","ತೆಲುಗು":"te","ಥಾಯ್":"th","ನಾರ್ವೇಜಿಯನ್‌":"nb","ಪೋರ್ಚುಗೀಸ್":"pt","ಪೋಲಿಷ್":"pl","ಫಾರ್ಸಿ":"fa","ಫಿನ್ನಿಷ್":"fi","ಫ್ರೆಂಚ್":"fr","ಬರ್ಮೀಸ್":"my","ಬಲ್ಗೇರಿಯನ್":"bg","ಬಾಸ್ಕ್":"eu","ಬೆಲರೂಸಿಯನ್":"be","ಮಂಗೋಲಿಯನ್":"mn","ಮರಾಠಿ":"mr","ಮಲಯ":"ms","ಮಲಯಾಳಂ":"ml","ಮಾಲ್ಟೀಸ್":"mt","ಮಾವೋರಿ":"mi","ಮ್ಯಾಸೆಡೋನಿಯನ್":"mk","ಯುಕ್ರೇನಿಯನ್":"uk","ರಷಿಯನ್":"ru","ರೊಮೇನಿಯನ್":"ro","ಲಿಥುವೇನಿಯನ್":"lt","ಲ್ಯಾಟಿನ್":"la","ಲ್ಯಾಟ್ವಿಯನ್‌":"lv","ವಿಯೆಟ್ನಾಮಿ":"vi","ವೆಲ್ಶ್":"cy","ಸರ್ಬಿಯನ್":"sr","ಸ್ಕಾಟ್ಸ್ ಗ್ಯಾಲಿಕ್":"gd","ಸ್ಪ್ಯಾನಿಷ್":"es","ಸ್ಲೊವಾಕ್":"sk","ಸ್ಲೊವೆನಿಯನ್":"sl","ಸ್ವೀಡಿಷ್":"sv","ಹಂಗೇರಿಯನ್":"hu","ಹಯಥಿಯನ್‌ ಕ್ರಿಯೋಲ್‌":"ht","ಹಿಂದಿ":"hi","ಹೀಬ್ರೂ":"he","അമാറിക്":"am","അർമേനിയൻ":"hy","അൽബേനിയൻ":"sq","അസർബൈജാനി":"az","അറബിക്":"ar","ഇന്തോനേഷ്യൻ":"id","ഇംഗ്ലീഷ്":"en","ഇറ്റാലിയൻ":"it","ഉക്രേനിയൻ":"uk","ഉസ്ബെക്ക്":"uz","എസ്‌പെരന്തോ":"eo","എസ്റ്റോണിയൻ":"et","ഐസ്‌ലാൻഡിക്":"is","ഐറിഷ്":"ga","കന്നട":"kn","കാറ്റലൻ":"ca","കുർദ്ദിഷ്":"ku","കൊറിയൻ":"ko","ക്രൊയേഷ്യൻ":"hr","ഗലീഷ്യൻ":"gl","ഗ്രീക്ക്":"el","ചെക്ക്":"cs","ചൈനീസ് (പരമ്പരാഗതം)":"zh-tw","ചൈനീസ് (ലഘൂകരിച്ചത്)":"zh-cn","ജർമ്മൻ":"de","ജാപ്പനീസ്‌":"ja","ടർക്കിഷ്":"tr","ഡച്ച്":"nl","ഡാനിഷ്":"da","തായ്":"th","തെലുങ്ക്":"te","നോർവീജിയൻ":"nb","പേർഷ്യൻ":"fa","പോർച്ചുഗീസ്":"pt","പോളിഷ്":"pl","ഫിന്നിഷ്":"fi","ഫ്രെഞ്ച്":"fr","ബർമീസ്":"my","ബൾഗേറിയൻ":"bg","ബാസ്ക്":"eu","ബെലാറുഷ്യൻ":"be","മംഗോളിയൻ":"mn","മലയാളം":"ml","മലയ്":"ms","മറാഠി":"mr","മാസഡോണിയൻ":"mk","മാൾട്ടീസ്":"mt","മൗറി":"mi","ലാറ്റിൻ":"la","ലാറ്റ്‌വിയൻ":"lv","ലിത്വേനിയൻ":"lt","വിയറ്റ്നാമീസ്":"vi","വെൽഷ്":"cy","സുളു":"zu","സെർബിയൻ":"sr","സ്കോട്ട്സ് ഗ്യാലിക്":"gd","സ്പാനിഷ്":"es","സ്ലോവാക്":"sk","സ്ലോവേനിയൻ":"sl","സ്വീഡിഷ്":"sv","ഹംഗേറിയൻ":"hu","ഹിന്ദി":"hi","ഹീബ്രു":"he","ഹെയ്തിയൻ ക്രയോൾ":"ht","റഷ്യൻ":"ru","റൊമേനിയൻ":"ro","albánčina":"sq","amharčina":"am","arabčina":"ar","arménčina":"hy","azerbajdžančina":"az","barmčina":"my","bieloruština":"be","bulharčina":"bg","čínština (tradičná)":"zh-tw","dánčina":"da","estónčina":"et","fínčina":"fi","francúzština":"fr","galícijčina":"gl","gréčtina":"el","haitská kreolčina":"ht","hebrejčina":"he","hindčina":"hi","holandčina":"nl","chorvátčina":"hr","indonézština":"id","írčina":"ga","islandčina":"is","japončina":"ja","kannadčina":"kn","katalánčina":"ca","kórejčina":"ko","kurdčina":"ku","latinčina":"la","litovčina":"lt","macedónčina":"mk","maďarčina":"hu","malajámčina":"ml","malajčina":"ms","maltčina":"mt","maorijčina":"mi","maratčina":"mr","mongolčina":"mn","nemčina":"de","nórčina":"nb","perzština":"fa","poľština":"pl","portugalčina":"pt","rumunčina":"ro","slovenčina":"sk","slovinčina":"sl","srbčina":"sr","škótska gaelčina":"gd","španielčina":"es","švédčina":"sv","taliančina":"it","telugčina":"te","thajčina":"th","ukrajinčina":"uk","vietnamčina":"vi","waleština":"cy","zuluština":"zu","isi-albania":"sq","isi-amharic":"am","isi-arabic":"ar","isi-armenian":"hy","isi-azerbaijani":"az","isi-basque":"eu","isi-belarusian":"be","isi-bulgarian":"bg","isi-burmese":"my","isi-catalan":"ca","isi-chinese (simplified)":"zh-cn","isi-chinese (traditional)":"zh-tw","isi-croatian":"hr","isi-czech":"cs","isi-danish":"da","isi-dutch":"nl","isi-english":"en","isi-esperanto":"eo","isi-estonian":"et","isi-finnish":"fi","isi-french":"fr","isi-galician":"gl","isi-german":"de","isi-greek":"el","isi-haitian creole":"ht","isi-hangarian":"hu","isi-hebrew":"he","isi-hindi":"hi","isi-icelandic":"is","isi-indonesian":"id","isi-irish":"ga","isi-italian":"it","isi-japanese":"ja","isi-kannada":"kn","isi-korean":"ko","isi-kurdish":"ku","isi-latin":"la","isi-latvian":"lv","isi-lithuanian":"lt","isi-macedonian":"mk","isi-malay":"ms","isi-malayalam":"ml","isi-maltese":"mt","isi-maori":"mi","isi-marathi":"mr","isi-mongolian":"mn","isi-norwegian":"nb","isi-persian":"fa","isi-polish":"pl","isi-portuguese":"pt","isi-romanian":"ro","isi-russian":"ru","isi-scots gaelic":"gd","isi-serbian":"sr","isi-slovak":"sk","isi-slovenian":"sl","isi-spanish":"es","isi-swedish":"sv","isi-telugu":"te","isi-thai":"th","isi-turkish":"tr","isi-ukrainian":"uk","isi-uzbek":"uz","isi-vietnamese":"vi","isi-welsh":"cy","isizulu":"zu","albania":"sq","armenia":"hy","azerbaijan":"az","belanda":"nl","belarus":"be","bulgaria":"bg","cina (mudah)":"zh-cn","cina (tradisional)":"zh-tw","croatia":"hr","denmark":"da","estonia":"et","finland":"fi","gaelic scotland":"gd","galicia":"gl","hungary":"hu","ibrani":"he","iceland":"is","indonesia":"id","inggeris":"en","ireland":"ga","itali":"it","jepun":"ja","jerman":"de","korea":"ko","kreol haiti":"ht","kurdistan":"ku","latvia":"lv","lithuania":"lt","macedonia":"mk","malta":"mt","melayu":"ms","mongolia":"mn","myanmar":"my","norway":"nb","parsi":"fa","perancis":"fr","poland":"pl","portugis":"pt","romania":"ro","rusia":"ru","sepanyol":"es","serbia":"sr","slovenia":"sl","sweden":"sv","turki":"tr","ukraine":"uk","vietnam":"vi","wales":"cy","азербайджанский":"az","албанский":"sq","амхарский":"am","английский":"en","арабский":"ar","армянский":"hy","баскский":"eu","белорусский":"be","бирманский":"my","болгарский":"bg","валлийский":"cy","венгерский":"hu","вьетнамский":"vi","галисийский":"gl","греческий":"el","датский":"da","иврит":"he","индонезийский":"id","ирландский":"ga","исландский":"is","испанский":"es","итальянский":"it","каталанский":"ca","китайский (традиционный)":"zh-tw","китайский (упрощенный)":"zh-cn","корейский":"ko","креольский (гаити)":"ht","курманджи":"ku","латинский":"la","латышский":"lv","литовский":"lt","македонский":"mk","малайский":"ms","мальтийский":"mt","маори":"mi","монгольский":"mn","немецкий":"de","нидерландский":"nl","норвежский":"nb","персидский":"fa","польский":"pl","португальский":"pt","румынский":"ro","русский":"ru","сербский":"sr","словацкий":"sk","словенский":"sl","тайский":"th","турецкий":"tr","узбекский":"uz","украинский":"uk","финский":"fi","французский":"fr","хинди":"hi","хорватский":"hr","чешский":"cs","шведский":"sv","шотландский (гэльский)":"gd","эсперанто":"eo","эстонский":"et","японский":"ja","albański":"sq","amharski":"am","angielski":"en","arabski":"ar","azerski":"az","baskijski":"eu","białoruski":"be","birmański":"my","bułgarski":"bg","chiński (tradycyjny)":"zh-tw","chiński (uproszczony)":"zh-cn","chorwacki":"hr","czeski":"cs","duński":"da","estoński":"et","fiński":"fi","francuski":"fr","galicyjski":"gl","grecki":"el","hebrajski":"he","hiszpański":"es","indonezyjski":"id","irlandzki":"ga","islandzki":"is","japoński":"ja","kataloński":"ca","koreański":"ko","kreolski (haiti)":"ht","kurdyjski":"ku","litewski":"lt","łaciński":"la","łotewski":"lv","macedoński":"mk","malajalam":"ml","malajski":"ms","maltański":"mt","mongolski":"mn","niderlandzki":"nl","niemiecki":"de","norweski":"nb","ormiański":"hy","perski":"fa","polski":"pl","portugalski":"pt","rosyjski":"ru","rumuński":"ro","serbski":"sr","słowacki":"sk","słoweński":"sl","szkocki gaelicki":"gd","szwedzki":"sv","tajski":"th","turecki":"tr","ukraiński":"uk","uzbecki":"uz","walijski":"cy","węgierski":"hu","wietnamski":"vi","włoski":"it","азербайджанская":"az","албанская":"sq","амхарская":"am","англійская":"en","арабская":"ar","армянская":"hy","балгарская":"bg","баскская":"eu","беларуская":"be","в\'етнамская":"vi","валійская":"cy","венгерская":"hu","гаіцянская крэольская":"ht","галандская":"nl","галісійская":"gl","грэчаская":"el","дацкая":"da","інданезійская":"id","ірландская":"ga","ісландская":"is","іспанская":"es","італьянская":"it","іўрыт":"he","карэйская":"ko","каталонская":"ca","кітайская (спрошчаная)":"zh-cn","кітайская (традыцыйная)":"zh-tw","курдская (курманджы)":"ku","латышская":"lv","лацінская":"la","літоўская":"lt","м\'янманская (бірманская)":"my","маары":"mi","македонская":"mk","малайская":"ms","мальтыйская":"mt","мангольская":"mn","нарвежская":"nb","нямецкая":"de","партугальская":"pt","персідская":"fa","польская":"pl","румынская":"ro","руская":"ru","сербская":"sr","славацкая":"sk","славенская":"sl","тайская":"th","турэцкая":"tr","тэлугу":"te","узбекская":"uz","украінская":"uk","фінская":"fi","французская":"fr","харвацкая":"hr","хіндзі":"hi","чэшская":"cs","шатландская гэльская":"gd","шведская":"sv","эсперанта":"eo","эстонская":"et","японская":"ja","amarikisht":"am","anglisht":"en","arabisht":"ar","armenisht":"hy","azerisht":"az","baskisht":"eu","birmanisht":"my","bjellorusisht":"be","bullgarisht":"bg","çekisht":"cs","danisht":"da","estonisht":"et","finlandisht":"fi","frëngjisht":"fr","galicianisht":"gl","galishte skoceze":"gd","greqisht":"el","gjermanisht":"de","hebraisht":"he","hindisht":"hi","holandisht":"nl","hungarisht":"hu","indonezisht":"id","irlandisht":"ga","islandisht":"is","italisht":"it","japonisht":"ja","kanada":"kn","katalonisht":"ca","kinezisht (e thjeshtuar)":"zh-cn","kinezisht (tradicionale)":"zh-tw","koreanisht":"ko","kreolishte haitiane":"ht","kroatisht":"hr","latinisht":"la","letonisht":"lv","lituanisht":"lt","malajalamisht":"ml","malajzisht":"ms","malteze":"mt","maorisht":"mi","maqedonisht":"mk","maratisht":"mr","mongolisht":"mn","norvegjisht":"nb","persisht":"fa","polonisht":"pl","portugalisht":"pt","rumanisht":"ro","rusisht":"ru","serbisht":"sr","sllovakisht":"sk","sllovenisht":"sl","spanjisht":"es","suedisht":"sv","shqip":"sq","tajlandisht":"th","telugisht":"te","turqisht":"tr","uellsisht":"cy","ukrainisht":"uk","uzbekisht":"uz","vietnamisht":"vi","ሀንጋሪኛ":"hu","ህንድኛ":"hi","ሊትዌንኛ":"lt","ላቲንኛ":"la","ላትቪያኛ":"lv","ማላያላምኛ":"ml","ማላይኛ":"ms","ማልቲስኛ":"mt","ማራቲኛ":"mr","ማዮሪኛ":"mi","ሜቄዶኒያኛ":"mk","ሞንጎሊያኛ":"mn","ራሽያኛ":"ru","ሮማኒያንኛ":"ro","ሰርቢያኛ":"sr","ስሎቫክኛ":"sk","ስሎቬንያኛ":"sl","ስዊድንኛ":"sv","ስፓኒሽኛ":"es","በርማኛ":"my","ቡልጋሪያኛ":"bg","ባስክኛ":"eu","ቤላሩስኛ":"be","ቪትናምኛ":"vi","ቱርክኛ":"tr","ታይኛ":"th","ቴሉጉኛ":"te","ቻይንኛ (ቀላሉ)":"zh-cn","ቻይንኛ (ባሕላዊው)":"zh-tw","ቼክኛ":"cs","ኖርዌጅያንኛ":"nb","አልባንያኛ":"sq","አማርኛ":"am","አርመኒያኛ":"hy","አዜርባይጃንኛ":"az","አይሪሽ":"ga","አይስላንድኛ":"is","ኡዝቤክኛ":"uz","ኤስቶኒያኛ":"et","ኤስፐራንቶ":"eo","እንዶኔዢያኛ":"id","እንግሊዝኛ":"en","ኩርድሽኛ":"ku","ካታላንኛ":"ca","ካናዳኛ":"kn","ክሮኤሽያኛ":"hr","ኮሪያኛ":"ko","ዌልሽ":"cy","ዐረብኛ":"ar","ዕብራይስጥ":"he","ዙሉኛ":"zu","የሃይቲ ክረኦሌኛ":"ht","የስኮት ጌልክኛ":"gd","ዩክሬንኛ":"uk","ደችኛ":"nl","ዴንሽኛ":"da","ጀርመንኛ":"de","ጃፓንኛ":"ja","ጋሊሺያኛ":"gl","ግሪክኛ":"el","ጣሊያንኛ":"it","ፈረንሳይኛ":"fr","ፊኒሽኛ":"fi","ፐርሺያኛ":"fa","ፖሊሽኛ":"pl","ፖርቱጋሊኛ":"pt","alban":"sq","alman":"de","amarikcə":"am","azərbaycan dili":"az","bask":"eu","belarusca":"be","bolqar":"bg","çex":"cs","çin (ən\'ənəvi)":"zh-tw","çin (sadələşdirilmiş)":"zh-cn","danimarka":"da","erməni":"hy","eston":"et","ərəb":"ar","fars dili":"fa","fin":"fi","fransız":"fr","haiti kreol dili":"ht","hind":"hi","xorvat":"hr","ispan":"es","i̇ndoneziya":"id","i̇ngilis":"en","i̇rland":"ga","i̇sland":"is","i̇sveç":"sv","i̇talyan":"it","i̇vrit":"he","katalan":"ca","koreya":"ko","kürd dili (kurmanci)":"ku","qalisian":"gl","latın":"la","latış":"lv","litva":"lt","macar":"hu","makedoniya":"mk","maoricə":"mi","monqolca":"mn","myanma (birma) dili":"my","norveç":"nb","özbək":"uz","polyak":"pl","portuqal":"pt","rumın":"ro","rus":"ru","serb":"sr","sloven":"sl","şotland (kelt)":"gd","tayca":"th","teluqu":"te","türk":"tr","uels":"cy","ukrayna":"uk","vyetnam":"vi","yapon":"ja","yunan":"el","zulu dili":"zu","albaniż":"sq","amħari":"am","armen":"hy","ażerbajġani":"az","belarussu":"be","bulgaru":"bg","ċek":"cs","ċiniż (semplifikat)":"zh-cn","ċiniż (tradizzjonali)":"zh-tw","creole haiti":"ht","daniż":"da","ebrajk":"he","estonjan":"et","finlandiż":"fi","franċiż":"fr","ġappuniż":"ja","ġermaniż":"de","gaelic tal-iskoċċiżi":"gd","galizjan":"gl","grieg":"el","għarbi":"ar","ħindi":"hi","indoneżjan":"id","ingliż":"en","irlandiż":"ga","islandiż":"is","kroat":"hr","kurd (kurmanji)":"ku","latvjan":"lv","litwen":"lt","maċedonjan":"mk","malasjan":"ms","malti":"mt","marati":"mr","mjanmar (burma)":"my","mongoljan":"mn","norveġiż":"nb","olandiż":"nl","persjan":"fa","pollakk":"pl","portugiż":"pt","rumen":"ro","russu":"ru","slovakk":"sk","spanjol":"es","svediż":"sv","tajlandiż":"th","taljan":"it","tork":"tr","ukren":"uk","ungeriż":"hu","użbek":"uz","vjetnamiż":"vi","żulu":"zu","albanski":"sq","amharik":"am","arapski":"ar","armenijski":"hy","azerbajdžanski":"az","bjeloruski":"be","bugarski":"bg","burmanski":"my","češki":"cs","danski":"da","engleski":"en","estonski":"et","finski":"fi","galski":"gl","grčki":"el","haićansko-kreolski":"ht","hebrejski":"he","hindu":"hi","hrvatski":"hr","indonezijski":"id","irski":"ga","islandski":"is","japanski":"ja","katalonski":"ca","kineski (pojednost.)":"zh-cn","kineski (tradicionalni)":"zh-tw","korejski":"ko","kurdski":"ku","latinski":"la","latvijski/letonski":"lv","litvanski":"lt","mađarski":"hu","makedonski":"mk","malezijski":"ms","malteški":"mt","nizozemski":"nl","norveški":"nb","njemački":"de","perzijski":"fa","poljski":"pl","rumunjski":"ro","ruski":"ru","slovački":"sk","slovenski":"sl","srpski":"sr","škotski keltski":"gd","španjolski":"es","švedski":"sv","tajlandski":"th","talijanski":"it","turski":"tr","ukrajinski":"uk","uzbekistanski":"uz","velški":"cy","vijetnamski":"vi","آذرباﻳﺠﺎﻧﻰ":"az","آلبانیایی":"sq","آلمانی":"de","ارمنی":"hy","ازبکی":"uz","اسپانیایی":"es","اسپرانتو":"eo","استونيايی":"et","اسلواکی":"sk","اسلونیایی":"sl","اکراينی":"uk","امهری":"am","اندونزيايی":"id","انگلیسی":"en","ایتالیایی":"it","ایرلندی":"ga","ايسلندی":"is","باسکی":"eu","برمه‌ای":"my","بلاروسی":"be","بلغاری":"bg","پرتغالی":"pt","تايلندی":"th","ترکی استانبولی":"tr","تلوگو":"te","چک":"cs","چینی (ساده‌شده)":"zh-cn","چینی (سنتی)":"zh-tw","دانمارکی":"da","روسی":"ru","رومانيايی":"ro","زولو":"zu","ژاپنی":"ja","سوئدی":"sv","صربی":"sr","عبری":"he","عربی":"ar","فارسی":"fa","فرانسوی":"fr","فنلاندی":"fi","کاتالان":"ca","کانارا":"kn","کرئول هائیتی":"ht","کردی":"ku","کرواتی":"hr","کره‌ای":"ko","گالیسی":"gl","گاليک اسکاتلندی":"gd","لاتين":"la","لتونيايی":"lv","لهستانی":"pl","ليتوانيايی":"lt","مائوری":"mi","مالایالمی":"ml","مالايی":"ms","مالتی":"mt","مجاری":"hu","مراتی":"mr","مغولی":"mn","مقدونيه‌ای":"mk","نروژی":"nb","ولزی":"cy","ويتنامی":"vi","هلندی":"nl","هندی":"hi","يونانی":"el","ahepaitani":"az","airihi":"ga","amariki":"am","amēniana":"hy","arapeinia":"sq","arapi":"ar","eperānato":"eo","etōnia":"et","haina (onamata)":"zh-tw","hainamana (kua whakamāmātia)":"zh-cn","hanekeria":"hu","hapanihi":"ja","herepia":"sr","hinerangi":"fi","hīni":"hi","hiperu":"he","horowākia":"sk","horowinia":"sl","huitene":"sv","huru":"zu","ingarihi":"en","initonīhia":"id","itāriana":"it","kanata":"kn","karihia":"gl","katarāna":"ca","kereore haiti":"ht","kiriki":"el","kōreana":"ko","koroātiana":"hr","korukoru":"tr","kūrihi":"ku","makerōnia":"mk","māratihi":"mt","marei":"ms","mareiarama":"ml","mongōriana":"mn","nōwei":"nb","pākihi":"eu","pāniora":"es","pēma (purumīhi)":"my","peraruhia":"be","perēhia":"fa","pōrana":"pl","potukīhi":"pt","purukāriana":"bg","rātini":"la","rāwhiana":"lv","rituānia":"lt","romānia":"ro","rūhia":"ru","tai":"th","tati":"nl","tenemāka":"da","teruku":"te","tiamana":"de","tieke":"cs","tiorangi":"is","tuauri kotarangi":"gd","uhipeke":"uz","ūkareiana":"uk","wēra":"cy","whitināmu":"vi","wīwī":"fr","αγγλικά":"en","αζερμπαϊτζανικά":"az","αλβανικά":"sq","αμχαρικά":"am","αραβικά":"ar","αρμενικά":"hy","βασκικά":"eu","βιετναμεζικά":"vi","βιρμανικά":"my","βουλγαρικά":"bg","γαελικά σκοτίας":"gd","γαλικιακά":"gl","γαλλικά":"fr","γερμανικά":"de","δανικά":"da","εβραϊκά":"he","ελληνικά":"el","εσθονικά":"et","εσπεράντο":"eo","ζουλού":"zu","ιαπωνικά":"ja","ινδονησιακά":"id","ιρλανδικά":"ga","ισλανδικά":"is","ισπανικά":"es","ιταλικά":"it","κανάντα":"kn","καταλανικά":"ca","κινέζικα (απλοποιημένα)":"zh-cn","κινέζικα (παραδοσιακά)":"zh-tw","κορεατικά":"ko","κουρδικά":"ku","κρεόλ αϊτής":"ht","κροατικά":"hr","λατινικά":"la","λετονικά":"lv","λευκορωσικά":"be","λιθουανικά":"lt","μαλαγιάλαμ":"ml","μαλέι":"ms","μαλτεζικά":"mt","μαορί":"mi","μαραθικά":"mr","μογγολικά":"mn","νορβηγικά":"nb","ολλανδικά":"nl","ουαλικά":"cy","ουγγρικά":"hu","ουζμπεκικά":"uz","ουκρανικά":"uk","περσικά":"fa","πολωνικά":"pl","πορτογαλικά":"pt","ρουμανικά":"ro","ρωσικά":"ru","σερβικά":"sr","σλαβομακεδονικά":"mk","σλοβακικά":"sk","σλοβενικά":"sl","σουηδικά":"sv","ταϊλανδεζικά":"th","τελούγκου":"te","τούρκικα":"tr","τσεχικά":"cs","φινλανδικά":"fi","χίντι":"hi","amxar":"am","arman":"hy","bolgar":"bg","dat":"da","fors":"fa","fransuz":"fr","gaiti-kreol":"ht","galisiy":"gl","golland":"nl","grek":"el","ibroniy":"he","indonez":"id","ingliz":"en","irland":"ga","island":"is","italyan":"it","koreys":"ko","kurd (kurmonji)":"ku","latish":"lv","lotin":"la","makedon":"mk","maltiy":"mt","maratxi":"mr","mo‘g‘ul":"mn","nemis":"de","norveg":"nb","ozarbayjon":"az","portugal":"pt","rumin":"ro","tay":"th","turk":"tr","ukrain":"uk","valliy":"cy","venger":"hu","xitoy (an’anaviy)":"zh-tw","xitoy (soddalashgan)":"zh-cn","o‘zbek":"uz","shotland-gel":"gd","shved":"sv","chex":"cs","albanska":"sq","amharísku":"am","arabíska":"ar","armenska":"hy","aserska":"az","baskneska":"eu","búlgarska":"bg","búrmíska":"my","danska":"da","eistneska":"et","enska":"en","esperantó":"eo","finnska":"fi","franska":"fr","galisíska":"gl","gríska":"el","haítískt kreólamál":"ht","hebreska":"he","hindí":"hi","hollenska":"nl","hvítrússneska":"be","indónesíska":"id","írska":"ga","íslenska":"is","ítalska":"it","japanska":"ja","katalónska":"ca","kínverska (einfölduð)":"zh-cn","kínverska (hefðbundin)":"zh-tw","kóreska":"ko","króatíska":"hr","kúrdíska":"ku","latína":"la","lettneska":"lv","litháíska":"lt","makedónska":"mk","malajíska":"ms","maltneska":"mt","maoríska":"mi","maratí":"mr","mongólska":"mn","norska":"nb","persneska":"fa","portúgalska":"pt","pólska":"pl","rúmenska":"ro","rússneska":"ru","serbneska":"sr","skosk-gelíska":"gd","slóvakíska":"sk","slóvenska":"sl","spænska":"es","súlú":"zu","sænska":"sv","taílenska":"th","tékkneska":"cs","tyrkneska":"tr","ungverska":"hu","úkraínska":"uk","úsbekíska":"uz","velska":"cy","víetnamska":"vi","þýska":"de","ադրբեջաներեն":"az","ալբաներեն":"sq","ամհարերեն":"am","անգլերեն":"en","արաբերեն":"ar","բասկերեն":"eu","բելառուսերեն":"be","բիրմաներեն":"my","բուլղարերեն":"bg","գալիսերեն":"gl","գերմաներեն":"de","դանիերեն":"da","եբրայերեն":"he","զուլուսերեն":"zu","էսպերանտո":"eo","էստոներեն":"et","թայերեն":"th","թուրքերեն":"tr","ինդոնեզերեն":"id","իռլանդերեն":"ga","իսլանդերեն":"is","իսպաներեն":"es","իտալերեն":"it","լատիներեն":"la","լատվիերեն":"lv","լեհերեն":"pl","լիտվերեն":"lt","խորվաթերեն":"hr","կաննադա":"kn","կատալաներեն":"ca","կելտական շոտլանդերեն":"gd","կորեերեն":"ko","կրեոլերեն (հայիթի)":"ht","հայերեն":"hy","հինդի":"hi","հոլանդերեն":"nl","հունարեն":"el","հունգարերեն":"hu","ճապոներեն":"ja","մալայալամ":"ml","մալայերեն":"ms","մալթերեն":"mt","մակեդոներեն":"mk","մաորի":"mi","մարաթի":"mr","մոնղոլերեն":"mn","նորվեգերեն":"nb","շվեդերեն":"sv","ուզբեկերեն":"uz","ուկրաիներեն":"uk","չեխերեն":"cs","չինարեն (ավանդական)":"zh-tw","չինարեն (պարզեցված)":"zh-cn","պարսկերեն":"fa","պորտուգալերեն":"pt","ռումիներեն":"ro","ռուսերեն":"ru","սերբերեն":"sr","սլովակերեն":"sk","սլովեներեն":"sl","վալերեն":"cy","վիետնամերեն":"vi","տելուգու":"te","քրդերեն (քուրմանջի)":"ku","ֆիններեն":"fi","ֆրանսերեն":"fr","arabia":"ar","baski":"eu","burma":"my","englanti":"en","espanja":"es","haitinkreoli":"ht","heprea":"he","hollanti":"nl","iiri":"ga","islanti":"is","italia":"it","japani":"ja","katalaani":"ca","kiina (perinteinen)":"zh-tw","kiina (yksinkert.)":"zh-cn","kreikka":"el","kroatia":"hr","kurdi":"ku","kymri":"cy","liettua":"lt","makedonia":"mk","malaiji":"ms","norja":"nb","persia":"fa","portugali":"pt","puola":"pl","ranska":"fr","ruotsi":"sv","saksa":"de","skottigaeli":"gd","slovakia":"sk","suomi":"fi","tanska":"da","tsekki":"cs","turkki":"tr","ukraina":"uk","unkari":"hu","uzbekki":"uz","valkovenäjä":"be","venäjä":"ru","viro":"et","albaniera":"sq","alemana":"de","amharera":"am","arabiera":"ar","armeniera":"hy","azerbaijanera":"az","bielorrusiera":"be","birmaniera":"my","bulgariera":"bg","daniera":"da","errumaniera":"ro","errusiera":"ru","eskoziako gaelera":"gd","eslovakiera":"sk","esloveniera":"sl","esperantoa":"eo","estoniera":"et","euskara":"eu","frantsesa":"fr","gaelera":"cy","galiziera":"gl","gaztelania":"es","greziera":"el","hebreera":"he","hindia":"hi","hungariera":"hu","indonesiera":"id","ingelesa":"en","irlandera":"ga","islandiera":"is","italiera":"it","japoniera":"ja","katalana":"ca","koreera":"ko","kreolera (haiti)":"ht","kroaziera":"hr","kurduera":"ku","letoniera":"lv","lituaniera":"lt","malabarera":"ml","malaysiera":"ms","maltera":"mt","maoriera":"mi","marathera":"mr","mazedoniera":"mk","mongoliera":"mn","nederlandera":"nl","norvegiera":"nb","persiera":"fa","poloniera":"pl","portugesa":"pt","serbiera":"sr","suediera":"sv","suomiera":"fi","telugua":"te","thaiera":"th","turkiera":"tr","txekiera":"cs","txinera (soildua)":"zh-cn","txinera (tradizionala)":"zh-tw","ukrainera":"uk","uzbekera":"uz","vietnamera":"vi","zuluera":"zu","albanès":"sq","alemany":"de","amhàric":"am","anglès":"en","àrab":"ar","armeni":"hy","àzeri":"az","basc":"eu","bielorús":"be","birmà":"my","búlgar":"bg","castellà":"es","català":"ca","coreà":"ko","crioll d\'haití":"ht","croat":"hr","danès":"da","eslovac":"sk","eslovè":"sl","estonià":"et","finès":"fi","francès":"fr","gaèlic escocès":"gd","gallec":"gl","gal·lès":"cy","hebreu":"he","hongarès":"hu","indonesi":"id","irlandès":"ga","islandès":"is","italià":"it","japonès":"ja","letó":"lv","lituà":"lt","llatí":"la","macedònic":"mk","malai":"ms","malaiàlam":"ml","maltès":"mt","neerlandès":"nl","noruec":"nb","polonès":"pl","portuguès":"pt","romanès":"ro","serbi":"sr","suec":"sv","txec":"cs","ucraïnès":"uk","xinès (simplificat)":"zh-cn","xinès (tradicional)":"zh-tw","albāņu":"sq","amharu":"am","angļu":"en","arābu":"ar","armēņu":"hy","azerbaidžāņu":"az","baltkrievu":"be","basku":"eu","birmiešu":"my","bulgāru":"bg","čehu":"cs","dāņu":"da","ebreju (ivrits)":"he","franču":"fr","galisiešu":"gl","grieķu":"el","holandiešu":"nl","horvātu":"hr","igauņu":"et","indonēziešu":"id","īru":"ga","īslandiešu":"is","itāļu":"it","japāņu":"ja","katalāņu":"ca","korejiešu":"ko","kreolu (haiti)":"ht","krievu":"ru","kurdu":"ku","ķīniešu (tradicionālā)":"zh-tw","ķīniešu (vienkāršotā)":"zh-cn","latīņu":"la","latviešu":"lv","lietuviešu":"lt","maķedoniešu":"mk","malajalamiešu":"ml","malajiešu":"ms","maltiešu":"mt","maratu":"mr","mongoļu":"mn","norvēģu":"nb","persiešu":"fa","poļu":"pl","portugāļu":"pt","rumāņu":"ro","serbu":"sr","skotu gēlu":"gd","slovāku":"sk","slovēņu":"sl","somu":"fi","spāņu":"es","taju":"th","turku":"tr","ukraiņu":"uk","ungāru":"hu","uzbeku":"uz","vācu":"de","velsiešu":"cy","vjetnamiešu":"vi","zviedru":"sv","belarussia":"be","cek":"cs","china (aks. sederhana)":"zh-cn","china (aks. tradisional)":"zh-tw","finlandia":"fi","gaelig":"ga","gaelik skotlandia":"gd","galisia":"gl","inggris":"en","islan":"is","jepang":"ja","katala":"ca","lituania":"lt","polandia":"pl","prancis":"fr","rumania":"ro","swensk":"sv","yunani":"el","అజర్‌బైజాని":"az","అర్మేనియన్":"hy","అల్బేనియన్":"sq","ఆంగ్లము":"en","ఆమ్హారిక్":"am","ఆరబిక్":"ar","ఇండొనేసియన్":"id","ఇటాలియన్":"it","ఉజ్బెక్":"uz","ఎస్పెరాంటో":"eo","ఏస్టోనియన్":"et","ఐరిష్":"ga","ఐస్ లాండిక్":"is","కన్నడ":"kn","కర్డిష్":"ku","కొరియన్":"ko","క్యాటలాన్":"ca","క్రొయేషియన్":"hr","గాలిసియన్":"gl","గ్రీక్":"el","చెక్":"cs","చైనీస్ (సరళమైన)":"zh-cn","చైనీస్ (సామ్ప్రదాయమైన)":"zh-tw","జపనీస్":"ja","జర్మన్":"de","జులు":"zu","టర్కిష్":"tr","డచ్":"nl","డానిష్":"da","తెలుగు":"te","థాయ్":"th","నార్విజియన్":"nb","పర్షియన్":"fa","పోర్చుగీస్":"pt","పోలిష్":"pl","ఫిన్నిష్":"fi","ఫ్రెంచ్":"fr","బర్మీస్":"my","బల్గేరియన్":"bg","బాస్క్":"eu","బెలారుషియన్":"be","మంగోలియన్":"mn","మయోరి":"mi","మరాఠీ":"mr","మలయాళం":"ml","మాలై":"ms","మాల్టీస్":"mt","మాసిడోనియన్":"mk","యుక్రేనియన్":"uk","రష్యన్":"ru","రొమేనియన్":"ro","లాటిన్":"la","లాట్వియన్":"lv","లిథువేనియన్":"lt","వియత్నామీస్":"vi","వెల్ష్":"cy","సెర్బియన్":"sr","స్కాట్స్ గేలిక్":"gd","స్పానిష్":"es","స్లోవక్":"sk","స్లోవేనియన్":"sl","స్వీడిష్":"sv","హంగేరియన్":"hu","హిందీ":"hi","హీబ్రూ":"he","హైయేటియన్ క్రియోల్":"ht","amhárico":"am","azerí":"az","chino (simplificado)":"zh-cn","chino (tradicional)":"zh-tw","criollo haitiano":"ht","danés":"da","estonio":"et","euskera":"eu","finlandés":"fi","gallego":"gl","griego":"el","japonés":"ja","kurdo":"ku","malayo":"ms","noruego":"nb","rumano":"ro","uzbeco":"uz","albaania":"sq","amhaari":"am","araabia":"ar","armeenia":"hy","aserbaidžaani":"az","birma":"my","bulgaaria":"bg","eesti":"et","galeegi":"gl","haitikreooli":"ht","heebrea":"he","hispaania":"es","hollandi":"nl","horvaadi":"hr","indoneesia":"id","inglise":"en","islandi":"is","itaalia":"it","jaapani":"ja","kreeka":"el","ladina":"la","leedu":"lt","lihtsustatud hiina":"zh-cn","läti":"lv","makedoonia":"mk","malajalaami":"ml","maoori":"mi","mongoli":"mn","norra":"nb","poola":"pl","prantsuse":"fr","pärsia":"fa","rootsi":"sv","rumeenia":"ro","slovaki":"sk","sloveeni":"sl","soome":"fi","suulu":"zu","šoti":"gd","taani":"da","traditsiooniline hiina":"zh-tw","tšehhi":"cs","türgi":"tr","uelsi":"cy","ungari":"hu","usbeki":"uz","valgevene":"be","vene":"ru","albanyen":"sq","amenyen":"hy","anglè":"en","azèbajani":"az","belarisyen":"be","bilgaryen":"bg","chinwa (senp)":"zh-cn","chinwa (tradisyonèl)":"zh-tw","danwa":"da","ebre":"he","endonezyen":"id","endou":"hi","estonyen":"et","fenlandè":"fi","franse":"fr","gaelik ekosè":"gd","galisyen":"gl","grèk":"el","ikrenyen":"uk","ilandè":"ga","islandè":"is","italyen":"it","izbèk":"uz","japonè":"ja","koreyen":"ko","kreyòl ayisyen":"ht","kurde (kurmandji)":"ku","kwoasyen":"hr","laten":"la","letonyen":"lv","lityanyen":"lt","malè":"ms","malt":"mt","masedonyen":"mk","mongolyen":"mn","myanma (burmese)":"my","nòvejyen":"nb","olandè, neyèlandè":"nl","onngaryen":"hu","panyòl":"es","pèsyen":"fa","polonè":"pl","pòtigè":"pt","ris":"ru","romanyen":"ro","sèb":"sr","slovenyen":"sl","syedwa":"sv","tuk":"tr","tyèk":"cs","vyetnamyen":"vi","albaneg":"sq","almaeneg":"de","arabeg":"ar","armeneg":"hy","aserbaijaneg":"az","basgeg":"eu","belarwseg":"be","bwlgaraidd":"bg","catalaneg":"ca","creol haiti":"ht","croateg":"hr","cymraeg":"cy","cyrdeg (kurmandji)":"ku","daneg":"da","eidaleg":"it","estoneg":"et","fietnameg":"vi","ffineg":"fi","fflemeg":"nl","ffrangeg":"fr","gaeleg yr alban":"gd","galisaidd":"gl","groeg":"el","gwyddeleg":"ga","hebraeg":"he","hwngareg":"hu","iaith corea":"ko","indonesieg":"id","islandeg":"is","iwcraineg":"uk","japaneg":"ja","latfieg":"lv","lithwaneg":"lt","lladin":"la","macedoneg":"mk","malteseg":"mt","mongoleg":"mn","myanmar (byrma)":"my","norwyeg":"nb","perseg":"fa","portiwgaleg":"pt","pwyleg":"pl","rwmaneg":"ro","rwsieg":"ru","saesneg":"en","sbaeneg":"es","serbeg":"sr","slofac":"sk","slofenia":"sl","swedeg":"sv","swlw":"zu","tsieceg":"cs","tsieineeg (traddodiadol)":"zh-tw","tsieineeg (wedi symleiddio)":"zh-cn","twrceg":"tr","usbec":"uz","अंग्रेज़ी":"en","अज़रबैजानी":"az","अल्बेनियन":"sq","आइसलैंडिक":"is","आर्मेनियन":"hy","इटैलियन":"it","उज़्बेक":"uz","एस्तोनियन":"et","एस्पेरांटो":"eo","ऐम्हेरिक":"am","कन्नड़":"kn","कुर्दिश (करमंजी)":"ku","कैटेलन":"ca","गैलिशियन":"gl","चीनी (परंपरागत)":"zh-tw","चेक":"cs","जापानी":"ja","ज़ुलु":"zu","डैनिश":"da","तुर्क":"tr","तेलुगु":"te","पुर्तगाली":"pt","फ़िनिश":"fi","फ़्रेंच":"fr","बर्मी":"my","बुल्गारियन":"bg","बेलारूसीयन":"be","बैस्क":"eu","मलयालम":"ml","माऔरी":"mi","माल्टी":"mt","मेसीडोनियन":"mk","यूक्रेनियन":"uk","रूसी":"ru","रोमेनियन":"ro","लातवियन":"lv","लैटिन":"la","वियतनामी":"vi","सर्बियाई":"sr","स्पैनिश":"es","स्लोवाक":"sk","स्लोवेनियन":"sl","हंगरियन":"hu","हीब्रू":"he","हैतियन क्रिओल":"ht","阿尔巴尼亚语":"sq","阿拉伯语":"ar","阿姆哈拉语":"am","阿塞拜疆语":"az","爱尔兰语":"ga","爱沙尼亚语":"et","巴斯克语":"eu","白俄罗斯语":"be","保加利亚语":"bg","冰岛语":"is","波兰语":"pl","波斯语":"fa","丹麦语":"da","德语":"de","俄语":"ru","法语":"fr","芬兰语":"fi","海地克里奥尔语":"ht","韩语":"ko","荷兰语":"nl","加利西亚语":"gl","加泰罗尼亚语":"ca","捷克语":"cs","卡纳达语":"kn","克罗地亚语":"hr","库尔德语":"ku","拉丁语":"la","拉脱维亚语":"lv","立陶宛语":"lt","罗马尼亚语":"ro","马耳他语":"mt","马拉地语":"mr","马拉雅拉姆语":"ml","马来语":"ms","马其顿语":"mk","毛利语":"mi","蒙古语":"mn","缅甸语":"my","南非祖鲁语":"zu","挪威语":"nb","葡萄牙语":"pt","日语":"ja","瑞典语":"sv","塞尔维亚语":"sr","世界语":"eo","斯洛伐克语":"sk","斯洛文尼亚语":"sl","苏格兰盖尔语":"gd","泰卢固语":"te","泰语":"th","土耳其语":"tr","威尔士语":"cy","乌克兰语":"uk","乌兹别克语":"uz","西班牙语":"es","希伯来语":"he","希腊语":"el","匈牙利语":"hu","亚美尼亚语":"hy","意大利语":"it","印地语":"hi","印尼语":"id","英语":"en","越南语":"vi","中文(繁体)":"zh-tw","中文(简体)":"zh-cn","азербайджански":"az","английски":"en","арабски":"ar","арменски":"hy","баски":"eu","беларуски":"be","бирмански":"my","български":"bg","галисийски":"gl","гръцки":"el","датски":"da","индонезийски":"id","ирландски":"ga","испански":"es","италиански":"it","китайски (опростен)":"zh-cn","китайски (традиционен)":"zh-tw","корейски":"ko","кюрдски":"ku","латвийски":"lv","литовски":"lt","малайски":"ms","малтийски":"mt","немски":"de","нидерландски":"nl","норвежки":"nb","персийски":"fa","румънски":"ro","словашки":"sk","словенски":"sl","сръбски":"sr","тайландски":"th","уелски":"cy","узбекски":"uz","финландски":"fi","френски":"fr","хаитянски креолски":"ht","хърватски":"hr","шотландски келтски":"gd","японски":"ja","الآيسلندية":"is","الأذرية":"az","الارمنية":"hy","الإسبانية":"es","الاسبرانتو":"eo","الإستونية":"et","الاسكتلندية الغالية":"gd","الألبانية":"sq","الألمانية":"de","الأمهرية":"am","الإنجليزية":"en","الإندونيسية":"id","الأوزبكية":"uz","الأوكرانية":"uk","الأيرلندية":"ga","الإيطالية":"it","الباسكية":"eu","البرتغالية":"pt","البلغارية":"bg","البورمية":"my","البولندية":"pl","البيلاروسية":"be","التايلاندية":"th","التركية":"tr","التشيكية":"cs","التيلوجو":"te","الجاليكية":"gl","الدانماركية":"da","الروسية":"ru","الرومانية":"ro","الزولوية":"zu","السلوفاكية":"sk","السلوفينية":"sl","السويدية":"sv","الصربية":"sr","الصينية (التقليدية)":"zh-tw","الصينية (المبسطة)":"zh-cn","العبرية":"he","العربية":"ar","الفارسية":"fa","الفرنسية":"fr","الفنلندية":"fi","الفيتنامية":"vi","القطلونية":"ca","الكانادا":"kn","الكردية":"ku","الكرواتية":"hr","الكورية":"ko","اللاتفية":"lv","اللاتينية":"la","اللغة الكريولية الهايتية":"ht","الليتوانية":"lt","المالايالامية":"ml","المالطيّة":"mt","الماورية":"mi","المقدونية":"mk","الملايو":"ms","المنغولية":"mn","المهراتية":"mr","النرويجية":"nb","الهندية":"hi","الهنغارية":"hu","الهولندية":"nl","الويلزية":"cy","اليابانية":"ja","اليونانية":"el","баскијски":"eu","вијетнамски":"vi","галски":"gl","енглески":"en","индонежански":"id","јапански":"ja","јерменски":"hy","кинески (поједностављени)":"zh-cn","кинески (традиционални)":"zh-tw","креолски (хаити)":"ht","летонски":"lv","мађарски":"hu","марати":"mr","немачки":"de","персијски":"fa","пољски":"pl","румунски":"ro","словеначки":"sl","тајски":"th","украјински":"uk","азербайжан":"az","албани":"sq","амхарик":"am","англи":"en","араб":"ar","армени":"hy","баск":"eu","беларусь":"be","бирм":"my","болгар":"bg","вьетнам":"vi","гаити креол":"ht","галик":"gl","гаэл":"gd","герман":"de","голланд":"nl","грек":"el","дани":"da","индонези":"id","ирланд":"ga","исланд":"is","испани":"es","итали":"it","каталан":"ca","кипр":"he","курд":"ku","латви":"lv","латин":"la","литва":"lt","македон":"mk","малай":"ms","малайлам":"ml","малти":"mt","монгол":"mn","норвеги":"nb","орос":"ru","перс":"fa","польш":"pl","португаль":"pt","румын":"ro","серби":"sr","словак":"sk","словени":"sl","солонгос":"ko","тай":"th","турк":"tr","тэлүгү":"te","узбек":"uz","украин":"uk","унгар":"hu","уэльс":"cy","финлянд":"fi","франц":"fr","хорват":"hr","хятад (ердийн)":"zh-cn","хятад (уламжлалт)":"zh-tw","чех":"cs","швед":"sv","эстони":"et","япон":"ja","amhariska":"am","arabiska":"ar","armeniska":"hy","azerbajdzjanska":"az","baskiska":"eu","bulgariska":"bg","burmesiska":"my","engelska":"en","estniska":"et","finska":"fi","gaeliska":"gd","galiciska":"gl","grekiska":"el","haitiska":"ht","hebreiska":"he","indonesiska":"id","irländska":"ga","isländska":"is","italienska":"it","kanaresiska":"kn","katalanska":"ca","kinesiska (förenklad)":"zh-cn","kinesiska (traditionell)":"zh-tw","koreanska":"ko","kroatiska":"hr","kurdiska":"ku","lettiska":"lv","litauiska":"lt","makedonska":"mk","malaysiska":"ms","maltesiska":"mt","mongoliska":"mn","nederländska":"nl","persiska":"fa","polska":"pl","portugisiska":"pt","rumänska":"ro","ryska":"ru","serbiska":"sr","slovakiska":"sk","slovenska":"sl","spanska":"es","svenska":"sv","thailändska":"th","tjeckiska":"cs","turkiska":"tr","tyska":"de","ukrainska":"uk","ungerska":"hu","uzbekiska":"uz","vietnamesiska":"vi","vitryska":"be","walesiska":"cy","albaneză":"sq","amharică":"am","arabă":"ar","armeană":"hy","azerbaidjană":"az","bască":"eu","bielorusă":"be","birmană":"my","bulgară":"bg","catalană":"ca","cehă":"cs","chineză (simplificată)":"zh-cn","chineză (tradițională)":"zh-tw","coreeană":"ko","creolă haitiană":"ht","croată":"hr","daneză":"da","ebraică":"he","engleză":"en","estonă":"et","finlandeză":"fi","franceză":"fr","galeză":"cy","galica scoțiană":"gd","galiciană":"gl","germană":"de","greacă":"el","indoneziană":"id","irlandeză":"ga","islandeză":"is","italiană":"it","japoneză":"ja","kurdă":"ku","latină":"la","letonă":"lv","lituaniană":"lt","macedoneană":"mk","maghiară":"hu","malaeză":"ms","malteză":"mt","mongolă":"mn","neerlandeză":"nl","norvegiană":"nb","persană":"fa","poloneză":"pl","portugheză":"pt","română":"ro","rusă":"ru","sârbă":"sr","slovacă":"sk","slovenă":"sl","spaniolă":"es","suedeză":"sv","thailandeză":"th","turcă":"tr","ucraineană":"uk","uzbecă":"uz","vietnameză":"vi","airių":"ga","albanų":"sq","amharų":"am","anglų":"en","arabų":"ar","armėnų":"hy","azerbaidžaniečių":"az","baltarusių":"be","baskų":"eu","birmiečių":"my","bulgarų":"bg","čekų":"cs","danų":"da","estų":"et","galisų":"gl","graikų":"el","haičio kreolų":"ht","hebrajų":"he","indoneziečių":"id","islandų":"is","ispanų":"es","italų":"it","japonų":"ja","kanadų":"kn","kataloniečių":"ca","kinų (supaprastinta)":"zh-cn","kinų (tradicinė)":"zh-tw","korėjiečių":"ko","kroatų":"hr","kurdų":"ku","latvių":"lv","lenkų":"pl","lietuvių":"lt","lotynų":"la","makedoniečių":"mk","malajalių":"ml","malajiečių":"ms","maltiečių":"mt","maorių":"mi","maratų":"mr","mongolų":"mn","norvegų":"nb","olandų":"nl","persų":"fa","portugalų":"pt","prancūzų":"fr","rumunų":"ro","rusų":"ru","serbų":"sr","slovakų":"sk","slovėnų":"sl","suomių":"fi","škotų (gėlų)":"gd","švedų":"sv","tajų":"th","telugų":"te","turkų":"tr","ukrainiečių":"uk","uzbekų":"uz","valų":"cy","vengrų":"hu","vietnamiečių":"vi","vokiečių":"de","zulusų":"zu","갈리시아어":"gl","그리스어":"el","네덜란드어":"nl","노르웨이어":"nb","덴마크어":"da","독일어":"de","라트비아어":"lv","라틴어":"la","러시아어":"ru","루마니아어":"ro","리투아니아어":"lt","마라티어":"mr","마오리어":"mi","마케도니아어":"mk","말라얄람어":"ml","말레이어":"ms","몰타어":"mt","몽골어":"mn","미얀마어 (버마어)":"my","바스크어":"eu","베트남어":"vi","벨라루스어":"be","불가리아어":"bg","세르비아어":"sr","스웨덴어":"sv","스코틀랜드 게일어":"gd","스페인어":"es","슬로바키아어":"sk","슬로베니아어":"sl","아랍어":"ar","아르메니아어":"hy","아이슬란드어":"is","아이티 크리올어":"ht","아일랜드어":"ga","아제르바이잔어":"az","알바니아어":"sq","암하라어":"am","에스토니아어":"et","에스페란토어":"eo","영어":"en","우즈베크어":"uz","우크라이나어":"uk","웨일즈어":"cy","이탈리아어":"it","인도네시아어":"id","일본어":"ja","줄루어":"zu","중국어(간체)":"zh-cn","중국어(번체)":"zh-tw","체코어":"cs","카탈로니아어":"ca","칸나다어":"kn","쿠르드어":"ku","크로아티아어":"hr","태국어":"th","터키어":"tr","텔루구어":"te","페르시아어":"fa","포르투갈어":"pt","폴란드어":"pl","프랑스어":"fr","핀란드어":"fi","한국어":"ko","헝가리어":"hu","히브리어":"he","힌디어":"hi","albanese":"sq","amarico":"am","arabo":"ar","armeno":"hy","azero":"az","bielorusso":"be","bulgaro":"bg","catalano":"ca","ceco":"cs","cinese (semplificato)":"zh-cn","cinese (tradizionale)":"zh-tw","creolo haitiano":"ht","croato":"hr","curdo (kurmanji)":"ku","danese":"da","ebraico":"he","estone":"et","finlandese":"fi","francese":"fr","gaelico scozzese":"gd","galiziano":"gl","gallese":"cy","giapponese":"ja","greco":"el","indonesiano":"id","inglese":"en","irlandese":"ga","islandese":"is","latino":"la","lettone":"lv","macedone":"mk","malese":"ms","mongolo":"mn","norvegese":"nb","olandese":"nl","persiano":"fa","polacco":"pl","portoghese":"pt","rumeno":"ro","serbo":"sr","slovacco":"sk","sloveno":"sl","spagnolo":"es","svedese":"sv","tailandese":"th","tedesco":"de","ucraino":"uk","ungherese":"hu","quốc tế ngữ":"eo","tiếng ả rập":"ar","tiếng albania":"sq","tiếng amharic":"am","tiếng anh":"en","tiếng armenia":"hy","tiếng azerbaijan":"az","tiếng ba lan":"pl","tiếng ba tư":"fa","tiếng basque":"eu","tiếng belarus":"be","tiếng bồ đào nha":"pt","tiếng bulgaria":"bg","tiếng catalan":"ca","tiếng creole ở haiti":"ht","tiếng croatia":"hr","tiếng do thái":"he","tiếng đan mạch":"da","tiếng đức":"de","tiếng estonia":"et","tiếng gael scotland":"gd","tiếng galicia":"gl","tiếng hà lan":"nl","tiếng hàn":"ko","tiếng hindi":"hi","tiếng hungary":"hu","tiếng hy lạp":"el","tiếng iceland":"is","tiếng indonesia":"id","tiếng ireland":"ga","tiếng kannada":"kn","tiếng kurd":"ku","tiếng latinh":"la","tiếng latvia":"lv","tiếng litva":"lt","tiếng mã lai":"ms","tiếng macedonia":"mk","tiếng malayalam":"ml","tiếng malta":"mt","tiếng maori":"mi","tiếng marathi":"mr","tiếng mông cổ":"mn","tiếng myanmar":"my","tiếng na uy":"nb","tiếng nga":"ru","tiếng nhật":"ja","tiếng pháp":"fr","tiếng phần lan":"fi","tiếng rumani":"ro","tiếng séc":"cs","tiếng serbia":"sr","tiếng slovak":"sk","tiếng slovenia":"sl","tiếng tây ban nha":"es","tiếng telugu":"te","tiếng thái":"th","tiếng thổ nhĩ kỳ":"tr","tiếng thụy điển":"sv","tiếng trung (giản thể)":"zh-cn","tiếng trung (phồn thể)":"zh-tw","tiếng ukraina":"uk","tiếng uzbek":"uz","tiếng việt":"vi","tiếng xứ wales":"cy","tiếng ý":"it","tiếng zulu":"zu","にほんご":"ja"},"scratchToGoogleMap":{"zh-cn":"zh","nb":"no","he":"iw","es-419":"es","pt-br":"pt","ja-hira":"ja"},"previouslySupported":["ab","ms","be","eo","hy","hi","kn","ht","ku","la","mk","ml","mt","mr","mn","my","nn","sq","te","uz"]}')},function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e,t,n){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:r+"")in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const s=n(20),{OrderedMap:o}=n(25),a=n(72),l=n(426),c=n(4),u=n(17),d=n(76),h=n(3),p=n(208),m=n(209),f=n(80),g=n(49),y=n(215),b=n(43),v=n(26),S=n(1),w=n(65),k=n(13),x=n(10),T=n(32),E=n(216),A=n(217),C=n(45),I=n(219),O=n(220),M=n(221),N=n(222),R=n(223),D=n(224),P=n(81),L=n(7),B=n(8),z={scratch3_control:n(225),scratch3_event:n(226),scratch3_looks:n(227),scratch3_motion:n(228),scratch3_operators:n(229),scratch3_sound:n(230),scratch3_sensing:n(231),scratch3_data:n(232),scratch3_procedures:n(233)},U=n(234),j=n(235),F=["#0FBD8C","#0DA57A","#0B8E69"],W=" // _twconfig_",V=(()=>{const e={};return e[c.ANGLE]={shadow:{type:"math_angle",fieldName:"NUM"}},e[c.COLOR]={shadow:{type:"colour_picker",fieldName:"COLOUR"}},e[c.NUMBER]={shadow:{type:"math_number",fieldName:"NUM"}},e[c.STRING]={shadow:{type:"text",fieldName:"TEXT"}},e[c.BOOLEAN]={check:"Boolean"},e[c.MATRIX]={shadow:{type:"matrix",fieldName:"MATRIX"}},e[c.NOTE]={shadow:{type:"note",fieldName:"NOTE"}},e[c.IMAGE]={fieldType:"field_image"},e[c.COSTUME]={shadow:{type:"looks_costume",fieldName:"COSTUME"}},e[c.SOUND]={shadow:{type:"sound_sounds_menu",fieldName:"SOUND_MENU"}},e})(),G=e=>{let t=0;return{canAddCloudVariable:()=>t{t++},removeCloudVariable:()=>{t--},hasCloudVariables:()=>t>0,getNumberOfCloudVariables:()=>t}};let q=-1,Y=-1,H=-1;class _ extends s{constructor(){super(),this.targets=[],this.executableTargets=[],this.threads=[],this.threadMap=new Map,this.sequencer=new m(this),this.flyoutBlocks=new u(this,!0),this.monitorBlocks=new u(this,!0),this._editingTarget=null,this._primitives={},this._blockInfo=[],this._hats={},this._flowing={},this._scriptGlowsPreviousFrame=[],this._nonMonitorThreadCount=0,this._lastStepDoneThreads=null,this._cloneCounter=0,this._refreshTargets=!1,this.monitorBlockInfo={},this._monitorState=o({}),this._prevMonitorState=o({}),this.turboMode=!1,this.frameLoop=new j(this),this.currentStepTime=1e3/30,this.updateCurrentMSecs(),this.redrawRequested=!1,this._registerBlockPackages(),this.ioDevices={clock:new I(this),cloud:new O(this),keyboard:new M(this),mouse:new N(this),mouseWheel:new R(this),userData:new D,video:new P(this)},this.peripheralExtensions={},this.profiler=null,this.cloudOptions={limit:10};const e=G(this.cloudOptions);this.hasCloudData=e.hasCloudVariables,this.canAddCloudVariable=e.canAddCloudVariable,this.getNumberOfCloudVariables=e.getNumberOfCloudVariables,this.addCloudVariable=this._initializeAddCloudVariable(e),this.removeCloudVariable=this._initializeRemoveCloudVariable(e),this.origin=null,this._initScratchLink(),this.resetRunId(),this._stageTarget=null,this.addonBlocks={},this.stageWidth=_.STAGE_WIDTH,this.stageHeight=_.STAGE_HEIGHT,this.runtimeOptions={maxClones:_.MAX_CLONES,miscLimits:!0,fencing:!0},this.compilerOptions={enabled:!0,warpTimer:!1},this.debug=!1,this._lastStepTime=Date.now(),this.interpolationEnabled=!1,this._defaultStoredSettings=this._generateAllProjectOptions(),this.isPackaged=!1,this.externalCommunicationMethods={cloudVariables:!1,customExtensions:!1},this.on(_.HAS_CLOUD_DATA_UPDATE,(e=>{this.setExternalCommunicationMethod("cloudVariables",e)})),this.enforcePrivacy=!0,this.extensionButtons=new Map,this.fontManager=new A(this),this.extensionStorage={},this.totalAssetRequests=0,this.finishedAssetRequests=0}static get STAGE_WIDTH(){return 480}static get STAGE_HEIGHT(){return 360}static get SCRIPT_GLOW_ON(){return"SCRIPT_GLOW_ON"}static get SCRIPT_GLOW_OFF(){return"SCRIPT_GLOW_OFF"}static get BLOCK_GLOW_ON(){return"BLOCK_GLOW_ON"}static get BLOCK_GLOW_OFF(){return"BLOCK_GLOW_OFF"}static get HAS_CLOUD_DATA_UPDATE(){return"HAS_CLOUD_DATA_UPDATE"}static get TURBO_MODE_ON(){return"TURBO_MODE_ON"}static get TURBO_MODE_OFF(){return"TURBO_MODE_OFF"}static get RUNTIME_OPTIONS_CHANGED(){return"RUNTIME_OPTIONS_CHANGED"}static get COMPILER_OPTIONS_CHANGED(){return"COMPILER_OPTIONS_CHANGED"}static get FRAMERATE_CHANGED(){return"FRAMERATE_CHANGED"}static get INTERPOLATION_CHANGED(){return"INTERPOLATION_CHANGED"}static get STAGE_SIZE_CHANGED(){return"STAGE_SIZE_CHANGED"}static get COMPILE_ERROR(){return"COMPILE_ERROR"}static get BEFORE_EXECUTE(){return"BEFORE_EXECUTE"}static get AFTER_EXECUTE(){return"AFTER_EXECUTE"}static get ASSET_PROGRESS(){return"ASSET_PROGRESS"}static get PROJECT_START(){return"PROJECT_START"}static get PROJECT_RUN_START(){return"PROJECT_RUN_START"}static get PROJECT_RUN_STOP(){return"PROJECT_RUN_STOP"}static get PROJECT_STOP_ALL(){return"PROJECT_STOP_ALL"}static get STOP_FOR_TARGET(){return"STOP_FOR_TARGET"}static get VISUAL_REPORT(){return"VISUAL_REPORT"}static get PROJECT_LOADED(){return"PROJECT_LOADED"}static get PROJECT_CHANGED(){return"PROJECT_CHANGED"}static get TOOLBOX_EXTENSIONS_NEED_UPDATE(){return"TOOLBOX_EXTENSIONS_NEED_UPDATE"}static get TARGETS_UPDATE(){return"TARGETS_UPDATE"}static get MONITORS_UPDATE(){return"MONITORS_UPDATE"}static get BLOCK_DRAG_UPDATE(){return"BLOCK_DRAG_UPDATE"}static get BLOCK_DRAG_END(){return"BLOCK_DRAG_END"}static get EXTENSION_ADDED(){return"EXTENSION_ADDED"}static get EXTENSION_FIELD_ADDED(){return"EXTENSION_FIELD_ADDED"}static get PERIPHERAL_LIST_UPDATE(){return"PERIPHERAL_LIST_UPDATE"}static get USER_PICKED_PERIPHERAL(){return"USER_PICKED_PERIPHERAL"}static get PERIPHERAL_CONNECTED(){return"PERIPHERAL_CONNECTED"}static get PERIPHERAL_DISCONNECTED(){return"PERIPHERAL_DISCONNECTED"}static get PERIPHERAL_REQUEST_ERROR(){return"PERIPHERAL_REQUEST_ERROR"}static get PERIPHERAL_CONNECTION_LOST_ERROR(){return"PERIPHERAL_CONNECTION_LOST_ERROR"}static get PERIPHERAL_SCAN_TIMEOUT(){return"PERIPHERAL_SCAN_TIMEOUT"}static get MIC_LISTENING(){return"MIC_LISTENING"}static get BLOCKSINFO_UPDATE(){return"BLOCKSINFO_UPDATE"}static get RUNTIME_STARTED(){return"RUNTIME_STARTED"}static get RUNTIME_STOPPED(){return"RUNTIME_STOPPED"}static get RUNTIME_DISPOSED(){return"RUNTIME_DISPOSED"}static get BLOCKS_NEED_UPDATE(){return"BLOCKS_NEED_UPDATE"}static get THREAD_STEP_INTERVAL(){return 1e3/60}static get THREAD_STEP_INTERVAL_COMPATIBILITY(){return 1e3/30}static get MAX_CLONES(){return 300}_initializeAddCloudVariable(e){return()=>{const t=this.hasCloudData();e.addCloudVariable(),!t&&this.hasCloudData()&&this.emit(_.HAS_CLOUD_DATA_UPDATE,!0)}}_initializeRemoveCloudVariable(e){return()=>{const t=this.hasCloudData();e.removeCloudVariable(),t&&!this.hasCloudData()&&this.emit(_.HAS_CLOUD_DATA_UPDATE,!1)}}_registerBlockPackages(){for(const e in z)if(Object.prototype.hasOwnProperty.call(z,e)){const t=new z[e](this);if(t.getPrimitives){const e=t.getPrimitives();for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this._primitives[n]=e[n].bind(t))}if(t.getHats){const e=t.getHats();for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this._hats[t]=e[t])}t.getMonitored&&(this.monitorBlockInfo=Object.assign({},this.monitorBlockInfo,t.getMonitored())),this.compilerRegisterExtension(e,t)}}compilerRegisterExtension(e,t){this["ext_".concat(e)]=t}getMonitorState(){return this._monitorState}_makeExtensionMenuId(e,t){return"".concat(t,"_menu_").concat(e)}makeMessageContextForTarget(e){const t={};(e=e||this.getEditingTarget()||this.getTargetForStage())&&(t.targetType=e.isStage?b.STAGE:b.SPRITE)}_registerExtensionPrimitives(e){const t={id:e.id,name:w(e.name),showStatusButton:e.showStatusButton,blockIconURI:e.blockIconURI,menuIconURI:e.menuIconURI};e.color1?(t.color1=e.color1,t.color2=e.color2,t.color3=e.color3):(t.color1=F[0],t.color2=F[1],t.color3=F[2]),this._blockInfo.push(t),this._fillExtensionCategory(t,e);for(const n in t.customFieldTypes)if(Object.prototype.hasOwnProperty.call(e.customFieldTypes,n)){const e=t.customFieldTypes[n];this.emit(_.EXTENSION_FIELD_ADDED,{name:"field_".concat(e.extendedName),implementation:e.fieldImplementation})}this.emit(_.EXTENSION_ADDED,t)}_refreshExtensionPrimitives(e){const t=this._blockInfo.find((t=>t.id===e.id));t&&(t.name=w(e.name),this._fillExtensionCategory(t,e),this.emit(_.BLOCKSINFO_UPDATE,t))}_fillExtensionCategory(e,t){e.blocks=[],e.customFieldTypes={},e.menus=[],e.menuInfo={};for(const n in t.menus)if(Object.prototype.hasOwnProperty.call(t.menus,n)){const r=t.menus[n],i=this._buildMenuForScratchBlocks(n,r,e);e.menus.push(i),e.menuInfo[n]=r}for(const n in t.customFieldTypes)if(Object.prototype.hasOwnProperty.call(t.customFieldTypes,n)){const r=t.customFieldTypes[n],i=this._buildCustomFieldInfo(n,r,t.id,e);e.customFieldTypes[n]=i}if(t.docsURI){const n={info:{},xml:"')};e.blocks.push(n)}for(const n of t.blocks)try{const t=this._convertForScratchBlocks(n,e);if(e.blocks.push(t),t.json){const e=t.json.type;n.blockType!==h.EVENT&&(this._primitives[e]=t.info.func),n.blockType===h.EVENT||n.blockType===h.HAT?this._hats[e]={edgeActivated:n.isEdgeActivated,restartExistingThreads:n.shouldRestartExistingThreads}:n.blockType===h.CONDITIONAL?this._flowing[e]={conditional:!0,loop:!1}:n.blockType===h.LOOP&&(this._flowing[e]={conditional:!1,loop:!0})}}catch(e){S.error("Error parsing block: ",{block:n,error:e})}}_convertMenuItems(e){if("function"!=typeof e){const t=this.makeMessageContextForTarget();return e.map((e=>{const n=w(e,t);switch(typeof n){case"string":return[n,n];case"object":return[w(e.text,t),e.value];default:throw new Error("Can't interpret menu item: ".concat(JSON.stringify(e)))}}))}return e}_buildMenuForScratchBlocks(e,t,n){const r=this._makeExtensionMenuId(e,n.id),i=this._convertMenuItems(t.items);return{json:{message0:"%1",type:r,inputsInline:!0,output:"String",colour:n.color1,colourSecondary:n.color2,colourTertiary:n.color3,outputShape:t.acceptReporters?y.OUTPUT_SHAPE_ROUND:y.OUTPUT_SHAPE_SQUARE,args0:[{type:"field_dropdown",name:e,options:i}]}}}_buildCustomFieldInfo(e,t,n,r){const i="".concat(n,"_").concat(e);return{fieldName:e,extendedName:i,argumentTypeInfo:{shadow:{type:i,fieldName:"field_".concat(i)}},scratchBlocksDefinition:this._buildCustomFieldTypeForScratchBlocks(i,t.output,t.outputShape,r),fieldImplementation:t.implementation}}_buildCustomFieldTypeForScratchBlocks(e,t,n,r){return{json:{type:e,message0:"%1",inputsInline:!0,output:t,colour:r.color1,colourSecondary:r.color2,colourTertiary:r.color3,outputShape:n,args0:[{name:"field_".concat(e),type:"field_".concat(e)}]}}}_convertForScratchBlocks(e,t){return"---"===e?this._convertSeparatorForScratchBlocks(e):e.blockType===h.LABEL?this._convertLabelForScratchBlocks(e):e.blockType===h.BUTTON?this._convertButtonForScratchBlocks(e,t):e.blockType===h.XML?this._convertXmlForScratchBlocks(e):this._convertBlockForScratchBlocks(e,t)}_convertBlockForScratchBlocks(e,t){var n,r,i;const s="".concat(t.id,"_").concat(e.opcode),o={type:s,inputsInline:!0,category:t.name,extensions:[],colour:null!==(n=e.color1)&&void 0!==n?n:t.color1,colourSecondary:null!==(r=e.color2)&&void 0!==r?r:t.color2,colourTertiary:null!==(i=e.color3)&&void 0!==i?i:t.color3},a={argsMap:{},blockJSON:o,categoryInfo:t,blockInfo:e,inputList:[]},l=e.blockIconURI||t.blockIconURI;if(o.extensions.push("from_extension"),o.colour===F[0]&&o.colourSecondary===F[1]&&o.colourTertiary===F[2]&&o.extensions.push("default_extension_colors"),l){o.extensions.push("scratch_extension"),o.message0="%1 %2";const e={type:"field_image",src:l,width:40,height:40},t={type:"field_vertical_separator"};o.args0=[e,t]}switch(e.blockType){case h.COMMAND:o.outputShape=y.OUTPUT_SHAPE_SQUARE,o.previousStatement=null,e.isTerminal||(o.nextStatement=null);break;case h.REPORTER:o.output=e.allowDropAnywhere?null:"String",o.outputShape=y.OUTPUT_SHAPE_ROUND;break;case h.BOOLEAN:o.output="Boolean",o.outputShape=y.OUTPUT_SHAPE_HEXAGONAL;break;case h.HAT:case h.EVENT:Object.prototype.hasOwnProperty.call(e,"isEdgeActivated")||(e.isEdgeActivated=!0),o.outputShape=y.OUTPUT_SHAPE_SQUARE,o.nextStatement=null;break;case h.CONDITIONAL:case h.LOOP:e.branchCount=e.branchCount||1,o.outputShape=y.OUTPUT_SHAPE_SQUARE,o.previousStatement=null,e.isTerminal||(o.nextStatement=null)}const c=Array.isArray(e.text)?e.text:[e.text];let u=0,d=0,p=0;const m=this._convertPlaceholders.bind(this,a),f=this.makeMessageContextForTarget();for(;u0?d+1:"")}],++d,++p)}if(e.blockType===h.REPORTER||e.blockType===h.BOOLEAN)e.disableMonitor||0!==a.inputList.length||(o.checkboxInFlyout=!0);else if(e.branchIconURI||e.blockType===h.LOOP&&!Object.prototype.hasOwnProperty.call(e,"branchIconURI")){var g;o["lastDummyAlign".concat(p)]="RIGHT",o["message".concat(p)]="%1",o["args".concat(p)]=[{type:"field_image",src:null!==(g=e.branchIconURI)&&void 0!==g?g:"media://repeat.svg",width:24,height:24,alt:"*",flip_rtl:!0}],++p}const b=e.isDynamic?''):"",v=a.inputList.join(""),S='').concat(b).concat(v,"");if(e.extensions)for(const t of e.extensions)o.extensions.includes(t)||o.extensions.push(t);return{info:a.blockInfo,json:a.blockJSON,xml:S}}_convertSeparatorForScratchBlocks(e){return{info:e,xml:''}}_convertLabelForScratchBlocks(e){return{info:e,xml:'')}}_convertButtonForScratchBlocks(e,t){const n=this.makeMessageContextForTarget(),r=w(e.text,n);if(["MAKE_A_LIST","MAKE_A_PROCEDURE","MAKE_A_VARIABLE"].includes(e.func))return{info:e,xml:'')};const i="".concat(t.id,"_").concat(e.func);return this.extensionButtons.set(i,e.callFunc),{info:e,xml:'')}}_convertXmlForScratchBlocks(e){return{info:e,xml:e.xml}}handleExtensionButtonPress(e){this.extensionButtons.get(e)()}_constructInlineImageJson(e){return e.dataURI||S.warn("Missing data URI in extension block with argument type IMAGE"),{type:"field_image",src:e.dataURI||"",width:24,height:24,flip_rtl:e.flipRTL||!1}}_convertPlaceholders(e,t,n){const r=e.blockInfo.arguments[n]||{};let i,s=V[r.type]||{};if(!V[r.type]&&e.categoryInfo.customFieldTypes[r.type]&&(s=e.categoryInfo.customFieldTypes[r.type].argumentTypeInfo),"field_image"===s.fieldType)i=this._constructInlineImageJson(r);else{i={type:"input_value",name:n};const t=void 0===r.defaultValue?null:w(r.defaultValue,this.makeMessageContextForTarget()).toString();let o,a,l;if(s.check&&(i.check=s.check),r.menu){const t=e.categoryInfo.menuInfo[r.menu];t.acceptReporters?(o=n,a=this._makeExtensionMenuId(r.menu,e.categoryInfo.id),l=r.menu):(i.type="field_dropdown",i.options=this._convertMenuItems(t.items),o=null,a=null,l=n)}else o=n,a=s.shadow&&s.shadow.type||null,l=s.shadow&&s.shadow.fieldName||null;o&&e.inputList.push('')),a&&e.inputList.push('')),null!==t&&l&&e.inputList.push('').concat(T(t),"")),a&&e.inputList.push(""),o&&e.inputList.push("")}const o="args".concat(e.outLineNum),a=e.blockJSON[o]=e.blockJSON[o]||[];i&&a.push(i);const l=a.length;return e.argsMap[n]=l,"%".concat(l)}getBlocksXML(e){return this._blockInfo.map((t=>{const{name:n,color1:r,color2:i}=t,s=t.blocks.filter((t=>{let n=!0;return e&&t.info.filter&&(n=t.info.filter.includes(e.isStage?b.STAGE:b.SPRITE)),n&&!t.info.hideFromPalette})),o='colour="'.concat(T(r),'" secondaryColour="').concat(T(i),'"');let a="";t.menuIconURI?a=t.menuIconURI:t.blockIconURI&&(a=t.blockIconURI);const l=a?'iconURI="'.concat(T(a),'"'):"";let c="";t.showStatusButton&&(c='showStatusButton="true"');let u='"),u+=s.map((e=>e.xml)).join(""),u+="",{id:t.id,xml:u}}))}getBlocksJSON(){return this._blockInfo.reduce(((e,t)=>e.concat(t.blocks.map((e=>e.json)))),[])}_initScratchLink(){if("undefined"!=typeof self&&"undefined"!=typeof document&&document.getElementById&&self.origin&&"null"!==self.origin&&self.navigator&&self.navigator.userAgent&&!self.navigator.userAgent.includes("Node.js")&&!self.navigator.userAgent.includes("jsdom")){if(!document.getElementById("scratch-link-extension-script")){const e=document.createElement("script");e.id="scratch-link-extension-script",document.body.appendChild(e),self.postMessage("inject-scratch-link-script",self.origin)}}}getScratchLinkSocket(e){return(this._linkSocketFactory||this._defaultScratchLinkSocketFactory)(e)}configureScratchLinkSocketFactory(e){this._linkSocketFactory=e}_defaultScratchLinkSocketFactory(e){const t=self.Scratch,n=t&&t.ScratchLinkSafariSocket;return n&&n.isSafariHelperCompatible()?new n(e):new E(e)}registerPeripheralExtension(e,t){this.peripheralExtensions[e]=t}scanForPeripheral(e){this.peripheralExtensions[e]&&this.peripheralExtensions[e].scan()}connectPeripheral(e,t){this.peripheralExtensions[e]&&this.peripheralExtensions[e].connect(t)}disconnectPeripheral(e){this.peripheralExtensions[e]&&this.peripheralExtensions[e].disconnect()}getPeripheralIsConnected(e){let t=!1;return this.peripheralExtensions[e]&&(t=this.peripheralExtensions[e].isConnected()),t}emitMicListening(e){this.emit(_.MIC_LISTENING,e)}getOpcodeFunction(e){return this._primitives[e]}getIsHat(e){return Object.prototype.hasOwnProperty.call(this._hats,e)}getIsEdgeActivatedHat(e){return Object.prototype.hasOwnProperty.call(this._hats,e)&&this._hats[e].edgeActivated}attachAudioEngine(e){this.audioEngine=e}attachRenderer(e){this.renderer=e,this.renderer.setLayerGroupOrdering(k.LAYER_GROUPS),this.renderer.offscreenTouching=!this.runtimeOptions.fencing,this.updatePrivacy()}attachV2BitmapAdapter(e){this.v2BitmapAdapter=e}attachStorage(e){if(this.storage=e,this.isPackaged){const t=e.createAsset;let n=0;e.createAsset=function(e,r,i,s,o){return s||(s=(++n).toString()),t.call(this,e,r,i,s,!1)}}C.setFetch(e.scratchFetch.scratchFetch),this.resetRunId()}_pushThread(e,t,n){const r=new v(e);return r.target=t,r.stackClick=Boolean(n&&n.stackClick),r.updateMonitor=Boolean(n&&n.updateMonitor),r.blockContainer=r.updateMonitor?this.monitorBlocks:t.blocks,r.pushStack(e),this.threads.push(r),r.stackClick||r.updateMonitor||this.threadMap.set(r.getId(),r),n&&n.updateMonitor||!this.compilerOptions.enabled||r.tryCompile(),r}_stopThread(e){e.isKilled=!0,this.sequencer.retireThread(e)}_restartThread(e){const t=new v(e.topBlock);t.target=e.target,t.stackClick=e.stackClick,t.updateMonitor=e.updateMonitor,t.blockContainer=e.blockContainer,t.pushStack(e.topBlock),e.triedToCompile&&this.compilerOptions.enabled&&t.tryCompile(),t.stackClick||t.updateMonitor||this.threadMap.set(t.getId(),t);const n=this.threads.indexOf(e);return n>-1?(this.threads[n]=t,t):(this.threads.push(e),e)}emitCompileError(e,t){this.emit(_.COMPILE_ERROR,e,t)}isActiveThread(e){return e.stack.length>0&&e.status!==v.STATUS_DONE&&this.threads.indexOf(e)>-1}isWaitingThread(e){return e.status===v.STATUS_PROMISE_WAIT||e.status===v.STATUS_YIELD_TICK||!this.isActiveThread(e)}toggleScript(e,t){t=Object.assign({target:this._editingTarget,stackClick:!1},t);for(let n=0;n=0;t--){const r=n[t],i=r.blocks.getScripts();for(let t=0;t=0;n--){const i=r[n],s=d.getScripts(i.blocks,e);for(let e=0;e{const{blockId:o,fieldsOfInputs:a}=e;for(const e in t)if(a[e].value!==t[e])return;if(i.restartExistingThreads){const e=this.threadMap.get(v.getIdFromTargetAndBlock(n,o));if(e)return void r.push(this._restartThread(e))}else for(let e=0;e{e.isCompiled?e.executableHat&&(g.saveGlobalState(),g(e),g.restoreGlobalState()):(f(this.sequencer,e),e.goToNextBlock())})),r}dispose(){this.stopAll(),this.targets.forEach((e=>{e.isOriginal&&e.deleteMonitors()})),this.targets.map(this.disposeTarget,this),this.extensionStorage={};const e=o({});e.equals(this._monitorState)||(this._monitorState=e,this.emit(_.MONITORS_UPDATE,this._monitorState)),this.emit(_.RUNTIME_DISPOSED),this.ioDevices.clock.resetProjectTimer(),this.fontManager.clear(),this.hasCloudData()&&this.emit(_.HAS_CLOUD_DATA_UPDATE,!1),this.ioDevices.cloud.clear();const t=G(this.cloudOptions);this.hasCloudData=t.hasCloudVariables,this.canAddCloudVariable=t.canAddCloudVariable,this.getNumberOfCloudVariables=t.getNumberOfCloudVariables,this.addCloudVariable=this._initializeAddCloudVariable(t),this.removeCloudVariable=this._initializeRemoveCloudVariable(t),this.resetProgress()}addTarget(e){this.targets.push(e),this.executableTargets.push(e),e.isStage&&!this._stageTarget&&(this._stageTarget=e)}moveExecutable(e,t){const n=this.executableTargets.indexOf(e);this.executableTargets.splice(n,1);let r=n+t;return r>this.executableTargets.length&&(r=this.executableTargets.length),r<=0&&(r=this.executableTargets.length>0&&this.executableTargets[0].isStage?1:0),this.executableTargets.splice(r,0,e),r}setExecutablePosition(e,t){const n=this.executableTargets.indexOf(e);return this.moveExecutable(e,t-n)}removeExecutable(e){const t=this.executableTargets.indexOf(e);t>-1&&this.executableTargets.splice(t,1)}disposeTarget(e){this.targets=this.targets.filter((t=>e!==t||(t.dispose(),!1))),this._stageTarget===e&&(this._stageTarget=null)}stopForTarget(e,t){this.emit(_.STOP_FOR_TARGET,e,t);for(let n=0;ne.clearEdgeActivatedValues()));for(let e=0;e!e.isKilled)),this.updateThreadMap();for(const e in this._hats){if(!Object.prototype.hasOwnProperty.call(this._hats,e))continue;this._hats[e].edgeActivated&&this.startHats(e)}this.redrawRequested=!1,this._pushMonitors(),null!==this.profiler&&(-1===Y&&(Y=this.profiler.idByName("Sequencer.stepThreads")),this.profiler.start(Y)),this.emit(_.BEFORE_EXECUTE);const e=this.sequencer.stepThreads();null!==this.profiler&&this.profiler.stop(),this.emit(_.AFTER_EXECUTE),this._updateGlows(e),this._emitProjectRunStatus(this.threads.length+e.length-this._getMonitorThreadCount([...this.threads,...e])),this._lastStepDoneThreads=e,this.renderer&&(null!==this.profiler&&(-1===H&&(H=this.profiler.idByName("RenderWebGL.draw")),this.profiler.start(H)),document.hidden||this.frameLoop._interpolationAnimation||this.renderer.draw(),null!==this.profiler&&this.profiler.stop()),this._refreshTargets&&(this.emit(_.TARGETS_UPDATE,!1),this._refreshTargets=!1),this._prevMonitorState.equals(this._monitorState)||(this.emit(_.MONITORS_UPDATE,this._monitorState),this._prevMonitorState=this._monitorState),null!==this.profiler&&(this.profiler.stop(),this.profiler.reportFrames()),this.interpolationEnabled&&(this._lastStepTime=Date.now())}_getMonitorThreadCount(e){let t=0;return e.forEach((e=>{e.updateMonitor&&t++})),t}_pushMonitors(){this.monitorBlocks.runAllMonitored(this)}setEditingTarget(e){const t=this._editingTarget;this._editingTarget=e,this._scriptGlowsPreviousFrame=[],this._updateGlows(),t!==this._editingTarget&&this.requestToolboxExtensionsUpdate()}setCompatibilityMode(e){e?this.setFramerate(30):this.setFramerate(60)}setFramerate(e){e>250&&(e=250),e<0&&(e=1),this.frameLoop.setFramerate(e),this.emit(_.FRAMERATE_CHANGED,e)}setInterpolation(e){this.interpolationEnabled=e,this.frameLoop.setInterpolation(this.interpolationEnabled),this.emit(_.INTERPOLATION_CHANGED,e)}setRuntimeOptions(e){this.runtimeOptions=Object.assign({},this.runtimeOptions,e),this.emit(_.RUNTIME_OPTIONS_CHANGED,this.runtimeOptions),this.renderer&&(this.renderer.offscreenTouching=!this.runtimeOptions.fencing)}setCompilerOptions(e){this.compilerOptions=Object.assign({},this.compilerOptions,e),this.resetAllCaches(),this.emit(_.COMPILER_OPTIONS_CHANGED,this.compilerOptions)}setStageSize(e,t){if(e=Math.round(Math.max(1,e)),t=Math.round(Math.max(1,t)),this.stageWidth!==e||this.stageHeight!==t){const n=e-this.stageWidth,r=t-this.stageHeight;if(this._monitorState.size>0){const e=n/2,t=r/2;for(const n of this._monitorState.valueSeq()){const r=n.set("x",n.get("x")+e).set("y",n.get("y")+t);this.requestUpdateMonitor(r)}this.emit(_.MONITORS_UPDATE,this._monitorState)}this.stageWidth=e,this.stageHeight=t,this.renderer&&this.renderer.setStageSize(-e/2,e/2,-t/2,t/2)}this.emit(_.STAGE_SIZE_CHANGED,e,t)}setInEditor(e){}convertToPackagedRuntime(){if(this.storage)throw new Error("convertToPackagedRuntime must be called before attachStorage");this.isPackaged=!0}resetAllCaches(){for(const e of this.targets)e.isOriginal&&e.blocks.resetCache();this.flyoutBlocks.resetCache(),this.monitorBlocks.resetCache()}addAddonBlock(e){const t=e.procedureCode,n=e.arguments||[],s=n,o=n.map(((e,t)=>"arg".concat(t))),a=n.map((()=>""));if(this.addonBlocks[t]=function(e){for(var t=1;te.id===n));if(!r){const e='';r={id:n,name:w({id:"tw.blocks.addons",default:"Addons",description:"Name of the addon block category in the extension list"}),color1:"#29beb8",color2:"#3aa8a4",color3:"#3aa8a4",menuIconURI:"data:image/svg+xml;,".concat(encodeURIComponent(e)),blocks:[],customFieldTypes:{},menus:[]},this._blockInfo.unshift(r)}r.blocks.push({info:{},xml:'"})}this.resetAllCaches()}getAddonBlock(e){return Object.prototype.hasOwnProperty.call(this.addonBlocks,e)?this.addonBlocks[e]:null}findProjectOptionsComment(){const e=this.getTargetForStage().comments;for(const t of Object.values(e))if(t.text.includes(W))return t;return null}parseProjectOptions(){const e=this.findProjectOptionsComment();if(!e)return;const t=e.text.split("\n").find((e=>e.endsWith(W)));if(!t)return void S.warn("Config comment does not contain valid line");const n=t.substr(0,t.length-14);let r;try{if(r=a.parse(n),!r||"object"!=typeof r)throw new Error("Invalid object")}catch(e){return void S.warn("Config comment has invalid JSON",e)}"number"==typeof r.framerate&&this.setFramerate(r.framerate),r.turbo&&(this.turboMode=!0,this.emit(_.TURBO_MODE_ON)),r.interpolation&&this.setInterpolation(!0),r.runtimeOptions&&this.setRuntimeOptions(r.runtimeOptions),r.hq&&this.renderer&&this.renderer.setUseHighQualityRender(!0);const i=+r.width||this.stageWidth,s=+r.height||this.stageHeight;i===this.stageWidth&&s===this.stageHeight||this.setStageSize(i,s)}_generateAllProjectOptions(){return{framerate:this.frameLoop.framerate,runtimeOptions:this.runtimeOptions,interpolation:this.interpolationEnabled,turbo:this.turboMode,hq:!!this.renderer&&this.renderer.useHighQualityRender,width:this.stageWidth,height:this.stageHeight}}generateDifferingProjectOptions(){const e=(t,n)=>{const r={};for(const i of Object.keys(n)){const s=n[i],o=t[i];if("object"==typeof s&&s){const t=e(o,s);Object.keys(t).length>0&&(r[i]=t)}else s!==o&&(r[i]=s)}return r};return e(this._defaultStoredSettings,this._generateAllProjectOptions())}storeProjectOptions(){const e=this.generateDifferingProjectOptions(),t="Configuration for https://turbowarp.org/\nYou can move, resize, and minimize this comment, but don't edit it by hand. This comment can be deleted to remove the stored settings.\n".concat(a.stringify(e)).concat(W),n=this.findProjectOptionsComment();if(n)n.text=t;else{this.getTargetForStage().createComment(B(),null,t,50,50,350,170,!1)}this.emitProjectChanged()}precompile(){this.allScriptsDo(((e,t)=>{const n=t.blocks.getBlock(e);if(this.getIsHat(n.opcode)){const n=new v(e);n.target=t,n.blockContainer=t.blocks,n.tryCompile()}}))}enableDebug(){this.resetAllCaches(),this.debug=!0}_updateGlows(e){const t=[];t.push(...this.threads),e&&t.push(...e);const n=[],r=[];for(let e=0;e0&&this.emit(_.PROJECT_RUN_START),this._nonMonitorThreadCount>0&&0===e&&this.emit(_.PROJECT_RUN_STOP),this._nonMonitorThreadCount=e}quietGlow(e){const t=this._scriptGlowsPreviousFrame.indexOf(e);t>-1&&this._scriptGlowsPreviousFrame.splice(t,1)}glowBlock(e,t){t?this.emit(_.BLOCK_GLOW_ON,{id:e}):this.emit(_.BLOCK_GLOW_OFF,{id:e})}glowScript(e,t){t?this.emit(_.SCRIPT_GLOW_ON,{id:e}):this.emit(_.SCRIPT_GLOW_OFF,{id:e})}emitBlockDragUpdate(e){this.emit(_.BLOCK_DRAG_UPDATE,e)}emitBlockEndDrag(e,t){this.emit(_.BLOCK_DRAG_END,e,t)}visualReport(e,t){this.emit(_.VISUAL_REPORT,{id:e,value:String(t)})}requestAddMonitor(e){const t=e.get("id");this.requestUpdateMonitor(e)||(this._monitorState=this._monitorState.set(t,e))}requestUpdateMonitor(e){const t=e.get("id");return!!this._monitorState.has(t)&&(this._monitorState=this._monitorState.set(t,this._monitorState.get(t).mergeWith(((e,t)=>null==t?e:t),e)),!0)}requestRemoveMonitor(e){this._monitorState=this._monitorState.delete(e)}requestHideMonitor(e){return this.requestUpdateMonitor(new Map([["id",e],["visible",!1]]))}requestShowMonitor(e){return this.requestUpdateMonitor(new Map([["id",e],["visible",!0]]))}requestRemoveMonitorByTargetId(e){this._monitorState=this._monitorState.filterNot((t=>t.targetId===e))}getTargetById(e){for(let t=0;te.id===t));if(!r)return;const i=r.blocks.find((e=>e.info.opcode===n));return i?{category:"extension",label:"".concat(r.name,": ").concat(i.info.text)}:void 0}createNewGlobalVariable(e,t,n){const r="string"==typeof n?n:x.SCALAR_TYPE,i=this.getAllVarNamesOfType(r),s=L.unusedName(e,i),o=new x(t||B(),s,r);return this.getTargetForStage().variables[o.id]=o,o}requestRedraw(){this.redrawRequested=!0}requestTargetsUpdate(e){e.isOriginal&&(this._refreshTargets=!0)}requestBlocksUpdate(){this.emit(_.BLOCKS_NEED_UPDATE)}requestToolboxExtensionsUpdate(){this.emit(_.TOOLBOX_EXTENSIONS_NEED_UPDATE)}start(){this.frameLoop.running||(this.frameLoop.start(),this.emit(_.RUNTIME_STARTED))}stop(){this.quit()}quit(){this.frameLoop.running&&(this.frameLoop.stop(),this.emit(_.RUNTIME_STOPPED))}enableProfiling(e){p.available()&&(this.profiler=new p(e))}disableProfiling(){this.profiler=null}updateCurrentMSecs(){this.currentMSecs=Date.now()}updatePrivacy(){const e=this.enforcePrivacy&&Object.values(this.externalCommunicationMethods).some((e=>e));this.renderer&&this.renderer.setPrivateSkinAccess&&this.renderer.setPrivateSkinAccess(!e)}setEnforcePrivacy(e){this.enforcePrivacy=e,this.updatePrivacy()}setExternalCommunicationMethod(e,t){if(!Object.prototype.hasOwnProperty.call(this.externalCommunicationMethods,e))throw new Error("Unknown method: ".concat(e));this.externalCommunicationMethods[e]=t,this.updatePrivacy()}emitAssetProgress(){this.emit(_.ASSET_PROGRESS,this.finishedAssetRequests,this.totalAssetRequests)}resetProgress(){this.finishedAssetRequests=0,this.totalAssetRequests=0,this.emitAssetProgress()}wrapAssetRequest(e){return this.totalAssetRequests++,this.emitAssetProgress(),e.then((e=>(this.finishedAssetRequests++,this.emitAssetProgress(),e))).catch((e=>{throw this.finishedAssetRequests++,this.emitAssetProgress(),e}))}}e.exports=_},function(e,t,n){"use strict";n.r(t),n.d(t,"_parse",(function(){return r})),n.d(t,"parse",(function(){return i})),n.d(t,"stringify",(function(){return s}));const r=e=>{let t=0;const n=n=>{const{line:r,column:i}=(()=>{let n=0,r=0;for(let i=0;i(t>=e.length&&n("Unexpected end of input"),e[t]),i=()=>r(t),s=()=>{t++},o=e=>{i()!==e&&n(`Expected '${e}' but found '${i()}'`),s()},a=(n=1,i=1)=>{if(t+i+n>e.length)return"";if(1===n)return r(t+i);let s="";for(let e=0;e{for(;;)if(/\s/.test(i()))s();else{const e=a(2,0);if("//"===e)for(s(),s();"\n"!==i();)s();else{if("/*"!==e)break;for(s(),s();"*/"!==a(2,0);)s();s(),s()}}},c=()=>{l();switch(i()){case'"':return h();case"{":return m();case"[":return p();case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":return d();default:return u()}},u=()=>{if("null"===a(4,0)){for(let e=0;e<4;e++)s();return null}if("true"===a(4,0)){for(let e=0;e<4;e++)s();return!0}if("false"===a(5,0)){for(let e=0;e<5;e++)s();return!1}if("Infinity"===a(8,0)){for(let e=0;e<8;e++)s();return 1/0}if("NaN"===a(3,0)){for(let e=0;e<3;e++)s();return NaN}n(`Unexpected character '${i()}'`)},d=()=>{if("-Infinity"===a(9,0)){for(let e=0;e<9;e++)s();return-1/0}let e="";for(;e+=i(),/[\d.e+-]/i.test(a());)s();s();const t=+e;return Number.isNaN(t)&&n(`Not a number: ${e}`),t},h=()=>{o('"');let e="";for(;;){const t=i();if('"'===t)break;if("\\"===t)switch(s(),i()){case'"':e+='"';break;case"/":e+="/";break;case"\\":e+="\\";break;case"b":e+="\b";break;case"f":e+="\f";break;case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"u":{let t="";for(let e=0;e<4;e++){s();const e=i();/[0-9a-f]/i.test(e)||n(`Invalid hex code: ${e}`),t+=e}const r=Number.parseInt(t,16);e+=String.fromCharCode(r);break}default:n(`Invalid escape code: \\${i()}`)}else e+=t;s()}return o('"'),e},p=()=>{o("["),l();const e=[];for(;l(),"]"!==i();){const t=c();if(e.push(t),l(),","!==i())break;s()}return o("]"),e},m=()=>{o("{"),l();const e={};for(;l(),"}"!==i();){const t=h();l(),o(":");const n=c();if(e[t]=n,l(),","!==i())break;s()}return o("}"),e};return c()},i=e=>{try{return JSON.parse(e)}catch(t){try{return r(e)}catch(e){throw t}}},s=e=>{if("string"==typeof e)return JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return e.toString();if(null==e||"symbol"==typeof e)return"null";if(Array.isArray(e))return`[${e.map((e=>s(e))).join(",")}]`;if("object"==typeof e){let t="{",n=!0;const r=Object.keys(e);for(let i=0;i("string"!=typeof e&&(r.warn("sanitize got unexpected type: ".concat(typeof e)),e=""+e),JSON.stringify(e).slice(1,-1)),h="runtime.ext_pen",p="".concat(h,"._getPenState(target)"),m=new o("factory"),f=new o("fun"),g=new o("gen");class y{constructor(e,t){if("number"!=typeof t)throw new Error("type is invalid");this.source=e,this.type=t}asNumber(){return 1===this.type?this.source:5===this.type?"(".concat(this.source," || 0)"):"(+".concat(this.source," || 0)")}asNumberOrNaN(){return 1===this.type||5===this.type?this.source:"(+".concat(this.source,")")}asString(){return 2===this.type?this.source:'("" + '.concat(this.source,")")}asBoolean(){return 3===this.type?this.source:"toBoolean(".concat(this.source,")")}asColor(){return this.asUnknown()}asUnknown(){return this.source}asSafe(){return this.asUnknown()}isAlwaysNumber(){return 1===this.type}isAlwaysNumberOrNaN(){return 1===this.type||5===this.type}isNeverNumber(){return!1}}class b{constructor(e,t){this.constantValue=e,this.safe=t}asNumber(){const e=+this.constantValue;return e?e.toString():Object.is(e,-0)?"-0":"0"}asNumberOrNaN(){return this.asNumber()}asString(){return'"'.concat(d(""+this.constantValue),'"')}asBoolean(){return i.toBoolean(this.constantValue).toString()}asColor(){if(/^#[0-9a-f]{6,8}$/i.test(this.constantValue)){const e=this.constantValue.substr(1);return Number.parseInt(e,16).toString()}return this.asUnknown()}asUnknown(){if("number"==typeof this.constantValue)return this.constantValue;return(+this.constantValue).toString()===this.constantValue?this.constantValue:this.asString()}asSafe(){return this.safe?this.asUnknown():this.asString()}isAlwaysNumber(){const e=+this.constantValue;return!Number.isNaN(e)&&(0!==e||""!==this.constantValue.toString().trim())}isAlwaysNumberOrNaN(){return this.isAlwaysNumber()}isNeverNumber(){return Number.isNaN(+this.constantValue)}}class v{constructor(e){this.source=e,this.type=4,this._value=null}setInput(e){if(e instanceof v){if(!e._value)return this.type=4,void(this._value=null);e=e._value}this._value=e,this.type=e instanceof y?e.type:4}asNumber(){return 1===this.type?this.source:5===this.type?"(".concat(this.source," || 0)"):"(+".concat(this.source," || 0)")}asNumberOrNaN(){return 1===this.type||5===this.type?this.source:"(+".concat(this.source,")")}asString(){return 2===this.type?this.source:'("" + '.concat(this.source,")")}asBoolean(){return 3===this.type?this.source:"toBoolean(".concat(this.source,")")}asColor(){return this.asUnknown()}asUnknown(){return this.source}asSafe(){return this.asUnknown()}isAlwaysNumber(){return!!this._value&&this._value.isAlwaysNumber()}isAlwaysNumberOrNaN(){return!!this._value&&this._value.isAlwaysNumberOrNaN()}isNeverNumber(){return!!this._value&&this._value.isNeverNumber()}}const S=e=>{const t=+e.constantValue;return!!t&&t.toString()===e.constantValue.toString()};class w{constructor(e){this.isLoop=e,this.isLastBlock=!1}}class k{constructor(e,t,n){this.script=e,this.ir=t,this.target=n,this.source="",this.variableInputs={},this.isWarp=e.isWarp,this.isProcedure=e.isProcedure,this.warpTimer=e.warpTimer,this.frames=[],this.currentFrame=null,this.namesOfCostumesAndSounds=(e=>{const t=new Set;for(const n of e.targets)if(n.isOriginal){const e=n.sprite;for(const n of e.costumes)t.add(n.name);for(const n of e.sounds)t.add(n.name)}return t})(n.runtime),this.localVariables=new o("a"),this._setupVariablesPool=new o("b"),this._setupVariables={},this.descendedIntoModulo=!1,this.isInHat=!1,this.debug=this.target.runtime.debug}pushFrame(e){this.frames.push(e),this.currentFrame=e}popFrame(){this.frames.pop(),this.currentFrame=this.frames[this.frames.length-1]}isLastBlockInLoop(){for(let e=this.frames.length-1;e>=0;e--){const t=this.frames[e];if(!t.isLastBlock)return!1;if(t.isLoop)return!0}return!1}descendInput(e){switch(e.kind){case"addons.call":return new y("(".concat(this.descendAddonCall(e),")"),4);case"args.boolean":return new y("toBoolean(p".concat(e.index,")"),3);case"args.stringNumber":return new y("p".concat(e.index),4);case"compat":return new y("(".concat(this.generateCompatibilityLayerCall(e,!1),")"),4);case"constant":return this.safeConstantInput(e.value);case"counter.get":return new y("runtime.ext_scratch3_control._counter",1);case"keyboard.pressed":return new y("runtime.ioDevices.keyboard.getKeyIsDown(".concat(this.descendInput(e.key).asSafe(),")"),3);case"list.contains":return new y("listContains(".concat(this.referenceVariable(e.list),", ").concat(this.descendInput(e.item).asUnknown(),")"),3);case"list.contents":return new y("listContents(".concat(this.referenceVariable(e.list),")"),2);case"list.get":{const t=this.descendInput(e.index);if(l.supportsNullishCoalescing){if(t.isAlwaysNumberOrNaN())return new y("(".concat(this.referenceVariable(e.list),".value[(").concat(t.asNumber(),' | 0) - 1] ?? "")'),4);if(t instanceof b&&"last"===t.constantValue)return new y("(".concat(this.referenceVariable(e.list),".value[").concat(this.referenceVariable(e.list),'.value.length - 1] ?? "")'),4)}return new y("listGet(".concat(this.referenceVariable(e.list),".value, ").concat(t.asUnknown(),")"),4)}case"list.indexOf":return new y("listIndexOf(".concat(this.referenceVariable(e.list),", ").concat(this.descendInput(e.item).asUnknown(),")"),1);case"list.length":return new y("".concat(this.referenceVariable(e.list),".value.length"),1);case"looks.size":return new y("Math.round(target.size)",1);case"looks.backdropName":return new y("stage.getCostumes()[stage.currentCostume].name",2);case"looks.backdropNumber":return new y("(stage.currentCostume + 1)",1);case"looks.costumeName":return new y("target.getCostumes()[target.currentCostume].name",2);case"looks.costumeNumber":return new y("(target.currentCostume + 1)",1);case"motion.direction":return new y("target.direction",1);case"motion.x":return new y("limitPrecision(target.x)",1);case"motion.y":return new y("limitPrecision(target.y)",1);case"mouse.down":return new y("runtime.ioDevices.mouse.getIsDown()",3);case"mouse.x":return new y("runtime.ioDevices.mouse.getScratchX()",1);case"mouse.y":return new y("runtime.ioDevices.mouse.getScratchY()",1);case"noop":return new y('""',2);case"op.abs":return new y("Math.abs(".concat(this.descendInput(e.value).asNumber(),")"),1);case"op.acos":return new y("((Math.acos(".concat(this.descendInput(e.value).asNumber(),") * 180) / Math.PI)"),5);case"op.add":return new y("(".concat(this.descendInput(e.left).asNumber()," + ").concat(this.descendInput(e.right).asNumber(),")"),5);case"op.and":return new y("(".concat(this.descendInput(e.left).asBoolean()," && ").concat(this.descendInput(e.right).asBoolean(),")"),3);case"op.asin":return new y("((Math.asin(".concat(this.descendInput(e.value).asNumber(),") * 180) / Math.PI)"),5);case"op.atan":return new y("((Math.atan(".concat(this.descendInput(e.value).asNumber(),") * 180) / Math.PI)"),1);case"op.ceiling":return new y("Math.ceil(".concat(this.descendInput(e.value).asNumber(),")"),1);case"op.contains":return new y("(".concat(this.descendInput(e.string).asString(),".toLowerCase().indexOf(").concat(this.descendInput(e.contains).asString(),".toLowerCase()) !== -1)"),3);case"op.cos":return new y("(Math.round(Math.cos((Math.PI * ".concat(this.descendInput(e.value).asNumber(),") / 180) * 1e10) / 1e10)"),5);case"op.divide":return new y("(".concat(this.descendInput(e.left).asNumber()," / ").concat(this.descendInput(e.right).asNumber(),")"),5);case"op.equals":{const t=this.descendInput(e.left),n=this.descendInput(e.right);if(t.isNeverNumber()||n.isNeverNumber())return new y("(".concat(t.asString(),".toLowerCase() === ").concat(n.asString(),".toLowerCase())"),3);const r=t.isAlwaysNumber(),i=n.isAlwaysNumber();return r&&i||(r&&t instanceof b&&S(t)||i&&n instanceof b&&S(n))?new y("(".concat(t.asNumber()," === ").concat(n.asNumber(),")"),3):new y("compareEqual(".concat(t.asUnknown(),", ").concat(n.asUnknown(),")"),3)}case"op.e^":return new y("Math.exp(".concat(this.descendInput(e.value).asNumber(),")"),1);case"op.floor":return new y("Math.floor(".concat(this.descendInput(e.value).asNumber(),")"),1);case"op.greater":{const t=this.descendInput(e.left),n=this.descendInput(e.right);return t.isAlwaysNumber()&&n.isAlwaysNumberOrNaN()?new y("(".concat(t.asNumber()," > ").concat(n.asNumberOrNaN(),")"),3):t.isAlwaysNumberOrNaN()&&n.isAlwaysNumber()?new y("!(".concat(t.asNumberOrNaN()," <= ").concat(n.asNumber(),")"),3):t.isNeverNumber()||n.isNeverNumber()?new y("(".concat(t.asString(),".toLowerCase() > ").concat(n.asString(),".toLowerCase())"),3):new y("compareGreaterThan(".concat(t.asUnknown(),", ").concat(n.asUnknown(),")"),3)}case"op.join":return new y("(".concat(this.descendInput(e.left).asString()," + ").concat(this.descendInput(e.right).asString(),")"),2);case"op.length":return new y("".concat(this.descendInput(e.string).asString(),".length"),1);case"op.less":{const t=this.descendInput(e.left),n=this.descendInput(e.right);return t.isAlwaysNumberOrNaN()&&n.isAlwaysNumber()?new y("(".concat(t.asNumberOrNaN()," < ").concat(n.asNumber(),")"),3):t.isAlwaysNumber()&&n.isAlwaysNumberOrNaN()?new y("!(".concat(t.asNumber()," >= ").concat(n.asNumberOrNaN(),")"),3):t.isNeverNumber()||n.isNeverNumber()?new y("(".concat(t.asString(),".toLowerCase() < ").concat(n.asString(),".toLowerCase())"),3):new y("compareLessThan(".concat(t.asUnknown(),", ").concat(n.asUnknown(),")"),3)}case"op.letterOf":return new y("((".concat(this.descendInput(e.string).asString(),")[(").concat(this.descendInput(e.letter).asNumber(),' | 0) - 1] || "")'),2);case"op.ln":return new y("Math.log(".concat(this.descendInput(e.value).asNumber(),")"),5);case"op.log":return new y("(Math.log(".concat(this.descendInput(e.value).asNumber(),") / Math.LN10)"),5);case"op.mod":return this.descendedIntoModulo=!0,new y("mod(".concat(this.descendInput(e.left).asNumber(),", ").concat(this.descendInput(e.right).asNumber(),")"),5);case"op.multiply":return new y("(".concat(this.descendInput(e.left).asNumber()," * ").concat(this.descendInput(e.right).asNumber(),")"),5);case"op.not":return new y("!".concat(this.descendInput(e.operand).asBoolean()),3);case"op.or":return new y("(".concat(this.descendInput(e.left).asBoolean()," || ").concat(this.descendInput(e.right).asBoolean(),")"),3);case"op.random":return e.useInts?new y("randomInt(".concat(this.descendInput(e.low).asNumber(),", ").concat(this.descendInput(e.high).asNumber(),")"),1):e.useFloats?new y("randomFloat(".concat(this.descendInput(e.low).asNumber(),", ").concat(this.descendInput(e.high).asNumber(),")"),5):new y("runtime.ext_scratch3_operators._random(".concat(this.descendInput(e.low).asUnknown(),", ").concat(this.descendInput(e.high).asUnknown(),")"),5);case"op.round":return new y("Math.round(".concat(this.descendInput(e.value).asNumber(),")"),1);case"op.sin":return new y("(Math.round(Math.sin((Math.PI * ".concat(this.descendInput(e.value).asNumber(),") / 180) * 1e10) / 1e10)"),5);case"op.sqrt":return new y("Math.sqrt(".concat(this.descendInput(e.value).asNumber(),")"),5);case"op.subtract":return new y("(".concat(this.descendInput(e.left).asNumber()," - ").concat(this.descendInput(e.right).asNumber(),")"),5);case"op.tan":return new y("tan(".concat(this.descendInput(e.value).asNumber(),")"),5);case"op.10^":return new y("(10 ** ".concat(this.descendInput(e.value).asNumber(),")"),1);case"procedures.call":{const t=e.code,n=e.variant,r=this.ir.procedures[n];if(null===r.stack)return new y('""',2);const i='thread.procedures["'.concat(d(n),'"]'),s=[];for(const t of e.arguments)s.push(this.descendInput(t).asSafe());const o=s.join(","),a=!this.isWarp&&t===this.script.procedureCode,l=this.isInHat;if(a||l){const e=r.yields?"yieldThenCallGenerator":"yieldThenCall";return new y("(yield* ".concat(e,"(").concat(i,", ").concat(o,"))"),4)}return r.yields?new y("(yield* ".concat(i,"(").concat(o,"))"),4):new y("".concat(i,"(").concat(o,")"),4)}case"sensing.answer":return new y("runtime.ext_scratch3_sensing._answer",2);case"sensing.colorTouchingColor":return new y("target.colorIsTouchingColor(colorToList(".concat(this.descendInput(e.target).asColor(),"), colorToList(").concat(this.descendInput(e.mask).asColor(),"))"),3);case"sensing.date":return new y("(new Date().getDate())",1);case"sensing.dayofweek":return new y("(new Date().getDay() + 1)",1);case"sensing.daysSince2000":return new y("daysSince2000()",1);case"sensing.distance":return new y("distance(".concat(this.descendInput(e.target).asString(),")"),1);case"sensing.hour":return new y("(new Date().getHours())",1);case"sensing.minute":return new y("(new Date().getMinutes())",1);case"sensing.month":return new y("(new Date().getMonth() + 1)",1);case"sensing.of":{const t=this.descendInput(e.object).asString(),n=e.property;if("constant"===e.object.kind){const r="_stage_"===e.object.value,i=r?"stage":this.evaluateOnce("runtime.getSpriteTargetByName(".concat(t,")"));if("volume"===n)return new y("(".concat(i," ? ").concat(i,".volume : 0)"),1);if(r)switch(n){case"background #":case"backdrop #":return new y("(".concat(i,".currentCostume + 1)"),1);case"backdrop name":return new y("".concat(i,".getCostumes()[").concat(i,".currentCostume].name"),2)}else switch(n){case"x position":return new y("(".concat(i," ? ").concat(i,".x : 0)"),1);case"y position":return new y("(".concat(i," ? ").concat(i,".y : 0)"),1);case"direction":return new y("(".concat(i," ? ").concat(i,".direction : 0)"),1);case"costume #":return new y("(".concat(i," ? ").concat(i,".currentCostume + 1 : 0)"),1);case"costume name":return new y("(".concat(i," ? ").concat(i,".getCostumes()[").concat(i,".currentCostume].name : 0)"),4);case"size":return new y("(".concat(i," ? ").concat(i,".size : 0)"),1)}const s=this.evaluateOnce("".concat(i," && ").concat(i,'.lookupVariableByNameAndType("').concat(d(n),'", "", true)'));return new y("(".concat(s," ? ").concat(s,".value : 0)"),4)}return new y("runtime.ext_scratch3_sensing.getAttributeOf({OBJECT: ".concat(t,', PROPERTY: "').concat(d(n),'" })'),4)}case"sensing.second":return new y("(new Date().getSeconds())",1);case"sensing.touching":return new y("target.isTouchingObject(".concat(this.descendInput(e.object).asUnknown(),")"),3);case"sensing.touchingColor":return new y("target.isTouchingColor(colorToList(".concat(this.descendInput(e.color).asColor(),"))"),3);case"sensing.username":return new y("runtime.ioDevices.userData.getUsername()",2);case"sensing.year":return new y("(new Date().getFullYear())",1);case"timer.get":return new y("runtime.ioDevices.clock.projectTimer()",1);case"tw.lastKeyPressed":return new y("runtime.ioDevices.keyboard.getLastKeyPressed()",2);case"var.get":return this.descendVariable(e.variable);default:throw r.warn("JS: Unknown input: ".concat(e.kind),e),new Error("JS: Unknown input: ".concat(e.kind))}}descendStackedBlock(e){switch(e.kind){case"addons.call":this.source+="".concat(this.descendAddonCall(e),";\n");break;case"compat":{const t=this.isLastBlockInLoop(),n=e.blockType;if(n===s.COMMAND||n===s.HAT)this.source+="".concat(this.generateCompatibilityLayerCall(e,t),";\n");else{if(n!==s.CONDITIONAL&&n!==s.LOOP)throw new Error("Unknown block type: ".concat(n));{const t=this.localVariables.next();this.source+="const ".concat(t," = createBranchInfo(").concat(n===s.LOOP,");\n"),this.source+="while (".concat(t,".branch = +(").concat(this.generateCompatibilityLayerCall(e,!1,t),")) {\n"),this.source+="switch (".concat(t,".branch) {\n");for(const t in e.substacks)this.source+="case ".concat(+t,": {\n"),this.descendStack(e.substacks[t],new w(!1)),this.source+="break;\n",this.source+="}\n";this.source+="}\n",this.source+="if (!".concat(t,".isLoop) break;\n"),this.yieldLoop(),this.source+="}\n"}}t&&(this.source+="if (hasResumedFromPromise) {hasResumedFromPromise = false;continue;}\n");break}case"control.createClone":this.source+="runtime.ext_scratch3_control._createClone(".concat(this.descendInput(e.target).asString(),", target);\n");break;case"control.deleteClone":this.source+="if (!target.isOriginal) {\n",this.source+=" runtime.disposeTarget(target);\n",this.source+=" runtime.stopForTarget(target);\n",this.retire(),this.source+="}\n";break;case"control.for":{this.resetVariableInputs();const t=this.localVariables.next();this.source+="var ".concat(t," = 0; "),this.source+="while (".concat(t," < ").concat(this.descendInput(e.count).asNumber(),") { "),this.source+="".concat(t,"++; "),this.source+="".concat(this.referenceVariable(e.variable),".value = ").concat(t,";\n"),this.descendStack(e.do,new w(!0)),this.yieldLoop(),this.source+="}\n";break}case"control.if":this.source+="if (".concat(this.descendInput(e.condition).asBoolean(),") {\n"),this.descendStack(e.whenTrue,new w(!1)),e.whenFalse.length&&(this.source+="} else {\n",this.descendStack(e.whenFalse,new w(!1))),this.source+="}\n";break;case"control.repeat":{const t=this.localVariables.next();this.source+="for (var ".concat(t," = ").concat(this.descendInput(e.times).asNumber(),"; ").concat(t," >= 0.5; ").concat(t,"--) {\n"),this.descendStack(e.do,new w(!0)),this.yieldLoop(),this.source+="}\n";break}case"control.stopAll":this.source+="runtime.stopAll();\n",this.retire();break;case"control.stopOthers":this.source+="runtime.stopForTarget(target, thread);\n";break;case"control.stopScript":this.stopScript();break;case"control.wait":{const t=this.localVariables.next();this.source+="thread.timer = timer();\n",this.source+="var ".concat(t," = Math.max(0, 1000 * ").concat(this.descendInput(e.seconds).asNumber(),");\n"),this.requestRedraw(),this.yieldNotWarp(),this.source+="while (thread.timer.timeElapsed() < ".concat(t,") {\n"),this.yieldStuckOrNotWarp(),this.source+="}\n",this.source+="thread.timer = null;\n";break}case"control.waitUntil":this.resetVariableInputs(),this.source+="while (!".concat(this.descendInput(e.condition).asBoolean(),") {\n"),this.yieldStuckOrNotWarp(),this.source+="}\n";break;case"control.while":this.resetVariableInputs(),this.source+="while (".concat(this.descendInput(e.condition).asBoolean(),") {\n"),this.descendStack(e.do,new w(!0)),e.warpTimer?this.yieldStuckOrNotWarp():this.yieldLoop(),this.source+="}\n";break;case"counter.clear":this.source+="runtime.ext_scratch3_control._counter = 0;\n";break;case"counter.increment":this.source+="runtime.ext_scratch3_control._counter++;\n";break;case"hat.edge":this.isInHat=!0,this.source+="{\n",this.source+="const resolvedValue = ".concat(this.descendInput(e.condition).asBoolean(),";\n"),this.source+='const id = "'.concat(d(e.id),'";\n'),this.source+="const hasOldEdgeValue = target.hasEdgeActivatedValue(id);\n",this.source+="const oldEdgeValue = target.updateEdgeActivatedValue(id, resolvedValue);\n",this.source+="const edgeWasActivated = hasOldEdgeValue ? (!oldEdgeValue && resolvedValue) : resolvedValue;\n",this.source+="if (!edgeWasActivated) {\n",this.retire(),this.source+="}\n",this.source+="yield;\n",this.source+="}\n",this.isInHat=!1;break;case"hat.predicate":this.isInHat=!0,this.source+="if (!".concat(this.descendInput(e.condition).asBoolean(),") {\n"),this.retire(),this.source+="}\n",this.source+="yield;\n",this.isInHat=!1;break;case"event.broadcast":this.source+='startHats("event_whenbroadcastreceived", { BROADCAST_OPTION: '.concat(this.descendInput(e.broadcast).asString()," });\n"),this.resetVariableInputs();break;case"event.broadcastAndWait":this.source+='yield* waitThreads(startHats("event_whenbroadcastreceived", { BROADCAST_OPTION: '.concat(this.descendInput(e.broadcast).asString()," }));\n"),this.yielded();break;case"list.add":{const t=this.referenceVariable(e.list);this.source+="".concat(t,".value.push(").concat(this.descendInput(e.item).asSafe(),");\n"),this.source+="".concat(t,"._monitorUpToDate = false;\n");break}case"list.delete":{const t=this.referenceVariable(e.list),n=this.descendInput(e.index);if(n instanceof b){if("last"===n.constantValue){this.source+="".concat(t,".value.pop();\n"),this.source+="".concat(t,"._monitorUpToDate = false;\n");break}if(1==+n.constantValue){this.source+="".concat(t,".value.shift();\n"),this.source+="".concat(t,"._monitorUpToDate = false;\n");break}}this.source+="listDelete(".concat(t,", ").concat(n.asUnknown(),");\n");break}case"list.deleteAll":this.source+="".concat(this.referenceVariable(e.list),".value = [];\n");break;case"list.hide":this.source+='runtime.monitorBlocks.changeBlock({ id: "'.concat(d(e.list.id),'", element: "checkbox", value: false }, runtime);\n');break;case"list.insert":{const t=this.referenceVariable(e.list),n=this.descendInput(e.index),r=this.descendInput(e.item);if(n instanceof b&&1==+n.constantValue){this.source+="".concat(t,".value.unshift(").concat(r.asSafe(),");\n"),this.source+="".concat(t,"._monitorUpToDate = false;\n");break}this.source+="listInsert(".concat(t,", ").concat(n.asUnknown(),", ").concat(r.asSafe(),");\n");break}case"list.replace":this.source+="listReplace(".concat(this.referenceVariable(e.list),", ").concat(this.descendInput(e.index).asUnknown(),", ").concat(this.descendInput(e.item).asSafe(),");\n");break;case"list.show":this.source+='runtime.monitorBlocks.changeBlock({ id: "'.concat(d(e.list.id),'", element: "checkbox", value: true }, runtime);\n');break;case"looks.backwardLayers":this.target.isStage||(this.source+="target.goBackwardLayers(".concat(this.descendInput(e.layers).asNumber(),");\n"));break;case"looks.clearEffects":this.source+="target.clearEffects();\n";break;case"looks.changeEffect":Object.prototype.hasOwnProperty.call(this.target.effects,e.effect)&&(this.source+='target.setEffect("'.concat(d(e.effect),'", runtime.ext_scratch3_looks.clampEffect("').concat(d(e.effect),'", ').concat(this.descendInput(e.value).asNumber(),' + target.effects["').concat(d(e.effect),'"]));\n'));break;case"looks.changeSize":this.source+="target.setSize(target.size + ".concat(this.descendInput(e.size).asNumber(),");\n");break;case"looks.forwardLayers":this.target.isStage||(this.source+="target.goForwardLayers(".concat(this.descendInput(e.layers).asNumber(),");\n"));break;case"looks.goToBack":this.target.isStage||(this.source+="target.goToBack();\n");break;case"looks.goToFront":this.target.isStage||(this.source+="target.goToFront();\n");break;case"looks.hide":this.source+="target.setVisible(false);\n",this.source+="runtime.ext_scratch3_looks._renderBubble(target);\n";break;case"looks.nextBackdrop":this.source+="runtime.ext_scratch3_looks._setBackdrop(stage, stage.currentCostume + 1, true);\n";break;case"looks.nextCostume":this.source+="target.setCostume(target.currentCostume + 1);\n";break;case"looks.setEffect":Object.prototype.hasOwnProperty.call(this.target.effects,e.effect)&&(this.source+='target.setEffect("'.concat(d(e.effect),'", runtime.ext_scratch3_looks.clampEffect("').concat(d(e.effect),'", ').concat(this.descendInput(e.value).asNumber(),"));\n"));break;case"looks.setSize":this.source+="target.setSize(".concat(this.descendInput(e.size).asNumber(),");\n");break;case"looks.show":this.source+="target.setVisible(true);\n",this.source+="runtime.ext_scratch3_looks._renderBubble(target);\n";break;case"looks.switchBackdrop":this.source+="runtime.ext_scratch3_looks._setBackdrop(stage, ".concat(this.descendInput(e.backdrop).asSafe(),");\n");break;case"looks.switchCostume":this.source+="runtime.ext_scratch3_looks._setCostume(target, ".concat(this.descendInput(e.costume).asSafe(),");\n");break;case"motion.changeX":this.source+="target.setXY(target.x + ".concat(this.descendInput(e.dx).asNumber(),", target.y);\n");break;case"motion.changeY":this.source+="target.setXY(target.x, target.y + ".concat(this.descendInput(e.dy).asNumber(),");\n");break;case"motion.ifOnEdgeBounce":this.source+="runtime.ext_scratch3_motion._ifOnEdgeBounce(target);\n";break;case"motion.setDirection":this.source+="target.setDirection(".concat(this.descendInput(e.direction).asNumber(),");\n");break;case"motion.setRotationStyle":this.source+='target.setRotationStyle("'.concat(d(e.style),'");\n');break;case"motion.setX":case"motion.setY":case"motion.setXY":{this.descendedIntoModulo=!1;const t="x"in e?this.descendInput(e.x).asNumber():"target.x",n="y"in e?this.descendInput(e.y).asNumber():"target.y";this.source+="target.setXY(".concat(t,", ").concat(n,");\n"),this.descendedIntoModulo&&(this.source+="if (target.interpolationData) target.interpolationData = null;\n");break}case"motion.step":this.source+="runtime.ext_scratch3_motion._moveSteps(".concat(this.descendInput(e.steps).asNumber(),", target);\n");break;case"noop":break;case"pen.clear":this.source+="".concat(h,".clear();\n");break;case"pen.down":this.source+="".concat(h,"._penDown(target);\n");break;case"pen.changeParam":this.source+="".concat(h,"._setOrChangeColorParam(").concat(this.descendInput(e.param).asString(),", ").concat(this.descendInput(e.value).asNumber(),", ").concat(p,", true);\n");break;case"pen.changeSize":this.source+="".concat(h,"._changePenSizeBy(").concat(this.descendInput(e.size).asNumber(),", target);\n");break;case"pen.legacyChangeHue":this.source+="".concat(h,"._changePenHueBy(").concat(this.descendInput(e.hue).asNumber(),", target);\n");break;case"pen.legacyChangeShade":this.source+="".concat(h,"._changePenShadeBy(").concat(this.descendInput(e.shade).asNumber(),", target);\n");break;case"pen.legacySetHue":this.source+="".concat(h,"._setPenHueToNumber(").concat(this.descendInput(e.hue).asNumber(),", target);\n");break;case"pen.legacySetShade":this.source+="".concat(h,"._setPenShadeToNumber(").concat(this.descendInput(e.shade).asNumber(),", target);\n");break;case"pen.setColor":this.source+="".concat(h,"._setPenColorToColor(").concat(this.descendInput(e.color).asColor(),", target);\n");break;case"pen.setParam":this.source+="".concat(h,"._setOrChangeColorParam(").concat(this.descendInput(e.param).asString(),", ").concat(this.descendInput(e.value).asNumber(),", ").concat(p,", false);\n");break;case"pen.setSize":this.source+="".concat(h,"._setPenSizeTo(").concat(this.descendInput(e.size).asNumber(),", target);\n");break;case"pen.stamp":this.source+="".concat(h,"._stamp(target);\n");break;case"pen.up":this.source+="".concat(h,"._penUp(target);\n");break;case"procedures.call":{const t=e.code,n=e.variant,r=this.ir.procedures[n];if(null===r.stack)break;!this.isWarp&&t===this.script.procedureCode&&this.yieldNotWarp(),r.yields&&(this.source+="yield* "),this.source+='thread.procedures["'.concat(d(n),'"](');const i=[];for(const t of e.arguments)i.push(this.descendInput(t).asSafe());this.source+=i.join(","),this.source+=");\n",this.resetVariableInputs();break}case"procedures.return":this.stopScriptAndReturn(this.descendInput(e.value).asSafe());break;case"timer.reset":this.source+="runtime.ioDevices.clock.resetProjectTimer();\n";break;case"tw.debugger":this.source+="debugger;\n";break;case"var.hide":this.source+='runtime.monitorBlocks.changeBlock({ id: "'.concat(d(e.variable.id),'", element: "checkbox", value: false }, runtime);\n');break;case"var.set":{const t=this.descendVariable(e.variable),n=this.descendInput(e.value);t.setInput(n),this.source+="".concat(t.source," = ").concat(n.asSafe(),";\n"),e.variable.isCloud&&(this.source+='runtime.ioDevices.cloud.requestUpdateVariable("'.concat(d(e.variable.name),'", ').concat(t.source,");\n"));break}case"var.show":this.source+='runtime.monitorBlocks.changeBlock({ id: "'.concat(d(e.variable.id),'", element: "checkbox", value: true }, runtime);\n');break;case"visualReport":{const t=this.localVariables.next();this.source+="const ".concat(t," = ").concat(this.descendInput(e.input).asUnknown(),";"),this.source+="if (".concat(t,' !== undefined) runtime.visualReport("').concat(d(this.script.topBlockId),'", ').concat(t,");\n");break}default:throw r.warn("JS: Unknown stacked block: ".concat(e.kind),e),new Error("JS: Unknown stacked block: ".concat(e.kind))}}descendInputRecord(e){let t="{";for(const n of Object.keys(e)){const r=e[n];t+='"'.concat(d(n),'":').concat(this.descendInput(r).asSafe(),",")}return t+="}",t}resetVariableInputs(){this.variableInputs={}}descendStack(e,t){this.resetVariableInputs(),this.pushFrame(t);for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:null;const r=e.opcode;let i="yield* executeInCompatibilityLayer({";for(const t of Object.keys(e.inputs)){const n=e.inputs[t],r=this.descendInput(n).asSafe();i+='"'.concat(d(t),'":').concat(r,",")}for(const t of Object.keys(e.fields)){const n=e.fields[t];i+='"'.concat(d(t),'":"').concat(d(n),'",')}const s=this.evaluateOnce('runtime.getOpcodeFunction("'.concat(d(r),'")'));return i+="}, ".concat(s,", ").concat(this.isWarp,", ").concat(t,', "').concat(d(e.id),'", ').concat(n,")"),i}getScriptFactoryName(){return m.next()}getScriptName(e){let t=e?g.next():f.next();if(this.isProcedure){const e=this.script.procedureCode.replace(/%[\w]/g,"").replace(/[^a-zA-Z0-9]/g,"_").substring(0,20);t+="_".concat(e)}return t}createScriptFactory(){let e="";e+="(function ".concat(this.getScriptFactoryName(),"(thread) { "),e+="const target = thread.target; ",e+="const runtime = target.runtime; ",e+="const stage = runtime.getTargetForStage();\n";for(const t of Object.keys(this._setupVariables)){const n=this._setupVariables[t];e+="const ".concat(n," = ").concat(t,";\n")}if(e+="return ",this.script.yields?e+="function* ":e+="function ",e+=this.getScriptName(this.script.yields),e+=" (",this.script.arguments.length){const t=[];for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.sequencer=e,this.thread=t,this._nowObj={now:()=>this.sequencer.runtime.currentMSecs}}get target(){return this.thread.target}get runtime(){return this.sequencer.runtime}get nowObj(){return this.runtime?this._nowObj:null}get stackFrame(){const e=this.thread.peekStackFrame();return null===e.executionContext&&(e.executionContext={}),e.executionContext}stackTimerFinished(){return!(this.stackFrame.timer.timeElapsed(){n.status===o.STATUS_RUNNING&&(n.status=o.STATUS_PROMISE_WAIT),e.then((e=>{if(d(e,t,n,r,i),i&&(!r._isHat||n.stackClick)){let e,t;do{const r=n.popStack();if(null===r)return;if(t=n.target.blocks.getNextBlock(r),null!==t)break;e=n.peekStackFrame()}while(null!==e&&!e.isLoop);n.pushStack(t)}}),(e=>{s.warn("Primitive rejected promise: ",e),n.status=o.STATUS_RUNNING,n.popStack()}))};class p{constructor(e,t){this.id=t.id,this.opcode=t.opcode,this.fields=t.fields,this.inputs=t.inputs,this.mutation=t.mutation,this._profiler=null,this._profilerFrame=null,this._isHat=!1,this._blockFunction=null,this._definedBlockFunction=!1,this._isShadowBlock=!1,this._shadowValue=null,this._fields=Object.assign({},this.fields),this._inputs=Object.assign({},this.inputs),this._argValues={mutation:this.mutation},this._parentKey=null,this._parentValues=null,this._ops=[];const{runtime:n}=c.sequencer,{opcode:r,fields:s,inputs:o}=this;this._isHat=n.getIsHat(r),this._blockFunction=n.getOpcodeFunction(r),this._definedBlockFunction=void 0!==this._blockFunction;const a=n._flowing[r];this._isConditional=!(!a||!a.conditional),this._isLoop=!(!a||!a.loop);const l=Object.keys(s);this._isShadowBlock=!this._definedBlockFunction&&1===l.length&&0===Object.keys(o).length,this._shadowValue=this._isShadowBlock&&s[l[0]].value;for(const e in s)this._argValues[e]="VARIABLE"===e||"LIST"===e||"BROADCAST_OPTION"===e?{id:s[e].id,name:s[e].value}:s[e].value;if(delete this._inputs.custom_block,"BROADCAST_INPUT"in this._inputs){this._argValues.BROADCAST_OPTION={id:null,name:null};const t=this._inputs.BROADCAST_INPUT;if(t.block===t.shadow){const n=e.getBlock(t.shadow).fields.BROADCAST_OPTION;this._argValues.BROADCAST_OPTION.id=n.id,this._argValues.BROADCAST_OPTION.name=n.value,delete this._inputs.BROADCAST_INPUT}}for(const t in this._inputs){const n=this._inputs[t];if(n.block){const r=i.getCached(e,n.block,p);if(r._isHat)continue;this._ops.push(...r._ops),r._parentKey=t,r._parentValues=this._argValues,r._isShadowBlock&&(this._argValues[t]=r._shadowValue)}}this._definedBlockFunction&&this._ops.push(this)}}e.exports=function(e,t){const n=e.runtime;c.sequencer=e,c.thread=t;const r=t.peekStack(),s=t.peekStackFrame();let a=t.blockContainer,m=i.getCached(a,r,p);if(null===m&&(a=n.flyoutBlocks,m=i.getCached(a,r,p),null===m))return void e.retireThread(t);const f=m._ops,g=f.length;let y=0;if(null!==s.reported){const e=s.reported;for(;ye.id===t));if(r){const e=r._parentKey,t=r._parentValues;"BROADCAST_INPUT"===e?(t.BROADCAST_OPTION.id=null,t.BROADCAST_OPTION.name=l.toString(n)):t[e]=n}}if(e.length>0){const t=e.reverse().find((e=>f.find((t=>t.id===e.opCached))));y=t?f.findIndex((e=>e.id===t.opCached))+1:0}if(null!==t.justReported&&f[y]&&f[y].id===s.reporting){const e=f[y],n=t.justReported;t.justReported=null;const r=e._parentKey,i=e._parentValues;"BROADCAST_INPUT"===r?(i.BROADCAST_OPTION.id=null,i.BROADCAST_OPTION.name=l.toString(n)):i[r]=n,y+=1}s.reporting=null,s.reported=null,s.waitingReporter=!1}const b=y;for(;y{const t=e._parentKey,n=e._parentValues;return"BROADCAST_INPUT"===t?{opCached:e.id,inputValue:n[t].BROADCAST_OPTION.name}:{opCached:e.id,inputValue:n[t]}}));break}if(t.status===o.STATUS_RUNNING)if(n)d(p,e,t,r,n);else{const e=r._parentKey,t=r._parentValues;"BROADCAST_INPUT"===e?(t.BROADCAST_OPTION.id=null,t.BROADCAST_OPTION.name=l.toString(p)):t[e]=p}}var v;if(null!==n.profiler){m._profiler!==n.profiler&&function(e,t){t._profiler=e,-1===u&&(u=e.idByName("blockFunction"));const n=t._ops;for(let t=0;tthis._setupPreview())):null}disableVideo(){if(this._disablePreview(),!this.provider)return null;this.provider.disableVideo()}getFrame(e){let{dimensions:t=i.DIMENSIONS,mirror:n=this.mirror,format:r=i.FORMAT_IMAGE_DATA,cacheTimeout:s=this._frameCacheTimeout}=e;return this.provider?this.provider.getFrame({dimensions:t,mirror:n,format:r,cacheTimeout:s}):null}setPreviewGhost(e){this._ghost=e,-1!==this._drawable&&this.runtime.renderer.updateDrawableEffect(this._drawable,"ghost",this._forceTransparentPreview?100:e)}_disablePreview(){-1!==this._skinId&&(this.runtime.renderer.updateBitmapSkin(this._skinId,new ImageData(...i.DIMENSIONS),1),this.runtime.renderer.updateDrawableVisible(this._drawable,!1)),this._renderPreviewFrame=null}_setupPreview(){const{renderer:e}=this.runtime;e&&(-1===this._skinId&&-1===this._drawable&&(this._skinId=e.createBitmapSkin(new ImageData(...i.DIMENSIONS),1),this._drawable=e.createDrawable(r.VIDEO_LAYER),e.updateDrawableSkinId(this._drawable,this._skinId),e.markSkinAsPrivate&&e.markSkinAsPrivate(this._skinId)),this._renderPreviewFrame||(e.updateDrawableEffect(this._drawable,"ghost",this._forceTransparentPreview?100:this._ghost),e.updateDrawableVisible(this._drawable,!0),this._renderPreviewFrame=()=>{if(clearTimeout(this._renderPreviewTimeout),!this._renderPreviewFrame)return;this._renderPreviewTimeout=setTimeout(this._renderPreviewFrame,this.runtime.currentStepTime);const t=this.getFrame({format:i.FORMAT_IMAGE_DATA,cacheTimeout:this.runtime.currentStepTime});t?(e.updateBitmapSkin(this._skinId,t,1),this.runtime.requestRedraw()):e.updateBitmapSkin(this._skinId,new ImageData(...i.DIMENSIONS),1)},this._renderPreviewFrame()))}get videoReady(){return!!this.provider&&this.provider.videoReady}postData(e){let{forceTransparentPreview:t}=e;this._forceTransparentPreview=t,this.setPreviewGhost(this._ghost)}}e.exports=i},function(e,t){e.exports={generateExtensionId:e=>{const t=e.replace(/[^a-z0-9]/gi,"").toLowerCase();return"sbx".concat(t)},argumentIndexToId:e=>e.toString()}},function(e,t){e.exports=class{constructor(e,t){this.callback=e,this.maxConcurrent=t,this._current=0,this._queue=[]}do(){for(var e=arguments.length,t=new Array(e),n=0;n{this._queue.push([e,n,t]),this._startNext()}))}_startNext(){if(this._current>=this.maxConcurrent||0===this._queue.length)return;this._current++;const[e,t,n]=this._queue.shift();this.callback.apply(null,n).then((t=>{e(t),this._current--,this._startNext()})).catch((e=>{t(e),this._current--,this._startNext()}))}}},function(e,t){class n{static _mergeVarRefObjects(e,t){for(const n in t)e[n]?e[n]=e[n].concat(t[n]):e[n]=t[n];return e}static getAllVarRefsForTargets(e,t){return e.map((e=>e.blocks.getAllVariableAndListReferences(null,t))).reduce(n._mergeVarRefObjects,{})}static updateVariableIdentifiers(e,t,n){e.map((e=>(e.referencingField.id=t,n&&(e.referencingField.value=n),e)))}}e.exports=n},function(e,t,n){const r=n(86),i=n(53),s=n(87),o=n(88),a=n(255),l=(e,t)=>{const n=[],r=e=>{e.localName!==t&&void 0!==t||!e.getAttribute||n.push(e);for(let t=0;t{const t=document.createElement("span"),n=e.outerHTML,i=r.sanitize(n,{USE_PROFILES:{svg:!0},FORBID_TAGS:["a","audio","canvas","video"],ADD_DATA_URI_TAGS:["image"]});let s,o;try{t.innerHTML=i,document.body.appendChild(t),s=t.children[0].getBBox()}finally{document.body.removeChild(t)}o=0===s.width||0===s.height?0:(e=>{let t=0;const n=e=>{e.getAttribute&&(e.getAttribute("stroke")&&(t=Math.max(t,1)),e.getAttribute("stroke-width")&&(t=Math.max(t,Number(e.getAttribute("stroke-width"))||0)));for(let t=0;t{t&&(e=>{const t=l(e,"linearGradient");for(const e of t)e.getAttribute("x2")||e.setAttribute("x2","0")})(e),a(e,window),(e=>{const t=l(e,"image"),n="image-rendering: optimizespeed; image-rendering: pixelated;";for(const e of t)e.getAttribute("style")?e.setAttribute("style",`${n} ${e.getAttribute("style")}`):e.setAttribute("style",n)})(e),t?((e=>{const t=[],n=e=>{"text"===e.localName&&t.push(e);for(let t=0;t{const t=l(e);for(const e of t){if(!e.style)continue;const t=e.style.stroke||e.getAttribute("stroke");t&&t.match(/^url\(#.*\)$/)&&(e.style["stroke-linejoin"]="round",e.style["stroke-linecap"]="round")}})(e)):e.getAttribute("viewBox")?e.getAttribute("width")&&e.getAttribute("height")||(e.setAttribute("width",e.viewBox.baseVal.width),e.setAttribute("height",e.viewBox.baseVal.height)):c(e)};e.exports=(e,t)=>{const n=new DOMParser;e=o(e);const r=n.parseFromString(e,"text/xml");if(r.childNodes.length<1||"svg"!==r.documentElement.localName)throw new Error("Document does not appear to be SVG.");const i=r.documentElement;return u(i,t),i}},function(e,t,n){e.exports=function(){"use strict";function e(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1?n-1:0),i=1;i/gm),F=a(/^data-[\-\w.\u00B7-\uFFFF]/),W=a(/^aria-[\-\w]+$/),V=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),G=a(/^(?:\w+script|data):/i),q=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function H(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:_(),t=function(e){return Q(e)};if(t.version="2.2.7",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var n=e.document,r=e.document,i=e.DocumentFragment,s=e.HTMLTemplateElement,a=e.Node,l=e.Element,c=e.NodeFilter,u=e.NamedNodeMap,d=void 0===u?e.NamedNodeMap||e.MozNamedAttrMap:u,k=e.Text,x=e.Comment,X=e.DOMParser,Z=e.trustedTypes,J=l.prototype,$=A(J,"cloneNode"),ee=A(J,"nextSibling"),te=A(J,"childNodes"),ne=A(J,"parentNode");if("function"==typeof s){var re=r.createElement("template");re.content&&re.content.ownerDocument&&(r=re.content.ownerDocument)}var ie=K(Z,n),se=ie&&ze?ie.createHTML(""):"",oe=r,ae=oe.implementation,le=oe.createNodeIterator,ce=oe.getElementsByTagName,ue=oe.createDocumentFragment,de=n.importNode,he={};try{he=E(r).documentMode?r.documentMode:{}}catch(e){}var pe={};t.isSupported="function"==typeof ne&&ae&&void 0!==ae.createHTMLDocument&&9!==he;var me=U,fe=j,ge=F,ye=W,be=G,ve=q,Se=V,we=null,ke=T({},[].concat(H(C),H(I),H(O),H(N),H(D))),xe=null,Te=T({},[].concat(H(P),H(L),H(B),H(z))),Ee=null,Ae=null,Ce=!0,Ie=!0,Oe=!1,Me=!1,Ne=!1,Re=!1,De=!1,Pe=!1,Le=!1,Be=!0,ze=!1,Ue=!0,je=!0,Fe=!1,We={},Ve=T({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ge=null,qe=T({},["audio","video","img","source","image","track"]),Ye=null,He=T({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),_e=null,Ke=r.createElement("form"),Qe=function(e){_e&&_e===e||(e&&"object"===(void 0===e?"undefined":Y(e))||(e={}),e=E(e),we="ALLOWED_TAGS"in e?T({},e.ALLOWED_TAGS):ke,xe="ALLOWED_ATTR"in e?T({},e.ALLOWED_ATTR):Te,Ye="ADD_URI_SAFE_ATTR"in e?T(E(He),e.ADD_URI_SAFE_ATTR):He,Ge="ADD_DATA_URI_TAGS"in e?T(E(qe),e.ADD_DATA_URI_TAGS):qe,Ee="FORBID_TAGS"in e?T({},e.FORBID_TAGS):{},Ae="FORBID_ATTR"in e?T({},e.FORBID_ATTR):{},We="USE_PROFILES"in e&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,Ie=!1!==e.ALLOW_DATA_ATTR,Oe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=e.SAFE_FOR_TEMPLATES||!1,Ne=e.WHOLE_DOCUMENT||!1,Pe=e.RETURN_DOM||!1,Le=e.RETURN_DOM_FRAGMENT||!1,Be=!1!==e.RETURN_DOM_IMPORT,ze=e.RETURN_TRUSTED_TYPE||!1,De=e.FORCE_BODY||!1,Ue=!1!==e.SANITIZE_DOM,je=!1!==e.KEEP_CONTENT,Fe=e.IN_PLACE||!1,Se=e.ALLOWED_URI_REGEXP||Se,Me&&(Ie=!1),Le&&(Pe=!0),We&&(we=T({},[].concat(H(D))),xe=[],!0===We.html&&(T(we,C),T(xe,P)),!0===We.svg&&(T(we,I),T(xe,L),T(xe,z)),!0===We.svgFilters&&(T(we,O),T(xe,L),T(xe,z)),!0===We.mathMl&&(T(we,N),T(xe,B),T(xe,z))),e.ADD_TAGS&&(we===ke&&(we=E(we)),T(we,e.ADD_TAGS)),e.ADD_ATTR&&(xe===Te&&(xe=E(xe)),T(xe,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&T(Ye,e.ADD_URI_SAFE_ATTR),je&&(we["#text"]=!0),Ne&&T(we,["html","head","body"]),we.table&&(T(we,["tbody"]),delete Ee.tbody),o&&o(e),_e=e)},Xe=T({},["mi","mo","mn","ms","mtext"]),Ze=T({},["foreignobject","desc","title","annotation-xml"]),Je=T({},I);T(Je,O),T(Je,M);var $e=T({},N);T($e,R);var et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml",rt=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:nt,tagName:"template"});var n=f(e.tagName),r=f(t.tagName);if(e.namespaceURI===tt)return t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===r||Xe[r]):Boolean(Je[n]);if(e.namespaceURI===et)return t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&Ze[r]:Boolean($e[n]);if(e.namespaceURI===nt){if(t.namespaceURI===tt&&!Ze[r])return!1;if(t.namespaceURI===et&&!Xe[r])return!1;var i=T({},["title","style","font","a","script"]);return!$e[n]&&(i[n]||!Je[n])}return!1},it=function(e){m(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=se}catch(t){e.remove()}}},st=function(e,n){try{m(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch(e){m(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),"is"===e&&!xe[e])if(Pe||Le)try{it(n)}catch(e){}else try{n.setAttribute(e,"")}catch(e){}},ot=function(e){var t=void 0,n=void 0;if(De)e=""+e;else{var i=g(e,/^[\r\n\t ]+/);n=i&&i[0]}var s=ie?ie.createHTML(e):e;try{t=(new X).parseFromString(s,"text/html")}catch(e){}if(!t||!t.documentElement){var o=(t=ae.createHTMLDocument("")).body;o.parentNode.removeChild(o.parentNode.firstElementChild),o.outerHTML=s}return e&&n&&t.body.insertBefore(r.createTextNode(n),t.body.childNodes[0]||null),ce.call(t,Ne?"html":"body")[0]},at=function(e){return le.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,(function(){return c.FILTER_ACCEPT}),!1)},lt=function(e){return!(e instanceof k||e instanceof x||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof d&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},ct=function(e){return"object"===(void 0===a?"undefined":Y(a))?e instanceof a:e&&"object"===(void 0===e?"undefined":Y(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},ut=function(e,n,r){pe[e]&&h(pe[e],(function(e){e.call(t,n,r,_e)}))},dt=function(e){var n=void 0;if(ut("beforeSanitizeElements",e,null),lt(e))return it(e),!0;if(g(e.nodeName,/[\u0080-\uFFFF]/))return it(e),!0;var r=f(e.nodeName);if(ut("uponSanitizeElement",e,{tagName:r,allowedTags:we}),!ct(e.firstElementChild)&&(!ct(e.content)||!ct(e.content.firstElementChild))&&S(/<[/\w]/g,e.innerHTML)&&S(/<[/\w]/g,e.textContent))return it(e),!0;if(!we[r]||Ee[r]){if(je&&!Ve[r]){var i=ne(e),s=te(e);if(s&&i)for(var o=s.length-1;o>=0;--o)i.insertBefore($(s[o],!0),ee(e))}return it(e),!0}return e instanceof l&&!rt(e)?(it(e),!0):"noscript"!==r&&"noembed"!==r||!S(/<\/no(script|embed)/i,e.innerHTML)?(Me&&3===e.nodeType&&(n=e.textContent,n=y(n,me," "),n=y(n,fe," "),e.textContent!==n&&(m(t.removed,{element:e.cloneNode()}),e.textContent=n)),ut("afterSanitizeElements",e,null),!1):(it(e),!0)},ht=function(e,t,n){if(Ue&&("id"===t||"name"===t)&&(n in r||n in Ke))return!1;if(Ie&&S(ge,t));else if(Ce&&S(ye,t));else{if(!xe[t]||Ae[t])return!1;if(Ye[t]);else if(S(Se,y(n,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==b(n,"data:")||!Ge[e])if(Oe&&!S(be,y(n,ve,"")));else if(n)return!1}return!0},pt=function(e){var n=void 0,r=void 0,i=void 0,s=void 0;ut("beforeSanitizeAttributes",e,null);var o=e.attributes;if(o){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe};for(s=o.length;s--;){var l=n=o[s],c=l.name,u=l.namespaceURI;if(r=v(n.value),i=f(c),a.attrName=i,a.attrValue=r,a.keepAttr=!0,a.forceKeepAttr=void 0,ut("uponSanitizeAttribute",e,a),r=a.attrValue,!a.forceKeepAttr&&(st(c,e),a.keepAttr))if(S(/\/>/i,r))st(c,e);else{Me&&(r=y(r,me," "),r=y(r,fe," "));var d=e.nodeName.toLowerCase();if(ht(d,i,r))try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),p(t.removed)}catch(e){}}}ut("afterSanitizeAttributes",e,null)}},mt=function e(t){var n=void 0,r=at(t);for(ut("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)ut("uponSanitizeShadowNode",n,null),dt(n)||(n.content instanceof i&&e(n.content),pt(n));ut("afterSanitizeShadowDOM",t,null)};return t.sanitize=function(r,s){var o=void 0,l=void 0,c=void 0,u=void 0,d=void 0;if(r||(r="\x3c!--\x3e"),"string"!=typeof r&&!ct(r)){if("function"!=typeof r.toString)throw w("toString is not a function");if("string"!=typeof(r=r.toString()))throw w("dirty is not a string, aborting")}if(!t.isSupported){if("object"===Y(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof r)return e.toStaticHTML(r);if(ct(r))return e.toStaticHTML(r.outerHTML)}return r}if(Re||Qe(s),t.removed=[],"string"==typeof r&&(Fe=!1),Fe);else if(r instanceof a)1===(l=(o=ot("\x3c!----\x3e")).ownerDocument.importNode(r,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?o=l:o.appendChild(l);else{if(!Pe&&!Me&&!Ne&&-1===r.indexOf("<"))return ie&&ze?ie.createHTML(r):r;if(!(o=ot(r)))return Pe?null:se}o&&De&&it(o.firstChild);for(var h=at(Fe?r:o);c=h.nextNode();)3===c.nodeType&&c===u||dt(c)||(c.content instanceof i&&mt(c.content),pt(c),u=c);if(u=null,Fe)return r;if(Pe){if(Le)for(d=ue.call(o.ownerDocument);o.firstChild;)d.appendChild(o.firstChild);else d=o;return Be&&(d=de.call(n,d,!0)),d}var p=Ne?o.outerHTML:o.innerHTML;return Me&&(p=y(p,me," "),p=y(p,fe," ")),ie&&ze?ie.createHTML(p):p},t.setConfig=function(e){Qe(e),Re=!0},t.clearConfig=function(){_e=null,Re=!1},t.isValidAttribute=function(e,t,n){_e||Qe({});var r=f(e),i=f(t);return ht(r,i,n)},t.addHook=function(e,t){"function"==typeof t&&(pe[e]=pe[e]||[],m(pe[e],t))},t.removeHook=function(e){pe[e]&&p(pe[e])},t.removeHooks=function(e){pe[e]&&(pe[e]=[])},t.removeAllHooks=function(){pe={}},t}return Q()}()},function(e,t){e.exports=function(e){const t=[],n=e=>{"text"===e.localName&&t.push(e);for(let t=0;t]*>/);t&&-1===t[0].indexOf("xmlns=")&&(e=e.replace("]+?xlink:href=["'])data:img\/png/g,((e,t)=>`${t}data:image/png`)));const n=/(<[^>]+?xmlns:(?!xml=)[^ ]+=)"http:\/\/www.w3.org\/XML\/1998\/namespace"/g;return null!==e.match(n)&&(e=e.replace(n,((e,t)=>`${t}"http://dummy.namespace"`))),e=(e=(e=e.replace(/<(\/?)\s*svg:/g,"<$1")).replace(/[\s\S]*<\/metadata>/,"")).replace(/[\s\S]*<\/script>/,"G. The B>G case\n\t// will be calculated in the negative and fed through abs() in the hue calculation at the end.\n\t// See also: https://en.wikipedia.org/wiki/HSL_and_HSV#Hue_and_chroma\n\tconst vec4 hueOffsets = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n\n\t// temp1.xy = sort B & G (largest first)\n\t// temp1.z = the hue offset we\'ll use if it turns out that R is the largest component (M==R)\n\t// temp1.w = the hue offset we\'ll use if it turns out that R is not the largest component (M==G or M==B)\n\tvec4 temp1 = rgb.b > rgb.g ? vec4(rgb.bg, hueOffsets.wz) : vec4(rgb.gb, hueOffsets.xy);\n\n\t// temp2.x = the largest component of RGB ("M" / "Max")\n\t// temp2.yw = the smaller components of RGB, ordered for the hue calculation (not necessarily sorted by magnitude!)\n\t// temp2.z = the hue offset we\'ll use in the hue calculation\n\tvec4 temp2 = rgb.r > temp1.x ? vec4(rgb.r, temp1.yzx) : vec4(temp1.xyw, rgb.r);\n\n\t// m = the smallest component of RGB ("min")\n\tfloat m = min(temp2.y, temp2.w);\n\n\t// Chroma = M - m\n\tfloat C = temp2.x - m;\n\n\t// Value = M\n\tfloat V = temp2.x;\n\n\treturn vec3(\n\t\tabs(temp2.z + (temp2.w - temp2.y) / (6.0 * C + epsilon)), // Hue\n\t\tC / (temp2.x + epsilon), // Saturation\n\t\tV); // Value\n}\n\nvec3 convertHue2RGB(float hue)\n{\n\tfloat r = abs(hue * 6.0 - 3.0) - 1.0;\n\tfloat g = 2.0 - abs(hue * 6.0 - 2.0);\n\tfloat b = 2.0 - abs(hue * 6.0 - 4.0);\n\treturn clamp(vec3(r, g, b), 0.0, 1.0);\n}\n\nvec3 convertHSV2RGB(vec3 hsv)\n{\n\tvec3 rgb = convertHue2RGB(hsv.x);\n\tfloat c = hsv.z * hsv.y;\n\treturn rgb * c + hsv.z - c;\n}\n#endif // !defined(DRAW_MODE_silhouette) && (defined(ENABLE_color))\n\nconst vec2 kCenter = vec2(0.5, 0.5);\n\nvoid main()\n{\n\t#if !(defined(DRAW_MODE_line) || defined(DRAW_MODE_background))\n\tvec2 texcoord0 = v_texCoord;\n\n\t#ifdef ENABLE_mosaic\n\ttexcoord0 = fract(u_mosaic * texcoord0);\n\t#endif // ENABLE_mosaic\n\n\t#ifdef ENABLE_pixelate\n\t{\n\t\t// TODO: clean up "pixel" edges\n\t\tvec2 pixelTexelSize = u_skinSize / u_pixelate;\n\t\ttexcoord0 = (floor(texcoord0 * pixelTexelSize) + kCenter) / pixelTexelSize;\n\t}\n\t#endif // ENABLE_pixelate\n\n\t#ifdef ENABLE_whirl\n\t{\n\t\tconst float kRadius = 0.5;\n\t\tvec2 offset = texcoord0 - kCenter;\n\t\tfloat offsetMagnitude = length(offset);\n\t\tfloat whirlFactor = max(1.0 - (offsetMagnitude / kRadius), 0.0);\n\t\tfloat whirlActual = u_whirl * whirlFactor * whirlFactor;\n\t\tfloat sinWhirl = sin(whirlActual);\n\t\tfloat cosWhirl = cos(whirlActual);\n\t\tmat2 rotationMatrix = mat2(\n\t\t\tcosWhirl, -sinWhirl,\n\t\t\tsinWhirl, cosWhirl\n\t\t);\n\n\t\ttexcoord0 = rotationMatrix * offset + kCenter;\n\t}\n\t#endif // ENABLE_whirl\n\n\t#ifdef ENABLE_fisheye\n\t{\n\t\tvec2 vec = (texcoord0 - kCenter) / kCenter;\n\t\tfloat vecLength = length(vec);\n\t\tfloat r = pow(min(vecLength, 1.0), u_fisheye) * max(1.0, vecLength);\n\t\tvec2 unit = vec / vecLength;\n\n\t\ttexcoord0 = kCenter + r * unit * kCenter;\n\t}\n\t#endif // ENABLE_fisheye\n\n\tgl_FragColor = texture2D(u_skin, texcoord0);\n\n\t#if defined(ENABLE_color) || defined(ENABLE_brightness)\n\t// Divide premultiplied alpha values for proper color processing\n\t// Add epsilon to avoid dividing by 0 for fully transparent pixels\n\tgl_FragColor.rgb = clamp(gl_FragColor.rgb / (gl_FragColor.a + epsilon), 0.0, 1.0);\n\n\t#ifdef ENABLE_color\n\t{\n\t\tvec3 hsv = convertRGB2HSV(gl_FragColor.xyz);\n\n\t\t// this code forces grayscale values to be slightly saturated\n\t\t// so that some slight change of hue will be visible\n\t\tconst float minLightness = 0.11 / 2.0;\n\t\tconst float minSaturation = 0.09;\n\t\tif (hsv.z < minLightness) hsv = vec3(0.0, 1.0, minLightness);\n\t\telse if (hsv.y < minSaturation) hsv = vec3(0.0, minSaturation, hsv.z);\n\n\t\thsv.x = mod(hsv.x + u_color, 1.0);\n\t\tif (hsv.x < 0.0) hsv.x += 1.0;\n\n\t\tgl_FragColor.rgb = convertHSV2RGB(hsv);\n\t}\n\t#endif // ENABLE_color\n\n\t#ifdef ENABLE_brightness\n\tgl_FragColor.rgb = clamp(gl_FragColor.rgb + vec3(u_brightness), vec3(0), vec3(1));\n\t#endif // ENABLE_brightness\n\n\t// Re-multiply color values\n\tgl_FragColor.rgb *= gl_FragColor.a + epsilon;\n\n\t#endif // defined(ENABLE_color) || defined(ENABLE_brightness)\n\n\t#ifdef ENABLE_ghost\n\tgl_FragColor *= u_ghost;\n\t#endif // ENABLE_ghost\n\n\t#ifdef DRAW_MODE_silhouette\n\t// Discard fully transparent pixels for stencil test\n\tif (gl_FragColor.a == 0.0) {\n\t\tdiscard;\n\t}\n\t// switch to u_silhouetteColor only AFTER the alpha test\n\tgl_FragColor = u_silhouetteColor;\n\t#else // DRAW_MODE_silhouette\n\n\t#ifdef DRAW_MODE_colorMask\n\tvec3 maskDistance = abs(gl_FragColor.rgb - u_colorMask);\n\tvec3 colorMaskTolerance = vec3(u_colorMaskTolerance, u_colorMaskTolerance, u_colorMaskTolerance);\n\tif (any(greaterThan(maskDistance, colorMaskTolerance)))\n\t{\n\t\tdiscard;\n\t}\n\t#endif // DRAW_MODE_colorMask\n\t#endif // DRAW_MODE_silhouette\n\n\t#ifdef DRAW_MODE_straightAlpha\n\t// Un-premultiply alpha.\n\tgl_FragColor.rgb /= gl_FragColor.a + epsilon;\n\t#endif\n\n\t#endif // !(defined(DRAW_MODE_line) || defined(DRAW_MODE_background))\n\n\t#ifdef DRAW_MODE_line\n\t// Maaaaagic antialiased-line-with-round-caps shader.\n\n\t// "along-the-lineness". This increases parallel to the line.\n\t// It goes from negative before the start point, to 0.5 through the start to the end, then ramps up again\n\t// past the end point.\n\tfloat d = ((v_texCoord.x - clamp(v_texCoord.x, 0.0, v_lineLength)) * 0.5) + 0.5;\n\n\t// Distance from (0.5, 0.5) to (d, the perpendicular coordinate). When we\'re in the middle of the line,\n\t// d will be 0.5, so the distance will be 0 at points close to the line and will grow at points further from it.\n\t// For the "caps", d will ramp down/up, giving us rounding.\n\t// See https://www.youtube.com/watch?v=PMltMdi1Wzg for a rough outline of the technique used to round the lines.\n\tfloat line = distance(vec2(0.5), vec2(d, v_texCoord.y)) * 2.0;\n\t// Expand out the line by its thickness.\n\tline -= ((v_lineThickness - 1.0) * 0.5);\n\t// Because "distance to the center of the line" decreases the closer we get to the line, but we want more opacity\n\t// the closer we are to the line, invert it.\n\tgl_FragColor = v_lineColor * clamp(1.0 - line, 0.0, 1.0);\n\t#endif // DRAW_MODE_line\n\n\t#ifdef DRAW_MODE_background\n\tgl_FragColor = u_backgroundColor;\n\t#endif\n}\n'},function(e,t){e.exports={rgbToHsv:(e,t)=>{let[n,r,i]=e,s=0;n/=255,r/=255,i/=255;let o=0;r{let[n,r,i]=e;if(0===r)return t[0]=t[1]=t[2]=255*i+.5,t;n%=1;const s=6*n|0,o=6*n-s,a=i*(1-r),l=i*(1-r*o),c=i*(1-r*(1-o));let u=0,d=0,h=0;switch(s){case 0:u=i,d=c,h=a;break;case 1:u=l,d=i,h=a;break;case 2:u=a,d=i,h=c;break;case 3:u=a,d=l,h=i;break;case 4:u=c,d=a,h=i;break;case 5:u=i,d=a,h=l}return t[0]=255*u+.5,t[1]=255*d+.5,t[2]=255*h+.5,t}}},function(e,t,n){const r=n(11),i=n(38),s=n(29),o=n(30),a={color4f:[0,0,1,1],diameter:1},l=[0,0,0,0],c=65520;e.exports=class extends s{constructor(e,t){super(e,t),this._size=null,this._framebuffer=null,this._silhouetteDirty=!1,this._silhouettePixels=null,this._silhouetteImageData=null,this._lineOnBufferDrawRegionId={enter:()=>this._enterDrawLineOnBuffer(),exit:()=>this._exitDrawLineOnBuffer()},this._usePenBufferDrawRegionId={enter:()=>this._enterUsePenBuffer(),exit:()=>this._exitUsePenBuffer()},this.renderQuality=1,this._nativeSize=t.getNativeSize(),this._resetAttributeIndexes(),this.a_lineColor=new Float32Array(c),this.a_lineThicknessAndLength=new Float32Array(32760),this.a_penPoints=new Float32Array(c),this.a_position=new Float32Array(32760);for(let e=0;ethis._enterDrawTexture(),exit:()=>this._exitDrawTexture()},this.onNativeSizeChanged=this.onNativeSizeChanged.bind(this),this._renderer.on(i.Events.NativeSizeChanged,this.onNativeSizeChanged),this._setCanvasSize(t.getNativeSize())}dispose(){this._renderer.removeListener(i.Events.NativeSizeChanged,this.onNativeSizeChanged),this._renderer.gl.deleteTexture(this._texture),this._texture=null,super.dispose()}get size(){return this._nativeSize}useNearest(e){return Math.max(e[0],e[1])>=100}getTexture(e){return this._texture}clear(){this._renderer.enterDrawRegion(this._usePenBufferDrawRegionId);const e=this._renderer.gl;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),this._silhouetteDirty=!0}drawPoint(e,t,n){this.drawLine(e,t,n,t,n)}drawLine(e,t,n,r,i){const s=e.diameter||a.diameter,o=1===s||3===s?.5:0;this._drawLineOnBuffer(e,t+o,n+o,r+o,i+o),this._silhouetteDirty=!0}_enterDrawLineOnBuffer(){this._resetAttributeIndexes();const e=this._renderer.gl;r.bindFramebufferInfo(e,this._framebuffer),e.viewport(0,0,this._size[0],this._size[1]);const t=this._lineShader;e.useProgram(t.program),r.setBuffersAndAttributes(e,t,this._lineBufferInfo);const n={u_skin:this._texture,u_stageSize:this._size};r.setUniforms(t,n)}_exitDrawLineOnBuffer(){this.a_lineColorIndex&&this._flushLines();const e=this._renderer.gl;r.bindFramebufferInfo(e,null)}_enterUsePenBuffer(){r.bindFramebufferInfo(this._renderer.gl,this._framebuffer)}_exitUsePenBuffer(){r.bindFramebufferInfo(this._renderer.gl,null)}_enterDrawTexture(){this._enterUsePenBuffer();const e=this._renderer.gl;e.viewport(0,0,this._size[0],this._size[1]),e.useProgram(this._drawTextureShader.program),r.setBuffersAndAttributes(e,this._drawTextureShader,this._renderer._bufferInfo)}_exitDrawTexture(){this._exitUsePenBuffer()}_drawPenTexture(e){this._renderer.enterDrawRegion(this._drawTextureRegionId);const t=this._renderer.gl,n=this._size[0],i=this._size[1],s={u_skin:e,u_projectionMatrix:r.m4.ortho(n/2,n/-2,i/-2,i/2,-1,1,r.m4.identity()),u_modelMatrix:r.m4.scaling(r.v3.create(n,i,0),r.m4.identity())};r.setTextureParameters(t,e,{minMag:t.NEAREST}),r.setUniforms(this._drawTextureShader,s),r.drawBufferInfo(t,this._renderer._bufferInfo,t.TRIANGLES)}_drawLineOnBuffer(e,t,n,r,i){this._renderer.enterDrawRegion(this._lineOnBufferDrawRegionId),this.a_lineColorIndex+24>c&&this._flushLines();const s=e.color4f||a.color4f;l[0]=s[0]*s[3],l[1]=s[1]*s[3],l[2]=s[2]*s[3],l[3]=s[3],t*=this.renderQuality,n*=this.renderQuality;const o=(r*=this.renderQuality)-t,u=(i*=this.renderQuality)-n,d=Math.sqrt(o*o+u*u),h=(e.diameter||a.diameter)*this.renderQuality;for(let e=0;e<6;e++)this.a_lineColor[this.a_lineColorIndex]=l[0],this.a_lineColorIndex++,this.a_lineColor[this.a_lineColorIndex]=l[1],this.a_lineColorIndex++,this.a_lineColor[this.a_lineColorIndex]=l[2],this.a_lineColorIndex++,this.a_lineColor[this.a_lineColorIndex]=l[3],this.a_lineColorIndex++,this.a_lineThicknessAndLength[this.a_lineThicknessAndLengthIndex]=h,this.a_lineThicknessAndLengthIndex++,this.a_lineThicknessAndLength[this.a_lineThicknessAndLengthIndex]=d,this.a_lineThicknessAndLengthIndex++,this.a_penPoints[this.a_penPointsIndex]=t,this.a_penPointsIndex++,this.a_penPoints[this.a_penPointsIndex]=-n,this.a_penPointsIndex++,this.a_penPoints[this.a_penPointsIndex]=o,this.a_penPointsIndex++,this.a_penPoints[this.a_penPointsIndex]=-u,this.a_penPointsIndex++}_resetAttributeIndexes(){this.a_lineColorIndex=0,this.a_lineThicknessAndLengthIndex=0,this.a_penPointsIndex=0}_flushLines(){const e=this._renderer.gl,t=this._lineShader;this.a_lineColorIndex<1e3?(r.setAttribInfoBufferFromArray(e,this._lineBufferInfo.attribs.a_lineColor,new Float32Array(this.a_lineColor.buffer,0,this.a_lineColorIndex),0),r.setAttribInfoBufferFromArray(e,this._lineBufferInfo.attribs.a_penPoints,new Float32Array(this.a_penPoints.buffer,0,this.a_penPointsIndex),0),r.setAttribInfoBufferFromArray(e,this._lineBufferInfo.attribs.a_lineThicknessAndLength,new Float32Array(this.a_lineThicknessAndLength.buffer,0,this.a_lineThicknessAndLengthIndex),0)):(r.setAttribInfoBufferFromArray(e,this._lineBufferInfo.attribs.a_lineColor,this.a_lineColor),r.setAttribInfoBufferFromArray(e,this._lineBufferInfo.attribs.a_penPoints,this.a_penPoints),r.setAttribInfoBufferFromArray(e,this._lineBufferInfo.attribs.a_lineThicknessAndLength,this.a_lineThicknessAndLength)),r.setBuffersAndAttributes(e,t,this._lineBufferInfo),r.drawBufferInfo(e,this._lineBufferInfo,e.TRIANGLES,this.a_lineThicknessAndLengthIndex/2),this._resetAttributeIndexes(),this._silhouetteDirty=!0}onNativeSizeChanged(e){this._nativeSize=e.newSize,this._setCanvasSize([e.newSize[0]*this.renderQuality,e.newSize[1]*this.renderQuality]),this.emitWasAltered()}_setCanvasSize(e){const[t,n]=e;if(this._size&&this._size[0]===t&&this._size[1]===n)return;this._size=e,this._rotationCenter[0]=this._nativeSize[0]/2,this._rotationCenter[1]=this._nativeSize[1]/2;const i=this._renderer.gl,s=this._texture;this._texture=r.createTexture(i,{mag:i.NEAREST,min:i.NEAREST,wrap:i.CLAMP_TO_EDGE,width:t,height:n});const o=[{format:i.RGBA,attachment:this._texture}];this._framebuffer,this._framebuffer=r.createFramebufferInfo(i,o,t,n),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),s&&this._drawPenTexture(s),this._silhouettePixels=new Uint8Array(Math.floor(t*n*4)),this._silhouetteImageData=new ImageData(t,n),this._silhouetteDirty=!0}setRenderQuality(e){this.renderQuality!==e&&(this.renderQuality=e,this._setCanvasSize([Math.round(this._nativeSize[0]*e),Math.round(this._nativeSize[1]*e)]))}updateSilhouette(){if(this._silhouetteDirty){this._renderer.enterDrawRegion(this._usePenBufferDrawRegionId);const e=this._renderer.gl;e.readPixels(0,0,this._size[0],this._size[1],e.RGBA,e.UNSIGNED_BYTE,this._silhouettePixels),this._silhouetteImageData.data.set(this._silhouettePixels),this._silhouette.update(this._silhouetteImageData,!0),this._silhouetteDirty=!1}}}},function(e,t,n){const r=n(11),i=n(29),{loadSvgString:s,serializeSvgToString:o}=n(35),a=n(30);e.exports=class extends i{constructor(e,t){super(e,t),this._svgImage=document.createElement("img"),this._svgImageLoaded=!1,this._size=[0,0],this._canvas=document.createElement("canvas"),this._context=this._canvas.getContext("2d"),this._scaledMIPs=[],this._largestMIPScale=0,this._maxTextureScale=1}dispose(){this.resetMIPs(),super.dispose()}get size(){return[this._size[0],this._size[1]]}useNearest(e,t){return!(t.enabledEffects&(a.EFFECT_INFO.fisheye.mask|a.EFFECT_INFO.whirl.mask|a.EFFECT_INFO.pixelate.mask|a.EFFECT_INFO.mosaic.mask))&&(t._direction%90==0&&(Math.abs(e[0])>99&&Math.abs(e[0])<101&&Math.abs(e[1])>99&&Math.abs(e[1])<101))}createMIP(e){const t=this._largestMIPScale0&&void 0!==arguments[0]?arguments[0]:[100,100];this.getTexture(e),this._silhouette.unlazy()}getTexture(e){const t=e?Math.max(Math.abs(e[0]),Math.abs(e[1])):100,n=Math.min(t/100,this._maxTextureScale),r=Math.max(Math.ceil(Math.log2(n))+8,0),i=Math.pow(2,r-8);return this._svgImageLoaded&&!this._scaledMIPs[r]&&(this._scaledMIPs[r]=this.createMIP(i)),this._scaledMIPs[r]||super.getTexture()}resetMIPs(){this._scaledMIPs.forEach((e=>this._renderer.gl.deleteTexture(e))),this._scaledMIPs.length=0,this._largestMIPScale=0}setSVG(e,t){const n=s(e),r=o(n,this._renderer.customFonts);this._svgImageLoaded=!1;const{x:i,y:a,width:l,height:c}=n.viewBox.baseVal;this._size[0]=l,this._size[1]=c,this._svgImage.onload=()=>{if(0===l||0===c)return void super.setEmptyImageData();const e=Math.ceil(Math.max(l,c)),n=this._renderer.maxTextureDimension;let r=2;for(;e*r<=n;r*=2)this._maxTextureScale=r;this.resetMIPs(),void 0===t&&(t=this.calculateRotationCenter()),this._rotationCenter[0]=t[0]-i,this._rotationCenter[1]=t[1]-a,this._svgImageLoaded=!0,this.emitWasAltered()},this._svgImage.src="data:image/svg+xml;utf8,".concat(encodeURIComponent(r))}}},function(e,t,n){const r=n(11),i=n(112),s=n(29),o=170,a=50,l=4,c=10,u=16,d=12,h="Helvetica",p=14,m=.9,f=16,g={BUBBLE_FILL:"white",BUBBLE_STROKE:"rgba(0, 0, 0, 0.15)",TEXT_FILL:"#575E75"};e.exports=class extends s{constructor(e,t){super(e,t),this._canvas=document.createElement("canvas"),this._size=[0,0],this._renderedScale=0,this._lines=[],this._textAreaSize={width:0,height:0},this._bubbleType="",this._pointsLeft=!1,this._textDirty=!0,this._textureDirty=!0,this.measurementProvider=new i(this._canvas.getContext("2d")),this.textWrapper=t.createTextWrapper(this.measurementProvider),this._restyleCanvas()}dispose(){this._texture&&(this._renderer.gl.deleteTexture(this._texture),this._texture=null),this._canvas=null,super.dispose()}get size(){return this._textDirty&&this._reflowLines(),this._size}setTextBubble(e,t,n){this._text=t,this._bubbleType=e,this._pointsLeft=n,this._textDirty=!0,this._textureDirty=!0,this.emitWasAltered()}_restyleCanvas(){this._canvas.getContext("2d").font="".concat(p,"px ").concat(h,", sans-serif")}_reflowLines(){this._lines=this.textWrapper.wrapText(o,this._text);let e=0;for(const t of this._lines)e=Math.max(e,this.measurementProvider.measureText(t));const t=Math.max(e,a)+2*c,n=f*this._lines.length+2*c;this._textAreaSize.width=t,this._textAreaSize.height=n,this._size[0]=t+l,this._size[1]=n+l+d,this._textDirty=!1}_renderTextBubble(e){const t=this._canvas.getContext("2d");this._textDirty&&this._reflowLines();const n=this._textAreaSize.width,r=this._textAreaSize.height;this._canvas.width=Math.ceil(this._size[0]*e),this._canvas.height=Math.ceil(this._size[1]*e),this._restyleCanvas(),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,this._canvas.width,this._canvas.height),t.scale(e,e),t.translate(.5*l,.5*l),t.save(),this._pointsLeft&&(t.scale(-1,1),t.translate(-n,0)),t.beginPath(),t.moveTo(u,r),t.arcTo(0,r,0,r-u,u),t.arcTo(0,0,n,0,u),t.arcTo(n,0,n,r,u),t.arcTo(n,r,n-u,r,u),t.save(),t.translate(n-u,r),"say"===this._bubbleType?(t.bezierCurveTo(0,4,4,8,4,10),t.arcTo(4,12,2,12,2),t.bezierCurveTo(-1,12,-11,8,-16,0),t.closePath()):(t.arc(-16,0,4,0,Math.PI),t.closePath(),t.moveTo(-7,7.25),t.arc(-9.25,7.25,2.25,0,2*Math.PI),t.moveTo(0,9.5),t.arc(-1.5,9.5,1.5,0,2*Math.PI)),t.restore(),t.fillStyle=g.BUBBLE_FILL,t.strokeStyle=g.BUBBLE_STROKE,t.lineWidth=l,t.stroke(),t.fill(),t.restore(),t.fillStyle=g.TEXT_FILL,t.font="".concat(p,"px ").concat(h,", sans-serif");const i=this._lines;for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:[100,100];this.getTexture(e)}getTexture(e){const t=e?Math.max(Math.abs(e[0]),Math.abs(e[1])):100,n=Math.min(10,t/100);if(this._textureDirty||this._renderedScale!==n){this._renderTextBubble(n),this._textureDirty=!1;const e=this._canvas.getContext("2d").getImageData(0,0,this._canvas.width,this._canvas.height),t=this._renderer.gl;if(null===this._texture){const e={auto:!1,wrap:t.CLAMP_TO_EDGE};this._texture=r.createTexture(t,e)}this._setTexture(e)}return this._texture}}},function(e,t,n){const r=n(404),i=n(409);e.exports=class{constructor(e){this._measurementProvider=e,this._cache={}}wrapText(e,t){t=t.normalize();const n="".concat(e,"-").concat(t);if(this._cache[n])return this._cache[n];const s=this._measurementProvider.beginMeasurementSession(),o=new r(t);let a,l=0,c=null;const u=[];for(;a=o.nextBreak();){const n=t.slice(l,a.position).replace(/\n+$/,"");let r=(c||"").concat(n),s=this._measurementProvider.measureText(r);if(s>e){if(this._measurementProvider.measureText(n)>e){let t,o=0;for(;o!==(t=i.nextBreak(n,o));){const i=n.substring(o,t);r=(c||"").concat(i),s=this._measurementProvider.measureText(r),null===c||s<=e?c=r:(u.push(c),c=i),o=t}}else null!==c&&u.push(c),c=n}else c=r;a.required&&(null!==c&&u.push(c),c=null),l=a.position}return c=c||"",(c.length>0||0===u.length)&&u.push(c),this._cache[n]=u,this._measurementProvider.endMeasurementSession(s),u}}},function(e,t,n){(function(){var t,r,i,s,o,a,l,c,u,d,h,p,m,f,g,y,b,v,S,w,k,x,T,E,A,C,I;S=n(113),x=n(406),C=n(407),C.BK,u=C.CR,C.LF,C.NL,o=C.CB,i=C.BA,C.SP,w=C.WJ,v=C.SP,s=C.BK,p=C.LF,f=C.NL,t=C.AI,r=C.AL,y=C.SA,b=C.SG,k=C.XX,l=C.CJ,C.ID,g=C.NS,C.characterClasses,I=n(408),d=I.DI_BRK,h=I.IN_BRK,a=I.CI_BRK,c=I.CP_BRK,I.PR_BRK,A=I.pairTable,E=x.toByteArray("AA4IAAAAAAAAAhqg5VV7NJtZvz7fTC8zU5deplUlMrQoWqmqahD5So0aipYWrUhVFSVBQ10iSTtUtW6nKDVF6k7d75eQfEUbFcQ9KiFS90tQEolcP23nrLPmO+esr/+f39rr/a293t/e7/P8nmfvlz0O6RvrBJADtbBNaD88IOKTOmOrCqhu9zE770vc1pBV/xL5dxj2V7Zj4FGSomFKStCWNlV7hG1VabZfZ1LaHbFrRwzzLjzPoi1UHDnlV/lWbhgIIJvLBp/pu7AHEdRnIY+ROdXxg4fNpMdTxVnnm08OjozejAVsBqwqz8kddGRlRxsd8c55dNZoPuex6a7Dt6L0NNb03sqgTlR2/OT7eTt0Y0WnpUXxLsp5SMANc4DsmX4zJUBQvznwexm9tsMH+C9uRYMPOd96ZHB29NZjCIM2nfO7tsmQveX3l2r7ft0N4/SRJ7kO6Y8ZCaeuUQ4gMTZ67cp7TgxvlNDsPgOBdZi2YTam5Q7m3+00l+XG7PrDe6YoPmHgK+yLih7fAR16ZFCeD9WvOVt+gfNW/KT5/M6rb/9KERt+N1lad5RneVjzxXHsLofuU+TvrEsr3+26sVz5WJh6L/svoPK3qepFH9bysDljWtD1F7KrxzW1i9r+e/NLxV/acts7zuo304J9+t3Pd6Y6u8f3EAqxNRgv5DZjaI3unyvkvHPya/v3mWVYOC38qBq11+yHZ2bAyP1HbkV92vdno7r2lxz9UwCdCJVfd14NLcpO2CadHS/XPJ9doXgz5vLv/1OBVS3gX0D9n6LiNIDfpilO9RsLgZ2W/wIy8W/Rh93jfoz4qmRV2xElv6p2lRXQdO6/Cv8f5nGn3u0wLXjhnvClabL1o+7yvIpvLfT/xsKG30y/sTvq30ia9Czxp9dr9v/e7Yn/O0QJXxxBOJmceP/DBFa1q1v6oudn/e6qc/37dUoNvnYL4plQ9OoneYOh/r8fOFm7yl7FETHY9dXd5K2n/qEc53dOEe1TTJcvCfp1dpTC334l0vyaFL6mttNEbFjzO+ZV2mLk0qc3BrxJ4d9gweMmjRorxb7vic0rSq6D4wzAyFWas1TqPE0sLI8XLAryC8tPChaN3ALEZSWmtB34SyZcxXYn/E4Tg0LeMIPhgPKD9zyHGMxxhxnDDih7eI86xECTM8zodUCdgffUmRh4rQ8zyA6ow/Aei+01a8OMfziQQ+GAEkhwN/cqUFYAVzA9ex4n6jgtsiMvXf5BtXxEU4hSphvx3v8+9au8eEekEEpkrkne/zB1M+HAPuXIz3paxKlfe8aDMfGWAX6Md6PuuAdKHFVH++Ed5LEji94Z5zeiJIxbmWeN7rr1/ZcaBl5/nimdHsHgIH/ssyLUXZ4fDQ46HnBb+hQqG8yNiKRrXL/b1IPYDUsu3dFKtRMcjqlRvONd4xBvOufx2cUHuk8pmG1D7PyOQmUmluisVFS9OWS8fPIe8LiCtjwJKnEC9hrS9uKmISI3Wa5+vdXUG9dtyfr7g/oJv2wbzeZU838G6mEvntUb3SVV/fBZ6H/sL+lElzeRrHy2Xbe7UWX1q5sgOQ81rv+2baej4fP4m5Mf/GkoxfDtT3++KP7do9Jn26aa6xAhCf5L9RZVfkWKCcjI1eYbm2plvTEqkDxKC402bGzXCYaGnuALHabBT1dFLuOSB7RorOPEhZah1NjZIgR/UFGfK3p1ElYnevOMBDLURdpIjrI+qZk4sffGbRFiXuEmdFjiAODlQCJvIaB1rW61Ljg3y4eS4LAcSgDxxZQs0DYa15wA032Z+lGUfpoyOrFo3mg1sRQtN/fHHCx3TrM8eTrldMbYisDLXbUDoXMLejSq0fUNuO1muX0gEa8vgyegkqiqqbC3W0S4cC9Kmt8MuS/hFO7Xei3f8rSvIjeveMM7kxjUixOrl6gJshe4JU7PhOHpfrRYvu7yoAZKa3Buyk2J+K5W+nNTz1nhJDhRUfDJLiUXxjxXCJeeaOe/r7HlBP/uURc/5efaZEPxr55Qj39rfTLkugUGyMrwo7HAglfEjDriehF1jXtwJkPoiYkYQ5aoXSA7qbCBGKq5hwtu2VkpI9xVDop/1xrC52eiIvCoPWx4lLl40jm9upvycVPfpaH9/o2D4xKXpeNjE2HPQRS+3RFaYTc4Txw7Dvq5X6JBRwzs9mvoB49BK6b+XgsZVJYiInTlSXZ+62FT18mkFVcPKCJsoF5ahb19WheZLUYsSwdrrVM3aQ2XE6SzU2xHDS6iWkodk5AF6F8WUNmmushi8aVpMPwiIfEiQWo3CApONDRjrhDiVnkaFsaP5rjIJkmsN6V26li5LNM3JxGSyKgomknTyyrhcnwv9Qcqaq5utAh44W30SWo8Q0XHKR0glPF4fWst1FUCnk2woFq3iy9fAbzcjJ8fvSjgKVOfn14RDqyQuIgaGJZuswTywdCFSa89SakMf6fe+9KaQMYQlKxiJBczuPSho4wmBjdA+ag6QUOr2GdpcbSl51Ay6khhBt5UXdrnxc7ZGMxCvz96A4oLocxh2+px+1zkyLacCGrxnPzTRSgrLKpStFpH5ppKWm7PgMKZtwgytKLOjbGCOQLTm+KOowqa1sdut9raj1CZFkZD0jbaKNLpJUarSH5Qknx1YiOxdA5L6d5sfI/unmkSF65Ic/AvtXt98Pnrdwl5vgppQ3dYzWFwknZsy6xh2llmLxpegF8ayLwniknlXRHiF4hzzrgB8jQ4wdIqcaHCEAxyJwCeGkXPBZYSrrGa4vMwZvNN9aK0F4JBOK9mQ8g8EjEbIQVwvfS2D8GuCYsdqwqSWbQrfWdTRUJMqmpnWPax4Z7E137I6brHbvjpPlfNZpF1d7PP7HB/MPHcHVKTMhLO4f3CZcaccZEOiS2DpKiQB5KXDJ+Ospcz4qTRCRxgrKEQIgUkKLTKKwskdx2DWo3bg3PEoB5h2nA24olwfKSR+QR6TAvEDi/0czhUT59RZmO1MGeKGeEfuOSPWfL+XKmhqpZmOVR9mJVNDPKOS49Lq+Um10YsBybzDMtemlPCOJEtE8zaXhsaqEs9bngSJGhlOTTMlCXly9Qv5cRN3PVLK7zoMptutf7ihutrQ/Xj7VqeCdUwleTTKklOI8Wep9h7fCY0kVtDtIWKnubWAvbNZtsRRqOYl802vebPEkZRSZc6wXOfPtpPtN5HI63EUFfsy7U/TLr8NkIzaY3vx4A28x765XZMzRZTpMk81YIMuwJ5+/zoCuZj1wGnaHObxa5rpKZj4WhT670maRw04w0e3cZW74Z0aZe2n05hjZaxm6urenz8Ef5O6Yu1J2aqYAlqsCXs5ZB5o1JJ5l3xkTVr8rJQ09NLsBqRRDT2IIjOPmcJa6xQ1R5yGP9jAsj23xYDTezdyqG8YWZ7vJBIWK56K+iDgcHimiQOTIasNSua1fOBxsKMMEKd15jxTl+3CyvGCR+UyRwuSI2XuwRIPoNNclPihfJhaq2mKkNijwYLY6feqohktukmI3KDvOpN7ItCqHHhNuKlxMfBAEO5LjW2RKh6lE5Hd1dtAOopac/Z4FdsNsjMhXz/ug8JGmbVJTA+VOBJXdrYyJcIn5+OEeoK8kWEWF+wdG8ZtZHKSquWDtDVyhFPkRVqguKFkLkKCz46hcU1SUY9oJ2Sk+dmq0kglqk4kqKT1CV9JDELPjK1WsWGkEXF87g9P98e5ff0mIupm/w6vc3kCeq04X5bgJQlcMFRjlFWmSk+kssXCAVikfeAlMuzpUvCSdXiG+dc6KrIiLxxhbEVuKf7vW7KmDQI95bZe3H9mN3/77F6fZ2Yx/F9yClllj8gXpLWLpd5+v90iOaFa9sd7Pvx0lNa1o1+bkiZ69wCiC2x9UIb6/boBCuNMB/HYR0RC6+FD9Oe5qrgQl6JbXtkaYn0wkdNhROLqyhv6cKvyMj1Fvs2o3OOKoMYTubGENLfY5F6H9d8wX1cnINsvz+wZFQu3zhWVlwJvwBEp69Dqu/ZnkBf3nIfbx4TK7zOVJH5sGJX+IMwkn1vVBn38GbpTg9bJnMcTOb5F6Ci5gOn9Fcy6Qzcu+FL6mYJJ+f2ZZJGda1VqruZ0JRXItp8X0aTjIcJgzdaXlha7q7kV4ebrMsunfsRyRa9qYuryBHA0hc1KVsKdE+oI0ljLmSAyMze8lWmc5/lQ18slyTVC/vADTc+SNM5++gztTBLz4m0aVUKcfgOEExuKVomJ7XQDZuziMDjG6JP9tgR7JXZTeo9RGetW/Xm9/TgPJpTgHACPOGvmy2mDm9fl09WeMm9sQUAXP3Su2uApeCwJVT5iWCXDgmcuTsFgU9Nm6/PusJzSbDQIMfl6INY/OAEvZRN54BSSXUClM51im6Wn9VhVamKJmzOaFJErgJcs0etFZ40LIF3EPkjFTjGmAhsd174NnOwJW8TdJ1Dja+E6Wa6FVS22Haj1DDA474EesoMP5nbspAPJLWJ8rYcP1DwCslhnn+gTFm+sS9wY+U6SogAa9tiwpoxuaFeqm2OK+uozR6SfiLCOPz36LiDlzXr6UWd7BpY6mlrNANkTOeme5EgnnAkQRTGo9T6iYxbUKfGJcI9B+ub2PcyUOgpwXbOf3bHFWtygD7FYbRhb+vkzi87dB0JeXl/vBpBUz93VtqZi7AL7C1VowTF+tGmyurw7DBcktc+UMY0E10Jw4URojf8NdaNpN6E1q4+Oz+4YePtMLy8FPRP"),T=new S(E),m=function(){var e,n,m;function S(e){this.string=e,this.pos=0,this.lastPos=0,this.curClass=null,this.nextClass=null}return S.prototype.nextCodePoint=function(){var e,t;return e=this.string.charCodeAt(this.pos++),t=this.string.charCodeAt(this.pos),55296<=e&&e<=56319&&56320<=t&&t<=57343?(this.pos++,1024*(e-55296)+(t-56320)+65536):e},n=function(e){switch(e){case t:case y:case b:case k:return r;case l:return g;default:return e}},m=function(e){switch(e){case p:case f:return s;case o:return i;case v:return w;default:return e}},S.prototype.nextCharClass=function(e){return null==e&&(e=!1),n(T.get(this.nextCodePoint()))},e=function(e,t){this.position=e,this.required=null!=t&&t},S.prototype.nextBreak=function(){var t,r,l;for(null==this.curClass&&(this.curClass=m(this.nextCharClass()));this.pos=this.string.length)return this.lastPos>>=1,t}function v(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,r+n}function S(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++i,n+=t.table[i],r-=t.table[i]}while(r>=0);return e.tag=s,e.bitcount-=i,t.trans[n+r]}function w(e,t,n){var r,i,s,o,a,l;for(r=v(e,5,257),i=v(e,5,1),s=v(e,4,4),o=0;o<19;++o)m[o]=0;for(o=0;o8;)e.sourceIndex--,e.bitcount-=8;if((t=256*(t=e.source[e.sourceIndex+1])+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return r;for(e.sourceIndex+=4,i=t;i;--i)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,n}!function(e,t){var n;for(n=0;n<7;++n)e.table[n]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,n=0;n<24;++n)e.trans[n]=256+n;for(n=0;n<144;++n)e.trans[24+n]=n;for(n=0;n<8;++n)e.trans[168+n]=280+n;for(n=0;n<112;++n)e.trans[176+n]=144+n;for(n=0;n<5;++n)t.table[n]=0;for(t.table[5]=32,n=0;n<32;++n)t.trans[n]=n}(o,a),f(l,c,4,3),f(u,d,2,1),l[28]=0,c[28]=258,e.exports=function(e,t){var i,l,c=new s(e,t);do{switch(i=b(c),v(c,2,0)){case 0:l=x(c);break;case 1:l=k(c,o,a);break;case 2:w(c,c.ltree,c.dtree),l=k(c,c.ltree,c.dtree);break;default:l=r}if(l!==n)throw new Error("Data error")}while(!i);return c.destLen0)throw new Error("Invalid string. Length must be a multiple of 4");var l=e.length;o="="===e.charAt(l-2)?2:"="===e.charAt(l-1)?1:0,a=new t(3*e.length/4-o),i=o>0?e.length-4:e.length;var u=0;function d(e){a[u++]=e}for(n=0,r=0;n>16),d((65280&s)>>8),d(255&s);return 2===o?d(255&(s=c(e.charAt(n))<<2|c(e.charAt(n+1))>>4)):1===o&&(d((s=c(e.charAt(n))<<10|c(e.charAt(n+1))<<4|c(e.charAt(n+2))>>2)>>8&255),d(255&s)),a},e.fromByteArray=function(e){var t,n,r,i,s=e.length%3,o="";function a(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-s;t>18&63)+a(i>>12&63)+a(i>>6&63)+a(63&i);switch(s){case 1:o+=a((n=e[e.length-1])>>2),o+=a(n<<4&63),o+="==";break;case 2:o+=a((n=(e[e.length-2]<<8)+e[e.length-1])>>10),o+=a(n>>4&63),o+=a(n<<2&63),o+="="}return o}}(t)},function(e,t){(function(){t.OP=0,t.CL=1,t.CP=2,t.QU=3,t.GL=4,t.NS=5,t.EX=6,t.SY=7,t.IS=8,t.PR=9,t.PO=10,t.NU=11,t.AL=12,t.HL=13,t.ID=14,t.IN=15,t.HY=16,t.BA=17,t.BB=18,t.B2=19,t.ZW=20,t.CM=21,t.WJ=22,t.H2=23,t.H3=24,t.JL=25,t.JV=26,t.JT=27,t.RI=28,t.AI=29,t.BK=30,t.CB=31,t.CJ=32,t.CR=33,t.LF=34,t.NL=35,t.SA=36,t.SG=37,t.SP=38,t.XX=39}).call(this)},function(e,t){(function(){t.DI_BRK=0,t.IN_BRK=1,t.CI_BRK=2,t.CP_BRK=3,t.PR_BRK=4,t.pairTable=[[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,4,4,4,4,4,4,4],[0,4,4,1,1,4,4,4,4,1,1,0,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,1,4,4,4,4,1,1,1,1,1,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[4,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,1,1,4,4,4,0,0,1,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,1,1,4,4,4,0,0,1,1,1,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,1,0,1,1,0,0,4,2,4,1,1,1,1,1,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,0,1,4,4,4,0,0,1,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,0,1,4,4,4,0,0,0,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,0,1,1,0,4,4,2,4,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,1,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,1,1,1,1,0,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,1,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,1]]}).call(this)},function(e,t,n){(function(e){(function(){var r,i,s,o,a,l,c,u,d,h,p,m,f,g,y,b;b=n(410),r=b.CR,a=b.LF,i=b.Control,s=b.Extend,u=b.Regional_Indicator,d=b.SpacingMark,o=b.L,m=b.V,h=b.T,l=b.LV,c=b.LVT,p=n(113),f=new p(e("AA4QAAAAAAAAAHbgAQgG9/ntmkuIXjUUxzN+r3k4bUWQVotSHVCsoov6qIoiToWKFYvMuLHVtlaoLqQilLrwtakuxFYoLmQQYWalRYpUKYJV0am4mMUooojgSEG7EC2CdiHq/3rzMcc0yT333jyu0xz4kdwkN+ckOXncfN9QS4jzwCqwBqwHt5O0uuFGsBlsAhOM8lvATkv+LrAb7AXPgRfBAfAqeJ2UmwZvgcPgKDgGjoNZMAe+AN+C5W0hLgAXtvN3KZci7UpwFVgHbgHjYAPYJJ8nwCTYCnaQ58dI+cfBHvn8DFgL9kl9LyP8LLOflJ8CM+Q5K39IPo/28vfeyd6X8fcR/5jYP4v4nHyeR/iNjC8gPAl+BU+T8qcRFx0hBsGKzn/74LreIrdKxsGkRO0zE48wy7lmZSfnYkmWdhnCtTK+oHnnWqUPbuyY679N5t2J8B4ZnyTltyK+Dezq5P62G+Femf+sDPdp6n8JaQcterN5NWXJ5/Ij+FnGR0n6BvCbZk4kwjGjjO8rGh9woedNoudtBz6VSCQSiUQikUgkEomET97t5Hdp/ecvGfcXH+CdWfLNu6onxGowh7SvZPp3CE+A63v5feBJxMcQPyXz/0D4N2h18+cRhEcQnt+1674I+Q+inofANrAd7AAPg529lJfyUl7KS3mu8+4G94H7e/H3rPWRid3+RGIpc0nBGbAuE63F39VV1mjS6Pn4VCv++jN9bs4JMM5gbFSIdaNnpj+ppE3j+QQYWybEA8vytP0IPwF/gpXLsQ+AhWH0xYgQPwwJMTjA46YRXrnVw4vxzYjvke8dzvQx60gkEonE0uQA9oU3wB04J7yH/fDDVv4/j+x/QqfJXv0RuEueJe7t5vkTCLeQ88V2zVkjq+tRpD/Rzf+39hTC55lnkhdQbr+l7EHkTZH8GcTnSf4hkpf9/+uI57NQFT6HTSsC6hMYg3no/FrTF983sH84FJ3xNlroteOfQWNTp+8vL/CZeeX5mgb62A2w6WaDXa/9D/6DeFTafqwBfXtFT4irwacObMnm50/dPPwF4e/grwa0kUsTxiMEnQbcY9ZlsDXwL4iyOIfEB5jvcEgST1L/u/PjkP7vctzaZzkuJZSepknsMaw67jQ0xZe61F2XyvZ5k/ecJq4voXzQ1oZWQRm1Dl1ZH0LtiiVN8pUmy9nQD77bppuTLqWl1O9Ch+9vv9Dfm12COrZqOrXRJv13TX6i00XHyISLNamp3/e6eWWab9xyoYSr1+XeUoWug7ZWFTonhLDPO9M8pOX7cVHwbhn7Yu1VantC61ZtMPWhaiMtX0YXp1wsf7X5p65sW/OslnXpV3XrN803WneXlC0zvj5EZ5sP/6yyXsQQ01rRVdJV/+XWXUZ/rPmp7gf9dNuZoKjOmOOZibqv6fY43fi6bp9pfoXyL1tZ0x5Fy6u+UcVOrm1FZxdOPS7OLi7sFaKaXt+2c/X71qELqbhcD4v8wgRnb6+rr459rqgr3H5T21tmza0r3LOnj/6oWkcmnP6pa7OPvve9dvmqm+PD1HdteyP3e7xsX/mcK7Y26tJV0bXfVI/vOa9bZ3wIbS9nraehKHiH248cn/KxtpX1bV3bQoptnGx+S9ND2xujn6jo+ku3Jvic16oO3djo7CsrnHWdM1dd9UPR/OFQ9rtKl2ZaQ4vaWWe9KGOzSV8dcenPZdvhUny1QZdW1ce4fuhSdGuYb/F1h8IV3/PPlR0+pOya6dofdPuDbt8oug9uis+YvguqjiHnnVDz1KbfR30637f1Y5U+1o2VrVxZMX37qvfcof1XJzFtCKG76plJCJ7fhTq/FJ0hqI/FFtMaGWOv69vjUsrePZTZQ331h8lm07dj1fpCn2Fi3EX09atn2L6Ynsv4AFfUernj4HucbGc8dU0w+aDL+4M6YmtLX0z3I7Ha4Fpn1bufKucck2/YfIhrP3dfci0h5puv9TfUPs21g8bbmvzQZ4tQfhNSiuZ4HVzp4rShTHt9icl2l31YVTqB6Eus81pd/U2xuwyxpYrNPsik1wCoDEZmyDMjCmXFZVtV8d12DqoMizP7zCeh9anyDw==","base64")),g=function(e,t){var n,r,i;return t=t||0,55296<=(n=e.charCodeAt(t))&&n<=56319?(r=n,56320<=(i=e.charCodeAt(t+1))&&i<=57343?1024*(r-55296)+(i-56320)+65536:r):56320<=n&&n<=57343?(i=n,55296<=(r=e.charCodeAt(t-1))&&r<=56319?1024*(r-55296)+(i-56320)+65536:i):n},y=function(e,t){return(e!==r||t!==a)&&(e===i||e===r||e===a||(t===i||t===r||t===a||(e!==o||t!==o&&t!==m&&t!==l&&t!==c)&&((e!==l&&e!==m||t!==m&&t!==h)&&((e!==c&&e!==h||t!==h)&&((e!==u||t!==u)&&(t!==s&&t!==d))))))},t.nextBreak=function(e,t){var n,r,i,s,o,a,l;if(null==t&&(t=0),t<0)return 0;if(t>=e.length-1)return e.length;for(i=f.get(g(e,t)),n=s=t+1,o=e.length;se.length)return e.length;if(t<=1)return 0;for(t--,r=f.get(g(e,t)),n=s=t-1;s>=0;n=s+=-1)if(!(55296<=(o=e.charCodeAt(n))&&o<=56319&&56320<=(a=e.charCodeAt(n+1))&&a<=57343)){if(i=f.get(g(e,n)),y(i,r))return n+1;r=i}return 0},t.break=function(e){var n,r,i;for(i=[],r=0;(n=t.nextBreak(e,r)) * {\n position: absolute;\n top: 0;\n left: 0;\n}\n"},function(e,t,n){const r=n(413),i=n(39),s=n(415),o=n(416),a=n(418),l=n(419),c=n(420),u=n(421),d=n(422),h=n(116),p=n(423);e.exports=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(()=>{const e=window.AudioContext||window.webkitAudioContext;if(!e)throw new Error("Browser does not support AudioContext");return new e})();this.audioContext=e,this.inputNode=this.audioContext.createGain(),this.inputNode.connect(this.audioContext.destination),this.audioBuffers={},this.loudness=null,this.effects=[u,d,h],r(this.audioContext)}get currentTime(){return this.audioContext.currentTime}get EFFECT_NAMES(){return{pitch:"pitch",pan:"pan"}}get DECAY_DURATION(){return.025}get DECAY_WAIT(){return.05}getInputNode(){return this.inputNode}_decodeSound(e){const t=e.data.buffer.slice(0),n=s();var r,a;return(r=this.audioContext,a=t,1===r.decodeAudioData.length?r.decodeAudioData(a):new Promise(((e,t)=>{r.decodeAudioData(a,(t=>e(t)),(e=>t(e)))}))).catch((()=>{if(0===e.data.length)return this._emptySound();const t=e.data.buffer.slice(0);return new o(this.audioContext).decode(t).catch((()=>this._emptySound()))})).then((e=>[n,e]),(e=>{i.warn("audio data could not be decoded",e)}))}_emptySound(){return this.audioContext.createBuffer(1,1,this.audioContext.sampleRate)}decodeSound(e){return this._decodeSound(e).then((e=>{let[t,n]=e;return this.audioBuffers[t]=n,t}))}decodeSoundPlayer(e){return this._decodeSound(e).then((e=>{let[t,n]=e;return new l(this,{id:t,buffer:n})}))}getLoudness(){return this.loudness||(this.loudness=new a(this.audioContext)),this.loudness.getLoudness()}createEffectChain(){const e=new c(this,this.effects);return e.connect(this),e}createBank(){return new p(this,this.createEffectChain())}}},function(e,t,n){const r=n(414);e.exports=function(e){if("undefined"!=typeof document)return r(e)}},function(e,t){const n=["mousedown","mouseup","keydown","keyup","touchstart","touchend"];e.exports=e=>{if("running"===e.state)return;const t=()=>{"running"===e.state&&(()=>{e.removeEventListener("statechange",t);for(const e of n)document.body.removeEventListener(e,r)})()};e.addEventListener("statechange",t);const r=()=>{e.resume()};for(const e of n)document.body.addEventListener(e,r)}},function(e,t){const n="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";e.exports=function(){const e=n.length,t=[];for(let r=0;r<20;r++)t[r]=n.charAt(Math.random()*e);return t.join("")}},function(e,t,n){const r=n(417),i=n(39),s=[7,8,9,10,11,12,13,14,16,17,19,21,23,25,28,31,34,37,41,45,50,55,60,66,73,80,88,97,107,118,130,143,157,173,190,209,230,253,279,307,337,371,408,449,494,544,598,658,724,796,876,963,1060,1166,1282,1411,1552,1707,1878,2066,2272,2499,2749,3024,3327,3660,4026,4428,4871,5358,5894,6484,7132,7845,8630,9493,10442,11487,12635,13899,15289,16818,18500,20350,22385,24623,27086,29794,32767],o=[-1,-1,-1,-1,2,4,6,8,-1,-1,-1,-1,2,4,6,8];let a=null;e.exports=class{constructor(e){this.audioContext=e}static get STEP_TABLE(){return s}static get INDEX_TABLE(){return o}decode(e){return new Promise(((t,n)=>{const s=new r(e);"RIFF"!==s.readUint8String(4)&&(i.warn("incorrect adpcm wav header"),n(new Error("incorrect adpcm wav header")));const o=s.readInt32();o+8!==e.byteLength&&i.warn("adpcm wav length in header: ".concat(o," is incorrect"));"WAVE"!==s.readUint8String(4)&&(i.warn("incorrect adpcm wav header"),n(new Error("incorrect adpcm wav header")));const a=this.extractChunk("fmt ",s);this.encoding=a.readUint16(),this.channels=a.readUint16(),this.samplesPerSecond=a.readUint32(),this.bytesPerSecond=a.readUint32(),this.blockAlignment=a.readUint16(),this.bitsPerSample=a.readUint16(),a.position+=2,this.samplesPerBlock=a.readUint16(),this.adpcmBlockSize=(this.samplesPerBlock-1)/2+4;const l=this.extractChunk("data",s),c=this.numberOfSamples(l,this.adpcmBlockSize),u=this.audioContext.createBuffer(1,c,this.samplesPerSecond);this.imaDecompress(l,this.adpcmBlockSize,u.getChannelData(0)),t(u)}))}extractChunk(e,t){for(t.position=12;t.position>1),1&e&&(i+=t>>2),i+=t>>3,a[n++]=8&e?-i:i}}return a}();let m=0;for(;m88&&(c=88),n[m++]=r/32768;const t=Math.min(h,d-m),s=m;for(;m-s88?c=88:c<0&&(c=0),r+=l,r>32767?r=32767:r<-32768&&(r=-32768),n[m++]=r/32768,i=u>>4&15,l=p[16*c+i],c+=o[i],c>88?c=88:c<0&&(c=0),r+=l,r>32767?r=32767:r<-32768&&(r=-32768),n[m++]=r/32768}}}},function(e,t){class n{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.byteLength,{_uint8View:r=new Uint8Array(e)}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this.arrayBuffer=e,this.start=t,this.end=n,this._uint8View=r,this._position=t}extract(e){return new n(this.arrayBuffer,this._position,this._position+e,this)}getLength(){return this.end-this.start}getBytesAvailable(){return this.end-this._position}get position(){return this._position-this.start}set position(e){this._position=e+this.start}readUint8(){const e=this._uint8View[this._position];return this._position+=1,e}readUint8String(e){const t=this._uint8View;let n="";const r=this._position+e;for(let e=this._position;e{this.audioStream=e,this.mic=this.audioContext.createMediaStreamSource(e),this.analyser=this.audioContext.createAnalyser(),this.mic.connect(this.analyser),this.micDataArray=new Float32Array(this.analyser.fftSize)})).catch((e=>{r.warn(e)}))),this.mic&&this.audioStream.active){this.analyser.getFloatTimeDomainData(this.micDataArray);let e=0;for(let t=0;tthis.audioEngine.currentTime}handleEvent(e){e.type===s&&this.onEnded()}onEnded(){this.emit("stop"),this.isPlaying=!1}_createSource(){null!==this.outputNode&&(this.outputNode.removeEventListener(s,this.handleEvent),this.outputNode.disconnect()),this.outputNode=this.audioEngine.audioContext.createBufferSource(),this.outputNode.playbackRate.value=this.playbackRate,this.outputNode.buffer=this.buffer,this.outputNode.addEventListener(s,this.handleEvent),null!==this.target&&this.connect(this.target)}initialize(){this.initialized=!0,this._createSource()}connect(e){return e===this.volumeEffect?(this.outputNode.disconnect(),void this.outputNode.connect(this.volumeEffect.getInputNode())):(this.target=e,this.initialized?(null===this.volumeEffect?(this.outputNode.disconnect(),this.outputNode.connect(e.getInputNode())):this.volumeEffect.connect(e),this):void 0)}dispose(){this.initialized&&(this.stopImmediately(),null!==this.volumeEffect&&(this.volumeEffect.dispose(),this.volumeEffect=null),this.outputNode.disconnect(),this.outputNode=null,this.target=null,this.initialized=!1)}take(){this.outputNode&&this.outputNode.removeEventListener(s,this.handleEvent);const e=new o(this.audioEngine,this);return e.playbackRate=this.playbackRate,this.isPlaying&&(e.startingUntil=this.startingUntil,e.isPlaying=this.isPlaying,e.initialized=this.initialized,e.outputNode=this.outputNode,e.outputNode.addEventListener(s,e.handleEvent),e.volumeEffect=this.volumeEffect,e.volumeEffect&&(e.volumeEffect.audioPlayer=e),null!==this.target&&e.connect(this.target),this.emit("stop"),e.emit("play")),this.outputNode=null,this.volumeEffect=null,this.initialized=!1,this.startingUntil=0,this.isPlaying=!1,e}play(){if(this.isStarting)return this.emit("stop"),void this.emit("play");this.isPlaying&&this.stop(),this.initialized?this._createSource():this.initialize(),this.outputNode.start(),this.isPlaying=!0;const{currentTime:e,DECAY_DURATION:t}=this.audioEngine;this.startingUntil=e+t,this.emit("play")}stop(){if(!this.isPlaying)return;const e=this.take();e.volumeEffect=new i(e.audioEngine,e,null),e.volumeEffect.connect(e.target),e.finished().then((()=>e.dispose())),e.volumeEffect.set(0);const{currentTime:t,DECAY_DURATION:n}=this.audioEngine;e.outputNode.stop(t+n)}stopImmediately(){this.isPlaying&&(this.outputNode.stop(),this.isPlaying=!1,this.startingUntil=0,this.emit("stop"))}finished(){return new Promise((e=>{this.once("stop",e)}))}setPlaybackRate(e){this.playbackRate=e,this.initialized&&(this.outputNode.playbackRate.value=e)}}e.exports=o},function(e,t){class n{constructor(e,t){this.audioEngine=e,this.inputNode=this.audioEngine.audioContext.createGain(),this.effects=t;let n=null;this._effects=t.reverse().map((t=>{const r=new t(e,this,n);return this[r.name]=r,n=r,r})).reverse(),this.firstEffect=this._effects[0],this.lastEffect=this._effects[this._effects.length-1],this._soundPlayers=new Set}clone(){const e=new n(this.audioEngine,this.effects);return this.target&&e.connect(this.target),e}addSoundPlayer(e){this._soundPlayers.has(e)||(this._soundPlayers.add(e),this.update())}removeSoundPlayer(e){this._soundPlayers.remove(e)}getInputNode(){return this.inputNode}connect(e){const{firstEffect:t,lastEffect:n}=this;if(e===n)return this.inputNode.disconnect(),void this.inputNode.connect(n.getInputNode());e!==t&&(this.target=e,t.connect(e))}getSoundPlayers(){return[...this._soundPlayers]}setEffectsFromTarget(e){this._effects.forEach((t=>{"soundEffects"in e&&t.name in e.soundEffects?t.set(e.soundEffects[t.name]):t.name in e&&t.set(e[t.name])}))}set(e,t){e in this&&this[e].set(t)}update(){this._effects.forEach((e=>e.update()))}clear(){this._effects.forEach((e=>e.clear()))}dispose(){this._soundPlayers=null,this._effects.forEach((e=>e.dispose())),this._effects=null}}e.exports=n},function(e,t,n){const r=n(60);e.exports=class extends r{constructor(e,t,n){super(e,t,n),this.leftGain=null,this.rightGain=null,this.channelMerger=null}get name(){return"pan"}initialize(){const e=this.audioEngine.audioContext;this.inputNode=e.createGain(),this.leftGain=e.createGain(),this.rightGain=e.createGain(),this.channelMerger=e.createChannelMerger(2),this.outputNode=this.channelMerger,this.inputNode.connect(this.leftGain),this.inputNode.connect(this.rightGain),this.leftGain.connect(this.channelMerger,0,0),this.rightGain.connect(this.channelMerger,0,1),this.initialized=!0}_set(e){this.value=e;const t=(e+100)/200,n=Math.cos(t*Math.PI/2),r=Math.sin(t*Math.PI/2),{currentTime:i,DECAY_WAIT:s,DECAY_DURATION:o}=this.audioEngine;this.leftGain.gain.setTargetAtTime(n,i+s,o),this.rightGain.gain.setTargetAtTime(r,i+s,o)}dispose(){this.initialized&&(this.inputNode.disconnect(),this.leftGain.disconnect(),this.rightGain.disconnect(),this.channelMerger.disconnect(),this.inputNode=null,this.leftGain=null,this.rightGain=null,this.channelMerger=null,this.outputNode=null,this.target=null,this.initialized=!1)}}},function(e,t,n){const r=n(60);e.exports=class extends r{constructor(e,t,n){super(e,t,n),this.ratio=1}get name(){return"pitch"}get _isPatch(){return!1}getInputNode(){return this.target.getInputNode()}initialize(){this.initialized=!0}_set(e){this.value=e,this.ratio=this.getRatio(this.value),this.updatePlayers(this.audioPlayer.getSoundPlayers())}update(){this.updatePlayers(this.audioPlayer.getSoundPlayers())}getRatio(e){const t=e/10;return Math.pow(2,t/12)}updatePlayer(e){e.setPlaybackRate(this.ratio)}updatePlayers(e){if(e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.updatePlayer(e[t])}}},function(e,t,n){const r=n(39);e.exports=class{constructor(e,t){this.audioEngine=e,this.soundPlayers={},this.playerTargets=new Map,this.soundEffects=new Map,this.effectChainPrime=t}addSoundPlayer(e){this.soundPlayers[e.id]=e}getSoundPlayer(e){return this.soundPlayers[e]||r.error("SoundBank.getSoundPlayer(".concat(e,"): called missing sound in bank")),this.soundPlayers[e]}getSoundEffects(e){return this.soundEffects.has(e)||this.soundEffects.set(e,this.effectChainPrime.clone()),this.soundEffects.get(e)}playSound(e,t){const n=this.getSoundEffects(t),r=this.getSoundPlayer(t);return this.playerTargets.get(t)!==e&&r.stop(),this.playerTargets.set(t,e),n.addSoundPlayer(r),n.setEffectsFromTarget(e),r.connect(n),r.play(),r.finished()}setEffects(e){this.playerTargets.forEach(((t,n)=>{t===e&&this.getSoundEffects(n).setEffectsFromTarget(e)}))}stop(e,t){this.playerTargets.get(t)===e&&this.soundPlayers[t].stop()}stopAllSounds(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*";this.playerTargets.forEach(((t,n)=>{"*"!==e&&t!==e||this.getSoundPlayer(n).stop()}))}dispose(){this.playerTargets.clear(),this.soundEffects.forEach((e=>e.dispose())),this.soundEffects.clear();for(const e in this.soundPlayers)Object.prototype.hasOwnProperty.call(this.soundPlayers,e)&&this.soundPlayers[e].dispose();this.soundPlayers={}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"SB1File",(function(){return st})),n.d(t,"AssertionError",(function(){return r})),n.d(t,"ValidationError",(function(){return i}));class r extends Error{}class i extends r{}const s=function(e,t){if(!e)throw new r(t)};s.validate=function(e,t){if(!e)throw new i(t)};class o{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.buffer=e,this.position=t,this.uint8a=new Uint8Array(this.buffer)}read(e){const t=e.read(this.uint8a,this.position);return 0===e.size?this.position+=e.sizeOf(this.uint8a,this.position):this.position+=e.size,t}readStruct(e){const t=new e(this.uint8a,this.position);return this.position+=e.size,t}resize(e){if(this.buffer.byteLength1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;s(e instanceof Uint8Array,"writeBytes must be passed an Uint8Array"),this.resize(this.position+(n-t));for(let r=t;r1&&void 0!==arguments[1]?arguments[1]:1/0;this.iter=e,this.maxPosition=t}[Symbol.iterator](){return this}next(){return this.iter.stream.position>=this.maxPosition?{value:null,done:!0}:this.iter.next()}}const l=()=>{throw new Error("Not implemented")},c=(()=>{const e=new Uint16Array(1),t=new Uint8Array(e.buffer);return e[0]=43707,187===t[0]})();class u{constructor(e){let{size:t=0,sizeOf:n=(()=>t),writeSizeOf:r=l,toBytes:i=new Uint8Array(1),read:s,write:o=l}=e;this.size=t,this.sizeOf=n,this.writeSizeOf=r,this.toBytes=i,this.bytes=new Uint8Array(i.buffer),this.read=s,this.write=o}asPropertyObject(e){const t=this;return{get(){return t.read(this.uint8a,e+this.offset)},set(n){return t.write(this.uint8a,e+this.offset,n)},enumerable:!0}}read(){return null}}const d=new u({size:1,read:(e,t)=>e[t],write:(e,t,n)=>(e[t]=n,n)}),h={size:2,read(e,t){return this.bytes[1]=e[t+0],this.bytes[0]=e[t+1],this.toBytes[0]},write(e,t,n){return this.toBytes[0]=n,e[t+0]=this.bytes[1],e[t+1]=this.bytes[0],n}},p={size:2,read(e,t){return this.bytes[0]=e[t+0],this.bytes[1]=e[t+1],this.toBytes[0]},write(e,t,n){return this.toBytes[0]=n,e[t+0]=this.bytes[0],e[t+1]=this.bytes[1],n}};let m;m=c?h:p;new u(Object.assign({},m,{toBytes:new Uint16Array(1)}));const f=new u(Object.assign({},m,{toBytes:new Int16Array(1)})),g={size:4,read(e,t){return this.bytes[3]=e[t+0],this.bytes[2]=e[t+1],this.bytes[1]=e[t+2],this.bytes[0]=e[t+3],this.toBytes[0]},write(e,t,n){return this.toBytes[0]=n,e[t+0]=this.bytes[3],e[t+1]=this.bytes[2],e[t+2]=this.bytes[1],e[t+3]=this.bytes[0],n}},y={size:4,read(e,t){return this.bytes[0]=e[t+0],this.bytes[1]=e[t+1],this.bytes[2]=e[t+2],this.bytes[3]=e[t+3],this.toBytes[0]},write(e,t,n){return this.toBytes[0]=n,e[t+0]=this.bytes[0],e[t+1]=this.bytes[1],e[t+2]=this.bytes[2],e[t+3]=this.bytes[3],n}};let b;b=c?g:y;const v=new u(Object.assign({},b,{toBytes:new Int32Array(1)})),S=new u(Object.assign({},b,{toBytes:new Uint32Array(1)}));let w;w=c?p:h;const k=new u(Object.assign({},w,{toBytes:new Uint16Array(1)}));let x;x=c?y:g;const T=new u(Object.assign({},x,{toBytes:new Uint32Array(1)}));let E;E=c?{size:8,read(e,t){return this.bytes[7]=e[t+0],this.bytes[6]=e[t+1],this.bytes[5]=e[t+2],this.bytes[4]=e[t+3],this.bytes[3]=e[t+4],this.bytes[2]=e[t+5],this.bytes[1]=e[t+6],this.bytes[0]=e[t+7],this.toBytes[0]}}:{size:8,read(e,t){return this.bytes[7]=e[t+0],this.bytes[6]=e[t+1],this.bytes[5]=e[t+2],this.bytes[4]=e[t+3],this.bytes[3]=e[t+4],this.bytes[2]=e[t+5],this.bytes[1]=e[t+6],this.bytes[0]=e[t+7],this.toBytes[0]}};const A=new u(Object.assign({},E,{toBytes:new Float64Array(1)}));class C extends u{constructor(e){super({size:e,read(t,n){let r="";for(let i=0;ie[t+0]<<16|e[t+1]<<8|e[t+2]}:{size:3,read:(e,t)=>e[t+2]<<16|e[t+1]<<8|e[t+0]});const N=new u({sizeOf(e,t){const n=f.read(e,t);return f.size+n},read(e,t){let n=0,r=0;const i=f.read(e,t);for(let s=0;sS.size+S.read(e,t),read(e,t){const n=S.read(e,t);return s(nS.size+2*S.read(e,t),read(e,t){const n=S.read(e,t);s(nS.size+S.read(e,t)*S.size,read(e,t){const n=S.read(e,t);s(nS.size+S.read(e,t),read(e,t){const n=S.read(e,t);return s(n>22&255)<<16|(n>>12&255)<<8|n>>2&255)>>>0}}),j=new u({size:5,read(e,t){const n=S.read(e,t);return(d.read(e,t)<<24|(n>>22&255)<<16|(n>>12&255)<<8|n>>2&255)>>>0}}),F={NULL:1,TRUE:2,FALSE:3,SMALL_INT:4,SMALL_INT_16:5,LARGE_INT_POSITIVE:6,LARGE_INT_NEGATIVE:7,FLOATING:8,STRING:9,SYMBOL:10,BYTES:11,SOUND:12,BITMAP:13,UTF8:14,ARRAY:20,ORDERED_COLLECTION:21,SET:22,IDENTITY_SET:23,DICTIONARY:24,IDENTITY_DICTIONARY:25,COLOR:30,TRANSLUCENT_COLOR:31,POINT:32,RECTANGLE:33,FORM:34,SQUEAK:35,OBJECT_REF:99,MORPH:100,ALIGNMENT:104,STATIC_STRING:105,UPDATING_STRING:106,SAMPLED_SOUND:109,IMAGE_MORPH:110,SPRITE:124,STAGE:125,WATCHER:155,IMAGE_MEDIA:162,SOUND_MEDIA:164,MULTILINE_STRING:171,WATCHER_READOUT_FRAME:173,WATCHER_SLIDER:174,LIST_WATCHER:175},W=Object.entries(F).reduce(((e,t)=>{let[n,r]=t;return e[r]=n,e}),{});class V{constructor(e,t){this.classId=e,this.position=t}}const G=e=>"object"==typeof e&&e?e.valueOf():e;class q extends V{constructor(e,t,n){super(e,t),this.value=n}valueOf(){return this.value}toJSON(){return this.classId===F.TRANSLUCENT_COLOR||this.classId===F.COLOR?16777215&this.value:this.value}toString(){return this.value}}class Y extends V{constructor(e,t,n){super(e,t),this.size=n}}class H extends V{constructor(e,t,n){super(e,t),this.index=n}valueOf(){return"Ref(".concat(this.index,")")}}class _ extends Y{constructor(e,t,n,r){super(e,t,r),this.version=n}}class K{constructor(e){let{type:t=q,read:n,value:r=(n?e=>e.read(n):null)}=e;this.type=t,this.value=r}next(e,t,n){return{value:new this.type(t,n,this.value(e)),done:!1}}}const Q={[F.NULL]:{value:()=>null},[F.TRUE]:{value:()=>!0},[F.FALSE]:{value:()=>!1},[F.SMALL_INT]:{read:v},[F.SMALL_INT_16]:{read:f},[F.LARGE_INT_POSITIVE]:{read:N},[F.LARGE_INT_NEGATIVE]:{read:N},[F.FLOATING]:{read:A},[F.STRING]:{read:R},[F.SYMBOL]:{read:R},[F.BYTES]:{read:D},[F.SOUND]:{read:P},[F.BITMAP]:{read:L},[F.UTF8]:{read:z},[F.ARRAY]:{type:Y,read:v},[F.ORDERED_COLLECTION]:{type:Y,read:v},[F.SET]:{type:Y,read:v},[F.IDENTITY_SET]:{type:Y,read:v},[F.DICTIONARY]:{type:Y,value:e=>2*e.read(v)},[F.IDENTITY_DICTIONARY]:{type:Y,value:e=>2*e.read(v)},[F.COLOR]:{read:U},[F.TRANSLUCENT_COLOR]:{read:j},[F.POINT]:{type:Y,value:()=>2},[F.RECTANGLE]:{type:Y,value:()=>4},[F.FORM]:{type:Y,value:()=>5},[F.SQUEAK]:{type:Y,value:()=>6},[F.OBJECT_REF]:{type:H,read:M}},X=Array.from({length:256},((e,t)=>Q[t]?new K(Q[t]):null)),Z=new K({type:class extends Y{constructor(e,t){super(e,t,0)}},value:()=>null});class J{constructor(e,t){this.buffer=e,this.stream=new o(e,t)}[Symbol.iterator](){return this}next(){if(this.stream.position>=this.stream.uint8a.length)return{value:null,done:!0};const e=this.stream.position,t=this.stream.read(d),n=X[t];if(null!==n)return n.next(this.stream,t,e);if(t1&&void 0!==arguments[1]?arguments[1]:$;class n extends t{get FIELDS(){return e}static get FIELDS(){return e}}return Object.keys(e).forEach((t=>{const r=e[t];Object.defineProperty(n.prototype,t.toLowerCase().replace(/_(\w)/g,(e=>{let[,t]=e;return t.toUpperCase()})),{get(){return this.fields[r]}})})),n}}class ee{constructor(){let e;this.bit=new Uint32Array(1),this.crc=0,this.c=0,this.table=[];for(let t=0;t<256;t++){e=t;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;this.table[t]=e>>>0}}update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=~this.crc>>>0;for(let i=0;i>>8^this.table[255&(r^e[t+i])];return this.crc=~r>>>0,this}get digest(){return this.crc}}const te=[0,4278190080,4294967295,4286611584,4294901760,4278255360,4278190335,4278255615,4294967040,4294902015,4280295456,4282400832,4284506208,4288651167,4290756543,4292861919,4278716424,4279242768,4279769112,4280821800,4281348144,4281874488,4282927176,4283453520,4283979864,4285032552,4285558896,4286085240,4287072135,4287598479,4288124823,4289177511,4289703855,4290230199,4291282887,4291809231,4292335575,4293388263,4293914607,4294440951,4278190080,4278203136,4278216192,4278229248,4278242304,4278255360,4278190131,4278203187,4278216243,4278229299,4278242355,4278255411,4278190182,4278203238,4278216294,4278229350,4278242406,4278255462,4278190233,4278203289,4278216345,4278229401,4278242457,4278255513,4278190284,4278203340,4278216396,4278229452,4278242508,4278255564,4278190335,4278203391,4278216447,4278229503,4278242559,4278255615,4281532416,4281545472,4281558528,4281571584,4281584640,4281597696,4281532467,4281545523,4281558579,4281571635,4281584691,4281597747,4281532518,4281545574,4281558630,4281571686,4281584742,4281597798,4281532569,4281545625,4281558681,4281571737,4281584793,4281597849,4281532620,4281545676,4281558732,4281571788,4281584844,4281597900,4281532671,4281545727,4281558783,4281571839,4281584895,4281597951,4284874752,4284887808,4284900864,4284913920,4284926976,4284940032,4284874803,4284887859,4284900915,4284913971,4284927027,4284940083,4284874854,4284887910,4284900966,4284914022,4284927078,4284940134,4284874905,4284887961,4284901017,4284914073,4284927129,4284940185,4284874956,4284888012,4284901068,4284914124,4284927180,4284940236,4284875007,4284888063,4284901119,4284914175,4284927231,4284940287,4288217088,4288230144,4288243200,4288256256,4288269312,4288282368,4288217139,4288230195,4288243251,4288256307,4288269363,4288282419,4288217190,4288230246,4288243302,4288256358,4288269414,4288282470,4288217241,4288230297,4288243353,4288256409,4288269465,4288282521,4288217292,4288230348,4288243404,4288256460,4288269516,4288282572,4288217343,4288230399,4288243455,4288256511,4288269567,4288282623,4291559424,4291572480,4291585536,4291598592,4291611648,4291624704,4291559475,4291572531,4291585587,4291598643,4291611699,4291624755,4291559526,4291572582,4291585638,4291598694,4291611750,4291624806,4291559577,4291572633,4291585689,4291598745,4291611801,4291624857,4291559628,4291572684,4291585740,4291598796,4291611852,4291624908,4291559679,4291572735,4291585791,4291598847,4291611903,4291624959,4294901760,4294914816,4294927872,4294940928,4294953984,4294967040,4294901811,4294914867,4294927923,4294940979,4294954035,4294967091,4294901862,4294914918,4294927974,4294941030,4294954086,4294967142,4294901913,4294914969,4294928025,4294941081,4294954137,4294967193,4294901964,4294915020,4294928076,4294941132,4294954188,4294967244,4294902015,4294915071,4294928127,4294941183,4294954239,4294967295],ne=[4294967295,4278190080],re=new u({sizeOf(e,t){const n=e[t];return n<=223?1:n<=254?2:5},read(e,t){const n=e[t];return n<=223?n:n<=254?256*(n-224)+e[t+1]:S.read(e,t+1)}});class ie{decode(e,t,n,r,i){const s=this.decodePixels(r,32===n);if(n<=8)return i||(i=1===n?ne:te),this.unpackPixels(s,e,t,n,i);if(16===n)return this.raster16To32(s,e,t);if(32===n)return s;throw new Error("Unhandled Squeak Image depth.")}decodePixels(e,t){let n;if(Array.isArray(e)||e instanceof Uint32Array){if(n=new Uint32Array(e),t)for(let e=0;e>2;let o;switch(3&e){case 0:s+=i;break;case 1:o=r.read(d),o|=o<<24|o<<16|o<<8,t&&0!==o&&(o|=4278190080);for(let e=0;e>u&o],u-=r}return s}raster16To32(e,t,n){const r=new Uint32Array(2*e.length);let i,s,o,a=0,l=0;for(let c=0;c>i&65535,0!==o){o=4278190080|(o>>7&248)<<16|(o>>2&248)<<8|o<<3&248}r[l++]=o,i-=16}}return r}buildCustomColormap(e,t,n){const r=new Uint32Array(1<>1,this.bitPosition=0,this.currentByte=0,this.stream=null,this.end=0}decode(e){this.bitPosition=0,this.currentByte=0,this.stream=new o(e.buffer,e.byteOffset),this.end=e.byteOffset+e.length;const t=Math.floor(8*e.length/this.bitsPerSample),n=new Int16Array(t);let r=0,i=0;for(let e=0;e=0,"Ran out of bits in Squeak Sound");let o=se[i],a=0;for(let e=this.valueHighBit;e>0;e>>=1)t&e&&(a+=o),o>>=1;a+=o,r+=t&this.signMask?-a:a,i+=this.indexTable[t],i<0&&(i=0),i>88&&(i=88),r>32767&&(r=32767),r<-32768&&(r=-32768),n[e]=r}return n}nextCode(){let e=this.bitsPerSample,t=e-this.bitPosition,n=t<0?this.currentByte>>-t:this.currentByte<0;){if(e-=this.bitPosition,!(this.end-this.stream.position>0))return this.currentByte=0,this.bitPosition=0,-1;this.currentByte=this.stream.read(d),this.bitPosition=8,t=e-this.bitPosition,n+=t<0?this.currentByte>>-t:this.currentByte<>8-this.bitPosition,n}static samples(e,t){return 8*t.length/e}}class le{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array(this.size),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.uint8a=e,this.offset=t}equals(e){for(const t in e)if(this[t]!==e[t])return!1;return!0}view(){const e=this.constructor.name,t={toString:()=>e};for(const e in this.shape)t[e]=this[e];return t}static initConstructor(e){return e.size=e.prototype.size,e}static extend(e){const t=class extends le{get shape(){return e}};let n=0;return Object.keys(e).forEach((r=>{if(Object.defineProperty(t.prototype,r,e[r].asPropertyObject(n)),0===e[r].size)throw new Error("Packet cannot be defined with variable sized members.");n+=e[r].size})),t.prototype.size=n,t.size=n,t}}class ce extends(le.extend({riff:new C(4),length:T,wave:new C(4)})){}le.initConstructor(ce);class ue extends(le.extend({chunkType:new C(4),length:T})){}le.initConstructor(ue);class de extends(le.extend({format:k,channels:k,sampleRate:T,bytesPerSec:T,blockAlignment:k,bitsPerSample:k})){}le.initConstructor(de);class he{encode(e){let{channels:t=1,sampleRate:n=22050}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),i=ce.size+ue.size+de.size+ue.size+r.length,s=new o(new ArrayBuffer(i));return s.writeStruct(ce,{riff:"RIFF",length:i-8,wave:"WAVE"}),s.writeStruct(ue,{chunkType:"fmt ",length:de.size}),s.writeStruct(de,{format:1,channels:t,sampleRate:n,bytesPerSec:2*n*t,blockAlignment:2*t,bitsPerSample:16}),s.writeStruct(ue,{chunkType:"data",length:i-s.position-ue.size}),s.writeBytes(r),s.uint8a}static encode(e,t){return(new he).encode(e,t)}static samples(e){const t=new ue(e,ce.size).length;return new ue(e,ce.size+ue.size+t).length/2}}var pe=n(40),me=n.n(pe);class fe extends($.define({X:0,Y:1})){}class ge extends($.define({X:0,Y:1,X2:2,Y2:3})){get width(){return this.x2-this.x}get height(){return this.y2-this.y}}class ye extends($.define({WIDTH:0,HEIGHT:1,DEPTH:2,BYTES:4,COLORMAP:5})){get decoded(){return this._decoded||(this._decoded=(e=>{for(let t=0;te.valueOf()))).buffer))),this._decoded}get extension(){return"uncompressed"}}class be extends($.define({STAGE_CONTENTS:2,OBJ_NAME:6,VARS:7,BLOCKS_BIN:8,IS_CLONE:9,MEDIA:10,CURRENT_COSTUME:11,ZOOM:12,H_PAN:13,V_PAN:14,OBSOLETE_SAVED_STATE:15,SPRITE_ORDER_IN_LIBRARY:16,VOLUME:17,TEMPO_BPM:18,SCENE_STATES:19,LISTS:20})){get spriteOrderInLibrary(){return this.fields[this.FIELDS.SPRITE_ORDER_IN_LIBRARY]||null}get tempoBPM(){return this.fields[this.FIELDS.TEMPO_BPM]||0}get lists(){return this.fields[this.FIELDS.LISTS]||[]}}class ve extends($.define({BOX:0,PARENT:1,COLOR:3,VISIBLE:4,OBJ_NAME:6,VARS:7,BLOCKS_BIN:8,IS_CLONE:9,MEDIA:10,CURRENT_COSTUME:11,VISIBILITY:12,SCALE_POINT:13,ROTATION_DEGREES:14,ROTATION_STYLE:15,VOLUME:16,TEMPO_BPM:17,DRAGGABLE:18,SCENE_STATES:19,LISTS:20})){get scratchX(){return this.box.x+this.currentCostume.rotationCenter.x-240}get scratchY(){return 180-(this.box.y+this.currentCostume.rotationCenter.y)}get visible(){return!(1&this.fields[this.FIELDS.VISIBLE])}get tempoBPM(){return this.fields[this.FIELDS.TEMPO_BPM]||0}get lists(){return this.fields[this.FIELDS.LISTS]||[]}}$.define({RECTANGLE:0,FONT:8,COLOR:9,LINES:11});class Se extends($.define({COSTUME_NAME:0,BITMAP:1,ROTATION_CENTER:2,TEXT_DETAILS:3,BASE_LAYER_DATA:4,OLD_COMPOSITE:5})){get image(){return this.oldComposite instanceof ye?this.oldComposite:this.baseLayerData.value?null:this.bitmap}get width(){return null===this.image?-1:this.image.width}get height(){return null===this.image?-1:this.image.height}get rawBytes(){return null===this.image?this.baseLayerData.value.slice():this.image.bytes.value}get decoded(){return null===this.image?this.baseLayerData.value.slice():this.image.decoded}get crc(){if(!this._crc){const e=(new ee).update(new Uint8Array(new Uint32Array([this.bitmap.width]).buffer)).update(new Uint8Array(new Uint32Array([this.bitmap.height]).buffer)).update(new Uint8Array(new Uint32Array([this.bitmap.depth]).buffer)).update(this.rawBytes);this._crc=e.digest}return this._crc}get extension(){return this.oldComposite instanceof ye?"uncompressed":this.baseLayerData.value?"jpg":"uncompressed"}toString(){return'ImageMediaData "'.concat(this.costumeName,'"')}}class we extends($.define({DATA:3,RATE:4})){}class ke extends($.define({NAME:0,UNCOMPRESSED:1,RATE:4,BITS_PER_SAMPLE:5,DATA:6})){get rate(){return 0!==this.uncompressed.data.value.length?this.uncompressed.rate:this.fields[this.FIELDS.RATE]}get rawBytes(){return this.data&&this.data.value?this.data.value:this.uncompressed.data.value}get decoded(){return this._decoded||(this.data&&this.data.value?this._decoded=new ae(this.bitsPerSample.value).decode(this.data.value):this._decoded=new Int16Array((e=>{const t=new Uint8Array(e);for(let n=0;nDe[t]||null));class Le{constructor(e){this.valueIterator=e}[Symbol.iterator](){return this}next(){const e=this.valueIterator.next();if(e.done)return e;const t=e.value,{classId:n}=t;let r=t;if(t instanceof Y){r=[];for(let e=0;e>>16;for(let s=0;s1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;return this.stream.writeBytes(e,t,n)}}class Ke extends _e{constructor(e){super(e),this.stream.writeStruct(qe,{cmf:8,flag:29}),this.adler=new Ve,this.chunk=this.stream.writeStruct(Ye,{lastPacket:0,length:0,lengthCheck:65535})}get _deflateIndex(){return this.chunk.length}set _deflateIndex(e){return this.chunk.length=e,this.chunk.lengthCheck=65535^e,this.chunk.length}writeStruct(e,t){this.writeBytes(Object.assign(new e,t).uint8a)}writeBytes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=t;for(;n-r>0;){this._deflateIndex===Ge&&(this.chunk=this.stream.writeStruct(Ye,{lastPacket:0,length:0,lengthCheck:65535}));const t=Math.min(n-r,Ge-this._deflateIndex);this.stream.writeBytes(e,r,r+t),this._deflateIndex+=t,r+=t}this.adler.update(e,t,n-t)}finish(){this.chunk.lastPacket=1,this.stream.writeStruct(He,{checksum:this.adler.digest})}static estimateSize(e){const t=Math.ceil(e/Ge);return qe.size+t*Ye.size+He.size+e}}class Qe extends _e{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"IHDR";super(e),this.start=this.stream.writeStruct(Ue,{length:0,chunkType:t}),this.crc=new ee}finish(){const e=this.start.offset+this.start.size,t=this.position-e;this.start.length=t,this.crc.update(this.stream.uint8a,e-S.size,t+S.size),this.stream.writeStruct(je,{checksum:this.crc.digest})}static size(e){return Ue.size+e+je.size}}class Xe{encode(e,t,n){const r=4*e+We.size,i=r*t,s=ze.size+Qe.size(Fe.size)+Qe.size(Ke.estimateSize(i))+Qe.size(0),a=new o(new ArrayBuffer(s));a.writeStruct(ze,{support8Bit:137,png:"PNG",dosLineEnding:"\r\n",dosEndOfFile:"",unixLineEnding:"\n"});const l=new Qe(a,"IHDR");l.writeStruct(Fe,{width:e,height:t,bitDepth:8,colorType:6,compressionMethod:0,filterMethod:0,interlaceMethod:0}),l.finish();const c=new Qe(a,"IDAT"),u=new Ke(c);let d=0;for(;d"uncompressed"===e.extension?new Uint8Array(Xe.encode(e.width,e.height,e.decoded)):e.decoded,et=e=>{const t=String(e[e.length-1]),n=e.length-1;return"mouse"===t?e[n]="_mouse_":"edge"===t?e[n]="_edge_":e[e.length-1]instanceof be&&(e[n]="_stage_"),e},tt={getParam:e=>{let[t,n,r,i]=e;return[t,n,r,i||"r"]},changeVariable:e=>[e[2],e[1],e[3]],EventHatMorph:e=>"Scratch-StartClicked"===String(e[1])?["whenGreenFlag"]:["whenIReceive",e[1]],MouseClickEventHatMorph:()=>["whenClicked"],KeyEventHatMorph:e=>["whenKeyPressed",e[1]],stopScripts:e=>"other scripts"===String(e[1])?[e[0],"other scripts in sprite"]:e,abs:e=>["computeFunction:of:","abs",e[1]],sqrt:e=>["computeFunction:of:","sqrt",e[1]],"\\\\":e=>["%",...e.slice(1)],doReturn:()=>["stopScripts","this script"],stopAll:()=>["stopScripts","all"],"showBackground:":e=>["startScene",e[1]],nextBackground:()=>["nextScene"],doForeverIf:e=>["doForever",[["doIf",e[1],e[2]]]],"getAttribute:of:":et,"gotoSpriteOrMouse:":et,"distanceTo:":et,"pointTowards:":et,"touching:":et},nt=e=>{const{info:t,stageData:n,images:r,sounds:i}=e,s=e=>{const t=[];for(let n=0;n{let[t,n]=e;return{name:t,value:n,isPersistent:!1}},a=e=>{let[,{listName:t,contents:n,x:r,y:i,width:s,height:o,hiddenWhenNull:a}]=e;return{listName:t,contents:n,isPersistent:!1,x:r,y:i,width:s,height:o,visible:null!==(l=a,"object"==typeof l&&l?l.valueOf():l)};var l},l=e=>{const t=i.findIndex((t=>t.crc===e.crc));return{soundName:e.name,soundID:t,md5:"".concat(e.md5,".wav"),sampleCount:e.sampleCount,rate:e.rate,format:""}},c=e=>{const t=r.findIndex((t=>t.crc===e.crc));return{costumeName:e.costumeName,baseLayerID:t,baseLayerMD5:"".concat(me()(e.rawBytes),".").concat((n=e,"uncompressed"===n.extension?"png":"jpg")),bitmapResolution:1,rotationCenterX:e.rotationCenter.x,rotationCenterY:e.rotationCenter.y};var n},u=e=>{let t=e.map(h);const n=tt[t[0]];return n&&(t=n(t)),t},d=e=>e.map(u),h=e=>e instanceof ve?e.objName:Array.isArray(e)?0===e.length||Array.isArray(e[0])?d(e):u(e):e,p=e=>[e[0].x,e[0].y,d(e[1])],m=e=>e instanceof ve?(e=>{const t=e.media.filter((e=>e instanceof Se)),r=e.media.filter((e=>e instanceof ke));return{objName:e.objName,variables:s(e.vars).map(o),lists:s(e.lists).map(a),scripts:e.blocksBin.map(p),costumes:t.map(c),currentCostumeIndex:t.findIndex((t=>t.crc===e.currentCostume.crc)),sounds:r.map(l),scratchX:e.scratchX,scratchY:e.scratchY,scale:e.scalePoint.x,direction:Math.round(1e6*e.rotationDegrees)/1e6-270,rotationStyle:e.rotationStyle,isDraggable:e.draggable,indexInLibrary:n.spriteOrderInLibrary.indexOf(e),visible:e.visible,spriteInfo:{}}})(e):null;return JSON.parse(JSON.stringify(Object.assign((e=>{const t=e.media.filter((e=>e instanceof Se)),n=e.media.filter((e=>e instanceof ke));return{objName:e.objName,variables:s(e.vars).map(o),lists:s(e.lists).map(a),scripts:e.blocksBin.map(p),costumes:t.map(c),currentCostumeIndex:t.findIndex((t=>t.crc===e.currentCostume.crc)),sounds:n.map(l),penLayerMD5:"5c81a336fab8be57adc039a8a2b33ca9.png",penLayerID:0,tempoBPM:e.tempoBPM,videoAlpha:.5,children:e.stageContents.map(m).filter(Boolean).reverse()}})(n),{info:(e=>{const t={};for(let n=0;n{let{images:t,sounds:n}=e;const r={};let i=0;for(const e of t)r["".concat(i++,".").concat((s=e,"uncompressed"===s.extension?"png":"jpg"))]={bytes:$e(e)};var s,o;i=0;for(const e of n)r["".concat(i++,".wav")]={bytes:(o=e,o.wavEncodedData)};return new Je(r)})({images:this.images(),sounds:this.sounds()})}view(){return{signature:this.signature,infoHeader:this.infoHeader,dataHeader:this.dataHeader,toString:()=>"SB1File"}}infoRaw(){return new a(new J(this.buffer,this.infoHeader.offset+it.size),this.signature.infoByteLength+rt.size)}infoTable(){return new Le(this.infoRaw())}info(){return this._info||(this._info=new Be(this.infoTable()).table[0]),this._info}dataRaw(){return new a(new J(this.buffer,this.dataHeader.offset+it.size),this.stream.uint8a.length)}dataTable(){return new Le(this.dataRaw())}dataFixed(){return this._data||(this._data=new Be(this.dataTable()).table),this._data}data(){return this.dataFixed()[0]}images(){const e=new Set;return this.dataFixed().filter((t=>t instanceof Se&&(!e.has(t.crc)&&(e.add(t.crc),!0))))}sounds(){const e=new Set;return this.dataFixed().filter((t=>t instanceof ke&&(!e.has(t.crc)&&(e.add(t.crc),!0))))}}},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"Scaffolding",(function(){return V})),n.d(r,"Cloud",(function(){return k})),n.d(r,"VM",(function(){return a.a})),n.d(r,"Renderer",(function(){return c.a})),n.d(r,"Storage",(function(){return g})),n.d(r,"AudioEngine",(function(){return p.a})),n.d(r,"JSZip",(function(){return s.a}));var i=n(23),s=n.n(i),o=n(62),a=n.n(o),l=n(108),c=n.n(l),u=n(114),d=n.n(u),h=n(115),p=n.n(h),m=n(35);class f extends d.a{constructor(){super(),this._totalAssets=0,this._loadedAssets=0}_updateProgress(){this.onprogress&&this.onprogress(this._totalAssets,this._loadedAssets)}load(e,t,n){return e===this.AssetType.ImageBitmap||e===this.AssetType.ImageVector||e===this.AssetType.Sound||e===this.AssetType.Font?(this._totalAssets++,this._updateProgress(),super.load(e,t,n).then((e=>(this._loadedAssets++,this._updateProgress(),e)))):super.load(e,t,n)}}var g=f;class y{constructor(){this._events={}}addEventListener(e,t){this._events[e]||(this._events[e]=[]),this._events[e].push(t)}removeEventListener(e,t){const n=this._events[e];n&&(this._events[e]=n.filter((e=>e!==t)))}dispatchEvent(e){const t=this._events[e.type];if(t)for(const n of t)n(e)}}const b=[],v=e=>{let t;var n;return 0===b.length?(n={audio:!1,video:e},t=navigator.mediaDevices?navigator.mediaDevices.getUserMedia(n):Promise.reject(new Error("video is not supported in this context (insecure domain?)")),b.push(t)):b.length>0&&(t=b[0],b.push(!0)),t};class S{constructor(){this.mirror=!0,this._frameCacheTimeout=16,this._video=null,this._track=null,this._workspace=[]}static get FORMAT_IMAGE_DATA(){return"image-data"}static get FORMAT_CANVAS(){return"canvas"}static get DIMENSIONS(){return[480,360]}static get ORDER(){return 1}get video(){return this._video}enableVideo(){return this.enabled=!0,this._setupVideo()}disableVideo(){this.enabled=!1,this._singleSetup&&this._singleSetup.then(this._teardown.bind(this)).catch((e=>this.onError(e)))}_teardown(){if(!1===this.enabled){const e=(b.pop(),!(b.length>0));this._singleSetup=null,this._video=null,this._track&&e&&this._track.stop(),this._track=null}}getFrame(e){let{dimensions:t=S.DIMENSIONS,mirror:n=this.mirror,format:r=S.FORMAT_IMAGE_DATA,cacheTimeout:i=this._frameCacheTimeout}=e;if(!this.videoReady)return null;const[s,o]=t,a=this._getWorkspace({dimensions:t,mirror:Boolean(n)}),{videoWidth:l,videoHeight:c}=this._video,{canvas:u,context:d,lastUpdate:h,cacheData:p}=a,m=Date.now();h+i{this._video=document.createElement("video");try{this._video.srcObject=e}catch(t){this._video.src=window.URL.createObjectURL(e)}return this._video.play(),this._track=e.getTracks()[0],this})).catch((e=>{this._singleSetup=null,this.onError(e)}))),this._singleSetup}get videoReady(){if(!this.enabled)return!1;if(!this._video)return!1;if(!this._track)return!1;const{videoWidth:e,videoHeight:t}=this._video;return"number"==typeof e&&"number"==typeof t&&(0!==e&&0!==t)}_getWorkspace(e){let{dimensions:t,mirror:n}=e,r=this._workspace.find((e=>e.dimensions.join("-")===t.join("-")&&e.mirror===n));return r||(r={dimensions:t,mirror:n,canvas:document.createElement("canvas"),lastUpdate:0,cacheData:{}},r.canvas.width=t[0],r.canvas.height=t[1],r.context=r.canvas.getContext("2d"),this._workspace.push(r)),r}}var w=S;var k={CloudManager:class{constructor(e){this.parent=e,this.providers=[],this.overrides=new Map}hasCloudData(){return this.parent.vm.runtime.hasCloudData()}projectReady(){if(this.hasCloudData())for(const e of this.providers)e.enable()}setVariable(e,t,n){this.overrides.has(t)&&this.overrides.get(t)!==e||this.parent.vm.postIOData("cloud",{varUpdate:{name:t,value:n}})}getUsername(){return this.parent._username}addProvider(e){e.manager=this,this.hasCloudData()&&e.enable(),this.providers.push(e)}requestCloseConnection(){}createVariable(e,t){}renameVariable(e,t){}deleteVariable(e){}addProviderOverride(e,t){if(t&&!this.providers.includes(t))throw new Error("Manager is not aware of this provider");this.overrides.set(e,t)}updateVariable(e,t){if(this.overrides.has(e)){const n=this.overrides.get(e);n&&n.handleUpdateVariable(e,t)}else for(const n of this.providers)n.handleUpdateVariable(e,t)}},WebSocketProvider:class{constructor(e,t){this.cloudHosts=Array.isArray(e)?e:[e],this.projectId=t,this.attemptedConnections=0,this.bufferedMessages=[],this.scheduledBufferedSend=null,this.reconnectTimeout=null,this.openConnection=this.openConnection.bind(this),this._scheduledSendBufferedMessages=this._scheduledSendBufferedMessages.bind(this)}enable(){this.openConnection()}setProjectId(e){this.projectId=e,this.closeAndReconnect()}openConnection(){this.currentCloudHost=this.cloudHosts[this.attemptedConnections%this.cloudHosts.length],this.attemptedConnections++,console.log("Connecting to ".concat(this.currentCloudHost," with ID ").concat(this.projectId,", username ").concat(this.manager.getUsername()));try{this.ws=new WebSocket(this.currentCloudHost)}catch(e){throw console.error(e),new Error("Cloud host ".concat(this.currentCloudHost," is invalid: ").concat(e))}this.ws.onerror=this.onerror.bind(this),this.ws.onmessage=this.onmessage.bind(this),this.ws.onopen=this.onopen.bind(this),this.ws.onclose=this.onclose.bind(this)}onerror(e){console.error("WebSocket error",e)}onmessage(e){for(const t of e.data.split("\n"))if(t){const e=JSON.parse(t);"set"===e.method&&this.manager.setVariable(this,e.name,e.value)}}onopen(){this.attemptedConnections=0,this.writeToServer({method:"handshake"}),this.sendBufferedMessages(),console.log("WebSocket connected")}onclose(e){if(e&&4002===e.code)return void console.log("Username is invalid; not reconnecting.");if(e&&4004===e.code)return void console.log("Project is blocked; not reconnecting.");const t=Math.random()*(Math.pow(2,Math.min(this.attemptedConnections+1,5))-1)*1e3;console.log("Connection lost; reconnecting in ".concat(Math.round(t),"ms")),this.reconnectTimeout=setTimeout(this.openConnection,t)}closeAndReconnect(){console.log("Closing connection and reconnecting."),this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close()),clearTimeout(this.reconnectTimeout);this.reconnectTimeout=setTimeout(this.openConnection,1e3/30)}canWriteToServer(){return this.ws&&this.ws.readyState===WebSocket.OPEN}scheduleBufferedSend(){this.scheduledBufferedSend||(this.scheduledBufferedSend=!0,Promise.resolve().then(this._scheduledSendBufferedMessages))}_scheduledSendBufferedMessages(){this.scheduledBufferedSend=!1,this.canWriteToServer()&&this.sendBufferedMessages()}sendBufferedMessages(){for(const e of this.bufferedMessages)this.writeToServer(e);this.bufferedMessages.length=0}bufferedWriteToServer(e){this.bufferedMessages.push(e),this.scheduleBufferedSend()}writeToServer(e){e.project_id=this.projectId,e.user=this.manager.getUsername(),this.ws.send(JSON.stringify(e))}handleUpdateVariable(e,t){for(const n of this.bufferedMessages)if(n.name===e)return void(n.value=t);this.bufferedWriteToServer({method:"set",name:e,value:t})}},LocalStorageProvider:class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p4:cloudvariables";this.key=e,this.variables={},this.handleStorageEvent=this.handleStorageEvent.bind(this)}readFromLocalStorage(){let e;try{if(e=JSON.parse(localStorage.getItem(this.key)),!e||"object"!=typeof e)return}catch(e){return}this.variables=e;for(const e of Object.keys(this.variables))this.manager.setVariable(this,e,this.variables[e])}storeToLocalStorage(){try{localStorage.setItem(this.key,JSON.stringify(this.variables))}catch(e){}}handleStorageEvent(e){e.key===this.key&&e.storageArea===localStorage&&this.readFromLocalStorage()}enable(){this.readFromLocalStorage(),window.addEventListener("storage",this.handleStorageEvent)}handleUpdateVariable(e,t){this.variables[e]=t,this.storeToLocalStorage()}}},x=n(117),T=n.n(x),E=n(61),A={insert:e=>{var t=document.head||document.body||document.documentElement;t.insertBefore(e,t.firstChild)},singleton:!1},C=(T()(E.a,A),E.a.locals||{});const I=e=>new Promise(((t,n)=>{const r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(new Error("Cannot read as text: ".concat(r.error))),r.readAsText(e)}));var O=class{constructor(e,t){this.el=e,this.callback=t,this.el.addEventListener("dragover",this.ondragover.bind(this)),this.el.addEventListener("dragleave",this.ondragleave.bind(this)),this.el.addEventListener("drop",this.ondrop.bind(this))}ondragover(e){e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.dataTransfer.dropEffect="copy",this.el.classList.add(C.dropping))}ondragleave(e){e.preventDefault(),this.el.classList.remove(C.dropping)}ondrop(e){e.preventDefault(),this.el.classList.remove(C.dropping),e.dataTransfer.types.includes("Files")&&e.dataTransfer.files.length>0&&Promise.all(Array.from(e.dataTransfer.files).map(I)).then((e=>{this.callback(e)}))}};var M=class{constructor(e,t){this.parent=e,this.text=t,this.root=document.createElement("div"),this.root.className=C.questionRoot,this.inner=document.createElement("div"),this.inner.className=C.questionInner,t&&(this.textElement=document.createElement("div"),this.textElement.textContent=t,this.textElement.className=C.questionText),this.inputContainer=document.createElement("div"),this.inputContainer.className=C.questionInputOuter,this.input=document.createElement("input"),this.input.className=C.questionInput,this.input.addEventListener("keypress",this.onkeypress.bind(this)),this.dropper=new O(this.input,this.dropperCallback.bind(this)),this.submitButton=document.createElement("button"),this.submitButton.className=C.questionSubmitButton,this.submitButton.addEventListener("click",this.onsubmitpressclick.bind(this)),this.inputContainer.appendChild(this.input),this.inputContainer.appendChild(this.submitButton),this.textElement&&this.inner.appendChild(this.textElement),this.inner.appendChild(this.inputContainer),this.root.appendChild(this.inner),this.parent._addLayer(this.root),this.input.focus(),this.answerCallback=new Promise((e=>{this.callback=e}))}answer(){return this.answerCallback}submit(){this.callback(this.input.value),this.destroy()}onkeypress(e){"Enter"===e.key&&this.submit()}dropperCallback(e){const t=e.join("").replace(/\r?\n/g," ");this.input.value=t}onsubmitpressclick(){this.submit()}destroy(){this.root.remove(),this.parent.question=null}};var N=class{constructor(e){this.parent=e,this.root=document.createElement("div"),this.root.className=C.contextMenu,this._onmousedown=this._onmousedown.bind(this),this._onresize=this._onresize.bind(this),this._onblur=this._onblur.bind(this)}_onmousedown(e){this.root.contains(e.target)||this.destroy()}_onresize(){this.destroy()}_onblur(){this.destroy()}add(e){const t=document.createElement("button");t.className=C.contextMenuItem,t.textContent=e.text,t.addEventListener("click",(()=>{this.destroy(),e.callback()})),t.addEventListener("contextmenu",(e=>{e.preventDefault()})),this.root.appendChild(t)}show(e){document.addEventListener("mousedown",this._onmousedown),window.addEventListener("resize",this._onresize),window.addEventListener("blur",this._onblur),this.parent._addLayer(this.root);const t=this.parent.layersRect,n=this.root.getBoundingClientRect();let r=e.clientX-t.left,i=e.clientY-t.top;r+n.width>t.width&&(r-=n.width),i+n.height>t.height&&(i-=n.height),this.root.style.transform="translate(".concat(r,"px, ").concat(i,"px)"),getComputedStyle(this.root).opacity,this.root.style.opacity="1"}destroy(){document.removeEventListener("mousedown",this._onmousedown),window.removeEventListener("resize",this._onresize),window.removeEventListener("blur",this._onblur),this.root.style.opacity="0",this.root.style.pointerEvents="none",setTimeout((()=>{this.root.remove()}),200)}};var R=(e,t)=>{if("undefined"!=typeof ExternalDownloadHelper)return void ExternalDownloadHelper.download(e,t);const n=document.createElement("a");if(document.body.appendChild(n),navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(t,e);else if("download"in HTMLAnchorElement.prototype){const r=window.URL.createObjectURL(t);n.href=r,n.download=e,n.type=t.type,n.click(),window.setTimeout((()=>{document.body.removeChild(n),window.URL.revokeObjectURL(r)}),1e3)}else{let e=window.open("","_blank");const n=new FileReader;n.onloadend=function(){e.location.href=n.result,e=null},n.readAsDataURL(t)}};class D{constructor(e,t){this.parent=e,this.id=t.get("id"),this.spriteName=t.get("spriteName"),this.targetId=t.get("targetId"),this.opcode=t.get("opcode"),this.params=t.get("params"),this.root=document.createElement("div"),this.root.className=C.monitorRoot,this.root.dataset.id=this.id,this.root.dataset.opcode=this.opcode,this.parent._monitorOverlay.appendChild(this.root)}getLabel(){let e;if("data_variable"===this.opcode)e=this.params.VARIABLE;else if("data_listcontents"===this.opcode)e=this.params.LIST;else if("motion_xposition"===this.opcode)e=this.parent.getMessage("var-x");else if("motion_yposition"===this.opcode)e=this.parent.getMessage("var-y");else if("motion_direction"===this.opcode)e=this.parent.getMessage("var-direction");else if("sensing_username"===this.opcode)e=this.parent.getMessage("var-username");else if("looks_costumenumbername"===this.opcode)e="number"===this.params.NUMBER_NAME?this.parent.getMessage("var-costume-number"):this.parent.getMessage("var-costume-name");else if("looks_backdropnumbername"===this.opcode)e="number"===this.params.NUMBER_NAME?this.parent.getMessage("var-backdrop-number"):this.parent.getMessage("var-backdrop-name");else if("looks_size"===this.opcode)e=this.parent.getMessage("var-size");else if("sensing_answer"===this.opcode)e=this.parent.getMessage("var-answer");else if("sensing_mousedown"===this.opcode)e=this.parent.getMessage("var-mousedown");else if("sensing_mousex"===this.opcode)e=this.parent.getMessage("var-mousex");else if("sensing_mousey"===this.opcode)e=this.parent.getMessage("var-mousey");else if("sensing_loudness"===this.opcode)e=this.parent.getMessage("var-loudness");else if("sensing_timer"===this.opcode)e=this.parent.getMessage("var-timer");else if("sensing_dayssince2000"===this.opcode)e=this.parent.getMessage("var-dayssince2000");else if("sound_volume"===this.opcode)e=this.parent.getMessage("var-volume");else if("sensing_current"===this.opcode){const t=this.params.CURRENTMENU.toLowerCase();"year"===t?e=this.parent.getMessage("var-year"):"month"===t?e=this.parent.getMessage("var-month"):"date"===t?e=this.parent.getMessage("var-date"):"dayofweek"===t?e=this.parent.getMessage("var-day-of-week"):"hour"===t?e=this.parent.getMessage("var-hour"):"minute"===t?e=this.parent.getMessage("var-minute"):"second"===t&&(e=this.parent.getMessage("var-second"))}else{const t=this.parent.vm.runtime.getLabelForOpcode(this.opcode);e=t?t.label:this.opcode}return this.spriteName?"".concat(this.spriteName,": ").concat(e):e}getTarget(){return this.targetId?this.parent.vm.runtime.getTargetById(this.targetId):this.parent.vm.runtime.getTargetForStage()}getVmVariable(){return this.getTarget().variables[this.id]}update(e){this.x=e.get("x"),this.y=e.get("y"),this.visible=e.get("visible"),this.root.style.transform="translate(".concat(Math.round(this.x),"px, ").concat(Math.round(this.y),"px)"),this.root.style.display=this.visible?"":"none"}}class P extends D{constructor(e,t){super(e,t),this.mode=t.get("mode"),"large"===this.mode?(this.valueElement=document.createElement("div"),this.valueElement.className=C.monitorLargeValue+" "+C.monitorValueColor,this.root.appendChild(this.valueElement)):(this.inner=document.createElement("div"),this.inner.className=C.monitorInner,this.valueRow=document.createElement("div"),this.valueRow.className=C.monitorRow,this.label=document.createElement("div"),this.label.className=C.monitorLabel,this.label.textContent=this.getLabel(),this.valueElement=document.createElement("div"),this.valueElement.className=C.monitorValue+" "+C.monitorValueColor,this.valueRow.appendChild(this.label),this.valueRow.appendChild(this.valueElement),this.inner.appendChild(this.valueRow),"slider"===this.mode&&(this.sliderRow=document.createElement("div"),this.sliderRow.className=C.monitorRow,this.slider=document.createElement("input"),this.slider.className=C.monitorSlider,this.slider.type="range",this.slider.min=t.get("sliderMin"),this.slider.max=t.get("sliderMax"),this.slider.step=t.get("isDiscrete")?1:.01,this.slider.addEventListener("input",this.onsliderchange.bind(this)),this.sliderRow.appendChild(this.slider),this.inner.appendChild(this.sliderRow)),this.root.appendChild(this.inner)),this.parent._monitorOverlay.appendChild(this.root),this._value=""}setVariableValue(e){const t=this.getVmVariable();if(t.value=e,t.isCloud){this.parent.vm.runtime.ioDevices.cloud.requestUpdateVariable(t.name,t.value)}this._value=e,this.valueElement.textContent=e}onsliderchange(e){this.setVariableValue(+e.target.value)}update(e){if(super.update(e),!this.visible)return;let t=e.get("value");"number"==typeof t&&(t=Number(t.toFixed(6))),this._value!==t&&(this._value=t,this.valueElement.textContent=t,this.slider&&(this.slider.value=t))}}class L{constructor(e){this.monitor=e,this.index=-1,this.value="",this.locked=!1,this.root=document.createElement("label"),this.root.className=C.monitorRowRoot,this.indexEl=document.createElement("div"),this.indexEl.className=C.monitorRowIndex,this.valueOuter=document.createElement("div"),this.valueOuter.className=C.monitorRowValueOuter,this.editable=this.monitor.editable,this.editable?(this.valueInner=document.createElement("input"),this.valueInner.tabIndex=-1,this.valueInner.className=C.monitorRowValueInner,this.valueInner.readOnly=!0,this.valueInner.addEventListener("click",this._onclickinput.bind(this)),this.valueInner.addEventListener("blur",this._onblurinput.bind(this)),this.valueInner.addEventListener("keypress",this._onkeypressinput.bind(this)),this.valueInner.addEventListener("keydown",this._onkeypressdown.bind(this)),this.valueInner.addEventListener("contextmenu",this._oncontextmenu.bind(this)),this.valueInner.addEventListener("input",this._oninput.bind(this)),this.valueOuter.appendChild(this.valueInner),this.deleteButton=document.createElement("button"),this.deleteButton.className=C.monitorRowDelete,this.deleteButton.textContent="×",this.deleteButton.addEventListener("mousedown",this._onclickdelete.bind(this)),this.valueOuter.appendChild(this.deleteButton)):(this.valueInner=document.createElement("div"),this.valueInner.className=C.monitorRowValueInner,this.valueOuter.appendChild(this.valueInner),this.valueInner.addEventListener("contextmenu",this._oncontextmenuuneditable.bind(this))),this.root.appendChild(this.indexEl),this.root.appendChild(this.valueOuter)}_onclickinput(){this.valueInner.focus(),this.locked||(this.valueInner.select(),this.valueInner.readOnly=!1,this.locked=!0,this.root.classList.add(C.monitorRowValueEditing),this.addNewValue=!1,this.deleteValue=!1,this.valueWasChanged=!1)}_onblurinput(){if(this.locked)if(this.unfocus(),this.deleteValue){const e=[...this.monitor.value];e.splice(this.index,1),this.monitor.setValue(e),this.monitor.tryToFocusRow(Math.min(e.length-1,this.index))}else if(this.valueWasChanged||this.addNewValue){const e=[...this.monitor.value];e[this.index]=this.valueInner.value,this.addNewValue&&e.splice(this.index+1,0,""),this.monitor.setValue(e),this.addNewValue&&this.monitor.tryToFocusRow(this.index+1)}}_oninput(){this.valueWasChanged=!0}_onkeypressinput(e){"Enter"===e.key&&(this.addNewValue=!0,this.valueInner.blur())}_onkeypressdown(e){if("Escape"===e.key)this.valueInner.blur();else if("ArrowUp"===e.key||"ArrowDown"===e.key||"Tab"===e.key){e.preventDefault();let t=this.index;"ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey?(t--,t<0&&(t=this.monitor.value.length-1)):(t++,t>=this.monitor.value.length&&(t=0)),this.monitor.tryToFocusRow(t)}}_onclickdelete(e){e.preventDefault(),this.deleteValue=!0,this.valueInner.blur()}_oncontextmenu(e){this.locked?e.stopPropagation():e.preventDefault()}_oncontextmenuuneditable(e){const t=getSelection();this.valueInner.contains(t.anchorNode)&&!t.isCollapsed&&e.stopPropagation()}setIndex(e){this.index!==e&&(this.index=e,this.root.dataset.index=e,this.root.style.transform="translateY(".concat(24*e,"px)"),this.indexEl.textContent=e+1)}setValue(e){this.value===e||this.locked||(this.value=e,this.editable?this.valueInner.value=e:this.valueInner.textContent=e)}focus(){this.valueInner.click(),document.activeElement!==this.valueInner&&setTimeout((()=>this.valueInner.click()))}unfocus(){this.locked&&(this.locked=!1,this.valueInner.readOnly=!0,this.root.classList.remove(C.monitorRowValueEditing))}}class B extends D{constructor(e,t){super(e,t),this.editable=e.editableLists,this.rows=new Map,this.cachedRows=[],this.scrollTop=0,this.oldLength=-1,this.label=document.createElement("div"),this.label.className=C.monitorListLabel,this.label.textContent=this.getLabel(),this.footer=document.createElement("div"),this.footer.className=C.monitorListFooter,this.footerText=document.createElement("div"),this.footerText.className=C.monitorListFooterText,this.rowsOuter=document.createElement("div"),this.rowsOuter.className=C.monitorRowsOuter,this.rowsInner=document.createElement("div"),this.rowsInner.className=C.monitorRowsInner,this.rowsInner.addEventListener("scroll",this._onscroll.bind(this),{passive:!0}),this.endPoint=document.createElement("div"),this.endPoint.className=C.monitorRowsEndpoint,this.emptyLabel=document.createElement("div"),this.emptyLabel.textContent=e.getMessage("list-empty"),this.emptyLabel.className=C.monitorEmpty,this.editable&&(this.addButton=document.createElement("button"),this.addButton.className=C.monitorListAdd,this.addButton.textContent="+",this.addButton.addEventListener("click",this._onclickaddbutton.bind(this)),this.footer.appendChild(this.addButton)),this.rowsInner.appendChild(this.endPoint),this.rowsInner.appendChild(this.emptyLabel),this.rowsOuter.appendChild(this.rowsInner),this.footer.appendChild(this.footerText),this.root.appendChild(this.label),this.root.appendChild(this.rowsOuter),this.root.appendChild(this.footer),this.dropper=new O(this.rowsOuter,this.dropperCallback.bind(this)),this.handleImport=this.handleImport.bind(this),this.handleExport=this.handleExport.bind(this),this.root.addEventListener("contextmenu",this._oncontextmenu.bind(this))}_onclickaddbutton(e){this.setValue([...this.value,""]),this.tryToFocusRow(this.value.length-1)}unfocusAllRows(){for(const e of this.rows.values())e.unfocus()}tryToFocusRow(e){if(e>=0&&e{const t=e.target.files;if(0===t.length)return;const n=t[0];I(n).then((e=>this.import(e)))})),e.click()}import(e){const t=e.split(/\r?\n/);this.setValue(t)}handleExport(){const e=this.getValue().join("\n"),t=new Blob([e],{type:"text/plain"});R("".concat(this.getLabel(),".txt"),t)}dropperCallback(e){this.import(e.join("\n"))}getValue(){return this.getVmVariable().value}setValue(e){this.getVmVariable().value=e,this.updateValue(e)}update(e){super.update(e),this.visible&&(this.width=e.get("width")||100,this.height=e.get("height")||200,this.root.style.width="".concat(this.width,"px"),this.root.style.height="".concat(this.height,"px"),this.updateValue(e.get("value")))}createRow(e){const t=this.cachedRows.pop()||new L(this);t.setIndex(e),t.setValue(this.value[e]),this.rows.set(e,t);let n=!1;for(const r of this.rowsInner.children){const i=r.dataset.index;if(!i)continue;if(+i>e){this.rowsInner.insertBefore(t.root,r),n=!0;break}}return n||this.rowsInner.appendChild(t.root),t}updateValue(e){this.value=e,e.length!==this.oldLength&&(this.oldLength=e.length,this.footerText.textContent=this.parent.getMessage("list-length").replace("{n}",e.length),this.endPoint.style.transform="translateY(".concat(24*e.length,"px)"),this.emptyLabel.style.display=e.length?"none":"");let t=Math.floor(this.scrollTop/24)-5;t<0&&(t=0);let n=Math.ceil((this.scrollTop+this.height)/24)+3;n>e.length-1&&(n=e.length-1);for(const r of this.rows.keys())if(rn){const t=this.rows.get(r);(!t.locked||r>=e.length)&&(t.unfocus(),t.root.remove(),this.rows.delete(r),this.cachedRows.length<10&&this.cachedRows.push(t))}for(let r=t;r<=n;r++){const t=this.rows.get(r);t?t.setValue(e[r]):this.createRow(r)}}}var z=class{constructor(){this.hasItem=!1,this.root=document.createElement("div"),this.root.className=C.controlsBar,this.start=document.createElement("div"),this.end=document.createElement("div"),this.root.appendChild(this.start),this.root.appendChild(this.end)}addToStart(e){this.hasItem=!0,this.start.appendChild(e)}addToEnd(e){this.hasItem=!0,this.end.appendChild(e)}computeHeight(){return this.hasItem?this.root.getBoundingClientRect().height:0}};const U=e=>"number"==typeof e||"string"==typeof e||"boolean"==typeof e;var j=n(121);const F=e=>e.touches&&e.touches[0]?{x:e.touches[0].clientX,y:e.touches[0].clientY}:e.changedTouches&&e.changedTouches[0]?{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}:{x:e.clientX,y:e.clientY},W=e=>"function"==typeof e?e:()=>e;class V extends y{constructor(){super(),this.width=480,this.height=360,this.resizeMode="preserve-ratio",this.editableLists=!1,this.shouldConnectPeripherals=!0,this.usePackagedRuntime=!1,this.messages=j,this._monitors=new Map,this._mousedownPosition=null,this._draggingId=null,this._draggingStartMousePosition=null,this._draggingStartSpritePosition=null,this._offsetFromTop=0,this._offsetFromBottom=0,this._offsetFromLeft=0,this._offsetFromRight=0,this._root=document.createElement("div"),this._root.className=C.root,this._layers=document.createElement("div"),this._layers.className=C.layers,this._root.appendChild(this._layers),this._canvas=document.createElement("canvas"),this._canvas.className=C.canvas,this._addLayer(this._canvas),this._overlays=document.createElement("div"),this._overlays.className=C.scaledOverlaysInner,this._overlaysOuter=document.createElement("div"),this._overlaysOuter.className=C.scaledOverlaysOuter,this._overlaysOuter.appendChild(this._overlays),this._addLayer(this._overlaysOuter),this._monitorOverlay=document.createElement("div"),this._monitorOverlay.className=C.monitorOverlay,this._overlays.appendChild(this._monitorOverlay),this._topControls=new z,this._layers.appendChild(this._topControls.root),document.addEventListener("mousemove",this._onmousemove.bind(this)),this._canvas.addEventListener("mousedown",this._onmousedown.bind(this)),document.addEventListener("mouseup",this._onmouseup.bind(this)),this._canvas.addEventListener("touchstart",this._ontouchstart.bind(this)),document.addEventListener("touchmove",this._ontouchmove.bind(this)),document.addEventListener("touchend",this._ontouchend.bind(this)),this._canvas.addEventListener("contextmenu",this._oncontextmenu.bind(this)),this._canvas.addEventListener("wheel",this._onwheel.bind(this)),document.addEventListener("keydown",this._onkeydown.bind(this)),document.addEventListener("keyup",this._onkeyup.bind(this)),window.addEventListener("resize",this._onresize.bind(this))}_addLayer(e){this._layers.appendChild(e)}_scratchCoordinates(e,t){return{x:this.width/this.layersRect.width*(e-this.layersRect.width/2),y:-this.height/this.layersRect.height*(t-this.layersRect.height/2)}}_onmousemove(e){const{x:t,y:n}=F(e),r={x:t-this.layersRect.left,y:n-this.layersRect.top,canvasWidth:this.layersRect.width,canvasHeight:this.layersRect.height};if(this._mousedownPosition&&!this._draggingId){Math.sqrt(Math.pow(r.x-this._mousedownPosition.x,2)+Math.pow(r.y-this._mousedownPosition.y,2))>3&&(this._startDragging(r.x,r.y),this._cancelDragTimeout())}else if(this._draggingId){const e=this._scratchCoordinates(r.x,r.y);this.vm.postSpriteInfo({x:e.x-this._draggingStartMousePosition.x+this._draggingStartSpritePosition.x,y:e.y-this._draggingStartMousePosition.y+this._draggingStartSpritePosition.y,force:!0})}this.vm.postIOData("mouse",r)}_startDragging(e,t){if(this._draggingId)return;const n=this.renderer.pick(e,t);if(null===n)return;const r=this.vm.getTargetIdForDrawableId(n);if(null===r)return;const i=this.vm.runtime.getTargetById(r);i.draggable&&(i.goToFront(),this._draggingId=r,this._draggingStartMousePosition=this._scratchCoordinates(e,t),this._draggingStartSpritePosition={x:i.x,y:i.y},this.vm.startDrag(r))}_cancelDragTimeout(){clearTimeout(this._dragTimeout),this._dragTimeout=null}_onmousedown(e){const{x:t,y:n}=F(e),r={x:t-this.layersRect.left,y:n-this.layersRect.top,button:e.button,canvasWidth:this.layersRect.width,canvasHeight:this.layersRect.height,isDown:!0},i="undefined"!=typeof TouchEvent&&e instanceof TouchEvent;(0===e.button||i)&&(this._dragTimeout=setTimeout(this._startDragging.bind(this,r.x,r.y),400)),i&&(e.preventDefault(),document.activeElement&&document.activeElement.blur&&document.activeElement.blur()),this._mousedownPosition={x:r.x,y:r.y},this.vm.postIOData("mouse",r)}_onmouseup(e){this._cancelDragTimeout();const{x:t,y:n}=F(e),r={x:t-this.layersRect.left,y:n-this.layersRect.top,button:e.button,canvasWidth:this.layersRect.width,canvasHeight:this.layersRect.height,isDown:!1,wasDragged:null!==this._draggingId};this._mousedownPosition=null,this.vm.postIOData("mouse",r),this._draggingId&&(this.vm.stopDrag(this._draggingId),this._draggingStartMousePosition=null,this._draggingStartSpritePosition=null,this._draggingId=null)}_ontouchstart(e){this._onmousedown(e)}_ontouchmove(e){this._onmousemove(e)}_ontouchend(e){this._onmouseup(e)}_oncontextmenu(e){e.preventDefault()}_onwheel(e){const t={deltaX:e.deltaX,deltaY:e.deltaY};this.vm.postIOData("mouseWheel",t)}_onkeydown(e){if(e.target!==document&&e.target!==document.body)return;const t={key:e.key,keyCode:e.keyCode,isDown:!0};this.vm.postIOData("keyboard",t),(32===e.keyCode||e.keyCode>=37&&e.keyCode<=40||8===e.keyCode||222===e.keyCode||191===e.keyCode)&&e.preventDefault()}_onkeyup(e){const t={key:e.key,keyCode:e.keyCode,isDown:!1};this.vm.postIOData("keyboard",t),e.target!==document&&e.target!==document.body&&e.preventDefault()}_onresize(){this.relayout()}relayout(){const e=Math.max(1,this._root.offsetWidth),t=Math.max(1,this._root.offsetHeight),n=this._offsetFromTop+this._topControls.computeHeight(),r=this._offsetFromBottom,i=this._offsetFromLeft,s=this._offsetFromRight,o=Math.max(1,e-i-s),a=Math.max(1,t-n-r);"dynamic-resize"===this.resizeMode&&(this.vm.setStageSize?(this.width=o,this.height=a,this.vm.setStageSize(this.width,this.height)):console.warn("dynamic-resize not supported: vm does not implement setStageSize"));let l=o,c=a;"stretch"!==this.resizeMode&&(l=c/this.height*this.width,l>o&&(c=o/this.width*this.height,l=o));const u=t-c,d=e-l,h=(d-i-s)/2+i-d/2,p=(u-n-r)/2+n-u/2;this._layers.style.transform="translate(".concat(h,"px, ").concat(p,"px)"),this._layers.style.width="".concat(l,"px"),this._layers.style.height="".concat(c,"px"),this._overlays.style.transform="scale(".concat(l/this.width,", ").concat(c/this.height,")"),this.renderer.resize(l,c),this.layersRect=this._layers.getBoundingClientRect()}appendTo(e){e.appendChild(this._root),this.relayout()}setup(){this.vm=new a.a,this.vm.setCompatibilityMode(!0),this.vm.setLocale(navigator.language),this.vm.on("MONITORS_UPDATE",this._onmonitorsupdate.bind(this)),this.vm.runtime.on("QUESTION",this._onquestion.bind(this)),this.vm.on("PROJECT_RUN_START",(()=>this.dispatchEvent(new Event("PROJECT_RUN_START")))),this.vm.on("PROJECT_RUN_STOP",(()=>this.dispatchEvent(new Event("PROJECT_RUN_STOP")))),this.usePackagedRuntime&&this.vm.convertToPackagedRuntime&&this.vm.convertToPackagedRuntime(),this.vm.setStageSize&&this.vm.setStageSize(this.width,this.height),this.vm.runtime.cloudOptions&&(this.vm.runtime.cloudOptions.limit=1/0),this.vm.on("STAGE_SIZE_CHANGED",((e,t)=>{this.width===e&&this.height===t||(this.width=e,this.height=t,this.relayout())})),this.cloudManager=new k.CloudManager(this),this.renderer=new c.a(this._canvas,-this.width/2,this.width/2,-this.height/2,this.height/2),this.vm.attachRenderer(this.renderer),this.renderer.overlayContainer&&this._layers.insertBefore(this.renderer.overlayContainer,this._overlaysOuter),this.storage=new g,this.vm.attachStorage(this.storage),"undefined"!=typeof AudioContext||"undefined"!=typeof webkitAudioContext?(this.audioEngine=new p.a,this.vm.attachAudioEngine(this.audioEngine)):console.warn("AudioContext not supported. Sound will not work."),this.bitmapAdapter=new m.BitmapAdapter,this.vm.attachV2BitmapAdapter(this.bitmapAdapter),this.videoProvider=new w,this.vm.setVideoProvider(this.videoProvider)}async _connectPeripherals(){const e=e=>new Promise((t=>{const n=t=>{const n=Object.keys(t).map((e=>t[e]));if(n.length>0){const t=n[0];console.log("Connecting to peripheral",t),this.vm.connectPeripheral(e,t.peripheralId)}else console.error("No peripherals found for",e);i()},r=()=>{console.error("Peripheral scan timed out for",e),i()},i=()=>{this.vm.removeListener("PERIPHERAL_LIST_UPDATE",n),this.vm.removeListener("PERIPHERAL_SCAN_TIMEOUT",r),t()};this.vm.on("PERIPHERAL_LIST_UPDATE",n),this.vm.on("PERIPHERAL_SCAN_TIMEOUT",r),this.vm.scanForPeripheral(e)}));for(const t of Object.keys(this.vm.runtime.peripheralExtensions))await e(t)}_onmonitorsupdate(e){for(const t of e.valueSeq()){const e=t.get("id");if(!this._monitors.has(e)){if(!t.get("visible"))continue;"list"===t.get("mode")?this._monitors.set(e,new B(this,t)):this._monitors.set(e,new P(this,t))}this._monitors.get(e).update(t)}}ask(e){return this._question=new M(this,e),this._question.answer()}_onquestion(e){this._question&&this._question.destroy(),null!==e&&this.ask(e).then((e=>{this.vm.runtime.emit("ANSWER",e)}))}loadProject(e){return this.vm.loadProject(e).then((()=>{this.vm.setCloudProvider(this.cloudManager),this.cloudManager.projectReady(),this.renderer.draw(),setTimeout((()=>{this.renderer.draw()})),this.shouldConnectPeripherals&&this._connectPeripherals()}))}setUsername(e){this._username=e,this.vm.postIOData("userData",{username:e})}addCloudProvider(e){this.cloudManager.addProvider(e)}addCloudProviderOverride(e,t){this.cloudManager.addProviderOverride(e,t)}addControlButton(e){let{element:t,where:n}=e;if("top-left"===n)this._topControls.addToStart(t);else{if("top-right"!==n)throw new Error("Unknown 'where': ".concat(n));this._topControls.addToEnd(t)}this.relayout()}getMessage(e){return this.messages[e]||e}setAccentColor(e){this._root.style.setProperty("--sc-accent-color",e),this._root.style.setProperty("--sc-accent-color-transparent","".concat(e,"59"))}start(){this.vm.start(),this.vm.greenFlag()}greenFlag(){this.start()}stopAll(){this.vm.stopAll()}_lookupVariable(e,t){const n=this.vm.runtime.getTargetForStage().lookupVariableByNameAndType(e,t);if(!n)throw new Error("Global ".concat(t||"variable"," does not exist: ").concat(e));return n}setExtensionSecurityManager(e){const t=this.vm.extensionManager.securityManager;if(t)for(const[n,r]of Object.entries(e))t[n]=W(r);else console.warn("setExtensionSecurityManager not supported: there is no security manager")}getVariable(e){return this._lookupVariable(e,"").value}setVariable(e,t){if(!U(t))throw new Error("Invalid variable value");this._lookupVariable(e,"").value=t}getList(e){return this._lookupVariable(e,"list").value}setList(e,t){if(!(e=>{if(!Array.isArray(e))return!1;for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:0,n=(l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]).toLowerCase();if(!a(n))throw TypeError("Stringified UUID is invalid");return n},p=0,m=0;var f=function(e,t,n){var r=t&&n||0,i=t||new Array(16),o=(e=e||{}).node||u,a=void 0!==e.clockseq?e.clockseq:d;if(null==o||null==a){var l=e.random||(e.rng||s)();null==o&&(o=u=[1|l[0],l[1],l[2],l[3],l[4],l[5]]),null==a&&(a=d=16383&(l[6]<<8|l[7]))}var c=void 0!==e.msecs?e.msecs:Date.now(),f=void 0!==e.nsecs?e.nsecs:m+1,g=c-p+(f-m)/1e4;if(g<0&&void 0===e.clockseq&&(a=a+1&16383),(g<0||c>p)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");p=c,m=f,d=a;var y=(1e4*(268435455&(c+=122192928e5))+f)%4294967296;i[r++]=y>>>24&255,i[r++]=y>>>16&255,i[r++]=y>>>8&255,i[r++]=255&y;var b=c/4294967296*1e4&268435455;i[r++]=b>>>8&255,i[r++]=255&b,i[r++]=b>>>24&15|16,i[r++]=b>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(var v=0;v<6;++v)i[r+v]=o[v];return t||h(i)};var g=function(e){if(!a(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};var y=function(e,t,n){function r(e,r,i,s){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n>>9<<4)+1}function v(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function S(e,t,n,r,i,s){return v((o=v(v(t,e),v(r,s)))<<(a=i)|o>>>32-a,n);var o,a}function w(e,t,n,r,i,s,o){return S(t&n|~t&r,e,t,i,s,o)}function k(e,t,n,r,i,s,o){return S(t&r|n&~r,e,t,i,s,o)}function x(e,t,n,r,i,s,o){return S(t^n^r,e,t,i,s,o)}function T(e,t,n,r,i,s,o){return S(n^(t|~r),e,t,i,s,o)}var E=y("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n>5]>>>i%32&255,o=parseInt(r.charAt(s>>>4&15)+r.charAt(15&s),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[r/8])<>>32-t}var O=y("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var i=0;i>>0;v=b,b=y,y=I(g,30)>>>0,g=f,f=k}n[0]=n[0]+f>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+y>>>0,n[3]=n[3]+b>>>0,n[4]=n[4]+v>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),M="00000000-0000-0000-0000-000000000000";var N=function(e){if(!a(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}}]); +// c11cf08a48f82d3faa43aa0b5a6943e314aee3e725d145b771fed3bee77452bd =^..^= \ No newline at end of file