diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e400c8f --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Samq64 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4c1a9fa --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Bliss Board for CARE + +A webpage for [CARE](https://www.carecentre.org/) that converts 4-digit codes to words. + +## Setup + +Simply clone the repository and start an HTTP server. + +```bash +git clone https://github.com/samq64/blissboard +cd blissboard +python -m http.server +``` + +## Scratch version + +The Scratch version is still available in the `scratch` directory but it will not load in the official editor since it relies on SheepTester's utilities extension. The project is packaged using the [TurboWarp Packager](https://packager.turbowarp.org/). diff --git a/assets/project.json b/assets/project.json deleted file mode 100644 index 3e06191..0000000 --- a/assets/project.json +++ /dev/null @@ -1 +0,0 @@ -{"targets":[{"isStage":true,"name":"Stage","variables":{"d":["Words",""]},"lists":{"a":["Code",[]]},"broadcasts":{"e":"Typing","f":"Enter"},"blocks":{"c":{"opcode":"event_whenflagclicked","next":"b","parent":null,"inputs":{},"fields":{},"topLevel":true},"b":{"opcode":"data_deletealloflist","next":"a","parent":"c","inputs":{},"fields":{"LIST":["Code","a"]}},"a":{"opcode":"data_setvariableto","next":"d","parent":"b","inputs":{"VALUE":[3,"e",[10,"0"]]},"fields":{"VARIABLE":["Words","d"]}},"e":{"opcode":"Fetch_fetchURL","next":null,"parent":"a","inputs":{"url":[1,[10,"https://samq64.github.io/blissboard/words.json"]]},"fields":{}},"d":{"opcode":"event_broadcast","next":null,"parent":"a","inputs":{"BROADCAST_INPUT":[1,[11,"Typing","e"]]},"fields":{}}},"comments":{},"currentCostume":0,"costumes":[{"assetId":"3430681f583c6c695f0ea34d094bbc7d","name":"backdrop1","bitmapResolution":2,"md5ext":"3430681f583c6c695f0ea34d094bbc7d.png","dataFormat":"png","rotationCenterX":216,"rotationCenterY":360}],"sounds":[],"volume":100,"layerOrder":0,"tempo":60,"videoTransparency":50,"videoState":"on","textToSpeechLanguage":null},{"isStage":false,"name":"character","variables":{"c":["word",""]},"lists":{},"broadcasts":{},"blocks":{"f":{"opcode":"event_whenbroadcastreceived","next":"a","parent":null,"inputs":{},"fields":{"BROADCAST_OPTION":["Typing","e"]},"topLevel":true},"a":{"opcode":"control_if_else","next":null,"parent":"f","inputs":{"CONDITION":[2,"d"],"SUBSTACK":[2,"g"],"SUBSTACK2":[2,"h"]},"fields":{}},"d":{"opcode":"operator_equals","next":null,"parent":"a","inputs":{"OPERAND1":[3,"i",[10,""]],"OPERAND2":[1,[10,"0"]]},"fields":{}},"i":{"opcode":"data_lengthoflist","next":null,"parent":"d","inputs":{},"fields":{"LIST":["Code","a"]}},"g":{"opcode":"looks_say","next":null,"parent":"a","inputs":{"MESSAGE":[1,[10,"Please enter a number."]]},"fields":{}},"h":{"opcode":"looks_think","next":null,"parent":"a","inputs":{"MESSAGE":[3,[13,"Code","a"],[10,"Hello!"]]},"fields":{}},"j":{"opcode":"event_whenflagclicked","next":"e","parent":null,"inputs":{},"fields":{},"topLevel":true},"e":{"opcode":"motion_gotoxy","next":"k","parent":"j","inputs":{"X":[1,[4,"0"]],"Y":[1,[4,"50"]]},"fields":{}},"k":{"opcode":"looks_show","next":null,"parent":"e","inputs":{},"fields":{}},"l":{"opcode":"event_whenbroadcastreceived","next":"c","parent":null,"inputs":{},"fields":{"BROADCAST_OPTION":["Enter","f"]},"topLevel":true},"c":{"opcode":"data_setvariableto","next":"b","parent":"l","inputs":{"VALUE":[3,"m",[10,"0"]]},"fields":{"VARIABLE":["word","c"]}},"m":{"opcode":"Fetch_jsonExtract","next":null,"parent":"c","inputs":{"name":[3,[13,"Code","a"],[10,"temperature"]],"data":[3,[12,"Words","d"],[10,"{\"temperature\": 12.3}"]]},"fields":{}},"b":{"opcode":"control_if_else","next":null,"parent":"c","inputs":{"CONDITION":[2,"n"],"SUBSTACK":[2,"o"],"SUBSTACK2":[2,"p"]},"fields":{}},"n":{"opcode":"operator_equals","next":null,"parent":"b","inputs":{"OPERAND1":[3,[12,"word","c"],[10,""]],"OPERAND2":[1,[10,""]]},"fields":{}},"o":{"opcode":"looks_say","next":null,"parent":"b","inputs":{"MESSAGE":[1,[10,"That is an invalid number."]]},"fields":{}},"p":{"opcode":"looks_say","next":null,"parent":"b","inputs":{"MESSAGE":[3,[12,"word","c"],[10,"Hello!"]]},"fields":{}}},"comments":{},"currentCostume":0,"costumes":[{"assetId":"12289178afab355a045335229994786f","name":"costume1","bitmapResolution":1,"md5ext":"12289178afab355a045335229994786f.svg","dataFormat":"svg","rotationCenterX":51.10216000000001,"rotationCenterY":73.6255124295749}],"sounds":[],"volume":100,"layerOrder":2,"visible":true,"x":0,"y":50,"size":100,"direction":90,"draggable":false,"rotationStyle":"all around"},{"isStage":false,"name":"keypad","variables":{"b":["clone id",""]},"lists":{},"broadcasts":{},"blocks":{"0":{"opcode":"control_create_clone_of_menu","next":null,"parent":"k","inputs":{},"fields":{"CLONE_OPTION":["_myself_",null]},"shadow":true},"1":{"opcode":"motion_changexby","next":null,"parent":"l","inputs":{"DX":[1,[4,"-59"]]},"fields":{}},"2":{"opcode":"control_create_clone_of_menu","next":null,"parent":"l","inputs":{},"fields":{"CLONE_OPTION":["_myself_",null]},"shadow":true},"3":{"opcode":"event_whenthisspriteclicked","next":"m","parent":null,"inputs":{},"fields":{},"topLevel":true},"4":{"opcode":"operator_equals","next":null,"parent":"D","inputs":{"OPERAND1":[3,[12,"clone id","b"],[10,""]],"OPERAND2":[1,[10,""]]},"fields":{}},"5":{"opcode":"looks_cleargraphiceffects","next":null,"parent":"n","inputs":{},"fields":{}},"6":{"opcode":"sensing_mousedown","next":null,"parent":"F","inputs":{},"fields":{}},"7":{"opcode":"event_whenthisspriteclicked","next":"o","parent":null,"inputs":{},"fields":{},"topLevel":true},"8":{"opcode":"operator_equals","next":null,"parent":"G","inputs":{"OPERAND1":[3,[12,"clone id","b"],[10,""]],"OPERAND2":[1,[10,""]]},"fields":{}},"9":{"opcode":"operator_equals","next":null,"parent":"a","inputs":{"OPERAND1":[3,[12,"clone id","b"],[10,""]],"OPERAND2":[1,[10,"back"]]},"fields":{}},"N":{"opcode":"event_whenflagclicked","next":"q","parent":null,"inputs":{},"fields":{},"topLevel":true},"q":{"opcode":"looks_hide","next":"r","parent":"N","inputs":{},"fields":{}},"r":{"opcode":"data_setvariableto","next":"O","parent":"q","inputs":{"VALUE":[1,[10,""]]},"fields":{"VARIABLE":["clone id","b"]}},"O":{"opcode":"procedures_call","next":null,"parent":"r","inputs":{},"fields":{},"mutation":{"tagName":"mutation","children":[],"proccode":"Make clones","argumentids":"[]","warp":"true"}},"P":{"opcode":"control_start_as_clone","next":"c","parent":null,"inputs":{},"fields":{},"topLevel":true},"Q":{"opcode":"looks_show","next":null,"parent":"c","inputs":{},"fields":{}},"c":{"opcode":"data_setvariableto","next":"Q","parent":"P","inputs":{"VALUE":[3,"R",[10,"0"]]},"fields":{"VARIABLE":["clone id","b"]}},"R":{"opcode":"looks_costumenumbername","next":null,"parent":"c","inputs":{},"fields":{"NUMBER_NAME":["name",null]}},"s":{"opcode":"procedures_definition","next":"d","parent":null,"inputs":{"custom_block":[1,"S"]},"fields":{},"topLevel":true},"S":{"opcode":"procedures_prototype","next":null,"parent":"s","inputs":{},"fields":{},"shadow":true,"mutation":{"tagName":"mutation","children":[],"proccode":"Make clones","argumentids":"[]","argumentnames":"[]","argumentdefaults":"[]","warp":"true"}},"d":{"opcode":"looks_switchcostumeto","next":"t","parent":"s","inputs":{"COSTUME":[1,"T"]},"fields":{}},"T":{"opcode":"looks_costume","next":null,"parent":"d","inputs":{},"fields":{"COSTUME":["0",null]},"shadow":true},"t":{"opcode":"motion_gotoxy","next":"e","parent":"d","inputs":{"X":[1,[4,"66"]],"Y":[1,[4,"-65"]]},"fields":{}},"e":{"opcode":"control_repeat","next":"u","parent":"t","inputs":{"TIMES":[1,[6,"4"]],"SUBSTACK":[2,"f"]},"fields":{}},"f":{"opcode":"control_create_clone_of","next":"v","parent":"e","inputs":{"CLONE_OPTION":[1,"U"]},"fields":{}},"U":{"opcode":"control_create_clone_of_menu","next":null,"parent":"f","inputs":{},"fields":{"CLONE_OPTION":["_myself_",null]},"shadow":true},"v":{"opcode":"looks_nextcostume","next":"V","parent":"f","inputs":{},"fields":{}},"V":{"opcode":"motion_changexby","next":null,"parent":"v","inputs":{"DX":[1,[4,"-44"]]},"fields":{}},"u":{"opcode":"motion_changeyby","next":"w","parent":"e","inputs":{"DY":[1,[4,"-44"]]},"fields":{}},"w":{"opcode":"motion_setx","next":"g","parent":"u","inputs":{"X":[1,[4,"66"]]},"fields":{}},"g":{"opcode":"control_create_clone_of","next":"h","parent":"w","inputs":{"CLONE_OPTION":[1,"W"]},"fields":{}},"W":{"opcode":"control_create_clone_of_menu","next":null,"parent":"g","inputs":{},"fields":{"CLONE_OPTION":["_myself_",null]},"shadow":true},"h":{"opcode":"looks_switchcostumeto","next":"x","parent":"g","inputs":{"COSTUME":[1,"X"]},"fields":{}},"X":{"opcode":"looks_costume","next":null,"parent":"h","inputs":{},"fields":{"COSTUME":["back",null]},"shadow":true},"x":{"opcode":"motion_setx","next":"i","parent":"h","inputs":{"X":[1,[4,"0"]]},"fields":{}},"i":{"opcode":"control_create_clone_of","next":"y","parent":"x","inputs":{"CLONE_OPTION":[1,"Y"]},"fields":{}},"Y":{"opcode":"control_create_clone_of_menu","next":null,"parent":"i","inputs":{},"fields":{"CLONE_OPTION":["_myself_",null]},"shadow":true},"y":{"opcode":"motion_setx","next":"j","parent":"i","inputs":{"X":[1,[4,"-66"]]},"fields":{}},"j":{"opcode":"looks_switchcostumeto","next":"k","parent":"y","inputs":{"COSTUME":[1,"Z"]},"fields":{}},"Z":{"opcode":"looks_costume","next":null,"parent":"j","inputs":{},"fields":{"COSTUME":["5",null]},"shadow":true},"k":{"opcode":"control_create_clone_of","next":"z","parent":"j","inputs":{"CLONE_OPTION":[1,"0"]},"fields":{}},"z":{"opcode":"motion_changeyby","next":"A","parent":"k","inputs":{"DY":[1,[4,"-44"]]},"fields":{}},"A":{"opcode":"motion_setx","next":"B","parent":"z","inputs":{"X":[1,[4,"59"]]},"fields":{}},"B":{"opcode":"control_repeat","next":null,"parent":"A","inputs":{"TIMES":[1,[6,"3"]],"SUBSTACK":[2,"C"]},"fields":{}},"C":{"opcode":"looks_nextcostume","next":"l","parent":"B","inputs":{},"fields":{}},"l":{"opcode":"control_create_clone_of","next":"1","parent":"C","inputs":{"CLONE_OPTION":[1,"2"]},"fields":{}},"m":{"opcode":"control_if","next":null,"parent":"3","inputs":{"CONDITION":[2,"D"],"SUBSTACK":[2,"E"]},"fields":{}},"D":{"opcode":"operator_not","next":null,"parent":"m","inputs":{"OPERAND":[2,"4"]},"fields":{}},"E":{"opcode":"looks_seteffectto","next":"n","parent":"m","inputs":{"VALUE":[1,[4,"-30"]]},"fields":{"EFFECT":["BRIGHTNESS",null]}},"n":{"opcode":"control_wait_until","next":"5","parent":"E","inputs":{"CONDITION":[2,"F"]},"fields":{}},"F":{"opcode":"operator_not","next":null,"parent":"n","inputs":{"OPERAND":[2,"6"]},"fields":{}},"o":{"opcode":"control_if","next":null,"parent":"7","inputs":{"CONDITION":[2,"G"],"SUBSTACK":[2,"a"]},"fields":{}},"G":{"opcode":"operator_not","next":null,"parent":"o","inputs":{"OPERAND":[2,"8"]},"fields":{}},"a":{"opcode":"control_if_else","next":"H","parent":"o","inputs":{"CONDITION":[2,"9"],"SUBSTACK":[2,"I"],"SUBSTACK2":[2,"b"]},"fields":{}},"I":{"opcode":"data_deleteoflist","next":null,"parent":"a","inputs":{"INDEX":[3,"!",[7,"1"]]},"fields":{"LIST":["Code","a"]}},"!":{"opcode":"data_lengthoflist","next":null,"parent":"I","inputs":{},"fields":{"LIST":["Code","a"]}},"b":{"opcode":"control_if","next":"#","parent":"a","inputs":{"CONDITION":[2,"J"],"SUBSTACK":[2,"%"]},"fields":{}},"J":{"opcode":"operator_equals","next":null,"parent":"b","inputs":{"OPERAND1":[3,"(",[10,""]],"OPERAND2":[1,[10,"4"]]},"fields":{}},"(":{"opcode":"data_lengthoflist","next":null,"parent":"J","inputs":{},"fields":{"LIST":["Code","a"]}},"%":{"opcode":"data_deletealloflist","next":null,"parent":"b","inputs":{},"fields":{"LIST":["Code","a"]}},"#":{"opcode":"data_addtolist","next":null,"parent":"b","inputs":{"ITEM":[3,[12,"clone id","b"],[10,"thing"]]},"fields":{"LIST":["Code","a"]}},"H":{"opcode":"event_broadcast","next":"p","parent":"a","inputs":{"BROADCAST_INPUT":[1,[11,"Typing","e"]]},"fields":{}},"p":{"opcode":"control_if","next":null,"parent":"H","inputs":{"CONDITION":[2,"K"],"SUBSTACK":[2,"L"]},"fields":{}},"K":{"opcode":"operator_not","next":null,"parent":"p","inputs":{"OPERAND":[2,"M"]},"fields":{}},"M":{"opcode":"operator_lt","next":null,"parent":"K","inputs":{"OPERAND1":[3,")",[10,""]],"OPERAND2":[1,[10,"4"]]},"fields":{}},")":{"opcode":"data_lengthoflist","next":null,"parent":"M","inputs":{},"fields":{"LIST":["Code","a"]}},"L":{"opcode":"control_wait","next":"*","parent":"p","inputs":{"DURATION":[1,[5,".2"]]},"fields":{}},"*":{"opcode":"event_broadcast","next":null,"parent":"L","inputs":{"BROADCAST_INPUT":[1,[11,"Enter","f"]]},"fields":{}}},"comments":{},"currentCostume":8,"costumes":[{"assetId":"005eb11d23ff40e32574e24a7cde4b01","name":"0","bitmapResolution":1,"md5ext":"005eb11d23ff40e32574e24a7cde4b01.svg","dataFormat":"svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.51374499999997},{"assetId":"20452090e6a2a0c9b7dd1053d35c6abf","name":"1","bitmapResolution":1,"md5ext":"20452090e6a2a0c9b7dd1053d35c6abf.svg","dataFormat":"svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.513734999999997},{"assetId":"b32058efe248af71718ff2e5ecaf417b","name":"2","bitmapResolution":1,"md5ext":"b32058efe248af71718ff2e5ecaf417b.svg","dataFormat":"svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.763744999999943},{"assetId":"733a29b0b6b8b1a26738d25f555a5a56","name":"3","bitmapResolution":1,"md5ext":"733a29b0b6b8b1a26738d25f555a5a56.svg","dataFormat":"svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.51374499999997},{"assetId":"c4ca28771493732b7646dacba0702e45","name":"4","bitmapResolution":1,"md5ext":"c4ca28771493732b7646dacba0702e45.svg","dataFormat":"svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.701224999999994},{"assetId":"f4829d6604c4497961de7bbec5210db3","name":"5","bitmapResolution":1,"md5ext":"f4829d6604c4497961de7bbec5210db3.svg","dataFormat":"svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.638734999999997},{"assetId":"82409cc740b81aa9514022c7c12ae5e3","name":"6","bitmapResolution":1,"md5ext":"82409cc740b81aa9514022c7c12ae5e3.svg","dataFormat":"svg","rotationCenterX":27.20727000000005,"rotationCenterY":19.513724999999994},{"assetId":"978741fdc172215a97e103559f3dafc8","name":"7","bitmapResolution":1,"md5ext":"978741fdc172215a97e103559f3dafc8.svg","dataFormat":"svg","rotationCenterX":27.082269999999994,"rotationCenterY":19.82623499999997},{"assetId":"12eac2ca2c9f6345774f06ffe8053726","name":"8","bitmapResolution":1,"md5ext":"12eac2ca2c9f6345774f06ffe8053726.svg","dataFormat":"svg","rotationCenterX":27.457279999999997,"rotationCenterY":19.57621499999999},{"assetId":"e97814fe59c4e089cf534280d2dc9f0c","name":"back","bitmapResolution":1,"md5ext":"e97814fe59c4e089cf534280d2dc9f0c.svg","dataFormat":"svg","rotationCenterX":41.644774999999996,"rotationCenterY":19.576234999999997}],"sounds":[],"volume":100,"layerOrder":1,"visible":false,"x":-118,"y":-153,"size":100,"direction":90,"draggable":false,"rotationStyle":"all around"}],"monitors":[{"id":"d","mode":"default","opcode":"data_variable","params":{"VARIABLE":"Words"},"spriteName":null,"value":0,"width":0,"height":0,"x":132,"y":0,"visible":false,"sliderMin":0,"sliderMax":100,"isDiscrete":true},{"id":"c","mode":"default","opcode":"data_variable","params":{"VARIABLE":"word"},"spriteName":"character","value":0,"width":0,"height":0,"x":132,"y":98,"visible":false,"sliderMin":0,"sliderMax":100,"isDiscrete":true},{"id":"b","mode":"default","opcode":"data_variable","params":{"VARIABLE":"clone id"},"spriteName":"keypad","value":0,"width":0,"height":0,"x":132,"y":5,"visible":false,"sliderMin":0,"sliderMax":100,"isDiscrete":true},{"id":"a","mode":"list","opcode":"data_listcontents","params":{"LIST":"Code"},"spriteName":null,"value":[],"width":0,"height":0,"x":132,"y":0,"visible":false}],"extensions":["Fetch"],"meta":{"semver":"3.0.0"}} \ No newline at end of file diff --git a/images/eyes-dark.svg b/images/eyes-dark.svg new file mode 100644 index 0000000..e2513c8 --- /dev/null +++ b/images/eyes-dark.svg @@ -0,0 +1 @@ +041235678 \ No newline at end of file diff --git a/images/eyes.svg b/images/eyes.svg new file mode 100644 index 0000000..9a22a76 --- /dev/null +++ b/images/eyes.svg @@ -0,0 +1 @@ +041235678 \ No newline at end of file diff --git a/index.html b/index.html index 092efb9..3fe8aec 100644 --- a/index.html +++ b/index.html @@ -1,335 +1,43 @@ - - - - - - - - Bliss Board for CARE - - - - - - - -
- - - -
-

Loading...

- -
-
- - - - - - - - - + + + + + + Bliss Board for C.A.R.E + + +
+

Bliss Board for C.A.R.E

+
+ + + Eyes surrounded by the digits 0-8. + +

+ This is the unofficial site for C.A.R.E. to speed up bliss board conversations. Type the code and see the corresponding words. +

+
+
+ + +
+

+
+ History +
    +
    + +
    + + diff --git a/scratch/BlissBoard.sb3 b/scratch/BlissBoard.sb3 new file mode 100644 index 0000000..f7caa65 Binary files /dev/null and b/scratch/BlissBoard.sb3 differ diff --git a/assets/005eb11d23ff40e32574e24a7cde4b01.svg b/scratch/assets/005eb11d23ff40e32574e24a7cde4b01.svg similarity index 100% rename from assets/005eb11d23ff40e32574e24a7cde4b01.svg rename to scratch/assets/005eb11d23ff40e32574e24a7cde4b01.svg diff --git a/assets/12289178afab355a045335229994786f.svg b/scratch/assets/12289178afab355a045335229994786f.svg similarity index 100% rename from assets/12289178afab355a045335229994786f.svg rename to scratch/assets/12289178afab355a045335229994786f.svg diff --git a/assets/12eac2ca2c9f6345774f06ffe8053726.svg b/scratch/assets/12eac2ca2c9f6345774f06ffe8053726.svg similarity index 100% rename from assets/12eac2ca2c9f6345774f06ffe8053726.svg rename to scratch/assets/12eac2ca2c9f6345774f06ffe8053726.svg diff --git a/assets/20452090e6a2a0c9b7dd1053d35c6abf.svg b/scratch/assets/20452090e6a2a0c9b7dd1053d35c6abf.svg similarity index 100% rename from assets/20452090e6a2a0c9b7dd1053d35c6abf.svg rename to scratch/assets/20452090e6a2a0c9b7dd1053d35c6abf.svg diff --git a/assets/3430681f583c6c695f0ea34d094bbc7d.png b/scratch/assets/3430681f583c6c695f0ea34d094bbc7d.png similarity index 100% rename from assets/3430681f583c6c695f0ea34d094bbc7d.png rename to scratch/assets/3430681f583c6c695f0ea34d094bbc7d.png diff --git a/assets/733a29b0b6b8b1a26738d25f555a5a56.svg b/scratch/assets/733a29b0b6b8b1a26738d25f555a5a56.svg similarity index 100% rename from assets/733a29b0b6b8b1a26738d25f555a5a56.svg rename to scratch/assets/733a29b0b6b8b1a26738d25f555a5a56.svg diff --git a/assets/82409cc740b81aa9514022c7c12ae5e3.svg b/scratch/assets/82409cc740b81aa9514022c7c12ae5e3.svg similarity index 100% rename from assets/82409cc740b81aa9514022c7c12ae5e3.svg rename to scratch/assets/82409cc740b81aa9514022c7c12ae5e3.svg diff --git a/assets/978741fdc172215a97e103559f3dafc8.svg b/scratch/assets/978741fdc172215a97e103559f3dafc8.svg similarity index 100% rename from assets/978741fdc172215a97e103559f3dafc8.svg rename to scratch/assets/978741fdc172215a97e103559f3dafc8.svg diff --git a/assets/b32058efe248af71718ff2e5ecaf417b.svg b/scratch/assets/b32058efe248af71718ff2e5ecaf417b.svg similarity index 100% rename from assets/b32058efe248af71718ff2e5ecaf417b.svg rename to scratch/assets/b32058efe248af71718ff2e5ecaf417b.svg diff --git a/assets/c4ca28771493732b7646dacba0702e45.svg b/scratch/assets/c4ca28771493732b7646dacba0702e45.svg similarity index 100% rename from assets/c4ca28771493732b7646dacba0702e45.svg rename to scratch/assets/c4ca28771493732b7646dacba0702e45.svg diff --git a/assets/e97814fe59c4e089cf534280d2dc9f0c.svg b/scratch/assets/e97814fe59c4e089cf534280d2dc9f0c.svg similarity index 100% rename from assets/e97814fe59c4e089cf534280d2dc9f0c.svg rename to scratch/assets/e97814fe59c4e089cf534280d2dc9f0c.svg diff --git a/assets/f4829d6604c4497961de7bbec5210db3.svg b/scratch/assets/f4829d6604c4497961de7bbec5210db3.svg similarity index 100% rename from assets/f4829d6604c4497961de7bbec5210db3.svg rename to scratch/assets/f4829d6604c4497961de7bbec5210db3.svg diff --git a/scratch/assets/project.json b/scratch/assets/project.json new file mode 100644 index 0000000..01689bd --- /dev/null +++ b/scratch/assets/project.json @@ -0,0 +1 @@ +{"targets":[{"isStage":true,"name":"Stage","variables":{"GwIf-6@Nn@Z;|=|VjMfD":["Words","{\n \"1000\": \"Sing\",\n \"1001\": \"Because\",\n \"1002\": \"Father\",\n \"1003\": \"Mother\",\n \"1004\": \"May\",\n \"1005\": \"Make\",\n \"1006\": \"Not\",\n \"1007\": \"Fight\",\n \"1008\": \"Drink\",\n \"1010\": \"Touch\",\n \"1011\": \"Each\",\n \"1012\": \"Special\",\n \"1013\": \"Lucky\",\n \"1014\": \"Afraid\",\n \"1015\": \"Teeth\",\n \"1016\": \"Milk\",\n \"1017\": \"Cutlery\",\n \"1020\": \"Letter\",\n \"1021\": \"Coat\",\n \"1022\": \"Taxi\",\n \"1023\": \"Television\",\n \"1024\": \"Store\",\n \"1025\": \"Fish\",\n \"1026\": \"Star\",\n \"1027\": \"Yesterday\",\n \"1030\": \"Time\",\n \"1031\": \"Heart Broken\",\n \"1100\": \"Question\",\n \"1101\": \"In order to\",\n \"1102\": \"Brother\",\n \"1103\": \"Sister\",\n \"1104\": \"Like\",\n \"1105\": \"Want\",\n \"1106\": \"Sleep\",\n \"1107\": \"Swim\",\n \"1108\": \"Dance\",\n \"1110\": \"To\",\n \"1111\": \"From\",\n \"1112\": \"Correct\",\n \"1113\": \"Proud\",\n \"1114\": \"Sick\",\n \"1115\": \"Hand\",\n \"1116\": \"Bread\",\n \"1117\": \"Switch\",\n \"1120\": \"Parcel\",\n \"1121\": \"Underwater\",\n \"1122\": \"Train\",\n \"1123\": \"Telephone\",\n \"1124\": \"Plaza\",\n \"1125\": \"Insect\",\n \"1126\": \"Weather\",\n \"1127\": \"Today\",\n \"1130\": \"Hour\",\n \"1131\": \"Hopeless\",\n \"1200\": \"Answer\",\n \"1201\": \"Maybe\",\n \"1202\": \"Grandfather\",\n \"1203\": \"Grandmother\",\n \"1204\": \"Love\",\n \"1205\": \"Feel\",\n \"1206\": \"wash\",\n \"1207\": \"Stand\",\n \"1208\": \"Joke\",\n \"1210\": \"Before\",\n \"1211\": \"In\",\n \"1212\": \"Interesting\",\n \"1213\": \"Safe\",\n \"1214\": \"Alone\",\n \"1215\": \"Legs\",\n \"1216\": \"Soup\",\n \"1217\": \"Scissors\",\n \"1220\": \"Symbol\",\n \"1221\": \"Socks\",\n \"1222\": \"Gun\",\n \"1223\": \"Electric\",\n \"1224\": \"Money\",\n \"1225\": \"Tree\",\n \"1226\": \"Rain\",\n \"1227\": \"Tomorrow\",\n \"1230\": \"Minute\",\n \"1231\": \"Depressed\",\n \"1300\": \"Who?\",\n \"1301\": \"Baby\",\n \"1302\": \"Uncle\",\n \"1303\": \"Aunt\",\n \"1304\": \"Laugh\",\n \"1305\": \"Need\",\n \"1306\": \"Dress\",\n \"1307\": \"Sit\",\n \"1308\": \"Fix\",\n \"1310\": \"After\",\n \"1311\": \"Out\",\n \"1312\": \"Big\",\n \"1313\": \"Little\",\n \"1314\": \"Broken\",\n \"1315\": \"Head\",\n \"1316\": \"Meat\",\n \"1317\": \"Needle\",\n \"1320\": \"Word\",\n \"1321\": \"Shoes\",\n \"1322\": \"Airplane\",\n \"1323\": \"Room\",\n \"1324\": \"Movies\",\n \"1325\": \"Flower\",\n \"1326\": \"Cloud\",\n \"1327\": \"Holiday\",\n \"1330\": \"Birthday\",\n \"1331\": \"Frustrated\",\n \"1400\": \"What?\",\n \"1401\": \"Child\",\n \"1402\": \"Cousin\",\n \"1403\": \"Relative\",\n \"1404\": \"Tease\",\n \"1405\": \"Let\",\n \"1406\": \"Change\",\n \"1407\": \"Dream\",\n \"1408\": \"Ask\",\n \"1410\": \"For\",\n \"1411\": \"On\",\n \"1412\": \"Long\",\n \"1413\": \"Heavy\",\n \"1414\": \"Dead\",\n \"1415\": \"Hair\",\n \"1416\": \"Foot\",\n \"1417\": \"Stomach\",\n \"1420\": \"News\",\n \"1421\": \"Pocket\",\n \"1422\": \"Boat\",\n \"1423\": \"Door\",\n \"1424\": \"Garage\",\n \"1425\": \"Grass\",\n \"1426\": \"Snow\",\n \"1427\": \"Weekend\",\n \"1430\": \"Spring\",\n \"1431\": \"Irritated\",\n \"1500\": \"Why?\",\n \"1501\": \"Teenager\",\n \"1502\": \"Volunteer\",\n \"1503\": \"Family\",\n \"1504\": \"Cry\",\n \"1505\": \"Give\",\n \"1506\": \"Grow\",\n \"1507\": \"Put\",\n \"1508\": \"Hug\",\n \"1510\": \"Up\",\n \"1511\": \"Again\",\n \"1512\": \"Fat\",\n \"1513\": \"Soft\",\n \"1514\": \"Wet\",\n \"1515\": \"Body\",\n \"1516\": \"Cheese\",\n \"1517\": \"Container\",\n \"1520\": \"Story\",\n \"1521\": \"Pyjamas\",\n \"1522\": \"Elevator\",\n \"1523\": \"Window\",\n \"1524\": \"Street\",\n \"1525\": \"Seed\",\n \"1526\": \"Ice\",\n \"1527\": \"Week\",\n \"1530\": \"Summer\",\n \"1531\": \"Resistant\",\n \"1600\": \"Where?\",\n \"1601\": \"Adult\",\n \"1602\": \"Teacher\",\n \"1603\": \"Freind\",\n \"1604\": \"Think\",\n \"1605\": \"Receive\",\n \"1606\": \"Marry\",\n \"1607\": \"Carry\",\n \"1608\": \"Break\",\n \"1610\": \"Down\",\n \"1611\": \"Too much\",\n \"1612\": \"Far\",\n \"1613\": \"Open\",\n \"1614\": \"Hot\",\n \"1615\": \"Pain\",\n \"1616\": \"Egg\",\n \"1617\": \"Comb\",\n \"1620\": \"Radio\",\n \"1621\": \"Towel\",\n \"1622\": \"Outing\",\n \"1623\": \"Floor\",\n \"1624\": \"Backyard\",\n \"1625\": \"Hill\",\n \"1626\": \"Thunder\",\n \"1627\": \"Month\",\n \"1630\": \"Fall\",\n \"1631\": \"Uptight\",\n \"1700\": \"When?\",\n \"1701\": \"Square\",\n \"1702\": \"Therapist\",\n \"1703\": \"Doctor\",\n \"1704\": \"Know\",\n \"1705\": \"Save\",\n \"1706\": \"Surprise\",\n \"1707\": \"End, Stop\",\n \"1708\": \"Smile\",\n \"1710\": \"Forward\",\n \"1711\": \"Enough\",\n \"1712\": \"Full\",\n \"1713\": \"Dirty\",\n \"1714\": \"Loud\",\n \"1715\": \"Name\",\n \"1716\": \"Vegetable\",\n \"1717\": \"Machine\",\n \"1720\": \"Picture\",\n \"1721\": \"Metal\",\n \"1722\": \"Gathering\",\n \"1723\": \"Wall\",\n \"1724\": \"Country\",\n \"1725\": \"Earth\",\n \"1726\": \"Sky\",\n \"1727\": \"Year\",\n \"1730\": \"Winter\",\n \"1731\": \"Annoyed\",\n \"2000\": \"How?\",\n \"2001\": \"Circle\",\n \"2002\": \"Nurse\",\n \"2003\": \"Dentist\",\n \"2004\": \"Learn\",\n \"2005\": \"Catch\",\n \"2006\": \"Cut\",\n \"2007\": \"Help\",\n \"2008\": \"Hold\",\n \"2010\": \"Under\",\n \"2011\": \"Much, Many\",\n \"2012\": \"Strong\",\n \"2013\": \"Expensive\",\n \"2014\": \"Early\",\n \"2015\": \"Secret\",\n \"2016\": \"Fruit\",\n \"2017\": \"Typewriter\",\n \"2020\": \"Flag\",\n \"2021\": \"Plastic\",\n \"2022\": \"Hobby\",\n \"2023\": \"Stairs\",\n \"2024\": \"Park\",\n \"2025\": \"Air\",\n \"2026\": \"Wind\",\n \"2027\": \"City\",\n \"2030\": \"Leaf\",\n \"2031\": \"Offeneded\",\n \"2100\": \"Which?\",\n \"2101\": \"Triangle\",\n \"2102\": \"Policeman\",\n \"2103\": \"Workman\",\n \"2104\": \"Guess\",\n \"2105\": \"Find\",\n \"2106\": \"Cook\",\n \"2107\": \"Try\",\n \"2108\": \"Argue\",\n \"2110\": \"Between\",\n \"2111\": \"More\",\n \"2112\": \"Here\",\n \"2113\": \"Hungry\",\n \"2114\": \"Late\",\n \"2115\": \"Protection\",\n \"2116\": \"Dessert\",\n \"2117\": \"Computer\",\n \"2120\": \"Music\",\n \"2121\": \"Glass\",\n \"2122\": \"Sport\",\n \"2123\": \"Cupboard\",\n \"2124\": \"Lake\",\n \"2125\": \"Water\",\n \"2126\": \"Battery\",\n \"2127\": \"Strap\",\n \"2130\": \"Gift\",\n \"2131\": \"Betrayed\",\n \"2200\": \"How Many?\",\n \"2201\": \"Rectangle\",\n \"2202\": \"Visitors\",\n \"2203\": \"Stranger\",\n \"2204\": \"Forget\",\n \"2205\": \"Choose\",\n \"2206\": \"Stick\",\n \"2207\": \"Wish\",\n \"2208\": \"Share\",\n \"2210\": \"Around\",\n \"2211\": \"Most\",\n \"2212\": \"There\",\n \"2213\": \"Left\",\n \"2214\": \"Right\",\n \"2215\": \"Idea\",\n \"2216\": \"Treat\",\n \"2217\": \"Desk\",\n \"2220\": \"Record\",\n \"2221\": \"Cloth\",\n \"2222\": \"Gym\",\n \"2223\": \"Ticket\",\n \"2224\": \"Place\",\n \"2225\": \"Fire\",\n \"2226\": \"Garbage\",\n \"2227\": \"Monster\",\n \"2230\": \"Party\",\n \"2231\": \"Outraged\",\n \"2302\": \"Couple\",\n \"2304\": \"Destroy\",\n \"2305\": \"Win\",\n \"2306\": \"Call\",\n \"2307\": \"Patient\",\n \"2308\": \"Engaged\",\n \"2310\": \"Favorite\",\n \"2311\": \"Free\",\n \"2312\": \"Comfortable\",\n \"2313\": \"Wrong\",\n \"2314\": \"Nice\",\n \"2315\": \"Physically handycapped\",\n \"2316\": \"Ice cream\",\n \"2317\": \"Wine\",\n \"2320\": \"Tape recorder\",\n \"2321\": \"Meeting\",\n \"2322\": \"Crotch\",\n \"2323\": \"Breast\",\n \"2324\": \"Back\",\n \"2325\": \"Heart\",\n \"2326\": \"Bowel Movement\",\n \"2327\": \"Plug\",\n \"2330\": \"Christmas\",\n \"0000\": \"Boy\",\n \"0001\": \"Girl\",\n \"0002\": \"Hello\",\n \"0003\": \"Swallow\",\n \"0004\": \"Hide\",\n \"0005\": \"Kiss\",\n \"0006\": \"Fall\",\n \"0007\": \"Push\",\n \"0008\": \"Miss\",\n \"0010\": \"Buy\",\n \"0011\": \"Red\",\n \"0012\": \"Green\",\n \"0013\": \"Blue\",\n \"0014\": \"Yellow\",\n \"0015\": \"White\",\n \"0016\": \"Brown\",\n \"0017\": \"Pink\",\n \"0020\": \"Black\",\n \"0021\": \"Purple\",\n \"0022\": \"Sunday\",\n \"0023\": \"Monday\",\n \"0024\": \"Tuesday\",\n \"0025\": \"Wednesday\",\n \"0026\": \"Thursday\",\n \"0027\": \"Friday\",\n \"0030\": \"Saturday\",\n \"0031\": \"Overjoyed\",\n \"0032\": \"Anxious\",\n \"0100\": \"Intensity\",\n \"0101\": \"Symbol (part)\",\n \"0103\": \"Sounds like\",\n \"0104\": \"Write\",\n \"0105\": \"Watch\",\n \"0106\": \"Belongs to\",\n \"0107\": \"And\",\n \"0108\": \"Worry\",\n \"0110\": \"With\",\n \"0111\": \"Opposite (meaning)\",\n \"0112\": \"Part\",\n \"0113\": \"Important\",\n \"0114\": \"Combine (indicator)\",\n \"0115\": \"Making (discriptive)\",\n \"0116\": \"(Plural)\",\n \"0117\": \"(Thing)\",\n \"0120\": \"Same as\",\n \"0121\": \"Like\",\n \"0122\": \"Different\",\n \"0124\": \"Trust\",\n \"0125\": \"Measure\",\n \"0126\": \"Count\",\n \"0127\": \"Minus\",\n \"0130\": \"Plus\",\n \"0131\": \"Relieved\",\n \"0132\": \"Unsure\",\n \"0200\": \"A\",\n \"0201\": \"B\",\n \"0202\": \"C\",\n \"0203\": \"D\",\n \"0204\": \"E\",\n \"0205\": \"F\",\n \"0206\": \"G\",\n \"0207\": \"H\",\n \"0208\": \"Visit\",\n \"0210\": \"I\",\n \"0211\": \"J\",\n \"0212\": \"K\",\n \"0213\": \"L\",\n \"0214\": \"M\",\n \"0215\": \"N\",\n \"0216\": \"O\",\n \"0217\": \"P\",\n \"0220\": \"Q\",\n \"0221\": \"R\",\n \"0222\": \"S\",\n \"0223\": \"T\",\n \"0224\": \"U\",\n \"0225\": \"V\",\n \"0226\": \"W\",\n \"0227\": \"X\",\n \"0230\": \"Y, Z\",\n \"0231\": \"Content\",\n \"0232\": \"Nervous\",\n \"0300\": \"Goodbye\",\n \"0301\": \"If\",\n \"0302\": \"I, Me\",\n \"0303\": \"You\",\n \"0304\": \"Past, Ago\",\n \"0305\": \"Present, Now\",\n \"0306\": \"Future, Then\",\n \"0307\": \"Go, Walk\",\n \"0310\": \"Can, be able\",\n \"0311\": \"A, an\",\n \"0312\": \"Good\",\n \"0313\": \"Lonely\",\n \"0314\": \"Smart\",\n \"0315\": \"Color\",\n \"0316\": \"Number\",\n \"0317\": \"0\",\n \"0320\": \"1\",\n \"0321\": \"2\",\n \"0322\": \"3\",\n \"0323\": \"4\",\n \"0324\": \"5\",\n \"0325\": \"6\",\n \"0326\": \"7\",\n \"0327\": \"8\",\n \"0330\": \"9\",\n \"0331\": \"Mellow\",\n \"0332\": \"Uneasy\",\n \"0400\": \"Please\",\n \"0401\": \"Or\",\n \"0402\": \"He, Him\",\n \"0403\": \"She, Her\",\n \"0404\": \"Past Tense\",\n \"0405\": \"Present Tense\",\n \"0406\": \"Future Tense\",\n \"0407\": \"Come\",\n \"0408\": \"Agree\",\n \"0410\": \"Eat\",\n \"0411\": \"The\",\n \"0412\": \"Young (new)\",\n \"0413\": \"Happy\",\n \"0414\": \"Sad\",\n \"0415\": \"Ear\",\n \"0416\": \"Food\",\n \"0417\": \"Game\",\n \"0420\": \"Pen\",\n \"0421\": \"Clothing\",\n \"0422\": \"Home\",\n \"0423\": \"Table\",\n \"0424\": \"(1000)\",\n \"0425\": \"(100)\",\n \"0426\": \"(10)\",\n \"0427\": \"(1)\",\n \"0430\": \"(.)period\",\n \"0431\": \"Lost\",\n \"0432\": \"Insecure\",\n \"0500\": \"Thanks\",\n \"0501\": \"But\",\n \"0502\": \"We, Us\",\n \"0503\": \"They, Them\",\n \"0504\": \"Did, done\",\n \"0505\": \"Do, Does\",\n \"0506\": \"Will do\",\n \"0507\": \"Work\",\n \"0508\": \"Understand\",\n \"0510\": \"See\",\n \"0511\": \"This\",\n \"0512\": \"Quick\",\n \"0513\": \"Funny\",\n \"0514\": \"Upset\",\n \"0515\": \"Eye\",\n \"0516\": \"Drink\",\n \"0517\": \"Doll\",\n \"0520\": \"Paper\",\n \"0521\": \"Dress\",\n \"0522\": \"Wheelchair\",\n \"0523\": \"Chair\",\n \"0524\": \"House\",\n \"0525\": \"Animal\",\n \"0526\": \"God\",\n \"0527\": \"Glove\",\n \"0530\": \"(,)comma\",\n \"0531\": \"Moody\",\n \"0532\": \"Pitied\",\n \"0600\": \"Welcome\",\n \"0601\": \"About\",\n \"0602\": \"Person\",\n \"0603\": \"It\",\n \"0604\": \"Was, Were\",\n \"0605\": \"Am, Is Are\",\n \"0606\": \"Will be\",\n \"0607\": \"Read\",\n \"0608\": \"Promise\",\n \"0610\": \"Hear\",\n \"0611\": \"That\",\n \"0612\": \"Difficult\",\n \"0613\": \"Beautiful\",\n \"0614\": \"Mean\",\n \"0615\": \"Mouth\",\n \"0616\": \"Toilet\",\n \"0617\": \"Thing\",\n \"0620\": \"Book\",\n \"0621\": \"Pants\",\n \"0622\": \"Car\",\n \"0623\": \"Bed\",\n \"0624\": \"School\",\n \"0625\": \"Pet\",\n \"0626\": \"Sun\",\n \"0627\": \"Day\",\n \"0630\": \"Morning\",\n \"0631\": \"Let down\",\n \"0632\": \"Uncomfortable\",\n \"0700\": \"Sorry\",\n \"0701\": \"By\",\n \"0702\": \"Man\",\n \"0703\": \"Woman\",\n \"0704\": \"Had\",\n \"0705\": \"Have, Has\",\n \"0706\": \"Will have\",\n \"0707\": \"Play\",\n \"0708\": \"Drive\",\n \"0710\": \"Say\",\n \"0711\": \"All\",\n \"0712\": \"Make\",\n \"0713\": \"Excited\",\n \"0714\": \"Angry\",\n \"0715\": \"Nose\",\n \"0716\": \"Medecine\",\n \"0717\": \"Tool\",\n \"0720\": \"Workbook\",\n \"0721\": \"Shirt\",\n \"0722\": \"Bus\",\n \"0723\": \"Light\",\n \"0724\": \"Hospital\",\n \"0725\": \"Bird\",\n \"0726\": \"Moon\",\n \"0727\": \"Night\",\n \"0730\": \"Afternoon\",\n \"0731\": \"Distressed\",\n \"0732\": \"Regretful\"\n}"]},"lists":{",Z9wCV?1i_|}4|YMKhdx":["Code",["0","0","0","0"]]},"broadcasts":{"0Fk?sw0w](4sHg0Tkg4y":"Typing","]v(m1,+n8xPLKBt7T2xf":"Enter"},"blocks":{},"comments":{"ac":{"blockId":null,"x":50,"y":50,"width":350,"height":170,"minimized":false,"text":"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{\"width\":216} // _twconfig_"}},"currentCostume":0,"costumes":[{"name":"backdrop1","bitmapResolution":2,"dataFormat":"png","assetId":"3430681f583c6c695f0ea34d094bbc7d","md5ext":"3430681f583c6c695f0ea34d094bbc7d.png","rotationCenterX":216,"rotationCenterY":360}],"sounds":[],"volume":100,"layerOrder":0,"tempo":60,"videoTransparency":50,"videoState":"on","textToSpeechLanguage":null},{"isStage":false,"name":"character","variables":{"p**OT?fJw^C-D%ET^-3^":["word","Boy"]},"lists":{},"broadcasts":{},"blocks":{"P":{"opcode":"event_whenbroadcastreceived","next":"b","parent":null,"inputs":{},"fields":{"BROADCAST_OPTION":["Typing","0Fk?sw0w](4sHg0Tkg4y"]},"topLevel":true},"b":{"opcode":"control_if_else","next":null,"parent":"P","inputs":{"CONDITION":[2,"r"],"SUBSTACK":[2,"Q"],"SUBSTACK2":[2,"R"]},"fields":{}},"r":{"opcode":"operator_equals","next":null,"parent":"b","inputs":{"OPERAND1":[3,"S",[10,""]],"OPERAND2":[1,[10,"0"]]},"fields":{}},"Q":{"opcode":"looks_say","next":null,"parent":"b","inputs":{"MESSAGE":[1,[10,"Please enter a number."]]},"fields":{}},"R":{"opcode":"looks_think","next":null,"parent":"b","inputs":{"MESSAGE":[3,[13,"Code",",Z9wCV?1i_|}4|YMKhdx"],[10,""]]},"fields":{}},"T":{"opcode":"event_whenflagclicked","next":"s","parent":null,"inputs":{},"fields":{},"topLevel":true},"e":{"opcode":"data_setvariableto","next":"U","parent":"t","inputs":{"VALUE":[3,"V",[10,"0"]]},"fields":{"VARIABLE":["Words","GwIf-6@Nn@Z;|=|VjMfD"]}},"V":{"opcode":"utilities_fetchFrom","next":null,"parent":"e","inputs":{"URL":[1,[10,"https://samq64.github.io/blissboard/words.json"]]},"fields":{}},"U":{"opcode":"event_broadcast","next":null,"parent":"e","inputs":{"BROADCAST_INPUT":[1,[11,"Typing","0Fk?sw0w](4sHg0Tkg4y"]]},"fields":{}},"u":{"opcode":"motion_gotoxy","next":"t","parent":"s","inputs":{"X":[1,[4,"0"]],"Y":[1,[4,"50"]]},"fields":{}},"s":{"opcode":"looks_show","next":"u","parent":"T","inputs":{},"fields":{}},"W":{"opcode":"event_whenbroadcastreceived","next":"f","parent":null,"inputs":{},"fields":{"BROADCAST_OPTION":["Enter","]v(m1,+n8xPLKBt7T2xf"]},"topLevel":true},"f":{"opcode":"data_setvariableto","next":"c","parent":"W","inputs":{"VALUE":[3,"X",[10,"0"]]},"fields":{"VARIABLE":["word","p**OT?fJw^C-D%ET^-3^"]}},"X":{"opcode":"utilities_parseJSON","next":null,"parent":"f","inputs":{"PATH":[3,[13,"Code",",Z9wCV?1i_|}4|YMKhdx"],[10,""]],"JSON_STRING":[3,[12,"Words","GwIf-6@Nn@Z;|=|VjMfD"],[10,""]]},"fields":{}},"c":{"opcode":"control_if_else","next":null,"parent":"f","inputs":{"CONDITION":[2,"Y"],"SUBSTACK":[2,"Z"],"SUBSTACK2":[2,"!"]},"fields":{}},"Y":{"opcode":"operator_equals","next":null,"parent":"c","inputs":{"OPERAND1":[3,[12,"word","p**OT?fJw^C-D%ET^-3^"],[10,""]],"OPERAND2":[1,[10,""]]},"fields":{}},"Z":{"opcode":"looks_say","next":null,"parent":"c","inputs":{"MESSAGE":[1,[10,"That is an invalid number."]]},"fields":{}},"!":{"opcode":"looks_say","next":null,"parent":"c","inputs":{"MESSAGE":[3,[12,"word","p**OT?fJw^C-D%ET^-3^"],[10,""]]},"fields":{}},"S":{"opcode":"data_lengthoflist","next":null,"parent":"r","inputs":{},"fields":{"LIST":["Code",",Z9wCV?1i_|}4|YMKhdx"]}},"t":{"opcode":"data_deletealloflist","next":"e","parent":"u","inputs":{},"fields":{"LIST":["Code",",Z9wCV?1i_|}4|YMKhdx"]}}},"comments":{},"currentCostume":0,"costumes":[{"name":"costume1","bitmapResolution":1,"dataFormat":"svg","assetId":"12289178afab355a045335229994786f","md5ext":"12289178afab355a045335229994786f.svg","rotationCenterX":51.10216000000001,"rotationCenterY":73.6255124295749}],"sounds":[],"volume":100,"layerOrder":2,"visible":true,"x":0,"y":50,"size":100,"direction":90,"draggable":false,"rotationStyle":"all around"},{"isStage":false,"name":"keypad","variables":{"Rvo;C;f{T8|]Q9E[5c+1":["clone id",""]},"lists":{},"broadcasts":{},"blocks":{"#":{"opcode":"event_whenflagclicked","next":"v","parent":null,"inputs":{},"fields":{},"topLevel":true},"v":{"opcode":"looks_hide","next":"w","parent":"#","inputs":{},"fields":{}},"w":{"opcode":"data_setvariableto","next":"%","parent":"v","inputs":{"VALUE":[1,[10,""]]},"fields":{"VARIABLE":["clone id","Rvo;C;f{T8|]Q9E[5c+1"]}},"%":{"opcode":"procedures_call","next":null,"parent":"w","inputs":{},"fields":{},"mutation":{"tagName":"mutation","children":[],"proccode":"clone","argumentids":"[]","warp":"true"}},"(":{"opcode":"control_start_as_clone","next":"g","parent":null,"inputs":{},"fields":{},"topLevel":true},"g":{"opcode":"data_setvariableto","next":")","parent":"(","inputs":{"VALUE":[3,"*",[10,"0"]]},"fields":{"VARIABLE":["clone id","Rvo;C;f{T8|]Q9E[5c+1"]}},"*":{"opcode":"looks_costumenumbername","next":null,"parent":"g","inputs":{},"fields":{"NUMBER_NAME":["name",null]}},")":{"opcode":"looks_show","next":null,"parent":"g","inputs":{},"fields":{}},"x":{"opcode":"procedures_definition","next":"h","parent":null,"inputs":{"custom_block":[1,"+"]},"fields":{},"topLevel":true},"+":{"opcode":"procedures_prototype","next":null,"parent":"x","inputs":{},"fields":{},"shadow":true,"mutation":{"tagName":"mutation","children":[],"proccode":"clone","argumentids":"[]","argumentnames":"[]","argumentdefaults":"[]","warp":"true"}},"h":{"opcode":"looks_switchcostumeto","next":"y","parent":"x","inputs":{"COSTUME":[1,","]},"fields":{}},",":{"opcode":"looks_costume","next":null,"parent":"h","inputs":{},"fields":{"COSTUME":["0",null]},"shadow":true},"y":{"opcode":"motion_gotoxy","next":"i","parent":"h","inputs":{"X":[1,[4,"66"]],"Y":[1,[4,"-65"]]},"fields":{}},"i":{"opcode":"control_repeat","next":"z","parent":"y","inputs":{"TIMES":[1,[6,"4"]],"SUBSTACK":[2,"j"]},"fields":{}},"j":{"opcode":"control_create_clone_of","next":"A","parent":"i","inputs":{"CLONE_OPTION":[1,"-"]},"fields":{}},"-":{"opcode":"control_create_clone_of_menu","next":null,"parent":"j","inputs":{},"fields":{"CLONE_OPTION":["_myself_",null]},"shadow":true},"A":{"opcode":"looks_nextcostume","next":".","parent":"j","inputs":{},"fields":{}},".":{"opcode":"motion_changexby","next":null,"parent":"A","inputs":{"DX":[1,[4,"-44"]]},"fields":{}},"z":{"opcode":"motion_gotoxy","next":"k","parent":"i","inputs":{"X":[1,[4,"66"]],"Y":[1,[4,"-109"]]},"fields":{}},"k":{"opcode":"control_repeat","next":"B","parent":"z","inputs":{"TIMES":[1,[6,"3"]],"SUBSTACK":[2,"l"]},"fields":{}},"l":{"opcode":"control_create_clone_of","next":"C","parent":"k","inputs":{"CLONE_OPTION":[1,"/"]},"fields":{}},"/":{"opcode":"control_create_clone_of_menu","next":null,"parent":"l","inputs":{},"fields":{"CLONE_OPTION":["_myself_",null]},"shadow":true},"C":{"opcode":"looks_nextcostume","next":":","parent":"l","inputs":{},"fields":{}},":":{"opcode":"motion_changexby","next":null,"parent":"C","inputs":{"DX":[1,[4,"-66"]]},"fields":{}},"B":{"opcode":"motion_gotoxy","next":"D","parent":"k","inputs":{"X":[1,[4,"59"]],"Y":[1,[4,"-153"]]},"fields":{}},"D":{"opcode":"control_repeat","next":null,"parent":"B","inputs":{"TIMES":[1,[6,"3"]],"SUBSTACK":[2,"m"]},"fields":{}},"m":{"opcode":"control_create_clone_of","next":"E","parent":"D","inputs":{"CLONE_OPTION":[1,";"]},"fields":{}},";":{"opcode":"control_create_clone_of_menu","next":null,"parent":"m","inputs":{},"fields":{"CLONE_OPTION":["_myself_",null]},"shadow":true},"E":{"opcode":"looks_nextcostume","next":"=","parent":"m","inputs":{},"fields":{}},"=":{"opcode":"motion_changexby","next":null,"parent":"E","inputs":{"DX":[1,[4,"-59"]]},"fields":{}},"?":{"opcode":"event_whenthisspriteclicked","next":"n","parent":null,"inputs":{},"fields":{},"topLevel":true},"n":{"opcode":"control_if","next":null,"parent":"?","inputs":{"CONDITION":[2,"F"],"SUBSTACK":[2,"G"]},"fields":{}},"F":{"opcode":"operator_not","next":null,"parent":"n","inputs":{"OPERAND":[2,"@"]},"fields":{}},"@":{"opcode":"operator_equals","next":null,"parent":"F","inputs":{"OPERAND1":[3,[12,"clone id","Rvo;C;f{T8|]Q9E[5c+1"],[10,""]],"OPERAND2":[1,[10,""]]},"fields":{}},"G":{"opcode":"looks_seteffectto","next":"o","parent":"n","inputs":{"VALUE":[1,[4,"-30"]]},"fields":{"EFFECT":["BRIGHTNESS",null]}},"o":{"opcode":"control_wait_until","next":"[","parent":"G","inputs":{"CONDITION":[2,"H"]},"fields":{}},"H":{"opcode":"operator_not","next":null,"parent":"o","inputs":{"OPERAND":[2,"]"]},"fields":{}},"]":{"opcode":"sensing_mousedown","next":null,"parent":"H","inputs":{},"fields":{}},"[":{"opcode":"looks_cleargraphiceffects","next":null,"parent":"o","inputs":{},"fields":{}},"^":{"opcode":"event_whenthisspriteclicked","next":"p","parent":null,"inputs":{},"fields":{},"topLevel":true},"p":{"opcode":"control_if","next":null,"parent":"^","inputs":{"CONDITION":[2,"I"],"SUBSTACK":[2,"a"]},"fields":{}},"I":{"opcode":"operator_not","next":null,"parent":"p","inputs":{"OPERAND":[2,"_"]},"fields":{}},"_":{"opcode":"operator_equals","next":null,"parent":"I","inputs":{"OPERAND1":[3,[12,"clone id","Rvo;C;f{T8|]Q9E[5c+1"],[10,""]],"OPERAND2":[1,[10,""]]},"fields":{}},"a":{"opcode":"control_if_else","next":"J","parent":"p","inputs":{"CONDITION":[2,"`"],"SUBSTACK":[2,"K"],"SUBSTACK2":[2,"d"]},"fields":{}},"`":{"opcode":"operator_equals","next":null,"parent":"a","inputs":{"OPERAND1":[3,[12,"clone id","Rvo;C;f{T8|]Q9E[5c+1"],[10,""]],"OPERAND2":[1,[10,"back"]]},"fields":{}},"K":{"opcode":"data_deleteoflist","next":null,"parent":"a","inputs":{"INDEX":[3,"{",[7,"1"]]},"fields":{"LIST":["Code",",Z9wCV?1i_|}4|YMKhdx"]}},"{":{"opcode":"data_lengthoflist","next":null,"parent":"K","inputs":{},"fields":{"LIST":["Code",",Z9wCV?1i_|}4|YMKhdx"]}},"d":{"opcode":"control_if","next":"|","parent":"a","inputs":{"CONDITION":[2,"L"],"SUBSTACK":[2,"}"]},"fields":{}},"L":{"opcode":"operator_equals","next":null,"parent":"d","inputs":{"OPERAND1":[3,"~",[10,""]],"OPERAND2":[1,[10,"4"]]},"fields":{}},"~":{"opcode":"data_lengthoflist","next":null,"parent":"L","inputs":{},"fields":{"LIST":["Code",",Z9wCV?1i_|}4|YMKhdx"]}},"}":{"opcode":"data_deletealloflist","next":null,"parent":"d","inputs":{},"fields":{"LIST":["Code",",Z9wCV?1i_|}4|YMKhdx"]}},"|":{"opcode":"data_addtolist","next":null,"parent":"d","inputs":{"ITEM":[3,[12,"clone id","Rvo;C;f{T8|]Q9E[5c+1"],[10,"thing"]]},"fields":{"LIST":["Code",",Z9wCV?1i_|}4|YMKhdx"]}},"J":{"opcode":"event_broadcast","next":"q","parent":"a","inputs":{"BROADCAST_INPUT":[1,[11,"Typing","0Fk?sw0w](4sHg0Tkg4y"]]},"fields":{}},"q":{"opcode":"control_if","next":null,"parent":"J","inputs":{"CONDITION":[2,"M"],"SUBSTACK":[2,"N"]},"fields":{}},"M":{"opcode":"operator_not","next":null,"parent":"q","inputs":{"OPERAND":[2,"O"]},"fields":{}},"O":{"opcode":"operator_lt","next":null,"parent":"M","inputs":{"OPERAND1":[3,"aa",[10,""]],"OPERAND2":[1,[10,"4"]]},"fields":{}},"aa":{"opcode":"data_lengthoflist","next":null,"parent":"O","inputs":{},"fields":{"LIST":["Code",",Z9wCV?1i_|}4|YMKhdx"]}},"N":{"opcode":"control_wait","next":"ab","parent":"q","inputs":{"DURATION":[1,[5,".2"]]},"fields":{}},"ab":{"opcode":"event_broadcast","next":null,"parent":"N","inputs":{"BROADCAST_INPUT":[1,[11,"Enter","]v(m1,+n8xPLKBt7T2xf"]]},"fields":{}}},"comments":{},"currentCostume":0,"costumes":[{"name":"0","bitmapResolution":1,"dataFormat":"svg","assetId":"005eb11d23ff40e32574e24a7cde4b01","md5ext":"005eb11d23ff40e32574e24a7cde4b01.svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.51374499999997},{"name":"1","bitmapResolution":1,"dataFormat":"svg","assetId":"20452090e6a2a0c9b7dd1053d35c6abf","md5ext":"20452090e6a2a0c9b7dd1053d35c6abf.svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.513734999999997},{"name":"2","bitmapResolution":1,"dataFormat":"svg","assetId":"b32058efe248af71718ff2e5ecaf417b","md5ext":"b32058efe248af71718ff2e5ecaf417b.svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.763744999999943},{"name":"3","bitmapResolution":1,"dataFormat":"svg","assetId":"733a29b0b6b8b1a26738d25f555a5a56","md5ext":"733a29b0b6b8b1a26738d25f555a5a56.svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.51374499999997},{"name":"4","bitmapResolution":1,"dataFormat":"svg","assetId":"c4ca28771493732b7646dacba0702e45","md5ext":"c4ca28771493732b7646dacba0702e45.svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.701224999999994},{"name":"back","bitmapResolution":1,"dataFormat":"svg","assetId":"e97814fe59c4e089cf534280d2dc9f0c","md5ext":"e97814fe59c4e089cf534280d2dc9f0c.svg","rotationCenterX":41.644774999999996,"rotationCenterY":19.576234999999997},{"name":"5","bitmapResolution":1,"dataFormat":"svg","assetId":"f4829d6604c4497961de7bbec5210db3","md5ext":"f4829d6604c4497961de7bbec5210db3.svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.638734999999997},{"name":"6","bitmapResolution":1,"dataFormat":"svg","assetId":"82409cc740b81aa9514022c7c12ae5e3","md5ext":"82409cc740b81aa9514022c7c12ae5e3.svg","rotationCenterX":27.20727000000005,"rotationCenterY":19.513724999999994},{"name":"7","bitmapResolution":1,"dataFormat":"svg","assetId":"978741fdc172215a97e103559f3dafc8","md5ext":"978741fdc172215a97e103559f3dafc8.svg","rotationCenterX":27.082269999999994,"rotationCenterY":19.82623499999997},{"name":"8","bitmapResolution":1,"dataFormat":"svg","assetId":"12eac2ca2c9f6345774f06ffe8053726","md5ext":"12eac2ca2c9f6345774f06ffe8053726.svg","rotationCenterX":27.457279999999997,"rotationCenterY":19.57621499999999}],"sounds":[],"volume":100,"layerOrder":1,"visible":false,"x":-112,"y":-153,"size":100,"direction":90,"draggable":false,"rotationStyle":"all around"}],"monitors":[{"id":"GwIf-6@Nn@Z;|=|VjMfD","mode":"default","opcode":"data_variable","params":{"VARIABLE":"Words"},"spriteName":null,"value":0,"width":0,"height":0,"x":132,"y":0,"visible":false,"sliderMin":0,"sliderMax":100,"isDiscrete":true},{"id":"p**OT?fJw^C-D%ET^-3^","mode":"default","opcode":"data_variable","params":{"VARIABLE":"word"},"spriteName":"character","value":0,"width":0,"height":0,"x":132,"y":98,"visible":false,"sliderMin":0,"sliderMax":100,"isDiscrete":true},{"id":"Rvo;C;f{T8|]Q9E[5c+1","mode":"default","opcode":"data_variable","params":{"VARIABLE":"clone id"},"spriteName":"keypad","value":0,"width":0,"height":0,"x":132,"y":5,"visible":false,"sliderMin":0,"sliderMax":100,"isDiscrete":true},{"id":",Z9wCV?1i_|}4|YMKhdx","mode":"list","opcode":"data_listcontents","params":{"LIST":"Code"},"spriteName":null,"value":[],"width":0,"height":0,"x":132,"y":0,"visible":false}],"extensions":["utilities"],"extensionURLs":{"utilities":"https://extensions.turbowarp.org/utilities.js"},"meta":{"semver":"3.0.0","platform":{"name":"TurboWarp","url":"https://turbowarp.org/"}}} \ No newline at end of file diff --git a/scratch/index.html b/scratch/index.html new file mode 100644 index 0000000..26643b3 --- /dev/null +++ b/scratch/index.html @@ -0,0 +1,370 @@ + + + + + + + + + Scratch Bliss Board for CARE + + + + + +
    + + + +
    + +

    Loading...

    + +
    +
    + + + + + + + + + + + diff --git a/scratch/script.js b/scratch/script.js new file mode 100644 index 0000000..c0912e9 --- /dev/null +++ b/scratch/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(70),o=n(69),a=n(68);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(261).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},M=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]=A(e[r]);const i=I(e[r].opcode);i&&n.add(i)}for(const e in t){const n=t[e];t[e]=C(n,t)}for(const e in t){const n=t[e];Array.isArray(n)&&[k,x].indexOf(n[0])<0&&(u.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)]},N=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},R=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},D=e=>"number"==typeof e||"string"==typeof e||"boolean"==typeof e,P=e=>{if(Array.isArray(e)){let t=null;for(let n=0;nE?(i.text=r.text.substring(0,E),i.extraText=r.text.substring(E)):i.text=r.text,t[n]=i}return t}(e.comments),(e.currentCostume<0||e.currentCostume>=e.costumes.length)&&(u.warn("currentCostume property for target ".concat(e.name," is out of range")),e.currentCostume=h.clamp(e.currentCostume,0,e.costumes.length-1)),n.currentCostume=e.currentCostume,n.costumes=e.costumes.map(N),n.sounds=e.sounds.map(R),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},B=(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},z=function(e,t,n,r){if(!Array.isArray(e))return e;const i=Object.create(null),s=d();switch(i.id=s,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:o.BROADCAST_MESSAGE_TYPE}},i.topLevel=!1;break;case k:i.opcode="data_variable",i.fields={VARIABLE:{name:"VARIABLE",value:e[1],id:e[2],variableType:o.SCALAR_TYPE}},e.length>3&&(i.topLevel=!0,i.x=e[3],i.y=e[4]);break;case x:i.opcode="data_listcontents",i.fields={LIST:{name:"LIST",value:e[1],id:e[2],variableType:o.LIST_TYPE}},e.length>3&&(i.topLevel=!0,i.x=e[3],i.y=e[4]);break;default:return u.error("Found unknown primitive type during deserialization: ".concat(JSON.stringify(e))),null}return r[s]=i,s},U=function(e,t,n){const r={};for(const i in e){if(!S.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=z(s[1],t,!0,n):2===l?o=z(s[1],t,!1,n):(o=z(s[1],t,!1,n),a=z(s[2],t,!0,n)),r[i]={name:i,block:o,shadow:a}}return r},j=function(e){const t={};for(const n in e){if(!S.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=o.BROADCAST_MESSAGE_TYPE:"VARIABLE"===n?t[n].variableType=o.SCALAR_TYPE:"LIST"===n&&(t[n].variableType=o.LIST_TYPE))}return t},F=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],z(n,null,!1,e)):(n.id=t,n.inputs=U(n.inputs,t,e),n.fields=j(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 h.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=>L(e,i))).map(((e,t)=>{const n=s[t],r=B(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=O(i,e);return n&&(t.extensionURLs=n),c&&(t.customFonts=c),l[0]}const u=B(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=I(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 d=O(i,e);d&&(r.extensionURLs=d),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="",p.platform=Object.assign({},e.platform),r.meta=p,n&&f(r),r},deserialize:async function(e,t,n,d){await((e,t)=>{if(!e.meta||!e.meta.platform)return;if(e.meta.platform.name===t.platform.name)return;let n=t.listenerCount(r.PLATFORM_MISMATCH);return 0!==n?new Promise((i=>{t.emit(r.PLATFORM_MISMATCH,e.meta.platform,(()=>{n--,0===n&&i()}))})):void 0})(e,t);const f={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))f.extensionURLs.set(t,n);let S;S=e.customFonts?t.fontManager.deserialize(e.customFonts,n,d):Promise.resolve();const w=((d?[e]:e.targets)||[]).map(((e,t)=>Object.assign(e,{targetPaneOrder:t}))).sort(((e,t)=>e.layerOrder-t.layerOrder)),k=e.monitors||[];return S.then((()=>w.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(b(r,t,n).then((()=>g(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(v(i,t,n).then((()=>y(i,t,r.soundBank))))})),r}(e,t,n))))).then((e=>Promise.resolve(e))).then((e=>Promise.all(w.map(((n,r)=>function(e,t,n,r,l){if(!Object.prototype.hasOwnProperty.call(e,"name"))return Promise.resolve(null);const u=new i(t),d=new s(u,t);if(Object.prototype.hasOwnProperty.call(e,"name")&&(d.name=e.name),Object.prototype.hasOwnProperty.call(e,"blocks")){F(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=I(r.opcode);i&&n.extensionIDs.add(i)}}const{costumePromises:p}=l,{soundBank:m,soundPromises:f}=l,g=d.createClone(e.isStage?c.BACKGROUND_LAYER:c.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(),s=new o(n,r[0],o.SCALAR_TYPE,i);i&&t.addCloudVariable(),s.value=r[1],g.variables[s.id]=s}if(Object.prototype.hasOwnProperty.call(e,"lists"))for(const t in e.lists){const n=e.lists[t],r=new o(t,n[0],o.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 o(t,n,o.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 a(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=h.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=h.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=>{d.costumes=e})),Promise.all(f).then((e=>{d.sounds=e,d.soundBank=m||null})),Promise.all(p.concat(f)).then((()=>g))}(n,t,f,0,e[r])))))).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=m.getAllVarRefsForTargets(e,!0);e.forEach((e=>{Object.keys(e.variables).forEach((t=>{const n=p.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=p.replaceUnsafeChars(e);e!==n&&m.updateVariableIdentifiers(t[e],n)}return e}(e))).then((n=>(k.map((e=>function(e,t,n,r){const i=(t.stageWidth-480)/2,s=(t.stageHeight-360)/2;if(e.x+=i,e.y+=s,e.x=h.clamp(e.x,0,t.stageWidth),e.y=h.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:u.warn("Tried to deserialize sprite specific monitor ".concat(e.opcode," but could not find sprite ").concat(e.spriteName,"."))}const a=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 c={};for(const t in e.params){const n={name:t,value:e.params[t]};c[t]=n}"data_variable"!==e.opcode&&"data_listcontents"!==e.opcode&&a&&a.isSpriteSpecific?e.id=a.getId(e.targetId,c):e.id=p.replaceUnsafeChars(e.id);const d=t.monitorBlocks._blocks[e.id];if(d)d.isMonitored=e.visible,d.targetId=e.targetId;else{const n={id:e.id,opcode:e.opcode,inputs:{},fields:c,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=o.SCALAR_TYPE}else if("data_listcontents"===e.opcode){const t=n.fields.LIST;t.id=e.id,t.variableType=o.LIST_TYPE}t.monitorBlocks.createBlock(n);const i=I(n.opcode);i&&r.extensionIDs.add(i)}t.requestAddMonitor(l(e))}(e,t,n,f))),Object.prototype.hasOwnProperty.call(e,"extensionStorage")&&(t.extensionStorage=e.extensionStorage),n))).then((e=>({targets:e,extensions:f})))},deserializeBlocks:F,serializeBlocks:M,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=I(t.opcode);e&&n.add(e)}const r=O(n,t);return r?{blocks:e,extensionURLs:r}:e},getExtensionIdForOpcode:I}},function(e,t,n){const r=n(11),i=n(38),s=n(395);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(71);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(255),i=n(277),s=n(91),o=n(85),a=n(279),l=n(90),c=n(55),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__(385),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){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(73),l=n(427),c=n(4),u=n(17),d=n(77),h=n(3),p=n(208),m=n(209),f=n(51),g=n(50),y=n(215),b=n(43),v=n(26),S=n(1),w=n(67),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(225),L=n(81),B=n(7),z=n(8),U={scratch3_control:n(226),scratch3_event:n(227),scratch3_looks:n(228),scratch3_motion:n(229),scratch3_operators:n(230),scratch3_sound:n(231),scratch3_sensing:n(232),scratch3_data:n(233),scratch3_procedures:n(234)},j=n(235),F=n(236),W=["#0FBD8C","#0DA57A","#0B8E69"],V=" // _twconfig_",G=(()=>{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})(),q=e=>{let t=0;return{canAddCloudVariable:()=>t{t++},removeCloudVariable:()=>{t--},hasCloudVariables:()=>t>0,getNumberOfCloudVariables:()=>t}};let Y=-1,H=-1,_=-1;class K 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 F(this),this.currentStepTime=1e3/30,this.updateCurrentMSecs(),this.redrawRequested=!1,this._registerBlockPackages(),this.ioDevices={clock:new O(this),cloud:new M(this),keyboard:new N(this),mouse:new R(this),mouseWheel:new D(this),userData:new P,video:new L(this)},this.peripheralExtensions={},this.profiler=null,this.cloudOptions={limit:10};const e=q(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.platform=Object.assign({},I),this._initScratchLink(),this.resetRunId(),this._stageTarget=null,this.addonBlocks={},this.stageWidth=K.STAGE_WIDTH,this.stageHeight=K.STAGE_HEIGHT,this.runtimeOptions={maxClones:K.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(K.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 PLATFORM_MISMATCH(){return"PLATFORM_MISMATCH"}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(K.HAS_CLOUD_DATA_UPDATE,!0)}}_initializeRemoveCloudVariable(e){return()=>{const t=this.hasCloudData();e.removeCloudVariable(),t&&!this.hasCloudData()&&this.emit(K.HAS_CLOUD_DATA_UPDATE,!1)}}_registerBlockPackages(){for(const e in U)if(Object.prototype.hasOwnProperty.call(U,e)){const t=new U[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=W[0],t.color2=W[1],t.color3=W[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(K.EXTENSION_FIELD_ADDED,{name:"field_".concat(e.extendedName),implementation:e.fieldImplementation})}this.emit(K.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(K.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===W[0]&&o.colourSecondary===W[1]&&o.colourTertiary===W[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=G[r.type]||{};if(!G[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(K.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(K.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(K.MONITORS_UPDATE,this._monitorState)),this.emit(K.RUNTIME_DISPOSED),this.ioDevices.clock.resetProjectTimer(),this.fontManager.clear(),this.hasCloudData()&&this.emit(K.HAS_CLOUD_DATA_UPDATE,!1),this.ioDevices.cloud.clear();const t=q(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(K.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===H&&(H=this.profiler.idByName("Sequencer.stepThreads")),this.profiler.start(H)),this.emit(K.BEFORE_EXECUTE);const e=this.sequencer.stepThreads();null!==this.profiler&&this.profiler.stop(),this.emit(K.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===_&&(_=this.profiler.idByName("RenderWebGL.draw")),this.profiler.start(_)),document.hidden||this.frameLoop._interpolationAnimation||this.renderer.draw(),null!==this.profiler&&this.profiler.stop()),this._refreshTargets&&(this.emit(K.TARGETS_UPDATE,!1),this._refreshTargets=!1),this._prevMonitorState.equals(this._monitorState)||(this.emit(K.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(K.FRAMERATE_CHANGED,e)}setInterpolation(e){this.interpolationEnabled=e,this.frameLoop.setInterpolation(this.interpolationEnabled),this.emit(K.INTERPOLATION_CHANGED,e)}setRuntimeOptions(e){this.runtimeOptions=Object.assign({},this.runtimeOptions,e),this.emit(K.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(K.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(K.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(K.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(V))return t;return null}parseProjectOptions(){const e=this.findProjectOptionsComment();if(!e)return;const t=e.text.split("\n").find((e=>e.endsWith(V)));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(K.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(V),n=this.findProjectOptionsComment();if(n)n.text=t;else{this.getTargetForStage().createComment(z(),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(K.PROJECT_RUN_START),this._nonMonitorThreadCount>0&&0===e&&this.emit(K.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(K.BLOCK_GLOW_ON,{id:e}):this.emit(K.BLOCK_GLOW_OFF,{id:e})}glowScript(e,t){t?this.emit(K.SCRIPT_GLOW_ON,{id:e}):this.emit(K.SCRIPT_GLOW_OFF,{id:e})}emitBlockDragUpdate(e){this.emit(K.BLOCK_DRAG_UPDATE,e)}emitBlockEndDrag(e,t){this.emit(K.BLOCK_DRAG_END,e,t)}visualReport(e,t){this.emit(K.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=B.unusedName(e,i),o=new x(t||z(),s,r);return this.getTargetForStage().variables[o.id]=o,o}requestRedraw(){this.redrawRequested=!0}requestTargetsUpdate(e){e.isOriginal&&(this._refreshTargets=!0)}requestBlocksUpdate(){this.emit(K.BLOCKS_NEED_UPDATE)}requestToolboxExtensionsUpdate(){this.emit(K.TOOLBOX_EXTENSIONS_NEED_UPDATE)}start(){this.frameLoop.running||(this.frameLoop.start(),this.emit(K.RUNTIME_STARTED))}stop(){this.quit()}quit(){this.frameLoop.running&&(this.frameLoop.stop(),this.emit(K.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(K.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=K},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(78),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 globalState.log.warn('Promise rejected in compiled script:', error);\n returnValue = '' + error;\n thread.status = 0; // STATUS_RUNNING\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(80),i=n(76),s=n(1),o=n(26),{Map:a}=n(25),l=n(2),c=new r;let u=-1;const d=function(e,t,n,r,i){const s=r.id,c=r.opcode,u=r._isHat,d=r._isConditional,h=r._isLoop;if(n.pushReportedValue(e),u)if(n.stackClick)n.status=o.STATUS_RUNNING;else if(t.runtime.getIsEdgeActivatedHat(c)){const r=n.target.hasEdgeActivatedValue(s),i=n.target.updateEdgeActivatedValue(s,e);(r?!i&&e:e)?n.status=o.STATUS_RUNNING:t.retireThread(n)}else e?n.status=o.STATUS_RUNNING:t.retireThread(n);else if((d||h)&&void 0!==e)t.stepToBranch(n,l.toNumber(e),h);else{if(i&&void 0!==e&&n.atStackTop()&&(n.stackClick&&t.runtime.visualReport(s,e),n.updateMonitor)){const n=t.runtime.monitorBlocks.getBlock(s).targetId;if(n&&!t.runtime.getTargetById(n))return;t.runtime.requestUpdateMonitor(a({id:s,spriteName:n?t.runtime.getTargetById(n).getName():null,value:e}))}n.status=o.STATUS_RUNNING}},h=(e,t,n,r,i)=>{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)}},p=(e,t,n,r,i)=>{n.status===o.STATUS_RUNNING&&(n.status=o.STATUS_PROMISE_WAIT),e.then((e=>{h(e,t,n,r,i)}),(e=>{s.warn("Primitive rejected promise: ",e),h("".concat(e),t,n,r,i)}))};class m{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,m);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,h=i.getCached(a,r,m);if(null===h&&(a=n.flyoutBlocks,h=i.getCached(a,r,m),null===h))return void e.retireThread(t);const f=h._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(h,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(h)):t[e]=h}}var v;if(null!==n.profiler){h._profiler!==n.profiler&&function(e,t){t._profiler=e,-1===u&&(u=e.idByName("blockFunction"));const n=t._ops;for(let t=0;te.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(52),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(287),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(314),Atrule:n(315),AtrulePrelude:n(316),AttributeSelector:n(317),Block:n(318),Brackets:n(319),CDC:n(320),CDO:n(321),ClassSelector:n(322),Combinator:n(323),Comment:n(324),Declaration:n(325),DeclarationList:n(326),Dimension:n(327),Function:n(328),Hash:n(329),Identifier:n(330),IdSelector:n(331),MediaFeature:n(332),MediaQuery:n(333),MediaQueryList:n(334),Nth:n(335),Number:n(336),Operator:n(337),Parentheses:n(338),Percentage:n(339),PseudoClassSelector:n(340),PseudoElementSelector:n(341),Ratio:n(342),Raw:n(18),Rule:n(343),Selector:n(344),SelectorList:n(345),String:n(346),StyleSheet:n(347),TypeSelector:n(348),UnicodeRange:n(349),Url:n(350),Value:n(351),WhiteSpace:n(352)}},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){"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()this._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(55),s=n(87),o=n(88),a=n(256),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(405),i=n(410);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(407),C=n(408),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(409),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(411),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(414),i=n(39),s=n(416),o=n(417),a=n(419),l=n(420),c=n(421),u=n(422),d=n(423),h=n(116),p=n(424);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(415);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(418),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(62);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(62);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(64),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(63),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)}}]); +// 9e73da06f49c78b57a8e2ea4cef6902adc121dc970bce9986ee3926d3799ab07 =^..^= \ No newline at end of file diff --git a/scratch/turbowarp-packager-settings.json b/scratch/turbowarp-packager-settings.json new file mode 100644 index 0000000..3d81b06 --- /dev/null +++ b/scratch/turbowarp-packager-settings.json @@ -0,0 +1 @@ +{"turbo":false,"interpolation":false,"framerate":30,"highQualityPen":false,"maxClones":300,"fencing":true,"miscLimits":true,"stageWidth":216,"stageHeight":360,"resizeMode":"preserve-ratio","autoplay":true,"username":"player####","closeWhenStopped":false,"projectId":"p4-@BlissBoard.sb3","custom":{"css":"","js":""},"appearance":{"background":"#cff6fe","foreground":"#000000","accent":"#ff4c4c"},"loadingScreen":{"progressBar":true,"text":"Loading...","imageMode":"normal","image":null},"controls":{"greenFlag":{"enabled":false},"stopAll":{"enabled":false},"fullscreen":{"enabled":true},"pause":{"enabled":false}},"monitors":{"editableLists":false,"variableColor":"#ff8c1a","listColor":"#fc662c"},"compiler":{"enabled":true,"warpTimer":false},"packagedRuntime":true,"target":"zip","app":{"icon":null,"packageName":"blissboard","windowTitle":"Scratch Bliss Board for CARE","windowMode":"window","version":"1.0.0","escapeBehavior":"unfullscreen-only","windowControls":"default"},"chunks":{"gamepad":false,"pointerlock":false},"cloudVariables":{"mode":"ws","cloudHost":"wss://clouddata.turbowarp.org","custom":{},"specialCloudBehaviors":false,"unsafeCloudBehaviors":false},"cursor":{"type":"auto","custom":null,"center":{"x":0,"y":0}},"extensions":["https://extensions.turbowarp.org/utilities.js"],"bakeExtensions":true,"maxTextureDimension":2048} \ No newline at end of file diff --git a/script.js b/script.js index c60cc8e..ab4dcb7 100644 --- a/script.js +++ b/script.js @@ -1,71 +1,27 @@ -/*! -Parts of this script are from the TurboWarp Packager , licensed as follows: -Copyright (C) 2021 Thomas Weber - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License version 3 -as published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program. If not, see . - -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. -*/ - -!function(A){function B(B){for(var t,g,i=B[0],Q=B[1],n=0,r=[];ne?1:0}return t===1/0&&e===1/0||t===-1/0&&e===-1/0?0:t-e}static isInt(A){return"number"==typeof A?!!isNaN(A)||A===Math.floor(A):"boolean"==typeof A||"string"==typeof A&&A.indexOf(".")<0}static get LIST_INVALID(){return"INVALID"}static get LIST_ALL(){return"ALL"}static toListIndex(A,B,t){if("number"!=typeof A){if("all"===A)return t?g.LIST_ALL:g.LIST_INVALID;if("last"===A)return B>0?B:g.LIST_INVALID;if("random"===A||"any"===A)return B>0?1+Math.floor(Math.random()*B):g.LIST_INVALID}return(A=Math.floor(g.toNumber(A)))<1||A>B?g.LIST_INVALID:A}}A.exports=g},function(A,B,t){"use strict";var e=t(15),g=t(82),i=t(38),Q=t(171),n=t(29);function s(A){return A}function r(A,B){for(var t=0;t1;)try{return c.stringifyByChunk(A,e,t)}catch(A){t=Math.floor(t/2)}return c.stringifyByChar(A)}function o(A,B){for(var t=0;tA-B);return A.map(A=>B.indexOf(A))}static inclusiveRandIntWithout(A,B,t){const e=B-A,g=A+Math.floor(Math.random()*e);return g>=t?g+1:g}static scale(A,B,t,e,g){return(A-B)/(t-B)*(g-e)+e}}},function(A,B,t){"use strict";var e=t(219),g=t(220),i=t(108),Q=t(107),n=t(106);function s(A,B){return Object.keys(B).forEach((function(t){A[t]=B[t]})),A}A.exports=function A(){var B=s({},n),t="en",r={},c=function(A){return A},E=null,o="warning",w={};function C(A,B,i){var Q="string"==typeof A?A:A.default,n=h(Q,"object"==typeof A&&A.id||c(Q),i||t);return(n.format||(n.format=g(e(n.message),i||t,w)))(B)}C.rich=function(A,B,i){var Q="string"==typeof A?A:A.default,n=h(Q,"object"==typeof A&&A.id||c(Q),i||t);return(n.toParts||(n.toParts=g.toParts(e(n.message,{tagsType:a}),i||t,w)))(B)};var a="<>";function I(A,B){var t=A[2];return function(A,B){var e="object"==typeof t?function(A,B){return Object.keys(A).reduce((function(t,e){return t[e]=A[e](B),t}),{})}(t,B):t;return"function"==typeof A?A(e):A}}function h(A,B,t){var e=Q(t,r)||"en",g=r[e]||(r[e]={}),i=g[B];if("string"==typeof i&&(i=g[B]={message:i}),!i){var n='Translation for "'+B+'" in "'+e+'" is missing';if("warning"===o)"undefined"!=typeof console&&console.warn(n);else if("ignore"!==o)throw new Error(n);var s="function"==typeof E?E(A,B,e)||A:E||A;i=g[B]={message:s}}return i}function Y(A,B,e,g,n){"object"==typeof e&&"object"!=typeof g&&(n=g,g=e,e=0);var s=Q(n||t,i),r=s&&i[s][A]||M;return g["="+ +B]||g[r(B-e)]||g.other}function M(){return"other"}return w[a]=I,C.setup=function(A){return(A=A||{}).locale&&(t=A.locale),"translations"in A&&(r=A.translations||{}),A.generateId&&(c=A.generateId),"missingReplacement"in A&&(E=A.missingReplacement),A.missingTranslation&&(o=A.missingTranslation),A.formats&&(A.formats.number&&s(B.number,A.formats.number),A.formats.date&&s(B.date,A.formats.date),A.formats.time&&s(B.time,A.formats.time)),A.types&&((w=A.types)[a]=I),{locale:t,translations:r,generateId:c,missingReplacement:E,missingTranslation:o,formats:B,types:w}},C.number=function(A,e,g){var i=e&&B.number[e]||B.parseNumberPattern(e)||B.number.default;return new Intl.NumberFormat(g||t,i).format(A)},C.date=function(A,e,g){var i=e&&B.date[e]||B.parseDatePattern(e)||B.date.default;return new Intl.DateTimeFormat(g||t,i).format(A)},C.time=function(A,e,g){var i=e&&B.time[e]||B.parseDatePattern(e)||B.time.default;return new Intl.DateTimeFormat(g||t,i).format(A)},C.select=function(A,B){return B[A]||B.other},C.custom=function(A,B,t,e){return A[1]in w?w[A[1]](A,B)(t,e):t},C.plural=Y.bind(null,"cardinal"),C.selectordinal=Y.bind(null,"ordinal"),C.namespace=A,C}()},function(A,B){A.exports={ANGLE:"angle",BOOLEAN:"Boolean",COLOR:"color",NUMBER:"number",STRING:"string",MATRIX:"matrix",NOTE:"note",IMAGE:"image"}},function(A,B,t){"use strict";(function(A){ -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -var e=t(156),g=t(157),i=t(75);function Q(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function n(A,B){if(Q()=Q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q().toString(16)+" bytes");return 0|A}function C(A,B){if(s.isBuffer(A))return A.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(A)||A instanceof ArrayBuffer))return A.byteLength;"string"!=typeof A&&(A=""+A);var t=A.length;if(0===t)return 0;for(var e=!1;;)switch(B){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return b(A).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return z(A).length;default:if(e)return b(A).length;B=(""+B).toLowerCase(),e=!0}}function a(A,B,t){var e=!1;if((void 0===B||B<0)&&(B=0),B>this.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(B>>>=0))return"";for(A||(A="utf8");;)switch(A){case"hex":return f(this,B,t);case"utf8":case"utf-8":return N(this,B,t);case"ascii":return m(this,B,t);case"latin1":case"binary":return G(this,B,t);case"base64":return U(this,B,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,B,t);default:if(e)throw new TypeError("Unknown encoding: "+A);A=(A+"").toLowerCase(),e=!0}}function I(A,B,t){var e=A[B];A[B]=A[t],A[t]=e}function h(A,B,t,e,g){if(0===A.length)return-1;if("string"==typeof t?(e=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=g?0:A.length-1),t<0&&(t=A.length+t),t>=A.length){if(g)return-1;t=A.length-1}else if(t<0){if(!g)return-1;t=0}if("string"==typeof B&&(B=s.from(B,e)),s.isBuffer(B))return 0===B.length?-1:Y(A,B,t,e,g);if("number"==typeof B)return B&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?g?Uint8Array.prototype.indexOf.call(A,B,t):Uint8Array.prototype.lastIndexOf.call(A,B,t):Y(A,[B],t,e,g);throw new TypeError("val must be string, number or Buffer")}function Y(A,B,t,e,g){var i,Q=1,n=A.length,s=B.length;if(void 0!==e&&("ucs2"===(e=String(e).toLowerCase())||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){if(A.length<2||B.length<2)return-1;Q=2,n/=2,s/=2,t/=2}function r(A,B){return 1===Q?A[B]:A.readUInt16BE(B*Q)}if(g){var c=-1;for(i=t;in&&(t=n-s),i=t;i>=0;i--){for(var E=!0,o=0;og&&(e=g):e=g;var i=B.length;if(i%2!=0)throw new TypeError("Invalid hex string");e>i/2&&(e=i/2);for(var Q=0;Q>8,g=t%256,i.push(g),i.push(e);return i}(B,A.length-t),A,t,e)}function U(A,B,t){return 0===B&&t===A.length?e.fromByteArray(A):e.fromByteArray(A.slice(B,t))}function N(A,B,t){t=Math.min(A.length,t);for(var e=[],g=B;g239?4:r>223?3:r>191?2:1;if(g+E<=t)switch(E){case 1:r<128&&(c=r);break;case 2:128==(192&(i=A[g+1]))&&(s=(31&r)<<6|63&i)>127&&(c=s);break;case 3:i=A[g+1],Q=A[g+2],128==(192&i)&&128==(192&Q)&&(s=(15&r)<<12|(63&i)<<6|63&Q)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:i=A[g+1],Q=A[g+2],n=A[g+3],128==(192&i)&&128==(192&Q)&&128==(192&n)&&(s=(15&r)<<18|(63&i)<<12|(63&Q)<<6|63&n)>65535&&s<1114112&&(c=s)}null===c?(c=65533,E=1):c>65535&&(c-=65536,e.push(c>>>10&1023|55296),c=56320|1023&c),e.push(c),g+=E}return function(A){var B=A.length;if(B<=4096)return String.fromCharCode.apply(String,A);var t="",e=0;for(;e0&&(A=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(A+=" ... ")),""},s.prototype.compare=function(A,B,t,e,g){if(!s.isBuffer(A))throw new TypeError("Argument must be a Buffer");if(void 0===B&&(B=0),void 0===t&&(t=A?A.length:0),void 0===e&&(e=0),void 0===g&&(g=this.length),B<0||t>A.length||e<0||g>this.length)throw new RangeError("out of range index");if(e>=g&&B>=t)return 0;if(e>=g)return-1;if(B>=t)return 1;if(this===A)return 0;for(var i=(g>>>=0)-(e>>>=0),Q=(t>>>=0)-(B>>>=0),n=Math.min(i,Q),r=this.slice(e,g),c=A.slice(B,t),E=0;Eg)&&(t=g),A.length>0&&(t<0||B<0)||B>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");for(var i=!1;;)switch(e){case"hex":return M(this,A,B,t);case"utf8":case"utf-8":return F(this,A,B,t);case"ascii":return D(this,A,B,t);case"latin1":case"binary":return u(this,A,B,t);case"base64":return l(this,A,B,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d(this,A,B,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function m(A,B,t){var e="";t=Math.min(A.length,t);for(var g=B;ge)&&(t=e);for(var g="",i=B;it)throw new RangeError("Trying to access beyond buffer length")}function R(A,B,t,e,g,i){if(!s.isBuffer(A))throw new TypeError('"buffer" argument must be a Buffer instance');if(B>g||BA.length)throw new RangeError("Index out of range")}function y(A,B,t,e){B<0&&(B=65535+B+1);for(var g=0,i=Math.min(A.length-t,2);g>>8*(e?g:1-g)}function J(A,B,t,e){B<0&&(B=4294967295+B+1);for(var g=0,i=Math.min(A.length-t,4);g>>8*(e?g:3-g)&255}function k(A,B,t,e,g,i){if(t+e>A.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function T(A,B,t,e,i){return i||k(A,0,t,4),g.write(A,B,t,e,23,4),t+4}function j(A,B,t,e,i){return i||k(A,0,t,8),g.write(A,B,t,e,52,8),t+8}s.prototype.slice=function(A,B){var t,e=this.length;if((A=~~A)<0?(A+=e)<0&&(A=0):A>e&&(A=e),(B=void 0===B?e:~~B)<0?(B+=e)<0&&(B=0):B>e&&(B=e),B0&&(g*=256);)e+=this[A+--B]*g;return e},s.prototype.readUInt8=function(A,B){return B||p(A,1,this.length),this[A]},s.prototype.readUInt16LE=function(A,B){return B||p(A,2,this.length),this[A]|this[A+1]<<8},s.prototype.readUInt16BE=function(A,B){return B||p(A,2,this.length),this[A]<<8|this[A+1]},s.prototype.readUInt32LE=function(A,B){return B||p(A,4,this.length),(this[A]|this[A+1]<<8|this[A+2]<<16)+16777216*this[A+3]},s.prototype.readUInt32BE=function(A,B){return B||p(A,4,this.length),16777216*this[A]+(this[A+1]<<16|this[A+2]<<8|this[A+3])},s.prototype.readIntLE=function(A,B,t){A|=0,B|=0,t||p(A,B,this.length);for(var e=this[A],g=1,i=0;++i=(g*=128)&&(e-=Math.pow(2,8*B)),e},s.prototype.readIntBE=function(A,B,t){A|=0,B|=0,t||p(A,B,this.length);for(var e=B,g=1,i=this[A+--e];e>0&&(g*=256);)i+=this[A+--e]*g;return i>=(g*=128)&&(i-=Math.pow(2,8*B)),i},s.prototype.readInt8=function(A,B){return B||p(A,1,this.length),128&this[A]?-1*(255-this[A]+1):this[A]},s.prototype.readInt16LE=function(A,B){B||p(A,2,this.length);var t=this[A]|this[A+1]<<8;return 32768&t?4294901760|t:t},s.prototype.readInt16BE=function(A,B){B||p(A,2,this.length);var t=this[A+1]|this[A]<<8;return 32768&t?4294901760|t:t},s.prototype.readInt32LE=function(A,B){return B||p(A,4,this.length),this[A]|this[A+1]<<8|this[A+2]<<16|this[A+3]<<24},s.prototype.readInt32BE=function(A,B){return B||p(A,4,this.length),this[A]<<24|this[A+1]<<16|this[A+2]<<8|this[A+3]},s.prototype.readFloatLE=function(A,B){return B||p(A,4,this.length),g.read(this,A,!0,23,4)},s.prototype.readFloatBE=function(A,B){return B||p(A,4,this.length),g.read(this,A,!1,23,4)},s.prototype.readDoubleLE=function(A,B){return B||p(A,8,this.length),g.read(this,A,!0,52,8)},s.prototype.readDoubleBE=function(A,B){return B||p(A,8,this.length),g.read(this,A,!1,52,8)},s.prototype.writeUIntLE=function(A,B,t,e){(A=+A,B|=0,t|=0,e)||R(this,A,B,t,Math.pow(2,8*t)-1,0);var g=1,i=0;for(this[B]=255&A;++i=0&&(i*=256);)this[B+g]=A/i&255;return B+t},s.prototype.writeUInt8=function(A,B,t){return A=+A,B|=0,t||R(this,A,B,1,255,0),s.TYPED_ARRAY_SUPPORT||(A=Math.floor(A)),this[B]=255&A,B+1},s.prototype.writeUInt16LE=function(A,B,t){return A=+A,B|=0,t||R(this,A,B,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[B]=255&A,this[B+1]=A>>>8):y(this,A,B,!0),B+2},s.prototype.writeUInt16BE=function(A,B,t){return A=+A,B|=0,t||R(this,A,B,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[B]=A>>>8,this[B+1]=255&A):y(this,A,B,!1),B+2},s.prototype.writeUInt32LE=function(A,B,t){return A=+A,B|=0,t||R(this,A,B,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[B+3]=A>>>24,this[B+2]=A>>>16,this[B+1]=A>>>8,this[B]=255&A):J(this,A,B,!0),B+4},s.prototype.writeUInt32BE=function(A,B,t){return A=+A,B|=0,t||R(this,A,B,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[B]=A>>>24,this[B+1]=A>>>16,this[B+2]=A>>>8,this[B+3]=255&A):J(this,A,B,!1),B+4},s.prototype.writeIntLE=function(A,B,t,e){if(A=+A,B|=0,!e){var g=Math.pow(2,8*t-1);R(this,A,B,t,g-1,-g)}var i=0,Q=1,n=0;for(this[B]=255&A;++i>0)-n&255;return B+t},s.prototype.writeIntBE=function(A,B,t,e){if(A=+A,B|=0,!e){var g=Math.pow(2,8*t-1);R(this,A,B,t,g-1,-g)}var i=t-1,Q=1,n=0;for(this[B+i]=255&A;--i>=0&&(Q*=256);)A<0&&0===n&&0!==this[B+i+1]&&(n=1),this[B+i]=(A/Q>>0)-n&255;return B+t},s.prototype.writeInt8=function(A,B,t){return A=+A,B|=0,t||R(this,A,B,1,127,-128),s.TYPED_ARRAY_SUPPORT||(A=Math.floor(A)),A<0&&(A=255+A+1),this[B]=255&A,B+1},s.prototype.writeInt16LE=function(A,B,t){return A=+A,B|=0,t||R(this,A,B,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[B]=255&A,this[B+1]=A>>>8):y(this,A,B,!0),B+2},s.prototype.writeInt16BE=function(A,B,t){return A=+A,B|=0,t||R(this,A,B,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[B]=A>>>8,this[B+1]=255&A):y(this,A,B,!1),B+2},s.prototype.writeInt32LE=function(A,B,t){return A=+A,B|=0,t||R(this,A,B,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[B]=255&A,this[B+1]=A>>>8,this[B+2]=A>>>16,this[B+3]=A>>>24):J(this,A,B,!0),B+4},s.prototype.writeInt32BE=function(A,B,t){return A=+A,B|=0,t||R(this,A,B,4,2147483647,-2147483648),A<0&&(A=4294967295+A+1),s.TYPED_ARRAY_SUPPORT?(this[B]=A>>>24,this[B+1]=A>>>16,this[B+2]=A>>>8,this[B+3]=255&A):J(this,A,B,!1),B+4},s.prototype.writeFloatLE=function(A,B,t){return T(this,A,B,!0,t)},s.prototype.writeFloatBE=function(A,B,t){return T(this,A,B,!1,t)},s.prototype.writeDoubleLE=function(A,B,t){return j(this,A,B,!0,t)},s.prototype.writeDoubleBE=function(A,B,t){return j(this,A,B,!1,t)},s.prototype.copy=function(A,B,t,e){if(t||(t=0),e||0===e||(e=this.length),B>=A.length&&(B=A.length),B||(B=0),e>0&&e=this.length)throw new RangeError("sourceStart out of bounds");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),A.length-B=0;--g)A[g+B]=this[g+t];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(g=0;g>>=0,t=void 0===t?this.length:t>>>0,A||(A=0),"number"==typeof A)for(i=B;i55295&&t<57344){if(!g){if(t>56319){(B-=3)>-1&&i.push(239,191,189);continue}if(Q+1===e){(B-=3)>-1&&i.push(239,191,189);continue}g=t;continue}if(t<56320){(B-=3)>-1&&i.push(239,191,189),g=t;continue}t=65536+(g-55296<<10|t-56320)}else g&&(B-=3)>-1&&i.push(239,191,189);if(g=null,t<128){if((B-=1)<0)break;i.push(t)}else if(t<2048){if((B-=2)<0)break;i.push(t>>6|192,63&t|128)}else if(t<65536){if((B-=3)<0)break;i.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((B-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return i}function z(A){return e.toByteArray(function(A){if((A=function(A){return A.trim?A.trim():A.replace(/^\s+|\s+$/g,"")}(A).replace(x,"")).length<2)return"";for(;A.length%4!=0;)A+="=";return A}(A))}function L(A,B,t,e){for(var g=0;g=B.length||g>=A.length);++g)B[g+t]=A[g];return g}}).call(this,t(9))},function(A,B,t){"use strict";function e(A){this.name=A||"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}e.prototype={push:function(A){this.emit("data",A)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(A){this.emit("error",A)}return!0},error:function(A){return!this.isFinished&&(this.isPaused?this.generatedError=A:(this.isFinished=!0,this.emit("error",A),this.previous&&this.previous.error(A),this.cleanUp()),!0)},on:function(A,B){return this._listeners[A].push(B),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(A,B){if(this._listeners[A])for(var t=0;t "+A:A}},A.exports=e},function(A,B){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(A){"object"==typeof window&&(t=window)}A.exports=t},function(A,B){const t="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";A.exports=function(){const A=t.length,B=[];for(let e=0;e<20;e++)B[e]=t.charAt(Math.random()*A);return B.join("")}},function(A,B,t){"use strict";var e,g="object"==typeof Reflect?Reflect:null,i=g&&"function"==typeof g.apply?g.apply:function(A,B,t){return Function.prototype.apply.call(A,B,t)};e=g&&"function"==typeof g.ownKeys?g.ownKeys:Object.getOwnPropertySymbols?function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:function(A){return Object.getOwnPropertyNames(A)};var Q=Number.isNaN||function(A){return A!=A};function n(){n.init.call(this)}A.exports=n,A.exports.once=function(A,B){return new Promise((function(t,e){function g(t){A.removeListener(B,i),e(t)}function i(){"function"==typeof A.removeListener&&A.removeListener("error",g),t([].slice.call(arguments))}h(A,B,i,{once:!0}),"error"!==B&&function(A,B,t){"function"==typeof A.on&&h(A,"error",B,t)}(A,g,{once:!0})}))},n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var s=10;function r(A){if("function"!=typeof A)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof A)}function c(A){return void 0===A._maxListeners?n.defaultMaxListeners:A._maxListeners}function E(A,B,t,e){var g,i,Q,n;if(r(t),void 0===(i=A._events)?(i=A._events=Object.create(null),A._eventsCount=0):(void 0!==i.newListener&&(A.emit("newListener",B,t.listener?t.listener:t),i=A._events),Q=i[B]),void 0===Q)Q=i[B]=t,++A._eventsCount;else if("function"==typeof Q?Q=i[B]=e?[t,Q]:[Q,t]:e?Q.unshift(t):Q.push(t),(g=c(A))>0&&Q.length>g&&!Q.warned){Q.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+Q.length+" "+String(B)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=A,s.type=B,s.count=Q.length,n=s,console&&console.warn&&console.warn(n)}return A}function o(){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 w(A,B,t){var e={fired:!1,wrapFn:void 0,target:A,type:B,listener:t},g=o.bind(e);return g.listener=t,e.wrapFn=g,g}function C(A,B,t){var e=A._events;if(void 0===e)return[];var g=e[B];return void 0===g?[]:"function"==typeof g?t?[g.listener||g]:[g]:t?function(A){for(var B=new Array(A.length),t=0;t0&&(Q=B[0]),Q instanceof Error)throw Q;var n=new Error("Unhandled error."+(Q?" ("+Q.message+")":""));throw n.context=Q,n}var s=g[A];if(void 0===s)return!1;if("function"==typeof s)i(s,this,B);else{var r=s.length,c=I(s,r);for(t=0;t=0;i--)if(t[i]===B||t[i].listener===B){Q=t[i].listener,g=i;break}if(g<0)return this;0===g?t.shift():function(A,B){for(;B+1=0;e--)this.removeListener(A,B[e]);return this},n.prototype.listeners=function(A){return C(this,A,!0)},n.prototype.rawListeners=function(A){return C(this,A,!1)},n.listenerCount=function(A,B){return"function"==typeof A.listenerCount?A.listenerCount(B):a.call(A,B)},n.prototype.listenerCount=a,n.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},function(A,B,t){const e=t(0);class g{static withoutTrailingDigits(A){let B=A.length-1;for(;B>=0&&"0123456789".indexOf(A.charAt(B))>-1;)B--;return A.slice(0,B+1)}static unusedName(A,B){if(B.indexOf(A)<0)return A;A=g.withoutTrailingDigits(A);let t=2;for(;B.indexOf(A+t)>=0;)t++;return A+t}static splitFirst(A,B){const t=A.indexOf(B);return t>=0?[A.substring(0,t),A.substring(t+1)]:[A,null]}static stringify(A){return JSON.stringify(A,(A,B)=>"number"!=typeof B||B!==1/0&&B!==-1/0&&!isNaN(B)?B:0)}static replaceUnsafeChars(A){if("string"!=typeof A){if(!Array.isArray(A))return e.error("Unexpected input recieved in replaceUnsafeChars"),A;A=String(A)}return A.replace(/[<>&'"]/g,A=>{switch(A){case"<":return"lt";case">":return"gt";case"&":return"amp";case"'":return"apos";case'"':return"quot"}})}}A.exports=g},function(A,B,t){const e=t(10),g=t(41);class i{constructor(A,B,t,g){switch(this.id=A||e(),this.name=B,this.type=t,this.isCloud=g,this.type){case i.SCALAR_TYPE:this.value=0;break;case i.LIST_TYPE:this.value=[];break;case i.BROADCAST_MESSAGE_TYPE:this.value=this.name;break;default:throw new Error("Invalid variable type: ".concat(this.type))}}toXML(A){return A=!0===A,'').concat(g(this.name),"")}static get SCALAR_TYPE(){return""}static get LIST_TYPE(){return"list"}static get BROADCAST_MESSAGE_TYPE(){return"broadcast_msg"}}A.exports=i},function(A,B,t){ -/*! - * @license twgl.js 4.4.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved. - * Available via the MIT license. - * see: http://github.com/greggman/twgl.js for details - */ -var e;"undefined"!=typeof self&&self,e=function(){return function(A){var B={};function t(e){if(B[e])return B[e].exports;var g=B[e]={i:e,l:!1,exports:{}};return A[e].call(g.exports,g,g.exports,t),g.l=!0,g.exports}return t.m=A,t.c=B,t.d=function(A,B,e){t.o(A,B)||Object.defineProperty(A,B,{configurable:!1,enumerable:!0,get:e})},t.n=function(A){var B=A&&A.__esModule?function(){return A.default}:function(){return A};return t.d(B,"a",B),B},t.o=function(A,B){return Object.prototype.hasOwnProperty.call(A,B)},t.p="",t(t.s=9)}([function(A,B,t){"use strict";B.__esModule=!0,B.copyExistingProperties=function(A,B){Object.keys(B).forEach((function(t){B.hasOwnProperty(t)&&A.hasOwnProperty(t)&&(B[t]=A[t])}))},B.copyNamedProperties=function(A,B,t){A.forEach((function(A){var e=B[A];void 0!==e&&(t[A]=e)}))},B.isBuffer=function(A,B){return Q||(Q=A.createBuffer()),B instanceof Q.constructor},B.isRenderbuffer=function(A,B){return n||(n=A.createRenderbuffer()),B instanceof n.constructor},B.isShader=function(A,B){return s||(s=A.createShader(A.VERTEX_SHADER)),B instanceof s.constructor},B.isTexture=function(A,B){return r||(r=A.createTexture()),B instanceof r.constructor},B.isSampler=function(A,B){if(!c){if(!A.createSampler)return!1;c=A.createSampler()}return B instanceof c.constructor},B.warn=B.error=void 0;var e,g=(e=t(2))&&e.__esModule?e:{default:e},i=g.default.console&&g.default.console.error&&"function"==typeof g.default.console.error?g.default.console.error.bind(g.default.console):function(){};B.error=i;var Q,n,s,r,c,E=g.default.console&&g.default.console.warn&&"function"==typeof g.default.console.warn?g.default.console.warn.bind(g.default.console):function(){};B.warn=E},function(A,B,t){"use strict";B.__esModule=!0,B.getGLTypeForTypedArray=function(A){if(A instanceof Int8Array)return 5120;if(A instanceof Uint8Array)return 5121;if(A instanceof Uint8ClampedArray)return 5121;if(A instanceof Int16Array)return 5122;if(A instanceof Uint16Array)return 5123;if(A instanceof Int32Array)return 5124;if(A instanceof Uint32Array)return 5125;if(A instanceof Float32Array)return 5126;throw"unsupported typed array type"},B.getGLTypeForTypedArrayType=function(A){if(A===Int8Array)return 5120;if(A===Uint8Array)return 5121;if(A===Uint8ClampedArray)return 5121;if(A===Int16Array)return 5122;if(A===Uint16Array)return 5123;if(A===Int32Array)return 5124;if(A===Uint32Array)return 5125;if(A===Float32Array)return 5126;throw"unsupported typed array type"},B.getTypedArrayTypeForGLType=function(A){var B=i[A];if(!B)throw"unknown gl type";return B},B.isArrayBuffer=void 0;var e,g=(e=t(2))&&e.__esModule?e:{default:e},i={},Q=i;Q[5120]=Int8Array,Q[5121]=Uint8Array,Q[5122]=Int16Array,Q[5123]=Uint16Array,Q[5124]=Int32Array,Q[5125]=Uint32Array,Q[5126]=Float32Array,Q[32819]=Uint16Array,Q[32820]=Uint16Array,Q[33635]=Uint16Array,Q[5131]=Uint16Array,Q[33640]=Uint32Array,Q[35899]=Uint32Array,Q[35902]=Uint32Array,Q[36269]=Uint32Array,Q[34042]=Uint32Array;var n=g.default.SharedArrayBuffer?function(A){return A&&A.buffer&&(A.buffer instanceof ArrayBuffer||A.buffer instanceof g.default.SharedArrayBuffer)}:function(A){return A&&A.buffer&&A.buffer instanceof ArrayBuffer};B.isArrayBuffer=n},function(A,B,t){"use strict";B.__esModule=!0,B.default=void 0;var e=void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};B.default=e},function(A,B,t){"use strict";B.__esModule=!0,B.add=function(A,B,t){return(t=t||new e(3))[0]=A[0]+B[0],t[1]=A[1]+B[1],t[2]=A[2]+B[2],t},B.copy=function(A,B){return(B=B||new e(3))[0]=A[0],B[1]=A[1],B[2]=A[2],B},B.create=function(A,B,t){var g=new e(3);return A&&(g[0]=A),B&&(g[1]=B),t&&(g[2]=t),g},B.cross=function(A,B,t){t=t||new e(3);var g=A[2]*B[0]-A[0]*B[2],i=A[0]*B[1]-A[1]*B[0];return t[0]=A[1]*B[2]-A[2]*B[1],t[1]=g,t[2]=i,t},B.distance=function(A,B){var t=A[0]-B[0],e=A[1]-B[1],g=A[2]-B[2];return Math.sqrt(t*t+e*e+g*g)},B.distanceSq=function(A,B){var t=A[0]-B[0],e=A[1]-B[1],g=A[2]-B[2];return t*t+e*e+g*g},B.divide=function(A,B,t){return(t=t||new e(3))[0]=A[0]/B[0],t[1]=A[1]/B[1],t[2]=A[2]/B[2],t},B.divScalar=function(A,B,t){return(t=t||new e(3))[0]=A[0]/B,t[1]=A[1]/B,t[2]=A[2]/B,t},B.dot=function(A,B){return A[0]*B[0]+A[1]*B[1]+A[2]*B[2]},B.lerp=function(A,B,t,g){return(g=g||new e(3))[0]=(1-t)*A[0]+t*B[0],g[1]=(1-t)*A[1]+t*B[1],g[2]=(1-t)*A[2]+t*B[2],g},B.length=function(A){return Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2])},B.lengthSq=function(A){return A[0]*A[0]+A[1]*A[1]+A[2]*A[2]},B.mulScalar=function(A,B,t){return(t=t||new e(3))[0]=A[0]*B,t[1]=A[1]*B,t[2]=A[2]*B,t},B.multiply=function(A,B,t){return(t=t||new e(3))[0]=A[0]*B[0],t[1]=A[1]*B[1],t[2]=A[2]*B[2],t},B.negate=function(A,B){return(B=B||new e(3))[0]=-A[0],B[1]=-A[1],B[2]=-A[2],B},B.normalize=function(A,B){B=B||new e(3);var t=A[0]*A[0]+A[1]*A[1]+A[2]*A[2],g=Math.sqrt(t);return g>1e-5?(B[0]=A[0]/g,B[1]=A[1]/g,B[2]=A[2]/g):(B[0]=0,B[1]=0,B[2]=0),B},B.setDefaultType=function(A){var B=e;return e=A,B},B.subtract=function(A,B,t){return(t=t||new e(3))[0]=A[0]-B[0],t[1]=A[1]-B[1],t[2]=A[2]-B[2],t};var e=Float32Array},function(A,B,t){"use strict";B.__esModule=!0,B.isWebGL1=function(A){return!A.texStorage2D},B.isWebGL2=function(A){return!!A.texStorage2D},B.glEnumToString=void 0;var e,g,i=(e={},g={},function(A,B){return function(A){var B=A.constructor.name;if(!e[B]){for(var t in A)if("number"==typeof A[t]){var i=g[A[t]];g[A[t]]=i?"".concat(i," | ").concat(t):t}e[B]=!0}}(A),g[B]||"0x"+B.toString(16)});B.glEnumToString=i},function(A,B,t){"use strict";B.__esModule=!0,B.createAttributeSetters=z,B.createProgram=H,B.createProgramFromScripts=function(A,B,t,e,g){for(var i=N(t,e,g),Q=[],n=0;n=0?(void 0).FRAGMENT_SHADER:A.indexOf("vert")>=0?(void 0).VERTEX_SHADER:void 0}function f(A,B){B.forEach((function(B){A.deleteShader(B)}))}function H(A,B,t,e,g){for(var Q=N(t,e,g),n=[],s=[],r=0;r1&&"[0]"===e.name.substr(-3),n=e.type,s=E[n];if(!s)throw"unknown type: 0x"+n.toString(16);if(s.bindPoint){var r=t;t+=e.size,g=Q?s.arraySetter(A,n,r,i,e.size):s.setter(A,n,r,i,e.size)}else g=s.arraySetter&&Q?s.arraySetter(A,i):s.setter(A,i);return g.location=i,g}for(var g={},i=A.getProgramParameter(B,A.ACTIVE_UNIFORMS),Q=0;Q0)throw"numComponents "+i+" not correct for length "+g;return Q}(B),t},B.createBufferFromArray=Y,B.createBufferFromTypedArray=s,B.createBufferInfoFromArrays=function(A,B){var t={attribs:I(A,B)},g=B.indices;if(g){var i=a(g,"indices");t.indices=s(A,i,A.ELEMENT_ARRAY_BUFFER),t.numElements=i.length,t.elementType=e.getGLTypeForTypedArray(i)}else t.numElements=function(A,B){var t,e;for(e=0;e0)throw"Can not guess numComponents for attribute '"+A+"'. Tried "+t+" but "+B+" values is not evenly divisible by "+t+". You should specify it.";return t}function C(A,B){return A.numComponents||A.size||w(B,c(A).length)}function a(A,B){if(e.isArrayBuffer(A))return A;if(e.isArrayBuffer(A.data))return A.data;Array.isArray(A)&&(A={data:A});var t=A.type;return t||(t=r(B)?Uint16Array:Float32Array),new t(A.data)}function I(A,B){var t={};return Object.keys(B).forEach((function(g){if(!r(g)){var i,n,c,E,o,I=B[g],h=I.attrib||I.name||I.attribName||Q.attribPrefix+g;if("number"==typeof I||"number"==typeof I.data){o=I.data||I;var Y=I.type||Float32Array,M=o*Y.BYTES_PER_ELEMENT;n=e.getGLTypeForTypedArrayType(Y),c=void 0!==I.normalize?I.normalize:(D=Y)===Int8Array||D===Uint8Array,E=I.numComponents||I.size||w(g,o),i=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,i),A.bufferData(A.ARRAY_BUFFER,M,I.drawType||A.STATIC_DRAW)}else{var F=a(I,g);i=s(A,F,void 0,I.drawType),n=e.getGLTypeForTypedArray(F),c=void 0!==I.normalize?I.normalize:function(A){return A instanceof Int8Array||A instanceof Uint8Array}(F),E=C(I,g),o=F.length}t[h]={buffer:i,numComponents:E,type:n,normalize:c,stride:I.stride||0,offset:I.offset||0,divisor:void 0===I.divisor?void 0:I.divisor,drawType:I.drawType}}var D})),A.bindBuffer(A.ARRAY_BUFFER,null),t}var h=["position","positions","a_position"];function Y(A,B,t){var e="indices"===t?A.ELEMENT_ARRAY_BUFFER:A.ARRAY_BUFFER;return s(A,a(B,t),e)}},function(A,B,t){"use strict";B.__esModule=!0,B.setTextureDefaults_=function(A){Q.copyExistingProperties(A,r),A.textureColor&&l(A.textureColor)},B.createSampler=R,B.createSamplers=function(A,B){var t={};return Object.keys(B).forEach((function(e){t[e]=R(A,B[e])})),t},B.setSamplerParameters=p,B.createTexture=K,B.setEmptyTexture=V,B.setTextureFromArray=W,B.loadTextureFromUrl=L,B.setTextureFromElement=j,B.setTextureFilteringForSize=y,B.setTextureParameters=H,B.setDefaultTextureColor=l,B.createTextures=function(A,B,t){t=t||x;var e=0,g=[],i={},Q={};function n(){0===e&&setTimeout((function(){t(g.length?g:void 0,i,Q)}),0)}return Object.keys(B).forEach((function(t){var s,r,c=B[t];("string"==typeof(r=c.src)||Array.isArray(r)&&"string"==typeof r[0])&&(s=function(A,B,i){Q[t]=i,--e,A&&g.push(A),n()},++e),i[t]=K(A,c,s)})),n(),i},B.resizeTexture=function(A,B,t,e,g){e=e||t.width,g=g||t.height;var i=t.target||A.TEXTURE_2D;A.bindTexture(i,B);var Q,n=t.level||0,s=t.internalFormat||t.format||A.RGBA,r=M(s),E=t.format||r.format,o=t.src;if(Q=o&&(c(o)||Array.isArray(o)&&"number"==typeof o[0])?t.type||D(A,o,r.type):t.type||r.type,i===A.TEXTURE_CUBE_MAP)for(var w=0;w<6;++w)A.texImage2D(A.TEXTURE_CUBE_MAP_POSITIVE_X+w,n,s,e,g,0,E,Q,null);else A.texImage2D(i,n,s,e,g,0,E,Q,null)},B.getNumComponentsForFormat=function(A){var B=C[A];if(!B)throw"unknown format: "+A;return B.numColorComponents},B.getBytesPerElementForInternalFormat=Y;var e,g=s(t(4)),i=s(t(1)),Q=s(t(0)),n=(e=t(2))&&e.__esModule?e:{default:e};function s(A){if(A&&A.__esModule)return A;var B={};if(null!=A)for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t)){var e=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,t):{};e.get||e.set?Object.defineProperty(B,t,e):B[t]=A[t]}return B.default=A,B}var r={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},c=i.isArrayBuffer,E=n.default.document&&n.default.document.createElement?n.default.document.createElement("canvas").getContext("2d"):null,o=6407,w=33319,C={},a=C;a[6406]={numColorComponents:1},a[6409]={numColorComponents:1},a[6410]={numColorComponents:2},a[o]={numColorComponents:3},a[6408]={numColorComponents:4},a[6403]={numColorComponents:1},a[36244]={numColorComponents:1},a[w]={numColorComponents:2},a[33320]={numColorComponents:2},a[o]={numColorComponents:3},a[36248]={numColorComponents:3},a[6408]={numColorComponents:4},a[36249]={numColorComponents:4},a[6402]={numColorComponents:1},a[34041]={numColorComponents:2};var I={},h=I;function Y(A,B){var t=I[A];if(!t)throw"unknown internal format";var e=t.bytesPerElementMap[B];if(void 0===e)throw"unknown internal format";return e}function M(A){var B=I[A];if(!B)throw"unknown internal format";return{format:B.textureFormat,type:Array.isArray(B.type)?B.type[0]:B.type}}function F(A){return 0==(A&A-1)}function D(A,B,t){return c(B)?i.getGLTypeForTypedArray(B):t||A.UNSIGNED_BYTE}function u(A,B,t,e,g){if(g%1!=0)throw"can't guess dimensions";if(t||e){if(e){if(!t&&(t=g/e)%1)throw"can't guess dimensions"}else if((e=g/t)%1)throw"can't guess dimensions"}else{var i=Math.sqrt(g/(B===A.TEXTURE_CUBE_MAP?6:1));i%1==0?(t=i,e=i):(t=g,e=1)}return{width:t,height:e}}function l(A){r.textureColor=new Uint8Array([255*A[0],255*A[1],255*A[2],255*A[3]])}h[6406]={textureFormat:6406,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[5121,5131,36193,5126]},h[6409]={textureFormat:6409,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[5121,5131,36193,5126]},h[6410]={textureFormat:6410,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[5121,5131,36193,5126]},h[o]={textureFormat:o,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[5121,5131,36193,5126,33635]},h[6408]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[5121,5131,36193,5126,32819,32820]},h[33321]={textureFormat:6403,colorRenderable:!0,textureFilterable:!0,bytesPerElement:1,type:5121},h[36756]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:1,type:5120},h[33325]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[5126,5131]},h[33326]={textureFormat:6403,colorRenderable:!1,textureFilterable:!1,bytesPerElement:4,type:5126},h[33330]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:5121},h[33329]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:5120},h[33332]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5123},h[33331]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5122},h[33334]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5125},h[33333]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5124},h[33323]={textureFormat:w,colorRenderable:!0,textureFilterable:!0,bytesPerElement:2,type:5121},h[36757]={textureFormat:w,colorRenderable:!1,textureFilterable:!0,bytesPerElement:2,type:5120},h[33327]={textureFormat:w,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[5126,5131]},h[33328]={textureFormat:w,colorRenderable:!1,textureFilterable:!1,bytesPerElement:8,type:5126},h[33336]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5121},h[33335]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5120},h[33338]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5123},h[33337]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5122},h[33340]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5125},h[33339]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5124},h[32849]={textureFormat:o,colorRenderable:!0,textureFilterable:!0,bytesPerElement:3,type:5121},h[35905]={textureFormat:o,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:5121},h[36194]={textureFormat:o,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[5121,33635]},h[36758]={textureFormat:o,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:5120},h[35898]={textureFormat:o,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[5126,5131,35899]},h[35901]={textureFormat:o,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[5126,5131,35902]},h[34843]={textureFormat:o,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[5126,5131]},h[34837]={textureFormat:o,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5126},h[36221]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:5121},h[36239]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:5120},h[36215]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:5123},h[36233]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:5122},h[36209]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5125},h[36227]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5124},h[32856]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:5121},h[35907]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:5121},h[36759]={textureFormat:6408,colorRenderable:!1,textureFilterable:!0,bytesPerElement:4,type:5120},h[32855]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[5121,32820,33640]},h[32854]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[5121,32819]},h[32857]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:33640},h[34842]={textureFormat:6408,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[5126,5131]},h[34836]={textureFormat:6408,colorRenderable:!1,textureFilterable:!1,bytesPerElement:16,type:5126},h[36220]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5121},h[36238]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5120},h[36975]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:33640},h[36214]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5123},h[36232]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5122},h[36226]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:5124},h[36208]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:5125},h[33189]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[5123,5125]},h[33190]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5125},h[36012]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5126},h[35056]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:34042},h[36013]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:36269},Object.keys(h).forEach((function(A){var B=h[A];if(B.bytesPerElementMap={},Array.isArray(B.bytesPerElement))B.bytesPerElement.forEach((function(A,t){var e=B.type[t];B.bytesPerElementMap[e]=A}));else{var t=B.type;B.bytesPerElementMap[t]=B.bytesPerElement}}));var d={};function U(A,B){void 0!==B.colorspaceConversion&&(d.colorspaceConversion=A.getParameter(A.UNPACK_COLORSPACE_CONVERSION_WEBGL),A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,B.colorspaceConversion)),void 0!==B.premultiplyAlpha&&(d.premultiplyAlpha=A.getParameter(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL),A.pixelStorei(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha)),void 0!==B.flipY&&(d.flipY=A.getParameter(A.UNPACK_FLIP_Y_WEBGL),A.pixelStorei(A.UNPACK_FLIP_Y_WEBGL,B.flipY))}function N(A,B){void 0!==B.colorspaceConversion&&A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,d.colorspaceConversion),void 0!==B.premultiplyAlpha&&A.pixelStorei(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d.premultiplyAlpha),void 0!==B.flipY&&A.pixelStorei(A.UNPACK_FLIP_Y_WEBGL,d.flipY)}function m(A){d.unpackAlignment=A.getParameter(A.UNPACK_ALIGNMENT),g.isWebGL2(A)&&(d.unpackRowLength=A.getParameter(A.UNPACK_ROW_LENGTH),d.unpackImageHeight=A.getParameter(A.UNPACK_IMAGE_HEIGHT),d.unpackSkipPixels=A.getParameter(A.UNPACK_SKIP_PIXELS),d.unpackSkipRows=A.getParameter(A.UNPACK_SKIP_ROWS),d.unpackSkipImages=A.getParameter(A.UNPACK_SKIP_IMAGES))}function G(A){A.pixelStorei(A.UNPACK_ALIGNMENT,d.unpackAlignment),g.isWebGL2(A)&&(A.pixelStorei(A.UNPACK_ROW_LENGTH,d.unpackRowLength),A.pixelStorei(A.UNPACK_IMAGE_HEIGHT,d.unpackImageHeight),A.pixelStorei(A.UNPACK_SKIP_PIXELS,d.unpackSkipPixels),A.pixelStorei(A.UNPACK_SKIP_ROWS,d.unpackSkipRows),A.pixelStorei(A.UNPACK_SKIP_IMAGES,d.unpackSkipImages))}function f(A,B,t,e){e.minMag&&(t.call(A,B,A.TEXTURE_MIN_FILTER,e.minMag),t.call(A,B,A.TEXTURE_MAG_FILTER,e.minMag)),e.min&&t.call(A,B,A.TEXTURE_MIN_FILTER,e.min),e.mag&&t.call(A,B,A.TEXTURE_MAG_FILTER,e.mag),e.wrap&&(t.call(A,B,A.TEXTURE_WRAP_S,e.wrap),t.call(A,B,A.TEXTURE_WRAP_T,e.wrap),(B===A.TEXTURE_3D||Q.isSampler(A,B))&&t.call(A,B,A.TEXTURE_WRAP_R,e.wrap)),e.wrapR&&t.call(A,B,A.TEXTURE_WRAP_R,e.wrapR),e.wrapS&&t.call(A,B,A.TEXTURE_WRAP_S,e.wrapS),e.wrapT&&t.call(A,B,A.TEXTURE_WRAP_T,e.wrapT),e.minLod&&t.call(A,B,A.TEXTURE_MIN_LOD,e.minLod),e.maxLod&&t.call(A,B,A.TEXTURE_MAX_LOD,e.maxLod),e.baseLevel&&t.call(A,B,A.TEXTURE_BASE_LEVEL,e.baseLevel),e.maxLevel&&t.call(A,B,A.TEXTURE_MAX_LEVEL,e.maxLevel)}function H(A,B,t){var e=t.target||A.TEXTURE_2D;A.bindTexture(e,B),f(A,e,A.texParameteri,t)}function p(A,B,t){f(A,B,A.samplerParameteri,t)}function R(A,B){var t=A.createSampler();return p(A,t,B),t}function y(A,B,t,e,i,Q,n){t=t||r.textureOptions,Q=Q||A.RGBA,n=n||A.UNSIGNED_BYTE;var s=t.target||A.TEXTURE_2D;if(e=e||t.width,i=i||t.height,A.bindTexture(s,B),function(A,B,t,e){if(!g.isWebGL2(A))return F(B)&&F(t);var i=I[e];if(!i)throw"unknown internal format";return i.colorRenderable&&i.textureFilterable}(A,e,i,Q))A.generateMipmap(s);else{var c=function(A){var B=I[A];if(!B)throw"unknown internal format";return B.textureFilterable}(Q)?A.LINEAR:A.NEAREST;A.texParameteri(s,A.TEXTURE_MIN_FILTER,c),A.texParameteri(s,A.TEXTURE_MAG_FILTER,c),A.texParameteri(s,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(s,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE)}}function J(A){return!0===A.auto||void 0===A.auto&&void 0===A.level}function k(A,B){return(B=B||{}).cubeFaceOrder||[A.TEXTURE_CUBE_MAP_POSITIVE_X,A.TEXTURE_CUBE_MAP_NEGATIVE_X,A.TEXTURE_CUBE_MAP_POSITIVE_Y,A.TEXTURE_CUBE_MAP_NEGATIVE_Y,A.TEXTURE_CUBE_MAP_POSITIVE_Z,A.TEXTURE_CUBE_MAP_NEGATIVE_Z]}function T(A,B){var t=k(A,B).map((function(A,B){return{face:A,ndx:B}}));return t.sort((function(A,B){return A.face-B.face})),t}function j(A,B,t,e){var g=(e=e||r.textureOptions).target||A.TEXTURE_2D,i=e.level||0,Q=t.width,s=t.height,c=e.internalFormat||e.format||A.RGBA,o=M(c),w=e.format||o.format,C=e.type||o.type;if(U(A,e),A.bindTexture(g,B),g===A.TEXTURE_CUBE_MAP){var a,I,h=t.width,Y=t.height;if(h/6===Y)a=Y,I=[0,0,1,0,2,0,3,0,4,0,5,0];else if(Y/6===h)a=h,I=[0,0,0,1,0,2,0,3,0,4,0,5];else if(h/3==Y/2)a=h/3,I=[0,0,1,0,2,0,0,1,1,1,2,1];else{if(h/2!=Y/3)throw"can't figure out cube map from element: "+(t.src?t.src:t.nodeName);a=h/2,I=[0,0,1,0,0,1,1,1,0,2,1,2]}E?(E.canvas.width=a,E.canvas.height=a,Q=a,s=a,T(A,e).forEach((function(B){var e=I[2*B.ndx+0]*a,g=I[2*B.ndx+1]*a;E.drawImage(t,e,g,a,a,0,0,a,a),A.texImage2D(B.face,i,c,w,C,E.canvas)})),E.canvas.width=1,E.canvas.height=1):n.default.createImageBitmap&&(Q=a,s=a,T(A,e).forEach((function(r){var E=I[2*r.ndx+0]*a,o=I[2*r.ndx+1]*a;A.texImage2D(r.face,i,c,a,a,0,w,C,null),n.default.createImageBitmap(t,E,o,a,a,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then((function(t){U(A,e),A.bindTexture(g,B),A.texImage2D(r.face,i,c,w,C,t),N(A,e),J(e)&&y(A,B,e,Q,s,c,C)}))})))}else if(g===A.TEXTURE_3D||g===A.TEXTURE_2D_ARRAY){var F=Math.min(t.width,t.height),D=Math.max(t.width,t.height),u=D/F;if(u%1!=0)throw"can not compute 3D dimensions of element";var l=t.width===D?1:0,d=t.height===D?1:0;m(A),A.pixelStorei(A.UNPACK_ALIGNMENT,1),A.pixelStorei(A.UNPACK_ROW_LENGTH,t.width),A.pixelStorei(A.UNPACK_IMAGE_HEIGHT,0),A.pixelStorei(A.UNPACK_SKIP_IMAGES,0),A.texImage3D(g,i,c,F,F,F,0,w,C,null);for(var f=0;f=0?Y(e,B):t.indexOf("tan")>=0||t.indexOf("binorm")>=0?I(e,B):t.indexOf("norm")>=0&&h(e,B)})),A}function F(A,B,t){return A=A||2,{position:{numComponents:2,data:[(B=B||0)+-1*(A*=.5),(t=t||0)+-1*A,B+1*A,t+-1*A,B+-1*A,t+1*A,B+1*A,t+1*A]},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 D(A,B,t,e,g){A=A||1,B=B||1,t=t||1,e=e||1,g=g||Q.identity();for(var i=(t+1)*(e+1),n=o(3,i),s=o(3,i),r=o(2,i),c=0;c<=e;c++)for(var E=0;E<=t;E++){var w=E/t,C=c/e;n.push(A*w-.5*A,0,B*C-.5*B),s.push(0,1,0),r.push(w,C)}for(var a=t+1,I=o(3,t*e*2,Uint16Array),h=0;h 0");e=e||0,i=i||0;for(var n=(g=g||Math.PI)-e,s=(Q=Q||2*Math.PI)-i,r=(B+1)*(t+1),c=o(3,r),E=o(3,r),w=o(2,r),C=0;C<=t;C++)for(var a=0;a<=B;a++){var I=a/B,h=C/t,Y=s*I,M=n*h,F=Math.sin(Y),D=Math.cos(Y),u=Math.sin(M),l=D*u,d=Math.cos(M),U=F*u;c.push(A*l,A*d,A*U),E.push(l,d,U),w.push(1-I,h)}for(var N=B+1,m=o(3,B*t*2,Uint16Array),G=0;Gg?(l=t,u=1,d=B):d=A+D/g*(B-A),-2!==D&&D!==g+2||(d=0,u=0),l-=t/2;for(var U=0;Ug?0:N*Y,D<0?-1:D>g?1:M,D<0||D>g?0:m*Y),C.push(U/e,1-u)}}for(var G=0;G 0");var s=(Q=Q||1)-(i=i||0),r=2*(g+1)*4,c=o(3,r),E=o(3,r),w=o(2,r);function C(A,B,t){return A+(B-A)*t}function a(B,t,Q,r,o,a){for(var I=0;I<=g;I++){var h=t/1,Y=I/g,M=2*(h-.5),F=(i+Y*s)*Math.PI,D=Math.sin(F),u=Math.cos(F),l=C(A,B,D),d=M*e,U=u*A,N=D*l;c.push(d,U,N);var m=n.add(n.multiply([0,D,u],Q),r);E.push(m),w.push(h*o+a,Y)}}for(var I=0;I<2;I++){var h=2*(I/1-.5);a(B,I,[1,1,1],[0,0,0],1,0),a(B,I,[0,0,0],[h,0,0],0,0),a(t,I,[1,1,1],[0,0,0],1,0),a(t,I,[0,0,0],[h,0,0],0,1)}var Y=o(3,2*g*4,Uint16Array);function M(A,B){for(var t=0;t0&&I!==B){var F=c+(I+1),D=c+I,u=c+I-w,l=c+(I+1)-w;r.push(F,D,u),r.push(F,u,l)}}c+=B+1}return{position:Q,normal:n,texcoord:s,indices:r}}function R(A){return function(B){var t=A.apply(this,Array.prototype.slice.call(arguments,1));return e.createBuffersFromArrays(B,t)}}function y(A){return function(B){var t=A.apply(null,Array.prototype.slice.call(arguments,1));return e.createBufferInfoFromArrays(B,t)}}var J=["numComponents","size","type","normalize","stride","offset","attrib","name","attribName"];function k(A,B,t,e){e=e||0;for(var g=A.length,i=0;i1&&(e+=B);const g=t.inputs[e];return void 0===g?null:g.block}getOpcode(A){return void 0===A?null:A.opcode}getFields(A){return void 0===A?null:A.fields}getInputs(A){if(void 0===A)return null;let B=this._cache.inputs[A.id];if(void 0!==B)return B;B={};for(const t in A.inputs)t.substring(0,C.BRANCH_INPUT_PREFIX.length)!==C.BRANCH_INPUT_PREFIX&&(B[t]=A.inputs[t]);return this._cache.inputs[A.id]=B,B}getMutation(A){return void 0===A?null:A.mutation}getTopLevelScript(A){let B=this._blocks[A];if(void 0===B)return null;for(;null!==B.parent;)B=this._blocks[B.parent];return B.id}getProcedureDefinition(A){const B=this._cache.procedureDefinitions[A];if(void 0!==B)return B;for(const B in this._blocks){if(!this._blocks.hasOwnProperty(B))continue;const t=this._blocks[B];if("procedures_definition"===t.opcode){const e=this._getCustomBlockInternal(t);if(e&&e.mutation.proccode===A)return this._cache.procedureDefinitions[A]=B,B}}return this._cache.procedureDefinitions[A]=null,null}getProcedureParamNamesAndIds(A){return this.getProcedureParamNamesIdsAndDefaults(A).slice(0,2)}getProcedureParamNamesIdsAndDefaults(A){const B=this._cache.procedureParamNames[A];if(void 0!==B)return B;for(const B in this._blocks){if(!this._blocks.hasOwnProperty(B))continue;const t=this._blocks[B];if("procedures_prototype"===t.opcode&&t.mutation.proccode===A){const B=JSON.parse(t.mutation.argumentnames),e=JSON.parse(t.mutation.argumentids),g=JSON.parse(t.mutation.argumentdefaults);return this._cache.procedureParamNames[A]=[B,e,g],this._cache.procedureParamNames[A]}}const t=this.runtime.getAddonBlock(A);return t?(this._cache.procedureParamNames[A]=t.namesIdsDefaults,t.namesIdsDefaults):(this._cache.procedureParamNames[A]=null,null)}populateProcedureCache(){if(!this._cache.proceduresPopulated){for(const A in this._blocks){if(!this._blocks.hasOwnProperty(A))continue;const B=this._blocks[A];if("procedures_prototype"!==B.opcode){if("procedures_definition"===B.opcode){const t=this._getCustomBlockInternal(B);if(t){const B=t.mutation.proccode;this._cache.procedureDefinitions[B]||(this._cache.procedureDefinitions[B]=A);continue}}}else{const A=B.mutation.proccode;if(!this._cache.procedureParamNames[A]){const t=JSON.parse(B.mutation.argumentnames),e=JSON.parse(B.mutation.argumentids),g=JSON.parse(B.mutation.argumentdefaults);this._cache.procedureParamNames[A]=[t,e,g]}}}this._cache.proceduresPopulated=!0}}duplicate(){const A=new C(this.runtime,this.forceNoGlow);return A._blocks=n.simple(this._blocks),A._scripts=n.simple(this._scripts),A}blocklyListen(A){if("object"!=typeof A)return;if("string"!=typeof A.blockId&&"string"!=typeof A.varId&&"string"!=typeof A.commentId)return;const B=this.runtime.getTargetForStage(),t=this.runtime.getEditingTarget();if("stackclick"!==A.element)switch(A.type){case"create":{const B=e(A);for(let A=0;AA.isOriginal);for(const B of t)if(B.lookupVariableByNameAndType(A.varName,A.varType,!0))return;B.createVariable(A.varId,A.varName,A.varType,A.isCloud),this.emitProjectChanged()}break;case"var_rename":if(t&&t.variables.hasOwnProperty(A.varId))t.renameVariable(A.varId,A.newName),t.blocks.updateBlocksAfterVarRename(A.varId,A.newName);else{B.renameVariable(A.varId,A.newName);const t=this.runtime.targets;for(let B=0;B0&&"data_variable"!==B.opcode&&"data_listcontents"!==B.opcode){const A=w(B.id,B.fields);let t=this.runtime.monitorBlocks.getBlock(A);t||(t=JSON.parse(JSON.stringify(B)),t.id=A,this.runtime.monitorBlocks.createBlock(t)),B=t}const t=B.isMonitored;B.isMonitored=A.value;let e=!1;"data_variable"===B.opcode?e=!this.runtime.getTargetForStage().variables[B.fields.VARIABLE.id]:"data_listcontents"===B.opcode&&(e=!this.runtime.getTargetForStage().variables[B.fields.LIST.id]);const g=e||this.runtime.monitorBlockInfo.hasOwnProperty(B.opcode)&&this.runtime.monitorBlockInfo[B.opcode].isSpriteSpecific;B.targetId=g?B.targetId||this.runtime.getEditingTarget().id:null,t&&!B.isMonitored?this.runtime.requestHideMonitor(B.id):!t&&B.isMonitored&&(this.runtime.requestShowMonitor(B.id)||this.runtime.requestAddMonitor(Q({id:B.id,targetId:B.targetId,spriteName:B.targetId?this.runtime.getTargetById(B.targetId).getName():null,opcode:B.opcode,params:this._getBlockParams(B),value:"",mode:"data_listcontents"===B.opcode?"list":"default"})));break}}this.emitProjectChanged(),this.resetCache()}}moveBlock(A){if(!this._blocks.hasOwnProperty(A.id))return;const B=this._blocks[A.id];let t=!1;if(A.newCoordinate&&(t=B.x!==A.newCoordinate.x||B.y!==A.newCoordinate.y,B.x=A.newCoordinate.x,B.y=A.newCoordinate.y),void 0!==A.oldParent){const B=this._blocks[A.oldParent];void 0!==A.oldInput&&B.inputs[A.oldInput].block===A.id?B.inputs[A.oldInput].block=null:B.next===A.id&&(B.next=null),this._blocks[A.id].parent=null,t=!0}if(void 0===A.newParent)this._addScript(A.id);else{if(this._deleteScript(A.id),void 0===A.newInput)this._blocks[A.newParent].next=A.id;else{let B=null;this._blocks[A.newParent].inputs.hasOwnProperty(A.newInput)&&(B=this._blocks[A.newParent].inputs[A.newInput].shadow),this._blocks[A.id].shadow&&(B=A.id),this._blocks[A.newParent].inputs[A.newInput]={name:A.newInput,block:A.id,shadow:B}}this._blocks[A.id].parent=A.newParent,t=!0}this.resetCache(),t&&this.emitProjectChanged()}runAllMonitored(A){null===this._cache._monitored&&(this._cache._monitored=Object.keys(this._blocks).filter(A=>this.getBlock(A).isMonitored).map(B=>{const t=this.getBlock(B).targetId;return{blockId:B,target:t?A.getTargetById(t):null}}));const B=this._cache._monitored;for(let t=0;tthis.blockToXML(B,A)).join()}blockToXML(A,B){const t=this._blocks[A];if(!t)return;const e=t.shadow?"shadow":"block";let g="<".concat(e,'\n id="').concat(t.id,'"\n type="').concat(t.opcode,'"\n ').concat(t.topLevel?'x="'.concat(t.x,'" y="').concat(t.y,'"'):"","\n >");const Q=t.comment;Q&&(B?B.hasOwnProperty(Q)?g+=B[Q].toXML():E.warn("Could not find comment with id: ".concat(Q," in provided comment descriptions.")):E.warn("Cannot serialize comment with id: ".concat(Q,"; no comment descriptions provided."))),t.mutation&&(g+=this.mutationToXML(t.mutation));for(const A in t.inputs){if(!t.inputs.hasOwnProperty(A))continue;const e=t.inputs[A];(e.block||e.shadow)&&(g+=''),e.block&&(g+=this.blockToXML(e.block,B)),e.shadow&&e.shadow!==e.block&&(g+=this.blockToXML(e.shadow,B)),g+="")}for(const A in t.fields){if(!t.fields.hasOwnProperty(A))continue;const B=t.fields[A];g+='".concat(n,"")}return t.next&&(g+="".concat(this.blockToXML(t.next,B),"")),g+=""),g}mutationToXML(A){let B="<".concat(A.tagName);for(const t in A){if("children"===t||"tagName"===t)continue;let e="string"==typeof A[t]?i(A[t]):A[t];"blockInfo"===t&&(e=i(JSON.stringify(A[t]))),B+=" ".concat(t,'="').concat(e,'"')}B+=">";for(let t=0;t"),B}_getBlockParams(A){const B={};for(const t in A.fields)B[t]=A.fields[t].value;for(const t in A.inputs){const e=this._blocks[A.inputs[t].block];for(const A in e.fields)B[A]=e.fields[A].value}return B}_getCustomBlockInternal(A){if(A.inputs&&A.inputs.custom_block)return this._blocks[A.inputs.custom_block.block]}_addScript(A){this._scripts.indexOf(A)>-1||(this._scripts.push(A),this._blocks[A].topLevel=!0)}_deleteScript(A){const B=this._scripts.indexOf(A);B>-1&&this._scripts.splice(B,1),this._blocks[A]&&(this._blocks[A].topLevel=!1)}}r.getCached=function(A,B,t){let e=A._cache._executeCached[B];if(void 0!==e)return e;const g=A.getBlock(B);return void 0===g?null:(e=void 0===t?{id:B,opcode:A.getOpcode(g),fields:A.getFields(g),inputs:A.getInputs(g),mutation:A.getMutation(g)}:new t(A,{id:B,opcode:A.getOpcode(g),fields:A.getFields(g),inputs:A.getInputs(g),mutation:A.getMutation(g)}),A._cache._executeCached[B]=e,e)};const a=c._RuntimeScriptCache;c.getScripts=function(A,B){let t=A._cache.scripts[B];if(!t){t=A._cache.scripts[B]=[];const e=A._scripts;for(let g=0;g=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;n[254]=n[254]=1;function r(){Q.call(this,"utf-8 decode"),this.leftOver=null}function c(){Q.call(this,"utf-8 encode")}B.utf8encode=function(A){return g.nodebuffer?i.newBufferFrom(A,"utf-8"):function(A){var B,t,e,i,Q,n=A.length,s=0;for(i=0;i>>6,B[Q++]=128|63&t):t<65536?(B[Q++]=224|t>>>12,B[Q++]=128|t>>>6&63,B[Q++]=128|63&t):(B[Q++]=240|t>>>18,B[Q++]=128|t>>>12&63,B[Q++]=128|t>>>6&63,B[Q++]=128|63&t);return B}(A)},B.utf8decode=function(A){return g.nodebuffer?e.transformTo("nodebuffer",A).toString("utf-8"):function(A){var B,t,g,i,Q=A.length,s=new Array(2*Q);for(t=0,B=0;B4)s[t++]=65533,B+=i-1;else{for(g&=2===i?31:3===i?15:7;i>1&&B1?s[t++]=65533:g<65536?s[t++]=g:(g-=65536,s[t++]=55296|g>>10&1023,s[t++]=56320|1023&g)}return s.length!==t&&(s.subarray?s=s.subarray(0,t):s.length=t),e.applyFromCharCode(s)}(A=e.transformTo(g.uint8array?"uint8array":"array",A))},e.inherits(r,Q),r.prototype.processChunk=function(A){var t=e.transformTo(g.uint8array?"uint8array":"array",A.data);if(this.leftOver&&this.leftOver.length){if(g.uint8array){var i=t;(t=new Uint8Array(i.length+this.leftOver.length)).set(this.leftOver,0),t.set(i,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var Q=function(A,B){var t;for((B=B||A.length)>A.length&&(B=A.length),t=B-1;t>=0&&128==(192&A[t]);)t--;return t<0||0===t?B:t+n[A[t]]>B?t:B}(t),s=t;Q!==t.length&&(g.uint8array?(s=t.subarray(0,Q),this.leftOver=t.subarray(Q,t.length)):(s=t.slice(0,Q),this.leftOver=t.slice(Q,t.length))),this.push({data:B.utf8decode(s),meta:A.meta})},r.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:B.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},B.Utf8DecodeWorker=r,e.inherits(c,Q),c.prototype.processChunk=function(A){this.push({data:B.utf8encode(A.data),meta:A.meta})},B.Utf8EncodeWorker=c},function(A,B){"function"==typeof Object.create?A.exports=function(A,B){B&&(A.super_=B,A.prototype=Object.create(B.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}))}:A.exports=function(A,B){if(B){A.super_=B;var t=function(){};t.prototype=B.prototype,A.prototype=new t,A.prototype.constructor=A}}},function(A,B,t){var e=t(209),g=e.enable,i=e.disable,Q="undefined"!=typeof navigator&&/chrome/i.test(navigator.userAgent),n=t(212);if(e.defaultBackend=Q?n.minilog:n,"undefined"!=typeof window){try{e.enable(JSON.parse(window.localStorage.minilogSettings))}catch(A){}if(window.location&&window.location.search){var s=RegExp("[?&]minilog=([^&]*)").exec(window.location.search);s&&e.enable(decodeURIComponent(s[1]))}}e.enable=function(){g.call(e,!0);try{window.localStorage.minilogSettings=JSON.stringify(!0)}catch(A){}return this},e.disable=function(){i.call(e);try{delete window.localStorage.minilogSettings}catch(A){}return this},(A.exports=e).backends={array:t(215),browser:e.defaultBackend,localStorage:t(216),jQuery:t(217)}},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__; -/** - * [js-md5]{@link https://github.com/emn178/js-md5} - * - * @namespace md5 - * @version 0.7.3 - * @author Chen, Yi-Cyuan [emn178@gmail.com] - * @copyright Chen, Yi-Cyuan 2014-2017 - * @license MIT - */!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__(358),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(A){return"[object Array]"===Object.prototype.toString.call(A)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(A){return"object"==typeof A&&A.buffer&&A.buffer.constructor===ArrayBuffer});var createOutputMethod=function(A){return function(B){return new Md5(!0).update(B)[A]()}},createMethod=function(){var A=createOutputMethod("hex");NODE_JS&&(A=nodeWrap(A)),A.create=function(){return new Md5},A.update=function(B){return A.create().update(B)};for(var B=0;B>2]|=A[i]<>6,s[g++]=128|63&e):e<55296||e>=57344?(s[g++]=224|e>>12,s[g++]=128|e>>6&63,s[g++]=128|63&e):(e=65536+((1023&e)<<10|1023&A.charCodeAt(++i)),s[g++]=240|e>>18,s[g++]=128|e>>12&63,s[g++]=128|e>>6&63,s[g++]=128|63&e);else for(g=this.start;i>2]|=e<>2]|=(192|e>>6)<>2]|=(128|63&e)<=57344?(n[g>>2]|=(224|e>>12)<>2]|=(128|e>>6&63)<>2]|=(128|63&e)<>2]|=(240|e>>18)<>2]|=(128|e>>12&63)<>2]|=(128|e>>6&63)<>2]|=(128|63&e)<=64?(this.start=g-64,this.hash(),this.hashed=!0):this.start=g}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 A=this.blocks,B=this.lastByteIndex;A[B>>2]|=EXTRA[3&B],B>=56&&(this.hashed||this.hash(),A[0]=A[16],A[16]=A[1]=A[2]=A[3]=A[4]=A[5]=A[6]=A[7]=A[8]=A[9]=A[10]=A[11]=A[12]=A[13]=A[14]=A[15]=0),A[14]=this.bytes<<3,A[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var A,B,t,e,g,i,Q=this.blocks;this.first?B=((B=((A=((A=Q[0]-680876937)<<7|A>>>25)-271733879<<0)^(t=((t=(-271733879^(e=((e=(-1732584194^2004318071&A)+Q[1]-117830708)<<12|e>>>20)+A<<0)&(-271733879^A))+Q[2]-1126478375)<<17|t>>>15)+e<<0)&(e^A))+Q[3]-1316259209)<<22|B>>>10)+t<<0:(A=this.h0,B=this.h1,t=this.h2,B=((B+=((A=((A+=((e=this.h3)^B&(t^e))+Q[0]-680876936)<<7|A>>>25)+B<<0)^(t=((t+=(B^(e=((e+=(t^A&(B^t))+Q[1]-389564586)<<12|e>>>20)+A<<0)&(A^B))+Q[2]+606105819)<<17|t>>>15)+e<<0)&(e^A))+Q[3]-1044525330)<<22|B>>>10)+t<<0),B=((B+=((A=((A+=(e^B&(t^e))+Q[4]-176418897)<<7|A>>>25)+B<<0)^(t=((t+=(B^(e=((e+=(t^A&(B^t))+Q[5]+1200080426)<<12|e>>>20)+A<<0)&(A^B))+Q[6]-1473231341)<<17|t>>>15)+e<<0)&(e^A))+Q[7]-45705983)<<22|B>>>10)+t<<0,B=((B+=((A=((A+=(e^B&(t^e))+Q[8]+1770035416)<<7|A>>>25)+B<<0)^(t=((t+=(B^(e=((e+=(t^A&(B^t))+Q[9]-1958414417)<<12|e>>>20)+A<<0)&(A^B))+Q[10]-42063)<<17|t>>>15)+e<<0)&(e^A))+Q[11]-1990404162)<<22|B>>>10)+t<<0,B=((B+=((A=((A+=(e^B&(t^e))+Q[12]+1804603682)<<7|A>>>25)+B<<0)^(t=((t+=(B^(e=((e+=(t^A&(B^t))+Q[13]-40341101)<<12|e>>>20)+A<<0)&(A^B))+Q[14]-1502002290)<<17|t>>>15)+e<<0)&(e^A))+Q[15]+1236535329)<<22|B>>>10)+t<<0,B=((B+=((e=((e+=(B^t&((A=((A+=(t^e&(B^t))+Q[1]-165796510)<<5|A>>>27)+B<<0)^B))+Q[6]-1069501632)<<9|e>>>23)+A<<0)^A&((t=((t+=(A^B&(e^A))+Q[11]+643717713)<<14|t>>>18)+e<<0)^e))+Q[0]-373897302)<<20|B>>>12)+t<<0,B=((B+=((e=((e+=(B^t&((A=((A+=(t^e&(B^t))+Q[5]-701558691)<<5|A>>>27)+B<<0)^B))+Q[10]+38016083)<<9|e>>>23)+A<<0)^A&((t=((t+=(A^B&(e^A))+Q[15]-660478335)<<14|t>>>18)+e<<0)^e))+Q[4]-405537848)<<20|B>>>12)+t<<0,B=((B+=((e=((e+=(B^t&((A=((A+=(t^e&(B^t))+Q[9]+568446438)<<5|A>>>27)+B<<0)^B))+Q[14]-1019803690)<<9|e>>>23)+A<<0)^A&((t=((t+=(A^B&(e^A))+Q[3]-187363961)<<14|t>>>18)+e<<0)^e))+Q[8]+1163531501)<<20|B>>>12)+t<<0,B=((B+=((e=((e+=(B^t&((A=((A+=(t^e&(B^t))+Q[13]-1444681467)<<5|A>>>27)+B<<0)^B))+Q[2]-51403784)<<9|e>>>23)+A<<0)^A&((t=((t+=(A^B&(e^A))+Q[7]+1735328473)<<14|t>>>18)+e<<0)^e))+Q[12]-1926607734)<<20|B>>>12)+t<<0,B=((B+=((i=(e=((e+=((g=B^t)^(A=((A+=(g^e)+Q[5]-378558)<<4|A>>>28)+B<<0))+Q[8]-2022574463)<<11|e>>>21)+A<<0)^A)^(t=((t+=(i^B)+Q[11]+1839030562)<<16|t>>>16)+e<<0))+Q[14]-35309556)<<23|B>>>9)+t<<0,B=((B+=((i=(e=((e+=((g=B^t)^(A=((A+=(g^e)+Q[1]-1530992060)<<4|A>>>28)+B<<0))+Q[4]+1272893353)<<11|e>>>21)+A<<0)^A)^(t=((t+=(i^B)+Q[7]-155497632)<<16|t>>>16)+e<<0))+Q[10]-1094730640)<<23|B>>>9)+t<<0,B=((B+=((i=(e=((e+=((g=B^t)^(A=((A+=(g^e)+Q[13]+681279174)<<4|A>>>28)+B<<0))+Q[0]-358537222)<<11|e>>>21)+A<<0)^A)^(t=((t+=(i^B)+Q[3]-722521979)<<16|t>>>16)+e<<0))+Q[6]+76029189)<<23|B>>>9)+t<<0,B=((B+=((i=(e=((e+=((g=B^t)^(A=((A+=(g^e)+Q[9]-640364487)<<4|A>>>28)+B<<0))+Q[12]-421815835)<<11|e>>>21)+A<<0)^A)^(t=((t+=(i^B)+Q[15]+530742520)<<16|t>>>16)+e<<0))+Q[2]-995338651)<<23|B>>>9)+t<<0,B=((B+=((e=((e+=(B^((A=((A+=(t^(B|~e))+Q[0]-198630844)<<6|A>>>26)+B<<0)|~t))+Q[7]+1126891415)<<10|e>>>22)+A<<0)^((t=((t+=(A^(e|~B))+Q[14]-1416354905)<<15|t>>>17)+e<<0)|~A))+Q[5]-57434055)<<21|B>>>11)+t<<0,B=((B+=((e=((e+=(B^((A=((A+=(t^(B|~e))+Q[12]+1700485571)<<6|A>>>26)+B<<0)|~t))+Q[3]-1894986606)<<10|e>>>22)+A<<0)^((t=((t+=(A^(e|~B))+Q[10]-1051523)<<15|t>>>17)+e<<0)|~A))+Q[1]-2054922799)<<21|B>>>11)+t<<0,B=((B+=((e=((e+=(B^((A=((A+=(t^(B|~e))+Q[8]+1873313359)<<6|A>>>26)+B<<0)|~t))+Q[15]-30611744)<<10|e>>>22)+A<<0)^((t=((t+=(A^(e|~B))+Q[6]-1560198380)<<15|t>>>17)+e<<0)|~A))+Q[13]+1309151649)<<21|B>>>11)+t<<0,B=((B+=((e=((e+=(B^((A=((A+=(t^(B|~e))+Q[4]-145523070)<<6|A>>>26)+B<<0)|~t))+Q[11]-1120210379)<<10|e>>>22)+A<<0)^((t=((t+=(A^(e|~B))+Q[2]+718787259)<<15|t>>>17)+e<<0)|~A))+Q[9]-343485551)<<21|B>>>11)+t<<0,this.first?(this.h0=A+1732584193<<0,this.h1=B-271733879<<0,this.h2=t-1732584194<<0,this.h3=e+271733878<<0,this.first=!1):(this.h0=this.h0+A<<0,this.h1=this.h1+B<<0,this.h2=this.h2+t<<0,this.h3=this.h3+e<<0)},Md5.prototype.hex=function(){this.finalize();var A=this.h0,B=this.h1,t=this.h2,e=this.h3;return HEX_CHARS[A>>4&15]+HEX_CHARS[15&A]+HEX_CHARS[A>>12&15]+HEX_CHARS[A>>8&15]+HEX_CHARS[A>>20&15]+HEX_CHARS[A>>16&15]+HEX_CHARS[A>>28&15]+HEX_CHARS[A>>24&15]+HEX_CHARS[B>>4&15]+HEX_CHARS[15&B]+HEX_CHARS[B>>12&15]+HEX_CHARS[B>>8&15]+HEX_CHARS[B>>20&15]+HEX_CHARS[B>>16&15]+HEX_CHARS[B>>28&15]+HEX_CHARS[B>>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[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]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var A=this.h0,B=this.h1,t=this.h2,e=this.h3;return[255&A,A>>8&255,A>>16&255,A>>24&255,255&B,B>>8&255,B>>16&255,B>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&e,e>>8&255,e>>16&255,e>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var A=new ArrayBuffer(16),B=new Uint32Array(A);return B[0]=this.h0,B[1]=this.h1,B[2]=this.h2,B[3]=this.h3,A},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var A,B,t,e="",g=this.array(),i=0;i<15;)A=g[i++],B=g[i++],t=g[i++],e+=BASE64_ENCODE_CHAR[A>>>2]+BASE64_ENCODE_CHAR[63&(A<<4|B>>>4)]+BASE64_ENCODE_CHAR[63&(B<<2|t>>>6)]+BASE64_ENCODE_CHAR[63&t];return A=g[i],e+=BASE64_ENCODE_CHAR[A>>>2]+BASE64_ENCODE_CHAR[A<<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__(27),__webpack_require__(9))},function(A,B){var t,e,g=A.exports={};function i(){throw new Error("setTimeout has not been defined")}function Q(){throw new Error("clearTimeout has not been defined")}function n(A){if(t===setTimeout)return setTimeout(A,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(A,0);try{return t(A,0)}catch(B){try{return t.call(null,A,0)}catch(B){return t.call(this,A,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(A){t=i}try{e="function"==typeof clearTimeout?clearTimeout:Q}catch(A){e=Q}}();var s,r=[],c=!1,E=-1;function o(){c&&s&&(c=!1,s.length?r=s.concat(r):E=-1,r.length&&w())}function w(){if(!c){var A=n(o);c=!0;for(var B=r.length;B;){for(s=r,r=[];++E1)for(var t=1;t>24&255;return{r:A>>16&255,g:A>>8&255,b:255&A,a:B>0?B:255}}static hexToRgb(A){A=A.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(A,B,t,e)=>B+B+t+t+e+e);const B=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(A);return B?{r:parseInt(B[1],16),g:parseInt(B[2],16),b:parseInt(B[3],16)}:null}static rgbToHex(A){return t.decimalToHex(t.rgbToDecimal(A))}static rgbToDecimal(A){return(A.r<<16)+(A.g<<8)+A.b}static hexToDecimal(A){return t.rgbToDecimal(t.hexToRgb(A))}static hsvToRgb(A){let B=A.h%360;B<0&&(B+=360);const t=Math.max(0,Math.min(A.s,1)),e=Math.max(0,Math.min(A.v,1)),g=Math.floor(B/60),i=B/60-g,Q=e*(1-t),n=e*(1-t*i),s=e*(1-t*(1-i));let r,c,E;switch(g){default:case 0:r=e,c=s,E=Q;break;case 1:r=n,c=e,E=Q;break;case 2:r=Q,c=e,E=s;break;case 3:r=Q,c=n,E=e;break;case 4:r=s,c=Q,E=e;break;case 5:r=e,c=Q,E=n}return{r:Math.floor(255*r),g:Math.floor(255*c),b:Math.floor(255*E)}}static rgbToHsv(A){const B=A.r/255,t=A.g/255,e=A.b/255,g=Math.min(Math.min(B,t),e),i=Math.max(Math.max(B,t),e);let Q=0,n=0;if(g!==i){Q=60*((B===g?3:t===g?5:1)-(B===g?t-e:t===g?e-B:B-t)/(i-g))%360,n=(i-g)/i}return{h:Q,s:n,v:i}}static mixRgb(A,B,t){if(t<=0)return A;if(t>=1)return B;const e=1-t;return{r:e*A.r+t*B.r,g:e*A.g+t*B.g,b:e*A.b+t*B.b}}}A.exports=t},function(A,B,t){A.exports=function(){"use strict";var A=Array.prototype.slice;function B(A,B){B&&(A.prototype=Object.create(B.prototype)),A.prototype.constructor=A}function t(A){return Q(A)?A:L(A)}function e(A){return n(A)?A:P(A)}function g(A){return s(A)?A:v(A)}function i(A){return Q(A)&&!r(A)?A:W(A)}function Q(A){return!(!A||!A[E])}function n(A){return!(!A||!A[o])}function s(A){return!(!A||!A[w])}function r(A){return n(A)||s(A)}function c(A){return!(!A||!A[C])}B(e,t),B(g,t),B(i,t),t.isIterable=Q,t.isKeyed=n,t.isIndexed=s,t.isAssociative=r,t.isOrdered=c,t.Keyed=e,t.Indexed=g,t.Set=i;var E="@@__IMMUTABLE_ITERABLE__@@",o="@@__IMMUTABLE_KEYED__@@",w="@@__IMMUTABLE_INDEXED__@@",C="@@__IMMUTABLE_ORDERED__@@",a={},I={value:!1},h={value:!1};function Y(A){return A.value=!1,A}function M(A){A&&(A.value=!0)}function F(){}function D(A,B){B=B||0;for(var t=Math.max(0,A.length-B),e=new Array(t),g=0;g>>0;if(""+t!==B||4294967295===t)return NaN;B=t}return B<0?u(A)+B:B}function d(){return!0}function U(A,B,t){return(0===A||void 0!==t&&A<=-t)&&(void 0===B||void 0!==t&&B>=t)}function N(A,B){return G(A,B,0)}function m(A,B){return G(A,B,B)}function G(A,B,t){return void 0===A?t:A<0?Math.max(0,B+A):void 0===B?A:Math.min(B,A)}var f,H,p,R="function"==typeof Symbol&&Symbol.iterator,y=R||"@@iterator";function J(A){this.next=A}function k(A,B,t,e){var g=0===A?B:1===A?t:[B,t];return e?e.value=g:e={value:g,done:!1},e}function T(){return{value:void 0,done:!0}}function j(A){return!!b(A)}function x(A){return A&&"function"==typeof A.next}function S(A){var B=b(A);return B&&B.call(A)}function b(A){var B=A&&(R&&A[R]||A["@@iterator"]);if("function"==typeof B)return B}function z(A){return A&&"number"==typeof A.length}function L(A){return null==A?_():Q(A)?A.toSeq():function(A){var B=AA(A)||"object"==typeof A&&new K(A);if(!B)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+A);return B}(A)}function P(A){return null==A?_().toKeyedSeq():Q(A)?n(A)?A.toSeq():A.fromEntrySeq():q(A)}function v(A){return null==A?_():Q(A)?n(A)?A.entrySeq():A.toIndexedSeq():$(A)}function W(A){return(null==A?_():Q(A)?n(A)?A.entrySeq():A:$(A)).toSetSeq()}function V(A){this._array=A,this.size=A.length}function K(A){var B=Object.keys(A);this._object=A,this._keys=B,this.size=B.length}function O(A){this._iterable=A,this.size=A.length||A.size}function X(A){this._iterator=A,this._iteratorCache=[]}function Z(A){return!(!A||!A["@@__IMMUTABLE_SEQ__@@"])}function _(){return f||(f=new V([]))}function q(A){var B=Array.isArray(A)?new V(A).fromEntrySeq():x(A)?new X(A).fromEntrySeq():j(A)?new O(A).fromEntrySeq():"object"==typeof A?new K(A):void 0;if(!B)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+A);return B}function $(A){var B=AA(A);if(!B)throw new TypeError("Expected Array or iterable object of values: "+A);return B}function AA(A){return z(A)?new V(A):x(A)?new X(A):j(A)?new O(A):void 0}function BA(A,B,t,e){var g=A._cache;if(g){for(var i=g.length-1,Q=0;Q<=i;Q++){var n=g[t?i-Q:Q];if(!1===B(n[1],e?n[0]:Q,A))return Q+1}return Q}return A.__iterateUncached(B,t)}function tA(A,B,t,e){var g=A._cache;if(g){var i=g.length-1,Q=0;return new J((function(){var A=g[t?i-Q:Q];return Q++>i?{value:void 0,done:!0}:k(B,e?A[0]:Q-1,A[1])}))}return A.__iteratorUncached(B,t)}function eA(A,B){return B?function A(B,t,e,g){return Array.isArray(t)?B.call(g,e,v(t).map((function(e,g){return A(B,e,g,t)}))):iA(t)?B.call(g,e,P(t).map((function(e,g){return A(B,e,g,t)}))):t}(B,A,"",{"":A}):gA(A)}function gA(A){return Array.isArray(A)?v(A).map(gA).toList():iA(A)?P(A).map(gA).toMap():A}function iA(A){return A&&(A.constructor===Object||void 0===A.constructor)}function QA(A,B){if(A===B||A!=A&&B!=B)return!0;if(!A||!B)return!1;if("function"==typeof A.valueOf&&"function"==typeof B.valueOf){if((A=A.valueOf())===(B=B.valueOf())||A!=A&&B!=B)return!0;if(!A||!B)return!1}return!("function"!=typeof A.equals||"function"!=typeof B.equals||!A.equals(B))}function nA(A,B){if(A===B)return!0;if(!Q(B)||void 0!==A.size&&void 0!==B.size&&A.size!==B.size||void 0!==A.__hash&&void 0!==B.__hash&&A.__hash!==B.__hash||n(A)!==n(B)||s(A)!==s(B)||c(A)!==c(B))return!1;if(0===A.size&&0===B.size)return!0;var t=!r(A);if(c(A)){var e=A.entries();return B.every((function(A,B){var g=e.next().value;return g&&QA(g[1],A)&&(t||QA(g[0],B))}))&&e.next().done}var g=!1;if(void 0===A.size)if(void 0===B.size)"function"==typeof A.cacheResult&&A.cacheResult();else{g=!0;var i=A;A=B,B=i}var E=!0,o=B.__iterate((function(B,e){if(t?!A.has(B):g?!QA(B,A.get(e,a)):!QA(A.get(e,a),B))return E=!1,!1}));return E&&A.size===o}function sA(A,B){if(!(this instanceof sA))return new sA(A,B);if(this._value=A,this.size=void 0===B?1/0:Math.max(0,B),0===this.size){if(H)return H;H=this}}function rA(A,B){if(!A)throw new Error(B)}function cA(A,B,t){if(!(this instanceof cA))return new cA(A,B,t);if(rA(0!==t,"Cannot step a Range by 0"),A=A||0,void 0===B&&(B=1/0),t=void 0===t?1:Math.abs(t),Be?{value:void 0,done:!0}:k(A,g,t[B?e-g++:g++])}))},B(K,P),K.prototype.get=function(A,B){return void 0===B||this.has(A)?this._object[A]:B},K.prototype.has=function(A){return this._object.hasOwnProperty(A)},K.prototype.__iterate=function(A,B){for(var t=this._object,e=this._keys,g=e.length-1,i=0;i<=g;i++){var Q=e[B?g-i:i];if(!1===A(t[Q],Q,this))return i+1}return i},K.prototype.__iterator=function(A,B){var t=this._object,e=this._keys,g=e.length-1,i=0;return new J((function(){var Q=e[B?g-i:i];return i++>g?{value:void 0,done:!0}:k(A,Q,t[Q])}))},K.prototype[C]=!0,B(O,v),O.prototype.__iterateUncached=function(A,B){if(B)return this.cacheResult().__iterate(A,B);var t=S(this._iterable),e=0;if(x(t))for(var g;!(g=t.next()).done&&!1!==A(g.value,e++,this););return e},O.prototype.__iteratorUncached=function(A,B){if(B)return this.cacheResult().__iterator(A,B);var t=S(this._iterable);if(!x(t))return new J(T);var e=0;return new J((function(){var B=t.next();return B.done?B:k(A,e++,B.value)}))},B(X,v),X.prototype.__iterateUncached=function(A,B){if(B)return this.cacheResult().__iterate(A,B);for(var t,e=this._iterator,g=this._iteratorCache,i=0;i=e.length){var B=t.next();if(B.done)return B;e[g]=B.value}return k(A,g,e[g++])}))},B(sA,v),sA.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},sA.prototype.get=function(A,B){return this.has(A)?this._value:B},sA.prototype.includes=function(A){return QA(this._value,A)},sA.prototype.slice=function(A,B){var t=this.size;return U(A,B,t)?this:new sA(this._value,m(B,t)-N(A,t))},sA.prototype.reverse=function(){return this},sA.prototype.indexOf=function(A){return QA(this._value,A)?0:-1},sA.prototype.lastIndexOf=function(A){return QA(this._value,A)?this.size:-1},sA.prototype.__iterate=function(A,B){for(var t=0;t=0&&B=0&&tt?{value:void 0,done:!0}:k(A,i++,Q)}))},cA.prototype.equals=function(A){return A instanceof cA?this._start===A._start&&this._end===A._end&&this._step===A._step:nA(this,A)},B(EA,t),B(oA,EA),B(wA,EA),B(CA,EA),EA.Keyed=oA,EA.Indexed=wA,EA.Set=CA;var aA="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(A,B){var t=65535&(A|=0),e=65535&(B|=0);return t*e+((A>>>16)*e+t*(B>>>16)<<16>>>0)|0};function IA(A){return A>>>1&1073741824|3221225471&A}function hA(A){if(!1===A||null==A)return 0;if("function"==typeof A.valueOf&&(!1===(A=A.valueOf())||null==A))return 0;if(!0===A)return 1;var B=typeof A;if("number"===B){if(A!=A||A===1/0)return 0;var t=0|A;for(t!==A&&(t^=4294967295*A);A>4294967295;)t^=A/=4294967295;return IA(t)}if("string"===B)return A.length>UA?function(A){var B=GA[A];return void 0===B&&(B=YA(A),mA===NA&&(mA=0,GA={}),mA++,GA[A]=B),B}(A):YA(A);if("function"==typeof A.hashCode)return A.hashCode();if("object"===B)return function(A){var B;if(uA&&void 0!==(B=MA.get(A)))return B;if(void 0!==(B=A[dA]))return B;if(!DA){if(void 0!==(B=A.propertyIsEnumerable&&A.propertyIsEnumerable[dA]))return B;if(void 0!==(B=function(A){if(A&&A.nodeType>0)switch(A.nodeType){case 1:return A.uniqueID;case 9:return A.documentElement&&A.documentElement.uniqueID}}(A)))return B}if(B=++lA,1073741824&lA&&(lA=0),uA)MA.set(A,B);else{if(void 0!==FA&&!1===FA(A))throw new Error("Non-extensible objects are not allowed as keys.");if(DA)Object.defineProperty(A,dA,{enumerable:!1,configurable:!1,writable:!1,value:B});else if(void 0!==A.propertyIsEnumerable&&A.propertyIsEnumerable===A.constructor.prototype.propertyIsEnumerable)A.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},A.propertyIsEnumerable[dA]=B;else{if(void 0===A.nodeType)throw new Error("Unable to set a non-enumerable property on object.");A[dA]=B}}return B}(A);if("function"==typeof A.toString)return YA(A.toString());throw new Error("Value type "+B+" cannot be hashed.")}function YA(A){for(var B=0,t=0;t=B.length)throw new Error("Missing value for key: "+B[t]);A.set(B[t],B[t+1])}}))},HA.prototype.toString=function(){return this.__toString("Map {","}")},HA.prototype.get=function(A,B){return this._root?this._root.get(0,void 0,A,B):B},HA.prototype.set=function(A,B){return WA(this,A,B)},HA.prototype.setIn=function(A,B){return this.updateIn(A,a,(function(){return B}))},HA.prototype.remove=function(A){return WA(this,A,a)},HA.prototype.deleteIn=function(A){return this.updateIn(A,(function(){return a}))},HA.prototype.update=function(A,B,t){return 1===arguments.length?A(this):this.updateIn([A],B,t)},HA.prototype.updateIn=function(A,B,t){t||(t=B,B=void 0);var e=function A(B,t,e,g){var i=B===a,Q=t.next();if(Q.done){var n=i?e:B,s=g(n);return s===n?B:s}rA(i||B&&B.set,"invalid keyPath");var r=Q.value,c=i?a:B.get(r,a),E=A(c,t,e,g);return E===c?B:E===a?B.remove(r):(i?vA():B).set(r,E)}(this,XB(A),B,t);return e===a?void 0:e},HA.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):vA()},HA.prototype.merge=function(){return XA(this,void 0,arguments)},HA.prototype.mergeWith=function(B){var t=A.call(arguments,1);return XA(this,B,t)},HA.prototype.mergeIn=function(B){var t=A.call(arguments,1);return this.updateIn(B,vA(),(function(A){return"function"==typeof A.merge?A.merge.apply(A,t):t[t.length-1]}))},HA.prototype.mergeDeep=function(){return XA(this,ZA,arguments)},HA.prototype.mergeDeepWith=function(B){var t=A.call(arguments,1);return XA(this,_A(B),t)},HA.prototype.mergeDeepIn=function(B){var t=A.call(arguments,1);return this.updateIn(B,vA(),(function(A){return"function"==typeof A.mergeDeep?A.mergeDeep.apply(A,t):t[t.length-1]}))},HA.prototype.sort=function(A){return DB(xB(this,A))},HA.prototype.sortBy=function(A,B){return DB(xB(this,B,A))},HA.prototype.withMutations=function(A){var B=this.asMutable();return A(B),B.wasAltered()?B.__ensureOwner(this.__ownerID):this},HA.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new F)},HA.prototype.asImmutable=function(){return this.__ensureOwner()},HA.prototype.wasAltered=function(){return this.__altered},HA.prototype.__iterator=function(A,B){return new bA(this,A,B)},HA.prototype.__iterate=function(A,B){var t=this,e=0;return this._root&&this._root.iterate((function(B){return e++,A(B[1],B[0],t)}),B),e},HA.prototype.__ensureOwner=function(A){return A===this.__ownerID?this:A?PA(this.size,this._root,A,this.__hash):(this.__ownerID=A,this.__altered=!1,this)},HA.isMap=pA;var RA,yA="@@__IMMUTABLE_MAP__@@",JA=HA.prototype;function kA(A,B){this.ownerID=A,this.entries=B}function TA(A,B,t){this.ownerID=A,this.bitmap=B,this.nodes=t}function jA(A,B,t){this.ownerID=A,this.count=B,this.nodes=t}function xA(A,B,t){this.ownerID=A,this.keyHash=B,this.entries=t}function SA(A,B,t){this.ownerID=A,this.keyHash=B,this.entry=t}function bA(A,B,t){this._type=B,this._reverse=t,this._stack=A._root&&LA(A._root)}function zA(A,B){return k(A,B[0],B[1])}function LA(A,B){return{node:A,index:0,__prev:B}}function PA(A,B,t,e){var g=Object.create(JA);return g.size=A,g._root=B,g.__ownerID=t,g.__hash=e,g.__altered=!1,g}function vA(){return RA||(RA=PA(0))}function WA(A,B,t){var e,g;if(A._root){var i=Y(I),Q=Y(h);if(e=VA(A._root,A.__ownerID,0,void 0,B,t,i,Q),!Q.value)return A;g=A.size+(i.value?t===a?-1:1:0)}else{if(t===a)return A;g=1,e=new kA(A.__ownerID,[[B,t]])}return A.__ownerID?(A.size=g,A._root=e,A.__hash=void 0,A.__altered=!0,A):e?PA(g,e):vA()}function VA(A,B,t,e,g,i,Q,n){return A?A.update(B,t,e,g,i,Q,n):i===a?A:(M(n),M(Q),new SA(B,e,[g,i]))}function KA(A){return A.constructor===SA||A.constructor===xA}function OA(A,B,t,e,g){if(A.keyHash===e)return new xA(B,e,[A.entry,g]);var i,Q=31&(0===t?A.keyHash:A.keyHash>>>t),n=31&(0===t?e:e>>>t);return new TA(B,1<>1&1431655765))+(A>>2&858993459))+(A>>4)&252645135,A+=A>>8,127&(A+=A>>16)}function AB(A,B,t,e){var g=e?A:D(A);return g[B]=t,g}JA[yA]=!0,JA.delete=JA.remove,JA.removeIn=JA.deleteIn,kA.prototype.get=function(A,B,t,e){for(var g=this.entries,i=0,Q=g.length;i=BB)return function(A,B,t,e){A||(A=new F);for(var g=new SA(A,hA(t),[t,e]),i=0;i>>A)),i=this.bitmap;return 0==(i&g)?e:this.nodes[$A(i&g-1)].get(A+5,B,t,e)},TA.prototype.update=function(A,B,t,e,g,i,Q){void 0===t&&(t=hA(e));var n=31&(0===B?t:t>>>B),s=1<=tB)return function(A,B,t,e,g){for(var i=0,Q=new Array(32),n=0;0!==t;n++,t>>>=1)Q[n]=1&t?B[i++]:void 0;return Q[e]=g,new jA(A,i+1,Q)}(A,o,r,n,C);if(c&&!C&&2===o.length&&KA(o[1^E]))return o[1^E];if(c&&C&&1===o.length&&KA(C))return C;var I=A&&A===this.ownerID,h=c?C?r:r^s:r|s,Y=c?C?AB(o,E,C,I):function(A,B,t){var e=A.length-1;if(t&&B===e)return A.pop(),A;for(var g=new Array(e),i=0,Q=0;Q>>A),i=this.nodes[g];return i?i.get(A+5,B,t,e):e},jA.prototype.update=function(A,B,t,e,g,i,Q){void 0===t&&(t=hA(e));var n=31&(0===B?t:t>>>B),s=g===a,r=this.nodes,c=r[n];if(s&&!c)return this;var E=VA(c,A,B+5,t,e,g,i,Q);if(E===c)return this;var o=this.count;if(c){if(!E&&--o0&&e<32?wB(0,e,5,null,new sB(t.toArray())):B.withMutations((function(A){A.setSize(e),t.forEach((function(B,t){return A.set(t,B)}))})))}function iB(A){return!(!A||!A[QB])}B(gB,wA),gB.of=function(){return this(arguments)},gB.prototype.toString=function(){return this.__toString("List [","]")},gB.prototype.get=function(A,B){if((A=l(this,A))>=0&&A=A.size||B<0)return A.withMutations((function(A){B<0?YB(A,B).set(0,t):YB(A,0,B+1).set(B,t)}));B+=A._origin;var e=A._tail,g=A._root,i=Y(h);return B>=FB(A._capacity)?e=aB(e,A.__ownerID,0,B,t,i):g=aB(g,A.__ownerID,A._level,B,t,i),i.value?A.__ownerID?(A._root=g,A._tail=e,A.__hash=void 0,A.__altered=!0,A):wB(A._origin,A._capacity,A._level,g,e):A}(this,A,B)},gB.prototype.remove=function(A){return this.has(A)?0===A?this.shift():A===this.size-1?this.pop():this.splice(A,1):this},gB.prototype.insert=function(A,B){return this.splice(A,0,B)},gB.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):CB()},gB.prototype.push=function(){var A=arguments,B=this.size;return this.withMutations((function(t){YB(t,0,B+A.length);for(var e=0;e>>B&31;if(e>=this.array.length)return new sB([],A);var g,i=0===e;if(B>0){var Q=this.array[e];if((g=Q&&Q.removeBefore(A,B-5,t))===Q&&i)return this}if(i&&!g)return this;var n=IB(this,A);if(!i)for(var s=0;s>>B&31;if(g>=this.array.length)return this;if(B>0){var i=this.array[g];if((e=i&&i.removeAfter(A,B-5,t))===i&&g===this.array.length-1)return this}var Q=IB(this,A);return Q.array.splice(g+1),e&&(Q.array[g]=e),Q};var rB,cB,EB={};function oB(A,B){var t=A._origin,e=A._capacity,g=FB(e),i=A._tail;return Q(A._root,A._level,0);function Q(A,n,s){return 0===n?function(A,Q){var n=Q===g?i&&i.array:A&&A.array,s=Q>t?0:t-Q,r=e-Q;return r>32&&(r=32),function(){if(s===r)return EB;var A=B?--r:s++;return n&&n[A]}}(A,s):function(A,g,i){var n,s=A&&A.array,r=i>t?0:t-i>>g,c=1+(e-i>>g);return c>32&&(c=32),function(){for(;;){if(n){var A=n();if(A!==EB)return A;n=null}if(r===c)return EB;var t=B?--c:r++;n=Q(s&&s[t],g-5,i+(t<>>t&31,s=A&&n0){var r=A&&A.array[n],c=aB(r,B,t-5,e,g,i);return c===r?A:((Q=IB(A,B)).array[n]=c,Q)}return s&&A.array[n]===g?A:(M(i),Q=IB(A,B),void 0===g&&n===Q.array.length-1?Q.array.pop():Q.array[n]=g,Q)}function IB(A,B){return B&&A&&B===A.ownerID?A:new sB(A?A.array.slice():[],B)}function hB(A,B){if(B>=FB(A._capacity))return A._tail;if(B<1<0;)t=t.array[B>>>e&31],e-=5;return t}}function YB(A,B,t){void 0!==B&&(B|=0),void 0!==t&&(t|=0);var e=A.__ownerID||new F,g=A._origin,i=A._capacity,Q=g+B,n=void 0===t?i:t<0?i+t:g+t;if(Q===g&&n===i)return A;if(Q>=n)return A.clear();for(var s=A._level,r=A._root,c=0;Q+c<0;)r=new sB(r&&r.array.length?[void 0,r]:[],e),c+=1<<(s+=5);c&&(Q+=c,g+=c,n+=c,i+=c);for(var E=FB(i),o=FB(n);o>=1<E?new sB([],e):w;if(w&&o>E&&Q5;I-=5){var h=E>>>I&31;a=a.array[h]=IB(a.array[h],e)}a.array[E>>>5&31]=w}if(n=o)Q-=o,n-=o,s=5,r=null,C=C&&C.removeBefore(e,0,Q);else if(Q>g||o>>s&31;if(Y!==o>>>s&31)break;Y&&(c+=(1<g&&(r=r.removeBefore(e,s,Q-c)),r&&oi&&(i=r.size),Q(s)||(r=r.map((function(A){return eA(A)}))),e.push(r)}return i>A.size&&(A=A.setSize(i)),qA(A,B,e)}function FB(A){return A<32?0:A-1>>>5<<5}function DB(A){return null==A?dB():uB(A)?A:dB().withMutations((function(B){var t=e(A);fA(t.size),t.forEach((function(A,t){return B.set(t,A)}))}))}function uB(A){return pA(A)&&c(A)}function lB(A,B,t,e){var g=Object.create(DB.prototype);return g.size=A?A.size:0,g._map=A,g._list=B,g.__ownerID=t,g.__hash=e,g}function dB(){return cB||(cB=lB(vA(),CB()))}function UB(A,B,t){var e,g,i=A._map,Q=A._list,n=i.get(B),s=void 0!==n;if(t===a){if(!s)return A;Q.size>=32&&Q.size>=2*i.size?(e=(g=Q.filter((function(A,B){return void 0!==A&&n!==B}))).toKeyedSeq().map((function(A){return A[0]})).flip().toMap(),A.__ownerID&&(e.__ownerID=g.__ownerID=A.__ownerID)):(e=i.remove(B),g=n===Q.size-1?Q.pop():Q.set(n,void 0))}else if(s){if(t===Q.get(n)[1])return A;e=i,g=Q.set(n,[B,t])}else e=i.set(B,Q.size),g=Q.set(Q.size,[B,t]);return A.__ownerID?(A.size=e.size,A._map=e,A._list=g,A.__hash=void 0,A):lB(e,g)}function NB(A,B){this._iter=A,this._useKeys=B,this.size=A.size}function mB(A){this._iter=A,this.size=A.size}function GB(A){this._iter=A,this.size=A.size}function fB(A){this._iter=A,this.size=A.size}function HB(A){var B=VB(A);return B._iter=A,B.size=A.size,B.flip=function(){return A},B.reverse=function(){var B=A.reverse.apply(this);return B.flip=function(){return A.reverse()},B},B.has=function(B){return A.includes(B)},B.includes=function(B){return A.has(B)},B.cacheResult=KB,B.__iterateUncached=function(B,t){var e=this;return A.__iterate((function(A,t){return!1!==B(t,A,e)}),t)},B.__iteratorUncached=function(B,t){if(2===B){var e=A.__iterator(B,t);return new J((function(){var A=e.next();if(!A.done){var B=A.value[0];A.value[0]=A.value[1],A.value[1]=B}return A}))}return A.__iterator(1===B?0:1,t)},B}function pB(A,B,t){var e=VB(A);return e.size=A.size,e.has=function(B){return A.has(B)},e.get=function(e,g){var i=A.get(e,a);return i===a?g:B.call(t,i,e,A)},e.__iterateUncached=function(e,g){var i=this;return A.__iterate((function(A,g,Q){return!1!==e(B.call(t,A,g,Q),g,i)}),g)},e.__iteratorUncached=function(e,g){var i=A.__iterator(2,g);return new J((function(){var g=i.next();if(g.done)return g;var Q=g.value,n=Q[0];return k(e,n,B.call(t,Q[1],n,A),g)}))},e}function RB(A,B){var t=VB(A);return t._iter=A,t.size=A.size,t.reverse=function(){return A},A.flip&&(t.flip=function(){var B=HB(A);return B.reverse=function(){return A.flip()},B}),t.get=function(t,e){return A.get(B?t:-1-t,e)},t.has=function(t){return A.has(B?t:-1-t)},t.includes=function(B){return A.includes(B)},t.cacheResult=KB,t.__iterate=function(B,t){var e=this;return A.__iterate((function(A,t){return B(A,t,e)}),!t)},t.__iterator=function(B,t){return A.__iterator(B,!t)},t}function yB(A,B,t,e){var g=VB(A);return e&&(g.has=function(e){var g=A.get(e,a);return g!==a&&!!B.call(t,g,e,A)},g.get=function(e,g){var i=A.get(e,a);return i!==a&&B.call(t,i,e,A)?i:g}),g.__iterateUncached=function(g,i){var Q=this,n=0;return A.__iterate((function(A,i,s){if(B.call(t,A,i,s))return n++,g(A,e?i:n-1,Q)}),i),n},g.__iteratorUncached=function(g,i){var Q=A.__iterator(2,i),n=0;return new J((function(){for(;;){var i=Q.next();if(i.done)return i;var s=i.value,r=s[0],c=s[1];if(B.call(t,c,r,A))return k(g,e?r:n++,c,i)}}))},g}function JB(A,B,t,e){var g=A.size;if(void 0!==B&&(B|=0),void 0!==t&&(t===1/0?t=g:t|=0),U(B,t,g))return A;var i=N(B,g),Q=m(t,g);if(i!=i||Q!=Q)return JB(A.toSeq().cacheResult(),B,t,e);var n,s=Q-i;s==s&&(n=s<0?0:s);var r=VB(A);return r.size=0===n?n:A.size&&n||void 0,!e&&Z(A)&&n>=0&&(r.get=function(B,t){return(B=l(this,B))>=0&&Bn)return{value:void 0,done:!0};var A=g.next();return e||1===B?A:k(B,s-1,0===B?void 0:A.value[1],A)}))},r}function kB(A,B,t,e){var g=VB(A);return g.__iterateUncached=function(g,i){var Q=this;if(i)return this.cacheResult().__iterate(g,i);var n=!0,s=0;return A.__iterate((function(A,i,r){if(!n||!(n=B.call(t,A,i,r)))return s++,g(A,e?i:s-1,Q)})),s},g.__iteratorUncached=function(g,i){var Q=this;if(i)return this.cacheResult().__iterator(g,i);var n=A.__iterator(2,i),s=!0,r=0;return new J((function(){var A,i,c;do{if((A=n.next()).done)return e||1===g?A:k(g,r++,0===g?void 0:A.value[1],A);var E=A.value;i=E[0],c=E[1],s&&(s=B.call(t,c,i,Q))}while(s);return 2===g?A:k(g,i,c,A)}))},g}function TB(A,B){var t=n(A),g=[A].concat(B).map((function(A){return Q(A)?t&&(A=e(A)):A=t?q(A):$(Array.isArray(A)?A:[A]),A})).filter((function(A){return 0!==A.size}));if(0===g.length)return A;if(1===g.length){var i=g[0];if(i===A||t&&n(i)||s(A)&&s(i))return i}var r=new V(g);return t?r=r.toKeyedSeq():s(A)||(r=r.toSetSeq()),(r=r.flatten(!0)).size=g.reduce((function(A,B){if(void 0!==A){var t=B.size;if(void 0!==t)return A+t}}),0),r}function jB(A,B,t){var e=VB(A);return e.__iterateUncached=function(e,g){var i=0,n=!1;return function A(s,r){var c=this;s.__iterate((function(g,s){return(!B||r0}function zB(A,B,e){var g=VB(A);return g.size=new V(e).map((function(A){return A.size})).min(),g.__iterate=function(A,B){for(var t,e=this.__iterator(1,B),g=0;!(t=e.next()).done&&!1!==A(t.value,g++,this););return g},g.__iteratorUncached=function(A,g){var i=e.map((function(A){return A=t(A),S(g?A.reverse():A)})),Q=0,n=!1;return new J((function(){var t;return n||(t=i.map((function(A){return A.next()})),n=t.some((function(A){return A.done}))),n?{value:void 0,done:!0}:k(A,Q++,B.apply(null,t.map((function(A){return A.value}))))}))},g}function LB(A,B){return Z(A)?B:A.constructor(B)}function PB(A){if(A!==Object(A))throw new TypeError("Expected [K, V] tuple: "+A)}function vB(A){return fA(A.size),u(A)}function WB(A){return n(A)?e:s(A)?g:i}function VB(A){return Object.create((n(A)?P:s(A)?v:W).prototype)}function KB(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):L.prototype.cacheResult.call(this)}function OB(A,B){return A>B?1:A=0;t--)B={value:arguments[t],next:B};return this.__ownerID?(this.size=A,this._head=B,this.__hash=void 0,this.__altered=!0,this):Ft(A,B)},at.prototype.pushAll=function(A){if(0===(A=g(A)).size)return this;fA(A.size);var B=this.size,t=this._head;return A.reverse().forEach((function(A){B++,t={value:A,next:t}})),this.__ownerID?(this.size=B,this._head=t,this.__hash=void 0,this.__altered=!0,this):Ft(B,t)},at.prototype.pop=function(){return this.slice(1)},at.prototype.unshift=function(){return this.push.apply(this,arguments)},at.prototype.unshiftAll=function(A){return this.pushAll(A)},at.prototype.shift=function(){return this.pop.apply(this,arguments)},at.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):Dt()},at.prototype.slice=function(A,B){if(U(A,B,this.size))return this;var t=N(A,this.size);if(m(B,this.size)!==this.size)return wA.prototype.slice.call(this,A,B);for(var e=this.size-t,g=this._head;t--;)g=g.next;return this.__ownerID?(this.size=e,this._head=g,this.__hash=void 0,this.__altered=!0,this):Ft(e,g)},at.prototype.__ensureOwner=function(A){return A===this.__ownerID?this:A?Ft(this.size,this._head,A,this.__hash):(this.__ownerID=A,this.__altered=!1,this)},at.prototype.__iterate=function(A,B){if(B)return this.reverse().__iterate(A);for(var t=0,e=this._head;e&&!1!==A(e.value,t++,this);)e=e.next;return t},at.prototype.__iterator=function(A,B){if(B)return this.reverse().__iterator(A);var t=0,e=this._head;return new J((function(){if(e){var B=e.value;return e=e.next,k(A,t++,B)}return{value:void 0,done:!0}}))},at.isStack=It;var ht,Yt="@@__IMMUTABLE_STACK__@@",Mt=at.prototype;function Ft(A,B,t,e){var g=Object.create(Mt);return g.size=A,g._head=B,g.__ownerID=t,g.__hash=e,g.__altered=!1,g}function Dt(){return ht||(ht=Ft(0))}function ut(A,B){var t=function(t){A.prototype[t]=B[t]};return Object.keys(B).forEach(t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(B).forEach(t),A}Mt[Yt]=!0,Mt.withMutations=JA.withMutations,Mt.asMutable=JA.asMutable,Mt.asImmutable=JA.asImmutable,Mt.wasAltered=JA.wasAltered,t.Iterator=J,ut(t,{toArray:function(){fA(this.size);var A=new Array(this.size||0);return this.valueSeq().__iterate((function(B,t){A[t]=B})),A},toIndexedSeq:function(){return new mB(this)},toJS:function(){return this.toSeq().map((function(A){return A&&"function"==typeof A.toJS?A.toJS():A})).__toJS()},toJSON:function(){return this.toSeq().map((function(A){return A&&"function"==typeof A.toJSON?A.toJSON():A})).__toJS()},toKeyedSeq:function(){return new NB(this,!0)},toMap:function(){return HA(this.toKeyedSeq())},toObject:function(){fA(this.size);var A={};return this.__iterate((function(B,t){A[t]=B})),A},toOrderedMap:function(){return DB(this.toKeyedSeq())},toOrderedSet:function(){return rt(n(this)?this.valueSeq():this)},toSet:function(){return Bt(n(this)?this.valueSeq():this)},toSetSeq:function(){return new GB(this)},toSeq:function(){return s(this)?this.toIndexedSeq():n(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return at(n(this)?this.valueSeq():this)},toList:function(){return gB(n(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(A,B){return 0===this.size?A+B:A+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+B},concat:function(){var B=A.call(arguments,0);return LB(this,TB(this,B))},includes:function(A){return this.some((function(B){return QA(B,A)}))},entries:function(){return this.__iterator(2)},every:function(A,B){fA(this.size);var t=!0;return this.__iterate((function(e,g,i){if(!A.call(B,e,g,i))return t=!1,!1})),t},filter:function(A,B){return LB(this,yB(this,A,B,!0))},find:function(A,B,t){var e=this.findEntry(A,B);return e?e[1]:t},forEach:function(A,B){return fA(this.size),this.__iterate(B?A.bind(B):A)},join:function(A){fA(this.size),A=void 0!==A?""+A:",";var B="",t=!0;return this.__iterate((function(e){t?t=!1:B+=A,B+=null!=e?e.toString():""})),B},keys:function(){return this.__iterator(0)},map:function(A,B){return LB(this,pB(this,A,B))},reduce:function(A,B,t){var e,g;return fA(this.size),arguments.length<2?g=!0:e=B,this.__iterate((function(B,i,Q){g?(g=!1,e=B):e=A.call(t,e,B,i,Q)})),e},reduceRight:function(A,B,t){var e=this.toKeyedSeq().reverse();return e.reduce.apply(e,arguments)},reverse:function(){return LB(this,RB(this,!0))},slice:function(A,B){return LB(this,JB(this,A,B,!0))},some:function(A,B){return!this.every(mt(A),B)},sort:function(A){return LB(this,xB(this,A))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(A,B){return u(A?this.toSeq().filter(A,B):this)},countBy:function(A,B){return function(A,B,t){var e=HA().asMutable();return A.__iterate((function(g,i){e.update(B.call(t,g,i,A),0,(function(A){return A+1}))})),e.asImmutable()}(this,A,B)},equals:function(A){return nA(this,A)},entrySeq:function(){var A=this;if(A._cache)return new V(A._cache);var B=A.toSeq().map(Nt).toIndexedSeq();return B.fromEntrySeq=function(){return A.toSeq()},B},filterNot:function(A,B){return this.filter(mt(A),B)},findEntry:function(A,B,t){var e=t;return this.__iterate((function(t,g,i){if(A.call(B,t,g,i))return e=[g,t],!1})),e},findKey:function(A,B){var t=this.findEntry(A,B);return t&&t[0]},findLast:function(A,B,t){return this.toKeyedSeq().reverse().find(A,B,t)},findLastEntry:function(A,B,t){return this.toKeyedSeq().reverse().findEntry(A,B,t)},findLastKey:function(A,B){return this.toKeyedSeq().reverse().findKey(A,B)},first:function(){return this.find(d)},flatMap:function(A,B){return LB(this,function(A,B,t){var e=WB(A);return A.toSeq().map((function(g,i){return e(B.call(t,g,i,A))})).flatten(!0)}(this,A,B))},flatten:function(A){return LB(this,jB(this,A,!0))},fromEntrySeq:function(){return new fB(this)},get:function(A,B){return this.find((function(B,t){return QA(t,A)}),void 0,B)},getIn:function(A,B){for(var t,e=this,g=XB(A);!(t=g.next()).done;){var i=t.value;if((e=e&&e.get?e.get(i,a):a)===a)return B}return e},groupBy:function(A,B){return function(A,B,t){var e=n(A),g=(c(A)?DB():HA()).asMutable();A.__iterate((function(i,Q){g.update(B.call(t,i,Q,A),(function(A){return(A=A||[]).push(e?[Q,i]:i),A}))}));var i=WB(A);return g.map((function(B){return LB(A,i(B))}))}(this,A,B)},has:function(A){return this.get(A,a)!==a},hasIn:function(A){return this.getIn(A,a)!==a},isSubset:function(A){return A="function"==typeof A.includes?A:t(A),this.every((function(B){return A.includes(B)}))},isSuperset:function(A){return(A="function"==typeof A.isSubset?A:t(A)).isSubset(this)},keyOf:function(A){return this.findKey((function(B){return QA(B,A)}))},keySeq:function(){return this.toSeq().map(Ut).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(A){return this.toKeyedSeq().reverse().keyOf(A)},max:function(A){return SB(this,A)},maxBy:function(A,B){return SB(this,B,A)},min:function(A){return SB(this,A?Gt(A):pt)},minBy:function(A,B){return SB(this,B?Gt(B):pt,A)},rest:function(){return this.slice(1)},skip:function(A){return this.slice(Math.max(0,A))},skipLast:function(A){return LB(this,this.toSeq().reverse().skip(A).reverse())},skipWhile:function(A,B){return LB(this,kB(this,A,B,!0))},skipUntil:function(A,B){return this.skipWhile(mt(A),B)},sortBy:function(A,B){return LB(this,xB(this,B,A))},take:function(A){return this.slice(0,Math.max(0,A))},takeLast:function(A){return LB(this,this.toSeq().reverse().take(A).reverse())},takeWhile:function(A,B){return LB(this,function(A,B,t){var e=VB(A);return e.__iterateUncached=function(e,g){var i=this;if(g)return this.cacheResult().__iterate(e,g);var Q=0;return A.__iterate((function(A,g,n){return B.call(t,A,g,n)&&++Q&&e(A,g,i)})),Q},e.__iteratorUncached=function(e,g){var i=this;if(g)return this.cacheResult().__iterator(e,g);var Q=A.__iterator(2,g),n=!0;return new J((function(){if(!n)return{value:void 0,done:!0};var A=Q.next();if(A.done)return A;var g=A.value,s=g[0],r=g[1];return B.call(t,r,s,i)?2===e?A:k(e,s,r,A):(n=!1,{value:void 0,done:!0})}))},e}(this,A,B))},takeUntil:function(A,B){return this.takeWhile(mt(A),B)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(A){if(A.size===1/0)return 0;var B=c(A),t=n(A),e=B?1:0;return function(A,B){return B=aA(B,3432918353),B=aA(B<<15|B>>>-15,461845907),B=aA(B<<13|B>>>-13,5),B=aA((B=(B+3864292196|0)^A)^B>>>16,2246822507),B=IA((B=aA(B^B>>>13,3266489909))^B>>>16)}(A.__iterate(t?B?function(A,B){e=31*e+Rt(hA(A),hA(B))|0}:function(A,B){e=e+Rt(hA(A),hA(B))|0}:B?function(A){e=31*e+hA(A)|0}:function(A){e=e+hA(A)|0}),e)}(this))}});var lt=t.prototype;lt[E]=!0,lt[y]=lt.values,lt.__toJS=lt.toArray,lt.__toStringMapper=ft,lt.inspect=lt.toSource=function(){return this.toString()},lt.chain=lt.flatMap,lt.contains=lt.includes,ut(e,{flip:function(){return LB(this,HB(this))},mapEntries:function(A,B){var t=this,e=0;return LB(this,this.toSeq().map((function(g,i){return A.call(B,[i,g],e++,t)})).fromEntrySeq())},mapKeys:function(A,B){var t=this;return LB(this,this.toSeq().flip().map((function(e,g){return A.call(B,e,g,t)})).flip())}});var dt=e.prototype;function Ut(A,B){return B}function Nt(A,B){return[B,A]}function mt(A){return function(){return!A.apply(this,arguments)}}function Gt(A){return function(){return-A.apply(this,arguments)}}function ft(A){return"string"==typeof A?JSON.stringify(A):String(A)}function Ht(){return D(arguments)}function pt(A,B){return AB?-1:0}function Rt(A,B){return A^B+2654435769+(A<<6)+(A>>2)|0}return dt[o]=!0,dt[y]=lt.entries,dt.__toJS=lt.toObject,dt.__toStringMapper=function(A,B){return JSON.stringify(B)+": "+ft(A)},ut(g,{toKeyedSeq:function(){return new NB(this,!1)},filter:function(A,B){return LB(this,yB(this,A,B,!1))},findIndex:function(A,B){var t=this.findEntry(A,B);return t?t[0]:-1},indexOf:function(A){var B=this.keyOf(A);return void 0===B?-1:B},lastIndexOf:function(A){var B=this.lastKeyOf(A);return void 0===B?-1:B},reverse:function(){return LB(this,RB(this,!1))},slice:function(A,B){return LB(this,JB(this,A,B,!1))},splice:function(A,B){var t=arguments.length;if(B=Math.max(0|B,0),0===t||2===t&&!B)return this;A=N(A,A<0?this.count():this.size);var e=this.slice(0,A);return LB(this,1===t?e:e.concat(D(arguments,2),this.slice(A+B)))},findLastIndex:function(A,B){var t=this.findLastEntry(A,B);return t?t[0]:-1},first:function(){return this.get(0)},flatten:function(A){return LB(this,jB(this,A,!1))},get:function(A,B){return(A=l(this,A))<0||this.size===1/0||void 0!==this.size&&A>this.size?B:this.find((function(B,t){return t===A}),void 0,B)},has:function(A){return(A=l(this,A))>=0&&(void 0!==this.size?this.size===1/0||A=A.costumes.length)&&(c.warn("currentCostume property for target ".concat(A.name," is out of range")),A.currentCostume=o.clamp(A.currentCostume,0,A.costumes.length-1)),t.currentCostume=A.currentCostume,t.costumes=A.costumes.map(f),t.sounds=A.sounds.map(H),A.hasOwnProperty("volume")&&(t.volume=A.volume),A.hasOwnProperty("layerOrder")&&(t.layerOrder=A.layerOrder),t.isStage?(A.hasOwnProperty("tempo")&&(t.tempo=A.tempo),A.hasOwnProperty("videoTransparency")&&(t.videoTransparency=A.videoTransparency),A.hasOwnProperty("videoState")&&(t.videoState=A.videoState),A.hasOwnProperty("textToSpeechLanguage")&&(t.textToSpeechLanguage=A.textToSpeechLanguage)):(t.visible=A.visible,t.x=A.x,t.y=A.y,t.size=A.size,t.direction=A.direction,t.draggable=A.draggable,t.rotationStyle=A.rotationStyle),e.forEach(A=>{B.add(A)}),t},R=function(A,B,t,e){if(!Array.isArray(A))return A;const g=Object.create(null),i=E();switch(g.id=i,g.next=null,g.parent=B,g.shadow=t,g.inputs=Object.create(null),A[0]){case 4:g.opcode="math_number",g.fields={NUM:{name:"NUM",value:A[1]}},g.topLevel=!1;break;case 5:g.opcode="math_positive_number",g.fields={NUM:{name:"NUM",value:A[1]}},g.topLevel=!1;break;case 6:g.opcode="math_whole_number",g.fields={NUM:{name:"NUM",value:A[1]}},g.topLevel=!1;break;case 7:g.opcode="math_integer",g.fields={NUM:{name:"NUM",value:A[1]}},g.topLevel=!1;break;case 8:g.opcode="math_angle",g.fields={NUM:{name:"NUM",value:A[1]}},g.topLevel=!1;break;case 9:g.opcode="colour_picker",g.fields={COLOUR:{name:"COLOUR",value:A[1]}},g.topLevel=!1;break;case 10:g.opcode="text",g.fields={TEXT:{name:"TEXT",value:A[1]}},g.topLevel=!1;break;case 11:g.opcode="event_broadcast_menu",g.fields={BROADCAST_OPTION:{name:"BROADCAST_OPTION",value:A[1],id:A[2],variableType:Q.BROADCAST_MESSAGE_TYPE}},g.topLevel=!1;break;case u:g.opcode="data_variable",g.fields={VARIABLE:{name:"VARIABLE",value:A[1],id:A[2],variableType:Q.SCALAR_TYPE}},A.length>3&&(g.topLevel=!0,g.x=A[3],g.y=A[4]);break;case l:g.opcode="data_listcontents",g.fields={LIST:{name:"LIST",value:A[1],id:A[2],variableType:Q.LIST_TYPE}},A.length>3&&(g.topLevel=!0,g.x=A[3],g.y=A[4]);break;default:return c.error("Found unknown primitive type during deserialization: ".concat(JSON.stringify(A))),null}return e[i]=g,i},y=function(A,B,t){const e={};for(const g in A){if(!F.call(A,g))continue;const i=A[g];if(!Array.isArray(i))continue;let Q=null,n=null;const s=i[0];1===s?Q=n=R(i[1],B,!0,t):2===s?Q=R(i[1],B,!1,t):(Q=R(i[1],B,!1,t),n=R(i[2],B,!0,t)),e[g]={name:g,block:Q,shadow:n}}return e},J=function(A){const B={};for(const t in A){if(!F.call(A,t))continue;const e=A[t];Array.isArray(e)&&(B[t]={name:t,value:e[0]},e.length>1&&(B[t].id=e[1]),"BROADCAST_OPTION"===t?B[t].variableType=Q.BROADCAST_MESSAGE_TYPE:"VARIABLE"===t?B[t].variableType=Q.SCALAR_TYPE:"LIST"===t&&(B[t].variableType=Q.LIST_TYPE))}return B},k=function(A){for(const B in A){if(!Object.prototype.hasOwnProperty.call(A,B))continue;const t=A[B];Array.isArray(t)?(delete A[B],R(t,null,!1,A)):(t.id=B,t.inputs=y(t.inputs,B,A),t.fields=J(t.fields))}return A};A.exports={serialize:function(A,B,{allowOptimization:t=!1}={}){const g=Object.create(null),i=new Set,Q=B?[A.getTargetById(B)]:A.targets.filter(A=>A.isOriginal),n=function(A){const B=A.map(A=>A.getLayerOrder());return o.reducedSortOrdering(B)}(Q),s=Q.map(A=>A.toJSON());A.renderer&&!B&&s.forEach((A,B)=>{A.layerOrder=n[B]});const r=s.map(A=>p(A,i));if(B)return r[0];g.targets=r,g.monitors=function(A,B){const t=(B.stageWidth-480)/2,e=(B.stageHeight-360)/2;return A.valueSeq().map(A=>{const B={id:A.id,mode:A.mode,opcode:A.opcode,params:A.params,spriteName:A.spriteName,value:Array.isArray(A.value)?[]:0,width:A.width,height:A.height,x:A.x-t,y:A.y-e,visible:A.visible};return"list"!==A.mode&&(B.sliderMin=A.sliderMin,B.sliderMax=A.sliderMax,B.isDiscrete=A.isDiscrete),B})}(A.getMonitorState(),A),g.extensions=Array.from(i);const c=Object.create(null);return c.semver="3.0.0",c.vm=e.version,A.origin&&(c.origin=A.origin),c.agent="none","undefined"!=typeof navigator&&(c.agent=navigator.userAgent),g.meta=c,t&&a(g),g},deserialize:function(A,B,t,e){const E={extensionIDs:new Set,extensionURLs:new Map};A.meta&&A.meta.origin?B.origin=A.meta.origin:B.origin=null;const a=((e?[A]:A.targets)||[]).map((A,B)=>Object.assign(A,{targetPaneOrder:B})).sort((A,B)=>A.layerOrder-B.layerOrder),F=A.monitors||[];return Promise.resolve(a.map(A=>function(A,B,t){if(!A.hasOwnProperty("name"))return Promise.resolve(null);const e={costumePromises:null,soundPromises:null,soundBank:B.audioEngine&&B.audioEngine.createBank()};return e.costumePromises=(A.costumes||[]).map(A=>{const e={asset:A.asset,assetId:A.assetId,skinId:null,name:A.name,bitmapResolution:A.bitmapResolution,rotationCenterX:A.rotationCenterX,rotationCenterY:A.rotationCenterY},g=A.dataFormat||A.assetType&&A.assetType.runtimeFormat||"png",i=A.hasOwnProperty("md5ext")?A.md5ext:"".concat(A.assetId,".").concat(g);return e.md5=i,e.dataFormat=g,Y(e,B,t).then(()=>I(i,e,B))}),e.soundPromises=(A.sounds||[]).map(A=>{const g={assetId:A.assetId,format:A.format,rate:A.rate,sampleCount:A.sampleCount,name:A.name,md5:A.md5ext,dataFormat:A.dataFormat,data:null};return M(g,B,t).then(()=>h(g,B,e.soundBank))}),e}(A,B,t))).then(A=>Promise.resolve(A)).then(A=>Promise.all(a.map((t,e)=>function(A,B,t,e,s){if(!A.hasOwnProperty("name"))return Promise.resolve(null);const c=new g(B),E=new i(c,B);if(A.hasOwnProperty("name")&&(E.name=A.name),A.hasOwnProperty("blocks")){k(A.blocks);for(const B in A.blocks){if(!A.blocks.hasOwnProperty(B))continue;const e=A.blocks[B];c.createBlock(e);const g=m(e.opcode);g&&t.extensionIDs.add(g)}}const{costumePromises:w}=s,{soundBank:C,soundPromises:a}=s,I=E.createClone(A.isStage?r.BACKGROUND_LAYER:r.SPRITE_LAYER);if(A.hasOwnProperty("tempo")&&(I.tempo=A.tempo),A.hasOwnProperty("volume")&&(I.volume=A.volume),A.hasOwnProperty("videoTransparency")&&(I.videoTransparency=A.videoTransparency),A.hasOwnProperty("videoState")&&(I.videoState=A.videoState),A.hasOwnProperty("textToSpeechLanguage")&&(I.textToSpeechLanguage=A.textToSpeechLanguage),A.hasOwnProperty("variables"))for(const t in A.variables){const e=A.variables[t],g=3===e.length&&e[2]&&A.isStage&&B.canAddCloudVariable(),i=new Q(t,e[0],Q.SCALAR_TYPE,g);g&&B.addCloudVariable(),i.value=e[1],I.variables[i.id]=i}if(A.hasOwnProperty("lists"))for(const B in A.lists){const t=A.lists[B],e=new Q(B,t[0],Q.LIST_TYPE,!1);e.value=t[1],I.variables[e.id]=e}if(A.hasOwnProperty("broadcasts"))for(const B in A.broadcasts){const t=A.broadcasts[B],e=new Q(B,t,Q.BROADCAST_MESSAGE_TYPE,!1);I.variables[e.id]=e}if(A.hasOwnProperty("comments"))for(const B in A.comments){const t=A.comments[B],e=new n(B,t.text,t.x,t.y,t.width,t.height,t.minimized);t.blockId&&(e.blockId=t.blockId),I.comments[e.id]=e}return A.hasOwnProperty("x")&&(I.x=A.x),A.hasOwnProperty("y")&&(I.y=A.y),A.hasOwnProperty("direction")&&(I.direction=A.direction),A.hasOwnProperty("size")&&(I.size=A.size),A.hasOwnProperty("visible")&&(I.visible=A.visible),A.hasOwnProperty("currentCostume")&&(I.currentCostume=o.clamp(A.currentCostume,0,A.costumes.length-1)),A.hasOwnProperty("rotationStyle")&&(I.rotationStyle=A.rotationStyle),A.hasOwnProperty("isStage")&&(I.isStage=A.isStage),A.hasOwnProperty("targetPaneOrder")&&(I.targetPaneOrder=A.targetPaneOrder),A.hasOwnProperty("draggable")&&(I.draggable=A.draggable),Promise.all(w).then(A=>{E.costumes=A}),Promise.all(a).then(A=>{E.sounds=A,E.soundBank=C||null}),Promise.all(w.concat(a)).then(()=>I)}(t,B,E,0,A[e])))).then(A=>A.map((A,B)=>(A.layerOrder=B,A)).sort((A,B)=>A.targetPaneOrder-B.targetPaneOrder).map(A=>(delete A.targetPaneOrder,A))).then(A=>function(A){const B=C.getAllVarRefsForTargets(A,!0);A.forEach(A=>{Object.keys(A.variables).forEach(B=>{const t=w.replaceUnsafeChars(B);t!==B&&(A.variables[B].id=t,A.variables[t]=A.variables[B],delete A.variables[B])})});for(const A in B){const t=w.replaceUnsafeChars(A);A!==t&&C.updateVariableIdentifiers(B[A],t)}return A}(A)).then(A=>(F.map(t=>function(A,B,t,e){const g=(B.stageWidth-480)/2,i=(B.stageHeight-360)/2;if(A.x+=g,A.y+=i,A.x=o.clamp(A.x,0,B.stageWidth),A.y=o.clamp(A.y,0,B.stageHeight),A.spriteName){const B=t.filter(B=>B.sprite.name===A.spriteName);B&&B.length>0?A.targetId=B[0].id:c.warn("Tried to deserialize sprite specific monitor ".concat(A.opcode," but could not find sprite ").concat(A.spriteName,"."))}const n=B.monitorBlockInfo[A.opcode];if("data_listcontents"===A.opcode){const B=A.targetId?t.find(B=>B.id===A.targetId):t.find(A=>A.isStage);B&&Object.prototype.hasOwnProperty.call(B.variables,A.id)&&(A.params.LIST=B.variables[A.id].name)}const r={};for(const B in A.params){const t={name:B,value:A.params[B]};r[B]=t}"data_variable"!==A.opcode&&"data_listcontents"!==A.opcode&&n&&n.isSpriteSpecific?A.id=n.getId(A.targetId,r):A.id=w.replaceUnsafeChars(A.id);const E=B.monitorBlocks._blocks[A.id];if(E)E.isMonitored=A.visible,E.targetId=A.targetId;else{const t={id:A.id,opcode:A.opcode,inputs:{},fields:r,topLevel:!0,next:null,parent:null,shadow:!1,x:0,y:0,isMonitored:A.visible,targetId:A.targetId};if("data_variable"===A.opcode){const B=t.fields.VARIABLE;B.id=A.id,B.variableType=Q.SCALAR_TYPE}else if("data_listcontents"===A.opcode){const B=t.fields.LIST;B.id=A.id,B.variableType=Q.LIST_TYPE}B.monitorBlocks.createBlock(t);const g=m(t.opcode);g&&e.extensionIDs.add(g)}B.requestAddMonitor(s(A))}(t,B,A,E)),A)).then(A=>({targets:A,extensions:E}))},deserializeBlocks:k,serializeBlocks:G,getExtensionIdForOpcode:m}},function(A,B,t){const e=t(11),g=t(14),i=t(46),Q=t(369);class n extends e{constructor(A){super(),this._id=A,this._rotationCenter=g.v3.create(0,0),this._texture=null,this._uniforms={u_skinSize:[0,0],u_skin:null},this._silhouette=new Q,this.setMaxListeners(i.SKIN_SHARE_SOFT_LIMIT)}dispose(){this._id=i.ID_NONE}get id(){return this._id}get rotationCenter(){return this._rotationCenter}get size(){return[0,0]}useNearest(A,B){return!0}calculateRotationCenter(){return[this.size[0]/2,this.size[1]/2]}getTexture(A){return this._emptyImageTexture}getFenceBounds(A,B){return A.getAABB(B)}getUniforms(A){return this._uniforms.u_skin=this.getTexture(A),this._uniforms.u_skinSize=this.size,this._uniforms}updateSilhouette(){}_setTexture(A){const B=this._renderer.gl;B.bindTexture(B.TEXTURE_2D,this._texture),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),B.texImage2D(B.TEXTURE_2D,0,B.RGBA,B.RGBA,B.UNSIGNED_BYTE,A),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),this._silhouette.update(A)}setEmptyImageData(){if(this._texture=null,!this._emptyImageData){this._emptyImageData=new ImageData(1,1);const A=this._renderer.gl,B={auto:!0,wrap:A.CLAMP_TO_EDGE,src:this._emptyImageData};this._emptyImageTexture=g.createTexture(A,B)}this._rotationCenter[0]=0,this._rotationCenter[1]=0,this._silhouette.update(this._emptyImageData),this.emit(n.Events.WasAltered)}isTouchingNearest(A){return this._silhouette.isTouchingNearest(A)}isTouchingLinear(A){return this._silhouette.isTouchingLinear(A)}}n.Events={WasAltered:"WasAltered"},A.exports=n},function(A,B,t){const e=t(14);class g{constructor(A){this._gl=A,this._shaderCache={};for(const A in g.DRAW_MODE)Object.prototype.hasOwnProperty.call(g.DRAW_MODE,A)&&(this._shaderCache[A]=[])}getShader(A,B){const t=this._shaderCache[A];A===g.DRAW_MODE.silhouette&&(B&=~(g.EFFECT_INFO.color.mask|g.EFFECT_INFO.brightness.mask));let e=t[B];return e||(e=t[B]=this._buildShader(A,B)),e}_buildShader(A,B){const i=g.EFFECTS.length,Q=["#define DRAW_MODE_".concat(A)];for(let A=0;AA/200%1,shapeChanges:!1},fisheye:{uniformName:"u_fisheye",mask:2,converter:A=>Math.max(0,(A+100)/100),shapeChanges:!0},whirl:{uniformName:"u_whirl",mask:4,converter:A=>-A*Math.PI/180,shapeChanges:!0},pixelate:{uniformName:"u_pixelate",mask:8,converter:A=>Math.abs(A)/10,shapeChanges:!0},mosaic:{uniformName:"u_mosaic",mask:16,converter:A=>(A=Math.round((Math.abs(A)+10)/10),Math.max(1,Math.min(A,512))),shapeChanges:!0},brightness:{uniformName:"u_brightness",mask:32,converter:A=>Math.max(-100,Math.min(A,100))/100,shapeChanges:!1},ghost:{uniformName:"u_ghost",mask:64,converter:A=>1-Math.max(0,Math.min(A,100))/100,shapeChanges:!1}},g.EFFECTS=Object.keys(g.EFFECT_INFO),g.DRAW_MODE={default:"default",straightAlpha:"straightAlpha",silhouette:"silhouette",colorMask:"colorMask",line:"line",background:"background"},A.exports=g},function(A,B,t){const e=t(393);A.exports=e},function(A,B,t){"use strict";(function(B){void 0===B||!B.version||0===B.version.indexOf("v0.")||0===B.version.indexOf("v1.")&&0!==B.version.indexOf("v1.8.")?A.exports={nextTick:function(A,t,e,g){if("function"!=typeof A)throw new TypeError('"callback" argument must be a function');var i,Q,n=arguments.length;switch(n){case 0:case 1:return B.nextTick(A);case 2:return B.nextTick((function(){A.call(null,t)}));case 3:return B.nextTick((function(){A.call(null,t,e)}));case 4:return B.nextTick((function(){A.call(null,t,e,g)}));default:for(i=new Array(n-1),Q=0;QA.play(this,B)};return Object.defineProperty(this,"audioPlayer",{configurable:!1,enumerable:!0,writable:!1,value:B}),B}initAudio(){}static get EVENT_TARGET_MOVED(){return"TARGET_MOVED"}static get EVENT_TARGET_VISUAL_CHANGE(){return"EVENT_TARGET_VISUAL_CHANGE"}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"}}setXY(A,B,t){if(this.isStage)return;if(this.dragging&&!t)return;const e=this.x,g=this.y;if(this.renderer){const t=this.runtime.runtimeOptions.fencing?this.renderer.getFencedPositionOfDrawable(this.drawableID,[A,B]):[A,B];this.x=t[0],this.y=t[1],this.renderer.updateDrawablePosition(this.drawableID,t),this.visible&&(this.emitFast(r.EVENT_TARGET_VISUAL_CHANGE,this),this.runtime.requestRedraw())}else this.x=A,this.y=B;this.emitFast(r.EVENT_TARGET_MOVED,this,e,g,t),this.runtime.requestTargetsUpdate(this)}_getRenderedDirectionAndScale(){let A=this.direction,B=[this.size,this.size];if(this.rotationStyle===r.ROTATION_STYLE_NONE)A=90;else if(this.rotationStyle===r.ROTATION_STYLE_LEFT_RIGHT){A=90;B=[(this.direction<0?-1:1)*this.size,this.size]}return{direction:A,scale:B}}setDirection(A){if(!this.isStage&&isFinite(A)){if(this.direction=e.wrapClamp(A,-179,180),this.renderer){const{direction:A,scale:B}=this._getRenderedDirectionAndScale();this.renderer.updateDrawableDirectionScale(this.drawableID,A,B),this.visible&&(this.emitFast(r.EVENT_TARGET_VISUAL_CHANGE,this),this.runtime.requestRedraw())}this.runtime.requestTargetsUpdate(this)}}setDraggable(A){this.isStage||(this.draggable=!!A,this.runtime.requestTargetsUpdate(this))}setVisible(A){this.isStage||(this.visible=!!A,this.renderer&&(this.renderer.updateDrawableVisible(this.drawableID,this.visible),this.visible&&(this.emitFast(r.EVENT_TARGET_VISUAL_CHANGE,this),this.runtime.requestRedraw())),this.runtime.requestTargetsUpdate(this))}setSize(A){if(!this.isStage){if(this.renderer){const B=this.renderer.getCurrentSkinSize(this.drawableID),t=B[0],g=B[1],i=this.runtime.runtimeOptions.fencing,Q=i?Math.min(1,Math.max(5/t,5/g)):0,n=i?Math.min(1.5*this.runtime.stageWidth/t,1.5*this.runtime.stageHeight/g):1/0;this.size=100*e.clamp(A/100,Q,n);const{direction:s,scale:c}=this._getRenderedDirectionAndScale();this.renderer.updateDrawableDirectionScale(this.drawableID,s,c),this.visible&&(this.emitFast(r.EVENT_TARGET_VISUAL_CHANGE,this),this.runtime.requestRedraw())}else this.size=A;this.runtime.requestTargetsUpdate(this)}}setEffect(A,B){this.effects.hasOwnProperty(A)&&(this.effects[A]=B,this.renderer&&(this.renderer.updateDrawableEffect(this.drawableID,A,B),this.visible&&(this.emitFast(r.EVENT_TARGET_VISUAL_CHANGE,this),this.runtime.requestRedraw())))}clearEffects(){for(const A in this.effects)this.effects.hasOwnProperty(A)&&(this.effects[A]=0);if(this.renderer){for(const A in this.effects)this.effects.hasOwnProperty(A)&&this.renderer.updateDrawableEffect(this.drawableID,A,0);this.visible&&(this.emitFast(r.EVENT_TARGET_VISUAL_CHANGE,this),this.runtime.requestRedraw())}}setCostume(A){if((A=Math.round(A))!==1/0&&A!==-1/0&&A||(A=0),this.currentCostume=e.wrapClamp(A,0,this.sprite.costumes.length-1),this.renderer){const A=this.getCostumes()[this.currentCostume];this.renderer.updateDrawableSkinId(this.drawableID,A.skinId),this.visible&&(this.emitFast(r.EVENT_TARGET_VISUAL_CHANGE,this),this.runtime.requestRedraw())}this.runtime.requestTargetsUpdate(this)}addCostume(A,B){"number"!=typeof B||isNaN(B)?this.sprite.addCostumeAt(A,this.sprite.costumes.length):this.sprite.addCostumeAt(A,B)}renameCostume(A,B){const t=this.sprite.costumes.filter((B,t)=>A!==t).map(A=>A.name),e=this.getCostumes()[A].name,i=g.unusedName(B,t);if(this.getCostumes()[A].name=i,this.isStage){const A=this.runtime.targets;for(let B=0;B=B)return null;const t=this.sprite.deleteCostumeAt(A);return A===this.currentCostume&&A===B-1?this.setCostume(A-1):AA.name);A.name=g.unusedName(A.name,t),"number"!=typeof B||isNaN(B)?this.sprite.sounds.push(A):this.sprite.sounds.splice(B,0,A)}renameSound(A,B){const t=this.sprite.sounds.filter((B,t)=>A!==t).map(A=>A.name),e=this.sprite.sounds[A].name,i=g.unusedName(B,t);this.sprite.sounds[A].name=i,this.blocks.updateAssetName(e,i,"sound")}deleteSound(A){if(A<0||A>=this.sprite.sounds.length)return null;const B=this.sprite.sounds.splice(A,1)[0];return this.runtime.requestTargetsUpdate(this),B}setRotationStyle(A){if(A===r.ROTATION_STYLE_NONE?this.rotationStyle=r.ROTATION_STYLE_NONE:A===r.ROTATION_STYLE_ALL_AROUND?this.rotationStyle=r.ROTATION_STYLE_ALL_AROUND:A===r.ROTATION_STYLE_LEFT_RIGHT&&(this.rotationStyle=r.ROTATION_STYLE_LEFT_RIGHT),this.renderer){const{direction:A,scale:B}=this._getRenderedDirectionAndScale();this.renderer.updateDrawableDirectionScale(this.drawableID,A,B),this.visible&&(this.emitFast(r.EVENT_TARGET_VISUAL_CHANGE,this),this.runtime.requestRedraw())}this.runtime.requestTargetsUpdate(this)}getCostumeIndexByName(A){const B=this.getCostumes();for(let t=0;tA/2||t.top>B/2||t.bottom<-B/2)return!0}return!1}isTouchingSprite(A){A=i.toString(A);const B=this.runtime.getSpriteTargetByName(A);if(!B||!this.renderer)return!1;const t=B.sprite.clones.filter(A=>!A.dragging).map(A=>A.drawableID);return this.renderer.isTouchingDrawables(this.drawableID,t)}isTouchingColor(A){return!!this.renderer&&this.renderer.isTouchingColor(this.drawableID,A)}colorIsTouchingColor(A,B){return!!this.renderer&&this.renderer.isTouchingColor(this.drawableID,A,B)}getLayerOrder(){return this.renderer?this.renderer.getDrawableOrder(this.drawableID):null}goToFront(){this.renderer&&this.renderer.setDrawableOrder(this.drawableID,1/0,s.SPRITE_LAYER),this.runtime.setExecutablePosition(this,1/0)}goToBack(){this.renderer&&this.renderer.setDrawableOrder(this.drawableID,-1/0,s.SPRITE_LAYER,!1),this.runtime.setExecutablePosition(this,-1/0)}goForwardLayers(A){this.renderer&&this.renderer.setDrawableOrder(this.drawableID,A,s.SPRITE_LAYER,!0),this.runtime.moveExecutable(this,A)}goBackwardLayers(A){this.renderer&&this.renderer.setDrawableOrder(this.drawableID,-A,s.SPRITE_LAYER,!0),this.runtime.moveExecutable(this,-A)}goBehindOther(A){if(this.renderer){const B=this.renderer.setDrawableOrder(A.drawableID,0,s.SPRITE_LAYER,!0);this.renderer.setDrawableOrder(this.drawableID,B,s.SPRITE_LAYER)}const B=this.runtime.executableTargets.indexOf(A);this.runtime.setExecutablePosition(this,B)}keepInFence(A,B,t){let e=t;e||(e={left:-this.runtime.stageWidth/2,right:this.runtime.stageWidth/2,top:this.runtime.stageHeight/2,bottom:-this.runtime.stageHeight/2});const g=this.getBounds();if(!g)return;g.left+=A-this.x,g.right+=A-this.x,g.top+=B-this.y,g.bottom+=B-this.y;let i=0,Q=0;return g.lefte.right&&(i+=e.right-g.right),g.top>e.top&&(Q+=e.top-g.top),g.bottom{const B=A.createClone();return B.x=400*(Math.random()-.5)/2,B.y=300*(Math.random()-.5)/2,B.direction=this.direction,B.draggable=this.draggable,B.visible=this.visible,B.size=this.size,B.currentCostume=this.currentCostume,B.rotationStyle=this.rotationStyle,B.effects=JSON.parse(JSON.stringify(this.effects)),B.variables=this.duplicateVariables(B.blocks),B.updateAllDrawableProperties(),B})}onGreenFlag(){this.clearEffects()}onStopAll(){this.clearEffects()}postSpriteInfo(A){const B=A.hasOwnProperty("force")?A.force:null,t=A.hasOwnProperty("x"),e=A.hasOwnProperty("y");(t||e)&&this.setXY(t?A.x:this.x,e?A.y:this.y,B),A.hasOwnProperty("direction")&&this.setDirection(A.direction),A.hasOwnProperty("draggable")&&this.setDraggable(A.draggable),A.hasOwnProperty("rotationStyle")&&this.setRotationStyle(A.rotationStyle),A.hasOwnProperty("visible")&&this.setVisible(A.visible),A.hasOwnProperty("size")&&this.setSize(A.size)}startDrag(){this.dragging=!0}stopDrag(){this.dragging=!1}toJSON(){const A=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:A[this.currentCostume],costumeCount:A.length,visible:this.visible,rotationStyle:this.rotationStyle,comments:this.comments,blocks:this.blocks._blocks,variables:this.variables,costumes:A,sounds:this.getSounds(),textToSpeechLanguage:this.textToSpeechLanguage,tempo:this.tempo,volume:this.volume,videoTransparency:this.videoTransparency,videoState:this.videoState}}dispose(){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?s.BACKGROUND_LAYER:s.SPRITE_LAYER),this.visible&&(this.emitFast(r.EVENT_TARGET_VISUAL_CHANGE,this),this.runtime.requestRedraw()))}}A.exports=r},function(A,B,t){const e=t(0);A.exports=function(A){if("string"!=typeof A){if(!Array.isArray(A))return e.error("Unexpected input recieved in replaceUnsafeChars"),A;A=String(A)}return A.replace(/[<>&'"]/g,A=>{switch(A){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case'"':return"""}})}},function(A,B,t){const e=t(115);A.exports=class extends e{constructor(A,B,t,e,g=null){super(),this._socket=A.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=e,this._connected=!1,this._characteristicDidChangeCallback=null,this._resetCallback=g,this._discoverTimeoutID=null,this._extensionId=B,this._peripheralOptions=t,this._runtime=A,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(A=>{this._handleRequestError(A)})}connectPeripheral(A){this.sendRemoteRequest("connect",{peripheralId:A}).then(()=>{this._connected=!0,this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED),this._connectCallback()}).catch(A=>{this._handleRequestError(A)})}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(A,B,t=null){const e={serviceId:A,characteristicId:B};return this._characteristicDidChangeCallback=t,this.sendRemoteRequest("startNotifications",e).catch(A=>{this.handleDisconnectError(A)})}read(A,B,t=!1,e=null){const g={serviceId:A,characteristicId:B};return t&&(g.startNotifications=!0),e&&(this._characteristicDidChangeCallback=e),this.sendRemoteRequest("read",g).catch(A=>{this.handleDisconnectError(A)})}write(A,B,t,e=null,g=null){const i={serviceId:A,characteristicId:B,message:t};return e&&(i.encoding=e),null!==g&&(i.withResponse=g),this.sendRemoteRequest("write",i).catch(A=>{this.handleDisconnectError(A)})}didReceiveCall(A,B){switch(A){case"didDiscoverPeripheral":this._availablePeripherals[B.peripheralId]=B,this._runtime.emit(this._runtime.constructor.PERIPHERAL_LIST_UPDATE,this._availablePeripherals),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID);break;case"userDidPickPeripheral":this._availablePeripherals[B.peripheralId]=B,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(B.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(A,B,t){const e=t(0),g=[];class i{constructor(A){this.isLoop=!1,this.warpMode=A,this.justReported=null,this.reporting="",this.reported=null,this.waitingReporter=null,this.params=null,this.executionContext=null}reset(){return this.isLoop=!1,this.warpMode=!1,this.justReported=null,this.reported=null,this.waitingReporter=null,this.params=null,this.executionContext=null,this}reuse(A=this.warpMode){return this.reset(),this.warpMode=Boolean(A),this}static create(A){const B=g.pop();return void 0!==B?(B.warpMode=Boolean(A),B):new i(A)}static release(A){void 0!==A&&g.push(A.reset())}}class Q{constructor(A){this.topBlock=A,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.warp=0,this.generator=null,this.procedures=null}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(A,B){return"".concat(A.id,"&").concat(B)}getId(){return Q.getIdFromTargetAndBlock(this.target,this.topBlock)}pushStack(A){if(this.stack.push(A),this.stack.length>this.stackFrames.length){const A=this.stackFrames[this.stackFrames.length-1];this.stackFrames.push(i.create(void 0!==A&&A.warpMode))}}reuseStackForNextBlock(A){this.stack[this.stack.length-1]=A,this.stackFrames[this.stackFrames.length-1].reuse()}popStack(){return i.release(this.stackFrames.pop()),this.stack.pop()}stopThisScript(){let A=this.peekStack();for(;null!==A;){const B=this.target.blocks.getBlock(A);if(void 0!==B&&"procedures_call"===B.opcode)break;this.popStack(),A=this.peekStack()}0===this.stack.length&&(this.requestScriptGlowInFrame=!1,this.status=Q.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(A){this.justReported=void 0===A?null:A}initParams(){const A=this.peekStackFrame();null===A.params&&(A.params={})}pushParam(A,B){this.peekStackFrame().params[A]=B}getParam(A){for(let B=this.stackFrames.length-1;B>=0;B--){const t=this.stackFrames[B];if(null!==t.params)return t.params.hasOwnProperty(A)?t.params[A]:null}return null}getAllparams(){return this.peekStackFrame().params}atStackTop(){return this.peekStack()===this.topBlock}goToNextBlock(){const A=this.target.blocks.getNextBlock(this.peekStack());this.reuseStackForNextBlock(A)}isRecursiveCall(A){let B=5;for(let t=this.stack.length-1-1;t>=0;t--){const e=this.target.blocks.getBlock(this.stack[t]);if("procedures_call"===e.opcode&&e.mutation.proccode===A)return!0;if(--B<0)return!1}return!1}tryCompile(){if(!this.blockContainer)return;const A=t(300);this.triedToCompile=!0;const B=this.topBlock,g=this.blockContainer.getBlock(B)?this.blockContainer:this.target.runtime.flyoutBlocks,i=g.getCachedCompileResult(B);if(i&&!i.success)return;let Q;if(i)Q=i.value;else try{Q=A(this),g.cacheCompileResult(B,Q)}catch(A){return e.error("cannot compile script",this.target.getName(),A),g.cacheCompileError(B,A),void this.target.runtime.emitCompileError(this.target,A)}this.procedures={};for(const A of Object.keys(Q.procedures))this.procedures[A]=Q.procedures[A](this);this.generator=Q.startingFunction(this)(),this.blockContainer.forceNoGlow||(this.blockGlowInFrame=this.topBlock,this.requestScriptGlowInFrame=!0),this.isCompiled=!0}}A.exports=Q},function(A,B,t){const e=t(12),g=t(0),{loadSvgString:i,serializeSvgToString:Q}=t(70),n=function(A,B,t,e){return new Promise(g=>{let n=A.asset.decodeText();if(e&&2===e){const t=Q(i(n,!0));if(n!==t){n=t;const e=B.storage;A.asset.encodeTextData(t,e.DataFormat.SVG,!0),A.assetId=A.asset.assetId,A.md5="".concat(A.assetId,".").concat(A.dataFormat)}}A.skinId=B.renderer.createSVGSkin(n,t),A.size=B.renderer.getSkinSize(A.skinId),t||(t=B.renderer.getSkinRotationCenter(A.skinId),A.rotationCenterX=t[0],A.rotationCenterY=t[1],A.bitmapResolution=1),g(A)})},s=new class{constructor(){this.pool=[],this.clearSoon=null}clear(){this.clearSoon||(this.clearSoon=new Promise(A=>setTimeout(A,1e3)).then(()=>{this.pool.length=0,this.clearSoon=null}))}create(){return this.pool.pop()||document.createElement("canvas")}release(A){this.clear(),this.pool.push(A)}},r=function(A,B,t){return function(A,B,t){return A&&A.asset?B.v2BitmapAdapter?Promise.all([A.asset,A.textLayerAsset].map(A=>A?"undefined"!=typeof createImageBitmap?createImageBitmap(new Blob([A.data],{type:A.assetType.contentType})):new Promise((B,t)=>{const e=new Image;e.onload=function(){B(e),e.onload=null,e.onerror=null},e.onerror=function(){t("Costume load failed. Asset could not be read."),e.onload=null,e.onerror=null},e.src=A.encodeDataURI()}):null)).then(([e,g])=>{const i=s.create(),Q=1===A.bitmapResolution?2:1;i.width=e.width,i.height=e.height;const n=i.getContext("2d");n.drawImage(e,0,0),g&&n.drawImage(g,0,0);let r=i;return 1!==Q&&(r=B.v2BitmapAdapter.resize(i,r.width*Q,r.height*Q)),t&&(t[0]=t[0]*Q,t[1]=t[1]*Q,A.rotationCenterX=t[0],A.rotationCenterY=t[1]),A.bitmapResolution=2,delete A.textLayerMD5,delete A.textLayerAsset,{canvas:r,mergeCanvas:i,rotationCenter:t,assetMatchesBase:1===Q&&!g}}).catch(()=>{delete A.textLayerMD5,delete A.textLayerAsset}):Promise.reject("No V2 Bitmap adapter present."):Promise.reject("Costume load failed. Assets were missing.")}(A,B,t).then(t=>(t.assetMatchesBase||function(t){if(!B.v2BitmapAdapter)return Promise.reject("No V2 Bitmap adapter present.");const e=B.storage;A.asset=e.createAsset(e.AssetType.ImageBitmap,e.DataFormat.PNG,B.v2BitmapAdapter.convertDataURIToBinary(t),null,!0),A.dataFormat=e.DataFormat.PNG,A.assetId=A.asset.assetId,A.md5="".concat(A.assetId,".").concat(A.dataFormat)}(t.canvas.toDataURL()),t)).then(({canvas:t,mergeCanvas:e,rotationCenter:g})=>{let i;g&&(i=[g[0]/2,g[1]/2]),A.skinId=B.renderer.createBitmapSkin(t,A.bitmapResolution,i),s.release(e);const Q=B.renderer.getSkinSize(A.skinId);return A.size=[2*Q[0],2*Q[1]],g||(g=B.renderer.getSkinRotationCenter(A.skinId),A.rotationCenterX=2*g[0],A.rotationCenterY=2*g[1],A.bitmapResolution=2),A})},c=function(A,B,t){A.assetId=A.asset.assetId;if(!B.renderer)return g.error("No rendering module present; cannot load costume: ",A.name),Promise.resolve(A);const e=B.storage.AssetType;let i;return"number"!=typeof A.rotationCenterX||isNaN(A.rotationCenterX)||"number"!=typeof A.rotationCenterY||isNaN(A.rotationCenterY)||(i=[A.rotationCenterX,A.rotationCenterY]),A.asset.assetType.runtimeFormat===e.ImageVector.runtimeFormat?n(A,B,i,t).catch(t=>(g.warn("Error loading vector image: ".concat(t.name,": ").concat(t.message)),A.assetId=B.storage.defaultAssetId.ImageVector,A.asset=B.storage.get(A.assetId),A.md5="".concat(A.assetId,".").concat(e.ImageVector.runtimeFormat),n(A,B))):r(A,B,i)};A.exports={loadCostume:function(A,B,t,i){const Q=e.splitFirst(A,"."),n=Q[0],s=Q[1].toLowerCase();if(B.dataFormat=s,B.asset)return c(B,t,i);if(!t.storage)return g.error("No storage module present; cannot load costume asset: ",A),Promise.resolve(B);if(!t.storage.defaultAssetId)return g.error("No default assets found"),Promise.resolve(B);const r=t.storage.AssetType,E="svg"===s?r.ImageVector:r.ImageBitmap,o=t.storage.load(E,n,s);if(!o)return void g.error("Couldn't fetch costume asset: ".concat(A));let w;return w=B.textLayerMD5?t.storage.load(r.ImageBitmap,B.textLayerMD5,"png"):Promise.resolve(null),Promise.all([o,w]).then(A=>(B.asset=A[0],A[1]&&(B.textLayerAsset=A[1]),c(B,t,i)))},loadCostumeFromAsset:c}},function(A,B,t){const e=t(12),g=t(0),i=function(A,B,t,e){return A.assetId=B.assetId,t.audioEngine?t.audioEngine.decodeSoundPlayer(Object.assign({},A,{data:B.data})).then(B=>{A.soundId=B.id;const t=B.buffer;return A.rate=t.sampleRate,A.sampleCount=t.length,null!==e&&e.addSoundPlayer(B),A}):(g.error("No audio engine present; cannot load sound asset: ",A.md5),Promise.resolve(A))};A.exports={loadSound:function(A,B,t){if(!B.storage)return g.error("No storage module present; cannot load sound asset: ",A.md5),Promise.resolve(A);const Q=e.splitFirst(A.md5,"."),n=Q[0],s=Q[1].toLowerCase();return A.dataFormat=s,(A.asset&&Promise.resolve(A.asset)||B.storage.load(B.storage.AssetType.Sound,n,s)).then(e=>(A.asset=e,i(A,e,B,t)))},loadSoundFromAsset:i}},function(A,B){A.exports={ID_NONE:-1,SKIN_SHARE_SOFT_LIMIT:1/0,Events:{UseHighQualityRenderChanged:"UseHighQualityRenderChanged",NativeSizeChanged:"NativeSizeChanged"}}},function(A,B,t){const e=t(25);e.enable(),A.exports=e("scratch-audioengine")},function(A,B,t){t(74),A.exports={TextEncoder:TextEncoder,TextDecoder:TextDecoder}},function(A,B,t){"use strict";function e(){if(!(this instanceof e))return new e;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var A=new e;for(var B in this)"function"!=typeof this[B]&&(A[B]=this[B]);return A}}e.prototype=t(155),e.prototype.loadAsync=t(203),e.support=t(15),e.defaults=t(88),e.version="3.1.5",e.loadAsync=function(A,B){return(new e).loadAsync(A,B)},e.external=t(29),A.exports=e},function(A,B,t){(B=A.exports=t(77)).Stream=B,B.Readable=B,B.Writable=t(52),B.Duplex=t(21),B.Transform=t(81),B.PassThrough=t(166)},function(A,B,t){var e=t(7),g=e.Buffer;function i(A,B){for(var t in A)B[t]=A[t]}function Q(A,B,t){return g(A,B,t)}g.from&&g.alloc&&g.allocUnsafe&&g.allocUnsafeSlow?A.exports=e:(i(e,B),B.Buffer=Q),i(g,Q),Q.from=function(A,B,t){if("number"==typeof A)throw new TypeError("Argument must not be a number");return g(A,B,t)},Q.alloc=function(A,B,t){if("number"!=typeof A)throw new TypeError("Argument must be a number");var e=g(A);return void 0!==B?"string"==typeof t?e.fill(B,t):e.fill(B):e.fill(0),e},Q.allocUnsafe=function(A){if("number"!=typeof A)throw new TypeError("Argument must be a number");return g(A)},Q.allocUnsafeSlow=function(A){if("number"!=typeof A)throw new TypeError("Argument must be a number");return e.SlowBuffer(A)}},function(A,B,t){"use strict";(function(B,e,g){var i=t(37);function Q(A){var B=this;this.next=null,this.entry=null,this.finish=function(){!function(A,B,t){var e=A.entry;A.entry=null;for(;e;){var g=e.callback;B.pendingcb--,g(t),e=e.next}B.corkedRequestsFree?B.corkedRequestsFree.next=A:B.corkedRequestsFree=A}(B,A)}}A.exports=Y;var n,s=!B.browser&&["v0.10","v0.9."].indexOf(B.version.slice(0,5))>-1?e:i.nextTick;Y.WritableState=h;var r=Object.create(t(28));r.inherits=t(24);var c={deprecate:t(164)},E=t(78),o=t(51).Buffer,w=g.Uint8Array||function(){};var C,a=t(79);function I(){}function h(A,B){n=n||t(21),A=A||{};var e=B instanceof n;this.objectMode=!!A.objectMode,e&&(this.objectMode=this.objectMode||!!A.writableObjectMode);var g=A.highWaterMark,r=A.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=g||0===g?g:e&&(r||0===r)?r:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var E=!1===A.decodeStrings;this.decodeStrings=!E,this.defaultEncoding=A.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(A){!function(A,B){var t=A._writableState,e=t.sync,g=t.writecb;if(function(A){A.writing=!1,A.writecb=null,A.length-=A.writelen,A.writelen=0}(t),B)!function(A,B,t,e,g){--B.pendingcb,t?(i.nextTick(g,e),i.nextTick(d,A,B),A._writableState.errorEmitted=!0,A.emit("error",e)):(g(e),A._writableState.errorEmitted=!0,A.emit("error",e),d(A,B))}(A,t,e,B,g);else{var Q=u(t);Q||t.corked||t.bufferProcessing||!t.bufferedRequest||D(A,t),e?s(F,A,t,Q,g):F(A,t,Q,g)}}(B,A)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Q(this)}function Y(A){if(n=n||t(21),!(C.call(Y,this)||this instanceof n))return new Y(A);this._writableState=new h(A,this),this.writable=!0,A&&("function"==typeof A.write&&(this._write=A.write),"function"==typeof A.writev&&(this._writev=A.writev),"function"==typeof A.destroy&&(this._destroy=A.destroy),"function"==typeof A.final&&(this._final=A.final)),E.call(this)}function M(A,B,t,e,g,i,Q){B.writelen=e,B.writecb=Q,B.writing=!0,B.sync=!0,t?A._writev(g,B.onwrite):A._write(g,i,B.onwrite),B.sync=!1}function F(A,B,t,e){t||function(A,B){0===B.length&&B.needDrain&&(B.needDrain=!1,A.emit("drain"))}(A,B),B.pendingcb--,e(),d(A,B)}function D(A,B){B.bufferProcessing=!0;var t=B.bufferedRequest;if(A._writev&&t&&t.next){var e=B.bufferedRequestCount,g=new Array(e),i=B.corkedRequestsFree;i.entry=t;for(var n=0,s=!0;t;)g[n]=t,t.isBuf||(s=!1),t=t.next,n+=1;g.allBuffers=s,M(A,B,!0,B.length,g,"",i.finish),B.pendingcb++,B.lastBufferedRequest=null,i.next?(B.corkedRequestsFree=i.next,i.next=null):B.corkedRequestsFree=new Q(B),B.bufferedRequestCount=0}else{for(;t;){var r=t.chunk,c=t.encoding,E=t.callback;if(M(A,B,!1,B.objectMode?1:r.length,r,c,E),t=t.next,B.bufferedRequestCount--,B.writing)break}null===t&&(B.lastBufferedRequest=null)}B.bufferedRequest=t,B.bufferProcessing=!1}function u(A){return A.ending&&0===A.length&&null===A.bufferedRequest&&!A.finished&&!A.writing}function l(A,B){A._final((function(t){B.pendingcb--,t&&A.emit("error",t),B.prefinished=!0,A.emit("prefinish"),d(A,B)}))}function d(A,B){var t=u(B);return t&&(!function(A,B){B.prefinished||B.finalCalled||("function"==typeof A._final?(B.pendingcb++,B.finalCalled=!0,i.nextTick(l,A,B)):(B.prefinished=!0,A.emit("prefinish")))}(A,B),0===B.pendingcb&&(B.finished=!0,A.emit("finish"))),t}r.inherits(Y,E),h.prototype.getBuffer=function(){for(var A=this.bufferedRequest,B=[];A;)B.push(A),A=A.next;return B},function(){try{Object.defineProperty(h.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(A){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(C=Function.prototype[Symbol.hasInstance],Object.defineProperty(Y,Symbol.hasInstance,{value:function(A){return!!C.call(this,A)||this===Y&&(A&&A._writableState instanceof h)}})):C=function(A){return A instanceof this},Y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Y.prototype.write=function(A,B,t){var e,g=this._writableState,Q=!1,n=!g.objectMode&&(e=A,o.isBuffer(e)||e instanceof w);return n&&!o.isBuffer(A)&&(A=function(A){return o.from(A)}(A)),"function"==typeof B&&(t=B,B=null),n?B="buffer":B||(B=g.defaultEncoding),"function"!=typeof t&&(t=I),g.ended?function(A,B){var t=new Error("write after end");A.emit("error",t),i.nextTick(B,t)}(this,t):(n||function(A,B,t,e){var g=!0,Q=!1;return null===t?Q=new TypeError("May not write null values to stream"):"string"==typeof t||void 0===t||B.objectMode||(Q=new TypeError("Invalid non-string/buffer chunk")),Q&&(A.emit("error",Q),i.nextTick(e,Q),g=!1),g}(this,g,A,t))&&(g.pendingcb++,Q=function(A,B,t,e,g,i){if(!t){var Q=function(A,B,t){A.objectMode||!1===A.decodeStrings||"string"!=typeof B||(B=o.from(B,t));return B}(B,e,g);e!==Q&&(t=!0,g="buffer",e=Q)}var n=B.objectMode?1:e.length;B.length+=n;var s=B.length-1))throw new TypeError("Unknown encoding: "+A);return this._writableState.defaultEncoding=A,this},Object.defineProperty(Y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Y.prototype._write=function(A,B,t){t(new Error("_write() is not implemented"))},Y.prototype._writev=null,Y.prototype.end=function(A,B,t){var e=this._writableState;"function"==typeof A?(t=A,A=null,B=null):"function"==typeof B&&(t=B,B=null),null!=A&&this.write(A,B),e.corked&&(e.corked=1,this.uncork()),e.ending||e.finished||function(A,B,t){B.ending=!0,d(A,B),t&&(B.finished?i.nextTick(t):A.once("finish",t));B.ended=!0,A.writable=!1}(this,e,t)},Object.defineProperty(Y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(A){this._writableState&&(this._writableState.destroyed=A)}}),Y.prototype.destroy=a.destroy,Y.prototype._undestroy=a.undestroy,Y.prototype._destroy=function(A,B){this.end(),B(A)}}).call(this,t(27),t(162).setImmediate,t(9))},function(A,B){A.exports=function(A){return"object"==typeof A?null!==A:"function"==typeof A}},function(A,B,t){A.exports=!t(85)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(A,B,t){"use strict";var e=t(29),g=t(89),i=t(90),Q=t(91);i=t(90);function n(A,B,t,e,g){this.compressedSize=A,this.uncompressedSize=B,this.crc32=t,this.compression=e,this.compressedContent=g}n.prototype={getContentWorker:function(){var A=new g(e.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new i("data_length")),B=this;return A.on("end",(function(){if(this.streamInfo.data_length!==B.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),A},getCompressedWorker:function(){return new g(e.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},n.createWorkerFrom=function(A,B,t){return A.pipe(new Q).pipe(new i("uncompressedSize")).pipe(B.compressWorker(t)).pipe(new i("compressedSize")).withStreamInfo("compression",B)},A.exports=n},function(A,B,t){"use strict";var e=t(2);var g=function(){for(var A,B=[],t=0;t<256;t++){A=t;for(var e=0;e<8;e++)A=1&A?3988292384^A>>>1:A>>>1;B[t]=A}return B}();A.exports=function(A,B){return void 0!==A&&A.length?"string"!==e.getTypeOf(A)?function(A,B,t,e){var i=g,Q=e+t;A^=-1;for(var n=e;n>>8^i[255&(A^B[n])];return-1^A}(0|B,A,A.length,0):function(A,B,t,e){var i=g,Q=e+t;A^=-1;for(var n=e;n>>8^i[255&(A^B.charCodeAt(n))];return-1^A}(0|B,A,A.length,0):0}},function(A,B,t){"use strict";A.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(A,B,t){const{Record:e}=t(31),g=e({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});A.exports=g},function(A,B){A.exports=function(A,B){let t="";for(const A in B){let e=B[A].value;"CURRENTMENU"===A&&(e=e.toLowerCase()),t+="_".concat(e)}return"".concat(A).concat(t)}},function(A,B,t){const e=t(10),g=t(41);class i{constructor(A,B,t,g,Q,n,s){this.id=A||e(),this.text=B,this.x=t,this.y=g,this.width=Math.max(Number(Q),i.MIN_WIDTH),this.height=Math.max(Number(n),i.MIN_HEIGHT),this.minimized=s||!1,this.blockId=null}toXML(){return'').concat(g(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}}A.exports=i},function(A,B,t){const e=t(20);A.exports=class{constructor(A){this._maxTokens=A,this._refillInterval=1e3/A,this._count=this._maxTokens,this._timer=new e,this._timer.start(),this._lastUpdateTime=this._timer.timeElapsed()}okayToSend(){const A=this._timer.timeElapsed(),B=A-this._lastUpdateTime,t=Math.floor(B/this._refillInterval);return t>0&&(this._lastUpdateTime=A),this._count=Math.min(this._maxTokens,this._count+t),this._count>0&&(this._count--,!0)}}},function(A,B){class t{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:t.xlink,xlink:t.xmlns,xmlns:"".concat(t.xmlns,"/"),"xmlns:xlink":"".concat(t.xmlns,"/")}}static create(A,B,e){return t.set(document.createElementNS(t.svg,A),B,e)}static get(A,B){const e=t.attributeNamespace[B],g=e?A.getAttributeNS(e,B):A.getAttribute(B);return"null"===g?null:g}static set(A,B,e){for(const g in B){let i=B[g];const Q=t.attributeNamespace[g];"number"==typeof i&&e&&(i=e.number(i)),Q?A.setAttributeNS(Q,g,i):A.setAttribute(g,i)}return A}}A.exports=t},function(A,B){class t{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:t.xlink,xlink:t.xmlns,xmlns:"".concat(t.xmlns,"/"),"xmlns:xlink":"".concat(t.xmlns,"/")}}static create(A,B,e){return t.set(document.createElementNS(t.svg,A),B,e)}static get(A,B){const e=t.attributeNamespace[B],g=e?A.getAttributeNS(e,B):A.getAttribute(B);return"null"===g?null:g}static set(A,B,e){for(const g in B){let i=B[g];const Q=t.attributeNamespace[g];"number"==typeof i&&e&&(i=e.number(i)),Q?A.setAttributeNS(Q,g,i):A.setAttribute(g,i)}return A}}A.exports=t},function(A,B,t){const e=t(25);e.enable(),A.exports=e("storage")},function(A,B,t){let e,g;if("undefined"==typeof TextDecoder||"undefined"==typeof TextEncoder){const A=t(74);e=A.TextDecoder,g=A.TextEncoder}else e=TextDecoder,g=TextEncoder;const i=t(26),Q=function(){let A=null;const B={};return(e,g)=>{if(!Object.prototype.hasOwnProperty.call(B,e))if("undefined"==typeof btoa){const A=t(395);B[e]=A.fromByteArray(g)}else{if(null===A){A=new Array(256);for(let B=0;B<256;B++)A[B]=String.fromCharCode(B)}const{length:t}=g;let i="";for(let B=0,e=0;B{if(A)return A===this||B(A.target)};if(B(A))throw new Error("Effect cannot connect to itself");this.target=A,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('+r+');\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}\n.sc-monitor-value {\n min-width: 40px;\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[opcode^="motion_"] .sc-monitor-value-color {\n background-color: #4c97ff;\n}\n.sc-monitor-root[opcode^="sensing_"] .sc-monitor-value-color {\n background-color: #5cb1d6;\n}\n.sc-monitor-root[opcode^="data_"] .sc-monitor-value-color {\n background-color: #ff8c1a;\n}\n.sc-monitor-root[opcode^="looks_"] .sc-monitor-value-color {\n background-color: #9966ff;\n}\n.sc-monitor-root[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: rgb(252, 102, 44);\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: rgb(226, 92, 40);\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',""]),s.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"},B.a=s},function(A,B,t){"use strict";(function(A){!function(A){function B(){}function t(){}var e=String.fromCharCode,g={}.toString,i=g.call(A.SharedArrayBuffer),Q=g(),n=A.Uint8Array,s=n||Array,r=n?ArrayBuffer:s,c=r.isView||function(A){return A&&"length"in A},E=g.call(r.prototype);r=t.prototype;var o=A.TextEncoder,w=new(n?Uint16Array:s)(32);B.prototype.decode=function(A){if(!c(A)){var B=g.call(A);if(B!==E&&B!==i&&B!==Q)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");A=n?new s(A):A||[]}for(var t,r,o,C=B="",a=0,I=0|A.length,h=I-32|0,Y=0,M=0,F=0,D=-1;a>4){case 15:if(2!=(o=255&A[a=a+1|0])>>6||247>6?M+4|0:24,r=r+256&768;case 13:case 12:Y<<=6,Y|=(31&r)<<6|63&(o=255&A[a=a+1|0]),M=M+7|0,a>6&&Y>>M&&1114112>Y?(r=Y,0<=(Y=Y-65536|0)&&(D=55296+(Y>>10)|0,r=56320+(1023&Y)|0,31>F?(w[F]=D,F=F+1|0,D=-1):(o=D,D=r,r=o))):(a=a-(r>>=8)-1|0,r=65533),Y=M=0,t=a<=h?32:I-a|0;default:w[F]=r;continue;case 11:case 10:case 9:case 8:}w[F]=65533}if(C+=e(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],w[8],w[9],w[10],w[11],w[12],w[13],w[14],w[15],w[16],w[17],w[18],w[19],w[20],w[21],w[22],w[23],w[24],w[25],w[26],w[27],w[28],w[29],w[30],w[31]),32>F&&(C=C.slice(0,F-32|0)),a>>31,D=-1,C.length=Q)e[g]=Q;else{if(2047>=Q)e[g]=192|Q>>6;else{A:{if(55296<=Q)if(56319>=Q){var r=0|A.charCodeAt(B=B+1|0);if(56320<=r&&57343>=r){if(65535<(Q=(Q<<10)+r-56613888|0)){e[g]=240|Q>>18,e[g=g+1|0]=128|Q>>12&63,e[g=g+1|0]=128|Q>>6&63,e[g=g+1|0]=128|63&Q;continue}break A}Q=65533}else 57343>=Q&&(Q=65533);!i&&B<<1>12,e[g=g+1|0]=128|Q>>6&63}e[g=g+1|0]=128|63&Q}}return n?e.subarray(0,g):e.slice(0,g)},o||(A.TextDecoder=B,A.TextEncoder=t)}(""+void 0==typeof A?""+void 0==typeof self?this:self:A)}).call(this,t(9))},function(A,B){var t={}.toString;A.exports=Array.isArray||function(A){return"[object Array]"==t.call(A)}},function(A,B,t){A.exports=t(158)},function(A,B,t){"use strict";(function(B,e){var g=t(37);A.exports=M;var i,Q=t(75);M.ReadableState=Y;t(11).EventEmitter;var n=function(A,B){return A.listeners(B).length},s=t(78),r=t(51).Buffer,c=B.Uint8Array||function(){};var E=Object.create(t(28));E.inherits=t(24);var o=t(159),w=void 0;w=o&&o.debuglog?o.debuglog("stream"):function(){};var C,a=t(160),I=t(79);E.inherits(M,s);var h=["error","close","destroy","pause","resume"];function Y(A,B){A=A||{};var e=B instanceof(i=i||t(21));this.objectMode=!!A.objectMode,e&&(this.objectMode=this.objectMode||!!A.readableObjectMode);var g=A.highWaterMark,Q=A.readableHighWaterMark,n=this.objectMode?16:16384;this.highWaterMark=g||0===g?g:e&&(Q||0===Q)?Q:n,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new a,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=A.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,A.encoding&&(C||(C=t(80).StringDecoder),this.decoder=new C(A.encoding),this.encoding=A.encoding)}function M(A){if(i=i||t(21),!(this instanceof M))return new M(A);this._readableState=new Y(A,this),this.readable=!0,A&&("function"==typeof A.read&&(this._read=A.read),"function"==typeof A.destroy&&(this._destroy=A.destroy)),s.call(this)}function F(A,B,t,e,g){var i,Q=A._readableState;null===B?(Q.reading=!1,function(A,B){if(B.ended)return;if(B.decoder){var t=B.decoder.end();t&&t.length&&(B.buffer.push(t),B.length+=B.objectMode?1:t.length)}B.ended=!0,l(A)}(A,Q)):(g||(i=function(A,B){var t;e=B,r.isBuffer(e)||e instanceof c||"string"==typeof B||void 0===B||A.objectMode||(t=new TypeError("Invalid non-string/buffer chunk"));var e;return t}(Q,B)),i?A.emit("error",i):Q.objectMode||B&&B.length>0?("string"==typeof B||Q.objectMode||Object.getPrototypeOf(B)===r.prototype||(B=function(A){return r.from(A)}(B)),e?Q.endEmitted?A.emit("error",new Error("stream.unshift() after end event")):D(A,Q,B,!0):Q.ended?A.emit("error",new Error("stream.push() after EOF")):(Q.reading=!1,Q.decoder&&!t?(B=Q.decoder.write(B),Q.objectMode||0!==B.length?D(A,Q,B,!1):U(A,Q)):D(A,Q,B,!1))):e||(Q.reading=!1));return function(A){return!A.ended&&(A.needReadable||A.lengthB.highWaterMark&&(B.highWaterMark=function(A){return A>=8388608?A=8388608:(A--,A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A++),A}(A)),A<=B.length?A:B.ended?B.length:(B.needReadable=!0,0))}function l(A){var B=A._readableState;B.needReadable=!1,B.emittedReadable||(w("emitReadable",B.flowing),B.emittedReadable=!0,B.sync?g.nextTick(d,A):d(A))}function d(A){w("emit readable"),A.emit("readable"),f(A)}function U(A,B){B.readingMore||(B.readingMore=!0,g.nextTick(N,A,B))}function N(A,B){for(var t=B.length;!B.reading&&!B.flowing&&!B.ended&&B.length=B.length?(t=B.decoder?B.buffer.join(""):1===B.buffer.length?B.buffer.head.data:B.buffer.concat(B.length),B.buffer.clear()):t=function(A,B,t){var e;Ai.length?i.length:A;if(Q===i.length?g+=i:g+=i.slice(0,A),0===(A-=Q)){Q===i.length?(++e,t.next?B.head=t.next:B.head=B.tail=null):(B.head=t,t.data=i.slice(Q));break}++e}return B.length-=e,g}(A,B):function(A,B){var t=r.allocUnsafe(A),e=B.head,g=1;e.data.copy(t),A-=e.data.length;for(;e=e.next;){var i=e.data,Q=A>i.length?i.length:A;if(i.copy(t,t.length-A,0,Q),0===(A-=Q)){Q===i.length?(++g,e.next?B.head=e.next:B.head=B.tail=null):(B.head=e,e.data=i.slice(Q));break}++g}return B.length-=g,t}(A,B);return e}(A,B.buffer,B.decoder),t);var t}function p(A){var B=A._readableState;if(B.length>0)throw new Error('"endReadable()" called on non-empty stream');B.endEmitted||(B.ended=!0,g.nextTick(R,B,A))}function R(A,B){A.endEmitted||0!==A.length||(A.endEmitted=!0,B.readable=!1,B.emit("end"))}function y(A,B){for(var t=0,e=A.length;t=B.highWaterMark||B.ended))return w("read: emitReadable",B.length,B.ended),0===B.length&&B.ended?p(this):l(this),null;if(0===(A=u(A,B))&&B.ended)return 0===B.length&&p(this),null;var e,g=B.needReadable;return w("need readable",g),(0===B.length||B.length-A0?H(A,B):null)?(B.needReadable=!0,A=0):B.length-=A,0===B.length&&(B.ended||(B.needReadable=!0),t!==A&&B.ended&&p(this)),null!==e&&this.emit("data",e),e},M.prototype._read=function(A){this.emit("error",new Error("_read() is not implemented"))},M.prototype.pipe=function(A,B){var t=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=A;break;case 1:i.pipes=[i.pipes,A];break;default:i.pipes.push(A)}i.pipesCount+=1,w("pipe count=%d opts=%j",i.pipesCount,B);var s=(!B||!1!==B.end)&&A!==e.stdout&&A!==e.stderr?c:M;function r(B,e){w("onunpipe"),B===t&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,w("cleanup"),A.removeListener("close",h),A.removeListener("finish",Y),A.removeListener("drain",E),A.removeListener("error",I),A.removeListener("unpipe",r),t.removeListener("end",c),t.removeListener("end",M),t.removeListener("data",a),o=!0,!i.awaitDrain||A._writableState&&!A._writableState.needDrain||E())}function c(){w("onend"),A.end()}i.endEmitted?g.nextTick(s):t.once("end",s),A.on("unpipe",r);var E=function(A){return function(){var B=A._readableState;w("pipeOnDrain",B.awaitDrain),B.awaitDrain&&B.awaitDrain--,0===B.awaitDrain&&n(A,"data")&&(B.flowing=!0,f(A))}}(t);A.on("drain",E);var o=!1;var C=!1;function a(B){w("ondata"),C=!1,!1!==A.write(B)||C||((1===i.pipesCount&&i.pipes===A||i.pipesCount>1&&-1!==y(i.pipes,A))&&!o&&(w("false write response, pause",t._readableState.awaitDrain),t._readableState.awaitDrain++,C=!0),t.pause())}function I(B){w("onerror",B),M(),A.removeListener("error",I),0===n(A,"error")&&A.emit("error",B)}function h(){A.removeListener("finish",Y),M()}function Y(){w("onfinish"),A.removeListener("close",h),M()}function M(){w("unpipe"),t.unpipe(A)}return t.on("data",a),function(A,B,t){if("function"==typeof A.prependListener)return A.prependListener(B,t);A._events&&A._events[B]?Q(A._events[B])?A._events[B].unshift(t):A._events[B]=[t,A._events[B]]:A.on(B,t)}(A,"error",I),A.once("close",h),A.once("finish",Y),A.emit("pipe",t),i.flowing||(w("pipe resume"),t.resume()),A},M.prototype.unpipe=function(A){var B=this._readableState,t={hasUnpiped:!1};if(0===B.pipesCount)return this;if(1===B.pipesCount)return A&&A!==B.pipes||(A||(A=B.pipes),B.pipes=null,B.pipesCount=0,B.flowing=!1,A&&A.emit("unpipe",this,t)),this;if(!A){var e=B.pipes,g=B.pipesCount;B.pipes=null,B.pipesCount=0,B.flowing=!1;for(var i=0;i>5==6?2:A>>4==14?3:A>>3==30?4:A>>6==2?-1:-2}function n(A){var B=this.lastTotal-this.lastNeed,t=function(A,B,t){if(128!=(192&B[0]))return A.lastNeed=0,"�";if(A.lastNeed>1&&B.length>1){if(128!=(192&B[1]))return A.lastNeed=1,"�";if(A.lastNeed>2&&B.length>2&&128!=(192&B[2]))return A.lastNeed=2,"�"}}(this,A);return void 0!==t?t:this.lastNeed<=A.length?(A.copy(this.lastChar,B,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(A.copy(this.lastChar,B,0,A.length),void(this.lastNeed-=A.length))}function s(A,B){if((A.length-B)%2==0){var t=A.toString("utf16le",B);if(t){var e=t.charCodeAt(t.length-1);if(e>=55296&&e<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=A[A.length-1],A.toString("utf16le",B,A.length-1)}function r(A){var B=A&&A.length?this.write(A):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return B+this.lastChar.toString("utf16le",0,t)}return B}function c(A,B){var t=(A.length-B)%3;return 0===t?A.toString("base64",B):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=A[A.length-1]:(this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1]),A.toString("base64",B,A.length-t))}function E(A){var B=A&&A.length?this.write(A):"";return this.lastNeed?B+this.lastChar.toString("base64",0,3-this.lastNeed):B}function o(A){return A.toString(this.encoding)}function w(A){return A&&A.length?this.write(A):""}B.StringDecoder=i,i.prototype.write=function(A){if(0===A.length)return"";var B,t;if(this.lastNeed){if(void 0===(B=this.fillLast(A)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t=0)return g>0&&(A.lastNeed=g-1),g;if(--e=0)return g>0&&(A.lastNeed=g-2),g;if(--e=0)return g>0&&(2===g?g=0:A.lastNeed=g-3),g;return 0}(this,A,B);if(!this.lastNeed)return A.toString("utf8",B);this.lastTotal=t;var e=A.length-(t-this.lastNeed);return A.copy(this.lastChar,0,e),A.toString("utf8",B,e)},i.prototype.fillLast=function(A){if(this.lastNeed<=A.length)return A.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,this.lastTotal-this.lastNeed,0,A.length),this.lastNeed-=A.length}},function(A,B,t){"use strict";A.exports=Q;var e=t(21),g=Object.create(t(28));function i(A,B){var t=this._transformState;t.transforming=!1;var e=t.writecb;if(!e)return this.emit("error",new Error("write callback called multiple times"));t.writechunk=null,t.writecb=null,null!=B&&this.push(B),e(A);var g=this._readableState;g.reading=!1,(g.needReadable||g.length>2,n=(3&B)<<4|t>>4,s=w>1?(15&t)<<2|g>>6:64,r=w>2?63&g:64,c.push(i.charAt(Q)+i.charAt(n)+i.charAt(s)+i.charAt(r));return c.join("")},B.decode=function(A){var B,t,e,Q,n,s,r=0,c=0;if("data:"===A.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var E,o=3*(A=A.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(A.charAt(A.length-1)===i.charAt(64)&&o--,A.charAt(A.length-2)===i.charAt(64)&&o--,o%1!=0)throw new Error("Invalid base64 input, bad content length.");for(E=g.uint8array?new Uint8Array(0|o):new Array(0|o);r>4,t=(15&Q)<<4|(n=i.indexOf(A.charAt(r++)))>>2,e=(3&n)<<6|(s=i.indexOf(A.charAt(r++))),E[c++]=B,64!==n&&(E[c++]=t),64!==s&&(E[c++]=e);return E}},function(A,B){var t=A.exports={version:"2.3.0"};"number"==typeof __e&&(__e=t)},function(A,B,t){var e=t(174);A.exports=function(A,B,t){if(e(A),void 0===B)return A;switch(t){case 1:return function(t){return A.call(B,t)};case 2:return function(t,e){return A.call(B,t,e)};case 3:return function(t,e,g){return A.call(B,t,e,g)}}return function(){return A.apply(B,arguments)}}},function(A,B){A.exports=function(A){try{return!!A()}catch(A){return!0}}},function(A,B,t){var e=t(53),g=t(39).document,i=e(g)&&e(g.createElement);A.exports=function(A){return i?g.createElement(A):{}}},function(A,B,t){"use strict";(function(B){var e=t(2),g=t(187),i=t(8),Q=t(82),n=t(15),s=t(29),r=null;if(n.nodestream)try{r=t(188)}catch(A){}function c(A,t){return new s.Promise((function(g,i){var n=[],s=A._internalType,r=A._outputType,c=A._mimeType;A.on("data",(function(A,B){n.push(A),t&&t(B)})).on("error",(function(A){n=[],i(A)})).on("end",(function(){try{var A=function(A,B,t){switch(A){case"blob":return e.newBlob(e.transformTo("arraybuffer",B),t);case"base64":return Q.encode(B);default:return e.transformTo(A,B)}}(r,function(A,t){var e,g=0,i=null,Q=0;for(e=0;e=this.max)return this.end();switch(this.type){case"string":A=this.data.substring(this.index,B);break;case"uint8array":A=this.data.subarray(this.index,B);break;case"array":case"nodebuffer":A=this.data.slice(this.index,B)}return this.index=B,this.push({data:A,meta:{percent:this.max?this.index/this.max*100:0}})},A.exports=i},function(A,B,t){"use strict";var e=t(2),g=t(8);function i(A){g.call(this,"DataLengthProbe for "+A),this.propName=A,this.withStreamInfo(A,0)}e.inherits(i,g),i.prototype.processChunk=function(A){if(A){var B=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=B+A.data.length}g.prototype.processChunk.call(this,A)},A.exports=i},function(A,B,t){"use strict";var e=t(8),g=t(56);function i(){e.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t(2).inherits(i,e),i.prototype.processChunk=function(A){this.streamInfo.crc32=g(A.data,this.streamInfo.crc32||0),this.push(A)},A.exports=i},function(A,B,t){"use strict";var e=t(8);B.STORE={magic:"\0\0",compressWorker:function(A){return new e("STORE compression")},uncompressWorker:function(){return new e("STORE decompression")}},B.DEFLATE=t(191)},function(A,B,t){"use strict";A.exports=function(A,B,t,e){for(var g=65535&A|0,i=A>>>16&65535|0,Q=0;0!==t;){t-=Q=t>2e3?2e3:t;do{i=i+(g=g+B[e++]|0)|0}while(--Q);g%=65521,i%=65521}return g|i<<16|0}},function(A,B,t){"use strict";var e=function(){for(var A,B=[],t=0;t<256;t++){A=t;for(var e=0;e<8;e++)A=1&A?3988292384^A>>>1:A>>>1;B[t]=A}return B}();A.exports=function(A,B,t,g){var i=e,Q=g+t;A^=-1;for(var n=g;n>>8^i[255&(A^B[n])];return-1^A}},function(A,B,t){"use strict";var e=t(16),g=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(A){g=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(A){i=!1}for(var Q=new e.Buf8(256),n=0;n<256;n++)Q[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;function s(A,B){if(B<65534&&(A.subarray&&i||!A.subarray&&g))return String.fromCharCode.apply(null,e.shrinkBuf(A,B));for(var t="",Q=0;Q>>6,B[Q++]=128|63&t):t<65536?(B[Q++]=224|t>>>12,B[Q++]=128|t>>>6&63,B[Q++]=128|63&t):(B[Q++]=240|t>>>18,B[Q++]=128|t>>>12&63,B[Q++]=128|t>>>6&63,B[Q++]=128|63&t);return B},B.buf2binstring=function(A){return s(A,A.length)},B.binstring2buf=function(A){for(var B=new e.Buf8(A.length),t=0,g=B.length;t4)r[e++]=65533,t+=i-1;else{for(g&=2===i?31:3===i?15:7;i>1&&t1?r[e++]=65533:g<65536?r[e++]=g:(g-=65536,r[e++]=55296|g>>10&1023,r[e++]=56320|1023&g)}return s(r,e)},B.utf8border=function(A,B){var t;for((B=B||A.length)>A.length&&(B=A.length),t=B-1;t>=0&&128==(192&A[t]);)t--;return t<0||0===t?B:t+Q[A[t]]>B?t:B}},function(A,B,t){"use strict";A.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}},function(A,B,t){"use strict";A.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(A,B,t){"use strict";B.LOCAL_FILE_HEADER="PK",B.CENTRAL_FILE_HEADER="PK",B.CENTRAL_DIRECTORY_END="PK",B.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",B.ZIP64_CENTRAL_DIRECTORY_END="PK",B.DATA_DESCRIPTOR="PK\b"},function(A,B,t){"use strict";var e=t(2),g=t(15),i=t(100),Q=t(205),n=t(206),s=t(102);A.exports=function(A){var B=e.getTypeOf(A);return e.checkSupport(B),"string"!==B||g.uint8array?"nodebuffer"===B?new n(A):g.uint8array?new s(e.transformTo("uint8array",A)):new i(e.transformTo("array",A)):new Q(A)}},function(A,B,t){"use strict";var e=t(101);function g(A){e.call(this,A);for(var B=0;B=0;--i)if(this.data[i]===B&&this.data[i+1]===t&&this.data[i+2]===e&&this.data[i+3]===g)return i-this.zero;return-1},g.prototype.readAndCheckSignature=function(A){var B=A.charCodeAt(0),t=A.charCodeAt(1),e=A.charCodeAt(2),g=A.charCodeAt(3),i=this.readData(4);return B===i[0]&&t===i[1]&&e===i[2]&&g===i[3]},g.prototype.readData=function(A){if(this.checkOffset(A),0===A)return[];var B=this.data.slice(this.zero+this.index,this.zero+this.index+A);return this.index+=A,B},A.exports=g},function(A,B,t){"use strict";var e=t(2);function g(A){this.data=A,this.length=A.length,this.index=0,this.zero=0}g.prototype={checkOffset:function(A){this.checkIndex(this.index+A)},checkIndex:function(A){if(this.length=this.index;B--)t=(t<<8)+this.byteAt(B);return this.index+=A,t},readString:function(A){return e.transformTo("string",this.readData(A))},readData:function(A){},lastIndexOfSignature:function(A){},readAndCheckSignature:function(A){},readDate:function(){var A=this.readInt(4);return new Date(Date.UTC(1980+(A>>25&127),(A>>21&15)-1,A>>16&31,A>>11&31,A>>5&63,(31&A)<<1))}},A.exports=g},function(A,B,t){"use strict";var e=t(100);function g(A){e.call(this,A)}t(2).inherits(g,e),g.prototype.readData=function(A){if(this.checkOffset(A),0===A)return new Uint8Array(0);var B=this.data.subarray(this.zero+this.index,this.zero+this.index+A);return this.index+=A,B},A.exports=g},function(A,B,t){const e=t(208),g=t(0);A.exports=new class extends e{constructor(){super(),this.services={},this.workerClass="undefined"==typeof Worker?null:Worker,this.workers=[]}callSync(A,B,...t){const{provider:e,isRemote:g}=this._getServiceProvider(A);if(e){if(g)throw new Error("Cannot use 'callSync' on remote provider for service ".concat(A,"."));return e[B].apply(e,t)}throw new Error("Provider not found for service: ".concat(A))}setServiceSync(A,B){this.services.hasOwnProperty(A)&&g.warn("Central dispatch replacing existing service provider for ".concat(A)),this.services[A]=B}setService(A,B){try{return this.setServiceSync(A,B),Promise.resolve()}catch(A){return Promise.reject(A)}}addWorker(A){-1===this.workers.indexOf(A)?(this.workers.push(A),A.onmessage=this._onMessage.bind(this,A),this._remoteCall(A,"dispatch","handshake").catch(A=>{g.error("Could not handshake with worker: ".concat(A))})):g.warn("Central dispatch ignoring attempt to add duplicate worker")}_getServiceProvider(A){const B=this.services[A];return B&&{provider:B,isRemote:Boolean(this.workerClass&&B instanceof this.workerClass||B.isRemote)}}_onDispatchMessage(A,B){let t;switch(B.method){case"setService":t=this.setService(B.args[0],A);break;default:g.error("Central dispatch received message for unknown method: ".concat(B.method))}return t}}},function(A,B){var t={black:"#000",red:"#c23621",green:"#25bc26",yellow:"#bbbb00",blue:"#492ee1",magenta:"#d338d3",cyan:"#33bbc8",gray:"#808080",purple:"#708"};A.exports=function(A,B){return B?"color: #fff; background: "+t[A]+";":"color: "+t[A]+";"}},function(A,B,t){const e=t(5);A.exports=function(A,B,t){return A&&A.id&&A.default?e(A,B,t):A}},function(A,B){var t="long",e="short",g="numeric";A.exports={number:{decimal:{style:"decimal"},integer:{style:"decimal",maximumFractionDigits:0},currency:{style:"currency",currency:"USD"},percent:{style:"percent"},default:{style:"decimal"}},date:{short:{month:g,day:g,year:"2-digit"},medium:{month:e,day:g,year:g},long:{month:t,day:g,year:g},full:{month:t,day:g,year:g,weekday:t},default:{month:e,day:g,year:g}},time:{short:{hour:g,minute:g},medium:{hour:g,minute:g,second:g},long:{hour:g,minute:g,second:g,timeZoneName:e},full:{hour:g,minute:g,second:g,timeZoneName:e},default:{hour:g,minute:g,second:g}},duration:{default:{hours:{minimumIntegerDigits:1,maximumFractionDigits:0},minutes:{minimumIntegerDigits:2,maximumFractionDigits:0},seconds:{minimumIntegerDigits:2,maximumFractionDigits:3}}},parseNumberPattern:function(A){if(A){var B={},t=A.match(/\b[A-Z]{3}\b/i),e=A.replace(/[^¤]/g,"").length;if(!e&&t&&(e=1),e?(B.style="currency",B.currencyDisplay=1===e?"symbol":2===e?"code":"name",B.currency=t?t[0].toUpperCase():"USD"):A.indexOf("%")>=0&&(B.style="percent"),!/[@#0]/.test(A))return B.style?B:void 0;if(B.useGrouping=A.indexOf(",")>=0,/E\+?[@#0]+/i.test(A)||A.indexOf("@")>=0){var g=A.replace(/E\+?[@#0]+|[^@#0]/gi,"");B.minimumSignificantDigits=Math.min(Math.max(g.replace(/[^@0]/g,"").length,1),21),B.maximumSignificantDigits=Math.min(Math.max(g.length,1),21)}else{for(var i=A.replace(/[^#0.]/g,"").split("."),Q=i[0],n=Q.length-1;"0"===Q[n];)--n;B.minimumIntegerDigits=Math.min(Math.max(Q.length-1-n,1),21);var s=i[1]||"";for(n=0;"0"===s[n];)++n;for(B.minimumFractionDigits=Math.min(Math.max(n,0),20);"#"===s[n];)++n;B.maximumFractionDigits=Math.min(Math.max(n,0),20)}return B}},parseDatePattern:function(A){if(A){for(var B={},i=0;iA.blocks.getAllVariableAndListReferences(null,B)).reduce(t._mergeVarRefObjects,{})}static updateVariableIdentifiers(A,B,t){A.map(A=>(A.referencingField.id=B,t&&(A.referencingField.value=t),A))}}A.exports=t},function(A,B){A.exports=class{constructor(){this._requestID=0,this._openRequests={}}sendRemoteRequest(A,B){const t=this._requestID++,e=new Promise((A,B)=>{this._openRequests[t]={resolve:A,reject:B}});return this._sendRequest(A,B,t),e}sendRemoteNotification(A,B){this._sendRequest(A,B)}didReceiveCall(){throw new Error("Must override didReceiveCall")}_sendMessage(){throw new Error("Must override _sendMessage")}_sendRequest(A,B,t){const e={jsonrpc:"2.0",method:A,params:B};null!==t&&(e.id=t),this._sendMessage(e)}_handleMessage(A){if("2.0"!==A.jsonrpc)throw new Error("Bad or missing JSON-RPC version in message: ".concat(A));A.hasOwnProperty("method")?this._handleRequest(A):this._handleResponse(A)}_sendResponse(A,B,t){const e={jsonrpc:"2.0",id:A};t?e.error=t:e.result=B||null,this._sendMessage(e)}_handleResponse(A){const{result:B,error:t,id:e}=A,g=this._openRequests[e];delete this._openRequests[e],g&&(t?g.reject(t):g.resolve(B))}_handleRequest(A){const{method:B,params:t,id:e}=A,g=this.didReceiveCall(B,t);e&&Promise.resolve(g).then(A=>{this._sendResponse(e,A)},A=>{this._sendResponse(e,null,A)})}}},function(A){A.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(A,B){A.exports=(A,B,t)=>{let e=null;const g=window.AbortController?new window.AbortController:null,i=g?g.signal:null;return Promise.race([fetch(A,Object.assign({signal:i},B)).then(A=>(clearTimeout(e),A)),new Promise((A,B)=>{e=setTimeout(()=>{g&&g.abort(),B(new Error("Fetch timed out after ".concat(t," ms")))},t)})])}},function(A,B,t){function e(A,B){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(A);B&&(e=e.filter((function(B){return Object.getOwnPropertyDescriptor(A,B).enumerable}))),t.push.apply(t,e)}return t}function g(A,B,t){return B in A?Object.defineProperty(A,B,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[B]=t,A}const i=t(11),{OrderedMap:Q}=t(31),n=t(6),s=t(22),r=t(113),c=t(3),E=t(298),o=t(299),w=t(122),C=t(308),a=t(109),I=t(43),h=t(0),Y=t(105),M=t(19),F=t(13),D=t(41),u=t(309),l=t(123),d=t(310),U=t(311),N=t(312),m=t(313),G=t(314),f=t(315),H=t(124),p=t(12),R=t(10),y={scratch3_control:t(316),scratch3_event:t(317),scratch3_looks:t(318),scratch3_motion:t(319),scratch3_operators:t(320),scratch3_sound:t(321),scratch3_sensing:t(322),scratch3_data:t(323),scratch3_procedures:t(324)},J=t(325),k=["#0FBD8C","#0DA57A","#0B8E69"],T=(()=>{const A={};return A[n.ANGLE]={shadow:{type:"math_angle",fieldName:"NUM"}},A[n.COLOR]={shadow:{type:"colour_picker",fieldName:"COLOUR"}},A[n.NUMBER]={shadow:{type:"math_number",fieldName:"NUM"}},A[n.STRING]={shadow:{type:"text",fieldName:"TEXT"}},A[n.BOOLEAN]={check:"Boolean"},A[n.MATRIX]={shadow:{type:"matrix",fieldName:"MATRIX"}},A[n.NOTE]={shadow:{type:"note",fieldName:"NOTE"}},A[n.IMAGE]={fieldType:"field_image"},A})(),j=A=>{let B=0;return{canAddCloudVariable:()=>B{B++},removeCloudVariable:()=>{B--},hasCloudVariables:()=>B>0}};let x=-1,S=-1,b=-1;const z="function"==typeof requestAnimationFrame?requestAnimationFrame:A=>setTimeout(A,1e3/60),L="function"==typeof requestAnimationFrame?cancelAnimationFrame:clearTimeout;class P extends i{constructor(){super(),this.targets=[],this.executableTargets=[],this.threads=[],this.threadMap=new Map,this.sequencer=new o(this),this.flyoutBlocks=new s(this,!0),this.monitorBlocks=new s(this,!0),this._editingTarget=null,this._primitives={},this._blockInfo=[],this._hats={},this._scriptGlowsPreviousFrame=[],this._nonMonitorThreadCount=0,this._lastStepDoneThreads=null,this._cloneCounter=0,this._refreshTargets=!1,this.monitorBlockInfo={},this._monitorState=Q({}),this._prevMonitorState=Q({}),this.turboMode=!1,this._steppingInterval=null,this.currentStepTime=null,this.updateCurrentMSecs(),this.redrawRequested=!1,this._registerBlockPackages(),this.ioDevices={clock:new d(this),cloud:new U(this),keyboard:new N(this),mouse:new m(this),mouseWheel:new G(this),userData:new f,video:new H(this)},this.peripheralExtensions={},this.profiler=null,this.cloudOptions={limit:100};const A=j(this.cloudOptions);this.hasCloudData=A.hasCloudVariables,this.canAddCloudVariable=A.canAddCloudVariable,this.addCloudVariable=this._initializeAddCloudVariable(A),this.removeCloudVariable=this._initializeRemoveCloudVariable(A),this.origin=null,this._stageTarget=null,this.framerate=60,this.addonBlocks={},this.stageWidth=P.STAGE_WIDTH,this.stageHeight=P.STAGE_HEIGHT,this.runtimeOptions={maxClones:P.MAX_CLONES,miscLimits:!0,fencing:!0},this.compilerOptions={enabled:!0,warpTimer:!1},this.debug=!1,this._animationFrame=this._animationFrame.bind(this),this._animationFrameId=null,this._lastStepTime=Date.now(),this.interpolationEnabled=!1}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 COMPILE_ERROR(){return"COMPILE_ERROR"}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(A){return()=>{const B=this.hasCloudData();A.addCloudVariable(),!B&&this.hasCloudData()&&this.emit(P.HAS_CLOUD_DATA_UPDATE,!0)}}_initializeRemoveCloudVariable(A){return()=>{const B=this.hasCloudData();A.removeCloudVariable(),B&&!this.hasCloudData()&&this.emit(P.HAS_CLOUD_DATA_UPDATE,!1)}}_registerBlockPackages(){for(const A in y)if(y.hasOwnProperty(A)){const B=new y[A](this);if(B.getPrimitives){const A=B.getPrimitives();for(const t in A)A.hasOwnProperty(t)&&(this._primitives[t]=A[t].bind(B))}if(B.getHats){const A=B.getHats();for(const B in A)A.hasOwnProperty(B)&&(this._hats[B]=A[B])}B.getMonitored&&(this.monitorBlockInfo=Object.assign({},this.monitorBlockInfo,B.getMonitored())),this.compilerRegisterExtension(A,B)}}compilerRegisterExtension(A,B){this["ext_".concat(A)]=B}getMonitorState(){return this._monitorState}_makeExtensionMenuId(A,B){return"".concat(B,"_menu_").concat(D(A))}makeMessageContextForTarget(A){const B={};(A=A||this.getEditingTarget()||this.getTargetForStage())&&(B.targetType=A.isStage?a.STAGE:a.SPRITE)}_registerExtensionPrimitives(A){const B={id:A.id,name:Y(A.name),showStatusButton:A.showStatusButton,blockIconURI:A.blockIconURI,menuIconURI:A.menuIconURI};A.color1?(B.color1=A.color1,B.color2=A.color2,B.color3=A.color3):(B.color1=k[0],B.color2=k[1],B.color3=k[2]),this._blockInfo.push(B),this._fillExtensionCategory(B,A);for(const t in B.customFieldTypes)if(A.customFieldTypes.hasOwnProperty(t)){const A=B.customFieldTypes[t];this.emit(P.EXTENSION_FIELD_ADDED,{name:"field_".concat(A.extendedName),implementation:A.fieldImplementation})}this.emit(P.EXTENSION_ADDED,B)}_refreshExtensionPrimitives(A){const B=this._blockInfo.find(B=>B.id===A.id);B&&(B.name=Y(A.name),this._fillExtensionCategory(B,A),this.emit(P.BLOCKSINFO_UPDATE,B))}_fillExtensionCategory(A,B){A.blocks=[],A.customFieldTypes={},A.menus=[],A.menuInfo={};for(const t in B.menus)if(B.menus.hasOwnProperty(t)){const e=B.menus[t],g=this._buildMenuForScratchBlocks(t,e,A);A.menus.push(g),A.menuInfo[t]=e}for(const t in B.customFieldTypes)if(B.customFieldTypes.hasOwnProperty(t)){const e=B.customFieldTypes[t],g=this._buildCustomFieldInfo(t,e,B.id,A);A.customFieldTypes[t]=g}if(B.docsURI)try{const t=new URL(B.docsURI);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new Error("invalid protocol");const e={info:{},xml:"')};A.blocks.push(e)}catch(A){h.warn("cannot create docsURI button",A)}for(const t of B.blocks)try{const B=this._convertForScratchBlocks(t,A);if(A.blocks.push(B),B.json){const A=B.json.type;t.blockType!==c.EVENT&&(this._primitives[A]=B.info.func),t.blockType!==c.EVENT&&t.blockType!==c.HAT||(this._hats[A]={edgeActivated:t.isEdgeActivated,restartExistingThreads:t.shouldRestartExistingThreads})}}catch(A){h.error("Error parsing block: ",{block:t,error:A})}}_convertMenuItems(A){if("function"!=typeof A){const B=this.makeMessageContextForTarget();return A.map(A=>{const t=Y(A,B);switch(typeof t){case"string":return[t,t];case"object":return[Y(A.text,B),A.value];default:throw new Error("Can't interpret menu item: ".concat(JSON.stringify(A)))}})}return A}_buildMenuForScratchBlocks(A,B,t){const e=this._makeExtensionMenuId(A,t.id),g=this._convertMenuItems(B.items);return{json:{message0:"%1",type:e,inputsInline:!0,output:"String",colour:t.color1,colourSecondary:t.color2,colourTertiary:t.color3,outputShape:B.acceptReporters?C.OUTPUT_SHAPE_ROUND:C.OUTPUT_SHAPE_SQUARE,args0:[{type:"field_dropdown",name:A,options:g}]}}}_buildCustomFieldInfo(A,B,t,e){const g="".concat(t,"_").concat(A);return{fieldName:A,extendedName:g,argumentTypeInfo:{shadow:{type:g,fieldName:"field_".concat(g)}},scratchBlocksDefinition:this._buildCustomFieldTypeForScratchBlocks(g,B.output,B.outputShape,e),fieldImplementation:B.implementation}}_buildCustomFieldTypeForScratchBlocks(A,B,t,e){return{json:{type:A,message0:"%1",inputsInline:!0,output:B,colour:e.color1,colourSecondary:e.color2,colourTertiary:e.color3,outputShape:t,args0:[{name:"field_".concat(A),type:"field_".concat(A)}]}}}_convertForScratchBlocks(A,B){return"---"===A?this._convertSeparatorForScratchBlocks(A):A.blockType===c.BUTTON?this._convertButtonForScratchBlocks(A):this._convertBlockForScratchBlocks(A,B)}_convertBlockForScratchBlocks(A,B){const t="".concat(B.id,"_").concat(A.opcode),e={type:t,inputsInline:!0,category:B.name,colour:B.color1,colourSecondary:B.color2,colourTertiary:B.color3},g={argsMap:{},blockJSON:e,categoryInfo:B,blockInfo:A,inputList:[]},i=A.blockIconURI||B.blockIconURI;if(i){e.extensions=["scratch_extension"],e.message0="%1 %2";const A={type:"field_image",src:i,width:40,height:40},B={type:"field_vertical_separator"};e.args0=[A,B]}switch(A.blockType){case c.COMMAND:e.outputShape=C.OUTPUT_SHAPE_SQUARE,e.previousStatement=null,A.isTerminal||(e.nextStatement=null);break;case c.REPORTER:e.output="String",e.outputShape=C.OUTPUT_SHAPE_ROUND;break;case c.BOOLEAN:e.output="Boolean",e.outputShape=C.OUTPUT_SHAPE_HEXAGONAL;break;case c.HAT:case c.EVENT:A.hasOwnProperty("isEdgeActivated")||(A.isEdgeActivated=!0),e.outputShape=C.OUTPUT_SHAPE_SQUARE,e.nextStatement=null;break;case c.CONDITIONAL:case c.LOOP:A.branchCount=A.branchCount||1,e.outputShape=C.OUTPUT_SHAPE_SQUARE,e.previousStatement=null,A.isTerminal||(e.nextStatement=null)}const Q=Array.isArray(A.text)?A.text:[A.text];let n=0,s=0,r=0;const E=this._convertPlaceholders.bind(this,g),o=this.makeMessageContextForTarget();for(;n0?s+1:"")}],++s,++r)}A.blockType===c.REPORTER?A.disableMonitor||0!==g.inputList.length||(e.checkboxInFlyout=!0):A.blockType===c.LOOP&&(e["lastDummyAlign".concat(r)]="RIGHT",e["message".concat(r)]="%1",e["args".concat(r)]=[{type:"field_image",src:"./static/blocks-media/repeat.svg",width:24,height:24,alt:"*",flip_rtl:!0}],++r);const w=A.isDynamic?''):"",a=g.inputList.join(""),I='').concat(w).concat(a,"");return{info:g.blockInfo,json:g.blockJSON,xml:I}}_convertSeparatorForScratchBlocks(A){return{info:A,xml:''}}_convertButtonForScratchBlocks(A){["MAKE_A_LIST","MAKE_A_PROCEDURE","MAKE_A_VARIABLE"].indexOf(A.func)<0&&h.error("Custom button callbacks not supported yet: ".concat(A.func));const B=this.makeMessageContextForTarget(),t=Y(A.text,B);return{info:A,xml:'')}}_constructInlineImageJson(A){return A.dataURI||h.warn("Missing data URI in extension block with argument type IMAGE"),{type:"field_image",src:A.dataURI||"",width:24,height:24,flip_rtl:A.flipRTL||!1}}_convertPlaceholders(A,B,t){t=t.replace(/[<"&]/,"_");const e=A.blockInfo.arguments[t]||{};let g,i=T[e.type]||{};if(!T[e.type]&&A.categoryInfo.customFieldTypes[e.type]&&(i=A.categoryInfo.customFieldTypes[e.type].argumentTypeInfo),"field_image"===i.fieldType)g=this._constructInlineImageJson(e);else{g={type:"input_value",name:t};const B=void 0===e.defaultValue?"":D(Y(e.defaultValue,this.makeMessageContextForTarget()).toString());let Q,n,s;if(i.check&&(g.check=i.check),e.menu){const B=A.categoryInfo.menuInfo[e.menu];B.acceptReporters?(Q=t,n=this._makeExtensionMenuId(e.menu,A.categoryInfo.id),s=e.menu):(g.type="field_dropdown",g.options=this._convertMenuItems(B.items),Q=null,n=null,s=t)}else Q=t,n=i.shadow&&i.shadow.type||null,s=i.shadow&&i.shadow.fieldName||null;Q&&A.inputList.push('')),n&&A.inputList.push('')),B&&s&&A.inputList.push('').concat(B,"")),n&&A.inputList.push(""),Q&&A.inputList.push("")}const Q="args".concat(A.outLineNum),n=A.blockJSON[Q]=A.blockJSON[Q]||[];g&&n.push(g);const s=n.length;return A.argsMap[t]=s,"%".concat(s)}getBlocksXML(A){return this._blockInfo.map(B=>{const{name:t,color1:e,color2:g}=B,i=B.blocks.filter(B=>{let t=!0;return A&&B.info.filter&&(t=B.info.filter.includes(A.isStage?a.STAGE:a.SPRITE)),t&&!B.info.hideFromPalette}),Q='colour="'.concat(e,'" secondaryColour="').concat(g,'"');let n="";B.menuIconURI?n=B.menuIconURI:B.blockIconURI&&(n=B.blockIconURI);const s=n?'iconURI="'.concat(n,'"'):"";let r="";return B.showStatusButton&&(r='showStatusButton="true"'),{id:B.id,xml:'").concat(i.map(A=>A.xml).join(""),"")}})}getBlocksJSON(){return this._blockInfo.reduce((A,B)=>A.concat(B.blocks.map(A=>A.json)),[])}getScratchLinkSocket(A){return(this._linkSocketFactory||this._defaultScratchLinkSocketFactory)(A)}configureScratchLinkSocketFactory(A){this._linkSocketFactory=A}_defaultScratchLinkSocketFactory(A){return new u(A)}registerPeripheralExtension(A,B){this.peripheralExtensions[A]=B}scanForPeripheral(A){this.peripheralExtensions[A]&&this.peripheralExtensions[A].scan()}connectPeripheral(A,B){this.peripheralExtensions[A]&&this.peripheralExtensions[A].connect(B)}disconnectPeripheral(A){this.peripheralExtensions[A]&&this.peripheralExtensions[A].disconnect()}getPeripheralIsConnected(A){let B=!1;return this.peripheralExtensions[A]&&(B=this.peripheralExtensions[A].isConnected()),B}emitMicListening(A){this.emit(P.MIC_LISTENING,A)}getOpcodeFunction(A){return this._primitives[A]}getIsHat(A){return this._hats.hasOwnProperty(A)}getIsEdgeActivatedHat(A){return this._hats.hasOwnProperty(A)&&this._hats[A].edgeActivated}attachAudioEngine(A){this.audioEngine=A,t(326)(A)}attachRenderer(A){this.renderer=A,this.renderer.setLayerGroupOrdering(M.LAYER_GROUPS)}attachV2BitmapAdapter(A){this.v2BitmapAdapter=A}attachStorage(A){this.storage=A}_pushThread(A,B,t){const e=new I(A);return e.target=B,e.stackClick=Boolean(t&&t.stackClick),e.updateMonitor=Boolean(t&&t.updateMonitor),e.blockContainer=e.updateMonitor?this.monitorBlocks:B.blocks,e.pushStack(A),this.threads.push(e),e.stackClick||e.updateMonitor||this.threadMap.set(e.getId(),e),t&&t.updateMonitor||!this.compilerOptions.enabled||e.tryCompile(),e}_stopThread(A){A.isKilled=!0,this.sequencer.retireThread(A)}_restartThread(A){const B=new I(A.topBlock);B.target=A.target,B.stackClick=A.stackClick,B.updateMonitor=A.updateMonitor,B.blockContainer=A.blockContainer,B.pushStack(A.topBlock),A.triedToCompile&&this.compilerOptions.enabled&&B.tryCompile(),B.stackClick||B.updateMonitor||this.threadMap.set(B.getId(),B);const t=this.threads.indexOf(A);return t>-1?(this.threads[t]=B,B):(this.threads.push(A),A)}emitCompileError(A,B){this.emit(P.COMPILE_ERROR,A,B)}isActiveThread(A){return A.stack.length>0&&A.status!==I.STATUS_DONE&&this.threads.indexOf(A)>-1}isWaitingThread(A){return A.status===I.STATUS_PROMISE_WAIT||A.status===I.STATUS_YIELD_TICK||!this.isActiveThread(A)}toggleScript(A,B){B=Object.assign({target:this._editingTarget,stackClick:!1},B);for(let t=0;t=0;B--){const e=t[B],g=e.blocks.getScripts();for(let B=0;B=0;t--){const g=e[t],i=r.getScripts(g.blocks,A);for(let A=0;A{const{blockId:Q,fieldsOfInputs:n}=A;for(const A in B)if(n[A].value!==B[A])return;if(g.restartExistingThreads){const A=this.threadMap.get(I.getIdFromTargetAndBlock(t,Q));if(A)return void e.push(this._restartThread(A))}else for(let A=0;A{A.isCompiled||(w(this.sequencer,A),A.goToNextBlock())}),e}dispose(){this.stopAll(),this.targets.forEach(A=>{A.isOriginal&&A.deleteMonitors()}),this.targets.map(this.disposeTarget,this);const A=Q({});A.equals(this._monitorState)||(this._monitorState=A,this.emit(P.MONITORS_UPDATE,this._monitorState)),this.emit(P.RUNTIME_DISPOSED),this.ioDevices.clock.resetProjectTimer(),this.hasCloudData()&&this.emit(P.HAS_CLOUD_DATA_UPDATE,!1),this.ioDevices.cloud.clear();const B=j(this.cloudOptions);this.hasCloudData=B.hasCloudVariables,this.canAddCloudVariable=B.canAddCloudVariable,this.addCloudVariable=this._initializeAddCloudVariable(B),this.removeCloudVariable=this._initializeRemoveCloudVariable(B)}addTarget(A){this.targets.push(A),this.executableTargets.push(A),A.isStage&&!this._stageTarget&&(this._stageTarget=A)}moveExecutable(A,B){const t=this.executableTargets.indexOf(A);this.executableTargets.splice(t,1);let e=t+B;return e>this.executableTargets.length&&(e=this.executableTargets.length),e<=0&&(e=this.executableTargets.length>0&&this.executableTargets[0].isStage?1:0),this.executableTargets.splice(e,0,A),e}setExecutablePosition(A,B){const t=this.executableTargets.indexOf(A);return this.moveExecutable(A,B-t)}removeExecutable(A){const B=this.executableTargets.indexOf(A);B>-1&&this.executableTargets.splice(B,1)}disposeTarget(A){this.targets=this.targets.filter(B=>A!==B||(B.dispose(),!1)),this._stageTarget===A&&(this._stageTarget=null)}stopForTarget(A,B){this.emit(P.STOP_FOR_TARGET,A,B);for(let t=0;tA.clearEdgeActivatedValues());for(let A=0;A!A.isKilled),this.updateThreadMap();for(const A in this._hats){if(!this._hats.hasOwnProperty(A))continue;this._hats[A].edgeActivated&&this.startHats(A)}this.redrawRequested=!1,this._pushMonitors(),null!==this.profiler&&(-1===S&&(S=this.profiler.idByName("Sequencer.stepThreads")),this.profiler.start(S));const A=this.sequencer.stepThreads();null!==this.profiler&&this.profiler.stop(),this._updateGlows(A),this._emitProjectRunStatus(this.threads.length+A.length-this._getMonitorThreadCount([...this.threads,...A])),this._lastStepDoneThreads=A,this.renderer&&(null!==this.profiler&&(-1===b&&(b=this.profiler.idByName("RenderWebGL.draw")),this.profiler.start(b)),document.hidden||null!==this._animationFrameId||this.renderer.draw(),null!==this.profiler&&this.profiler.stop()),this._refreshTargets&&(this.emit(P.TARGETS_UPDATE,!1),this._refreshTargets=!1),this._prevMonitorState.equals(this._monitorState)||(this.emit(P.MONITORS_UPDATE,this._monitorState),this._prevMonitorState=this._monitorState),null!==this.profiler&&(this.profiler.stop(),this.profiler.reportFrames()),this.interpolationEnabled&&(this._lastStepTime=Date.now())}_getMonitorThreadCount(A){let B=0;return A.forEach(A=>{A.updateMonitor&&B++}),B}_pushMonitors(){this.monitorBlocks.runAllMonitored(this)}setEditingTarget(A){const B=this._editingTarget;this._editingTarget=A,this._scriptGlowsPreviousFrame=[],this._updateGlows(),B!==this._editingTarget&&this.requestToolboxExtensionsUpdate()}setCompatibilityMode(A){A?this.setFramerate(30):this.setFramerate(60)}setFramerate(A){A>250&&(A=250),this.framerate=A,this._steppingInterval&&(clearInterval(this._steppingInterval),this._steppingInterval=null,this.start()),this.emit(P.FRAMERATE_CHANGED,A)}setInterpolation(A){this.interpolationEnabled=A,this._steppingInterval&&(this.stop(),this.start()),this.emit(P.INTERPOLATION_CHANGED,A)}setRuntimeOptions(A){this.runtimeOptions=Object.assign({},this.runtimeOptions,A),this.emit(P.RUNTIME_OPTIONS_CHANGED,this.runtimeOptions)}setCompilerOptions(A){this.compilerOptions=Object.assign({},this.compilerOptions,A),this.resetAllCaches(),this.emit(P.COMPILER_OPTIONS_CHANGED,this.compilerOptions)}resetAllCaches(){for(const A of this.targets)A.isOriginal&&A.blocks.resetCache();this.flyoutBlocks.resetCache(),this.monitorBlocks.resetCache()}addAddonBlock(A){const B=A.procedureCode,t=A.arguments,i=A.arguments.map((A,B)=>"arg".concat(B)),Q=A.arguments.map(()=>"");this.addonBlocks[B]=function(A){for(var B=1;B"a-b"===A.id);n||(n={id:"a-b",name:"Addons",color1:A.color,color2:A.secondaryColor,color3:A.secondaryColor,blocks:[],customFieldTypes:{},menus:[]},this._blockInfo.unshift(n)),n.blocks.push({info:{},xml:'"}),this.resetAllCaches()}getAddonBlock(A){return Object.prototype.hasOwnProperty.call(this.addonBlocks,A)?this.addonBlocks[A]:null}findProjectOptionsComment(){const A=this.getTargetForStage().comments;for(const B of Object.values(A))if(B.text.includes(" // _twconfig_"))return B;return null}parseProjectOptions(){const A=this.findProjectOptionsComment();if(!A)return;const B=A.text.split("\n").find(A=>A.endsWith(" // _twconfig_"));if(!B)return void h.warn("Config comment does not contain valid line");const t=B.substr(0,B.length-" // _twconfig_".length);let e;try{if(e=l.parse(t),!e||"object"!=typeof e)throw new Error("Invalid object")}catch(A){return void h.warn("Config comment has invalid JSON",A)}"number"==typeof e.framerate&&this.setFramerate(e.framerate),e.turbo&&(this.turboMode=!0,this.emit(P.TURBO_MODE_ON)),e.interpolation&&this.setInterpolation(!0),e.runtimeOptions&&this.setRuntimeOptions(e.runtimeOptions),e.hq&&this.renderer&&this.renderer.setUseHighQualityRender(!0)}generateProjectOptions(){const A={};return A.framerate=this.framerate,A.runtimeOptions=this.runtimeOptions,A.interpolation=this.interpolationEnabled,A.turbo=this.turboMode,A.hq=!!this.renderer&&this.renderer.useHighQualityRender,A}storeProjectOptions(){const A=this.generateProjectOptions(),B="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(l.stringify(A)).concat(" // _twconfig_"),t=this.findProjectOptionsComment();if(t)t.text=B;else{this.getTargetForStage().createComment(R(),null,B,50,50,350,170,!1)}this.emitProjectChanged()}precompile(){this.allScriptsDo((A,B)=>{const t=B.blocks.getBlock(A);if(this.getIsHat(t.opcode)){const t=new I(A);t.target=B,t.blockContainer=B.blocks,t.tryCompile()}})}enableDebug(){this.resetAllCaches(),this.debug=!0}_updateGlows(A){const B=[];B.push.apply(B,this.threads),A&&B.push.apply(B,A);const t=[],e=[];for(let A=0;A0&&this.emit(P.PROJECT_RUN_START),this._nonMonitorThreadCount>0&&0===A&&this.emit(P.PROJECT_RUN_STOP),this._nonMonitorThreadCount=A}quietGlow(A){const B=this._scriptGlowsPreviousFrame.indexOf(A);B>-1&&this._scriptGlowsPreviousFrame.splice(B,1)}glowBlock(A,B){B?this.emit(P.BLOCK_GLOW_ON,{id:A}):this.emit(P.BLOCK_GLOW_OFF,{id:A})}glowScript(A,B){B?this.emit(P.SCRIPT_GLOW_ON,{id:A}):this.emit(P.SCRIPT_GLOW_OFF,{id:A})}emitBlockDragUpdate(A){this.emit(P.BLOCK_DRAG_UPDATE,A)}emitBlockEndDrag(A,B){this.emit(P.BLOCK_DRAG_END,A,B)}visualReport(A,B){this.emit(P.VISUAL_REPORT,{id:A,value:String(B)})}requestAddMonitor(A){const B=A.get("id");this.requestUpdateMonitor(A)||(this._monitorState=this._monitorState.set(B,A))}requestUpdateMonitor(A){const B=A.get("id");return!!this._monitorState.has(B)&&(this._monitorState=this._monitorState.set(B,this._monitorState.get(B).mergeWith((A,B)=>null==B?A:B,A)),!0)}requestRemoveMonitor(A){this._monitorState=this._monitorState.delete(A)}requestHideMonitor(A){return this.requestUpdateMonitor(new Map([["id",A],["visible",!1]]))}requestShowMonitor(A){return this.requestUpdateMonitor(new Map([["id",A],["visible",!0]]))}requestRemoveMonitorByTargetId(A){this._monitorState=this._monitorState.filterNot(B=>B.targetId===A)}getTargetById(A){for(let B=0;BA.id===B);if(!e)return;const g=e.blocks.find(A=>A.info.opcode===t);return g?{category:"extension",label:"".concat(e.name,": ").concat(g.info.text)}:void 0}createNewGlobalVariable(A,B,t){const e="string"==typeof t?t:F.SCALAR_TYPE,g=this.getAllVarNamesOfType(e),i=p.unusedName(A,g),Q=new F(B||R(),i,e);return this.getTargetForStage().variables[Q.id]=Q,Q}requestRedraw(){this.redrawRequested=!0}requestTargetsUpdate(A){A.isOriginal&&(this._refreshTargets=!0)}requestBlocksUpdate(){this.emit(P.BLOCKS_NEED_UPDATE)}requestToolboxExtensionsUpdate(){this.emit(P.TOOLBOX_EXTENSIONS_NEED_UPDATE)}start(){if(this._steppingInterval)return;this.interpolationEnabled&&(this._animationFrameId=z(this._animationFrame));const A=1e3/this.framerate;this.currentStepTime=A,this._steppingInterval=setInterval(()=>{this._step()},A),this.emit(P.RUNTIME_STARTED)}stop(){this._steppingInterval&&(clearInterval(this._steppingInterval),this._steppingInterval=null,null!==this._animationFrameId&&(L(this._animationFrameId),this._animationFrameId=null),this.emit(P.RUNTIME_STOPPED))}enableProfiling(A){E.available()&&(this.profiler=new E(A))}disableProfiling(){this.profiler=null}updateCurrentMSecs(){this.currentMSecs=Date.now()}}A.exports=P},function(A,B){A.exports={IntermediateScript:class{constructor(){this.topBlockId=null,this.stack=null,this.isProcedure=!1,this.procedureCode="",this.arguments=[],this.isWarp=!1,this.yields=!0,this.warpTimer=!1,this.dependedProcedures=[],this.cachedCompileResult=null}},IntermediateRepresentation:class{constructor(){this.entry=null,this.procedures={}}}}},function(A,B,t){const e={Timer:t(20),Cast:t(1),log:t(0),compatibilityLayerBlockUtility:t(305),thread:null};let g="";const i={isStuck:"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}",startHats:"const startHats = (requestedHat, optMatchFields) => {\n const thread = globalState.thread;\n const threads = thread.target.runtime.startHats(requestedHat, optMatchFields);\n return threads;\n}",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}",executeInCompatibilityLayer:"let hasResumedFromPromise = false;\nconst waitPromise = function*(promise) {\n const thread = globalState.thread;\n let returnValue;\n\n promise\n .then(value => {\n returnValue = value;\n thread.status = 0; // STATUS_RUNNING\n })\n .catch(error => {\n thread.status = 0; // STATUS_RUNNING\n globalState.log.warn('Promise rejected in compiled script:', error);\n });\n\n // enter STATUS_PROMISE_WAIT and yield\n // this will stop script execution until the promise handlers reset the thread status\n thread.status = 1; // STATUS_PROMISE_WAIT\n yield;\n\n return returnValue;\n};\nconst executeInCompatibilityLayer = function*(inputs, blockFunction, useFlags) {\n const thread = globalState.thread;\n\n // reset the stackframe\n // we only ever use one stackframe at a time, so this shouldn't cause issues\n thread.stackFrames[thread.stackFrames.length - 1].reuse(thread.warp > 0);\n\n const executeBlock = () => {\n const compatibilityLayerBlockUtility = globalState.compatibilityLayerBlockUtility;\n compatibilityLayerBlockUtility.thread = thread;\n compatibilityLayerBlockUtility.sequencer = thread.target.runtime.sequencer;\n return blockFunction(inputs, compatibilityLayerBlockUtility);\n };\n\n const isPromise = value => (\n // see engine/execute.js\n value !== null &&\n typeof value === 'object' &&\n typeof value.then === 'function'\n );\n\n let returnValue = executeBlock();\n\n if (isPromise(returnValue)) {\n returnValue = yield* waitPromise(returnValue);\n if (useFlags) {\n hasResumedFromPromise = true;\n }\n return returnValue;\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 (thread.warp === 0 || 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\n if (isPromise(returnValue)) {\n returnValue = yield* waitPromise(returnValue);\n if (useFlags) {\n hasResumedFromPromise = true;\n }\n return returnValue;\n }\n }\n\n // todo: do we have to do anything extra if status is STATUS_DONE?\n\n return returnValue;\n}",callAddonBlock:"const callAddonBlock = function*(procedureCode, blockId, args) {\n const thread = globalState.thread;\n const addonBlock = thread.target.runtime.getAddonBlock(procedureCode);\n if (addonBlock) {\n const target = thread.target;\n addonBlock.callback(args, {\n // Shim enough of BlockUtility to make addons work\n peekStack () {\n return blockId;\n },\n target\n });\n if (thread.status === 1 /* STATUS_PROMISE_WAIT */) {\n yield;\n }\n }\n}",retire:"const retire = () => {\n const thread = globalState.thread;\n thread.target.runtime.sequencer.retireThread(thread);\n}",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}"};g+="const isWhiteSpace = val => (\n val === null || (typeof val === 'string' && val.trim().length === 0)\n);",g+="const compareEqual = (v1, v2) => {\n let n1 = +v1;\n let n2 = +v2;\n if (n1 === 0 && isWhiteSpace(v1)) {\n n1 = NaN;\n } else if (n2 === 0 && isWhiteSpace(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};",i.compareGreaterThan="const compareGreaterThan = (v1, v2) => {\n let n1 = +v1;\n let n2 = +v2;\n if (n1 === 0 && isWhiteSpace(v1)) {\n n1 = NaN;\n } else if (n2 === 0 && isWhiteSpace(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}",i.compareLessThan="const compareLessThan = (v1, v2) => {\n let n1 = +v1;\n let n2 = +v2;\n if (n1 === 0 && isWhiteSpace(v1)) {\n n1 = NaN;\n } else if (n2 === 0 && isWhiteSpace(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}",i.randomInt="const randomInt = (low, high) => low + Math.floor(Math.random() * ((high + 1) - low))",i.randomFloat="const randomFloat = (low, high) => (Math.random() * (high - low)) + low",i.timer="const timer = () => {\n const t = new globalState.Timer({\n now: () => globalState.thread.target.runtime.currentMSecs\n });\n t.start();\n return t;\n}",i.daysSince2000="const daysSince2000 = () => (Date.now() - 946684800000) / (24 * 60 * 60 * 1000)",i.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}",g+="const listIndex = (index, length) => {\n if (typeof index !== 'number') {\n if (index === 'last') {\n if (length > 0) {\n return length - 1;\n }\n return -1;\n } else if (index === 'random' || index === '*') {\n if (length > 0) {\n return (Math.random() * length) | 0;\n }\n return -1;\n }\n index = +index || 0;\n }\n index = index | 0;\n if (index < 1 || index > length) {\n return -1;\n }\n return index - 1;\n};",i.listGet="const listGet = (list, idx) => {\n const index = listIndex(idx, list.length);\n if (index === -1) {\n return '';\n }\n return list[index];\n}",i.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}",i.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}",i.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}",i.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}",i.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}",i.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}",i.colorToList="const colorToList = color => globalState.Cast.toRgbColorList(color)",i.mod="const mod = (n, modulus) => {\n let result = n % modulus;\n if (result / modulus < 0) result += modulus;\n return result;\n}";const Q=A=>{e.thread=A,A.generator.next()};Q.scopedEval=A=>{try{const B=(A=>{let B="const isWhiteSpace = val => (\n val === null || (typeof val === 'string' && val.trim().length === 0)\n);const compareEqual = (v1, v2) => {\n let n1 = +v1;\n let n2 = +v2;\n if (n1 === 0 && isWhiteSpace(v1)) {\n n1 = NaN;\n } else if (n2 === 0 && isWhiteSpace(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};const listIndex = (index, length) => {\n if (typeof index !== 'number') {\n if (index === 'last') {\n if (length > 0) {\n return length - 1;\n }\n return -1;\n } else if (index === 'random' || index === '*') {\n if (length > 0) {\n return (Math.random() * length) | 0;\n }\n return -1;\n }\n index = +index || 0;\n }\n index = index | 0;\n if (index < 1 || index > length) {\n return -1;\n }\n return index - 1;\n};";for(const t of Object.keys(i))A.includes(t)&&(B+="".concat(i[t],";"));return B+="return ".concat(A),B})(A);return new Function("globalState",B)(e)}catch(B){throw e.log.error("was unable to compile script",A),B}},Q.runtimeFunctions=i,A.exports=Q},function(A,B,t){const e=t(43),g=t(20);A.exports=class{constructor(A=null,B=null){this.sequencer=A,this.thread=B,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 A=this.thread.peekStackFrame();return null===A.executionContext&&(A.executionContext={}),A.executionContext}stackTimerFinished(){return!(this.stackFrame.timer.timeElapsed(){t.status===Q.STATUS_RUNNING&&(t.status=Q.STATUS_PROMISE_WAIT),A.then(A=>{if(E(A,B,t,e,g),g){let A,B;do{const e=t.popStack();if(null===e)return;if(B=t.target.blocks.getNextBlock(e),null!==B)break;A=t.peekStackFrame()}while(null!==A&&!A.isLoop);t.pushStack(B)}},A=>{i.warn("Primitive rejected promise: ",A),t.status=Q.STATUS_RUNNING,t.popStack()})};class w{constructor(A,B){this.id=B.id,this.opcode=B.opcode,this.fields=B.fields,this.inputs=B.inputs,this.mutation=B.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:t}=r.sequencer,{opcode:e,fields:i,inputs:Q}=this;this._isHat=t.getIsHat(e),this._blockFunction=t.getOpcodeFunction(e),this._definedBlockFunction=void 0!==this._blockFunction;const n=Object.keys(i);this._isShadowBlock=!this._definedBlockFunction&&1===n.length&&0===Object.keys(Q).length,this._shadowValue=this._isShadowBlock&&i[n[0]].value;for(const A in i)this._argValues[A]="VARIABLE"===A||"LIST"===A||"BROADCAST_OPTION"===A?{id:i[A].id,name:i[A].value}:i[A].value;if(delete this._inputs.custom_block,"BROADCAST_INPUT"in this._inputs){this._argValues.BROADCAST_OPTION={id:null,name:null};const B=this._inputs.BROADCAST_INPUT;if(B.block===B.shadow){const t=A.getBlock(B.shadow).fields.BROADCAST_OPTION;this._argValues.BROADCAST_OPTION.id=t.id,this._argValues.BROADCAST_OPTION.name=t.value,delete this._inputs.BROADCAST_INPUT}}for(const B in this._inputs){const t=this._inputs[B];if(t.block){const e=g.getCached(A,t.block,w);if(e._isHat)continue;this._ops.push(...e._ops),e._parentKey=B,e._parentValues=this._argValues,e._isShadowBlock&&(this._argValues[B]=e._shadowValue)}}this._definedBlockFunction&&this._ops.push(this)}}A.exports=function(A,B){const t=A.runtime;r.sequencer=A,r.thread=B;const e=B.peekStack(),i=B.peekStackFrame();let n=B.blockContainer,C=g.getCached(n,e,w);if(null===C&&(n=t.flyoutBlocks,C=g.getCached(n,e,w),null===C))return void A.retireThread(B);const a=C._ops,I=a.length;let h=0;if(null!==i.reported){const A=i.reported;for(;hA.id===B);if(e){const A=e._parentKey,B=e._parentValues;"BROADCAST_INPUT"===A?(B.BROADCAST_OPTION.id=null,B.BROADCAST_OPTION.name=s.toString(t)):B[A]=t}}if(A.length>0){const B=A.reverse().find(A=>a.find(B=>B.id===A.opCached));h=B?a.findIndex(A=>A.id===B.opCached)+1:0}if(null!==B.justReported&&a[h]&&a[h].id===i.reporting){const A=a[h],t=B.justReported;B.justReported=null;const e=A._parentKey,g=A._parentValues;"BROADCAST_INPUT"===e?(g.BROADCAST_OPTION.id=null,g.BROADCAST_OPTION.name=s.toString(t)):g[e]=t,h+=1}i.reporting=null,i.reported=null}const Y=h;for(;h{const B=A._parentKey,t=A._parentValues;return"BROADCAST_INPUT"===B?{opCached:A.id,inputValue:t[B].BROADCAST_OPTION.name}:{opCached:A.id,inputValue:t[B]}});break}if(B.status===Q.STATUS_RUNNING)if(t)E(w,A,B,e,t);else{const A=e._parentKey,B=e._parentValues;"BROADCAST_INPUT"===A?(B.BROADCAST_OPTION.id=null,B.BROADCAST_OPTION.name=s.toString(w)):B[A]=w}}var M;if(null!==t.profiler){C._profiler!==t.profiler&&function(A,B){B._profiler=A,-1===c&&(c=A.idByName("blockFunction"));const t=B._ops;for(let B=0;B=this.source.length&&this.error("Unexpected end of input"),this.source[A]}next(){this.index++}expect(A){this.char()!==A&&this.error("Expected '".concat(A,"' but found '").concat(this.char(),"'")),this.next()}peek(A=1,B=1){if(this.index+B+A>this.source.length)return"";if(1===A)return this.charAt(this.index+B);let t="";for(let e=0;e{if("string"==typeof A)return JSON.stringify(A);if("number"==typeof A)return Number.isNaN(A)?"0":A.toString();if("boolean"==typeof A)return A.toString();if(null===A)return"null";if(Array.isArray(A))return"[".concat(A.map(A=>e(A)).join(","),"]");if("object"==typeof A){let B="{";const t=Object.keys(A);for(let g=0;gnew t(A).parse(),stringify:e}},function(A,B,t){const e=t(19);class g{constructor(A){this.runtime=A,this.provider=null,this._skinId=-1,this._drawable=-1,this._ghost=0,this._forceTransparentPreview=!1}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}setProvider(A){this.provider=A}enableVideo(){return this.provider?this.provider.enableVideo().then(()=>this._setupPreview()):null}disableVideo(){if(this._disablePreview(),!this.provider)return null;this.provider.disableVideo()}getFrame({dimensions:A=g.DIMENSIONS,mirror:B=this.mirror,format:t=g.FORMAT_IMAGE_DATA,cacheTimeout:e=this._frameCacheTimeout}){return this.provider?this.provider.getFrame({dimensions:A,mirror:B,format:t,cacheTimeout:e}):null}setPreviewGhost(A){this._ghost=A,-1!==this._drawable&&this.runtime.renderer.updateDrawableEffect(this._drawable,"ghost",this._forceTransparentPreview?100:A)}_disablePreview(){-1!==this._skinId&&(this.runtime.renderer.updateBitmapSkin(this._skinId,new ImageData(...g.DIMENSIONS),1),this.runtime.renderer.updateDrawableVisible(this._drawable,!1)),this._renderPreviewFrame=null}_setupPreview(){const{renderer:A}=this.runtime;A&&(-1===this._skinId&&-1===this._drawable&&(this._skinId=A.createBitmapSkin(new ImageData(...g.DIMENSIONS),1),this._drawable=A.createDrawable(e.VIDEO_LAYER),A.updateDrawableSkinId(this._drawable,this._skinId)),this._renderPreviewFrame||(A.updateDrawableEffect(this._drawable,"ghost",this._forceTransparentPreview?100:this._ghost),A.updateDrawableVisible(this._drawable,!0),this._renderPreviewFrame=()=>{if(clearTimeout(this._renderPreviewTimeout),!this._renderPreviewFrame)return;this._renderPreviewTimeout=setTimeout(this._renderPreviewFrame,this.runtime.currentStepTime);const B=this.getFrame({format:g.FORMAT_IMAGE_DATA,cacheTimeout:this.runtime.currentStepTime});B?(A.updateBitmapSkin(this._skinId,B,1),this.runtime.requestRedraw()):A.updateBitmapSkin(this._skinId,new ImageData(...g.DIMENSIONS),1)},this._renderPreviewFrame()))}get videoReady(){return!!this.provider&&this.provider.videoReady}postData({forceTransparentPreview:A}){this._forceTransparentPreview=A,this.setPreviewGhost(this._ghost)}}A.exports=g},function(A,B,t){"use strict";var e=window.URL||window.webkitURL;A.exports=function(A,B){try{try{var t;try{(t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(A),t=t.getBlob()}catch(B){t=new Blob([A])}return new Worker(e.createObjectURL(t))}catch(B){return new Worker("data:application/javascript,"+encodeURIComponent(A))}}catch(A){if(!B)throw Error("Inline worker is not supported");return new Worker(B)}}},function(A,B,t){const e=t(10);A.exports=A=>{const B={};for(let t=0;t{const t=[],e=A=>{A.localName!==B&&void 0!==B||!A.getAttribute||t.push(A);for(let B=0;B{const B=document.createElement("span"),t=A.outerHTML,g=e.sanitize(t,{USE_PROFILES:{svg:!0},FORBID_TAGS:["a","audio","canvas","video"],ADD_DATA_URI_TAGS:["image"]});let i,Q;try{B.innerHTML=g,document.body.appendChild(B),i=B.children[0].getBBox()}finally{document.body.removeChild(B)}Q=0===i.width||0===i.height?0:(A=>{let B=0;const t=A=>{A.getAttribute&&(A.getAttribute("stroke")&&(B=Math.max(B,1)),A.getAttribute("stroke-width")&&(B=Math.max(B,Number(A.getAttribute("stroke-width"))||0)));for(let B=0;B{B&&(A=>{const B=s(A,"linearGradient");for(const A of B)A.getAttribute("x2")||A.setAttribute("x2","0")})(A),n(A,window),(A=>{const B=s(A,"image"),t="image-rendering: optimizespeed; image-rendering: pixelated;";for(const A of B)A.getAttribute("style")?A.setAttribute("style","".concat(t," ").concat(A.getAttribute("style"))):A.setAttribute("style",t)})(A),B?((A=>{const B=[],t=A=>{"text"===A.localName&&B.push(A);for(let B=0;B{const B=s(A);for(const A of B){if(!A.style)continue;const B=A.style.stroke||A.getAttribute("stroke");B&&B.match(/^url\(#.*\)$/)&&(A.style["stroke-linejoin"]="round",A.style["stroke-linecap"]="round")}})(A)):A.getAttribute("viewBox")?A.getAttribute("width")&&A.getAttribute("height")||(A.setAttribute("width",A.viewBox.baseVal.width),A.setAttribute("height",A.viewBox.baseVal.height)):r(A)};A.exports=(A,B)=>{const t=new DOMParser;A=Q(A);const e=t.parseFromString(A,"text/xml");if(e.childNodes.length<1||"svg"!==e.documentElement.localName)throw new Error("Document does not appear to be SVG.");const g=e.documentElement;return c(g,B),g}},function(A,B,t){ -/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */ -A.exports=function(){"use strict";var A=Object.hasOwnProperty,B=Object.setPrototypeOf,t=Object.isFrozen,e=Object.getPrototypeOf,g=Object.getOwnPropertyDescriptor,i=Object.freeze,Q=Object.seal,n=Object.create,s="undefined"!=typeof Reflect&&Reflect,r=s.apply,c=s.construct;r||(r=function(A,B,t){return A.apply(B,t)}),i||(i=function(A){return A}),Q||(Q=function(A){return A}),c||(c=function(A,B){return new(Function.prototype.bind.apply(A,[null].concat(function(A){if(Array.isArray(A)){for(var B=0,t=Array(A.length);B1?t-1:0),g=1;g/gm),S=Q(/^data-[\-\w.\u00B7-\uFFFF]/),b=Q(/^aria-[\-\w]+$/),z=Q(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),L=Q(/^(?:\w+script|data):/i),P=Q(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A};function W(A){if(Array.isArray(A)){for(var B=0,t=Array(A.length);B0&&void 0!==arguments[0]?arguments[0]:V(),t=function(B){return A(B)};if(t.version="2.2.7",t.removed=[],!B||!B.document||9!==B.document.nodeType)return t.isSupported=!1,t;var e=B.document,g=B.document,Q=B.DocumentFragment,n=B.HTMLTemplateElement,s=B.Node,r=B.Element,c=B.NodeFilter,E=B.NamedNodeMap,u=void 0===E?B.NamedNodeMap||B.MozNamedAttrMap:E,O=B.Text,X=B.Comment,Z=B.DOMParser,_=B.trustedTypes,q=r.prototype,$=U(q,"cloneNode"),AA=U(q,"nextSibling"),BA=U(q,"childNodes"),tA=U(q,"parentNode");if("function"==typeof n){var eA=g.createElement("template");eA.content&&eA.content.ownerDocument&&(g=eA.content.ownerDocument)}var gA=K(_,e),iA=gA&&jA?gA.createHTML(""):"",QA=g,nA=QA.implementation,sA=QA.createNodeIterator,rA=QA.getElementsByTagName,cA=QA.createDocumentFragment,EA=e.importNode,oA={};try{oA=d(g).documentMode?g.documentMode:{}}catch(A){}var wA={};t.isSupported="function"==typeof tA&&nA&&void 0!==nA.createHTMLDocument&&9!==oA;var CA=j,aA=x,IA=S,hA=b,YA=L,MA=P,FA=z,DA=null,uA=l({},[].concat(W(N),W(m),W(G),W(H),W(R))),lA=null,dA=l({},[].concat(W(y),W(J),W(k),W(T))),UA=null,NA=null,mA=!0,GA=!0,fA=!1,HA=!1,pA=!1,RA=!1,yA=!1,JA=!1,kA=!1,TA=!0,jA=!1,xA=!0,SA=!0,bA=!1,zA={},LA=l({},["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"]),PA=null,vA=l({},["audio","video","img","source","image","track"]),WA=null,VA=l({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),KA=null,OA=g.createElement("form"),XA=function(A){KA&&KA===A||(A&&"object"===(void 0===A?"undefined":v(A))||(A={}),A=d(A),DA="ALLOWED_TAGS"in A?l({},A.ALLOWED_TAGS):uA,lA="ALLOWED_ATTR"in A?l({},A.ALLOWED_ATTR):dA,WA="ADD_URI_SAFE_ATTR"in A?l(d(VA),A.ADD_URI_SAFE_ATTR):VA,PA="ADD_DATA_URI_TAGS"in A?l(d(vA),A.ADD_DATA_URI_TAGS):vA,UA="FORBID_TAGS"in A?l({},A.FORBID_TAGS):{},NA="FORBID_ATTR"in A?l({},A.FORBID_ATTR):{},zA="USE_PROFILES"in A&&A.USE_PROFILES,mA=!1!==A.ALLOW_ARIA_ATTR,GA=!1!==A.ALLOW_DATA_ATTR,fA=A.ALLOW_UNKNOWN_PROTOCOLS||!1,HA=A.SAFE_FOR_TEMPLATES||!1,pA=A.WHOLE_DOCUMENT||!1,JA=A.RETURN_DOM||!1,kA=A.RETURN_DOM_FRAGMENT||!1,TA=!1!==A.RETURN_DOM_IMPORT,jA=A.RETURN_TRUSTED_TYPE||!1,yA=A.FORCE_BODY||!1,xA=!1!==A.SANITIZE_DOM,SA=!1!==A.KEEP_CONTENT,bA=A.IN_PLACE||!1,FA=A.ALLOWED_URI_REGEXP||FA,HA&&(GA=!1),kA&&(JA=!0),zA&&(DA=l({},[].concat(W(R))),lA=[],!0===zA.html&&(l(DA,N),l(lA,y)),!0===zA.svg&&(l(DA,m),l(lA,J),l(lA,T)),!0===zA.svgFilters&&(l(DA,G),l(lA,J),l(lA,T)),!0===zA.mathMl&&(l(DA,H),l(lA,k),l(lA,T))),A.ADD_TAGS&&(DA===uA&&(DA=d(DA)),l(DA,A.ADD_TAGS)),A.ADD_ATTR&&(lA===dA&&(lA=d(lA)),l(lA,A.ADD_ATTR)),A.ADD_URI_SAFE_ATTR&&l(WA,A.ADD_URI_SAFE_ATTR),SA&&(DA["#text"]=!0),pA&&l(DA,["html","head","body"]),DA.table&&(l(DA,["tbody"]),delete UA.tbody),i&&i(A),KA=A)},ZA=l({},["mi","mo","mn","ms","mtext"]),_A=l({},["foreignobject","desc","title","annotation-xml"]),qA=l({},m);l(qA,G),l(qA,f);var $A=l({},H);l($A,p);var AB="http://www.w3.org/1998/Math/MathML",BB="http://www.w3.org/2000/svg",tB="http://www.w3.org/1999/xhtml",eB=function(A){var B=tA(A);B&&B.tagName||(B={namespaceURI:tB,tagName:"template"});var t=a(A.tagName),e=a(B.tagName);if(A.namespaceURI===BB)return B.namespaceURI===tB?"svg"===t:B.namespaceURI===AB?"svg"===t&&("annotation-xml"===e||ZA[e]):Boolean(qA[t]);if(A.namespaceURI===AB)return B.namespaceURI===tB?"math"===t:B.namespaceURI===BB?"math"===t&&_A[e]:Boolean($A[t]);if(A.namespaceURI===tB){if(B.namespaceURI===BB&&!_A[e])return!1;if(B.namespaceURI===AB&&!ZA[e])return!1;var g=l({},["title","style","font","a","script"]);return!$A[t]&&(g[t]||!qA[t])}return!1},gB=function(A){C(t.removed,{element:A});try{A.parentNode.removeChild(A)}catch(B){try{A.outerHTML=iA}catch(B){A.remove()}}},iB=function(A,B){try{C(t.removed,{attribute:B.getAttributeNode(A),from:B})}catch(A){C(t.removed,{attribute:null,from:B})}if(B.removeAttribute(A),"is"===A&&!lA[A])if(JA||kA)try{gB(B)}catch(A){}else try{B.setAttribute(A,"")}catch(A){}},QB=function(A){var B=void 0,t=void 0;if(yA)A=""+A;else{var e=I(A,/^[\r\n\t ]+/);t=e&&e[0]}var i=gA?gA.createHTML(A):A;try{B=(new Z).parseFromString(i,"text/html")}catch(A){}if(!B||!B.documentElement){var Q=(B=nA.createHTMLDocument("")).body;Q.parentNode.removeChild(Q.parentNode.firstElementChild),Q.outerHTML=i}return A&&t&&B.body.insertBefore(g.createTextNode(t),B.body.childNodes[0]||null),rA.call(B,pA?"html":"body")[0]},nB=function(A){return sA.call(A.ownerDocument||A,A,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,(function(){return c.FILTER_ACCEPT}),!1)},sB=function(A){return!(A instanceof O||A instanceof X||"string"==typeof A.nodeName&&"string"==typeof A.textContent&&"function"==typeof A.removeChild&&A.attributes instanceof u&&"function"==typeof A.removeAttribute&&"function"==typeof A.setAttribute&&"string"==typeof A.namespaceURI&&"function"==typeof A.insertBefore)},rB=function(A){return"object"===(void 0===s?"undefined":v(s))?A instanceof s:A&&"object"===(void 0===A?"undefined":v(A))&&"number"==typeof A.nodeType&&"string"==typeof A.nodeName},cB=function(A,B,e){wA[A]&&o(wA[A],(function(A){A.call(t,B,e,KA)}))},EB=function(A){var B=void 0;if(cB("beforeSanitizeElements",A,null),sB(A))return gB(A),!0;if(I(A.nodeName,/[\u0080-\uFFFF]/))return gB(A),!0;var e=a(A.nodeName);if(cB("uponSanitizeElement",A,{tagName:e,allowedTags:DA}),!rB(A.firstElementChild)&&(!rB(A.content)||!rB(A.content.firstElementChild))&&F(/<[/\w]/g,A.innerHTML)&&F(/<[/\w]/g,A.textContent))return gB(A),!0;if(!DA[e]||UA[e]){if(SA&&!LA[e]){var g=tA(A),i=BA(A);if(i&&g)for(var Q=i.length-1;Q>=0;--Q)g.insertBefore($(i[Q],!0),AA(A))}return gB(A),!0}return A instanceof r&&!eB(A)?(gB(A),!0):"noscript"!==e&&"noembed"!==e||!F(/<\/no(script|embed)/i,A.innerHTML)?(HA&&3===A.nodeType&&(B=A.textContent,B=h(B,CA," "),B=h(B,aA," "),A.textContent!==B&&(C(t.removed,{element:A.cloneNode()}),A.textContent=B)),cB("afterSanitizeElements",A,null),!1):(gB(A),!0)},oB=function(A,B,t){if(xA&&("id"===B||"name"===B)&&(t in g||t in OA))return!1;if(GA&&F(IA,B));else if(mA&&F(hA,B));else{if(!lA[B]||NA[B])return!1;if(WA[B]);else if(F(FA,h(t,MA,"")));else if("src"!==B&&"xlink:href"!==B&&"href"!==B||"script"===A||0!==Y(t,"data:")||!PA[A])if(fA&&!F(YA,h(t,MA,"")));else if(t)return!1}return!0},wB=function(A){var B=void 0,e=void 0,g=void 0,i=void 0;cB("beforeSanitizeAttributes",A,null);var Q=A.attributes;if(Q){var n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:lA};for(i=Q.length;i--;){var s=B=Q[i],r=s.name,c=s.namespaceURI;if(e=M(B.value),g=a(r),n.attrName=g,n.attrValue=e,n.keepAttr=!0,n.forceKeepAttr=void 0,cB("uponSanitizeAttribute",A,n),e=n.attrValue,!n.forceKeepAttr&&(iB(r,A),n.keepAttr))if(F(/\/>/i,e))iB(r,A);else{HA&&(e=h(e,CA," "),e=h(e,aA," "));var E=A.nodeName.toLowerCase();if(oB(E,g,e))try{c?A.setAttributeNS(c,r,e):A.setAttribute(r,e),w(t.removed)}catch(A){}}}cB("afterSanitizeAttributes",A,null)}},CB=function A(B){var t=void 0,e=nB(B);for(cB("beforeSanitizeShadowDOM",B,null);t=e.nextNode();)cB("uponSanitizeShadowNode",t,null),EB(t)||(t.content instanceof Q&&A(t.content),wB(t));cB("afterSanitizeShadowDOM",B,null)};return t.sanitize=function(A,g){var i=void 0,n=void 0,r=void 0,c=void 0,E=void 0;if(A||(A="\x3c!--\x3e"),"string"!=typeof A&&!rB(A)){if("function"!=typeof A.toString)throw D("toString is not a function");if("string"!=typeof(A=A.toString()))throw D("dirty is not a string, aborting")}if(!t.isSupported){if("object"===v(B.toStaticHTML)||"function"==typeof B.toStaticHTML){if("string"==typeof A)return B.toStaticHTML(A);if(rB(A))return B.toStaticHTML(A.outerHTML)}return A}if(RA||XA(g),t.removed=[],"string"==typeof A&&(bA=!1),bA);else if(A instanceof s)1===(n=(i=QB("\x3c!----\x3e")).ownerDocument.importNode(A,!0)).nodeType&&"BODY"===n.nodeName||"HTML"===n.nodeName?i=n:i.appendChild(n);else{if(!JA&&!HA&&!pA&&-1===A.indexOf("<"))return gA&&jA?gA.createHTML(A):A;if(!(i=QB(A)))return JA?null:iA}i&&yA&&gB(i.firstChild);for(var o=nB(bA?A:i);r=o.nextNode();)3===r.nodeType&&r===c||EB(r)||(r.content instanceof Q&&CB(r.content),wB(r),c=r);if(c=null,bA)return A;if(JA){if(kA)for(E=cA.call(i.ownerDocument);i.firstChild;)E.appendChild(i.firstChild);else E=i;return TA&&(E=EA.call(e,E,!0)),E}var w=pA?i.outerHTML:i.innerHTML;return HA&&(w=h(w,CA," "),w=h(w,aA," ")),gA&&jA?gA.createHTML(w):w},t.setConfig=function(A){XA(A),RA=!0},t.clearConfig=function(){KA=null,RA=!1},t.isValidAttribute=function(A,B,t){KA||XA({});var e=a(A),g=a(B);return oB(e,g,t)},t.addHook=function(A,B){"function"==typeof B&&(wA[A]=wA[A]||[],C(wA[A],B))},t.removeHook=function(A){wA[A]&&w(wA[A])},t.removeHooks=function(A){wA[A]&&(wA[A]=[])},t.removeAllHooks=function(){wA={}},t}()}()},function(A,B){A.exports=function(A){const B=[],t=A=>{"text"===A.localName&&B.push(A);for(let B=0;B1&&void 0!==arguments[1]?arguments[1]:0}}function a(){for(var A=arguments.length,B=Array(A),t=0;t1&&void 0!==arguments[1]?arguments[1]:void 0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return F(A*M/180,B,t)}function u(A){var B=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return w(B)&&(B=A),{a:A,c:0,e:0,b:0,d:B,f:0}}function l(A,B){return{a:1,c:A,e:0,b:B,d:1,f:0}}var d=Math.tan;function U(A,B){return{a:1,c:d(A),e:0,b:d(B),d:1,f:0}}function N(A,B){return U(A*Math.PI/180,B*Math.PI/180)}function m(A){return f(A)}function G(A){return f(A)}function f(A){return"matrix("+A.a+","+A.b+","+A.c+","+A.d+","+A.e+","+A.f+")"}t.d(B,"applyToPoint",(function(){return e})),t.d(B,"applyToPoints",(function(){return g})),t.d(B,"fromObject",(function(){return i})),t.d(B,"fromString",(function(){return n})),t.d(B,"identity",(function(){return s})),t.d(B,"inverse",(function(){return r})),t.d(B,"isAffineMatrix",(function(){return o})),t.d(B,"rotate",(function(){return F})),t.d(B,"rotateDEG",(function(){return D})),t.d(B,"scale",(function(){return u})),t.d(B,"shear",(function(){return l})),t.d(B,"skew",(function(){return U})),t.d(B,"skewDEG",(function(){return N})),t.d(B,"toCSS",(function(){return m})),t.d(B,"toSVG",(function(){return G})),t.d(B,"toString",(function(){return f})),t.d(B,"transform",(function(){return a})),t.d(B,"compose",(function(){return I})),t.d(B,"translate",(function(){return C}))}])},function(A,B,t){const e=t(132);A.exports=(A,B)=>{let t=(new XMLSerializer).serializeToString(A);return B&&(t=e(t)),t}},function(A,B,t){const e=t(133);A.exports=function(A){const B=e();if("string"!=typeof A)throw new Error("SVG to be inlined is not a string");const t=new Set,g=/font-family="([^"]*)"/g;let i=g.exec(A);for(;i;)t.add(i[1]),i=g.exec(A);if(t.size>0){let e="",A=A.replace(/]*>/,"$&".concat(e))}return A}},function(A,B,t){let e;A.exports=function(){if(e)return e;e={"Sans Serif":t(342),Serif:t(343),Handwriting:t(344),Marker:t(345),Curly:t(346),Pixel:t(347),Scratch:t(348)};for(const A in e){const B=e[A];e[A]="@font-face {"+'font-family: "'.concat(A,'";src: url("data:application/x-font-ttf;charset=utf-8;base64,').concat(B,'");}')}if(!document.getElementById("scratch-font-styles")){const A=document.createElement("style");A.id="scratch-font-styles";for(const B in e)A.textContent+=e[B];document.body.insertBefore(A,document.body.firstChild)}return e}},function(A,B,t){var e=t(353),g=e(t(354)),i=e(t(356)),Q=e(t(357));A.exports=function(A,B,t){g(A,B).then((function(A){return i(A[0]).then(Q.bind(null,B)).then((function(B){return[B,A[1]]}))})).then(t.bind(null,null),t)}},function(A,B,t){const e=t(40),g=t(22),{loadSoundFromAsset:i}=t(45),{loadCostumeFromAsset:Q}=t(44),n=t(126),s=t(12),r=t(19);class c{constructor(A,B){this.runtime=B,A||(A=new g(B)),this.blocks=A,this.name="",this.costumes_=[],this.sounds=[],this.clones=[],this.soundBank=null,this.runtime&&this.runtime.audioEngine&&(this.soundBank=this.runtime.audioEngine.createBank())}set costumes(A){this.costumes_=[];for(const B of A)this.addCostumeAt(B,this.costumes_.length)}get costumes(){return this.costumes_}addCostumeAt(A,B){A.name||(A.name="");const t=this.costumes_.map(A=>A.name);A.name=s.unusedName(A.name,t),this.costumes_.splice(B,0,A)}deleteCostumeAt(A){return this.costumes.splice(A,1)[0]}createClone(A){const B=new e(this,this.runtime);if(B.isOriginal=0===this.clones.length,this.clones.push(B),B.initAudio(),B.isOriginal){const t="string"==typeof A?A:r.SPRITE_LAYER;B.initDrawable(t),this.runtime.fireTargetWasCreated(B)}else this.runtime.fireTargetWasCreated(B,this.clones[0]);return B}removeClone(A){this.runtime.fireTargetWasRemoved(A);const B=this.clones.indexOf(A);B>=0&&this.clones.splice(B,1)}duplicate(){const A=new c(null,this.runtime),B=this.blocks._blocks,t=Object.keys(B).map(A=>B[A]),e=JSON.parse(JSON.stringify(t));n(e),e.forEach(B=>{A.blocks.createBlock(B)});const g=this.runtime.targets.map(A=>A.sprite.name);A.name=s.unusedName(this.name,g);const r=[];return A.costumes=this.costumes_.map(A=>{const B=Object.assign({},A);return r.push(Q(B,this.runtime)),B}),A.sounds=this.sounds.map(B=>{const t=Object.assign({},B),e=B.asset;return r.push(i(t,e,this.runtime,A.soundBank)),t}),Promise.all(r).then(()=>A)}dispose(){this.soundBank&&this.soundBank.dispose()}}A.exports=c},function(A,B,t){const e=t(49),g=t(0);A.exports={deserializeSound:function(A,B,t,i){const Q=i||A.md5,n=B.storage;if(!n)return g.error("No storage module present; cannot load sound asset: ",Q),Promise.resolve(null);if(!t)return Promise.resolve(null);let s=t.file(Q);if(!s){const A=new RegExp("^([^/]*/)?".concat(Q,"$"));s=t.file(A)[0]}if(!s)return g.error("Could not find sound file associated with the ".concat(A.name," sound.")),Promise.resolve(null);if(!e.support.uint8array)return g.error("JSZip uint8array is not supported in this browser."),Promise.resolve(null);const r="mp3"===A.dataFormat.toLowerCase()?n.DataFormat.MP3:n.DataFormat.WAV;return s.async("uint8array").then(A=>n.createAsset(n.AssetType.Sound,r,A,null,!0)).then(B=>{A.asset=B,A.assetId=B.assetId,A.md5="".concat(B.assetId,".").concat(B.dataFormat)})},deserializeCostume:function(A,B,t,i,Q){const n=B.storage,s=A.assetId,r=i||"".concat(s,".").concat(A.dataFormat);if(!n)return g.error("No storage module present; cannot load costume asset: ",r),Promise.resolve(null);if(A.asset)return Promise.resolve(n.createAsset(A.asset.assetType,A.asset.dataFormat,new Uint8Array(Object.keys(A.asset.data).map(B=>A.asset.data[B])),null,!0)).then(B=>{A.asset=B,A.assetId=B.assetId,A.md5="".concat(B.assetId,".").concat(B.dataFormat)});if(!t)return Promise.resolve(null);let c=t.file(r);if(!c){const A=new RegExp("^([^/]*/)?".concat(r,"$"));c=t.file(A)[0]}if(!c)return g.error("Could not find costume file associated with the ".concat(A.name," costume.")),Promise.resolve(null);let E=null;const o=A.dataFormat.toLowerCase();if("svg"===o?E=n.AssetType.ImageVector:["png","bmp","jpeg","jpg","gif"].indexOf(o)>=0?E=n.AssetType.ImageBitmap:g.error("Unexpected file format for costume: ".concat(o)),!e.support.uint8array)return g.error("JSZip uint8array is not supported in this browser."),Promise.resolve(null);let w;if(A.textLayerMD5){const B=t.file(Q);if(!B)return g.error("Could not find text layer file associated with the ".concat(A.name," costume.")),Promise.resolve(null);w=B.async("uint8array").then(B=>n.createAsset(n.AssetType.ImageBitmap,"png",B,A.textLayerMD5)).then(B=>{A.textLayerAsset=B})}else w=Promise.resolve(null);return Promise.all([w,c.async("uint8array").then(A=>n.createAsset(E,o,A,null,!0)).then(B=>{A.asset=B,A.assetId=B.assetId,A.md5="".concat(B.assetId,".").concat(B.dataFormat)})])}}},function(A,B,t){const e=t(22),g=t(40),i=t(135),Q=t(30),n=t(0),s=t(10),r=t(12),c=t(4),E=t(361),o=t(60),w=t(13),C=t(58),a=t(19),{loadCostume:I}=t(44),{loadSound:h}=t(45),{deserializeCostume:Y,deserializeSound:M}=t(136),F=["argument","control","data","event","looks","math","motion","operator","procedures","sensing","sound"],D=function(A){const B=[{}];let t=0;const e=A.split(/(?=[^\\]%[nbs])/);for(let A=0;AA.inputName).filter(A=>A)},l=function A(B){let t=[];for(let e=0;e"".concat(A,"-").concat(r.replaceUnsafeChars(B),"-").concat(t);return function(t,e){return e&&(A={}),function(g,i){return e?(A["".concat(g,"-").concat(i)]=B(t,g,i),A["".concat(g,"-").concat(i)]):A["".concat(g,"-").concat(i)]?A["".concat(g,"-").concat(i)]:B(t,g,i)}}}(),N=function(){let A={};const B=[],t=s();return function(e){return e&&(A={}),{broadcastMsgMapUpdater:function(e,g){return""===(e=e.toLowerCase())&&(e=t),A[e]="broadcastMsgId-".concat(r.replaceUnsafeChars(e)),B.push(g),A[e]},globalBroadcastMsgs:A,allBroadcastFields:B,emptyMsgName:t}}}(),m=(A,B,t,e)=>{if(!E[A.cmd])return void n.warn("Could not find monitor block with opcode: ".concat(A.cmd));const g=E[A.cmd].opcode,i=g.indexOf("_"),Q=g.substring(0,i);if("videoSensing"===Q)return;if(-1===F.indexOf(Q)&&""!==Q&&!e.extensionIDs.has(Q)&&!A.visible)return;let s=null;if(!A.hasOwnProperty("target"))for(let B=0;B{const t=e.variables[B];return t.type===w.LIST_TYPE&&t.name===A.listName}).length>0&&(s=e,A.target=e.getName())}if(s=s||t.filter(B=>B.getName()===A.target)[0],!s)throw new Error("Cannot create monitor for target that cannot be found by name");const r=U(s.id,!1),[c,o]=H([A.cmd,A.param],null,r,e,{},null,null);"getVar:"===A.cmd?c.id=r(A.param,w.SCALAR_TYPE):"contentsOfList:"===A.cmd?c.id=r(A.param,w.LIST_TYPE):B.monitorBlockInfo.hasOwnProperty(c.opcode)?c.id=B.monitorBlockInfo[c.opcode].getId(s.id,c.fields):c.id=c.opcode,c.targetId=s.isStage?null:s.id,c.isMonitored=A.visible;const a=B.monitorBlocks._blocks[c.id];if(a)a.isMonitored=A.visible,a.targetId=c.targetId;else{const A=l([c]);for(let t=0;t{const[B,t,e,g,i,Q,n]=A,s=A[5]>=0,r=new o(null,n,s?null:1.5*B,s?null:2.2*t,1.5*e,2.2*g,!i);return s&&(r.blockId=Q,G.hasOwnProperty(Q)?G[Q].push(r):G[Q]=[r]),r}).forEach(A=>{M.comments[A.id]=A})}B.hasOwnProperty("scripts")&&function(A,B,t,e,g,i){let Q=0;for(let n=0;n{"number"==typeof A.blockId&&(A.blockId=null)})}if(E.updateTargetSpecificBlocks(n),B.hasOwnProperty("lists"))for(let A=0;A{C.costumes=A}),Promise.all(Y).then(A=>{C.sounds=A,C.soundBank=h||null});const f=[];if(B.children)for(let e=0;ePromise.all(f).then(A=>{if(M.isStage){const A=D.globalBroadcastMsgs,B=D.allBroadcastFields,t=D.emptyMsgName;if(A[t]){let e=1;for(;A["message".concat(e)];)e+=1;const g="message".concat(e);A[g]=A[t],delete A[t];for(let A=0;A(A.layerOrder=B,A)).sort((A,B)=>A.targetPaneOrder-B.targetPaneOrder);return B.forEach(A=>{delete A.targetPaneOrder}),B},H=function A(B,t,e,g,i,r,c){const o=r&&"number"==typeof c&&!isNaN(c)?r[c]:null,C=function(A){const B=A[0],t=B&&E[B];return t?"function"==typeof t?t(A):t:(n.warn("Couldn't find SB2 block: ".concat(B)),null)}(B);if(!C)return o&&o.forEach(A=>{A.blockId=null,A.x=A.y=0}),[null,c+1];const a=B[0],I=C.opcode.indexOf("_"),h=C.opcode.substring(0,I);-1===F.indexOf(h)&&""!==h&&g.extensionIDs.add(h);const Y={id:s(),opcode:C.opcode,inputs:{},fields:{},next:null,shadow:!1,children:[]};o&&(Y.comment=o[o.length-1].id,o.forEach(A=>{A.id===Y.comment?A.blockId=Y.id:(A.blockId=null,A.x=A.y=0)})),c++;const M=i.expectedArg;"call"===a&&(C.argMap=D(B[1]));for(let E=0;E0){let A=null;for(let t=0;tI(s.md5,s,t,2)))}const{soundBank:n,soundPromises:s}=i;if(B.hasOwnProperty("sounds"))for(let A=0;Ah(i,t,n)))}const c=i.children;if(B.children)for(let e=0;ePromise.resolve(A)).then(i=>G(A,B,g,!t,e,i)).then(f).then(A=>({targets:A,extensions:g}))}}},function(A,B){class t{constructor(){this.left=-1/0,this.right=1/0,this.bottom=-1/0,this.top=1/0}initFromBounds(A,B,t,e){this.left=A,this.right=B,this.bottom=t,this.top=e}initFromPointsAABB(A){this.left=1/0,this.right=-1/0,this.top=-1/0,this.bottom=1/0;for(let B=0;Bthis.right&&(this.right=t),e>this.top&&(this.top=e),e=A.bottom&&A.top>=this.bottom}contains(A){return A.left>this.left&&A.rightthis.bottom}clamp(A,B,t,e){this.left=Math.max(this.left,A),this.right=Math.min(this.right,B),this.bottom=Math.max(this.bottom,t),this.top=Math.min(this.top,e),this.left=Math.min(this.left,B),this.right=Math.max(this.right,A),this.bottom=Math.min(this.bottom,e),this.top=Math.max(this.top,t)}snapToInt(){this.left=Math.floor(this.left),this.right=Math.ceil(this.right),this.bottom=Math.floor(this.bottom),this.top=Math.ceil(this.top)}static intersect(A,B,e=new t){return e.left=Math.max(A.left,B.left),e.right=Math.min(A.right,B.right),e.top=Math.min(A.top,B.top),e.bottom=Math.max(A.bottom,B.bottom),e}static union(A,B,e=new t){return e.left=Math.min(A.left,B.left),e.right=Math.max(A.right,B.right),e.top=Math.max(A.top,B.top),e.bottom=Math.min(A.bottom,B.bottom),e}get width(){return Math.abs(this.left-this.right)}get height(){return Math.abs(this.top-this.bottom)}}A.exports=t},function(A,B,t){const e=t(14),{rgbToHsv:g,hsvToRgb:i}=t(373),Q=t(35),n=[0,0,0];A.exports=class{static transformColor(A,B,t){if(0===B[3])return B;let e=A.enabledEffects;"number"==typeof t&&(e&=t);const s=A.getUniforms(),r=0!=(e&Q.EFFECT_INFO.color.mask),c=0!=(e&Q.EFFECT_INFO.brightness.mask);if(r||c){const A=B[3]/255;if(B[0]/=A,B[1]/=A,B[2]/=A,r){const A=g(B,n),t=.055,e=.09;A[2]{const t=[],e=A=>{A.localName!==B&&void 0!==B||!A.getAttribute||t.push(A);for(let B=0;B{const B=document.createElement("span"),t=A.outerHTML,g=e.sanitize(t,{USE_PROFILES:{svg:!0},FORBID_TAGS:["a","audio","canvas","video"],ADD_DATA_URI_TAGS:["image"]});let i,Q;try{B.innerHTML=g,document.body.appendChild(B),i=B.children[0].getBBox()}finally{document.body.removeChild(B)}Q=0===i.width||0===i.height?0:(A=>{let B=0;const t=A=>{A.getAttribute&&(A.getAttribute("stroke")&&(B=Math.max(B,1)),A.getAttribute("stroke-width")&&(B=Math.max(B,Number(A.getAttribute("stroke-width"))||0)));for(let B=0;B{B&&(A=>{const B=s(A,"linearGradient");for(const A of B)A.getAttribute("x2")||A.setAttribute("x2","0")})(A),n(A,window),(A=>{const B=s(A,"image"),t="image-rendering: optimizespeed; image-rendering: pixelated;";for(const A of B)A.getAttribute("style")?A.setAttribute("style","".concat(t," ").concat(A.getAttribute("style"))):A.setAttribute("style",t)})(A),B?((A=>{const B=[],t=A=>{"text"===A.localName&&B.push(A);for(let B=0;B{const B=s(A);for(const A of B){if(!A.style)continue;const B=A.style.stroke||A.getAttribute("stroke");B&&B.match(/^url\(#.*\)$/)&&(A.style["stroke-linejoin"]="round",A.style["stroke-linecap"]="round")}})(A)):A.getAttribute("viewBox")?A.getAttribute("width")&&A.getAttribute("height")||(A.setAttribute("width",A.viewBox.baseVal.width),A.setAttribute("height",A.viewBox.baseVal.height)):r(A)};A.exports=(A,B)=>{const t=new DOMParser;A=Q(A);const e=t.parseFromString(A,"text/xml");if(e.childNodes.length<1||"svg"!==e.documentElement.localName)throw new Error("Document does not appear to be SVG.");const g=e.documentElement;return c(g,B),g}},function(A,B){A.exports=function(A){const B=[],t=A=>{"text"===A.localName&&B.push(A);for(let B=0;B{let t=(new XMLSerializer).serializeToString(A);return B&&(t=e(t)),t}},function(A,B,t){const e=t(133);A.exports=function(A){const B=e();if("string"!=typeof A)throw new Error("SVG to be inlined is not a string");const t=new Set,g=/font-family="([^"]*)"/g;let i=g.exec(A);for(;i;)t.add(i[1]),i=g.exec(A);if(t.size>0){let e="",A=A.replace(/]*>/,"$&".concat(e))}return A}},function(A,B,t){var e,g;g=t(387),e=function(){function A(A){var B,t,e;(B="function"==typeof A.readUInt32BE&&"function"==typeof A.slice)||A instanceof Uint8Array?(B?(this.highStart=A.readUInt32BE(0),this.errorValue=A.readUInt32BE(4),t=A.readUInt32BE(8),A=A.slice(12)):(e=new DataView(A.buffer),this.highStart=e.getUint32(0),this.errorValue=e.getUint32(4),t=e.getUint32(8),A=A.subarray(12)),A=g(A,new Uint8Array(t)),A=g(A,new Uint8Array(t)),this.data=new Uint32Array(A.buffer)):(this.data=A.data,this.highStart=A.highStart,this.errorValue=A.errorValue)}return 11,5,6,32,64,63,2,32,31,2048,32,2080,2080,32,2112,4,A.prototype.get=function(A){var B;return A<0||A>1114111?this.errorValue:A<55296||A>56319&&A<=65535?(B=(this.data[A>>5]<<2)+(31&A),this.data[B]):A<=65535?(B=(this.data[2048+(A-55296>>5)]<<2)+(31&A),this.data[B]):A>11)],B=((B=this.data[B+(A>>5&63)])<<2)+(31&A),this.data[B]):this.data[this.data.length-4]},A}(),A.exports=e},function(A,B,t){const e=t(66),g={ImageBitmap:{contentType:"image/png",name:"ImageBitmap",runtimeFormat:e.PNG,immutable:!0},ImageVector:{contentType:"image/svg+xml",name:"ImageVector",runtimeFormat:e.SVG,immutable:!0},Project:{contentType:"application/json",name:"Project",runtimeFormat:e.JSON,immutable:!1},Sound:{contentType:"audio/x-wav",name:"Sound",runtimeFormat:e.WAV,immutable:!0},Sprite:{contentType:"application/json",name:"Sprite",runtimeFormat:e.JSON,immutable:!0}};A.exports=g},function(A,B){A.exports=class{constructor(A){this.parent=A}load(A,B,t){return Promise.reject(new Error("No asset of type ".concat(A," for ID ").concat(B," with format ").concat(t)))}}},function(A,B,t){const e=t(68);A.exports=class extends e{get DEFAULT_VALUE(){return 100}get name(){return"volume"}initialize(){this.inputNode=this.audioEngine.audioContext.createGain(),this.outputNode=this.inputNode,this.initialized=!0}_set(A){this.value=A;const{gain:B}=this.outputNode,{currentTime:t,DECAY_DURATION:e}=this.audioEngine;B.linearRampToValueAtTime(A/100,t+e)}dispose(){this.initialized&&(this.outputNode.disconnect(),this.inputNode=null,this.outputNode=null,this.target=null,this.initialized=!1)}}},function(A,B,t){"use strict";var e,g=function(){return void 0===e&&(e=Boolean(window&&document&&document.all&&!window.atob)),e},i=function(){var A={};return function(B){if(void 0===A[B]){var t=document.querySelector(B);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(A){t=null}A[B]=t}return A[B]}}(),Q=[];function n(A){for(var B=-1,t=0;t{const B={};return B._refreshExtensionPrimitives=A._refreshExtensionPrimitives.bind(A),B._registerExtensionPrimitives=A._registerExtensionPrimitives.bind(A),B})(this.runtime)).catch(A=>{r.error("Failed to register runtime service: ".concat(JSON.stringify(A)))}),this.editingTarget=null,this._dragTarget=null,this.runtime.on(E.SCRIPT_GLOW_ON,A=>{this.emit(E.SCRIPT_GLOW_ON,A)}),this.runtime.on(E.SCRIPT_GLOW_OFF,A=>{this.emit(E.SCRIPT_GLOW_OFF,A)}),this.runtime.on(E.BLOCK_GLOW_ON,A=>{this.emit(E.BLOCK_GLOW_ON,A)}),this.runtime.on(E.BLOCK_GLOW_OFF,A=>{this.emit(E.BLOCK_GLOW_OFF,A)}),this.runtime.on(E.PROJECT_START,()=>{this.emit(E.PROJECT_START)}),this.runtime.on(E.PROJECT_RUN_START,()=>{this.emit(E.PROJECT_RUN_START)}),this.runtime.on(E.PROJECT_RUN_STOP,()=>{this.emit(E.PROJECT_RUN_STOP)}),this.runtime.on(E.PROJECT_CHANGED,()=>{this.emit(E.PROJECT_CHANGED)}),this.runtime.on(E.VISUAL_REPORT,A=>{this.emit(E.VISUAL_REPORT,A)}),this.runtime.on(E.TARGETS_UPDATE,A=>{this.emitTargetsUpdate(A)}),this.runtime.on(E.MONITORS_UPDATE,A=>{this.emit(E.MONITORS_UPDATE,A)}),this.runtime.on(E.BLOCK_DRAG_UPDATE,A=>{this.emit(E.BLOCK_DRAG_UPDATE,A)}),this.runtime.on(E.BLOCK_DRAG_END,(A,B)=>{this.emit(E.BLOCK_DRAG_END,A,B)}),this.runtime.on(E.EXTENSION_ADDED,A=>{this.emit(E.EXTENSION_ADDED,A)}),this.runtime.on(E.EXTENSION_FIELD_ADDED,(A,B)=>{this.emit(E.EXTENSION_FIELD_ADDED,A,B)}),this.runtime.on(E.BLOCKSINFO_UPDATE,A=>{this.emit(E.BLOCKSINFO_UPDATE,A)}),this.runtime.on(E.BLOCKS_NEED_UPDATE,()=>{this.emitWorkspaceUpdate()}),this.runtime.on(E.TOOLBOX_EXTENSIONS_NEED_UPDATE,()=>{this.extensionManager.refreshBlocks()}),this.runtime.on(E.PERIPHERAL_LIST_UPDATE,A=>{this.emit(E.PERIPHERAL_LIST_UPDATE,A)}),this.runtime.on(E.USER_PICKED_PERIPHERAL,A=>{this.emit(E.USER_PICKED_PERIPHERAL,A)}),this.runtime.on(E.PERIPHERAL_CONNECTED,()=>this.emit(E.PERIPHERAL_CONNECTED)),this.runtime.on(E.PERIPHERAL_REQUEST_ERROR,()=>this.emit(E.PERIPHERAL_REQUEST_ERROR)),this.runtime.on(E.PERIPHERAL_DISCONNECTED,()=>this.emit(E.PERIPHERAL_DISCONNECTED)),this.runtime.on(E.PERIPHERAL_CONNECTION_LOST_ERROR,A=>this.emit(E.PERIPHERAL_CONNECTION_LOST_ERROR,A)),this.runtime.on(E.PERIPHERAL_SCAN_TIMEOUT,()=>this.emit(E.PERIPHERAL_SCAN_TIMEOUT)),this.runtime.on(E.MIC_LISTENING,A=>{this.emit(E.MIC_LISTENING,A)}),this.runtime.on(E.RUNTIME_STARTED,()=>{this.emit(E.RUNTIME_STARTED)}),this.runtime.on(E.RUNTIME_STOPPED,()=>{this.emit(E.RUNTIME_STOPPED)}),this.runtime.on(E.HAS_CLOUD_DATA_UPDATE,A=>{this.emit(E.HAS_CLOUD_DATA_UPDATE,A)}),this.runtime.on(E.RUNTIME_OPTIONS_CHANGED,A=>{this.emit(E.RUNTIME_OPTIONS_CHANGED,A)}),this.runtime.on(E.COMPILER_OPTIONS_CHANGED,A=>{this.emit(E.COMPILER_OPTIONS_CHANGED,A)}),this.runtime.on(E.FRAMERATE_CHANGED,A=>{this.emit(E.FRAMERATE_CHANGED,A)}),this.runtime.on(E.INTERPOLATION_CHANGED,A=>{this.emit(E.INTERPOLATION_CHANGED,A)}),this.runtime.on(E.COMPILE_ERROR,(A,B)=>{this.emit(E.COMPILE_ERROR,A,B)}),this.extensionManager=new s(this.runtime);for(const A of u)this.extensionManager.loadExtensionIdSync(A);this.blockListener=this.blockListener.bind(this),this.flyoutBlockListener=this.flyoutBlockListener.bind(this),this.monitorBlockListener=this.monitorBlockListener.bind(this),this.variableListener=this.variableListener.bind(this)}start(){this.runtime.start()}stop(){this.runtime.stop()}greenFlag(){this.runtime.greenFlag()}setTurboMode(A){this.runtime.turboMode=!!A,this.runtime.turboMode?this.emit(E.TURBO_MODE_ON):this.emit(E.TURBO_MODE_OFF)}setCompatibilityMode(A){this.runtime.setCompatibilityMode(!!A)}setFramerate(A){this.runtime.setFramerate(A)}setInterpolation(A){this.runtime.setInterpolation(A)}setRuntimeOptions(A){this.runtime.setRuntimeOptions(A)}setCompilerOptions(A){this.runtime.setCompilerOptions(A)}addAddonBlock(A){this.runtime.addAddonBlock(A)}storeProjectOptions(){this.runtime.storeProjectOptions(),this.editingTarget.isStage&&this.emitWorkspaceUpdate()}enableDebug(){return this.runtime.enableDebug(),"enabled debug mode"}stopAll(){this.runtime.stopAll()}clear(){this.runtime.dispose(),this.editingTarget=null,this.emitTargetsUpdate(!1)}getPlaygroundData(){const A=this,B=this.runtime.threads.filter(B=>B.target===A.editingTarget),t=JSON.stringify(B,(A,B)=>{if("target"!==A&&"blockContainer"!==A)return B},2);this.emit("playgroundData",{blocks:this.editingTarget.blocks,threads:t})}postIOData(A,B){this.runtime.ioDevices[A]&&this.runtime.ioDevices[A].postData(B)}setVideoProvider(A){this.runtime.ioDevices.video.setProvider(A)}setCloudProvider(A){this.runtime.ioDevices.cloud.setProvider(A)}scanForPeripheral(A){this.runtime.scanForPeripheral(A)}connectPeripheral(A,B){this.runtime.connectPeripheral(A,B)}disconnectPeripheral(A){this.runtime.disconnectPeripheral(A)}getPeripheralIsConnected(A){return this.runtime.getPeripheralIsConnected(A)}loadProject(A){"object"!=typeof A||A instanceof ArrayBuffer||ArrayBuffer.isView(A)||(A=JSON.stringify(A));return new Promise((B,e)=>{const g=t(134);g(A,!1,(t,i)=>{if(t)return"{"!==A[0]&&A[0]!=="{".charCodeAt(0)?e(t):("string"!=typeof A&&(A=(new TextDecoder).decode(A)),A=I.parse(A),A=JSON.stringify(A),g(A,!1,(A,g)=>{if(A)return e(t);B(g)}));B(i)})}).catch(B=>{const{SB1File:e,ValidationError:g}=t(418);try{const B=new e(A),t=B.json;return t.projectVersion=2,Promise.resolve([t,B.zip])}catch(A){if(!(A instanceof g||"Non-ascii character in FixedAsciiString"==="".concat(A)))return Promise.reject(A)}return Promise.reject(B)}).then(A=>this.deserializeProject(A[0],A[1])).then(()=>this.runtime.emitProjectLoaded()).catch(A=>A.hasOwnProperty("validationError")?Promise.reject(JSON.stringify(A)):Promise.reject(A))}downloadProjectId(A){const B=this.runtime.storage;if(!B)return void r.error("No storage module present; cannot load project: ",A);const t=this;B.load(B.AssetType.Project,A).then(A=>{t.loadProject(A.data)})}saveProjectSb3(){const A=M(this.runtime),B=F(this.runtime),t=this.toJSON(),e=new i;return e.file("project.json",t),this._addFileDescsToZip(A.concat(B),e),e.generateAsync({type:"blob",mimeType:"application/x.scratch.sb3",compression:"DEFLATE",compressionOptions:{level:6}})}saveProjectSb3DontZip(){const A=M(this.runtime),B=F(this.runtime),t=this.toJSON(),g={"project.json":(new e).encode(t)};for(const t of A.concat(B))g[t.fileName]=t.fileContent;return g}get assets(){return this.runtime.targets.reduce((A,B)=>A.concat(B.sprite.sounds.map(A=>A.asset)).concat(B.sprite.costumes.map(A=>A.asset)),[])}_addFileDescsToZip(A,B){for(let t=0;t("undefined"!=typeof performance&&(performance.mark("scratch-vm-deserialize-end"),performance.measure("scratch-vm-deserialize","scratch-vm-deserialize-start","scratch-vm-deserialize-end")),this.installTargets(A,B,!0)))}async installTargets(A,B,t){await this.extensionManager.allAsyncExtensionsLoaded();const e=[];return B.extensionIDs.forEach(A=>{if(!this.extensionManager.isExtensionLoaded(A)){const t=B.extensionURLs.get(A)||A;e.push(this.extensionManager.loadExtensionURL(t))}}),A=A.filter(A=>!!A),Promise.all(e).then(()=>{A.forEach(A=>{this.runtime.addTarget(A),A.updateAllDrawableProperties(),A.isSprite()&&this.renameSprite(A.id,A.getName())}),this.runtime.executableTargets.sort((A,B)=>A.layerOrder-B.layerOrder),A.forEach(A=>{delete A.layerOrder}),t&&A.length>1?this.editingTarget=A[1]:this.editingTarget=A[0],t||this.editingTarget.fixUpVariableReferences(),t&&this.runtime.parseProjectOptions(),this.emitTargetsUpdate(!1),this.emitWorkspaceUpdate(),this.runtime.setEditingTarget(this.editingTarget),this.runtime.ioDevices.cloud.setStage(this.runtime.getTargetForStage())})}addSprite(A){"object"!=typeof A||A instanceof ArrayBuffer||ArrayBuffer.isView(A)||(A=JSON.stringify(A));return new Promise((B,e)=>{t(134)(A,!0,(A,t)=>{if(A)return e(A);B(t)})}).then(A=>{const B=A[0].projectVersion;return 2===B?this._addSprite2(A[0],A[1]):3===B?this._addSprite3(A[0],A[1]):Promise.reject("".concat("Sprite Upload Error:"," Unable to verify sprite version."))}).then(()=>this.runtime.emitProjectChanged()).catch(A=>A.hasOwnProperty("validationError")?Promise.reject(JSON.stringify(A)):Promise.reject("".concat("Sprite Upload Error:"," ").concat(A)))}_addSprite2(A,B){return t(137).deserialize(A,this.runtime,!0,B).then(({targets:A,extensions:B})=>this.installTargets(A,B,!1))}_addSprite3(A,B){return t(33).deserialize(A,this.runtime,B,!0).then(({targets:A,extensions:B})=>this.installTargets(A,B,!1))}addCostume(A,B,t,e){const g=t?this.runtime.getTargetById(t):this.editingTarget;return g?h(A,B,this.runtime,e).then(()=>{g.addCostume(B),g.setCostume(g.getCostumes().length-1),this.runtime.emitProjectChanged()}):Promise.reject()}addCostumeFromLibrary(A,B){return this.editingTarget?this.addCostume(A,B,this.editingTarget.id,2):Promise.reject()}duplicateCostume(A){const B=this.editingTarget.getCostumes()[A],t=Object.assign({},B),e="".concat(t.assetId,".").concat(t.dataFormat);return h(e,t,this.runtime).then(()=>{this.editingTarget.addCostume(t,A+1),this.editingTarget.setCostume(A+1),this.emitTargetsUpdate()})}duplicateSound(A){const B=this.editingTarget.getSounds()[A],t=Object.assign({},B);return Y(t,this.runtime,this.editingTarget.sprite.soundBank).then(()=>{this.editingTarget.addSound(t,A+1),this.emitTargetsUpdate()})}renameCostume(A,B){this.editingTarget.renameCostume(A,B),this.emitTargetsUpdate()}deleteCostume(A){const B=this.editingTarget.deleteCostume(A);if(B){const A=this.editingTarget;return this.runtime.emitProjectChanged(),()=>{A.addCostume(B),this.emitTargetsUpdate()}}return null}addSound(A,B){const t=B?this.runtime.getTargetById(B):this.editingTarget;return t?Y(A,this.runtime,t.sprite.soundBank).then(()=>{t.addSound(A),this.emitTargetsUpdate()}):new Promise.reject}renameSound(A,B){this.editingTarget.renameSound(A,B),this.emitTargetsUpdate()}getSoundBuffer(A){const B=this.editingTarget.sprite.sounds[A].soundId;return B&&this.runtime&&this.runtime.audioEngine?this.editingTarget.sprite.soundBank.getSoundPlayer(B).buffer:null}updateSoundBuffer(A,B,t){const e=this.editingTarget.sprite.sounds[A],g=e?e.soundId:null;if(g&&this.runtime&&this.runtime.audioEngine&&(this.editingTarget.sprite.soundBank.getSoundPlayer(g).buffer=B),t){e.format="";const A=this.runtime.storage;e.asset=A.createAsset(A.AssetType.Sound,A.DataFormat.WAV,t,null,!0),e.assetId=e.asset.assetId,e.dataFormat=A.DataFormat.WAV,e.md5="".concat(e.assetId,".").concat(e.dataFormat),e.sampleCount=B.length,e.rate=B.sampleRate}this.emitTargetsUpdate()}deleteSound(A){const B=this.editingTarget,t=this.editingTarget.deleteSound(A);if(t){this.runtime.emitProjectChanged();return()=>{B.addSound(t),this.emitTargetsUpdate()}}return null}getCostume(A){const B=this.editingTarget.getCostumes()[A].asset;if(!B||!this.runtime||!this.runtime.storage)return null;const t=B.dataFormat;return t===this.runtime.storage.DataFormat.SVG?B.decodeText():t===this.runtime.storage.DataFormat.PNG||t===this.runtime.storage.DataFormat.JPG?B.encodeDataURI():(r.error("Unhandled format: ".concat(B.dataFormat)),null)}updateBitmap(A,B,t,e,g){const i=this.editingTarget.getCostumes()[A];if(!(i&&this.runtime&&this.runtime.renderer))return;i.rotationCenterX=t,i.rotationCenterY=e;const n=0===B.sourceWidth?0:B.width,s=0===B.sourceHeight?0:B.height,r=document.createElement("canvas");r.width=n,r.height=s;r.getContext("2d").putImageData(B,0,0),this.runtime.renderer.updateBitmapSkin(i.skinId,r,g,[t/g,e/g]),r.toBlob(A=>{const B=new FileReader;B.addEventListener("loadend",()=>{const A=this.runtime.storage;i.dataFormat=A.DataFormat.PNG,i.bitmapResolution=g,i.size=[n,s],i.asset=A.createAsset(A.AssetType.ImageBitmap,i.dataFormat,Q.from(B.result),null,!0),i.assetId=i.asset.assetId,i.md5="".concat(i.assetId,".").concat(i.dataFormat),this.emitTargetsUpdate()}),A&&B.readAsArrayBuffer(A)})}updateSvg(A,B,t,g){const i=this.editingTarget.getCostumes()[A];i&&this.runtime&&this.runtime.renderer&&(i.rotationCenterX=t,i.rotationCenterY=g,this.runtime.renderer.updateSVGSkin(i.skinId,B,[t,g]),i.size=this.runtime.renderer.getSkinSize(i.skinId));const Q=this.runtime.storage;i.dataFormat=Q.DataFormat.SVG,i.bitmapResolution=1,i.asset=Q.createAsset(Q.AssetType.ImageVector,i.dataFormat,(new e).encode(B),null,!0),i.assetId=i.asset.assetId,i.md5="".concat(i.assetId,".").concat(i.dataFormat),this.emitTargetsUpdate()}addBackdrop(A,B){return h(A,B,this.runtime).then(()=>{const A=this.runtime.getTargetForStage();A.addCostume(B),A.setCostume(A.getCostumes().length-1),this.runtime.emitProjectChanged()})}renameSprite(A,B){const t=this.runtime.getTargetById(A);if(!t)throw new Error("No target with the provided id.");{if(!t.isSprite())throw new Error("Cannot rename non-sprite targets.");const A=t.sprite;if(!A)throw new Error("No sprite associated with this target.");if(B&&-1===D.indexOf(B)){const e=this.runtime.targets.filter(A=>A.isSprite()&&A.id!==t.id).map(A=>A.sprite.name),g=A.name,i=o.unusedName(B,e);if(A.name=i,g===i)return;const Q=this.runtime.targets;for(let A=0;AA.id).indexOf(B.id);if(!B.isSprite())throw new Error("Cannot delete non-sprite targets.");const e=B.sprite;if(!e)throw new Error("No sprite associated with this target.");const g=this.exportSprite(A,"uint8array"),i=()=>g.then(A=>this.addSprite(A));B.deleteMonitors();const Q=this.editingTarget;for(let A=0;A0?this.setEditingTarget(this.runtime.targets[A].id):this.editingTarget=null}}return this.emitTargetsUpdate(),i}throw new Error("No target with the provided id.")}duplicateSprite(A){const B=this.runtime.getTargetById(A);if(!B)throw new Error("No target with the provided id.");if(!B.isSprite())throw new Error("Cannot duplicate non-sprite targets.");if(!B.sprite)throw new Error("No sprite associated with this target.");return B.duplicate().then(A=>{this.runtime.addTarget(A),A.goBehindOther(B),this.setEditingTarget(A.id)})}attachAudioEngine(A){this.runtime.attachAudioEngine(A)}attachRenderer(A){this.runtime.attachRenderer(A)}get renderer(){return this.runtime&&this.runtime.renderer}attachV2SVGAdapter(){}attachV2BitmapAdapter(A){this.runtime.attachV2BitmapAdapter(A)}attachStorage(A){this.runtime.attachStorage(A)}setLocale(A,B){return A!==w.setup().locale&&w.setup({locale:A,translations:{[A]:B}}),this.extensionManager.refreshBlocks()}getLocale(){return w.setup().locale}blockListener(A){this.editingTarget&&this.editingTarget.blocks.blocklyListen(A)}flyoutBlockListener(A){this.runtime.flyoutBlocks.blocklyListen(A)}monitorBlockListener(A){-1!==["create","change"].indexOf(A.type)&&this.runtime.monitorBlocks.blocklyListen(A)}variableListener(A){-1!==["var_create","var_rename","var_delete"].indexOf(A.type)&&this.runtime.getTargetForStage().blocks.blocklyListen(A)}setEditingTarget(A){if(this.editingTarget&&A===this.editingTarget.id)return;const B=this.runtime.getTargetById(A);B&&(this.editingTarget=B,this.emitTargetsUpdate(!1),this.emitWorkspaceUpdate(),this.runtime.setEditingTarget(B))}shareBlocksToTarget(A,B,e){const g=t(33),i=JSON.parse(JSON.stringify(A));a(i);const Q=this.runtime.getTargetById(B);if(e){this.runtime.getTargetById(e).resolveVariableSharingConflictsWithTarget(i,Q)}const n=new Set(i.map(A=>g.getExtensionIdForOpcode(A.opcode)).filter(A=>!!A).filter(A=>!this.extensionManager.isExtensionLoaded(A))),s=Array.from(n,A=>this.extensionManager.loadExtensionURL(A));return Promise.all(s).then(()=>{i.forEach(A=>{Q.blocks.createBlock(A)}),Q.blocks.updateTargetSpecificBlocks(Q.isStage)})}shareCostumeToTarget(A,B){const t=this.editingTarget.getCostumes()[A],e=Object.assign({},t),g="".concat(e.assetId,".").concat(e.dataFormat);return h(g,e,this.runtime).then(()=>{const A=this.runtime.getTargetById(B);A&&(A.addCostume(e),A.setCostume(A.getCostumes().length-1))})}shareSoundToTarget(A,B){const t=this.editingTarget.getSounds()[A],e=Object.assign({},t),g=this.runtime.getTargetById(B);return Y(e,this.runtime,g.sprite.soundBank).then(()=>{g&&(g.addSound(e),this.emitTargetsUpdate())})}refreshWorkspace(){this.editingTarget&&(this.emitWorkspaceUpdate(),this.runtime.setEditingTarget(this.editingTarget),this.emitTargetsUpdate(!1))}emitTargetsUpdate(A){let B;void 0===A&&(A=!0);const t=()=>(B||(B=this.runtime.targets.filter(A=>!A.hasOwnProperty("isOriginal")||A.isOriginal).map(A=>A.toJSON())),B);this.emit("targetsUpdate",{get targetList(){return t()},editingTarget:this.editingTarget?this.editingTarget.id:null}),A&&this.runtime.emitProjectChanged()}emitWorkspaceUpdate(){const A=this.runtime.getTargetForStage().variables;let B=[];for(const t in A)A[t].type===C.BROADCAST_MESSAGE_TYPE&&B.push(t);for(let A=0;At[A]),i=Object.keys(e).map(A=>e[A]),Q=Object.keys(this.editingTarget.comments).map(A=>this.editingTarget.comments[A]).filter(A=>null===A.blockId),n='\n \n '.concat(g.map(A=>A.toXML()).join(),"\n ").concat(i.map(A=>A.toXML(!0)).join(),"\n \n ").concat(Q.map(A=>A.toXML()).join(),"\n ").concat(this.editingTarget.blocks.toXML(this.editingTarget.comments),"\n ");this.emit("workspaceUpdate",{xml:n})}getTargetIdForDrawableId(A){const B=this.runtime.getTargetByDrawableId(A);return B&&B.hasOwnProperty("id")&&B.hasOwnProperty("isStage")&&!B.isStage?B.id:null}reorderTarget(A,B){let t=this.runtime.targets;if((A=c.clamp(A,0,t.length-1))===(B=c.clamp(B,0,t.length-1)))return!1;const e=t[A];return t=t.slice(0,A).concat(t.slice(A+1)),t.splice(B,0,e),this.runtime.targets=t,this.emitTargetsUpdate(),!0}reorderCostume(A,B,t){const e=this.runtime.getTargetById(A);if(e){const A=e.reorderCostume(B,t);return A&&this.runtime.emitProjectChanged(),A}return!1}reorderSound(A,B,t){const e=this.runtime.getTargetById(A);if(e){const A=e.reorderSound(B,t);return A&&this.runtime.emitProjectChanged(),A}return!1}startDrag(A){const B=this.runtime.getTargetById(A);B&&(this._dragTarget=B,B.startDrag())}stopDrag(A){const B=this.runtime.getTargetById(A);B&&(this._dragTarget=null,B.stopDrag(),this.setEditingTarget(B.sprite&&B.sprite.clones[0]?B.sprite.clones[0].id:B.id))}postSpriteInfo(A){this._dragTarget?this._dragTarget.postSpriteInfo(A):this.editingTarget.postSpriteInfo(A),this.runtime.emitProjectChanged()}setVariableValue(A,B,t){const e=this.runtime.getTargetById(A);if(e){const A=e.lookupVariableById(B);if(A)return A.value=t,A.isCloud&&this.runtime.ioDevices.cloud.requestUpdateVariable(A.name,A.value),!0}return!1}getVariableValue(A,B){const t=this.runtime.getTargetById(A);if(t){const A=t.lookupVariableById(B);if(A)return A.value}return null}configureScratchLinkSocketFactory(A){this.runtime.configureScratchLinkSocketFactory(A)}}l.isTurboWarp=!0,A.exports=l},function(A,B,t){"use strict";var e=t(23),g=t(2),i=t(8),Q=t(87),n=t(88),s=t(55),r=t(189),c=t(190),E=t(38),o=t(202),w=function(A,B,t){var e,Q=g.getTypeOf(B),c=g.extend(t||{},n);c.date=c.date||new Date,null!==c.compression&&(c.compression=c.compression.toUpperCase()),"string"==typeof c.unixPermissions&&(c.unixPermissions=parseInt(c.unixPermissions,8)),c.unixPermissions&&16384&c.unixPermissions&&(c.dir=!0),c.dosPermissions&&16&c.dosPermissions&&(c.dir=!0),c.dir&&(A=a(A)),c.createFolders&&(e=C(A))&&I.call(this,e,!0);var w="string"===Q&&!1===c.binary&&!1===c.base64;t&&void 0!==t.binary||(c.binary=!w),(B instanceof s&&0===B.uncompressedSize||c.dir||!B||0===B.length)&&(c.base64=!1,c.binary=!0,B="",c.compression="STORE",Q="string");var h=null;h=B instanceof s||B instanceof i?B:E.isNode&&E.isStream(B)?new o(A,B):g.prepareContent(A,B,c.binary,c.optimizedBinaryString,c.base64);var Y=new r(A,h,c);this.files[A]=Y},C=function(A){"/"===A.slice(-1)&&(A=A.substring(0,A.length-1));var B=A.lastIndexOf("/");return B>0?A.substring(0,B):""},a=function(A){return"/"!==A.slice(-1)&&(A+="/"),A},I=function(A,B){return B=void 0!==B?B:n.createFolders,A=a(A),this.files[A]||w.call(this,A,null,{dir:!0,createFolders:B}),this.files[A]};function h(A){return"[object RegExp]"===Object.prototype.toString.call(A)}var Y={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(A){var B,t,e;for(B in this.files)this.files.hasOwnProperty(B)&&(e=this.files[B],(t=B.slice(this.root.length,B.length))&&B.slice(0,this.root.length)===this.root&&A(t,e))},filter:function(A){var B=[];return this.forEach((function(t,e){A(t,e)&&B.push(e)})),B},file:function(A,B,t){if(1===arguments.length){if(h(A)){var e=A;return this.filter((function(A,B){return!B.dir&&e.test(A)}))}var g=this.files[this.root+A];return g&&!g.dir?g:null}return A=this.root+A,w.call(this,A,B,t),this},folder:function(A){if(!A)return this;if(h(A))return this.filter((function(B,t){return t.dir&&A.test(B)}));var B=this.root+A,t=I.call(this,B),e=this.clone();return e.root=t.name,e},remove:function(A){A=this.root+A;var B=this.files[A];if(B||("/"!==A.slice(-1)&&(A+="/"),B=this.files[A]),B&&!B.dir)delete this.files[A];else for(var t=this.filter((function(B,t){return t.name.slice(0,A.length)===A})),e=0;e0?Q-4:Q;for(t=0;t>16&255,s[c++]=B>>8&255,s[c++]=255&B;2===n&&(B=g[A.charCodeAt(t)]<<2|g[A.charCodeAt(t+1)]>>4,s[c++]=255&B);1===n&&(B=g[A.charCodeAt(t)]<<10|g[A.charCodeAt(t+1)]<<4|g[A.charCodeAt(t+2)]>>2,s[c++]=B>>8&255,s[c++]=255&B);return s},B.fromByteArray=function(A){for(var B,t=A.length,g=t%3,i=[],Q=0,n=t-g;Qn?n:Q+16383));1===g?(B=A[t-1],i.push(e[B>>2]+e[B<<4&63]+"==")):2===g&&(B=(A[t-2]<<8)+A[t-1],i.push(e[B>>10]+e[B>>4&63]+e[B<<2&63]+"="));return i.join("")};for(var e=[],g=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=Q.length;n0)throw new Error("Invalid string. Length must be a multiple of 4");var t=A.indexOf("=");return-1===t&&(t=B),[t,t===B?0:4-t%4]}function c(A,B,t){for(var g,i,Q=[],n=B;n>18&63]+e[i>>12&63]+e[i>>6&63]+e[63&i]);return Q.join("")}g["-".charCodeAt(0)]=62,g["_".charCodeAt(0)]=63},function(A,B){ -/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -B.read=function(A,B,t,e,g){var i,Q,n=8*g-e-1,s=(1<>1,c=-7,E=t?g-1:0,o=t?-1:1,w=A[B+E];for(E+=o,i=w&(1<<-c)-1,w>>=-c,c+=n;c>0;i=256*i+A[B+E],E+=o,c-=8);for(Q=i&(1<<-c)-1,i>>=-c,c+=e;c>0;Q=256*Q+A[B+E],E+=o,c-=8);if(0===i)i=1-r;else{if(i===s)return Q?NaN:1/0*(w?-1:1);Q+=Math.pow(2,e),i-=r}return(w?-1:1)*Q*Math.pow(2,i-e)},B.write=function(A,B,t,e,g,i){var Q,n,s,r=8*i-g-1,c=(1<>1,o=23===g?Math.pow(2,-24)-Math.pow(2,-77):0,w=e?0:i-1,C=e?1:-1,a=B<0||0===B&&1/B<0?1:0;for(B=Math.abs(B),isNaN(B)||B===1/0?(n=isNaN(B)?1:0,Q=c):(Q=Math.floor(Math.log(B)/Math.LN2),B*(s=Math.pow(2,-Q))<1&&(Q--,s*=2),(B+=Q+E>=1?o/s:o*Math.pow(2,1-E))*s>=2&&(Q++,s/=2),Q+E>=c?(n=0,Q=c):Q+E>=1?(n=(B*s-1)*Math.pow(2,g),Q+=E):(n=B*Math.pow(2,E-1)*Math.pow(2,g),Q=0));g>=8;A[t+w]=255&n,w+=C,n/=256,g-=8);for(Q=Q<0;A[t+w]=255&Q,w+=C,Q/=256,r-=8);A[t+w-C]|=128*a}},function(A,B,t){A.exports=g;var e=t(11).EventEmitter;function g(){e.call(this)}t(24)(g,e),g.Readable=t(50),g.Writable=t(167),g.Duplex=t(168),g.Transform=t(169),g.PassThrough=t(170),g.Stream=g,g.prototype.pipe=function(A,B){var t=this;function g(B){A.writable&&!1===A.write(B)&&t.pause&&t.pause()}function i(){t.readable&&t.resume&&t.resume()}t.on("data",g),A.on("drain",i),A._isStdio||B&&!1===B.end||(t.on("end",n),t.on("close",s));var Q=!1;function n(){Q||(Q=!0,A.end())}function s(){Q||(Q=!0,"function"==typeof A.destroy&&A.destroy())}function r(A){if(c(),0===e.listenerCount(this,"error"))throw A}function c(){t.removeListener("data",g),A.removeListener("drain",i),t.removeListener("end",n),t.removeListener("close",s),t.removeListener("error",r),A.removeListener("error",r),t.removeListener("end",c),t.removeListener("close",c),A.removeListener("close",c)}return t.on("error",r),A.on("error",r),t.on("end",c),t.on("close",c),A.on("close",c),A.emit("pipe",t),A}},function(A,B){},function(A,B,t){"use strict";var e=t(51).Buffer,g=t(161);A.exports=function(){function A(){!function(A,B){if(!(A instanceof B))throw new TypeError("Cannot call a class as a function")}(this,A),this.head=null,this.tail=null,this.length=0}return A.prototype.push=function(A){var B={data:A,next:null};this.length>0?this.tail.next=B:this.head=B,this.tail=B,++this.length},A.prototype.unshift=function(A){var B={data:A,next:this.head};0===this.length&&(this.tail=B),this.head=B,++this.length},A.prototype.shift=function(){if(0!==this.length){var A=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,A}},A.prototype.clear=function(){this.head=this.tail=null,this.length=0},A.prototype.join=function(A){if(0===this.length)return"";for(var B=this.head,t=""+B.data;B=B.next;)t+=A+B.data;return t},A.prototype.concat=function(A){if(0===this.length)return e.alloc(0);if(1===this.length)return this.head.data;for(var B,t,g,i=e.allocUnsafe(A>>>0),Q=this.head,n=0;Q;)B=Q.data,t=i,g=n,B.copy(t,g),n+=Q.data.length,Q=Q.next;return i},A}(),g&&g.inspect&&g.inspect.custom&&(A.exports.prototype[g.inspect.custom]=function(){var A=g.inspect({length:this.length});return this.constructor.name+" "+A})},function(A,B){},function(A,B,t){(function(A){var e=void 0!==A&&A||"undefined"!=typeof self&&self||window,g=Function.prototype.apply;function i(A,B){this._id=A,this._clearFn=B}B.setTimeout=function(){return new i(g.call(setTimeout,e,arguments),clearTimeout)},B.setInterval=function(){return new i(g.call(setInterval,e,arguments),clearInterval)},B.clearTimeout=B.clearInterval=function(A){A&&A.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(e,this._id)},B.enroll=function(A,B){clearTimeout(A._idleTimeoutId),A._idleTimeout=B},B.unenroll=function(A){clearTimeout(A._idleTimeoutId),A._idleTimeout=-1},B._unrefActive=B.active=function(A){clearTimeout(A._idleTimeoutId);var B=A._idleTimeout;B>=0&&(A._idleTimeoutId=setTimeout((function(){A._onTimeout&&A._onTimeout()}),B))},t(163),B.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==A&&A.setImmediate||this&&this.setImmediate,B.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==A&&A.clearImmediate||this&&this.clearImmediate}).call(this,t(9))},function(A,B,t){(function(A,B){!function(A,t){"use strict";if(!A.setImmediate){var e,g,i,Q,n,s=1,r={},c=!1,E=A.document,o=Object.getPrototypeOf&&Object.getPrototypeOf(A);o=o&&o.setTimeout?o:A,"[object process]"==={}.toString.call(A.process)?e=function(A){B.nextTick((function(){C(A)}))}:!function(){if(A.postMessage&&!A.importScripts){var B=!0,t=A.onmessage;return A.onmessage=function(){B=!1},A.postMessage("","*"),A.onmessage=t,B}}()?A.MessageChannel?((i=new MessageChannel).port1.onmessage=function(A){C(A.data)},e=function(A){i.port2.postMessage(A)}):E&&"onreadystatechange"in E.createElement("script")?(g=E.documentElement,e=function(A){var B=E.createElement("script");B.onreadystatechange=function(){C(A),B.onreadystatechange=null,g.removeChild(B),B=null},g.appendChild(B)}):e=function(A){setTimeout(C,0,A)}:(Q="setImmediate$"+Math.random()+"$",n=function(B){B.source===A&&"string"==typeof B.data&&0===B.data.indexOf(Q)&&C(+B.data.slice(Q.length))},A.addEventListener?A.addEventListener("message",n,!1):A.attachEvent("onmessage",n),e=function(B){A.postMessage(Q+B,"*")}),o.setImmediate=function(A){"function"!=typeof A&&(A=new Function(""+A));for(var B=new Array(arguments.length-1),t=0;tt;)B.push(arguments[t++]);return I[++a]=function(){n("function"==typeof A?A:Function(A),B)},e(a),a},w=function(A){delete I[A]},"process"==t(184)(E)?e=function(A){E.nextTick(Q(h,A,1))}:C?(i=(g=new C).port2,g.port1.onmessage=Y,e=Q(i.postMessage,i,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(e=function(A){c.postMessage(A+"","*")},c.addEventListener("message",Y,!1)):e="onreadystatechange"in r("script")?function(A){s.appendChild(r("script")).onreadystatechange=function(){s.removeChild(this),h.call(A)}}:function(A){setTimeout(Q(h,A,1),0)}),A.exports={set:o,clear:w}},function(A,B){A.exports=function(A,B,t){var e=void 0===t;switch(B.length){case 0:return e?A():A.call(t);case 1:return e?A(B[0]):A.call(t,B[0]);case 2:return e?A(B[0],B[1]):A.call(t,B[0],B[1]);case 3:return e?A(B[0],B[1],B[2]):A.call(t,B[0],B[1],B[2]);case 4:return e?A(B[0],B[1],B[2],B[3]):A.call(t,B[0],B[1],B[2],B[3])}return A.apply(t,B)}},function(A,B,t){A.exports=t(39).document&&document.documentElement},function(A,B){var t={}.toString;A.exports=function(A){return t.call(A).slice(8,-1)}},function(A,B,t){"use strict";var e=t(186);function g(){}var i={},Q=["REJECTED"],n=["FULFILLED"],s=["PENDING"];function r(A){if("function"!=typeof A)throw new TypeError("resolver must be a function");this.state=s,this.queue=[],this.outcome=void 0,A!==g&&w(this,A)}function c(A,B,t){this.promise=A,"function"==typeof B&&(this.onFulfilled=B,this.callFulfilled=this.otherCallFulfilled),"function"==typeof t&&(this.onRejected=t,this.callRejected=this.otherCallRejected)}function E(A,B,t){e((function(){var e;try{e=B(t)}catch(B){return i.reject(A,B)}e===A?i.reject(A,new TypeError("Cannot resolve promise with itself")):i.resolve(A,e)}))}function o(A){var B=A&&A.then;if(A&&("object"==typeof A||"function"==typeof A)&&"function"==typeof B)return function(){B.apply(A,arguments)}}function w(A,B){var t=!1;function e(B){t||(t=!0,i.reject(A,B))}function g(B){t||(t=!0,i.resolve(A,B))}var Q=C((function(){B(g,e)}));"error"===Q.status&&e(Q.value)}function C(A,B){var t={};try{t.value=A(B),t.status="success"}catch(A){t.status="error",t.value=A}return t}A.exports=r,r.prototype.catch=function(A){return this.then(null,A)},r.prototype.then=function(A,B){if("function"!=typeof A&&this.state===n||"function"!=typeof B&&this.state===Q)return this;var t=new this.constructor(g);this.state!==s?E(t,this.state===n?A:B,this.outcome):this.queue.push(new c(t,A,B));return t},c.prototype.callFulfilled=function(A){i.resolve(this.promise,A)},c.prototype.otherCallFulfilled=function(A){E(this.promise,this.onFulfilled,A)},c.prototype.callRejected=function(A){i.reject(this.promise,A)},c.prototype.otherCallRejected=function(A){E(this.promise,this.onRejected,A)},i.resolve=function(A,B){var t=C(o,B);if("error"===t.status)return i.reject(A,t.value);var e=t.value;if(e)w(A,e);else{A.state=n,A.outcome=B;for(var g=-1,Q=A.queue.length;++g0?B.windowBits=-B.windowBits:B.gzip&&B.windowBits>0&&B.windowBits<16&&(B.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new n,this.strm.avail_out=0;var t=e.deflateInit2(this.strm,B.level,B.method,B.windowBits,B.memLevel,B.strategy);if(0!==t)throw new Error(Q[t]);if(B.header&&e.deflateSetHeader(this.strm,B.header),B.dictionary){var c;if(c="string"==typeof B.dictionary?i.string2buf(B.dictionary):"[object ArrayBuffer]"===s.call(B.dictionary)?new Uint8Array(B.dictionary):B.dictionary,0!==(t=e.deflateSetDictionary(this.strm,c)))throw new Error(Q[t]);this._dict_set=!0}}function c(A,B){var t=new r(B);if(t.push(A,!0),t.err)throw t.msg||Q[t.err];return t.result}r.prototype.push=function(A,B){var t,Q,n=this.strm,r=this.options.chunkSize;if(this.ended)return!1;Q=B===~~B?B:!0===B?4:0,"string"==typeof A?n.input=i.string2buf(A):"[object ArrayBuffer]"===s.call(A)?n.input=new Uint8Array(A):n.input=A,n.next_in=0,n.avail_in=n.input.length;do{if(0===n.avail_out&&(n.output=new g.Buf8(r),n.next_out=0,n.avail_out=r),1!==(t=e.deflate(n,Q))&&0!==t)return this.onEnd(t),this.ended=!0,!1;0!==n.avail_out&&(0!==n.avail_in||4!==Q&&2!==Q)||("string"===this.options.to?this.onData(i.buf2binstring(g.shrinkBuf(n.output,n.next_out))):this.onData(g.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||0===n.avail_out)&&1!==t);return 4===Q?(t=e.deflateEnd(this.strm),this.onEnd(t),this.ended=!0,0===t):2!==Q||(this.onEnd(0),n.avail_out=0,!0)},r.prototype.onData=function(A){this.chunks.push(A)},r.prototype.onEnd=function(A){0===A&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=g.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg},B.Deflate=r,B.deflate=c,B.deflateRaw=function(A,B){return(B=B||{}).raw=!0,c(A,B)},B.gzip=function(A,B){return(B=B||{}).gzip=!0,c(A,B)}},function(A,B,t){"use strict";var e,g=t(16),i=t(195),Q=t(93),n=t(94),s=t(57);function r(A,B){return A.msg=s[B],B}function c(A){return(A<<1)-(A>4?9:0)}function E(A){for(var B=A.length;--B>=0;)A[B]=0}function o(A){var B=A.state,t=B.pending;t>A.avail_out&&(t=A.avail_out),0!==t&&(g.arraySet(A.output,B.pending_buf,B.pending_out,t,A.next_out),A.next_out+=t,B.pending_out+=t,A.total_out+=t,A.avail_out-=t,B.pending-=t,0===B.pending&&(B.pending_out=0))}function w(A,B){i._tr_flush_block(A,A.block_start>=0?A.block_start:-1,A.strstart-A.block_start,B),A.block_start=A.strstart,o(A.strm)}function C(A,B){A.pending_buf[A.pending++]=B}function a(A,B){A.pending_buf[A.pending++]=B>>>8&255,A.pending_buf[A.pending++]=255&B}function I(A,B){var t,e,g=A.max_chain_length,i=A.strstart,Q=A.prev_length,n=A.nice_match,s=A.strstart>A.w_size-262?A.strstart-(A.w_size-262):0,r=A.window,c=A.w_mask,E=A.prev,o=A.strstart+258,w=r[i+Q-1],C=r[i+Q];A.prev_length>=A.good_match&&(g>>=2),n>A.lookahead&&(n=A.lookahead);do{if(r[(t=B)+Q]===C&&r[t+Q-1]===w&&r[t]===r[i]&&r[++t]===r[i+1]){i+=2,t++;do{}while(r[++i]===r[++t]&&r[++i]===r[++t]&&r[++i]===r[++t]&&r[++i]===r[++t]&&r[++i]===r[++t]&&r[++i]===r[++t]&&r[++i]===r[++t]&&r[++i]===r[++t]&&iQ){if(A.match_start=B,Q=e,e>=n)break;w=r[i+Q-1],C=r[i+Q]}}}while((B=E[B&c])>s&&0!=--g);return Q<=A.lookahead?Q:A.lookahead}function h(A){var B,t,e,i,s,r,c,E,o,w,C=A.w_size;do{if(i=A.window_size-A.lookahead-A.strstart,A.strstart>=C+(C-262)){g.arraySet(A.window,A.window,C,C,0),A.match_start-=C,A.strstart-=C,A.block_start-=C,B=t=A.hash_size;do{e=A.head[--B],A.head[B]=e>=C?e-C:0}while(--t);B=t=C;do{e=A.prev[--B],A.prev[B]=e>=C?e-C:0}while(--t);i+=C}if(0===A.strm.avail_in)break;if(r=A.strm,c=A.window,E=A.strstart+A.lookahead,o=i,w=void 0,(w=r.avail_in)>o&&(w=o),t=0===w?0:(r.avail_in-=w,g.arraySet(c,r.input,r.next_in,w,E),1===r.state.wrap?r.adler=Q(r.adler,c,w,E):2===r.state.wrap&&(r.adler=n(r.adler,c,w,E)),r.next_in+=w,r.total_in+=w,w),A.lookahead+=t,A.lookahead+A.insert>=3)for(s=A.strstart-A.insert,A.ins_h=A.window[s],A.ins_h=(A.ins_h<=3&&(A.ins_h=(A.ins_h<=3)if(e=i._tr_tally(A,A.strstart-A.match_start,A.match_length-3),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=3){A.match_length--;do{A.strstart++,A.ins_h=(A.ins_h<=3&&(A.ins_h=(A.ins_h<4096)&&(A.match_length=2)),A.prev_length>=3&&A.match_length<=A.prev_length){g=A.strstart+A.lookahead-3,e=i._tr_tally(A,A.strstart-1-A.prev_match,A.prev_length-3),A.lookahead-=A.prev_length-1,A.prev_length-=2;do{++A.strstart<=g&&(A.ins_h=(A.ins_h<15&&(n=2,e-=16),i<1||i>9||8!==t||e<8||e>15||B<0||B>9||Q<0||Q>4)return r(A,-2);8===e&&(e=9);var s=new D;return A.state=s,s.strm=A,s.wrap=n,s.gzhead=null,s.w_bits=e,s.w_size=1<A.pending_buf_size-5&&(t=A.pending_buf_size-5);;){if(A.lookahead<=1){if(h(A),0===A.lookahead&&0===B)return 1;if(0===A.lookahead)break}A.strstart+=A.lookahead,A.lookahead=0;var e=A.block_start+t;if((0===A.strstart||A.strstart>=e)&&(A.lookahead=A.strstart-e,A.strstart=e,w(A,!1),0===A.strm.avail_out))return 1;if(A.strstart-A.block_start>=A.w_size-262&&(w(A,!1),0===A.strm.avail_out))return 1}return A.insert=0,4===B?(w(A,!0),0===A.strm.avail_out?3:4):(A.strstart>A.block_start&&(w(A,!1),A.strm.avail_out),1)})),new F(4,4,8,4,Y),new F(4,5,16,8,Y),new F(4,6,32,32,Y),new F(4,4,16,16,M),new F(8,16,32,32,M),new F(8,16,128,128,M),new F(8,32,128,256,M),new F(32,128,258,1024,M),new F(32,258,258,4096,M)],B.deflateInit=function(A,B){return d(A,B,8,15,8,0)},B.deflateInit2=d,B.deflateReset=l,B.deflateResetKeep=u,B.deflateSetHeader=function(A,B){return A&&A.state?2!==A.state.wrap?-2:(A.state.gzhead=B,0):-2},B.deflate=function(A,B){var t,g,Q,s;if(!A||!A.state||B>5||B<0)return A?r(A,-2):-2;if(g=A.state,!A.output||!A.input&&0!==A.avail_in||666===g.status&&4!==B)return r(A,0===A.avail_out?-5:-2);if(g.strm=A,t=g.last_flush,g.last_flush=B,42===g.status)if(2===g.wrap)A.adler=0,C(g,31),C(g,139),C(g,8),g.gzhead?(C(g,(g.gzhead.text?1:0)+(g.gzhead.hcrc?2:0)+(g.gzhead.extra?4:0)+(g.gzhead.name?8:0)+(g.gzhead.comment?16:0)),C(g,255&g.gzhead.time),C(g,g.gzhead.time>>8&255),C(g,g.gzhead.time>>16&255),C(g,g.gzhead.time>>24&255),C(g,9===g.level?2:g.strategy>=2||g.level<2?4:0),C(g,255&g.gzhead.os),g.gzhead.extra&&g.gzhead.extra.length&&(C(g,255&g.gzhead.extra.length),C(g,g.gzhead.extra.length>>8&255)),g.gzhead.hcrc&&(A.adler=n(A.adler,g.pending_buf,g.pending,0)),g.gzindex=0,g.status=69):(C(g,0),C(g,0),C(g,0),C(g,0),C(g,0),C(g,9===g.level?2:g.strategy>=2||g.level<2?4:0),C(g,3),g.status=113);else{var I=8+(g.w_bits-8<<4)<<8;I|=(g.strategy>=2||g.level<2?0:g.level<6?1:6===g.level?2:3)<<6,0!==g.strstart&&(I|=32),I+=31-I%31,g.status=113,a(g,I),0!==g.strstart&&(a(g,A.adler>>>16),a(g,65535&A.adler)),A.adler=1}if(69===g.status)if(g.gzhead.extra){for(Q=g.pending;g.gzindex<(65535&g.gzhead.extra.length)&&(g.pending!==g.pending_buf_size||(g.gzhead.hcrc&&g.pending>Q&&(A.adler=n(A.adler,g.pending_buf,g.pending-Q,Q)),o(A),Q=g.pending,g.pending!==g.pending_buf_size));)C(g,255&g.gzhead.extra[g.gzindex]),g.gzindex++;g.gzhead.hcrc&&g.pending>Q&&(A.adler=n(A.adler,g.pending_buf,g.pending-Q,Q)),g.gzindex===g.gzhead.extra.length&&(g.gzindex=0,g.status=73)}else g.status=73;if(73===g.status)if(g.gzhead.name){Q=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>Q&&(A.adler=n(A.adler,g.pending_buf,g.pending-Q,Q)),o(A),Q=g.pending,g.pending===g.pending_buf_size)){s=1;break}s=g.gzindexQ&&(A.adler=n(A.adler,g.pending_buf,g.pending-Q,Q)),0===s&&(g.gzindex=0,g.status=91)}else g.status=91;if(91===g.status)if(g.gzhead.comment){Q=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>Q&&(A.adler=n(A.adler,g.pending_buf,g.pending-Q,Q)),o(A),Q=g.pending,g.pending===g.pending_buf_size)){s=1;break}s=g.gzindexQ&&(A.adler=n(A.adler,g.pending_buf,g.pending-Q,Q)),0===s&&(g.status=103)}else g.status=103;if(103===g.status&&(g.gzhead.hcrc?(g.pending+2>g.pending_buf_size&&o(A),g.pending+2<=g.pending_buf_size&&(C(g,255&A.adler),C(g,A.adler>>8&255),A.adler=0,g.status=113)):g.status=113),0!==g.pending){if(o(A),0===A.avail_out)return g.last_flush=-1,0}else if(0===A.avail_in&&c(B)<=c(t)&&4!==B)return r(A,-5);if(666===g.status&&0!==A.avail_in)return r(A,-5);if(0!==A.avail_in||0!==g.lookahead||0!==B&&666!==g.status){var Y=2===g.strategy?function(A,B){for(var t;;){if(0===A.lookahead&&(h(A),0===A.lookahead)){if(0===B)return 1;break}if(A.match_length=0,t=i._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,t&&(w(A,!1),0===A.strm.avail_out))return 1}return A.insert=0,4===B?(w(A,!0),0===A.strm.avail_out?3:4):A.last_lit&&(w(A,!1),0===A.strm.avail_out)?1:2}(g,B):3===g.strategy?function(A,B){for(var t,e,g,Q,n=A.window;;){if(A.lookahead<=258){if(h(A),A.lookahead<=258&&0===B)return 1;if(0===A.lookahead)break}if(A.match_length=0,A.lookahead>=3&&A.strstart>0&&(e=n[g=A.strstart-1])===n[++g]&&e===n[++g]&&e===n[++g]){Q=A.strstart+258;do{}while(e===n[++g]&&e===n[++g]&&e===n[++g]&&e===n[++g]&&e===n[++g]&&e===n[++g]&&e===n[++g]&&e===n[++g]&&gA.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=3?(t=i._tr_tally(A,1,A.match_length-3),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(t=i._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),t&&(w(A,!1),0===A.strm.avail_out))return 1}return A.insert=0,4===B?(w(A,!0),0===A.strm.avail_out?3:4):A.last_lit&&(w(A,!1),0===A.strm.avail_out)?1:2}(g,B):e[g.level].func(g,B);if(3!==Y&&4!==Y||(g.status=666),1===Y||3===Y)return 0===A.avail_out&&(g.last_flush=-1),0;if(2===Y&&(1===B?i._tr_align(g):5!==B&&(i._tr_stored_block(g,0,0,!1),3===B&&(E(g.head),0===g.lookahead&&(g.strstart=0,g.block_start=0,g.insert=0))),o(A),0===A.avail_out))return g.last_flush=-1,0}return 4!==B?0:g.wrap<=0?1:(2===g.wrap?(C(g,255&A.adler),C(g,A.adler>>8&255),C(g,A.adler>>16&255),C(g,A.adler>>24&255),C(g,255&A.total_in),C(g,A.total_in>>8&255),C(g,A.total_in>>16&255),C(g,A.total_in>>24&255)):(a(g,A.adler>>>16),a(g,65535&A.adler)),o(A),g.wrap>0&&(g.wrap=-g.wrap),0!==g.pending?0:1)},B.deflateEnd=function(A){var B;return A&&A.state?42!==(B=A.state.status)&&69!==B&&73!==B&&91!==B&&103!==B&&113!==B&&666!==B?r(A,-2):(A.state=null,113===B?r(A,-3):0):-2},B.deflateSetDictionary=function(A,B){var t,e,i,n,s,r,c,o,w=B.length;if(!A||!A.state)return-2;if(2===(n=(t=A.state).wrap)||1===n&&42!==t.status||t.lookahead)return-2;for(1===n&&(A.adler=Q(A.adler,B,w,0)),t.wrap=0,w>=t.w_size&&(0===n&&(E(t.head),t.strstart=0,t.block_start=0,t.insert=0),o=new g.Buf8(t.w_size),g.arraySet(o,B,w-t.w_size,t.w_size,0),B=o,w=t.w_size),s=A.avail_in,r=A.next_in,c=A.input,A.avail_in=w,A.next_in=0,A.input=B,h(t);t.lookahead>=3;){e=t.strstart,i=t.lookahead-2;do{t.ins_h=(t.ins_h<=0;)A[B]=0}var i=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Q=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],s=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],r=new Array(576);g(r);var c=new Array(60);g(c);var E=new Array(512);g(E);var o=new Array(256);g(o);var w=new Array(29);g(w);var C,a,I,h=new Array(30);function Y(A,B,t,e,g){this.static_tree=A,this.extra_bits=B,this.extra_base=t,this.elems=e,this.max_length=g,this.has_stree=A&&A.length}function M(A,B){this.dyn_tree=A,this.max_code=0,this.stat_desc=B}function F(A){return A<256?E[A]:E[256+(A>>>7)]}function D(A,B){A.pending_buf[A.pending++]=255&B,A.pending_buf[A.pending++]=B>>>8&255}function u(A,B,t){A.bi_valid>16-t?(A.bi_buf|=B<>16-A.bi_valid,A.bi_valid+=t-16):(A.bi_buf|=B<>>=1,t<<=1}while(--B>0);return t>>>1}function U(A,B,t){var e,g,i=new Array(16),Q=0;for(e=1;e<=15;e++)i[e]=Q=Q+t[e-1]<<1;for(g=0;g<=B;g++){var n=A[2*g+1];0!==n&&(A[2*g]=d(i[n]++,n))}}function N(A){var B;for(B=0;B<286;B++)A.dyn_ltree[2*B]=0;for(B=0;B<30;B++)A.dyn_dtree[2*B]=0;for(B=0;B<19;B++)A.bl_tree[2*B]=0;A.dyn_ltree[512]=1,A.opt_len=A.static_len=0,A.last_lit=A.matches=0}function m(A){A.bi_valid>8?D(A,A.bi_buf):A.bi_valid>0&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0}function G(A,B,t,e){var g=2*B,i=2*t;return A[g]>1;t>=1;t--)f(A,i,t);g=s;do{t=A.heap[1],A.heap[1]=A.heap[A.heap_len--],f(A,i,1),e=A.heap[1],A.heap[--A.heap_max]=t,A.heap[--A.heap_max]=e,i[2*g]=i[2*t]+i[2*e],A.depth[g]=(A.depth[t]>=A.depth[e]?A.depth[t]:A.depth[e])+1,i[2*t+1]=i[2*e+1]=g,A.heap[1]=g++,f(A,i,1)}while(A.heap_len>=2);A.heap[--A.heap_max]=A.heap[1],function(A,B){var t,e,g,i,Q,n,s=B.dyn_tree,r=B.max_code,c=B.stat_desc.static_tree,E=B.stat_desc.has_stree,o=B.stat_desc.extra_bits,w=B.stat_desc.extra_base,C=B.stat_desc.max_length,a=0;for(i=0;i<=15;i++)A.bl_count[i]=0;for(s[2*A.heap[A.heap_max]+1]=0,t=A.heap_max+1;t<573;t++)(i=s[2*s[2*(e=A.heap[t])+1]+1]+1)>C&&(i=C,a++),s[2*e+1]=i,e>r||(A.bl_count[i]++,Q=0,e>=w&&(Q=o[e-w]),n=s[2*e],A.opt_len+=n*(i+Q),E&&(A.static_len+=n*(c[2*e+1]+Q)));if(0!==a){do{for(i=C-1;0===A.bl_count[i];)i--;A.bl_count[i]--,A.bl_count[i+1]+=2,A.bl_count[C]--,a-=2}while(a>0);for(i=C;0!==i;i--)for(e=A.bl_count[i];0!==e;)(g=A.heap[--t])>r||(s[2*g+1]!==i&&(A.opt_len+=(i-s[2*g+1])*s[2*g],s[2*g+1]=i),e--)}}(A,B),U(i,r,A.bl_count)}function R(A,B,t){var e,g,i=-1,Q=B[1],n=0,s=7,r=4;for(0===Q&&(s=138,r=3),B[2*(t+1)+1]=65535,e=0;e<=t;e++)g=Q,Q=B[2*(e+1)+1],++n>=7;e<30;e++)for(h[e]=g<<7,A=0;A<1<0?(2===A.strm.data_type&&(A.strm.data_type=function(A){var B,t=4093624447;for(B=0;B<=31;B++,t>>>=1)if(1&t&&0!==A.dyn_ltree[2*B])return 0;if(0!==A.dyn_ltree[18]||0!==A.dyn_ltree[20]||0!==A.dyn_ltree[26])return 1;for(B=32;B<256;B++)if(0!==A.dyn_ltree[2*B])return 1;return 0}(A)),p(A,A.l_desc),p(A,A.d_desc),Q=function(A){var B;for(R(A,A.dyn_ltree,A.l_desc.max_code),R(A,A.dyn_dtree,A.d_desc.max_code),p(A,A.bl_desc),B=18;B>=3&&0===A.bl_tree[2*s[B]+1];B--);return A.opt_len+=3*(B+1)+5+5+4,B}(A),g=A.opt_len+3+7>>>3,(i=A.static_len+3+7>>>3)<=g&&(g=i)):g=i=t+5,t+4<=g&&-1!==B?k(A,B,t,e):4===A.strategy||i===g?(u(A,2+(e?1:0),3),H(A,r,c)):(u(A,4+(e?1:0),3),function(A,B,t,e){var g;for(u(A,B-257,5),u(A,t-1,5),u(A,e-4,4),g=0;g>>8&255,A.pending_buf[A.d_buf+2*A.last_lit+1]=255&B,A.pending_buf[A.l_buf+A.last_lit]=255&t,A.last_lit++,0===B?A.dyn_ltree[2*t]++:(A.matches++,B--,A.dyn_ltree[2*(o[t]+256+1)]++,A.dyn_dtree[2*F(B)]++),A.last_lit===A.lit_bufsize-1},B._tr_align=function(A){u(A,2,3),l(A,256,r),function(A){16===A.bi_valid?(D(A,A.bi_buf),A.bi_buf=0,A.bi_valid=0):A.bi_valid>=8&&(A.pending_buf[A.pending++]=255&A.bi_buf,A.bi_buf>>=8,A.bi_valid-=8)}(A)}},function(A,B,t){"use strict";var e=t(197),g=t(16),i=t(95),Q=t(97),n=t(57),s=t(96),r=t(200),c=Object.prototype.toString;function E(A){if(!(this instanceof E))return new E(A);this.options=g.assign({chunkSize:16384,windowBits:0,to:""},A||{});var B=this.options;B.raw&&B.windowBits>=0&&B.windowBits<16&&(B.windowBits=-B.windowBits,0===B.windowBits&&(B.windowBits=-15)),!(B.windowBits>=0&&B.windowBits<16)||A&&A.windowBits||(B.windowBits+=32),B.windowBits>15&&B.windowBits<48&&0==(15&B.windowBits)&&(B.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var t=e.inflateInit2(this.strm,B.windowBits);if(t!==Q.Z_OK)throw new Error(n[t]);if(this.header=new r,e.inflateGetHeader(this.strm,this.header),B.dictionary&&("string"==typeof B.dictionary?B.dictionary=i.string2buf(B.dictionary):"[object ArrayBuffer]"===c.call(B.dictionary)&&(B.dictionary=new Uint8Array(B.dictionary)),B.raw&&(t=e.inflateSetDictionary(this.strm,B.dictionary))!==Q.Z_OK))throw new Error(n[t])}function o(A,B){var t=new E(B);if(t.push(A,!0),t.err)throw t.msg||n[t.err];return t.result}E.prototype.push=function(A,B){var t,n,s,r,E,o=this.strm,w=this.options.chunkSize,C=this.options.dictionary,a=!1;if(this.ended)return!1;n=B===~~B?B:!0===B?Q.Z_FINISH:Q.Z_NO_FLUSH,"string"==typeof A?o.input=i.binstring2buf(A):"[object ArrayBuffer]"===c.call(A)?o.input=new Uint8Array(A):o.input=A,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new g.Buf8(w),o.next_out=0,o.avail_out=w),(t=e.inflate(o,Q.Z_NO_FLUSH))===Q.Z_NEED_DICT&&C&&(t=e.inflateSetDictionary(this.strm,C)),t===Q.Z_BUF_ERROR&&!0===a&&(t=Q.Z_OK,a=!1),t!==Q.Z_STREAM_END&&t!==Q.Z_OK)return this.onEnd(t),this.ended=!0,!1;o.next_out&&(0!==o.avail_out&&t!==Q.Z_STREAM_END&&(0!==o.avail_in||n!==Q.Z_FINISH&&n!==Q.Z_SYNC_FLUSH)||("string"===this.options.to?(s=i.utf8border(o.output,o.next_out),r=o.next_out-s,E=i.buf2string(o.output,s),o.next_out=r,o.avail_out=w-r,r&&g.arraySet(o.output,o.output,s,r,0),this.onData(E)):this.onData(g.shrinkBuf(o.output,o.next_out)))),0===o.avail_in&&0===o.avail_out&&(a=!0)}while((o.avail_in>0||0===o.avail_out)&&t!==Q.Z_STREAM_END);return t===Q.Z_STREAM_END&&(n=Q.Z_FINISH),n===Q.Z_FINISH?(t=e.inflateEnd(this.strm),this.onEnd(t),this.ended=!0,t===Q.Z_OK):n!==Q.Z_SYNC_FLUSH||(this.onEnd(Q.Z_OK),o.avail_out=0,!0)},E.prototype.onData=function(A){this.chunks.push(A)},E.prototype.onEnd=function(A){A===Q.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=g.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg},B.Inflate=E,B.inflate=o,B.inflateRaw=function(A,B){return(B=B||{}).raw=!0,o(A,B)},B.ungzip=o},function(A,B,t){"use strict";var e=t(16),g=t(93),i=t(94),Q=t(198),n=t(199);function s(A){return(A>>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24)}function r(){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 e.Buf16(320),this.work=new e.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function c(A){var B;return A&&A.state?(B=A.state,A.total_in=A.total_out=B.total=0,A.msg="",B.wrap&&(A.adler=1&B.wrap),B.mode=1,B.last=0,B.havedict=0,B.dmax=32768,B.head=null,B.hold=0,B.bits=0,B.lencode=B.lendyn=new e.Buf32(852),B.distcode=B.distdyn=new e.Buf32(592),B.sane=1,B.back=-1,0):-2}function E(A){var B;return A&&A.state?((B=A.state).wsize=0,B.whave=0,B.wnext=0,c(A)):-2}function o(A,B){var t,e;return A&&A.state?(e=A.state,B<0?(t=0,B=-B):(t=1+(B>>4),B<48&&(B&=15)),B&&(B<8||B>15)?-2:(null!==e.window&&e.wbits!==B&&(e.window=null),e.wrap=t,e.wbits=B,E(A))):-2}function w(A,B){var t,e;return A?(e=new r,A.state=e,e.window=null,0!==(t=o(A,B))&&(A.state=null),t):-2}var C,a,I=!0;function h(A){if(I){var B;for(C=new e.Buf32(512),a=new e.Buf32(32),B=0;B<144;)A.lens[B++]=8;for(;B<256;)A.lens[B++]=9;for(;B<280;)A.lens[B++]=7;for(;B<288;)A.lens[B++]=8;for(n(1,A.lens,0,288,C,0,A.work,{bits:9}),B=0;B<32;)A.lens[B++]=5;n(2,A.lens,0,32,a,0,A.work,{bits:5}),I=!1}A.lencode=C,A.lenbits=9,A.distcode=a,A.distbits=5}function Y(A,B,t,g){var i,Q=A.state;return null===Q.window&&(Q.wsize=1<=Q.wsize?(e.arraySet(Q.window,B,t-Q.wsize,Q.wsize,0),Q.wnext=0,Q.whave=Q.wsize):((i=Q.wsize-Q.wnext)>g&&(i=g),e.arraySet(Q.window,B,t-g,i,Q.wnext),(g-=i)?(e.arraySet(Q.window,B,t-g,g,0),Q.wnext=g,Q.whave=Q.wsize):(Q.wnext+=i,Q.wnext===Q.wsize&&(Q.wnext=0),Q.whave>>8&255,t.check=i(t.check,k,2,0),a=0,I=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&a)<<8)+(a>>8))%31){A.msg="incorrect header check",t.mode=30;break}if(8!=(15&a)){A.msg="unknown compression method",t.mode=30;break}if(I-=4,H=8+(15&(a>>>=4)),0===t.wbits)t.wbits=H;else if(H>t.wbits){A.msg="invalid window size",t.mode=30;break}t.dmax=1<>8&1),512&t.flags&&(k[0]=255&a,k[1]=a>>>8&255,t.check=i(t.check,k,2,0)),a=0,I=0,t.mode=3;case 3:for(;I<32;){if(0===w)break A;w--,a+=r[E++]<>>8&255,k[2]=a>>>16&255,k[3]=a>>>24&255,t.check=i(t.check,k,4,0)),a=0,I=0,t.mode=4;case 4:for(;I<16;){if(0===w)break A;w--,a+=r[E++]<>8),512&t.flags&&(k[0]=255&a,k[1]=a>>>8&255,t.check=i(t.check,k,2,0)),a=0,I=0,t.mode=5;case 5:if(1024&t.flags){for(;I<16;){if(0===w)break A;w--,a+=r[E++]<>>8&255,t.check=i(t.check,k,2,0)),a=0,I=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&((D=t.length)>w&&(D=w),D&&(t.head&&(H=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),e.arraySet(t.head.extra,r,E,D,H)),512&t.flags&&(t.check=i(t.check,r,D,E)),w-=D,E+=D,t.length-=D),t.length))break A;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(0===w)break A;D=0;do{H=r[E+D++],t.head&&H&&t.length<65536&&(t.head.name+=String.fromCharCode(H))}while(H&&D>9&1,t.head.done=!0),A.adler=t.check=0,t.mode=12;break;case 10:for(;I<32;){if(0===w)break A;w--,a+=r[E++]<>>=7&I,I-=7&I,t.mode=27;break}for(;I<3;){if(0===w)break A;w--,a+=r[E++]<>>=1)){case 0:t.mode=14;break;case 1:if(h(t),t.mode=20,6===B){a>>>=2,I-=2;break A}break;case 2:t.mode=17;break;case 3:A.msg="invalid block type",t.mode=30}a>>>=2,I-=2;break;case 14:for(a>>>=7&I,I-=7&I;I<32;){if(0===w)break A;w--,a+=r[E++]<>>16^65535)){A.msg="invalid stored block lengths",t.mode=30;break}if(t.length=65535&a,a=0,I=0,t.mode=15,6===B)break A;case 15:t.mode=16;case 16:if(D=t.length){if(D>w&&(D=w),D>C&&(D=C),0===D)break A;e.arraySet(c,r,E,D,o),w-=D,E+=D,C-=D,o+=D,t.length-=D;break}t.mode=12;break;case 17:for(;I<14;){if(0===w)break A;w--,a+=r[E++]<>>=5,I-=5,t.ndist=1+(31&a),a>>>=5,I-=5,t.ncode=4+(15&a),a>>>=4,I-=4,t.nlen>286||t.ndist>30){A.msg="too many length or distance symbols",t.mode=30;break}t.have=0,t.mode=18;case 18:for(;t.have>>=3,I-=3}for(;t.have<19;)t.lens[T[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,R={bits:t.lenbits},p=n(0,t.lens,0,19,t.lencode,0,t.work,R),t.lenbits=R.bits,p){A.msg="invalid code lengths set",t.mode=30;break}t.have=0,t.mode=19;case 19:for(;t.have>>16&255,N=65535&J,!((d=J>>>24)<=I);){if(0===w)break A;w--,a+=r[E++]<>>=d,I-=d,t.lens[t.have++]=N;else{if(16===N){for(y=d+2;I>>=d,I-=d,0===t.have){A.msg="invalid bit length repeat",t.mode=30;break}H=t.lens[t.have-1],D=3+(3&a),a>>>=2,I-=2}else if(17===N){for(y=d+3;I>>=d)),a>>>=3,I-=3}else{for(y=d+7;I>>=d)),a>>>=7,I-=7}if(t.have+D>t.nlen+t.ndist){A.msg="invalid bit length repeat",t.mode=30;break}for(;D--;)t.lens[t.have++]=H}}if(30===t.mode)break;if(0===t.lens[256]){A.msg="invalid code -- missing end-of-block",t.mode=30;break}if(t.lenbits=9,R={bits:t.lenbits},p=n(1,t.lens,0,t.nlen,t.lencode,0,t.work,R),t.lenbits=R.bits,p){A.msg="invalid literal/lengths set",t.mode=30;break}if(t.distbits=6,t.distcode=t.distdyn,R={bits:t.distbits},p=n(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,R),t.distbits=R.bits,p){A.msg="invalid distances set",t.mode=30;break}if(t.mode=20,6===B)break A;case 20:t.mode=21;case 21:if(w>=6&&C>=258){A.next_out=o,A.avail_out=C,A.next_in=E,A.avail_in=w,t.hold=a,t.bits=I,Q(A,F),o=A.next_out,c=A.output,C=A.avail_out,E=A.next_in,r=A.input,w=A.avail_in,a=t.hold,I=t.bits,12===t.mode&&(t.back=-1);break}for(t.back=0;U=(J=t.lencode[a&(1<>>16&255,N=65535&J,!((d=J>>>24)<=I);){if(0===w)break A;w--,a+=r[E++]<>m)])>>>16&255,N=65535&J,!(m+(d=J>>>24)<=I);){if(0===w)break A;w--,a+=r[E++]<>>=m,I-=m,t.back+=m}if(a>>>=d,I-=d,t.back+=d,t.length=N,0===U){t.mode=26;break}if(32&U){t.back=-1,t.mode=12;break}if(64&U){A.msg="invalid literal/length code",t.mode=30;break}t.extra=15&U,t.mode=22;case 22:if(t.extra){for(y=t.extra;I>>=t.extra,I-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;U=(J=t.distcode[a&(1<>>16&255,N=65535&J,!((d=J>>>24)<=I);){if(0===w)break A;w--,a+=r[E++]<>m)])>>>16&255,N=65535&J,!(m+(d=J>>>24)<=I);){if(0===w)break A;w--,a+=r[E++]<>>=m,I-=m,t.back+=m}if(a>>>=d,I-=d,t.back+=d,64&U){A.msg="invalid distance code",t.mode=30;break}t.offset=N,t.extra=15&U,t.mode=24;case 24:if(t.extra){for(y=t.extra;I>>=t.extra,I-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){A.msg="invalid distance too far back",t.mode=30;break}t.mode=25;case 25:if(0===C)break A;if(D=F-C,t.offset>D){if((D=t.offset-D)>t.whave&&t.sane){A.msg="invalid distance too far back",t.mode=30;break}D>t.wnext?(D-=t.wnext,u=t.wsize-D):u=t.wnext-D,D>t.length&&(D=t.length),l=t.window}else l=c,u=o-t.offset,D=t.length;D>C&&(D=C),C-=D,t.length-=D;do{c[o++]=l[u++]}while(--D);0===t.length&&(t.mode=21);break;case 26:if(0===C)break A;c[o++]=t.length,C--,t.mode=21;break;case 27:if(t.wrap){for(;I<32;){if(0===w)break A;w--,a|=r[E++]<>>=F=M>>>24,C-=F,0===(F=M>>>16&255))N[i++]=65535&M;else{if(!(16&F)){if(0==(64&F)){M=a[(65535&M)+(w&(1<>>=F,C-=F),C<15&&(w+=U[e++]<>>=F=M>>>24,C-=F,!(16&(F=M>>>16&255))){if(0==(64&F)){M=I[(65535&M)+(w&(1<s){A.msg="invalid distance too far back",t.mode=30;break A}if(w>>>=F,C-=F,u>(F=i-Q)){if((F=u-F)>c&&t.sane){A.msg="invalid distance too far back",t.mode=30;break A}if(l=0,d=o,0===E){if(l+=r-F,F2;)N[i++]=d[l++],N[i++]=d[l++],N[i++]=d[l++],D-=3;D&&(N[i++]=d[l++],D>1&&(N[i++]=d[l++]))}else{l=i-u;do{N[i++]=N[l++],N[i++]=N[l++],N[i++]=N[l++],D-=3}while(D>2);D&&(N[i++]=N[l++],D>1&&(N[i++]=N[l++]))}break}}break}}while(e>3,w&=(1<<(C-=D<<3))-1,A.next_in=e,A.next_out=i,A.avail_in=e=1&&0===k[N];N--);if(m>N&&(m=N),0===N)return r[c++]=20971520,r[c++]=20971520,o.bits=1,0;for(U=1;U0&&(0===A||1!==N))return-1;for(T[1]=0,l=1;l<15;l++)T[l+1]=T[l]+k[l];for(d=0;d852||2===A&&p>592)return 1;for(;;){M=l-f,E[d]Y?(F=j[x+E[d]],D=y[J+E[d]]):(F=96,D=0),w=1<>f)+(C-=w)]=M<<24|F<<16|D|0}while(0!==C);for(w=1<>=1;if(0!==w?(R&=w-1,R+=w):R=0,d++,0==--k[l]){if(l===N)break;l=B[t+E[d]]}if(l>m&&(R&I)!==a){for(0===f&&(f=m),h+=U,H=1<<(G=l-f);G+f852||2===A&&p>592)return 1;r[a=R&I]=m<<24|G<<16|h-c|0}}return 0!==R&&(r[h+R]=l-f<<24|64<<16|0),o.bits=m,0}},function(A,B,t){"use strict";A.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(A,B,t){"use strict";var e=t(2),g=t(8),i=t(23),Q=t(56),n=t(98),s=function(A,B){var t,e="";for(t=0;t>>=8;return e},r=function(A,B,t,g,r,c){var E,o,w=A.file,C=A.compression,a=c!==i.utf8encode,I=e.transformTo("string",c(w.name)),h=e.transformTo("string",i.utf8encode(w.name)),Y=w.comment,M=e.transformTo("string",c(Y)),F=e.transformTo("string",i.utf8encode(Y)),D=h.length!==w.name.length,u=F.length!==Y.length,l="",d="",U="",N=w.dir,m=w.date,G={crc32:0,compressedSize:0,uncompressedSize:0};B&&!t||(G.crc32=A.crc32,G.compressedSize=A.compressedSize,G.uncompressedSize=A.uncompressedSize);var f=0;B&&(f|=8),a||!D&&!u||(f|=2048);var H,p,R,y=0,J=0;N&&(y|=16),"UNIX"===r?(J=798,y|=(H=w.unixPermissions,p=N,R=H,H||(R=p?16893:33204),(65535&R)<<16)):(J=20,y|=63&(w.dosPermissions||0)),E=m.getUTCHours(),E<<=6,E|=m.getUTCMinutes(),E<<=5,E|=m.getUTCSeconds()/2,o=m.getUTCFullYear()-1980,o<<=4,o|=m.getUTCMonth()+1,o<<=5,o|=m.getUTCDate(),D&&(d=s(1,1)+s(Q(I),4)+h,l+="up"+s(d.length,2)+d),u&&(U=s(1,1)+s(Q(M),4)+F,l+="uc"+s(U.length,2)+U);var k="";return k+="\n\0",k+=s(f,2),k+=C.magic,k+=s(E,2),k+=s(o,2),k+=s(G.crc32,4),k+=s(G.compressedSize,4),k+=s(G.uncompressedSize,4),k+=s(I.length,2),k+=s(l.length,2),{fileRecord:n.LOCAL_FILE_HEADER+k+I+l,dirRecord:n.CENTRAL_FILE_HEADER+s(J,2)+k+s(M.length,2)+"\0\0\0\0"+s(y,4)+s(g,4)+I+l+M}},c=function(A){return n.DATA_DESCRIPTOR+s(A.crc32,4)+s(A.compressedSize,4)+s(A.uncompressedSize,4)};function E(A,B,t,e){g.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=B,this.zipPlatform=t,this.encodeFileName=e,this.streamFiles=A,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}e.inherits(E,g),E.prototype.push=function(A){var B=A.meta.percent||0,t=this.entriesCount,e=this._sources.length;this.accumulate?this.contentBuffer.push(A):(this.bytesWritten+=A.data.length,g.prototype.push.call(this,{data:A.data,meta:{currentFile:this.currentFile,percent:t?(B+100*(t-e-1))/t:100}}))},E.prototype.openedSource=function(A){this.currentSourceOffset=this.bytesWritten,this.currentFile=A.file.name;var B=this.streamFiles&&!A.file.dir;if(B){var t=r(A,B,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:t.fileRecord,meta:{percent:0}})}else this.accumulate=!0},E.prototype.closedSource=function(A){this.accumulate=!1;var B=this.streamFiles&&!A.file.dir,t=r(A,B,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(t.dirRecord),B)this.push({data:c(A),meta:{percent:100}});else for(this.push({data:t.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},E.prototype.flush=function(){for(var A=this.bytesWritten,B=0;B1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var A,B;for(A=0;A0)this.isSignature(B,i.CENTRAL_FILE_HEADER)||(this.reader.zero=e);else if(e<0)throw new Error("Corrupted zip: missing "+Math.abs(e)+" bytes.")},prepareReader:function(A){this.reader=e(A)},load:function(A){this.prepareReader(A),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},A.exports=s},function(A,B,t){"use strict";var e=t(101);function g(A){e.call(this,A)}t(2).inherits(g,e),g.prototype.byteAt=function(A){return this.data.charCodeAt(this.zero+A)},g.prototype.lastIndexOfSignature=function(A){return this.data.lastIndexOf(A)-this.zero},g.prototype.readAndCheckSignature=function(A){return A===this.readData(4)},g.prototype.readData=function(A){this.checkOffset(A);var B=this.data.slice(this.zero+this.index,this.zero+this.index+A);return this.index+=A,B},A.exports=g},function(A,B,t){"use strict";var e=t(102);function g(A){e.call(this,A)}t(2).inherits(g,e),g.prototype.readData=function(A){this.checkOffset(A);var B=this.data.slice(this.zero+this.index,this.zero+this.index+A);return this.index+=A,B},A.exports=g},function(A,B,t){"use strict";var e=t(99),g=t(2),i=t(55),Q=t(56),n=t(23),s=t(92),r=t(15);function c(A,B){this.options=A,this.loadOptions=B}c.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(A){var B,t;if(A.skip(22),this.fileNameLength=A.readInt(2),t=A.readInt(2),this.fileName=A.readData(this.fileNameLength),A.skip(t),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(B=function(A){for(var B in s)if(s.hasOwnProperty(B)&&s[B].magic===A)return s[B];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+g.pretty(this.compressionMethod)+" unknown (inner file : "+g.transformTo("string",this.fileName)+")");this.decompressed=new i(this.compressedSize,this.uncompressedSize,this.crc32,B,A.readData(this.compressedSize))},readCentralPart:function(A){this.versionMadeBy=A.readInt(2),A.skip(2),this.bitFlag=A.readInt(2),this.compressionMethod=A.readString(2),this.date=A.readDate(),this.crc32=A.readInt(4),this.compressedSize=A.readInt(4),this.uncompressedSize=A.readInt(4);var B=A.readInt(2);if(this.extraFieldsLength=A.readInt(2),this.fileCommentLength=A.readInt(2),this.diskNumberStart=A.readInt(2),this.internalFileAttributes=A.readInt(2),this.externalFileAttributes=A.readInt(4),this.localHeaderOffset=A.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");A.skip(B),this.readExtraFields(A),this.parseZIP64ExtraField(A),this.fileComment=A.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var A=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===A&&(this.dosPermissions=63&this.externalFileAttributes),3===A&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(A){if(this.extraFields[1]){var B=e(this.extraFields[1].value);this.uncompressedSize===g.MAX_VALUE_32BITS&&(this.uncompressedSize=B.readInt(8)),this.compressedSize===g.MAX_VALUE_32BITS&&(this.compressedSize=B.readInt(8)),this.localHeaderOffset===g.MAX_VALUE_32BITS&&(this.localHeaderOffset=B.readInt(8)),this.diskNumberStart===g.MAX_VALUE_32BITS&&(this.diskNumberStart=B.readInt(4))}},readExtraFields:function(A){var B,t,e,g=A.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});A.index{const n=this._storeCallbacks(i,Q);g.length>0&&"function"==typeof g[g.length-1].func&&(g.pop(),g.pop()),e?A.postMessage({service:B,method:t,responseId:n,args:g},e):A.postMessage({service:B,method:t,responseId:n,args:g})})}_storeCallbacks(A,B){const t=this.nextResponseId++;return this.callbacks[t]=[A,B],t}_deliverResponse(A,B){try{const[t,e]=this.callbacks[A];delete this.callbacks[A],B.error?e(B.error):t(B.result)}catch(A){e.error("Dispatch callback failed: ".concat(A))}}_onMessage(A,B){const t=B.data;let g;t.args=t.args||[],t.service?g="dispatch"===t.service?this._onDispatchMessage(A,t):this.call(t.service,t.method,...t.args):void 0===t.responseId?e.error("Dispatch caught malformed message from a worker: ".concat(JSON.stringify(B))):this._deliverResponse(t.responseId,t),g&&(void 0===t.responseId?e.error("Dispatch message missing required response ID: ".concat(JSON.stringify(B))):g.then(B=>A.postMessage({responseId:t.responseId,result:B}),B=>A.postMessage({responseId:t.responseId,error:"".concat(B)})))}_getServiceProvider(A){throw new Error("Could not get provider for ".concat(A,": _getServiceProvider not implemented"))}_onDispatchMessage(A,B){throw new Error("Unimplemented dispatch message handler cannot handle ".concat(B.method," method"))}}},function(A,B,t){var e=t(17),g=t(211),i=new e,Q=Array.prototype.slice;(B=A.exports=function(A){var t=function(){return i.write(A,void 0,Q.call(arguments)),t};return t.debug=function(){return i.write(A,"debug",Q.call(arguments)),t},t.info=function(){return i.write(A,"info",Q.call(arguments)),t},t.warn=function(){return i.write(A,"warn",Q.call(arguments)),t},t.error=function(){return i.write(A,"error",Q.call(arguments)),t},t.log=t.debug,t.suggest=B.suggest,t.format=i.format,t}).defaultBackend=B.defaultFormatter=null,B.pipe=function(A){return i.pipe(A)},B.end=B.unpipe=B.disable=function(A){return i.unpipe(A)},B.Transform=e,B.Filter=g,B.suggest=new g,B.enable=function(){return B.defaultFormatter?i.pipe(B.suggest).pipe(B.defaultFormatter).pipe(B.defaultBackend):i.pipe(B.suggest).pipe(B.defaultBackend)}},function(A,B){function t(){this._events={}}t.prototype={on:function(A,B){this._events||(this._events={});var t=this._events;return(t[A]||(t[A]=[])).push(B),this},removeListener:function(A,B){var t,e=this._events[A]||[];for(t=e.length-1;t>=0&&e[t];t--)e[t]!==B&&e[t].cb!==B||e.splice(t,1)},removeAllListeners:function(A){A?this._events[A]&&(this._events[A]=[]):this._events={}},listeners:function(A){return this._events&&this._events[A]||[]},emit:function(A){this._events||(this._events={});var B,t=Array.prototype.slice.call(arguments,1),e=this._events[A]||[];for(B=e.length-1;B>=0&&e[B];B--)e[B].apply(this,t);return this},when:function(A,B){return this.once(A,B,!0)},once:function(A,B,t){if(!B)return this;function e(){t||this.removeListener(A,e),B.apply(this,arguments)&&t&&this.removeListener(A,e)}return e.cb=B,this.on(A,e),this}},t.mixin=function(A){var B,e=t.prototype;for(B in e)e.hasOwnProperty(B)&&(A.prototype[B]=e[B])},A.exports=t},function(A,B,t){var e=t(17),g={debug:1,info:2,warn:3,error:4};function i(){this.enabled=!0,this.defaultResult=!0,this.clear()}function Q(A,B){return A.n.test?A.n.test(B):A.n==B}e.mixin(i),i.prototype.allow=function(A,B){return this._white.push({n:A,l:g[B]}),this},i.prototype.deny=function(A,B){return this._black.push({n:A,l:g[B]}),this},i.prototype.clear=function(){return this._white=[],this._black=[],this},i.prototype.test=function(A,B){var t,e=Math.max(this._white.length,this._black.length);for(t=0;t=this._white[t].l)return!0;if(this._black[t]&&Q(this._black[t],A)&&g[B]<=this._black[t].l)return!1}return this.defaultResult},i.prototype.write=function(A,B,t){if(!this.enabled||this.test(A,B))return this.emit("item",A,B,t)},A.exports=i},function(A,B,t){var e=t(17),g=/\n+$/,i=new e;i.write=function(A,B,t){var e=t.length-1;if("undefined"!=typeof console&&console.log){if(console.log.apply)return console.log.apply(console,[A,B].concat(t));if(JSON&&JSON.stringify){t[e]&&"string"==typeof t[e]&&(t[e]=t[e].replace(g,""));try{for(e=0;et(221),pen:()=>t(222),wedo2:()=>t(227),music:()=>t(231),microbit:()=>t(294),text2speech:()=>t(295),translate:()=>t(296),videoSensing:()=>t(297),ev3:()=>t(329),makeymakey:()=>t(331),boost:()=>t(332),gdxfor:()=>t(333),tw:()=>t(336)};A.exports=class{constructor(A){this.nextExtensionWorker=0,this.pendingExtensions=[],this.pendingWorkers=[],this._loadedExtensions=new Map,this.workerMode="worker",this.runtime=A,this.loadingAsyncExtensions=0,this.asyncExtensionsLoadedCallbacks=[],e.setService("extensions",(A=>{const B={};return B.registerExtensionServiceSync=A.registerExtensionServiceSync.bind(A),B.allocateWorker=A.allocateWorker.bind(A),B.onWorkerInit=A.onWorkerInit.bind(A),B.registerExtensionService=A.registerExtensionService.bind(A),B})(this)).catch(A=>{g.error("ExtensionManager was unable to register extension service: ".concat(JSON.stringify(A)))})}isExtensionLoaded(A){return this._loadedExtensions.has(A)}loadExtensionIdSync(A){if(!n.hasOwnProperty(A))return void g.warn("Could not find extension ".concat(A," in the built in extensions."));if(this.isExtensionLoaded(A)){const B="Rejecting attempt to load a second extension with ID ".concat(A);return void g.warn(B)}const B=new(n[A]())(this.runtime),t=this._registerInternalExtension(B);this._loadedExtensions.set(A,t),this.runtime.compilerRegisterExtension(A,B)}loadExtensionURL(A){if(n.hasOwnProperty(A)){if(this.isExtensionLoaded(A)){const B="Rejecting attempt to load a second extension with ID ".concat(A);return g.warn(B),Promise.resolve()}const B=new(n[A]())(this.runtime),t=this._registerInternalExtension(B);return this._loadedExtensions.set(A,t),this.runtime.compilerRegisterExtension(A,B),Promise.resolve()}return this.loadingAsyncExtensions++,new Promise((B,t)=>{this.pendingExtensions.push({extensionURL:A,resolve:B,reject:t}),this.createExtensionWorker().then(A=>e.addWorker(A)).catch(A=>t(A))})}allAsyncExtensionsLoaded(){if(0!==this.loadingAsyncExtensions)return new Promise(A=>{this.asyncExtensionsLoadedCallbacks.push(A)})}createExtensionWorker(){if("worker"===this.workerMode){const A=t(337);return Promise.resolve(new A)}return"iframe"===this.workerMode?t.e(0).then(t.t.bind(null,420,7)).then(A=>new A.default):Promise.reject(new Error("Unknown extension worker mode"))}refreshBlocks(){const A=Array.from(this._loadedExtensions.values()).map(A=>e.call(A,"getInfo").then(B=>{B=this._prepareExtensionInfo(A,B),e.call("runtime","_refreshExtensionPrimitives",B)}).catch(A=>{g.error("Failed to refresh built-in extension primitives: ".concat(JSON.stringify(A)))}));return Promise.all(A)}allocateWorker(){const A=this.nextExtensionWorker++,B=this.pendingExtensions.shift();return this.pendingWorkers[A]=B,[A,B.extensionURL]}registerExtensionServiceSync(A){const B=e.callSync(A,"getInfo");this._registerExtensionInfo(A,B)}registerExtensionService(A){e.call(A,"getInfo").then(B=>{this._loadedExtensions.set(B.id,A),this._registerExtensionInfo(A,B),this.loadingAsyncExtensions--,0===this.loadingAsyncExtensions&&(this.asyncExtensionsLoadedCallbacks.forEach(A=>A()),this.asyncExtensionsLoadedCallbacks=[])})}onWorkerInit(A,B){const t=this.pendingWorkers[A];delete this.pendingWorkers[A],B?t.reject(B):t.resolve(A)}_registerInternalExtension(A){const B=A.getInfo(),t=this.nextExtensionWorker++,g="extension_".concat(t,"_").concat(B.id);return e.setServiceSync(g,A),e.callSync("extensions","registerExtensionServiceSync",g),g}_registerExtensionInfo(A,B){B=this._prepareExtensionInfo(A,B),e.call("runtime","_registerExtensionPrimitives",B).catch(B=>{g.error("Failed to register primitives for extension on service ".concat(A,":"),B)})}_sanitizeID(A){return A.toString().replace(/[<"&]/,"_")}_prepareExtensionInfo(A,B){if(B=Object.assign({},B),!/^[a-z0-9]+$/i.test(B.id))throw new Error("Invalid extension id");return B.name=B.name||B.id,B.blocks=B.blocks||[],B.targetTypes=B.targetTypes||[],B.blocks=B.blocks.reduce((B,t)=>{try{let e;switch(t){case"---":e="---";break;default:e=this._prepareBlockInfo(A,t)}B.push(e)}catch(A){g.error("Error processing block: ".concat(A.message,", Block:\n").concat(JSON.stringify(t)))}return B},[]),B.menus=B.menus||{},B.menus=this._prepareMenuInfo(A,B.menus),B}_prepareMenuInfo(A,B){const t=Object.getOwnPropertyNames(B);for(let g=0;g{switch(typeof(A=i(A,g))){case"object":return[i(A.text,g),A.value];case"string":return[A,A];default:return A}});if(!Q||Q.length<1)throw new Error("Extension menu returned no items: ".concat(B));return Q}_prepareBlockInfo(A,B){switch((B=Object.assign({},{blockType:Q.COMMAND,terminal:!1,blockAllThreads:!1,arguments:{}},B)).opcode=B.opcode&&this._sanitizeID(B.opcode),B.text=B.text||B.opcode,B.blockType){case Q.EVENT:B.func&&g.warn('Ignoring function "'.concat(B.func,'" for event block ').concat(B.opcode));break;case Q.BUTTON:B.opcode&&g.warn('Ignoring opcode "'.concat(B.opcode,'" for button with text: ').concat(B.text));break;default:{if(!B.opcode)throw new Error("Missing opcode for block");const t=B.func?this._sanitizeID(B.func):B.opcode,i=B.isDynamic?A=>A&&A.mutation&&A.mutation.blockInfo:()=>B,Q=(()=>{if(e._isRemoteService(A))return(B,g,i)=>e.call(A,t,B,g,i);const B=e.services[A];return B[t]||g.warn("Could not find extension block function called ".concat(t)),(A,e,g)=>B[t](A,e,g)})();B.func=(A,B)=>{const t=i(A);return Q(A,B,t)};break}}return B}}},function(A,B,t){"use strict";var e=["number","date","time","ordinal","duration","spellout"],g=["plural","select","selectordinal"];function i(A,B){var t=A.pattern,e=t.length,g=[],i=A.index,n=Q(A,B);for(n&&g.push(n),n&&A.tokens&&A.tokens.push(["text",t.slice(i,A.index)]);A.index=9&&A<=13||32===A||133===A||160===A||6158===A||A>=8192&&A<=8205||8232===A||8233===A||8239===A||8287===A||8288===A||12288===A||65279===A}function s(A){for(var B=A.pattern,t=B.length,e=A.index;A.index"===A.pattern.slice(A.index,A.index+"/>".length))return A.tokens&&A.tokens.push(["syntax","/>"]),A.index+="/>".length,[t,B];if(">"!==A.pattern[A.index])throw C(A,">");A.tokens&&A.tokens.push(["syntax",">"]);++A.index;var e=i(A,B),g=A.index;if("");A.tokens&&A.tokens.push(["syntax","","");if(s(A),">"!==A.pattern[A.index])throw C(A,">");A.tokens&&A.tokens.push(["syntax",">"]);return++A.index,[t,B,{children:e}]}(A);if(t)return t;if("{"!==B[A.index])throw C(A,"{");A.tokens&&A.tokens.push(["syntax","{"]),++A.index,s(A);var g=c(A);if(!g)throw C(A,"placeholder id");A.tokens&&A.tokens.push(["id",g]),s(A);var Q=B[A.index];if("}"===Q)return A.tokens&&A.tokens.push(["syntax","}"]),++A.index,[g];if(","!==Q)throw C(A,", or }");A.tokens&&A.tokens.push(["syntax",","]),++A.index,s(A);var n,r=c(A);if(!r)throw C(A,"placeholder type");if(A.tokens&&A.tokens.push(["type",r]),s(A),"}"===(Q=B[A.index])){if(A.tokens&&A.tokens.push(["syntax","}"]),"plural"===r||"selectordinal"===r||"select"===r)throw C(A,r+" sub-messages");return++A.index,[g,r]}if(","!==Q)throw C(A,", or }");if(A.tokens&&A.tokens.push(["syntax",","]),++A.index,s(A),"plural"===r||"selectordinal"===r){var w=function(A){var B=A.pattern,t=B.length,e=0;if("offset:"===B.slice(A.index,A.index+"offset:".length)){A.tokens&&A.tokens.push(["offset","offset"],["syntax",":"]),A.index+="offset:".length,s(A);for(var g=A.index;A.index=48&&i<=57);)++A.index;if(g===A.index)throw C(A,"offset number");A.tokens&&A.tokens.push(["number",B.slice(g,A.index)]),e=+B.slice(g,A.index)}var i;return e}(A);s(A),n=[g,r,w,o(A,r)]}else if("select"===r)n=[g,r,o(A,r)];else if(e.indexOf(r)>=0)n=[g,r,E(A)];else{var a=A.index,I=E(A);s(A),"{"===B[A.index]&&(A.index=a,I=o(A,r)),n=[g,r,I]}if(s(A),"}"!==B[A.index])throw C(A,"}");return A.tokens&&A.tokens.push(["syntax","}"]),++A.index,n}function c(A,B){for(var t=A.pattern,e=t.length,g="";A.index"===i||"/"===i))break;g+=i,++A.index}return g}function E(A){var B=A.index,t=Q(A,"{style}");if(!t)throw C(A,"placeholder style name");return A.tokens&&A.tokens.push(["style",A.pattern.slice(B,A.index)]),t}function o(A,B){for(var t=A.pattern,e=t.length,i={};A.index=0)throw C(A,null,null,'"other" sub-message must be specified in '+B);return i}function w(A,B){if("{"!==A.pattern[A.index])throw C(A,"{ to start sub-message");A.tokens&&A.tokens.push(["syntax","{"]),++A.index;var t=i(A,B);if("}"!==A.pattern[A.index])throw C(A,"} to end sub-message");return A.tokens&&A.tokens.push(["syntax","}"]),++A.index,t}function C(A,B,t,e){var g=A.pattern,i=g.slice(0,A.index).split(/\r?\n/),Q=A.index,n=i.length,s=i.slice(-1)[0].length;return t=t||(A.index>=g.length?"end of message pattern":c(A)||g[A.index]),e||(e=function(A,B){return A?"Expected "+A+" but found "+B:"Unexpected "+B+" found"}(B,t)),new a(e+=" in "+g.replace(/\r?\n/g,"\n"),B,t,Q,n,s)}function a(A,B,t,e,g,i){Error.call(this,A),this.name="SyntaxError",this.message=A,this.expected=B,this.found=t,this.offset=e,this.line=g,this.column=i}B=A.exports=function(A,B){return i({pattern:String(A),index:0,tagsType:B&&B.tagsType||null,tokens:B&&B.tokens||null},"")},a.prototype=Object.create(Error.prototype),B.SyntaxError=a},function(A,B,t){"use strict";var e=t(106),g=t(107),i=t(108);function Q(A,B,t,e,g){var i=A.map((function(A){return function(A,B,t,e,g){if("string"==typeof A){var i=A;return function(){return i}}var s,r=A[0],c=A[1];if(B&&"#"===A[0]){r=B[0];var E=B[2],w=(e.number||o.number)([r,"number"],t);return function(A){return w(n(r,A)-E,A)}}"plural"===c||"selectordinal"===c?(s={},Object.keys(A[3]).forEach((function(B){s[B]=Q(A[3][B],A,t,e,g)})),A=[A[0],A[1],A[2],s]):A[2]&&"object"==typeof A[2]&&(s={},Object.keys(A[2]).forEach((function(B){s[B]=Q(A[2][B],A,t,e,g)})),A=[A[0],A[1],s]);var C=c&&(e[c]||o[c]);if(C){var a=C(A,t);return function(A){return a(n(r,A),A)}}return g?function(A){return String(n(r,A))}:function(A){return n(r,A)}}(A,B,t,e,g)}));return g?1===i.length?i[0]:function(A){for(var B="",t=0;t0)t=new Intl.PluralRules(B,{type:e});else{var s=g(B,i),r=s&&i[s][e]||E;t={select:r}}return function(A,B){return(n["="+ +A]||n[t.select(A-Q)]||n.other)(B)}}function E(){return"other"}(B=A.exports=function(A,B,t){return Q(A,null,B||"en",t||{},!0)}).toParts=function(A,B,t){return Q(A,null,B||"en",t||{},!1)};var o={number:s,ordinal:s,spellout:s,duration:function(A,B){var t=A[2],g=e.duration[t]||e.duration.default,i=new Intl.NumberFormat(B,g.seconds).format,Q=new Intl.NumberFormat(B,g.minutes).format,n=new Intl.NumberFormat(B,g.hours).format,s=/^fi$|^fi-|^da/.test(String(B))?".":":";return function(A,B){if(A=+A,!isFinite(A))return i(A);var t=~~(A/60/60),e=~~(A/60%60),g=(t?n(Math.abs(t))+s:"")+Q(Math.abs(e))+s+i(Math.abs(A%60));return A<0?n(-1).replace(n(1),g):g}},date:r,time:r,plural:c,selectordinal:c,select:function(A,B){var t=A[2];return function(A,B){return(t[A]||t.other)(B)}}};B.types=o},function(A,B,t){const e=t(3),g=t(6);A.exports=class{constructor(A){this.runtime=A}getInfo(){return{id:"coreExample",name:"CoreEx",blocks:[{func:"MAKE_A_VARIABLE",blockType:e.BUTTON,text:"make a variable (CoreEx)"},{opcode:"exampleOpcode",blockType:e.REPORTER,text:"example block"},{opcode:"exampleWithInlineImage",blockType:e.COMMAND,text:"block with image [CLOCKWISE] inline",arguments:{CLOCKWISE:{type:g.IMAGE,dataURI:'data:image/svg+xml,%3Csvg id="rotate-counter-clockwise" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%233d79cc;%7D.cls-2%7Bfill:%23fff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3Erotate-counter-clockwise%3C/title%3E%3Cpath class="cls-1" d="M22.68,12.2a1.6,1.6,0,0,1-1.27.63H13.72a1.59,1.59,0,0,1-1.16-2.58l1.12-1.41a4.82,4.82,0,0,0-3.14-.77,4.31,4.31,0,0,0-2,.8,4.25,4.25,0,0,0-1.34,1.73,5.06,5.06,0,0,0,.54,4.62A5.58,5.58,0,0,0,12,17.74h0a2.26,2.26,0,0,1-.16,4.52A10.25,10.25,0,0,1,3.74,18,10.14,10.14,0,0,1,2.25,8.78,9.7,9.7,0,0,1,5.08,4.64,9.92,9.92,0,0,1,9.66,2.5a10.66,10.66,0,0,1,7.72,1.68l1.08-1.35a1.57,1.57,0,0,1,1.24-.6,1.6,1.6,0,0,1,1.54,1.21l1.7,7.37A1.57,1.57,0,0,1,22.68,12.2Z"/%3E%3Cpath class="cls-2" d="M21.38,11.83H13.77a.59.59,0,0,1-.43-1l1.75-2.19a5.9,5.9,0,0,0-4.7-1.58,5.07,5.07,0,0,0-4.11,3.17A6,6,0,0,0,7,15.77a6.51,6.51,0,0,0,5,2.92,1.31,1.31,0,0,1-.08,2.62,9.3,9.3,0,0,1-7.35-3.82A9.16,9.16,0,0,1,3.17,9.12,8.51,8.51,0,0,1,5.71,5.4,8.76,8.76,0,0,1,9.82,3.48a9.71,9.71,0,0,1,7.75,2.07l1.67-2.1a.59.59,0,0,1,1,.21L22,11.08A.59.59,0,0,1,21.38,11.83Z"/%3E%3C/svg%3E'}}}]}}exampleOpcode(){const A=this.runtime.getTargetForStage();return A?A.getName():"no stage yet"}exampleWithInlineImage(){}}},function(A,B,t){const e=t(6),g=t(3),i=t(109),Q=t(1),n=t(18),s=t(30),r=t(5),c=t(4),E=t(40),o=t(0),w=t(19),C="color",a="saturation",I="brightness",h="transparency";class Y{constructor(A){this.runtime=A,this._penDrawableId=-1,this._penSkinId=-1,this._onTargetCreated=this._onTargetCreated.bind(this),this._onTargetMoved=this._onTargetMoved.bind(this),A.on("targetWasCreated",this._onTargetCreated),A.on("RUNTIME_DISPOSED",this.clear.bind(this))}static get DEFAULT_PEN_STATE(){return{penDown:!1,color:66.66,saturation:100,brightness:100,transparency:0,_shade:50,penAttributes:{color4f:[0,0,1,1],diameter:1}}}static get PEN_SIZE_RANGE(){return{min:1,max:1200}}static get STATE_KEY(){return"Scratch.pen"}_clampPenSize(A){return this.runtime.renderer&&this.runtime.renderer.useHighQualityRender||!this.runtime.runtimeOptions.miscLimits?Math.max(0,A):c.clamp(A,Y.PEN_SIZE_RANGE.min,Y.PEN_SIZE_RANGE.max)}_getPenLayerID(){return this._penSkinId<0&&this.runtime.renderer&&(this._penSkinId=this.runtime.renderer.createPenSkin(),this._penDrawableId=this.runtime.renderer.createDrawable(w.PEN_LAYER),this.runtime.renderer.updateDrawableSkinId(this._penDrawableId,this._penSkinId)),this._penSkinId}_getPenState(A){let B=A.getCustomState(Y.STATE_KEY);return B||(B=n.simple(Y.DEFAULT_PEN_STATE),A.setCustomState(Y.STATE_KEY,B)),B}_onTargetCreated(A,B){if(B){const t=B.getCustomState(Y.STATE_KEY);t&&(A.setCustomState(Y.STATE_KEY,n.simple(t)),t.penDown&&A.addListener(E.EVENT_TARGET_MOVED,this._onTargetMoved))}}_onTargetMoved(A,B,t,e){if(!e){const e=this._getPenLayerID();if(e>=0){const g=this._getPenState(A);this.runtime.renderer.penLine(e,g.penAttributes,B,t,A.x,A.y),this.runtime.requestRedraw()}}}_wrapColor(A){return c.wrapClamp(A,0,100)}_initColorParam(){return[{text:r({id:"pen.colorMenu.color",default:"color",description:"label for color element in color picker for pen extension"}),value:C},{text:r({id:"pen.colorMenu.saturation",default:"saturation",description:"label for saturation element in color picker for pen extension"}),value:a},{text:r({id:"pen.colorMenu.brightness",default:"brightness",description:"label for brightness element in color picker for pen extension"}),value:I},{text:r({id:"pen.colorMenu.transparency",default:"transparency",description:"label for transparency element in color picker for pen extension"}),value:h}]}_clampColorParam(A){return c.clamp(A,0,100)}_alphaToTransparency(A){return 100*(1-A)}_transparencyToAlpha(A){return 1-A/100}getInfo(){return{id:"pen",name:r({id:"pen.categoryName",default:"Pen",description:"Label for the pen extension category"}),blockIconURI:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+cGVuLWljb248L3RpdGxlPjxnIHN0cm9rZT0iIzU3NUU3NSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik04Ljc1MyAzNC42MDJsLTQuMjUgMS43OCAxLjc4My00LjIzN2MxLjIxOC0yLjg5MiAyLjkwNy01LjQyMyA1LjAzLTcuNTM4TDMxLjA2NiA0LjkzYy44NDYtLjg0MiAyLjY1LS40MSA0LjAzMi45NjcgMS4zOCAxLjM3NSAxLjgxNiAzLjE3My45NyA0LjAxNUwxNi4zMTggMjkuNTljLTIuMTIzIDIuMTE2LTQuNjY0IDMuOC03LjU2NSA1LjAxMiIgZmlsbD0iI0ZGRiIvPjxwYXRoIGQ9Ik0yOS40MSA2LjExcy00LjQ1LTIuMzc4LTguMjAyIDUuNzcyYy0xLjczNCAzLjc2Ni00LjM1IDEuNTQ2LTQuMzUgMS41NDYiLz48cGF0aCBkPSJNMzYuNDIgOC44MjVjMCAuNDYzLS4xNC44NzMtLjQzMiAxLjE2NGwtOS4zMzUgOS4zYy4yODItLjI5LjQxLS42NjguNDEtMS4xMiAwLS44NzQtLjUwNy0xLjk2My0xLjQwNi0yLjg2OC0xLjM2Mi0xLjM1OC0zLjE0Ny0xLjgtNC4wMDItLjk5TDMwLjk5IDUuMDFjLjg0NC0uODQgMi42NS0uNDEgNC4wMzUuOTYuODk4LjkwNCAxLjM5NiAxLjk4MiAxLjM5NiAyLjg1NU0xMC41MTUgMzMuNzc0Yy0uNTczLjMwMi0xLjE1Ny41Ny0xLjc2NC44M0w0LjUgMzYuMzgybDEuNzg2LTQuMjM1Yy4yNTgtLjYwNC41My0xLjE4Ni44MzMtMS43NTcuNjkuMTgzIDEuNDQ4LjYyNSAyLjEwOCAxLjI4Mi42Ni42NTggMS4xMDIgMS40MTIgMS4yODcgMi4xMDIiIGZpbGw9IiM0Qzk3RkYiLz48cGF0aCBkPSJNMzYuNDk4IDguNzQ4YzAgLjQ2NC0uMTQuODc0LS40MzMgMS4xNjVsLTE5Ljc0MiAxOS42OGMtMi4xMyAyLjExLTQuNjczIDMuNzkzLTcuNTcyIDUuMDFMNC41IDM2LjM4bC45NzQtMi4zMTYgMS45MjUtLjgwOGMyLjg5OC0xLjIxOCA1LjQ0LTIuOSA3LjU3LTUuMDFsMTkuNzQzLTE5LjY4Yy4yOTItLjI5Mi40MzItLjcwMi40MzItMS4xNjUgMC0uNjQ2LS4yNy0xLjQtLjc4LTIuMTIyLjI1LjE3Mi41LjM3Ny43MzcuNjE0Ljg5OC45MDUgMS4zOTYgMS45ODMgMS4zOTYgMi44NTYiIGZpbGw9IiM1NzVFNzUiIG9wYWNpdHk9Ii4xNSIvPjxwYXRoIGQ9Ik0xOC40NSAxMi44M2MwIC41LS40MDQuOTA1LS45MDQuOTA1cy0uOTA1LS40MDUtLjkwNS0uOTA0YzAtLjUuNDA3LS45MDMuOTA2LS45MDMuNSAwIC45MDQuNDA0LjkwNC45MDR6IiBmaWxsPSIjNTc1RTc1Ii8+PC9nPjwvc3ZnPg==",blocks:[{opcode:"clear",blockType:g.COMMAND,text:r({id:"pen.clear",default:"erase all",description:"erase all pen trails and stamps"})},{opcode:"stamp",blockType:g.COMMAND,text:r({id:"pen.stamp",default:"stamp",description:"render current costume on the background"}),filter:[i.SPRITE]},{opcode:"penDown",blockType:g.COMMAND,text:r({id:"pen.penDown",default:"pen down",description:"start leaving a trail when the sprite moves"}),filter:[i.SPRITE]},{opcode:"penUp",blockType:g.COMMAND,text:r({id:"pen.penUp",default:"pen up",description:"stop leaving a trail behind the sprite"}),filter:[i.SPRITE]},{opcode:"setPenColorToColor",blockType:g.COMMAND,text:r({id:"pen.setColor",default:"set pen color to [COLOR]",description:"set the pen color to a particular (RGB) value"}),arguments:{COLOR:{type:e.COLOR}},filter:[i.SPRITE]},{opcode:"changePenColorParamBy",blockType:g.COMMAND,text:r({id:"pen.changeColorParam",default:"change pen [COLOR_PARAM] by [VALUE]",description:"change the state of a pen color parameter"}),arguments:{COLOR_PARAM:{type:e.STRING,menu:"colorParam",defaultValue:C},VALUE:{type:e.NUMBER,defaultValue:10}},filter:[i.SPRITE]},{opcode:"setPenColorParamTo",blockType:g.COMMAND,text:r({id:"pen.setColorParam",default:"set pen [COLOR_PARAM] to [VALUE]",description:"set the state for a pen color parameter e.g. saturation"}),arguments:{COLOR_PARAM:{type:e.STRING,menu:"colorParam",defaultValue:C},VALUE:{type:e.NUMBER,defaultValue:50}},filter:[i.SPRITE]},{opcode:"changePenSizeBy",blockType:g.COMMAND,text:r({id:"pen.changeSize",default:"change pen size by [SIZE]",description:"change the diameter of the trail left by a sprite"}),arguments:{SIZE:{type:e.NUMBER,defaultValue:1}},filter:[i.SPRITE]},{opcode:"setPenSizeTo",blockType:g.COMMAND,text:r({id:"pen.setSize",default:"set pen size to [SIZE]",description:"set the diameter of a trail left by a sprite"}),arguments:{SIZE:{type:e.NUMBER,defaultValue:1}},filter:[i.SPRITE]},{opcode:"setPenShadeToNumber",blockType:g.COMMAND,text:r({id:"pen.setShade",default:"set pen shade to [SHADE]",description:"legacy pen blocks - set pen shade"}),arguments:{SHADE:{type:e.NUMBER,defaultValue:1}},hideFromPalette:!0},{opcode:"changePenShadeBy",blockType:g.COMMAND,text:r({id:"pen.changeShade",default:"change pen shade by [SHADE]",description:"legacy pen blocks - change pen shade"}),arguments:{SHADE:{type:e.NUMBER,defaultValue:1}},hideFromPalette:!0},{opcode:"setPenHueToNumber",blockType:g.COMMAND,text:r({id:"pen.setHue",default:"set pen color to [HUE]",description:"legacy pen blocks - set pen color to number"}),arguments:{HUE:{type:e.NUMBER,defaultValue:1}},hideFromPalette:!0},{opcode:"changePenHueBy",blockType:g.COMMAND,text:r({id:"pen.changeHue",default:"change pen color by [HUE]",description:"legacy pen blocks - change pen color"}),arguments:{HUE:{type:e.NUMBER,defaultValue:1}},hideFromPalette:!0}],menus:{colorParam:{acceptReporters:!0,items:this._initColorParam()}}}}clear(){const A=this._getPenLayerID();A>=0&&(this.runtime.renderer.penClear(A),this.runtime.requestRedraw())}stamp(A,B){this._stamp(B.target)}_stamp(A){const B=this._getPenLayerID();B>=0&&(this.runtime.renderer.penStamp(B,A.drawableID),this.runtime.requestRedraw())}penDown(A,B){this._penDown(B.target)}_penDown(A){const B=this._getPenState(A);B.penDown||(B.penDown=!0,A.addListener(E.EVENT_TARGET_MOVED,this._onTargetMoved));const t=this._getPenLayerID();t>=0&&(this.runtime.renderer.penPoint(t,B.penAttributes,A.x,A.y),this.runtime.requestRedraw())}penUp(A,B){this._penUp(B.target)}_penUp(A){const B=this._getPenState(A);B.penDown&&(B.penDown=!1,A.removeListener(E.EVENT_TARGET_MOVED,this._onTargetMoved))}setPenColorToColor(A,B){this._setPenColorToColor(A.COLOR,B.target)}_setPenColorToColor(A,B){const t=this._getPenState(B),e=Q.toRgbColorObject(A),g=s.rgbToHsv(e);t.color=g.h/360*100,t.saturation=100*g.s,t.brightness=100*g.v,e.hasOwnProperty("a")?t.transparency=100*(1-e.a/255):t.transparency=0,t._shade=t.brightness/2,this._updatePenColor(t)}_updatePenColor(A){const B=s.hsvToRgb({h:360*A.color/100,s:A.saturation/100,v:A.brightness/100});A.penAttributes.color4f[0]=B.r/255,A.penAttributes.color4f[1]=B.g/255,A.penAttributes.color4f[2]=B.b/255,A.penAttributes.color4f[3]=this._transparencyToAlpha(A.transparency)}_setOrChangeColorParam(A,B,t,e){switch(A){case C:t.color=this._wrapColor(B+(e?t.color:0));break;case a:t.saturation=this._clampColorParam(B+(e?t.saturation:0));break;case I:t.brightness=this._clampColorParam(B+(e?t.brightness:0));break;case h:t.transparency=this._clampColorParam(B+(e?t.transparency:0));break;default:o.warn("Tried to set or change unknown color parameter: ".concat(A))}this._updatePenColor(t)}changePenColorParamBy(A,B){const t=this._getPenState(B.target);this._setOrChangeColorParam(A.COLOR_PARAM,Q.toNumber(A.VALUE),t,!0)}setPenColorParamTo(A,B){const t=this._getPenState(B.target);this._setOrChangeColorParam(A.COLOR_PARAM,Q.toNumber(A.VALUE),t,!1)}changePenSizeBy(A,B){this._changePenSizeBy(Q.toNumber(A.SIZE),B.target)}_changePenSizeBy(A,B){const t=this._getPenState(B).penAttributes;t.diameter=this._clampPenSize(t.diameter+A)}setPenSizeTo(A,B){this._setPenSizeTo(Q.toNumber(A.SIZE),B.target)}_setPenSizeTo(A,B){this._getPenState(B).penAttributes.diameter=this._clampPenSize(A)}setPenHueToNumber(A,B){this._setPenHueToNumber(Q.toNumber(A.HUE),B.target)}_setPenHueToNumber(A,B){const t=this._getPenState(B),e=A/2;this._setOrChangeColorParam(C,e,t,!1),this._setOrChangeColorParam(h,0,t,!1),this._legacyUpdatePenColor(t)}changePenHueBy(A,B){this._changePenHueBy(Q.toNumber(A.HUE),B.target)}_changePenHueBy(A,B){const t=this._getPenState(B),e=A/2;this._setOrChangeColorParam(C,e,t,!0),this._legacyUpdatePenColor(t)}setPenShadeToNumber(A,B){this._setPenShadeToNumber(Q.toNumber(A.SHADE),B.target)}_setPenShadeToNumber(A,B){const t=this._getPenState(B);let e=Q.toNumber(A);e%=200,e<0&&(e+=200),t._shade=e,this._legacyUpdatePenColor(t)}changePenShadeBy(A,B){this._changePenShadeBy(A.SHADE,B.target)}_changePenShadeBy(A,B){const t=this._getPenState(B),e=Q.toNumber(A);this._setPenShadeToNumber(t._shade+e,B)}_legacyUpdatePenColor(A){let B=s.hsvToRgb({h:360*A.color/100,s:1,v:1});const t=A._shade>100?200-A._shade:A._shade;B=t<50?s.mixRgb(s.RGB_BLACK,B,(10+t)/60):s.mixRgb(B,s.RGB_WHITE,(t-50)/60);const e=s.rgbToHsv(B);A.color=100*e.h/360,A.saturation=100*e.s,A.brightness=100*e.v,this._updatePenColor(A)}}A.exports=Y},function(A,B,t){const e=t(11),g=t(22),i=t(13),Q=t(60),n=t(10),{Map:s}=t(31),r=t(0),c=t(12),E=t(114);t(226);A.exports=class extends e{constructor(A,B){super(),B||(B=new g(A)),this.runtime=A,this.id=n(),this.blocks=B,this.variables={},this.comments={},this._customState={},this._edgeActivatedHatValues={}}onGreenFlag(){}getName(){return this.id}updateEdgeActivatedValue(A,B){const t=this._edgeActivatedHatValues[A];return this._edgeActivatedHatValues[A]=B,t}hasEdgeActivatedValue(A){return this._edgeActivatedHatValues.hasOwnProperty(A)}clearEdgeActivatedValues(){this._edgeActivatedHatValues={}}lookupOrCreateVariable(A,B){let t=this.lookupVariableById(A);if(t)return t;if(t=this.lookupVariableByNameAndType(B,i.SCALAR_TYPE),t)return t;const e=new i(A,B,i.SCALAR_TYPE,!1);return this.variables[A]=e,e}lookupBroadcastMsg(A,B){let t;if(A?t=this.lookupVariableById(A):B?t=this.lookupBroadcastByInputValue(B):r.error("Cannot find broadcast message if neither id nor name are provided."),t)return B&&t.name.toLowerCase()!==B.toLowerCase()&&r.error("Found broadcast message with id: ".concat(A,", but")+"its name, ".concat(t.name," did not match expected name ").concat(B,".")),t.type!==i.BROADCAST_MESSAGE_TYPE&&r.error("Found variable with id: ".concat(A,", but its type ").concat(t.type)+"did not match expected type ".concat(i.BROADCAST_MESSAGE_TYPE)),t}lookupBroadcastByInputValue(A){const B=this.variables;for(const t in B)if(B[t].type===i.BROADCAST_MESSAGE_TYPE&&B[t].name.toLowerCase()===A.toLowerCase())return B[t]}lookupVariableById(A){if(this.variables.hasOwnProperty(A))return this.variables[A];if(this.runtime&&!this.isStage){const B=this.runtime.getTargetForStage();if(B&&B.variables.hasOwnProperty(A))return B.variables[A]}}lookupVariableByNameAndType(A,B,t){if("string"==typeof A){"string"!=typeof B&&(B=i.SCALAR_TYPE),t=t||!1;for(const t in this.variables){const e=this.variables[t];if(e.name===A&&e.type===B)return e}if(!t&&this.runtime&&!this.isStage){const t=this.runtime.getTargetForStage();if(t)for(const e in t.variables){const g=t.variables[e];if(g.name===A&&g.type===B)return g}}return null}}lookupOrCreateList(A,B){let t=this.lookupVariableById(A);if(t)return t;if(t=this.lookupVariableByNameAndType(B,i.LIST_TYPE),t)return t;const e=new i(A,B,i.LIST_TYPE,!1);return this.variables[A]=e,e}createVariable(A,B,t,e){if(!this.variables.hasOwnProperty(A)){const g=new i(A,B,t,!1);e&&this.isStage&&this.runtime.canAddCloudVariable()&&(g.isCloud=!0,this.runtime.addCloudVariable(),this.runtime.ioDevices.cloud.requestCreateVariable(g)),this.variables[A]=g}}createComment(A,B,t,e,g,i,n,s){if(!this.comments.hasOwnProperty(A)){const c=new Q(A,t,e,g,i,n,s);if(B){c.blockId=B;const t=this.blocks.getBlock(B);t?t.comment=A:r.warn("Could not find block with id ".concat(B," associated with commentId: ").concat(A))}this.comments[A]=c}}renameVariable(A,B){if(this.variables.hasOwnProperty(A)){const t=this.variables[A];if(t.id===A){const e=t.name;if(t.name=B,this.runtime){if(t.isCloud&&this.isStage&&this.runtime.ioDevices.cloud.requestRenameVariable(e,B),t.type===i.SCALAR_TYPE){let A=!1;this.runtime.targets.forEach(t=>{A=t.blocks.updateSensingOfReference(e,B,this.isStage?"_stage_":this.getName())||A}),A&&this.runtime.requestBlocksUpdate()}const g=this.runtime.monitorBlocks;g.changeBlock({id:A,element:"field",name:t.type===i.LIST_TYPE?"LIST":"VARIABLE",value:A},this.runtime);const Q=g.getBlock(t.id);Q&&this.runtime.requestUpdateMonitor(s({id:A,params:g._getBlockParams(Q)}))}}}}deleteVariable(A){if(this.variables.hasOwnProperty(A)){const B=this.variables[A].name,t=this.variables[A].isCloud;delete this.variables[A],this.runtime&&(t&&this.isStage&&(this.runtime.ioDevices.cloud.requestDeleteVariable(B),this.runtime.removeCloudVariable()),this.runtime.monitorBlocks.deleteBlock(A),this.runtime.requestRemoveMonitor(A))}}deleteMonitors(){let A;this.runtime.requestRemoveMonitorByTargetId(this.id),A=this.isStage?Object.keys(this.variables):Object.keys(this.runtime.monitorBlocks._blocks).filter(A=>this.runtime.monitorBlocks._blocks[A].targetId===this.id);for(const B of A)this.runtime.monitorBlocks.deleteBlock(B)}duplicateVariable(A,B){if(this.variables.hasOwnProperty(A)){const t=this.variables[A],e=new i(B?A:null,t.name,t.type,t.isCloud);return e.type===i.LIST_TYPE?e.value=t.value.slice(0):e.value=t.value,e}return null}duplicateVariables(A){let B;return A&&(B=A.getAllVariableAndListReferences()),Object.keys(this.variables).reduce((t,e)=>{const g=this.duplicateVariable(e,!A);if(t[g.id]=g,A&&B){const A=B[e];A&&this.mergeVariables(e,g.id,A)}return t},{})}postSpriteInfo(){}getCustomState(A){return this._customState[A]}setCustomState(A,B){this._customState[A]=B}dispose(){this._customState={},this.runtime&&this.runtime.removeExecutable(this)}getAllVariableNamesInScopeByType(A,B){"string"!=typeof A&&(A=i.SCALAR_TYPE),B=B||!1;const t=Object.values(this.variables).filter(B=>B.type===A).map(A=>A.name);if(B||this.isStage||!this.runtime)return t;const e=this.runtime.getTargetForStage().getAllVariableNamesInScopeByType(A);return t.concat(e)}mergeVariables(A,B,t,e){const g=t||this.blocks.getAllVariableAndListReferences()[A];E.updateVariableIdentifiers(g,B,e)}shareLocalVariableToStage(A,B){if(!this.runtime)return;const t=this.variables[A];if(!t)return void r.warn("Cannot share a local variable to the stage if it's not local.");const e=this.runtime.getTargetForStage(),g="StageVarFromLocal_".concat(A);let i=e.lookupVariableById(g);if(!i){const A=t.name,B=t.type,e="Stage: ".concat(A);i=this.runtime.createNewGlobalVariable(e,g,B)}this.mergeVariables(A,i.id,B,i.name)}shareLocalVariableToSprite(A,B,t){if(!this.runtime)return;if(this.isStage)return;const e=this.variables[A];if(!e)return void r.warn("Tried to call 'shareLocalVariableToSprite' with a non-local variable.");const g=e.name,Q=e.type,n=B.lookupVariableByNameAndType(g,Q);let s;if(n)s=n.id;else{const A=new i(null,g,Q);s=A.id,B.variables[s]=A}this.mergeVariables(A,s,t)}resolveVariableSharingConflictsWithTarget(A,B){if(this.isStage)return;const t=this.blocks.getAllVariableAndListReferences(A);for(const A in t){if(!this.variables[A])continue;const e=t[A];B.isStage?this.shareLocalVariableToStage(A,e):this.shareLocalVariableToSprite(A,B,e)}}fixUpVariableReferences(){if(!this.runtime)return;if(this.isStage)return;const A=this.runtime.getTargetForStage();if(!A||!A.variables)return;const B=(B,t,e)=>{if(A.lookupVariableByNameAndType(t,e)){const A=c.unusedName("".concat(this.getName(),": ").concat(t),this.getAllVariableNamesInScopeByType(e));return this.renameVariable(B,A),A}return null},t=this.blocks.getAllVariableAndListReferences(),e=[];if(Object.keys(this.variables).length>0)for(const A in this.variables)this.variables.hasOwnProperty(A)&&(t[A]||e.push(A));const g=Object.create(null),i=Object.create(null),Q={},n=A=>{const B=Q[A];return B||(Q[A]=this.runtime.getAllVarNamesOfType(A),Q[A])};for(const e in t){const Q=t[e][0],s=Q.referencingField.value,r=Q.type;if(this.lookupVariableById(e)){if(this.variables.hasOwnProperty(e)){const A=B(e,s,r);A&&t[e].map(B=>(B.referencingField.value=A,B))}}else{const B=A.lookupVariableByNameAndType(s,r);if(B)g[e]||(g[e]=B.id);else{const B=n(r),t=c.unusedName(s,B);A.createVariable(e,t,r),i[e]||(i[e]=t)}}}for(const A in e){const t=e[A];B(t,this.variables[t].name,this.variables[t].type)}for(const A in g){const B=g[A],e=t[A];this.mergeVariables(A,B,e)}for(const A in i){const B=i[A];t[A].map(A=>(A.referencingField.value=B,A))}}}},function(A,B,t){const e=t(110),g=t(111),i=t(10),Q=function A(B,t,g,Q){B.attribs.id||(B.attribs.id=i());const n={id:B.attribs.id,opcode:B.attribs.type,inputs:{},fields:{},next:null,topLevel:g,parent:Q,shadow:"shadow"===B.name,x:B.attribs.x,y:B.attribs.y};t[n.id]=n;for(let g=0;g0&&i.children[0].data?i.children[0].data:"",n.fields[A]={name:A,id:B,value:t};const e=i.attribs.variabletype;"string"==typeof e&&(n.fields[A].variableType=e);break}case"comment":n.comment=i.attribs.id;break;case"value":case"statement":{A(Q,t,!1,n.id),s&&Q!==s&&A(s,t,!1,n.id);const B=i.attribs.name;n.inputs[B]={name:B,block:Q.attribs.id,shadow:s?s.attribs.id:null};break}case"next":if(!Q||!Q.attribs)continue;A(Q,t,!1,n.id),n.next=Q.attribs.id;break;case"mutation":n.mutation=e(i)}}};A.exports=function(A){if("object"==typeof A&&"object"==typeof A.xml)return function(A){const B={};for(let t=0;t",quot:'"',nbsp:" "},e=/&([a-z]+);/gi;A.exports=function(A){return A.replace(e,(function(A,B){return B=B.toLowerCase(),t.hasOwnProperty(B)?t[B]:A}))}},function(A,B,t){t(11).prototype.emitFast=function(A,B,t,e,g){const i=this._events[A];if(i)if("function"==typeof i)i.call(this,B,t,e,g);else{const A=i.length;for(var Q=0;Q{this._pendingTimeoutId===t&&(this._pendingTimeoutId=null,this._pendingTimeoutStartTime=null,this._pendingTimeoutDelay=null),A()},B);this._pendingTimeoutId=t,this._pendingTimeoutStartTime=Date.now(),this._pendingTimeoutDelay=B}}class y{constructor(A,B){this._runtime=A,this._runtime.on("PROJECT_STOP_ALL",this.stopAll.bind(this)),this._extensionId=B,this._ports=["none","none"],this._motors=[null,null],this._sensors={tiltX:0,tiltY:0,distance:0},this._ble=null,this._runtime.registerPeripheralExtension(B,this),this._rateLimiter=new E(20),this._batteryLevelIntervalId=null,this.reset=this.reset.bind(this),this._onConnect=this._onConnect.bind(this),this._onMessage=this._onMessage.bind(this),this._checkBatteryLevel=this._checkBatteryLevel.bind(this)}get tiltX(){return this._sensors.tiltX}get tiltY(){return this._sensors.tiltY}get distance(){return this._sensors.distance}motor(A){return this._motors[A]}stopAllMotors(){this._motors.forEach(A=>{A&&A.turnOff(!1)})}setLED(A){const B=[A>>16&255,A>>8&255,255&A],t=this.generateOutputCommand(d,f,B);return this.send(M,t)}setLEDMode(){const A=this.generateInputCommand(d,D,H.LED,0,p.LED,!1);return this.send(Y,A)}stopLED(){const A=this.generateOutputCommand(d,f,[0,0,0]);return this.send(M,A)}playTone(A,B){const t=this.generateOutputCommand(U,m,[A,A>>8,B,B>>8]);return this.send(M,t)}stopTone(){const A=this.generateOutputCommand(U,G);return this.send(M,A,!1)}stopAll(){this.isConnected()&&(this.stopTone(),this.stopAllMotors())}scan(){this._ble&&this._ble.disconnect(),this._ble=new s(this._runtime,this._extensionId,{filters:[{services:[w]}],optionalServices:[C]},this._onConnect,this.reset)}connect(A){this._ble&&this._ble.connectPeripheral(A)}disconnect(){this._ble&&this._ble.disconnect(),this.reset()}reset(){this._ports=["none","none"],this._motors=[null,null],this._sensors={tiltX:0,tiltY:0,distance:0},this._batteryLevelIntervalId&&(window.clearInterval(this._batteryLevelIntervalId),this._batteryLevelIntervalId=null)}isConnected(){let A=!1;return this._ble&&(A=this._ble.isConnected()),A}send(A,B,t=!0){return this.isConnected()?t&&!this._rateLimiter.okayToSend()?Promise.resolve():this._ble.write(C,A,r.uint8ArrayToBase64(B),"base64"):Promise.resolve()}generateOutputCommand(A,B,t=null){let e=[A,B];return t&&(e=e.concat(t.length).concat(t)),e}generateInputCommand(A,B,t,e,g,i){return[1,2,A,B,t,e,0,0,0,g,i?1:0]}_onConnect(){this.setLEDMode(),this.setLED(255),this._ble.startNotifications(w,a,this._onMessage),this._batteryLevelIntervalId=window.setInterval(this._checkBatteryLevel,5e3)}_onMessage(A){const B=r.base64ToUint8Array(A);switch(B[0]){case 1:case 2:{const A=B[0];0===B[1]?this._clearPort(A):this._registerSensorOrMotor(A,B[3]);break}default:{const A=B[1],t=this._ports[A-1];t===l&&(this._sensors.distance=B[2]),t===u&&(this._sensors.tiltX=B[2],this._sensors.tiltY=B[3]);break}}}_checkBatteryLevel(){this._ble.read(w,I,!1)}_registerSensorOrMotor(A,B){if(this._ports[A-1]=B,B===F)this._motors[A-1]=new R(this,A-1);else{const t=B===l?"DISTANCE":"TILT",e=this.generateInputCommand(A,B,H[t],1,p[t],!0);this.send(Y,e),this._ble.startNotifications(C,h,this._onMessage)}}_clearPort(A){const B=this._ports[A-1];B===u&&(this._sensors.tiltX=this._sensors.tiltY=0),B===l&&(this._sensors.distance=0),this._ports[A-1]="none",this._motors[A-1]=null}}const J="motor",k="motor A",T="motor B",j="all motors",x="this way",S="that way",b="reverse",z="up",L="down",P="left",v="right",W="any";class V{static get EXTENSION_ID(){return"wedo2"}static get TILT_THRESHOLD(){return 15}constructor(A){this.runtime=A,this._peripheral=new y(this.runtime,V.EXTENSION_ID)}getInfo(){return{id:V.EXTENSION_ID,name:"WeDo 2.0",blockIconURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAF8klEQVR4Ae2cbWxTVRjH/7ctbVc2tyEMNpWBk0VIkLcEjSAQgglTE5HEaKqJi1E/mbCP/dJA0kQbvzgTQ0Ki2T7V6AeYGoEPLJmGKPiyzZDwEpYJCHSbQIcbdLvres1zOa13Xbvdu2eTDp9fst329Lnn5XfPPfece7tphmFAmDkuccdDBDIRgUxEIBMRyEQEMhGBTEQgExHIRAQyEYFMRCATEchEBDIRgUxEIBMRyEQEMhGBTEQgExHIxMPNIByNVQBoBUDb7kgo2KTS9wBoUmFNkVCwW6U3A1gP4JJKHwxHY/S+WcW2RkLBVhV7AMAOAIMAGlWstbyOSCh4QMU2Uoy1PBVL+a7IqZu1vOZIKNg20/azBarGvKxebw9HY22RULADwBFLTBcATQnZl4lVEimN4ssteXQrQfstebQpmW1q30xshyqvxRLbofYnYW9ZYgeV8C5LLOWlzbTxM3ouHI7GPgSwWx3Z0syBSBku6IYnlTbM+uQenJQaMnKHDaqAFnDrcCFbl3G1defEjas0a4N/Vz10OybyvapfrSX1sjpo+WIz0ME7QL3djgtHPTAcjb2mepw/b2ZaGh5NL5RnofR8R99dIC5fHusK5JsrCUpm7TSx21XvbcwTNwnbAsPR2GcA3qaG+H0LsHlDPZ7fca/ujZ+cRW9/Em5vCXzlNVhQUjFpf/3OTSRvXkKJz43Xt1bh1S1LUeq/5+njQ9/iVmLIfL1ieRU2b1iFtavztXNu6TrTi8PfnYI67WdPoOp5przV9Y8iuHdb9rOW9uumPI+vDIElddBckztPOqVn5X36Xj1WVQeynx1sOWbK83jc2PviM/dFXIYNax9H55leXLoyYHsfWwI14JCRRx7x5ckBU1oheYQ+1G9u39lVM0Hej7+cR7w/Yb7e9+5LqChfaLvixcK088BwNNZkAOV02ubK6+odwt3RcfOULSSPGEveG48bNj08If3kqXPmdtO6unkpDzYn0u/TLxrzcumJJ80Ut79sygzoFF6/siw75mUYupOEpmnY0/A0pw33FTsCa+hX5oJhZXgkZb5zub2O20CnL7EwkPeCPm+wI7CEBvi5wuOZ36tJW7X3uGXJXAgxk8P4eNpRPEvgskqfuR0Z/BNGejxvDM3/5gs0pboWv+motqybCc+tqUCzz43kaBJ/X+2eMjZ3ClNsjIzo5ioknXZ2b4AlkKYltLJoaY9jOJm/B0KJbtg4c4F/XOmH3+dF9dLKbBo1OD6QQGV56YQ55ODtO0jcHkZ1VSX8/n9nB9S7RkZ1rFy+NG8ZR9s70TeQQKDEh7vJUdt1Y9/OopXFB2/WcbMpyOexE9mlFS21aLlHMmKHfzBl0QT/hV2bzM9oLXv0xG8YGR0zpdLEn6RT2k+/XjDzoLX2G3u3TZBLUyral/Z5qCyAK1f/sl2/or+IWNel1Eji3MWrpjyCZHWqdNrSe6ieSHFERl4mP+q5GehgHGvvRGal5XI5uzU47f3A/R99YTgdF2wXrmkolr9ToZ5NvTjT4yOhoC2T057CJM/r9WDxoqmXa07R9THcuDVcMO8bt4ag6ynULKvkFjWBTLl0ugZKvNlyqLeSQKfYGgOpgXt2b5zVhlzrS+Dr451YvKg0b95txztxvS8xZ+VuXFuLJ5+oNgV+9c3PuHDxGs6cu+w4v//9RJo6x5bN9UgbBo4cPY1U6j+cSD8orFvzGFYuX4KxsRQGbth6FCICc9m5dY05HtN46AQRqPB5PWjY+ZT5RnMwkxGBFh5ZVmle9Z3MrGbjwfqccrC1vajrV7QCaVCfS6qrJj96nQlFK5CujPRT7MgYyEQEMhGBTGwJpAW4kJ9pBbo0zbx70X7y7AOv8HxP3LyB4YTpb2cZBt2iqL3QEwf9zDbX+waLca439QMeC7a+YBmOxugLiM/OTt2yaOoMoO+H6LOcNwf6xusrthsh/7mIh1yFmYhAJiKQiQhkIgKZiEAmIpCJCGQiApmIQCYikIkIZCICmYhAJiKQiQhkIgKZiEAmIpCJCGQiAjkA+AeOwQKMcWZqHgAAAABJRU5ErkJggg==",showStatusButton:!0,blocks:[{opcode:"motorOnFor",text:Q({id:"wedo2.motorOnFor",default:"turn [MOTOR_ID] on for [DURATION] seconds",description:"turn a motor on for some time"}),blockType:g.COMMAND,arguments:{MOTOR_ID:{type:e.STRING,menu:"MOTOR_ID",defaultValue:J},DURATION:{type:e.NUMBER,defaultValue:1}}},{opcode:"motorOn",text:Q({id:"wedo2.motorOn",default:"turn [MOTOR_ID] on",description:"turn a motor on indefinitely"}),blockType:g.COMMAND,arguments:{MOTOR_ID:{type:e.STRING,menu:"MOTOR_ID",defaultValue:J}}},{opcode:"motorOff",text:Q({id:"wedo2.motorOff",default:"turn [MOTOR_ID] off",description:"turn a motor off"}),blockType:g.COMMAND,arguments:{MOTOR_ID:{type:e.STRING,menu:"MOTOR_ID",defaultValue:J}}},{opcode:"startMotorPower",text:Q({id:"wedo2.startMotorPower",default:"set [MOTOR_ID] power to [POWER]",description:"set the motor's power and turn it on"}),blockType:g.COMMAND,arguments:{MOTOR_ID:{type:e.STRING,menu:"MOTOR_ID",defaultValue:J},POWER:{type:e.NUMBER,defaultValue:100}}},{opcode:"setMotorDirection",text:Q({id:"wedo2.setMotorDirection",default:"set [MOTOR_ID] direction to [MOTOR_DIRECTION]",description:"set the motor's turn direction"}),blockType:g.COMMAND,arguments:{MOTOR_ID:{type:e.STRING,menu:"MOTOR_ID",defaultValue:J},MOTOR_DIRECTION:{type:e.STRING,menu:"MOTOR_DIRECTION",defaultValue:x}}},{opcode:"setLightHue",text:Q({id:"wedo2.setLightHue",default:"set light color to [HUE]",description:"set the LED color"}),blockType:g.COMMAND,arguments:{HUE:{type:e.NUMBER,defaultValue:50}}},{opcode:"playNoteFor",text:Q({id:"wedo2.playNoteFor",default:"play note [NOTE] for [DURATION] seconds",description:"play a certain note for some time"}),blockType:g.COMMAND,arguments:{NOTE:{type:e.NUMBER,defaultValue:60},DURATION:{type:e.NUMBER,defaultValue:.5}},hideFromPalette:!0},{opcode:"whenDistance",text:Q({id:"wedo2.whenDistance",default:"when distance [OP] [REFERENCE]",description:"check for when distance is < or > than reference"}),blockType:g.HAT,arguments:{OP:{type:e.STRING,menu:"OP",defaultValue:"<"},REFERENCE:{type:e.NUMBER,defaultValue:50}}},{opcode:"whenTilted",text:Q({id:"wedo2.whenTilted",default:"when tilted [TILT_DIRECTION_ANY]",description:"check when tilted in a certain direction"}),func:"isTilted",blockType:g.HAT,arguments:{TILT_DIRECTION_ANY:{type:e.STRING,menu:"TILT_DIRECTION_ANY",defaultValue:W}}},{opcode:"getDistance",text:Q({id:"wedo2.getDistance",default:"distance",description:"the value returned by the distance sensor"}),blockType:g.REPORTER},{opcode:"isTilted",text:Q({id:"wedo2.isTilted",default:"tilted [TILT_DIRECTION_ANY]?",description:"whether the tilt sensor is tilted"}),blockType:g.BOOLEAN,arguments:{TILT_DIRECTION_ANY:{type:e.STRING,menu:"TILT_DIRECTION_ANY",defaultValue:W}}},{opcode:"getTiltAngle",text:Q({id:"wedo2.getTiltAngle",default:"tilt angle [TILT_DIRECTION]",description:"the angle returned by the tilt sensor"}),blockType:g.REPORTER,arguments:{TILT_DIRECTION:{type:e.STRING,menu:"TILT_DIRECTION",defaultValue:z}}}],menus:{MOTOR_ID:{acceptReporters:!0,items:[{text:Q({id:"wedo2.motorId.default",default:"motor",description:"label for motor element in motor menu for LEGO WeDo 2 extension"}),value:J},{text:Q({id:"wedo2.motorId.a",default:"motor A",description:"label for motor A element in motor menu for LEGO WeDo 2 extension"}),value:k},{text:Q({id:"wedo2.motorId.b",default:"motor B",description:"label for motor B element in motor menu for LEGO WeDo 2 extension"}),value:T},{text:Q({id:"wedo2.motorId.all",default:"all motors",description:"label for all motors element in motor menu for LEGO WeDo 2 extension"}),value:j}]},MOTOR_DIRECTION:{acceptReporters:!0,items:[{text:Q({id:"wedo2.motorDirection.forward",default:"this way",description:"label for forward element in motor direction menu for LEGO WeDo 2 extension"}),value:x},{text:Q({id:"wedo2.motorDirection.backward",default:"that way",description:"label for backward element in motor direction menu for LEGO WeDo 2 extension"}),value:S},{text:Q({id:"wedo2.motorDirection.reverse",default:"reverse",description:"label for reverse element in motor direction menu for LEGO WeDo 2 extension"}),value:b}]},TILT_DIRECTION:{acceptReporters:!0,items:[{text:Q({id:"wedo2.tiltDirection.up",default:"up",description:"label for up element in tilt direction menu for LEGO WeDo 2 extension"}),value:z},{text:Q({id:"wedo2.tiltDirection.down",default:"down",description:"label for down element in tilt direction menu for LEGO WeDo 2 extension"}),value:L},{text:Q({id:"wedo2.tiltDirection.left",default:"left",description:"label for left element in tilt direction menu for LEGO WeDo 2 extension"}),value:P},{text:Q({id:"wedo2.tiltDirection.right",default:"right",description:"label for right element in tilt direction menu for LEGO WeDo 2 extension"}),value:v}]},TILT_DIRECTION_ANY:{acceptReporters:!0,items:[{text:Q({id:"wedo2.tiltDirection.up",default:"up"}),value:z},{text:Q({id:"wedo2.tiltDirection.down",default:"down"}),value:L},{text:Q({id:"wedo2.tiltDirection.left",default:"left"}),value:P},{text:Q({id:"wedo2.tiltDirection.right",default:"right"}),value:v},{text:Q({id:"wedo2.tiltDirection.any",default:"any",description:"label for any element in tilt direction menu for LEGO WeDo 2 extension"}),value:W}]},OP:{acceptReporters:!0,items:["<",">"]}}}}motorOnFor(A){let B=1e3*i.toNumber(A.DURATION);return B=c.clamp(B,0,15e3),new Promise(t=>{this._forEachMotor(A.MOTOR_ID,A=>{const t=this._peripheral.motor(A);t&&t.turnOnFor(B)}),setTimeout(t,B)})}motorOn(A){return this._forEachMotor(A.MOTOR_ID,A=>{const B=this._peripheral.motor(A);B&&B.turnOn()}),new Promise(A=>{window.setTimeout(()=>{A()},100)})}motorOff(A){return this._forEachMotor(A.MOTOR_ID,A=>{const B=this._peripheral.motor(A);B&&B.turnOff()}),new Promise(A=>{window.setTimeout(()=>{A()},100)})}startMotorPower(A){return this._forEachMotor(A.MOTOR_ID,B=>{const t=this._peripheral.motor(B);t&&(t.power=c.clamp(i.toNumber(A.POWER),0,100),t.turnOn())}),new Promise(A=>{window.setTimeout(()=>{A()},100)})}setMotorDirection(A){return this._forEachMotor(A.MOTOR_ID,B=>{const t=this._peripheral.motor(B);if(t){switch(A.MOTOR_DIRECTION){case x:t.direction=1;break;case S:t.direction=-1;break;case b:t.direction=-t.direction;break;default:o.warn("Unknown motor direction in setMotorDirection: ".concat(A.DIRECTION))}t.isOn&&(t.pendingTimeoutDelay?t.turnOnFor(t.pendingTimeoutStartTime+t.pendingTimeoutDelay-Date.now()):t.turnOn())}}),new Promise(A=>{window.setTimeout(()=>{A()},100)})}setLightHue(A){let B=i.toNumber(A.HUE);B=c.wrapClamp(B,0,100);const t=360*B/100,e=n.hsvToRgb({h:t,s:1,v:1}),g=n.rgbToDecimal(e);return this._peripheral.setLED(g),new Promise(A=>{window.setTimeout(()=>{A()},100)})}playNoteFor(A){let B=1e3*i.toNumber(A.DURATION);B=c.clamp(B,0,3e3);const t=c.clamp(i.toNumber(A.NOTE),25,125);if(0!==B)return new Promise(A=>{const e=this._noteToTone(t);this._peripheral.playTone(e,B),setTimeout(A,B)})}whenDistance(A){switch(A.OP){case"<":return this._peripheral.distance":return this._peripheral.distance>i.toNumber(A.REFERENCE);default:return o.warn("Unknown comparison operator in whenDistance: ".concat(A.OP)),!1}}whenTilted(A){return this._isTilted(A.TILT_DIRECTION_ANY)}getDistance(){return this._peripheral.distance}isTilted(A){return this._isTilted(A.TILT_DIRECTION_ANY)}getTiltAngle(A){return this._getTiltAngle(A.TILT_DIRECTION)}_isTilted(A){switch(A){case W:return this._getTiltAngle(z)>=V.TILT_THRESHOLD||this._getTiltAngle(L)>=V.TILT_THRESHOLD||this._getTiltAngle(P)>=V.TILT_THRESHOLD||this._getTiltAngle(v)>=V.TILT_THRESHOLD;default:return this._getTiltAngle(A)>=V.TILT_THRESHOLD}}_getTiltAngle(A){switch(A){case z:return this._peripheral.tiltY>45?256-this._peripheral.tiltY:-this._peripheral.tiltY;case L:return this._peripheral.tiltY>45?this._peripheral.tiltY-256:this._peripheral.tiltY;case P:return this._peripheral.tiltX>45?256-this._peripheral.tiltX:-this._peripheral.tiltX;case v:return this._peripheral.tiltX>45?this._peripheral.tiltX-256:this._peripheral.tiltX;default:o.warn("Unknown tilt direction in _getTiltAngle: ".concat(A))}}_forEachMotor(A,B){let t;switch(A){case k:t=[0];break;case T:t=[1];break;case j:case J:t=[0,1];break;default:o.warn("Invalid motor ID: ".concat(A)),t=[]}for(const A of t)B(A)}_noteToTone(A){return 440*Math.pow(2,(A-69)/12)}}A.exports=V},function(A,B,t){(function(A,B){!function(t){"use strict";var e,g="function"==typeof(e=t.atob)?e:"function"==typeof A?function(B){ -//!! Deliberately using an API that's deprecated in node.js because -//!! this file is for browsers and we expect them to cope with it. -//!! Discussion: github.com/node-browser-compat/atob/pull/9 -return new A(B,"base64").toString("binary")}:"object"==typeof t.base64js?function(A){var B=t.base64js.b64ToByteArray(A);return Array.prototype.map.call(B,(function(A){return String.fromCharCode(A)})).join("")}:function(){throw new Error("You're probably in an old browser or an iOS webworker. It might help to include beatgammit's base64-js.")};t.atob=g,B&&B.exports&&(B.exports=g)}(window)}).call(this,t(7).Buffer,t(229)(A))},function(A,B){A.exports=function(A){return A.webpackPolyfill||(A.deprecate=function(){},A.paths=[],A.children||(A.children=[]),Object.defineProperty(A,"loaded",{enumerable:!0,get:function(){return A.l}}),Object.defineProperty(A,"id",{enumerable:!0,get:function(){return A.i}}),A.webpackPolyfill=1),A}},function(A,B,t){(function(B){!function(){"use strict";A.exports=function(A){return(A instanceof B?A:B.from(A.toString(),"binary")).toString("base64")}}()}).call(this,t(7).Buffer)},function(A,B,t){const e=t(6),g=t(3),i=t(18),Q=t(1),n=t(5),s=t(4),r=t(20);let c={};try{c=t(232)}catch(A){}class E{constructor(A){this.runtime=A,this._concurrencyCounter=0,this._drumPlayers=[],this._instrumentPlayerArrays=[],this._instrumentPlayerNoteArrays=[],this._bufferSources=[],this._loadAllSounds(),this._onTargetCreated=this._onTargetCreated.bind(this),this.runtime.on("targetWasCreated",this._onTargetCreated),this._playNoteForPicker=this._playNoteForPicker.bind(this),this.runtime.on("PLAY_NOTE",this._playNoteForPicker)}_loadAllSounds(){const A=[];this.DRUM_INFO.forEach((B,t)=>{const e="drums/".concat(B.fileName),g=this._storeSound(e,t,this._drumPlayers);A.push(g)}),this.INSTRUMENT_INFO.forEach((B,t)=>{this._instrumentPlayerArrays[t]=[],this._instrumentPlayerNoteArrays[t]=[],B.samples.forEach((e,g)=>{const i="instruments/".concat(B.dirName,"/").concat(e),Q=this._storeSound(i,g,this._instrumentPlayerArrays[t]);A.push(Q)})}),Promise.all(A).then(()=>{})}_storeSound(A,B,t){const e="".concat(A,".mp3");if(!c[e])return;const g=c[e];return fetch(g).then(A=>A.arrayBuffer()).then(A=>this._decodeSound(A)).then(A=>{t[B]=A})}_decodeSound(A){const B=this.runtime.audioEngine;return B?B.decodeSoundPlayer({data:{buffer:A}}):Promise.reject(new Error("No Audio Context Detected"))}_buildMenu(A){return A.map((A,B)=>{const t={};return t.text=A.name,t.value=String(B+1),t})}get DRUM_INFO(){return[{name:n({id:"music.drumSnare",default:"(1) Snare Drum",description:"Sound of snare drum as used in a standard drum kit"}),fileName:"1-snare"},{name:n({id:"music.drumBass",default:"(2) Bass Drum",description:"Sound of bass drum as used in a standard drum kit"}),fileName:"2-bass-drum"},{name:n({id:"music.drumSideStick",default:"(3) Side Stick",description:"Sound of a drum stick hitting the side of a drum (usually the snare)"}),fileName:"3-side-stick"},{name:n({id:"music.drumCrashCymbal",default:"(4) Crash Cymbal",description:"Sound of a drum stick hitting a crash cymbal"}),fileName:"4-crash-cymbal"},{name:n({id:"music.drumOpenHiHat",default:"(5) Open Hi-Hat",description:"Sound of a drum stick hitting a hi-hat while open"}),fileName:"5-open-hi-hat"},{name:n({id:"music.drumClosedHiHat",default:"(6) Closed Hi-Hat",description:"Sound of a drum stick hitting a hi-hat while closed"}),fileName:"6-closed-hi-hat"},{name:n({id:"music.drumTambourine",default:"(7) Tambourine",description:"Sound of a tambourine being struck"}),fileName:"7-tambourine"},{name:n({id:"music.drumHandClap",default:"(8) Hand Clap",description:"Sound of two hands clapping together"}),fileName:"8-hand-clap"},{name:n({id:"music.drumClaves",default:"(9) Claves",description:"Sound of claves being struck together"}),fileName:"9-claves"},{name:n({id:"music.drumWoodBlock",default:"(10) Wood Block",description:"Sound of a wood block being struck"}),fileName:"10-wood-block"},{name:n({id:"music.drumCowbell",default:"(11) Cowbell",description:"Sound of a cowbell being struck"}),fileName:"11-cowbell"},{name:n({id:"music.drumTriangle",default:"(12) Triangle",description:"Sound of a triangle (instrument) being struck"}),fileName:"12-triangle"},{name:n({id:"music.drumBongo",default:"(13) Bongo",description:"Sound of a bongo being struck"}),fileName:"13-bongo"},{name:n({id:"music.drumConga",default:"(14) Conga",description:"Sound of a conga being struck"}),fileName:"14-conga"},{name:n({id:"music.drumCabasa",default:"(15) Cabasa",description:"Sound of a cabasa being shaken"}),fileName:"15-cabasa"},{name:n({id:"music.drumGuiro",default:"(16) Guiro",description:"Sound of a guiro being played"}),fileName:"16-guiro"},{name:n({id:"music.drumVibraslap",default:"(17) Vibraslap",description:"Sound of a Vibraslap being played"}),fileName:"17-vibraslap"},{name:n({id:"music.drumCuica",default:"(18) Cuica",description:"Sound of a cuica being played"}),fileName:"18-cuica"}]}get INSTRUMENT_INFO(){return[{name:n({id:"music.instrumentPiano",default:"(1) Piano",description:"Sound of a piano"}),dirName:"1-piano",releaseTime:.5,samples:[24,36,48,60,72,84,96,108]},{name:n({id:"music.instrumentElectricPiano",default:"(2) Electric Piano",description:"Sound of an electric piano"}),dirName:"2-electric-piano",releaseTime:.5,samples:[60]},{name:n({id:"music.instrumentOrgan",default:"(3) Organ",description:"Sound of an organ"}),dirName:"3-organ",releaseTime:.5,samples:[60]},{name:n({id:"music.instrumentGuitar",default:"(4) Guitar",description:"Sound of an accoustic guitar"}),dirName:"4-guitar",releaseTime:.5,samples:[60]},{name:n({id:"music.instrumentElectricGuitar",default:"(5) Electric Guitar",description:"Sound of an electric guitar"}),dirName:"5-electric-guitar",releaseTime:.5,samples:[60]},{name:n({id:"music.instrumentBass",default:"(6) Bass",description:"Sound of an accoustic upright bass"}),dirName:"6-bass",releaseTime:.25,samples:[36,48]},{name:n({id:"music.instrumentPizzicato",default:"(7) Pizzicato",description:"Sound of a string instrument (e.g. violin) being plucked"}),dirName:"7-pizzicato",releaseTime:.25,samples:[60]},{name:n({id:"music.instrumentCello",default:"(8) Cello",description:"Sound of a cello being played with a bow"}),dirName:"8-cello",releaseTime:.1,samples:[36,48,60]},{name:n({id:"music.instrumentTrombone",default:"(9) Trombone",description:"Sound of a trombone being played"}),dirName:"9-trombone",samples:[36,48,60]},{name:n({id:"music.instrumentClarinet",default:"(10) Clarinet",description:"Sound of a clarinet being played"}),dirName:"10-clarinet",samples:[48,60]},{name:n({id:"music.instrumentSaxophone",default:"(11) Saxophone",description:"Sound of a saxophone being played"}),dirName:"11-saxophone",samples:[36,60,84]},{name:n({id:"music.instrumentFlute",default:"(12) Flute",description:"Sound of a flute being played"}),dirName:"12-flute",samples:[60,72]},{name:n({id:"music.instrumentWoodenFlute",default:"(13) Wooden Flute",description:"Sound of a wooden flute being played"}),dirName:"13-wooden-flute",samples:[60,72]},{name:n({id:"music.instrumentBassoon",default:"(14) Bassoon",description:"Sound of a bassoon being played"}),dirName:"14-bassoon",samples:[36,48,60]},{name:n({id:"music.instrumentChoir",default:"(15) Choir",description:"Sound of a choir singing"}),dirName:"15-choir",releaseTime:.25,samples:[48,60,72]},{name:n({id:"music.instrumentVibraphone",default:"(16) Vibraphone",description:"Sound of a vibraphone being struck"}),dirName:"16-vibraphone",releaseTime:.5,samples:[60,72]},{name:n({id:"music.instrumentMusicBox",default:"(17) Music Box",description:"Sound of a music box playing"}),dirName:"17-music-box",releaseTime:.25,samples:[60]},{name:n({id:"music.instrumentSteelDrum",default:"(18) Steel Drum",description:"Sound of a steel drum being struck"}),dirName:"18-steel-drum",releaseTime:.5,samples:[60]},{name:n({id:"music.instrumentMarimba",default:"(19) Marimba",description:"Sound of a marimba being struck"}),dirName:"19-marimba",samples:[60]},{name:n({id:"music.instrumentSynthLead",default:"(20) Synth Lead",description:'Sound of a "lead" synthesizer being played'}),dirName:"20-synth-lead",releaseTime:.1,samples:[60]},{name:n({id:"music.instrumentSynthPad",default:"(21) Synth Pad",description:'Sound of a "pad" synthesizer being played'}),dirName:"21-synth-pad",releaseTime:.25,samples:[60]}]}get MIDI_INSTRUMENTS(){return[1,1,1,1,2,2,4,4,17,17,17,16,19,16,17,17,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,6,8,8,8,8,8,7,8,19,8,8,8,8,15,15,15,19,9,9,9,9,9,9,9,9,11,11,11,11,14,14,14,10,12,12,13,13,13,13,12,12,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,4,4,4,4,17,14,8,10,17,17,18,19,1,1,1,1,21,21,21,21,21,21,21,21]}get MIDI_DRUMS(){return[[1,-4],[1,0],[2,0],[0,0],[7,0],[0,2],[1,-6,4],[5,0],[1,-3,3.2],[5,0],[1,0,3],[4,-8],[1,4,3],[1,7,2.7],[3,-8],[1,10,2.7],[4,-2],[3,-11],[4,2],[6,0],[3,0,3.5],[10,0],[3,-8,3.5],[16,-6],[4,2],[12,2],[12,0],[13,0,.2],[13,0,2],[13,-5,2],[12,12],[12,5],[10,19],[10,12],[14,0],[14,0],[17,12],[17,5],[15,0],[15,0],[8,0],[9,0],[9,-4],[17,-5],[17,0],[11,-6,1],[11,-6,3]]}static get STATE_KEY(){return"Scratch.music"}static get DEFAULT_MUSIC_STATE(){return{currentInstrument:0}}static get MIDI_NOTE_RANGE(){return{min:0,max:130}}static get BEAT_RANGE(){return{min:0,max:100}}static get TEMPO_RANGE(){return{min:20,max:500}}static get CONCURRENCY_LIMIT(){return 30}_getMusicState(A){let B=A.getCustomState(E.STATE_KEY);return B||(B=i.simple(E.DEFAULT_MUSIC_STATE),A.setCustomState(E.STATE_KEY,B)),B}_onTargetCreated(A,B){if(B){const t=B.getCustomState(E.STATE_KEY);t&&A.setCustomState(E.STATE_KEY,i.simple(t))}}getInfo(){return{id:"music",name:n({id:"music.categoryName",default:"Music",description:"Label for the Music extension category"}),menuIconURI:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE2LjA5IDEyLjkzN2MuMjI4IDEuMTQxLS44MzMgMi4wNjMtMi4zNzMgMi4wNjMtMS41MzUgMC0yLjk2Mi0uOTIyLTMuMTg2LTIuMDYzLS4yMy0xLjE0Mi44MzMtMi4wNjggMi4zNzItMi4wNjguMzIzIDAgLjY0MS4wNDIuOTQ1LjExN2EzLjUgMy41IDAgMCAxIC40NjguMTUxYy40MzUtLjAxLS4wNTItMS4xNDctLjkxNy02LjExNC0xLjA2Ny02LjE1MiAxLjUzLS45MzUgNC4zODQtMS4zNzcgMi44NTQtLjQ0Mi4wMzggMi40MS0xLjgyNSAxLjkyMi0xLjg2Mi0uNDkzLTIuMzI1LTMuNTc3LjEzMiA3LjM3ek03LjQ2IDguNTYzYy0xLjg2Mi0uNDkzLTIuMzI1LTMuNTc2LjEzIDcuMzdDNy44MTYgMTcuMDczIDYuNzU0IDE4IDUuMjIgMThjLTEuNTM1IDAtMi45NjEtLjkyNi0zLjE5LTIuMDY4LS4yMjQtMS4xNDIuODM3LTIuMDY3IDIuMzc1LTIuMDY3LjUwMSAwIC45ODcuMDk4IDEuNDI3LjI3Mi40MTItLjAyOC0uMDc0LTEuMTg5LS45My02LjExNEMzLjgzNCAxLjg3IDYuNDMgNy4wODcgOS4yODIgNi42NDZjMi44NTQtLjQ0Ny4wMzggMi40MS0xLjgyMyAxLjkxN3oiIGZpbGw9IiM1NzVFNzUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==",blockIconURI:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PHRpdGxlPm11c2ljLWJsb2NrLWljb248L3RpdGxlPjxkZWZzPjxwYXRoIGQ9Ik0zMi4xOCAyNS44NzRDMzIuNjM2IDI4LjE1NyAzMC41MTIgMzAgMjcuNDMzIDMwYy0zLjA3IDAtNS45MjMtMS44NDMtNi4zNzItNC4xMjYtLjQ1OC0yLjI4NSAxLjY2NS00LjEzNiA0Ljc0My00LjEzNi42NDcgMCAxLjI4My4wODQgMS44OS4yMzQuMzM4LjA4Ni42MzcuMTguOTM4LjMwMi44Ny0uMDItLjEwNC0yLjI5NC0xLjgzNS0xMi4yMy0yLjEzNC0xMi4zMDIgMy4wNi0xLjg3IDguNzY4LTIuNzUyIDUuNzA4LS44ODUuMDc2IDQuODItMy42NSAzLjg0NC0zLjcyNC0uOTg3LTQuNjUtNy4xNTMuMjYzIDE0LjczOHptLTE2Ljk5OCA1Ljk5QzE1LjYzIDM0LjE0OCAxMy41MDcgMzYgMTAuNDQgMzZjLTMuMDcgMC01LjkyMi0xLjg1Mi02LjM4LTQuMTM2LS40NDgtMi4yODQgMS42NzQtNC4xMzUgNC43NS00LjEzNSAxLjAwMyAwIDEuOTc1LjE5NiAyLjg1NS41NDMuODIyLS4wNTUtLjE1LTIuMzc3LTEuODYyLTEyLjIyOC0yLjEzMy0xMi4zMDMgMy4wNi0xLjg3IDguNzY0LTIuNzUzIDUuNzA2LS44OTQuMDc2IDQuODItMy42NDggMy44MzQtMy43MjQtLjk4Ny00LjY1LTcuMTUyLjI2MiAxNC43Mzh6IiBpZD0iYSIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjx1c2UgZmlsbD0iI0ZGRiIgeGxpbms6aHJlZj0iI2EiLz48cGF0aCBzdHJva2Utb3BhY2l0eT0iLjEiIHN0cm9rZT0iIzAwMCIgZD0iTTI4LjQ1NiAyMS42NzVjLS4wMS0uMzEyLS4wODctLjgyNS0uMjU2LTEuNzAyLS4wOTYtLjQ5NS0uNjEyLTMuMDIyLS43NTMtMy43My0uMzk1LTEuOTgtLjc2LTMuOTItMS4xNDItNi4xMTMtLjczMi00LjIyMy0uNjkzLTYuMDUuMzQ0LTYuNTI3LjUtLjIzIDEuMDYtLjA4IDEuODQuMzUuNDE0LjIyNyAyLjE4MiAxLjM2NSAyLjA3IDEuMjk2IDEuOTk0IDEuMjQyIDMuNDY0IDEuNzc0IDQuOTMgMS41NDggMS41MjYtLjIzNyAyLjUwNC0uMDYgMi44NzYuNjE4LjM0OC42MzUuMDE1IDEuNDE2LS43MyAyLjE4LTEuNDcyIDEuNTE2LTMuOTc1IDIuNTE0LTUuODQ4IDIuMDIzLS44MjItLjIyLTEuMjM4LS40NjUtMi4zOC0xLjI2N2wtLjA5NS0uMDY2Yy4wNDcuNTkzLjI2NCAxLjc0LjcxNyAzLjgwMy4yOTQgMS4zMzYgMi4wOCA5LjE4NyAyLjYzNyAxMS42NzRsLjAwMi4wMTJjLjUyOCAyLjYzNy0xLjg3MyA0LjcyNC01LjIzNiA0LjcyNC0zLjI5IDAtNi4zNjMtMS45ODgtNi44NjItNC41MjgtLjUzLTIuNjQgMS44NzMtNC43MzQgNS4yMzMtNC43MzQuNjcyIDAgMS4zNDcuMDg1IDIuMDE0LjI1LjIyNy4wNTcuNDM2LjExOC42MzYuMTg3em0tMTYuOTk2IDUuOTljLS4wMS0uMzE4LS4wOS0uODM4LS4yNjYtMS43MzctLjA5LS40Ni0uNTk1LTIuOTM3LS43NTMtMy43MjctLjM5LTEuOTYtLjc1LTMuODktMS4xMy02LjA3LS43MzItNC4yMjMtLjY5Mi02LjA1LjM0NC02LjUyNi41MDItLjIzIDEuMDYtLjA4MiAxLjg0LjM1LjQxNS4yMjcgMi4xODIgMS4zNjQgMi4wNyAxLjI5NSAxLjk5MyAxLjI0MiAzLjQ2MiAxLjc3NCA0LjkyNiAxLjU0OCAxLjUyNS0uMjQgMi41MDQtLjA2NCAyLjg3Ni42MTQuMzQ4LjYzNS4wMTUgMS40MTUtLjcyOCAyLjE4LTEuNDc0IDEuNTE3LTMuOTc3IDIuNTEzLTUuODQ3IDIuMDE3LS44Mi0uMjItMS4yMzYtLjQ2NC0yLjM3OC0xLjI2N2wtLjA5NS0uMDY1Yy4wNDcuNTkzLjI2NCAxLjc0LjcxNyAzLjgwMi4yOTQgMS4zMzcgMi4wNzggOS4xOSAyLjYzNiAxMS42NzVsLjAwMy4wMTNjLjUxNyAyLjYzOC0xLjg4NCA0LjczMi01LjIzNCA0LjczMi0zLjI4NyAwLTYuMzYtMS45OTMtNi44Ny00LjU0LS41Mi0yLjY0IDEuODg0LTQuNzMgNS4yNC00LjczLjkwNSAwIDEuODAzLjE1IDIuNjUuNDM2eiIvPjwvZz48L3N2Zz4=",blocks:[{opcode:"playDrumForBeats",blockType:g.COMMAND,text:n({id:"music.playDrumForBeats",default:"play drum [DRUM] for [BEATS] beats",description:"play drum sample for a number of beats"}),arguments:{DRUM:{type:e.NUMBER,menu:"DRUM",defaultValue:1},BEATS:{type:e.NUMBER,defaultValue:.25}}},{opcode:"midiPlayDrumForBeats",blockType:g.COMMAND,text:n({id:"music.midiPlayDrumForBeats",default:"play drum [DRUM] for [BEATS] beats",description:"play drum sample for a number of beats according to a mapping of MIDI codes"}),arguments:{DRUM:{type:e.NUMBER,menu:"DRUM",defaultValue:1},BEATS:{type:e.NUMBER,defaultValue:.25}},hideFromPalette:!0},{opcode:"restForBeats",blockType:g.COMMAND,text:n({id:"music.restForBeats",default:"rest for [BEATS] beats",description:"rest (play no sound) for a number of beats"}),arguments:{BEATS:{type:e.NUMBER,defaultValue:.25}}},{opcode:"playNoteForBeats",blockType:g.COMMAND,text:n({id:"music.playNoteForBeats",default:"play note [NOTE] for [BEATS] beats",description:"play a note for a number of beats"}),arguments:{NOTE:{type:e.NOTE,defaultValue:60},BEATS:{type:e.NUMBER,defaultValue:.25}}},{opcode:"setInstrument",blockType:g.COMMAND,text:n({id:"music.setInstrument",default:"set instrument to [INSTRUMENT]",description:"set the instrument (e.g. piano, guitar, trombone) for notes played"}),arguments:{INSTRUMENT:{type:e.NUMBER,menu:"INSTRUMENT",defaultValue:1}}},{opcode:"midiSetInstrument",blockType:g.COMMAND,text:n({id:"music.midiSetInstrument",default:"set instrument to [INSTRUMENT]",description:"set the instrument for notes played according to a mapping of MIDI codes"}),arguments:{INSTRUMENT:{type:e.NUMBER,defaultValue:1}},hideFromPalette:!0},{opcode:"setTempo",blockType:g.COMMAND,text:n({id:"music.setTempo",default:"set tempo to [TEMPO]",description:"set tempo (speed) for notes, drums, and rests played"}),arguments:{TEMPO:{type:e.NUMBER,defaultValue:60}}},{opcode:"changeTempo",blockType:g.COMMAND,text:n({id:"music.changeTempo",default:"change tempo by [TEMPO]",description:"change tempo (speed) for notes, drums, and rests played"}),arguments:{TEMPO:{type:e.NUMBER,defaultValue:20}}},{opcode:"getTempo",text:n({id:"music.getTempo",default:"tempo",description:"get the current tempo (speed) for notes, drums, and rests played"}),blockType:g.REPORTER}],menus:{DRUM:{acceptReporters:!0,items:this._buildMenu(this.DRUM_INFO)},INSTRUMENT:{acceptReporters:!0,items:this._buildMenu(this.INSTRUMENT_INFO)}}}}playDrumForBeats(A,B){this._playDrumForBeats(A.DRUM,A.BEATS,B)}midiPlayDrumForBeats(A,B){let t=Q.toNumber(A.DRUM);t=Math.round(t);const e=this.MIDI_DRUMS[t-35];t=e?e[0]:2,t+=1,this._playDrumForBeats(t,A.BEATS,B)}_playDrumForBeats(A,B,t){this._stackTimerNeedsInit(t)?(A=Q.toNumber(A),A=Math.round(A),A-=1,A=s.wrapClamp(A,0,this.DRUM_INFO.length-1),B=Q.toNumber(B),B=this._clampBeats(B),this._playDrumNum(t,A),this._startStackTimer(t,this._beatsToSec(B))):this._checkStackTimer(t)}_playDrumNum(A,B){if(null===A.runtime.audioEngine)return;if(null===A.target.sprite.soundBank)return;if(this._concurrencyCounter>E.CONCURRENCY_LIMIT)return;const t=this._drumPlayers[B];if(void 0===t)return;t.isPlaying&&!t.isStarting&&t.take();const e=A.runtime.audioEngine,g=e.audioContext.createGain();g.gain.setValueAtTime(A.target.volume/100,e.currentTime),g.connect(e.getInputNode()),this._concurrencyCounter++,t.once("stop",()=>{this._concurrencyCounter--}),t.play(),t.connect({getInputNode:()=>g})}restForBeats(A,B){if(this._stackTimerNeedsInit(B)){let t=Q.toNumber(A.BEATS);t=this._clampBeats(t),this._startStackTimer(B,this._beatsToSec(t))}else this._checkStackTimer(B)}playNoteForBeats(A,B){if(this._stackTimerNeedsInit(B)){let t=Q.toNumber(A.NOTE);t=s.clamp(t,E.MIDI_NOTE_RANGE.min,E.MIDI_NOTE_RANGE.max);let e=Q.toNumber(A.BEATS);if(e=this._clampBeats(e),0===e)return;const g=this._beatsToSec(e);this._playNote(B,t,g),this._startStackTimer(B,g)}else this._checkStackTimer(B)}_playNoteForPicker(A,B){if(B!==this.getInfo().name)return;const t={runtime:this.runtime,target:this.runtime.getEditingTarget()};this._playNote(t,A,.25)}_playNote(A,B,t){if(null===A.runtime.audioEngine)return;if(null===A.target.sprite.soundBank)return;if(this._concurrencyCounter>E.CONCURRENCY_LIMIT)return;const e=this._getMusicState(A.target).currentInstrument,g=this.INSTRUMENT_INFO[e].samples,i=this._selectSampleIndexForNote(B,g);if(void 0===this._instrumentPlayerArrays[e])return;if(void 0===this._instrumentPlayerArrays[e][i])return;const Q=A.runtime.audioEngine;this._instrumentPlayerNoteArrays[e][B]||(this._instrumentPlayerNoteArrays[e][B]=this._instrumentPlayerArrays[e][i].take());const n=this._instrumentPlayerNoteArrays[e][B];n.isPlaying&&!n.isStarting&&n.take();const s=g[i],r=this._ratioForPitchInterval(B-s),c=Q.audioContext,o=c.createGain();o.gain.setValueAtTime(A.target.volume/100,Q.currentTime);const w=c.createGain();o.connect(w),w.connect(Q.getInputNode());let C=this.INSTRUMENT_INFO[e].releaseTime;void 0===C&&(C=.01);const a=c.currentTime+t,I=a+C;w.gain.setValueAtTime(1,a),w.gain.linearRampToValueAtTime(1e-4,I),this._concurrencyCounter++,n.once("stop",()=>{this._concurrencyCounter--}),n.play(),n.connect({getInputNode:()=>o}),n.outputNode.playbackRate.value=r,n.outputNode.stop(I)}_selectSampleIndexForNote(A,B){for(let t=B.length-1;t>=0;t--)if(A>=B[t])return t;return 0}_ratioForPitchInterval(A){return Math.pow(2,A/12)}_clampBeats(A){return s.clamp(A,E.BEAT_RANGE.min,E.BEAT_RANGE.max)}_beatsToSec(A){return 60/this.getTempo()*A}_stackTimerNeedsInit(A){return!A.stackFrame.timer}_startStackTimer(A,B){A.stackFrame.timer=new r,A.stackFrame.timer.start(),A.stackFrame.duration=B,A.yield()}_checkStackTimer(A){A.stackFrame.timer.timeElapsed()<1e3*A.stackFrame.duration&&A.yield()}setInstrument(A,B){this._setInstrument(A.INSTRUMENT,B,!1)}midiSetInstrument(A,B){this._setInstrument(A.INSTRUMENT,B,!0)}_setInstrument(A,B,t){const e=this._getMusicState(B.target);A=Q.toNumber(A),A=Math.round(A),A-=1,t&&(A=(this.MIDI_INSTRUMENTS[A]||0)-1),A=s.wrapClamp(A,0,this.INSTRUMENT_INFO.length-1),e.currentInstrument=A}setTempo(A){const B=Q.toNumber(A.TEMPO);this._updateTempo(B)}changeTempo(A){const B=Q.toNumber(A.TEMPO)+this.getTempo();this._updateTempo(B)}_updateTempo(A){A=s.clamp(A,E.TEMPO_RANGE.min,E.TEMPO_RANGE.max);const B=this.runtime.getTargetForStage();B&&(B.tempo=A)}getTempo(){const A=this.runtime.getTargetForStage();return A?A.tempo:60}}A.exports=E},function(A,B,t){A.exports={"drums/1-snare.mp3":t(233),"drums/2-bass-drum.mp3":t(234),"drums/3-side-stick.mp3":t(235),"drums/4-crash-cymbal.mp3":t(236),"drums/5-open-hi-hat.mp3":t(237),"drums/6-closed-hi-hat.mp3":t(238),"drums/7-tambourine.mp3":t(239),"drums/8-hand-clap.mp3":t(240),"drums/9-claves.mp3":t(241),"drums/10-wood-block.mp3":t(242),"drums/11-cowbell.mp3":t(243),"drums/12-triangle.mp3":t(244),"drums/13-bongo.mp3":t(245),"drums/14-conga.mp3":t(246),"drums/15-cabasa.mp3":t(247),"drums/16-guiro.mp3":t(248),"drums/17-vibraslap.mp3":t(249),"drums/18-cuica.mp3":t(250),"instruments/1-piano/24.mp3":t(251),"instruments/1-piano/36.mp3":t(252),"instruments/1-piano/48.mp3":t(253),"instruments/1-piano/60.mp3":t(254),"instruments/1-piano/72.mp3":t(255),"instruments/1-piano/84.mp3":t(256),"instruments/1-piano/96.mp3":t(257),"instruments/1-piano/108.mp3":t(258),"instruments/2-electric-piano/60.mp3":t(259),"instruments/3-organ/60.mp3":t(260),"instruments/4-guitar/60.mp3":t(261),"instruments/5-electric-guitar/60.mp3":t(262),"instruments/6-bass/36.mp3":t(263),"instruments/6-bass/48.mp3":t(264),"instruments/7-pizzicato/60.mp3":t(265),"instruments/8-cello/36.mp3":t(266),"instruments/8-cello/48.mp3":t(267),"instruments/8-cello/60.mp3":t(268),"instruments/9-trombone/36.mp3":t(269),"instruments/9-trombone/48.mp3":t(270),"instruments/9-trombone/60.mp3":t(271),"instruments/10-clarinet/48.mp3":t(272),"instruments/10-clarinet/60.mp3":t(273),"instruments/11-saxophone/36.mp3":t(274),"instruments/11-saxophone/60.mp3":t(275),"instruments/11-saxophone/84.mp3":t(276),"instruments/12-flute/60.mp3":t(277),"instruments/12-flute/72.mp3":t(278),"instruments/13-wooden-flute/60.mp3":t(279),"instruments/13-wooden-flute/72.mp3":t(280),"instruments/14-bassoon/36.mp3":t(281),"instruments/14-bassoon/48.mp3":t(282),"instruments/14-bassoon/60.mp3":t(283),"instruments/15-choir/48.mp3":t(284),"instruments/15-choir/60.mp3":t(285),"instruments/15-choir/72.mp3":t(286),"instruments/16-vibraphone/60.mp3":t(287),"instruments/16-vibraphone/72.mp3":t(288),"instruments/17-music-box/60.mp3":t(289),"instruments/18-steel-drum/60.mp3":t(290),"instruments/19-marimba/60.mp3":t(291),"instruments/20-synth-lead/60.mp3":t(292),"instruments/21-synth-pad/60.mp3":t(293)}},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B){A.exports=null},function(A,B,t){const e=t(6),g=t(3),i=t(0),Q=t(1),n=t(5),s=t(42),r=t(32),c=129,E=130,o=61445,w="5261da01-fa7e-42ab-850b-7c80220097cc",C="5261da02-fa7e-42ab-850b-7c80220097cc";class a{constructor(A,B){this._runtime=A,this._ble=null,this._runtime.registerPeripheralExtension(B,this),this._extensionId=B,this._sensors={tiltX:0,tiltY:0,buttonA:0,buttonB:0,touchPins:[0,0,0],gestureState:0,ledMatrixState:new Uint8Array(5)},this._gestures={moving:!1,move:{active:!1,timeout:!1},shake:{active:!1,timeout:!1},jump:{active:!1,timeout:!1}},this._timeoutID=null,this._busy=!1,this._busyTimeoutID=null,this.reset=this.reset.bind(this),this._onConnect=this._onConnect.bind(this),this._onMessage=this._onMessage.bind(this)}displayText(A){const B=new Uint8Array(A.length);for(let t=0;t{this._busy=!1},5e3);const t=new Uint8Array(B.length+1);t[0]=A;for(let A=0;A{this._busy=!1,window.clearTimeout(this._busyTimeoutID)})}_onConnect(){this._ble.read(o,w,!0,this._onMessage),this._timeoutID=window.setTimeout(()=>this._ble.handleDisconnectError("micro:bit extension stopped receiving data"),4500)}_onMessage(A){const B=r.base64ToUint8Array(A);this._sensors.tiltX=B[1]|B[0]<<8,this._sensors.tiltX>32768&&(this._sensors.tiltX-=65536),this._sensors.tiltY=B[3]|B[2]<<8,this._sensors.tiltY>32768&&(this._sensors.tiltY-=65536),this._sensors.buttonA=B[4],this._sensors.buttonB=B[5],this._sensors.touchPins[0]=B[6],this._sensors.touchPins[1]=B[7],this._sensors.touchPins[2]=B[8],this._sensors.gestureState=B[9],window.clearTimeout(this._timeoutID),this._timeoutID=window.setTimeout(()=>this._ble.handleDisconnectError("micro:bit extension stopped receiving data"),4500)}_checkPinState(A){return this._sensors.touchPins[A]}}const I="front",h="back",Y="left",M="right",F="any",D="moved",u="shaken",l="jumped",d="A",U="B",N="any",m="on",G="off";class f{static get EXTENSION_NAME(){return"micro:bit"}static get EXTENSION_ID(){return"microbit"}static get TILT_THRESHOLD(){return 15}get BUTTONS_MENU(){return[{text:"A",value:d},{text:"B",value:U},{text:n({id:"microbit.buttonsMenu.any",default:"any",description:'label for "any" element in button picker for micro:bit extension'}),value:N}]}get GESTURES_MENU(){return[{text:n({id:"microbit.gesturesMenu.moved",default:"moved",description:"label for moved gesture in gesture picker for micro:bit extension"}),value:D},{text:n({id:"microbit.gesturesMenu.shaken",default:"shaken",description:"label for shaken gesture in gesture picker for micro:bit extension"}),value:u},{text:n({id:"microbit.gesturesMenu.jumped",default:"jumped",description:"label for jumped gesture in gesture picker for micro:bit extension"}),value:l}]}get PIN_STATE_MENU(){return[{text:n({id:"microbit.pinStateMenu.on",default:"on",description:"label for on element in pin state picker for micro:bit extension"}),value:m},{text:n({id:"microbit.pinStateMenu.off",default:"off",description:"label for off element in pin state picker for micro:bit extension"}),value:G}]}get TILT_DIRECTION_MENU(){return[{text:n({id:"microbit.tiltDirectionMenu.front",default:"front",description:"label for front element in tilt direction picker for micro:bit extension"}),value:I},{text:n({id:"microbit.tiltDirectionMenu.back",default:"back",description:"label for back element in tilt direction picker for micro:bit extension"}),value:h},{text:n({id:"microbit.tiltDirectionMenu.left",default:"left",description:"label for left element in tilt direction picker for micro:bit extension"}),value:Y},{text:n({id:"microbit.tiltDirectionMenu.right",default:"right",description:"label for right element in tilt direction picker for micro:bit extension"}),value:M}]}get TILT_DIRECTION_ANY_MENU(){return[...this.TILT_DIRECTION_MENU,{text:n({id:"microbit.tiltDirectionMenu.any",default:"any",description:"label for any direction element in tilt direction picker for micro:bit extension"}),value:F}]}constructor(A){this.runtime=A,this._peripheral=new a(this.runtime,f.EXTENSION_ID)}getInfo(){return{id:f.EXTENSION_ID,name:f.EXTENSION_NAME,blockIconURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAKcElEQVR42u2cfXAU9RnHv7u3L3d7l9yR5PIGXO7MkQKaYiCUWqJhFGvRMk4JZXSc8aXVaSmiYlthVHQEW99FxiIdrVY6teiMdoa+ICqhIqgQAsjwMgYDOQKXl7uY17u9293b3f5x5JKYe8+FJGSfvzbP/n77e/azz+95nt9v90KoqgpN0hdSQ6AB1ABqADWAmmgANYAaQA2gJhpADeBEE2q8GPLaWzu/CslyiY4k9dOn5uijtXGd7+jWkaReVpT3Hrhv6d0awEFC07rgD+ZeYYnXprhwigUAvjj0zbjxQCLebozT7iDzK1ZUWCru2K7L//6MVC8ue45Blz8n6rlQ815QtuohOlXiEdy/AUqPa6y59Mkh6Q1345GNja6m7pHEQKNl3t0704EXat4L6fSOmOeEI1vHKzwAyNJR9MPFpRUPOu0ONm2A0xatWaTLm5WfDrzvAppA8AbiG03fC8CQNkDKZK2YrPAuRrhpifJERsuYywveJc7CqcIDMAyeLm82dEXzw39I/qjXkpr3QuW9lxfAdOABGAKPslWDnbsy7Jl8BxTeM3SqmO0gaA5U6c3jymup0YSn9JyLee67wpTfBQAQjmyF3HFqiJcRtDECjy5dAmbmcgQPvjjxl3Lx4IVjnD/5cE1zkWtyP34VBGcdKLJnLgc9cznk1kMXFdzEn8KJ4KUqqsSHvcxWDf7j1UM8UPr6/YgHhhX8xAaYaXgAIB7fBnbuSrBzV8aNgarEQ/z6/YkLcDTg9V9XlXjQtuqoU1TpcUHlvZDOfDiuyh5qPMCLrJ1bDw3EuUtx81N/BH3pjQBJQ2HMF5V6iKfeRchVm9kkMtrwxmSdobeA9daBde8GwVlBcFYofS1Jw0vaAy9HeJHQwBUPzIBvGxDc92Rmp/BowJs10wkAONfsBs8HAAAltqngOAO8HZ3o6OiMqcvLy4E1Lwc8H8C5ZndMXdLJa/qNacNLCDBw/O8nFUNWxp/64+tWAwBefe1tHKg7CgC4/9d3ori4EHv3HcDrb26PqVt2602ovvaHaGlpw+8ffSamLqXYmya8jG8mpFy6iGLkWLh4HAwG4+r6j4VBfaPpLgU8IMGO9MLqW2pYQ9aQokuR5dgXIwCC1CUcNMj3hpdvLAdSF54EYpCHooRA0Swomo2pC0kCQpIAkqTA6LmYupgxL0X7m78+aG10NXVkpIwxsAwWXncDCESHLkohfPbpbiT6ZFPPZQ9fC0e58Wi6wTDj6UbT/rQAyiERS2pW4Kc3LQDLRO8miCEAKj7d83FcTxyLJJJJ+9MCqKoq9HomMrgkSThxsgEcZ8AMpwMkSYJlKDA0DVUFiHGWRDJp/4jXwqIo4uFHnkZXdw8AYGbZFXhs3WqQJDkhkkim7E8KoMlkxKbnn8DBunrwUli3e8/+yOAA0HjmHDq7upGXm5PUoDUr7hmWRB5Zt3FYwoime+vtd/H6G9uGJIxouniSyP6H7v8FystnY80jGzIA0MihsMAKu20aTp3JzFb6WCWRuDUvHwByw8cOhw2FBVaYjNzIAba1e3Hfb9aiq7MTNStuBwAsvr4KO3d9GnmKztIS5EyxTJiVSDT7p04tipx/9MnnYc7ORlu7NzMxsK3di5AkDHgGw2DTC+uHBeGJshJJZL/fxyMQEDKbRAiCQDAoQhBDYBkKNE2j4uqrhpUBoiSBIMZfEhkN+1NeiWSqEB2rlUg69md0JRIQRHy86z8jXsqNVRLJlP0jqgNJXXgAgjbCcONmCHUvQ+44NWG2s/rtH5Mt/ciToo0wLH4JBGO6LLazRiJk2vBYy4gHHw/bWSN+LZBKEhkMjzn/CaSiKgQOvJDyFB7L7axUJWNJZDA8IhQA1boPin7KZbMSGfUYyFx9b3hXg/cCsoBA2Z0AoYOaxlcC4+mdyCUDKBzanLFBJ3USyaRMuiSSKZmUSSSTMimTCABUlblRU9kAZ0E39p+eii21c+EL0jHbOwu6sfaWgyjND//U4oP6MmzZnfi79XT7mfQSNi7bh0JzOLG19XBY/89r49pYVebGqhuOosDsh1+gsWV3BXYdd2Q+BlaVuXFv9bHgkSbzk+vfcVRyjHhi47J9cftsXLYf7T36Ix8cLHlo6ydlv6qpPI2qssRZcuOy/Wjp4k5s+2zG+offKqtcUt6kJtNv7S0H0RtkvEufXTB/6bML5je2Wy7UVDbEbF9o9mPDsv2oP5v75vbPS26rP5u3fdXiozDppcwDrKlswOlWy9E//DX09Mt/azh8zzNM1RybF86C7pheVGD240CDeX3NWtfml94Rt+0+Mf3Lm8qbEnpfgdmPs+3G9+564vTT//pM/GrHYduWRP0AYOEMN/5S61xT92Vtfd2XtfWb/vu91fHALyxzw9tnkB/cTD5w+2Ou9375HHtfa7exM5mxRpKFaafdQQKgAcDERs98/foLHrXdaXfoABi8vczhWO2/28/TRR5z2h00gKymNl1ton79oigq6bQ7dE67Q+ew9mb1h4FYYwVESgLAXLSRa+3mWpIdK+UYuPiq89f8+XfT/+ftZQ4vLm9ZmUyfdcsv1M2fWfRaUCK8i8vdK1u6ktuAWPWTsztm24o/cnnYHUsrWzd1+fVJ9XtqxbG3XzFdNcPTawjcueibpxK1t+X26f/9R8a953jub4typOvm2b1XnvUmv8JKWMZcaZffX3XDERRP8cGaFRjWxtPLoZvXY4oxgPBNEsgxBhCUKEzL6Ru+JydS8Ak0giKFgESDJFQoKmCgQzAwIfQEWETzmoBIwd2VNaStu8uEHGO4Buz06zHHFv0dRkefAZ1+PQx0KNK2eIoPLCUj2zDc275qzgcBFWv+cf3IyxgTK2KOzQufEM5kfpGF12eGPSf8DXN+No/87HDWiwYYALw+M6ym8AscAxO++X7xCTRM7EDQzht0Da8v/NWo1dQDAxNCocUXs+303IGHdaptOmYXnh/SLlZbV+fwnwJm6UXEm/ojqgM/PFmJQ81OPHfrtqT7bN23BE8seTflYLvz5DwYGQHLKz5Puo/XZ8aLtT+D1dSDuxbsGQIymmz48DbwIguOESJOcce8XaO3oVpZ8k3Em5KVVAAMFnuOB9as1MbimCBunn04vBmR40ls29Wfgxf1KMn1gBdY+MXUCvK4ANvPndpLzrLzALjBN2VPwrDBksgLYkn1jBMp90nVY2++8vAw3RlPeLNYVZSPAEgjKWP6ZCn4lF+gMdnE08spQb73RQB9aXtgo6tJcNodf8rWz3L//Br340UW3sExEkXrFFKSSUVHqkRfkJZ8QSZk5gS6hw9H+GyDQAclSs41BVmSUIn+toAKIUTJskKoQUknCxKlkISKb/sM0NMyyVAhXW+AlYosfgOgQlUJVadTSUWBKoQoudvPioPbenq5oIUTaRUqenhWKi3oyVIUqKpKREoLggDhF6hQb4CV9LRM9rctMPN6glChp2SdTqeSskwoAECSKnG61fzFR/XsGu+FhmONriYl7TImsjoYKJyZSeB8CoBQo6spqU8TCO1fgE7gDVUNoCYaQA2gBlADqAHURAOoAdQAagA10QCOgfwfNp/hXbfBMCAAAAAASUVORK5CYII=",showStatusButton:!0,blocks:[{opcode:"whenButtonPressed",text:n({id:"microbit.whenButtonPressed",default:"when [BTN] button pressed",description:"when the selected button on the micro:bit is pressed"}),blockType:g.HAT,arguments:{BTN:{type:e.STRING,menu:"buttons",defaultValue:d}}},{opcode:"isButtonPressed",text:n({id:"microbit.isButtonPressed",default:"[BTN] button pressed?",description:"is the selected button on the micro:bit pressed?"}),blockType:g.BOOLEAN,arguments:{BTN:{type:e.STRING,menu:"buttons",defaultValue:d}}},"---",{opcode:"whenGesture",text:n({id:"microbit.whenGesture",default:"when [GESTURE]",description:"when the selected gesture is detected by the micro:bit"}),blockType:g.HAT,arguments:{GESTURE:{type:e.STRING,menu:"gestures",defaultValue:D}}},"---",{opcode:"displaySymbol",text:n({id:"microbit.displaySymbol",default:"display [MATRIX]",description:"display a pattern on the micro:bit display"}),blockType:g.COMMAND,arguments:{MATRIX:{type:e.MATRIX,defaultValue:"0101010101100010101000100"}}},{opcode:"displayText",text:n({id:"microbit.displayText",default:"display text [TEXT]",description:"display text on the micro:bit display"}),blockType:g.COMMAND,arguments:{TEXT:{type:e.STRING,defaultValue:n({id:"microbit.defaultTextToDisplay",default:"Hello!",description:'default text to display.\n IMPORTANT - the micro:bit only supports letters a-z, A-Z.\n Please substitute a default word in your language\n that can be written with those characters,\n substitute non-accented characters or leave it as "Hello!".\n Check the micro:bit site documentation for details'})}}},{opcode:"displayClear",text:n({id:"microbit.clearDisplay",default:"clear display",description:"display nothing on the micro:bit display"}),blockType:g.COMMAND},"---",{opcode:"whenTilted",text:n({id:"microbit.whenTilted",default:"when tilted [DIRECTION]",description:"when the micro:bit is tilted in a direction"}),blockType:g.HAT,arguments:{DIRECTION:{type:e.STRING,menu:"tiltDirectionAny",defaultValue:F}}},{opcode:"isTilted",text:n({id:"microbit.isTilted",default:"tilted [DIRECTION]?",description:"is the micro:bit is tilted in a direction?"}),blockType:g.BOOLEAN,arguments:{DIRECTION:{type:e.STRING,menu:"tiltDirectionAny",defaultValue:F}}},{opcode:"getTiltAngle",text:n({id:"microbit.tiltAngle",default:"tilt angle [DIRECTION]",description:"how much the micro:bit is tilted in a direction"}),blockType:g.REPORTER,arguments:{DIRECTION:{type:e.STRING,menu:"tiltDirection",defaultValue:I}}},"---",{opcode:"whenPinConnected",text:n({id:"microbit.whenPinConnected",default:"when pin [PIN] connected",description:"when the pin detects a connection to Earth/Ground"}),blockType:g.HAT,arguments:{PIN:{type:e.STRING,menu:"touchPins",defaultValue:"0"}}}],menus:{buttons:{acceptReporters:!0,items:this.BUTTONS_MENU},gestures:{acceptReporters:!0,items:this.GESTURES_MENU},pinState:{acceptReporters:!0,items:this.PIN_STATE_MENU},tiltDirection:{acceptReporters:!0,items:this.TILT_DIRECTION_MENU},tiltDirectionAny:{acceptReporters:!0,items:this.TILT_DIRECTION_ANY_MENU},touchPins:{acceptReporters:!0,items:["0","1","2"]}}}}whenButtonPressed(A){return"any"===A.BTN?this._peripheral.buttonA|this._peripheral.buttonB:"A"===A.BTN?this._peripheral.buttonA:"B"===A.BTN&&this._peripheral.buttonB}isButtonPressed(A){return"any"===A.BTN?0!=(this._peripheral.buttonA|this._peripheral.buttonB):"A"===A.BTN?0!==this._peripheral.buttonA:"B"===A.BTN&&0!==this._peripheral.buttonB}whenGesture(A){const B=Q.toString(A.GESTURE);return"moved"===B?this._peripheral.gestureState>>2&1:"shaken"===B?1&this._peripheral.gestureState:"jumped"===B&&this._peripheral.gestureState>>1&1}displaySymbol(A){const B=Q.toString(A.MATRIX).replace(/\s/g,"").split("").reduce((A,B,t)=>"0"===B?A:A+Math.pow(2,t),0);return null!==B&&(this._peripheral.ledMatrixState[0]=31&B,this._peripheral.ledMatrixState[1]=B>>5&31,this._peripheral.ledMatrixState[2]=B>>10&31,this._peripheral.ledMatrixState[3]=B>>15&31,this._peripheral.ledMatrixState[4]=B>>20&31,this._peripheral.displayMatrix(this._peripheral.ledMatrixState)),new Promise(A=>{setTimeout(()=>{A()},100)})}displayText(A){const B=String(A.TEXT).substring(0,19);B.length>0&&this._peripheral.displayText(B);const t=120*(6*B.length+6);return new Promise(A=>{setTimeout(()=>{A()},t)})}displayClear(){for(let A=0;A<5;A++)this._peripheral.ledMatrixState[A]=0;return this._peripheral.displayMatrix(this._peripheral.ledMatrixState),new Promise(A=>{setTimeout(()=>{A()},100)})}whenTilted(A){return this._isTilted(A.DIRECTION)}isTilted(A){return this._isTilted(A.DIRECTION)}getTiltAngle(A){return this._getTiltAngle(A.DIRECTION)}_isTilted(A){switch(A){case F:return Math.abs(this._peripheral.tiltX/10)>=f.TILT_THRESHOLD||Math.abs(this._peripheral.tiltY/10)>=f.TILT_THRESHOLD;default:return this._getTiltAngle(A)>=f.TILT_THRESHOLD}}_getTiltAngle(A){switch(A){case I:return Math.round(this._peripheral.tiltY/-10);case h:return Math.round(this._peripheral.tiltY/10);case Y:return Math.round(this._peripheral.tiltX/-10);case M:return Math.round(this._peripheral.tiltX/10);default:i.warn("Unknown tilt direction in _getTiltAngle: ".concat(A))}}whenPinConnected(A){const B=parseInt(A.PIN,10);if(!isNaN(B))return!(B<0||B>2)&&this._peripheral._checkPinState(B)}}A.exports=f},function(A,B,t){const e=t(5),g=t(116),i=t(6),Q=t(3),n=t(1),s=t(4),r=t(18),c=t(0),E=t(117);class o{constructor(A){this.runtime=A,this._soundPlayers=new Map,this._stopAllSpeech=this._stopAllSpeech.bind(this),this.runtime&&this.runtime.on("PROJECT_STOP_ALL",this._stopAllSpeech),this._onTargetCreated=this._onTargetCreated.bind(this),this.runtime&&A.on("targetWasCreated",this._onTargetCreated),this._supportedLocales=this._getSupportedLocales()}get VOICE_INFO(){return{ALTO:{name:e({id:"text2speech.alto",default:"alto",description:"Name for a voice with ambiguous gender."}),gender:"female",playbackRate:1},TENOR:{name:e({id:"text2speech.tenor",default:"tenor",description:"Name for a voice with ambiguous gender."}),gender:"male",playbackRate:1},SQUEAK:{name:e({id:"text2speech.squeak",default:"squeak",description:"Name for a funny voice with a high pitch."}),gender:"female",playbackRate:1.19},GIANT:{name:e({id:"text2speech.giant",default:"giant",description:"Name for a funny voice with a low pitch."}),gender:"male",playbackRate:.84},KITTEN:{name:e({id:"text2speech.kitten",default:"kitten",description:"A baby cat."}),gender:"female",playbackRate:1.41}}}get LANGUAGE_INFO(){return{ar:{name:"Arabic",locales:["ar"],speechSynthLocale:"arb",singleGender:!0},"zh-cn":{name:"Chinese (Mandarin)",locales:["zh-cn","zh-tw"],speechSynthLocale:"cmn-CN",singleGender:!0},da:{name:"Danish",locales:["da"],speechSynthLocale:"da-DK"},nl:{name:"Dutch",locales:["nl"],speechSynthLocale:"nl-NL"},en:{name:"English",locales:["en"],speechSynthLocale:"en-US"},fr:{name:"French",locales:["fr"],speechSynthLocale:"fr-FR"},de:{name:"German",locales:["de"],speechSynthLocale:"de-DE"},hi:{name:"Hindi",locales:["hi"],speechSynthLocale:"hi-IN",singleGender:!0},is:{name:"Icelandic",locales:["is"],speechSynthLocale:"is-IS"},it:{name:"Italian",locales:["it"],speechSynthLocale:"it-IT"},ja:{name:"Japanese",locales:["ja","ja-hira"],speechSynthLocale:"ja-JP"},ko:{name:"Korean",locales:["ko"],speechSynthLocale:"ko-KR",singleGender:!0},nb:{name:"Norwegian",locales:["nb","nn"],speechSynthLocale:"nb-NO",singleGender:!0},pl:{name:"Polish",locales:["pl"],speechSynthLocale:"pl-PL"},"pt-br":{name:"Portuguese (Brazilian)",locales:["pt-br"],speechSynthLocale:"pt-BR"},pt:{name:"Portuguese (European)",locales:["pt"],speechSynthLocale:"pt-PT"},ro:{name:"Romanian",locales:["ro"],speechSynthLocale:"ro-RO",singleGender:!0},ru:{name:"Russian",locales:["ru"],speechSynthLocale:"ru-RU"},es:{name:"Spanish (European)",locales:["es"],speechSynthLocale:"es-ES"},"es-419":{name:"Spanish (Latin American)",locales:["es-419"],speechSynthLocale:"es-US"},sv:{name:"Swedish",locales:["sv"],speechSynthLocale:"sv-SE",singleGender:!0},tr:{name:"Turkish",locales:["tr"],speechSynthLocale:"tr-TR",singleGender:!0},cy:{name:"Welsh",locales:["cy"],speechSynthLocale:"cy-GB",singleGender:!0}}}static get STATE_KEY(){return"Scratch.text2speech"}static get DEFAULT_TEXT2SPEECH_STATE(){return{voiceId:"ALTO"}}get DEFAULT_LANGUAGE(){return"en"}_getState(A){let B=A.getCustomState(o.STATE_KEY);return B||(B=r.simple(o.DEFAULT_TEXT2SPEECH_STATE),A.setCustomState(o.STATE_KEY,B)),B}_onTargetCreated(A,B){if(B){const t=B.getCustomState(o.STATE_KEY);t&&A.setCustomState(o.STATE_KEY,r.simple(t))}}getInfo(){let A="hello";return this.isSupportedLanguage(this.getEditorLanguage())&&(A=e({id:"text2speech.defaultTextToSpeak",default:"hello",description:"hello: the default text to speak"})),{id:"text2speech",name:e({id:"text2speech.categoryName",default:"Text to Speech",description:"Name of the Text to Speech extension."}),blockIconURI:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUyLjIgKDY3MTQ1KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5FeHRlbnNpb25zL1NvZnR3YXJlL1RleHQtdG8tU3BlZWNoLUJsb2NrPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGcgaWQ9IkV4dGVuc2lvbnMvU29mdHdhcmUvVGV4dC10by1TcGVlY2gtQmxvY2siIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1vcGFjaXR5PSIwLjE1Ij4KICAgICAgICA8ZyBpZD0idGV4dDJzcGVlY2giIHRyYW5zZm9ybT0idHJhbnNsYXRlKDQuMDAwMDAwLCA0LjAwMDAwMCkiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjMDAwMDAwIj4KICAgICAgICAgICAgPHBhdGggZD0iTTExLjUsMTcuNjY5MzQzNSBDMTEuNSwxNi42NTM5MjY5IDEwLjAwNjAxNDUsMTYuMDg0NDI3NCA5LjExMjU2MDI0LDE2Ljg4ODMgTDYuNDEyNTYwMjQsMTkuMDUwNzE0IEM1LjM5MzQ2NzU1LDE5Ljg2Njg5OTQgNC4wNzQ5NzM1MSwyMC4zMzE3NTc1IDIuNywyMC4zMzE3NTc1IEwyLjMsMjAuMzMxNzU3NSBDMS4yNjUxOTIzMywyMC4zMzE3NTc1IDAuNSwyMS4wMjEyMDAzIDAuNSwyMS45MDQwNzEgTDAuNSwyNi4xMzg3OTg2IEMwLjUsMjcuMDIxNjY5MyAxLjI2NTE5MjMzLDI3LjcxMTExMiAyLjMsMjcuNzExMTEyIEwyLjcsMjcuNzExMTEyIEM0LjE1NzU1NjgyLDI3LjcxMTExMiA1LjQ1MzcyMzIyLDI4LjEzMzUyNzEgNi41MTk3MjA5OCwyOC45OTggTDkuMTE4NDAyOTMsMzEuMTU5MzIxNiBDMTAuMDI2MTg1NSwzMS45MDkwNzkzIDExLjUsMzEuMzQ3MjY4OSAxMS41LDMwLjI4MzQyNTUgTDExLjUsMTcuNjY5MzQzNSBaIiBpZD0ic3BlYWtlciIgZmlsbD0iIzRENEQ0RCI+PC9wYXRoPgogICAgICAgICAgICA8cGF0aCBkPSJNMjEuNjQzNjA2NiwxNi41IEMxOS45NzcwMDk5LDE4LjQzNzAyMzQgMTcuMTA1MDI3NSwxOS45Mjg1NzE0IDE1LjY2NjY2NjcsMTkuOTI4NTcxNCBDMTUuNTEyNjM5NywxOS45Mjg1NzE0IDE1LjMxNjYyOTIsMTkuODk1OTAzIDE1LjEwOTcyNjUsMTkuNzkyNDUxNyBDMTQuNzM3NjAzOSwxOS42MDYzOTA0IDE0LjUsMTkuMjQ5OTg0NiAxNC41LDE4Ljc2MTkwNDggQzE0LjUsMTguNjU2ODA0MSAxNC41MTcwNTU1LDE4LjU1NDUwNzYgMTQuNTQ5NDQ2NywxOC40NTQwODQ0IEMxNC42MjU3NTQ1LDE4LjIxNzUwNjMgMTUuMTczNTcyMSwxNy40Njc1MzEgMTUuMjc3MjA3MSwxNy4yODA5ODgxIEMxNS41NDYzNTI2LDE2Ljc5NjUyNjEgMTUuNzM5MDI1LDE2LjIwNjM1NjEgMTUuODQzMjg5MSwxNS40MTYwMDM0IEMxMy4xODk3MDA1LDEzLjkyNjgzNjkgMTEuNSwxMS4xMTM5NjY4IDExLjUsOCBDMTEuNSwzLjMwNTU3OTYzIDE1LjMwNTU3OTYsLTAuNSAyMCwtMC41IEwyNCwtMC41IEMyOC42OTQ0MjA0LC0wLjUgMzIuNSwzLjMwNTU3OTYzIDMyLjUsOCBDMzIuNSwxMi42OTQ0MjA0IDI4LjY5NDQyMDQsMTYuNSAyNCwxNi41IEwyMS42NDM2MDY2LDE2LjUgWiIgaWQ9InNwZWVjaCIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+",menuIconURI:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUyLjIgKDY3MTQ1KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5FeHRlbnNpb25zL1NvZnR3YXJlL1RleHQtdG8tU3BlZWNoLU1lbnU8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZyBpZD0iRXh0ZW5zaW9ucy9Tb2Z0d2FyZS9UZXh0LXRvLVNwZWVjaC1NZW51IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0idGV4dDJzcGVlY2giIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIuMDAwMDAwLCAyLjAwMDAwMCkiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik01Ljc1LDguODM0NjcxNzMgQzUuNzUsOC4zMjY5NjM0NCA1LjAwMzAwNzI3LDguMDQyMjEzNzEgNC41NTYyODAxMiw4LjQ0NDE0OTk5IEwzLjIwNjI4MDEyLDkuNTI1MzU3MDIgQzIuNjk2NzMzNzgsOS45MzM0NDk2OCAyLjAzNzQ4Njc1LDEwLjE2NTg3ODggMS4zNSwxMC4xNjU4Nzg4IEwxLjE1LDEwLjE2NTg3ODggQzAuNjMyNTk2MTY1LDEwLjE2NTg3ODggMC4yNSwxMC41MTA2MDAyIDAuMjUsMTAuOTUyMDM1NSBMMC4yNSwxMy4wNjkzOTkzIEMwLjI1LDEzLjUxMDgzNDYgMC42MzI1OTYxNjUsMTMuODU1NTU2IDEuMTUsMTMuODU1NTU2IEwxLjM1LDEzLjg1NTU1NiBDMi4wNzg3Nzg0MSwxMy44NTU1NTYgMi43MjY4NjE2MSwxNC4wNjY3NjM2IDMuMjU5ODYwNDksMTQuNDk5IEw0LjU1OTIwMTQ3LDE1LjU3OTY2MDggQzUuMDEzMDkyNzYsMTUuOTU0NTM5NiA1Ljc1LDE1LjY3MzYzNDQgNS43NSwxNS4xNDE3MTI4IEw1Ljc1LDguODM0NjcxNzMgWiIgaWQ9InNwZWFrZXIiIHN0cm9rZS1vcGFjaXR5PSIwLjE1IiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMC41IiBmaWxsPSIjNEQ0RDREIj48L3BhdGg+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMC43MDQ4MzEzLDggQzkuNzkwNjc0NjgsOS4xMzExNDg0NyA4LjMwNjYxODQsOS43MTQyODU3MSA3LjgzMzMzMzMzLDkuNzE0Mjg1NzEgQzcuODMzMzMzMzMsOS43MTQyODU3MSA3LjUsOS43MTQyODU3MSA3LjUsOS4zODA5NTIzOCBDNy41LDkuMDg1MjI2ODQgOC4wNjIyMDE2OCw4LjkwMTk0MTY0IDguMTg5MDYwNjcsNy41Njc1NDA1OCBDNi44ODk5Njk5MSw2LjkwNjc5MDA1IDYsNS41NTczMjY4MyA2LDQgQzYsMS43OTA4NjEgNy43OTA4NjEsNC4wNTgxMjI1MWUtMTYgMTAsMCBMMTIsMCBDMTQuMjA5MTM5LC00LjA1ODEyMjUxZS0xNiAxNiwxLjc5MDg2MSAxNiw0IEMxNiw2LjIwOTEzOSAxNC4yMDkxMzksOCAxMiw4IEwxMC43MDQ4MzEzLDggWiIgaWQ9InNwZWVjaCIgZmlsbD0iIzBFQkQ4QyI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+",blocks:[{opcode:"speakAndWait",text:e({id:"text2speech.speakAndWaitBlock",default:"speak [WORDS]",description:"Speak some words."}),blockType:Q.COMMAND,arguments:{WORDS:{type:i.STRING,defaultValue:A}}},{opcode:"setVoice",text:e({id:"text2speech.setVoiceBlock",default:"set voice to [VOICE]",description:"Set the voice for speech synthesis."}),blockType:Q.COMMAND,arguments:{VOICE:{type:i.STRING,menu:"voices",defaultValue:"ALTO"}}},{opcode:"setLanguage",text:e({id:"text2speech.setLanguageBlock",default:"set language to [LANGUAGE]",description:"Set the language for speech synthesis."}),blockType:Q.COMMAND,arguments:{LANGUAGE:{type:i.STRING,menu:"languages",defaultValue:this.getCurrentLanguage()}}}],menus:{voices:{acceptReporters:!0,items:this.getVoiceMenu()},languages:{acceptReporters:!0,items:this.getLanguageMenu()}}}}getEditorLanguage(){return(e.setup().locale||navigator.language||navigator.userLanguage||this.DEFAULT_LANGUAGE).toLowerCase()}getCurrentLanguage(){const A=this.runtime.getTargetForStage();return A?(A.textToSpeechLanguage||this.setCurrentLanguage(this.getEditorLanguage()),A.textToSpeechLanguage):this.DEFAULT_LANGUAGE}setCurrentLanguage(A){const B=this.runtime.getTargetForStage();if(!B)return;this.isSupportedLanguage(A)&&(B.textToSpeechLanguage=this._getExtensionLocaleForSupportedLocale(A));const t=g.nameMap[A.toLowerCase()];t&&this.isSupportedLanguage(t)&&(B.textToSpeechLanguage=this._getExtensionLocaleForSupportedLocale(t)),B.textToSpeechLanguage||(B.textToSpeechLanguage=this.DEFAULT_LANGUAGE)}_getExtensionLocaleForSupportedLocale(A){for(const B in this.LANGUAGE_INFO)if(this.LANGUAGE_INFO[B].locales.includes(A))return B;c.error("cannot find extension locale for locale ".concat(A))}_getSpeechSynthLocale(){let A=this.LANGUAGE_INFO[this.DEFAULT_LANGUAGE].speechSynthLocale;return this.LANGUAGE_INFO[this.getCurrentLanguage()]&&(A=this.LANGUAGE_INFO[this.getCurrentLanguage()].speechSynthLocale),A}_getSupportedLocales(){return Object.keys(this.LANGUAGE_INFO).reduce((A,B)=>A.concat(this.LANGUAGE_INFO[B].locales),[])}isSupportedLanguage(A){return this._supportedLocales.includes(A)}getVoiceMenu(){return Object.keys(this.VOICE_INFO).map(A=>({text:this.VOICE_INFO[A].name,value:A}))}getLanguageMenu(){const A=this.getEditorLanguage(),B={};let t=g.menuMap[A];if(t){let e=[];g.spokenLanguages&&(e=g.spokenLanguages[A],t=t.concat(e)),t.forEach(A=>{B[A.code]=A.name})}return Object.keys(this.LANGUAGE_INFO).map(A=>{let t=this.LANGUAGE_INFO[A].name;const e=B[A];return e&&(t=e),t=t.charAt(0).toUpperCase()+t.slice(1),{text:t,value:A}})}setVoice(A,B){const t=this._getState(B.target);let e=A.VOICE,g=parseInt(e,10);isNaN(g)||(g-=1,g=s.wrapClamp(g,0,Object.keys(this.VOICE_INFO).length-1),e=Object.keys(this.VOICE_INFO)[g]),Object.keys(this.VOICE_INFO).includes(e)&&(t.voiceId=e)}setLanguage(A){this.setCurrentLanguage(A.LANGUAGE)}_stopAllSpeech(){this._soundPlayers.forEach(A=>{A.stop()})}speakAndWait(A,B){let t=n.toString(A.WORDS),e=this._getSpeechSynthLocale();const g=this._getState(B.target);let i=this.VOICE_INFO[g.voiceId].gender,Q=this.VOICE_INFO[g.voiceId].playbackRate;this.LANGUAGE_INFO[this.getCurrentLanguage()].singleGender&&(i="female","TENOR"===g.voiceId&&(Q=.89),"GIANT"===g.voiceId&&(Q=.79)),"KITTEN"===g.voiceId&&(t=t.replace(/\S+/g,"meow"),e=this.LANGUAGE_INFO[this.DEFAULT_LANGUAGE].speechSynthLocale);let s="".concat("https://synthesis-service.scratch.mit.edu","/synth");return s+="?locale=".concat(e),s+="&gender=".concat(i),s+="&text=".concat(encodeURIComponent(t.substring(0,128))),E(s,{},1e4).then(A=>{if(200!==A.status)throw new Error("HTTP ".concat(A.status," error reaching translation service"));return A.arrayBuffer()}).then(A=>{const B={data:{buffer:A}};return this.runtime.audioEngine.decodeSoundPlayer(B)}).then(A=>{this._soundPlayers.set(A.id,A),A.setPlaybackRate(Q);const B=this.runtime.audioEngine.createEffectChain();return B.set("volume",250),A.connect(B),A.play(),new Promise(B=>{A.on("stop",()=>{this._soundPlayers.delete(A.id),B()})})}).catch(A=>{c.warn(A)})}}A.exports=o},function(A,B,t){const e=t(6),g=t(3),i=t(1),Q=t(0),n=t(117),s=t(116),r=t(5);A.exports=class{constructor(){this._viewerLanguageCode=this.getViewerLanguageCode(),this._supportedLanguages=[],this._randomLanguageCode="en",this._translateResult="",this._lastLangTranslated="",this._lastTextTranslated=""}static get STATE_KEY(){return"Scratch.translate"}getInfo(){return this._supportedLanguages=this._getSupportedLanguages(this.getViewerLanguageCode()),this._randomLanguageCode=this._supportedLanguages[Math.floor(Math.random()*this._supportedLanguages.length)].value,{id:"translate",name:r({id:"translate.categoryName",default:"Translate",description:"Name of extension that adds translate blocks"}),blockIconURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAN+UlEQVR4Ae1ce2xT1xn/Tkhq4hqHJKRLDAlQGI+GUfFc14HaLmxuGd0ab93GgK6Vmm01y9BUsaU0RfyRFTakaRHq3So6jVapWEUxa9dRuU8x6IAGCoO6wa1KXiSQOE9jkjivO/2u7yWOuff6XvvekFb5SUdx7ON7v/vz9zrnO+cwnudpAokjZYK75DBBYJKYIDBJTBCYJCYITBJfOgIZYzbGWA5jLJ8xNm/z5s334a/4P1omYyzNsPt9WdIYxhiUId/j8azPz89fY7VaF6ampjqi+4TD4Qvd3d0f7t+/fx/HcTVE1M7z/EBS99VDoCikTWzWMdTgYSLqIaIQGs/zwzKyOaqrq1+aOnVqUUZGBqWnp5PFYqG0tDQaHh6mvr4+GhwcpFAoJLSenp4P9+7dW8Zx3Fme5zsTFSxVa0eovtPpnL1ly5YfzJgxw2WxWBYketNEAO25dOmSp7Ky8iBjrFbmoW12u70oOzubMjMzR32QkpJCVqtVeG2322lgYIACgcDK0tLS1+6+++4yxpiH5/krCQkGDYzXiCi3qqrKXVNTE7x48SLf0dHB9/X18WMF3Av3xL0hA2SBTNFyE9E8v9/PX758WbNUuCa+4/F4ymKvp7XF1UDGWK7H43m0sLBwZ05Ozg2/7lgApoiGe3d2dk5ZsWLFcx6Px84Y2xelOcHW1taXiOiRcDgsaJ2gljab0GDKscD1Jk2ahHd3ejwePOtenufb9TySKoEw26qqKhfIy83NFdT/ZiP6oauqqoKMsf2iObeuXr26vKKiwpOVlTXFbrfb8/LyFubk5KyBu1H68aVnGh4e3uZ2u08yxo7pCixKqgrX4XQ6l8JkoOrjDZAJskFGyBolt0UMcGhgJ19yP2rm3dDQwJ85c+akXlNWI9B++PDh38PvjFdANsgIWVUfksheUVHxfZDY3d0t+zT9/f2CP3S73feJWYZFC4FqJmxDtJ06daphRnuiluhrDqJbLcZcD7JBRiJ6Dj5Qrg9jDHfLhlm3tbUdslgsj8i5IvhI+MpNmzaVLlq0yCN+9wMiCvA8H1KSQY1AK3yHFP6ThfcTouePEaVNItrzI6LbpiR/TcgmplOyQmLE4XQ6C3fv3v0y+iEQIbggjZELKiB2+vTpxXl5ecUIRD6fr/nQoUNuxtjbPM/3yN1DLREWPsNNjUBNC9HgMFEKI2q5asglo2VTeo7sioqKP6anpwtBZObMmZSfny9LHokRG5+jn8PhoFtuucVRXFzMQdmVZPiyTyakIblGBqE3/QKZIBLDQafTmavUT/NIRA3XwkSlB4jaFD3FCPqHiJ5+Xb3PNBvRnoeN85UYyiUCmDHg9XoVn8wQDTxRR9RxjQjxLl4DgfH64Fq4pgEY6OjoONTe3q6bRPTH9zBmFsfgsjBEA4vmE/kuE30eiPzfN0B0WYyJGelEWQpx6FJXhNC0FKIcG9Fk0TUVZEWuaQBad+zYUbF79+6FjY2NC+DfpBGKGkBeY2MjBYPBC2VlZU9g1sZUAoFf3zvyGia9/u8RbRrmiSofvrG/1IeEaEn0/E+NkmQEmLVhjPmIaAMisRYSo8nbunXrBq/X6+N5PqzU35QgAt8177bI655+ovPNN/Z50xeJyIyIlswwQ4oI8PAgAWSAFJCjZM56ySMzo/DP7iJKTSEaGibi/jP6M2jfwbNEQzzRpBSin68yS4oItJCYCHlkJoEYcWSKvu9KkOjwxyOf7T9F1DsQ0b6CTGOS6niQIxEJNSVBHhnpA+Xwm28RPfOvSAL9t+NEy2cShcJEr5+P+EcQ+PT9ZkowGiBF8olIsMPhcBFmrnt7e4Voi4Chhzwym0BoYWFexAcODBGVvUbU3RshbxIjWrdobLQvGhKJXq+3xO12z1q3bt2aN9544x2O45A4Neshj8wmENjmJHr8ZaJQ/0iizcRk+fFvmn13eYgk1TLGWjiOwxQWKY1148H0oRwiMohiUYky8Oz3zL5zfIA0qSV6DdM18NWPiF4+FXnNogh84h9EW9cQ3TV7pC+ceVTVTNPooa5OGLLMYkgmE0fcqp8STCPwYhvRn94jauqKBBHJbOED4Q8xAtn1FtH8rxA9WUSUNthJiQy5Zs2aRX6/35usvBqqfrJQrAujmu/3+/3z5s3TJQgCxsEzRP9riuSAUsBYXhCJysCWVyP+EHkgiA0Hr9D9Xw3S/QuJJlvShIlSca4vASr0A5MG0Piuri68vnr69OmyjRs3aip1GqaByPNePRuZCMDwTSIuPY1oy32jTfWFDUQvniB67RzRta4rtDwvSN8tJBrnVT9ZGEIgpupf+C/RgGh90CpMEKwtJFq/XH5aCiOVb0zvpH+fipD3Baj6yUKNQIEOqLcWU4IPx9ANGue6k+iBQvX5PPi6lHD7dc0bD+RJgCxDQ0O0bNmyXU6n8wRjrFsxsKhUshznzp2r0VrSbAny/OcB7eU7VMdQBfuiV/3U8sAQohIcqxZgRHH7NO2/MlIVEitr4xVRVT+bkoiqBCKkIyp1dia8eEkRiHokVtbGK+JV/VQJhM17vd5ahPRAIICZCkMfU8r3xipVSQQaqn7qURjRB0u/ENIRleBYb0aaEQ+Btk4qfXLnqF7bn/oF3bFgjun3jjsWRh7kcrn2VVdXb25pablaW1uLXOl6xWo84LD36A1SHDl6akwk05QHgkTkQwjpsQsstSa/V65cGeUGMIbFMMwIyJFVfdpHj2zopVut6YbcQwmaZ2Ngzl6v9+zatWv/sHjx4u9UVlYKAzMUoOMB5HV1dV09cODAQ/NFOJ1OpxEPAKJ6evtueB/vnTrtM+IWqtA1nYXAwvM81GgAi3CUFi5KQKBobm4WyDt48OCm8vLy93me/xQNSmjEAxw5NqJ91vTJQpNQ/dE4I5AikwxWjuPWZGVlFWM9shLgI+vr6zHDcoHjuAdF8gwN5dd6eulUFEkrlhUKTQI+Q4AxE4lMqOasWrXqafg9uRREquiDvKamppe2bdv2kz179pwwmjyS8X3Lly4SWjSqT38s/2WDkMhkggUBJHbsCuIQndH6+/ubjxw58ju32/0eXKCeCUo9iDbfadMyr2sfzFjyi4ffOkZrnatNoi8xAoX1JjabrRhDnehZZBDn9/v3uFyuV+ItTEwWdQ3NVN9w+fpVViwdMV0QeeTYaeF1W1un0HdWgcNoEQQkYsJd27dvfxa+7dKlS9TQ0NBcV1d36OTJk5sLCwtXuVwujuf5WjPJIxnzvWf18uuvY834TZk80Sjo1kBxdPLp4sWLizBnKr4NewnqLQkmg1gCy575s+LVkOo8UWKOHAlV5cSAgGmadnG/WWCsyZPL/ZSAvmaNTHRroLho2xFdlGaMXRSDxZiQGJvf3bHgdtl+n1y4OOo70WZuFHQRCPKwaHvXrl1/sVqtK7EsYs6cOdsee+yxd8vLy3+Lir/ZJCKvi879Zhbk0fanfinb91dP7hSCCEXlhDnTjJ0M0WzCEnlYZ5eZmbly7ty5woLs2bNnYzxchPfxuaihpiE2r7tnlbJWRUdmMikn1ERgNHl2u33UIkUM5fA/3h8LEpHXRWPFskWKfWNNNva7RkDLZkNF8iTgf7yPFaDoh9VPZpnzvVEaZ7VOVjVJ5H4/fOjbRoswGnG2SIG8pSgu1dXV8UNDQ6pFGHyOfugv7mFT3C5FRHNRVBrLbbN6AdkgI2RNZK+cLvIkyJCYonB9XVW/mwHIBhkhayJVuWxEWyWzVYJkzjabbcGOHTvKUbBT6Kqr6nczANkgo9o2BzVWbEhVMGWllbzrF01JIXwPU16IMwrdTK36JQuxbHEVMiZEoNPpFKaaE62axSPd7KpfMoAskAmyQUa12STFKOz1egODg4PN9fX1Dqxb0TJ1LwG/HuYEg8Hgu5i9Ueo3Hqt+kB3k+Xy+p8QVWqrmoZbGtGOrJ3YrNjc3O6StonhAOTKx4h21D0xvYTYa6+0wOlHb5UMjBat9WMiDtShdXV1TvkjL21TPjcEpQJiB5jhOWM28ZMkSV0FBQTG2gsoBJU/MQp8/f/5tt9v9gZ5F20Yeq4LJXlhNPEjaRjELLEWz1eaYNR57AlWwYTs88iJsj5cDFgxhWz2218fbhq90ToN4zgF+obk4ykRvk7b2azn+JGabf754b9m0S3ceqPCAuTiYAQc0KAGCR53tIgklHQKh6RyCZFr0+QhNTU1x81f0OX78uMe0c2Ni0I7jknDiTzAYxNEiN3SA6VgsFmGV57lz50oDgcA7fr9f2ErQ0dFxlTH2ERE1mVUnwVwlY+z9lpaWB0tKSv4aDocXwOUo+VOkW6FQqJjjOI94gpG+FfsJmFk2TvqB6iudgCGZBzJ5aCsaRif4ztGjR19M9NfWKadl3bp1d+J+uG9bW5uiNra2tkojjpm675OgcLkSiXqGYjBvcWw5z2wC+RGf6uA4bqPP52v67LPPZImMGvPqliuhNdKxqUdvb+8UrJFRW6VAN2Epm+gmmhlj/ySiDzwez4/nz59f2tnZ6ZCOhEJqhvQFlUa1nFUJCS8ylxYcud3umpKSkl2hUGilJFRqaipNnjz5+hEjyLOwoa+7u1tKrk2t2MnIKmygYYzhBI5XqqqqHpgzZ84au93+dRwqgRQGlUaxzqMLSR/AKJ4Gme12uxeuX7/+0YyMjJWxORxGND09PTWNjY3vuFyu/UTUaFYQ0SizRcwOpIU0Q2JVUf8Pa6C/AZGZYuqSL+VkYh6H/3OQS46F7xvLNnGSeZKYOMU3SUwQmCQmCEwSEwQmiQkCkwER/R+aET3lwEIlXgAAAABJRU5ErkJggg==",menuIconURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAGAklEQVRYhe1YbUxTVxh+rh02o0KtkOEgKA4U4yeRWCdgxDoxCnH6h22iqSz76aasZlnijzkTBlvS4TJ/LGaJsmiyESe4hAVJvMJGxwQhLKECcRWkpWNZERs6Ctb2Lm97C/fe3n6Jyfzhk5y09z3nPPe57znnPe85DMdxeJ6x6LlW90LgM8BLchR1dXUZeXl5b3Ect+ppXsEwzHBfX98PVVVVY0GbmjW2AdgpaFYP4JxTZ+iLyCVdJFeuXNmdn59fn56enrFkyRIsWhSfk30+H1wuF+x2+1hPT4++oqLiJi/wEoA8AJslXSqdOsOlmARWV1dnlpeXd2ZnZ2fEK0xOqMViGWtoaNh++vRpa9CuZo1ZAJokQlc5dYYROR6RCq1WW56WlhZV3H0H8O9sZIHEQVzEKbTzQooBPBCYz4TlET4oFIosGtZoOHUN+Ph61GYgLuIU2tSscSmAYwAeCcx6NWs8o2aNxVKOkEUi9R55qv428Ng7b3viA/6eAs7dmrctVgD6bYBKGZ6LB4mrk7F/whcmokApfh8BWu6G2mc8ADsktuWmAbtzozGiLUJdu9QQVSC98JUkYNgBfPsboH4Z+GhPoK62FZiaAU7sCrTZmB5VHM3BPjVrrARwUVL1B4CD0vYxLVV68YFNQIICcLrn7SROtTjwEbGIE4iksFIpEVfs1BkeSdvGFUsObAz8Gm8CNTcC/49q42EIEbkLwKfhxCGWIRZC/zrQ/ifgcAWMK5YB+zc8nUBeZFuUORmfQIp/PsHGM/04YMta5oPT6cTs7Cw8Ho+oj9vtzmloaCgPZQtApVI96ejo6K2trR3lOM4nrRftJCzLfq3T6Y7LCfvuNtDL7wepfKgkTz6ZdeHdzePYlq30xz2lUintHhH0UbQ12my2+oKCguMcx7mE7aOHmWHgsxvzzzQP3ysMxMfzt2bxKmNHyZblSE5OjktYEImJidBoNFCr1frOzs5khmHe4Thubp8SCVQoFBwNUUJCwpyNwsfyZGBDOvB2fuCZQAH56KYJKJUpTy1OCOJYvXr1ocbGxjIAPwarRKvYZrNdn5iYEHV8LRW4cBj4oHheXBDT09PPRFwQxKXRaIQpmVjgkSNHfrFardcmJydjIqSMRehtOfzjmMTZmm/8hf5HAnF5vV7RVicSyHGcR6vVHh4YGPjKYrFMkTelq5JAH0B1MzMzUT+iu6cfdwfv+wv9jxchgZomaEFBwcmcnJxVY2NjXQqFQlQ/Pj6O/v7+s2az+U2Hw9Ec7X3tHXfm/v/c2hG3wLCruLm5+VBGRoY2mJGQJ0nc4ODgqZKSkjqKWSzL7olEPjJqx4PRv5CaqvE/OxyTflvWitj3xbBbnUql2kRxjYTRcA4MDHR1d3frguJiIW//NeC9/SVF2LplvcgWK8J6sKWl5UuVSrXO4/HYHj58+FNZWVkLx3HT8Rz0u3vN/t8Ho3aRaH3FgYULrKmpodT8jeBzvDcQ3T1m/5D6RXX0zNmn3TP+uq356xcmkE/NTwLoc+oMTXGpA3CnN7Bi99Hw5s8PL4mlulgFys5BXlwbn4I3qlnjsXgFBr22f+8OrFub7S/79u4Q1cWCEA8KxAmPhRfVrBFy51cK1nJnj+/rvwix0eqVswu5pJDzoPTMKhSZJzQolUoLZSLPCsRFnEI6OYE7I7xPdGYoKiq6YLVaByllWiiIg7iIM5rAYBouBB2yq5w6g+iATWGnqampZGhoqItiJSUP4YrcR9CQUh31JQ7iIk5hm7AXmPxdip5/dNIUCnduYBgm8fLly9tzc3NLwzlSqVTuW7NmzVphQkubwL179+xdXV3HKisrTVJxiJKwnuGHVM2XNjVrPCh3h8IT3+SLLKqrq+tKS0uvrly5UksJKvjsJSkpKd3r9TrkxCGSBxHwIoWXc7zAIOiIOOLUGULOsNHAMIzSZDJ9npmZeSIlJcWfTdPQm0ym8zqd7n257hGPnXxYyePv8py8mVb40ji1+UGZUmFh4Yetra1bzGbzteHh4SlKQNxu961wff7XS3Sau/w0c4VLQF7c8i8IAP4DcHKth/4Ur7MAAAAASUVORK5CYII=",blocks:[{opcode:"getTranslate",text:r({id:"translate.translateBlock",default:"translate [WORDS] to [LANGUAGE]",description:"translate some text to a different language"}),blockType:g.REPORTER,arguments:{WORDS:{type:e.STRING,defaultValue:r({id:"translate.defaultTextToTranslate",default:"hello",description:"hello: the default text to translate"})},LANGUAGE:{type:e.STRING,menu:"languages",defaultValue:this._randomLanguageCode}}},{opcode:"getViewerLanguage",text:r({id:"translate.viewerLanguage",default:"language",description:"the languge of the project viewer"}),blockType:g.REPORTER,arguments:{}}],menus:{languages:{acceptReporters:!0,items:this._supportedLanguages}}}}_getSupportedLanguages(A){return s.menuMap[A].map(A=>({text:A.name,value:A.code}))}getViewerLanguage(){this._viewerLanguageCode=this.getViewerLanguageCode();const A=s.menuMap[this._viewerLanguageCode];let B=A.find(A=>A.code===this._viewerLanguageCode);if(!B&&s.scratchToGoogleMap[this._viewerLanguageCode]){const t=s.scratchToGoogleMap[this._viewerLanguageCode];B=A.find(A=>A.code===t)}let t=this._viewerLanguageCode;return B&&(t=B.name),t}getViewerLanguageCode(){const A=[r.setup().locale].concat(navigator.languages),B=Object.keys(s.menuMap);return(A.reduce((A,t)=>A||(B.indexOf(t.toLowerCase())>-1?t:A),"")||"en").toLowerCase()}getLanguageCodeFromArg(A){const B=i.toString(A).toLowerCase();return s.menuMap.hasOwnProperty(B)?B:s.nameMap.hasOwnProperty(B)?s.nameMap[B]:-1!==s.previouslySupported.indexOf(B)?B:"en"}getTranslate(A){if(/^\d+$/.test(A.WORDS))return Promise.resolve(A.WORDS);if(this._lastTextTranslated===A.WORDS&&this._lastLangTranslated===A.LANGUAGE)return this._translateResult;const B=this.getLanguageCodeFromArg(A.LANGUAGE);let t="".concat("https://trampoline.turbowarp.org/translate/","translate?language=");t+=B,t+="&text=",t+=encodeURIComponent(A.WORDS);const e=this;return n(t,{},1e4).then(A=>A.text()).then(B=>{const t=JSON.parse(B).result;return e._translateResult=t,e._lastTextTranslated=A.WORDS,e._lastLangTranslated=A.LANGUAGE,t}).catch(A=>(Q.warn("error fetching translate result! ".concat(A)),""))}}},function(A,B,t){const e=t(118),g=t(6),i=t(3),Q=t(18),n=t(1),s=t(5),r=t(124),c=t(327),E={MOTION:"motion",DIRECTION:"direction"},o={STAGE:"Stage",SPRITE:"this sprite"},w={OFF:"off",ON:"on",ON_FLIPPED:"on-flipped"};class C{constructor(A){this.runtime=A,this.detect=new c,this._lastUpdate=null,this.firstInstall=!0,this.runtime.ioDevices&&(this.runtime.on(e.PROJECT_LOADED,this.updateVideoDisplay.bind(this)),this.runtime.on(e.PROJECT_RUN_START,this.reset.bind(this)),this._loop())}static get INTERVAL(){return 33}static get DIMENSIONS(){return[480,360]}static get STATE_KEY(){return"Scratch.videoSensing"}static get DEFAULT_MOTION_STATE(){return{motionFrameNumber:0,motionAmount:0,motionDirection:0}}get globalVideoTransparency(){const A=this.runtime.getTargetForStage();return A?A.videoTransparency:50}set globalVideoTransparency(A){const B=this.runtime.getTargetForStage();return B&&(B.videoTransparency=A),A}get globalVideoState(){const A=this.runtime.getTargetForStage();return A?A.videoState:w.OFF}set globalVideoState(A){const B=this.runtime.getTargetForStage();return B&&(B.videoState=A),A}updateVideoDisplay(){this.setVideoTransparency({TRANSPARENCY:this.globalVideoTransparency}),this.videoToggle({VIDEO_STATE:this.globalVideoState})}reset(){this.detect.reset();const A=this.runtime.targets;for(let B=0;BC.INTERVAL){const B=this.runtime.ioDevices.video.getFrame({format:r.FORMAT_IMAGE_DATA,dimensions:C.DIMENSIONS});B&&(this._lastUpdate=A,this.detect.addFrame(B.data))}}_buildMenu(A){return A.map((A,B)=>{const t={};return t.text=A.name,t.value=A.value||String(B+1),t})}_getMotionState(A){let B=A.getCustomState(C.STATE_KEY);return B||(B=Q.simple(C.DEFAULT_MOTION_STATE),A.setCustomState(C.STATE_KEY,B)),B}static get SensingAttribute(){return E}get ATTRIBUTE_INFO(){return[{name:s({id:"videoSensing.motion",default:"motion",description:'Attribute for the "video [ATTRIBUTE] on [SUBJECT]" block'}),value:E.MOTION},{name:s({id:"videoSensing.direction",default:"direction",description:'Attribute for the "video [ATTRIBUTE] on [SUBJECT]" block'}),value:E.DIRECTION}]}static get SensingSubject(){return o}get SUBJECT_INFO(){return[{name:s({id:"videoSensing.sprite",default:"sprite",description:'Subject for the "video [ATTRIBUTE] on [SUBJECT]" block'}),value:o.SPRITE},{name:s({id:"videoSensing.stage",default:"stage",description:'Subject for the "video [ATTRIBUTE] on [SUBJECT]" block'}),value:o.STAGE}]}static get VideoState(){return w}get VIDEO_STATE_INFO(){return[{name:s({id:"videoSensing.off",default:"off",description:'Option for the "turn video [STATE]" block'}),value:w.OFF},{name:s({id:"videoSensing.on",default:"on",description:'Option for the "turn video [STATE]" block'}),value:w.ON},{name:s({id:"videoSensing.onFlipped",default:"on flipped",description:'Option for the "turn video [STATE]" block that causes the video to be flipped horizontally (reversed as in a mirror)'}),value:w.ON_FLIPPED}]}getInfo(){return this.firstInstall&&(this.globalVideoState=w.ON,this.globalVideoTransparency=50,this.updateVideoDisplay(),this.firstInstall=!1),{id:"videoSensing",name:s({id:"videoSensing.categoryName",default:"Video Sensing",description:"Label for the video sensing extension category"}),blockIconURI:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUyLjIgKDY3MTQ1KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5FeHRlbnNpb25zL1NvZnR3YXJlL1ZpZGVvLVNlbnNpbmctQmxvY2s8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZyBpZD0iRXh0ZW5zaW9ucy9Tb2Z0d2FyZS9WaWRlby1TZW5zaW5nLUJsb2NrIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2Utb3BhY2l0eT0iMC4xNSI+CiAgICAgICAgPGcgaWQ9InZpZGVvLW1vdGlvbiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC4wMDAwMDAsIDEwLjAwMDAwMCkiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSIjMDAwMDAwIj4KICAgICAgICAgICAgPGNpcmNsZSBpZD0iT3ZhbC1Db3B5IiBmaWxsPSIjRkZGRkZGIiBvcGFjaXR5PSIwLjI1IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGN4PSIzMiIgY3k9IjE2IiByPSI0LjUiPjwvY2lyY2xlPgogICAgICAgICAgICA8Y2lyY2xlIGlkPSJPdmFsLUNvcHkiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjeD0iMzIiIGN5PSIxMiIgcj0iNC41Ij48L2NpcmNsZT4KICAgICAgICAgICAgPGNpcmNsZSBpZD0iT3ZhbC1Db3B5IiBmaWxsPSIjRkZGRkZGIiBvcGFjaXR5PSIwLjc1IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGN4PSIzMiIgY3k9IjgiIHI9IjQuNSI+PC9jaXJjbGU+CiAgICAgICAgICAgIDxjaXJjbGUgaWQ9Ik92YWwiIGZpbGw9IiNGRkZGRkYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgY3g9IjMyIiBjeT0iNCIgcj0iNC41Ij48L2NpcmNsZT4KICAgICAgICAgICAgPHBhdGggZD0iTTIyLjY3MTk0NzcsNC40MTk1NzY0OSBMMTYuNSw4LjQxOTkxMjk4IEwxNi41LDYuMSBDMTYuNSw0LjA4OTc2NDU0IDE0LjkzNzE4MDYsMi41IDEzLDIuNSBMNC4xLDIuNSBDMi4wNzYxNDIzNywyLjUgMC41LDQuMDc2MTQyMzcgMC41LDYuMSBMMC41LDE0IEMwLjUsMTUuOTI3Mzk4NyAyLjA4NDQ5ODM5LDE3LjUxMTg5NzEgNC4xLDE3LjYgTDEzLDE3LjYgQzE0LjkwMTY2MDIsMTcuNiAxNi41LDE1Ljk0NjU0NSAxNi41LDE0IEwxNi41LDExLjcxNjkwNDggTDIyLjc1NzI0NzksMTUuNDcxMjUzNSBMMjIuODUzNTUzNCwxNS41NDY0NDY2IEMyMi44NzM3ODg2LDE1LjU2NjY4MTggMjIuOTUxNTMxLDE1LjYgMjMsMTUuNiBDMjMuMjY2OTg2NSwxNS42IDIzLjUsMTUuMzgyNTIwNyAyMy41LDE1LjEgTDIzLjUsNC44IEMyMy41LDQuODM2NzY1MzggMjMuNDQzODA1OCw0LjcwNTY0NTYzIDIzLjM3MTI1MzUsNC41NTcyNDc4OCBDMjMuMjI1OTA1Niw0LjMxNTAwMTM5IDIyLjk0MTU5MzcsNC4yNTgxMzg5OSAyMi42NzE5NDc3LDQuNDE5NTc2NDkgWiIgaWQ9InZpZGVvXzM3XyIgZmlsbD0iIzRENEQ0RCI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+",menuIconURI:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUyLjIgKDY3MTQ1KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5FeHRlbnNpb25zL1NvZnR3YXJlL1ZpZGVvLVNlbnNpbmctTWVudTwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxnIGlkPSJFeHRlbnNpb25zL1NvZnR3YXJlL1ZpZGVvLVNlbnNpbmctTWVudSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9InZpZGVvLW1vdGlvbiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC4wMDAwMDAsIDUuMDAwMDAwKSIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgPGNpcmNsZSBpZD0iT3ZhbC1Db3B5IiBmaWxsPSIjMEVCRDhDIiBvcGFjaXR5PSIwLjI1IiBjeD0iMTYiIGN5PSI4IiByPSIyIj48L2NpcmNsZT4KICAgICAgICAgICAgPGNpcmNsZSBpZD0iT3ZhbC1Db3B5IiBmaWxsPSIjMEVCRDhDIiBvcGFjaXR5PSIwLjUiIGN4PSIxNiIgY3k9IjYiIHI9IjIiPjwvY2lyY2xlPgogICAgICAgICAgICA8Y2lyY2xlIGlkPSJPdmFsLUNvcHkiIGZpbGw9IiMwRUJEOEMiIG9wYWNpdHk9IjAuNzUiIGN4PSIxNiIgY3k9IjQiIHI9IjIiPjwvY2lyY2xlPgogICAgICAgICAgICA8Y2lyY2xlIGlkPSJPdmFsIiBmaWxsPSIjMEVCRDhDIiBjeD0iMTYiIGN5PSIyIiByPSIyIj48L2NpcmNsZT4KICAgICAgICAgICAgPHBhdGggZD0iTTExLjMzNTk3MzksMi4yMDk3ODgyNSBMOC4yNSw0LjIwOTk1NjQ5IEw4LjI1LDMuMDUgQzguMjUsMi4wNDQ4ODIyNyA3LjQ2ODU5MDMxLDEuMjUgNi41LDEuMjUgTDIuMDUsMS4yNSBDMS4wMzgwNzExOSwxLjI1IDAuMjUsMi4wMzgwNzExOSAwLjI1LDMuMDUgTDAuMjUsNyBDMC4yNSw3Ljk2MzY5OTM3IDEuMDQyMjQ5MTksOC43NTU5NDg1NiAyLjA1LDguOCBMNi41LDguOCBDNy40NTA4MzAwOSw4LjggOC4yNSw3Ljk3MzI3MjUgOC4yNSw3IEw4LjI1LDUuODU4NDUyNDEgTDguNjI4NjIzOTQsNi4wODU2MjY3NyBMMTEuNDI2Nzc2Nyw3Ljc3MzIyMzMgQzExLjQzNjg5NDMsNy43ODMzNDA5MSAxMS40NzU3NjU1LDcuOCAxMS41LDcuOCBDMTEuNjMzNDkzMiw3LjggMTEuNzUsNy42OTEyNjAzNCAxMS43NSw3LjU1IEwxMS43NSwyLjQgQzExLjc1LDIuNDE4MzgyNjkgMTEuNzIxOTAyOSwyLjM1MjgyMjgyIDExLjY4NTYyNjgsMi4yNzg2MjM5NCBDMTEuNjEyOTUyOCwyLjE1NzUwMDY5IDExLjQ3MDc5NjgsMi4xMjkwNjk1IDExLjMzNTk3MzksMi4yMDk3ODgyNSBaIiBpZD0idmlkZW9fMzdfIiBzdHJva2Utb3BhY2l0eT0iMC4xNSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjAuNSIgZmlsbD0iIzRENEQ0RCI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+",blocks:[{opcode:"whenMotionGreaterThan",text:s({id:"videoSensing.whenMotionGreaterThan",default:"when video motion > [REFERENCE]",description:"Event that triggers when the amount of motion is greater than [REFERENCE]"}),blockType:i.HAT,arguments:{REFERENCE:{type:g.NUMBER,defaultValue:10}}},{opcode:"videoOn",blockType:i.REPORTER,text:s({id:"videoSensing.videoOn",default:"video [ATTRIBUTE] on [SUBJECT]",description:"Reporter that returns the amount of [ATTRIBUTE] for the selected [SUBJECT]"}),arguments:{ATTRIBUTE:{type:g.NUMBER,menu:"ATTRIBUTE",defaultValue:E.MOTION},SUBJECT:{type:g.NUMBER,menu:"SUBJECT",defaultValue:o.SPRITE}}},{opcode:"videoToggle",text:s({id:"videoSensing.videoToggle",default:"turn video [VIDEO_STATE]",description:"Controls display of the video preview layer"}),arguments:{VIDEO_STATE:{type:g.NUMBER,menu:"VIDEO_STATE",defaultValue:w.ON}}},{opcode:"setVideoTransparency",text:s({id:"videoSensing.setVideoTransparency",default:"set video transparency to [TRANSPARENCY]",description:"Controls transparency of the video preview layer"}),arguments:{TRANSPARENCY:{type:g.NUMBER,defaultValue:50}}}],menus:{ATTRIBUTE:{acceptReporters:!0,items:this._buildMenu(this.ATTRIBUTE_INFO)},SUBJECT:{acceptReporters:!0,items:this._buildMenu(this.SUBJECT_INFO)},VIDEO_STATE:{acceptReporters:!0,items:this._buildMenu(this.VIDEO_STATE_INFO)}}}}_analyzeLocalMotion(A){const B=this.runtime.renderer._allDrawables[A.drawableID],t=this._getMotionState(A);return this.detect.getLocalMotion(B,t),t}videoOn(A,B){this.detect.analyzeFrame();let t=this.detect;return A.SUBJECT===o.SPRITE&&(t=this._analyzeLocalMotion(B.target)),A.ATTRIBUTE===E.MOTION?t.motionAmount:t.motionDirection}whenMotionGreaterThan(A,B){this.detect.analyzeFrame();return this._analyzeLocalMotion(B.target).motionAmount>Number(A.REFERENCE)}videoToggle(A){const B=A.VIDEO_STATE;this.globalVideoState=B,B===w.OFF?this.runtime.ioDevices.video.disableVideo():(this.runtime.ioDevices.video.enableVideo(),this.runtime.ioDevices.video.mirror=B===w.ON)}setVideoTransparency(A){const B=n.toNumber(A.TRANSPARENCY);this.globalVideoTransparency=B,this.runtime.ioDevices.video.setPreviewGhost(B)}}A.exports=C},function(A,B){let t=0;const e={},g="object"==typeof window&&window.performance;class i{constructor(A){this.id=-1,this.totalTime=0,this.selfTime=0,this.arg=null,this.depth=A,this.count=0}}class Q{constructor(A=function(){}){this.records=[],this.increments=[],this.counters=[],this.nullFrame=new i(-1),this._stack=[new i(0)],this.onFrame=A,this.START=0,this.STOP=1}start(A,B){this.records.push(0,A,B,g.now())}stop(){this.records.push(1,g.now())}increment(A){this.increments[A]||(this.increments[A]=new i(-1),this.increments[A].id=A),this.increments[A].count+=1}frame(A,B){for(let t=0;t=A.length&&A.push(new i(B));const e=A[B++];e.id=this.records[t+1],e.arg=this.records[t+2],e.totalTime=this.records[t+3],e.selfTime=0,t+=4}else{if(1!==this.records[t])throw this.records.length=0,new Error("Unable to decode Profiler records.");{const e=this.records[t+1],g=A[--B];g.totalTime=e-g.totalTime,g.selfTime+=g.totalTime,A[B-1].selfTime-=g.totalTime,g.count=1,this.onFrame(g),t+=2}}for(let A=0;A0&&(this.onFrame(this.increments[A]),this.increments[A].count=0);for(let A=0;A0&&(this.onFrame(this.counters[A]),this.counters[A].count=0);this.records.length=0}idByName(A){return Q.idByName(A)}nameById(A){return Q.nameById(A)}static idByName(A){return"number"!=typeof e[A]&&(e[A]=t++),e[A]}static nameById(A){for(const B in e)if(e[B]===A)return B;return null}static available(){return"object"==typeof window&&void 0!==window.performance}}Q.START=0,Q.STOP=1,A.exports=Q},function(A,B,t){const e=t(20),g=t(43),i=t(122),Q=t(120);let n=-1,s=-1,r=-1;class c{constructor(A){this.timer=new e,this.runtime=A,this.activeThread=null}static get WARP_TIME(){return 500}stepThreads(){const A=.75*this.runtime.currentStepTime;this.runtime.updateCurrentMSecs(),this.timer.start();let B=1/0,t=!1;const e=[];for(;this.runtime.threads.length>0&&B>0&&this.timer.timeElapsed()c.WARP_TIME)return}else{if(B.waitingReporter)return;A.goToNextBlock()}}}else A.status=g.STATUS_DONE}stepToBranch(A,B,t){B||(B=1);const e=A.peekStack(),g=A.target.blocks.getBranch(e,B);A.peekStackFrame().isLoop=t,g?A.pushStack(g):A.pushStack(null)}stepToProcedure(A,B){const t=A.target.blocks.getProcedureDefinition(B);if(!t)return;const e=A.isRecursiveCall(B);if(A.pushStack(t),A.peekStackFrame().warpMode&&A.warpTimer.timeElapsed()>c.WARP_TIME)A.status=g.STATUS_YIELD;else{const B=A.target.blocks.getBlock(t),i=A.target.blocks.getBlock(B.inputs.custom_block.block);let Q=!1;if(i&&i.mutation){const A=i.mutation.warp;"boolean"==typeof A?Q=A:"string"==typeof A&&(Q=JSON.parse(A))}Q?A.peekStackFrame().warpMode=!0:e&&(A.status=g.STATUS_YIELD)}}retireThread(A){A.stack=[],A.stackFrame=[],A.requestScriptGlowInFrame=!1,A.status=g.STATUS_DONE,A.isCompiled&&(A.procedures=null,A.generator=null)}}A.exports=c},function(A,B,t){const e=t(301),g=t(303);A.exports=A=>{const B=new e(A).generate(),t={},i=A.target,Q=A=>{if(A.cachedCompileResult)return A.cachedCompileResult;const t=new g(A,B,i).compile();return A.cachedCompileResult=t,t},n=Q(B.entry);for(const A of Object.keys(B.procedures)){const e=Q(B.procedures[A]);t[A]=e}return{startingFunction:n,procedures:t}}},function(A,B,t){const e=t(1),g=t(12),i=t(3),Q=t(13),n=t(0),{IntermediateScript:s,IntermediateRepresentation:r}=t(119),c=t(302),E=(A,B)=>({scope:A,id:B.id,name:B.name,isCloud:B.isCloud});class o{constructor(A){this.thread=A,this.target=A.target,this.blocks=A.blockContainer,this.runtime=this.target.runtime,this.stage=this.runtime.getTargetForStage(),this.script=new s,this.script.warpTimer=this.target.runtime.compilerOptions.warpTimer,this.variableCache={}}setProcedureCode(A){this.script.procedureCode=A,this.script.isProcedure=!0,this.script.yields=!1;const B=this.blocks.getProcedureParamNamesIdsAndDefaults(A);if(null===B)throw new Error("IR: cannot find procedure: ".concat(A));const[t,e,g]=B;this.script.arguments=t}enableWarp(){this.script.isWarp=!0}getBlockById(A){return this.blocks.getBlock(A)||this.blocks.runtime.flyoutBlocks.getBlock(A)}getBlockInfo(A){const[B,t]=g.splitFirst(A,"_");if(!B||!t)return null;const e=this.runtime._blockInfo.find(A=>A.id===B);if(!e)return null;const i=e.blocks.find(A=>A.info.opcode===t);return i||null}descendInputOfBlock(A,B){const t=A.inputs[B];if(!t)return n.warn("IR: ".concat(A.opcode,": missing input ").concat(B),A),{kind:"constant",value:0};const e=t.block,g=this.getBlockById(e);return g?this.descendInput(g):(n.warn("IR: ".concat(A.opcode,": could not find input ").concat(B," with ID ").concat(e)),{kind:"constant",value:0})}descendInput(A){switch(A.opcode){case"colour_picker":{const B=A.fields.COLOUR.value,t=B.substr(1);return/^[0-9a-f]{6,8}$/.test(t)?{kind:"constant",value:Number.parseInt(t,16)}:{kind:"constant",value:B}}case"math_angle":case"math_integer":case"math_number":case"math_positive_number":case"math_whole_number":return{kind:"constant",value:A.fields.NUM.value};case"text":return{kind:"constant",value:A.fields.TEXT.value};case"argument_reporter_string_number":{const B=A.fields.VALUE.value,t=this.script.arguments.lastIndexOf(B);return-1===t&&"last key pressed"===B.toLowerCase()?{kind:"tw.lastKeyPressed"}:-1===t?{kind:"constant",value:0}:{kind:"args.stringNumber",index:t}}case"argument_reporter_boolean":{const B=A.fields.VALUE.value,t=this.script.arguments.lastIndexOf(B);return-1===t?"is compiled?"===B.toLowerCase()||"is turbowarp?"===B.toLowerCase()?{kind:"constant",value:!0}:{kind:"constant",value:0}:{kind:"args.boolean",index:t}}case"data_variable":return{kind:"var.get",variable:this.descendVariable(A,"VARIABLE","")};case"data_itemoflist":return{kind:"list.get",list:this.descendVariable(A,"LIST","list"),index:this.descendInputOfBlock(A,"INDEX")};case"data_lengthoflist":return{kind:"list.length",list:this.descendVariable(A,"LIST","list")};case"data_listcontainsitem":return{kind:"list.contains",list:this.descendVariable(A,"LIST","list"),item:this.descendInputOfBlock(A,"ITEM")};case"data_itemnumoflist":return{kind:"list.indexOf",list:this.descendVariable(A,"LIST","list"),item:this.descendInputOfBlock(A,"ITEM")};case"data_listcontents":return{kind:"list.contents",list:this.descendVariable(A,"LIST","list")};case"looks_backdropnumbername":return"number"===A.fields.NUMBER_NAME.value?{kind:"looks.backdropNumber"}:{kind:"looks.backdropName"};case"looks_costumenumbername":return"number"===A.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(A,"NUM1"),right:this.descendInputOfBlock(A,"NUM2")};case"operator_and":return{kind:"op.and",left:this.descendInputOfBlock(A,"OPERAND1"),right:this.descendInputOfBlock(A,"OPERAND2")};case"operator_contains":return{kind:"op.contains",string:this.descendInputOfBlock(A,"STRING1"),contains:this.descendInputOfBlock(A,"STRING2")};case"operator_divide":return{kind:"op.divide",left:this.descendInputOfBlock(A,"NUM1"),right:this.descendInputOfBlock(A,"NUM2")};case"operator_equals":return{kind:"op.equals",left:this.descendInputOfBlock(A,"OPERAND1"),right:this.descendInputOfBlock(A,"OPERAND2")};case"operator_gt":return{kind:"op.greater",left:this.descendInputOfBlock(A,"OPERAND1"),right:this.descendInputOfBlock(A,"OPERAND2")};case"operator_join":return{kind:"op.join",left:this.descendInputOfBlock(A,"STRING1"),right:this.descendInputOfBlock(A,"STRING2")};case"operator_length":return{kind:"op.length",string:this.descendInputOfBlock(A,"STRING")};case"operator_letter_of":return{kind:"op.letterOf",letter:this.descendInputOfBlock(A,"LETTER"),string:this.descendInputOfBlock(A,"STRING")};case"operator_lt":return{kind:"op.less",left:this.descendInputOfBlock(A,"OPERAND1"),right:this.descendInputOfBlock(A,"OPERAND2")};case"operator_mathop":{const B=this.descendInputOfBlock(A,"NUM");switch(A.fields.OPERATOR.value.toLowerCase()){case"abs":return{kind:"op.abs",value:B};case"floor":return{kind:"op.floor",value:B};case"ceiling":return{kind:"op.ceiling",value:B};case"sqrt":return{kind:"op.sqrt",value:B};case"sin":return{kind:"op.sin",value:B};case"cos":return{kind:"op.cos",value:B};case"tan":return{kind:"op.tan",value:B};case"asin":return{kind:"op.asin",value:B};case"acos":return{kind:"op.acos",value:B};case"atan":return{kind:"op.atan",value:B};case"ln":return{kind:"op.ln",value:B};case"log":return{kind:"op.log",value:B};case"e ^":return{kind:"op.e^",value:B};case"10 ^":return{kind:"op.10^",value:B};default:return{kind:"constant",value:0}}}case"operator_mod":return{kind:"op.mod",left:this.descendInputOfBlock(A,"NUM1"),right:this.descendInputOfBlock(A,"NUM2")};case"operator_multiply":return{kind:"op.multiply",left:this.descendInputOfBlock(A,"NUM1"),right:this.descendInputOfBlock(A,"NUM2")};case"operator_not":return{kind:"op.not",operand:this.descendInputOfBlock(A,"OPERAND")};case"operator_or":return{kind:"op.or",left:this.descendInputOfBlock(A,"OPERAND1"),right:this.descendInputOfBlock(A,"OPERAND2")};case"operator_random":{const B=this.descendInputOfBlock(A,"FROM"),t=this.descendInputOfBlock(A,"TO");if("constant"===B.kind&&"constant"===t.kind){const A=B.value,g=t.value,i=e.toNumber(A),Q=e.toNumber(g);return i===Q?{kind:"constant",value:i}:e.isInt(A)&&e.isInt(g)?{kind:"op.random",low:i<=Q?B:t,high:i<=Q?t:B,useInts:!0,useFloats:!1}:{kind:"op.random",low:i<=Q?B:t,high:i<=Q?t:B,useInts:!1,useFloats:!0}}if("constant"===B.kind){if(!e.isInt(e.toNumber(B.value)))return{kind:"op.random",low:B,high:t,useInts:!1,useFloats:!0}}else if("constant"===t.kind&&!e.isInt(e.toNumber(t.value)))return{kind:"op.random",low:B,high:t,useInts:!1,useFloats:!0};return{kind:"op.random",low:B,high:t,useInts:!1,useFloats:!1}}case"operator_round":return{kind:"op.round",value:this.descendInputOfBlock(A,"NUM")};case"operator_subtract":return{kind:"op.subtract",left:this.descendInputOfBlock(A,"NUM1"),right:this.descendInputOfBlock(A,"NUM2")};case"sensing_answer":return{kind:"sensing.answer"};case"sensing_coloristouchingcolor":return{kind:"sensing.colorTouchingColor",target:this.descendInputOfBlock(A,"COLOR2"),mask:this.descendInputOfBlock(A,"COLOR")};case"sensing_current":switch(A.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(A,"DISTANCETOMENU")};case"sensing_keypressed":return{kind:"keyboard.pressed",key:this.descendInputOfBlock(A,"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:A.fields.PROPERTY.value,object:this.descendInputOfBlock(A,"OBJECT")};case"sensing_timer":return{kind:"timer.get"};case"sensing_touchingcolor":return{kind:"sensing.touchingColor",color:this.descendInputOfBlock(A,"COLOR")};case"sensing_touchingobject":return{kind:"sensing.touching",object:this.descendInputOfBlock(A,"TOUCHINGOBJECTMENU")};case"sensing_username":return{kind:"sensing.username"};case"sound_sounds_menu":return{kind:"constant",value:A.fields.SOUND_MENU.value};case"tw_getLastKeyPressed":return{kind:"tw.lastKeyPressed"};default:{if(this.runtime.getOpcodeFunction(A.opcode)){if(c.inputs.includes(A.opcode))return this.descendCompatLayer(A);const B=this.getBlockInfo(A.opcode);if(B){const t=B.info.blockType;if(t===i.REPORTER||t===i.BOOLEAN)return this.descendCompatLayer(A)}}const B=Object.keys(A.inputs),t=Object.keys(A.fields);if(0===B.length&&1===t.length)return{kind:"constant",value:A.fields[t[0]].value};throw new Error("IR: Unknown input: ".concat(A.opcode))}}}descendStackedBlock(A){switch(A.opcode){case"control_all_at_once":return{kind:"control.if",condition:{kind:"constant",value:!0},whenTrue:this.descendSubstack(A,"SUBSTACK"),whenFalse:[]};case"control_create_clone_of":return{kind:"control.createClone",target:this.descendInputOfBlock(A,"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(A,"SUBSTACK")};case"control_for_each":return this.analyzeLoop(),{kind:"control.for",variable:this.descendVariable(A,"VARIABLE",""),count:this.descendInputOfBlock(A,"VALUE"),do:this.descendSubstack(A,"SUBSTACK")};case"control_if":return{kind:"control.if",condition:this.descendInputOfBlock(A,"CONDITION"),whenTrue:this.descendSubstack(A,"SUBSTACK"),whenFalse:[]};case"control_if_else":return{kind:"control.if",condition:this.descendInputOfBlock(A,"CONDITION"),whenTrue:this.descendSubstack(A,"SUBSTACK"),whenFalse:this.descendSubstack(A,"SUBSTACK2")};case"control_repeat":return this.analyzeLoop(),{kind:"control.repeat",times:this.descendInputOfBlock(A,"TIMES"),do:this.descendSubstack(A,"SUBSTACK")};case"control_repeat_until":return this.analyzeLoop(),{kind:"control.while",condition:{kind:"op.not",operand:this.descendInputOfBlock(A,"CONDITION")},do:this.descendSubstack(A,"SUBSTACK")};case"control_stop":{const B=A.fields.STOP_OPTION.value;return"all"===B?(this.script.yields=!0,{kind:"control.stopAll"}):"other scripts in sprite"===B||"other scripts in stage"===B?{kind:"control.stopOthers"}:"this script"===B?{kind:"control.stopScript"}:{kind:"noop"}}case"control_wait":return this.script.yields=!0,{kind:"control.wait",seconds:this.descendInputOfBlock(A,"DURATION")};case"control_wait_until":return this.script.yields=!0,{kind:"control.waitUntil",condition:this.descendInputOfBlock(A,"CONDITION")};case"control_while":return this.analyzeLoop(),{kind:"control.while",condition:this.descendInputOfBlock(A,"CONDITION"),do:this.descendSubstack(A,"SUBSTACK")};case"data_addtolist":return{kind:"list.add",list:this.descendVariable(A,"LIST","list"),item:this.descendInputOfBlock(A,"ITEM")};case"data_changevariableby":{const B=this.descendVariable(A,"VARIABLE","");return{kind:"var.set",variable:B,value:{kind:"op.add",left:{kind:"var.get",variable:B},right:this.descendInputOfBlock(A,"VALUE")}}}case"data_deletealloflist":return{kind:"list.deleteAll",list:this.descendVariable(A,"LIST","list")};case"data_deleteoflist":{const B=this.descendInputOfBlock(A,"INDEX");return"constant"===B.kind&&"all"===B.value?{kind:"list.deleteAll",list:this.descendVariable(A,"LIST","list")}:{kind:"list.delete",list:this.descendVariable(A,"LIST","list"),index:B}}case"data_hidelist":return{kind:"list.hide",list:this.descendVariable(A,"LIST","list")};case"data_hidevariable":return{kind:"var.hide",variable:this.descendVariable(A,"VARIABLE","")};case"data_insertatlist":return{kind:"list.insert",list:this.descendVariable(A,"LIST","list"),index:this.descendInputOfBlock(A,"INDEX"),item:this.descendInputOfBlock(A,"ITEM")};case"data_replaceitemoflist":return{kind:"list.replace",list:this.descendVariable(A,"LIST","list"),index:this.descendInputOfBlock(A,"INDEX"),item:this.descendInputOfBlock(A,"ITEM")};case"data_setvariableto":return{kind:"var.set",variable:this.descendVariable(A,"VARIABLE",""),value:this.descendInputOfBlock(A,"VALUE")};case"data_showlist":return{kind:"list.show",list:this.descendVariable(A,"LIST","list")};case"data_showvariable":return{kind:"var.show",variable:this.descendVariable(A,"VARIABLE","")};case"event_broadcast":return{kind:"event.broadcast",broadcast:this.descendInputOfBlock(A,"BROADCAST_INPUT")};case"event_broadcastandwait":return this.script.yields=!0,{kind:"event.broadcastAndWait",broadcast:this.descendInputOfBlock(A,"BROADCAST_INPUT")};case"looks_changeeffectby":return{kind:"looks.changeEffect",effect:A.fields.EFFECT.value.toLowerCase(),value:this.descendInputOfBlock(A,"CHANGE")};case"looks_changesizeby":return{kind:"looks.changeSize",size:this.descendInputOfBlock(A,"CHANGE")};case"looks_cleargraphiceffects":return{kind:"looks.clearEffects"};case"looks_goforwardbackwardlayers":return"forward"===A.fields.FORWARD_BACKWARD.value?{kind:"looks.forwardLayers",layers:this.descendInputOfBlock(A,"NUM")}:{kind:"looks.backwardLayers",layers:this.descendInputOfBlock(A,"NUM")};case"looks_gotofrontback":return"front"===A.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:A.fields.EFFECT.value.toLowerCase(),value:this.descendInputOfBlock(A,"VALUE")};case"looks_setsizeto":return{kind:"looks.setSize",size:this.descendInputOfBlock(A,"SIZE")};case"looks_show":return{kind:"looks.show"};case"looks_switchbackdropto":return{kind:"looks.switchBackdrop",backdrop:this.descendInputOfBlock(A,"BACKDROP")};case"looks_switchcostumeto":return{kind:"looks.switchCostume",costume:this.descendInputOfBlock(A,"COSTUME")};case"motion_changexby":return{kind:"motion.setXY",x:{kind:"op.add",left:{kind:"motion.x"},right:this.descendInputOfBlock(A,"DX")},y:{kind:"motion.y"}};case"motion_changeyby":return{kind:"motion.setXY",x:{kind:"motion.x"},y:{kind:"op.add",left:{kind:"motion.y"},right:this.descendInputOfBlock(A,"DY")}};case"motion_gotoxy":return{kind:"motion.setXY",x:this.descendInputOfBlock(A,"X"),y:this.descendInputOfBlock(A,"Y")};case"motion_ifonedgebounce":return{kind:"motion.ifOnEdgeBounce"};case"motion_movesteps":return{kind:"motion.step",steps:this.descendInputOfBlock(A,"STEPS")};case"motion_pointindirection":return{kind:"motion.setDirection",direction:this.descendInputOfBlock(A,"DIRECTION")};case"motion_setrotationstyle":return{kind:"motion.setRotationStyle",style:A.fields.STYLE.value};case"motion_setx":return{kind:"motion.setXY",x:this.descendInputOfBlock(A,"X"),y:{kind:"motion.y"}};case"motion_sety":return{kind:"motion.setXY",x:{kind:"motion.x"},y:this.descendInputOfBlock(A,"Y")};case"motion_turnleft":return{kind:"motion.setDirection",direction:{kind:"op.subtract",left:{kind:"motion.direction"},right:this.descendInputOfBlock(A,"DEGREES")}};case"motion_turnright":return{kind:"motion.setDirection",direction:{kind:"op.add",left:{kind:"motion.direction"},right:this.descendInputOfBlock(A,"DEGREES")}};case"pen_clear":return{kind:"pen.clear"};case"pen_changePenColorParamBy":return{kind:"pen.changeParam",param:this.descendInputOfBlock(A,"COLOR_PARAM"),value:this.descendInputOfBlock(A,"VALUE")};case"pen_changePenHueBy":return{kind:"pen.legacyChangeHue",hue:this.descendInputOfBlock(A,"HUE")};case"pen_changePenShadeBy":return{kind:"pen.legacyChangeShade",shade:this.descendInputOfBlock(A,"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(A,"COLOR_PARAM"),value:this.descendInputOfBlock(A,"VALUE")};case"pen_setPenColorToColor":return{kind:"pen.setColor",color:this.descendInputOfBlock(A,"COLOR")};case"pen_setPenHueToNumber":return{kind:"pen.legacySetHue",hue:this.descendInputOfBlock(A,"HUE")};case"pen_setPenShadeToNumber":return{kind:"pen.legacySetShade",shade:this.descendInputOfBlock(A,"SHADE")};case"pen_setPenSizeTo":return{kind:"pen.setSize",size:this.descendInputOfBlock(A,"SIZE")};case"pen_changePenSizeBy":return{kind:"pen.changeSize",size:this.descendInputOfBlock(A,"SIZE")};case"pen_stamp":return{kind:"pen.stamp"};case"procedures_call":{const B=A.mutation.proccode;if("tw:debugger;"===B)return{kind:"tw.debugger"};const t=this.blocks.getProcedureParamNamesIdsAndDefaults(B);if(null===t)return{kind:"noop"};const[e,g,i]=t;if(this.runtime.getAddonBlock(B)){this.script.yields=!0;const t={};for(let B=0;B0;){this.compilingProcedures=this.proceduresToCompile,this.proceduresToCompile=new Map;for(const[A,B]of this.compilingProcedures.entries()){const t=this.blocks.getBlock(B),e=this.blocks.getBlock(t.inputs.custom_block.block);let g=!1;if(e&&e.mutation){const A=e.mutation.warp;"boolean"==typeof A?g=A:"string"==typeof A&&(g=JSON.parse(A))}if(this.blocks._cache.compiledProcedures[A]){const B=this.blocks._cache.compiledProcedures[A];this.procedures[A]=B,this.addProcedureDependencies(B.dependedProcedures)}else{const t=new o(this.thread);t.setProcedureCode(A),g&&t.enableWarp();const e=this.generateScriptTree(t,B);this.procedures[A]=e,this.blocks._cache.compiledProcedures[A]=e}}}for(;this.analyzeScript(A););const B=new r;return B.entry=A,B.procedures=this.procedures,B}}},function(A,B){A.exports={stacked:["control_clear_counter","control_incr_counter","looks_changestretchby","looks_say","looks_sayforsecs","looks_setstretchto","looks_switchbackdroptoandwait","looks_think","looks_thinkforsecs","motion_glidesecstoxy","motion_glideto","motion_goto","motion_pointtowards","sensing_askandwait","sensing_setdragmode","sound_changeeffectby","sound_changevolumeby","sound_cleareffects","sound_play","sound_playuntildone","sound_seteffectto","sound_setvolumeto","sound_stopallsounds"],inputs:["control_get_counter","sensing_loud","sensing_loudness","sound_volume"]}},function(A,B,t){const e=t(0),g=t(1),i=t(304),Q=t(120),{disableToString:n}=t(306),s=t(307),{IntermediateScript:r,IntermediateRepresentation:c}=t(119),E=A=>("string"!=typeof A&&(e.warn("sanitize got unexpected type: ".concat(typeof A)),A=""+A),JSON.stringify(A).slice(1,-1)),o="runtime.ext_pen",w="".concat(o,"._getPenState(target)"),C=new i("factory"),a=new i("fun"),I=new i("gen");class h{constructor(A,B){if("number"!=typeof B)throw new Error("type is invalid");this.source=A,this.type=B}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,")")}asUnknown(){return this.source}asSafe(){return this.asUnknown()}isAlwaysNumber(){return 1===this.type}isNeverNumber(){return!1}}class Y{constructor(A,B){this.constantValue=A,this.safe=B}asNumber(){const A=+this.constantValue;return A?A.toString():"0"}asNumberOrNaN(){return this.asNumber()}asString(){return'"'.concat(E(""+this.constantValue),'"')}asBoolean(){return g.toBoolean(this.constantValue).toString()}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 A=+this.constantValue;return!Number.isNaN(A)&&(0!==A||""!==this.constantValue.toString().trim())}isNeverNumber(){return Number.isNaN(+this.constantValue)}}class M{constructor(A){this.source=A,this.type=4,this._value=null}setInput(A){if(A instanceof M){if(!A._value)return this.type=4,void(this._value=null);A=A._value}this._value=A,this.type=A instanceof h?A.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,")")}asUnknown(){return this.source}asSafe(){return this.asUnknown()}isAlwaysNumber(){return!!this._value&&this._value.isAlwaysNumber()}isNeverNumber(){return!!this._value&&this._value.isNeverNumber()}}n(Y.prototype),n(Y.prototype.asNumber),n(Y.prototype.asString),n(Y.prototype.asBoolean),n(Y.prototype.asUnknown),n(Y.prototype.asSafe),n(h.prototype),n(h.prototype.asNumber),n(h.prototype.asString),n(h.prototype.asBoolean),n(h.prototype.asUnknown),n(h.prototype.asSafe);const F=A=>{const B=+A.constantValue;return!!B&&B.toString()===A.constantValue.toString()};class D{constructor(A){this.isLoop=A,this.isLastBlock=!1}}A.exports=class{constructor(A,B,t){this.script=A,this.ir=B,this.target=t,this.source="",this.variableInputs={},this.isWarp=A.isWarp,this.isProcedure=A.isProcedure,this.warpTimer=A.warpTimer,this.frames=[],this.currentFrame=null,this.namesOfCostumesAndSounds=(A=>{const B=new Set;for(const t of A.targets)if(t.isOriginal){const A=t.sprite;for(const t of A.costumes)B.add(t.name);for(const t of A.sounds)B.add(t.name)}return B})(t.runtime),this.localVariables=new i("a"),this._setupVariablesPool=new i("b"),this._setupVariables={},this.descendedIntoModulo=!1,this.debug=this.target.runtime.debug}pushFrame(A){this.frames.push(A),this.frame=A}popFrame(){this.frames.pop(),this.frame=this.frames[this.frames.length-1]}isLastBlockInLoop(){for(let A=this.frames.length-1;A>=0;A--){const B=this.frames[A];if(!B.isLastBlock)return!1;if(B.isLoop)return!0}return!1}descendInput(A){switch(A.kind){case"args.boolean":return new h("toBoolean(p".concat(A.index,")"),3);case"args.stringNumber":return new h("p".concat(A.index),4);case"compat":return new h("(".concat(this.generateCompatibilityLayerCall(A,!1),")"),4);case"constant":return this.safeConstantInput(A.value);case"keyboard.pressed":return new h("runtime.ioDevices.keyboard.getKeyIsDown(".concat(this.descendInput(A.key).asSafe(),")"),3);case"list.contains":return new h("listContains(".concat(this.referenceVariable(A.list),", ").concat(this.descendInput(A.item).asUnknown(),")"),3);case"list.contents":return new h("listContents(".concat(this.referenceVariable(A.list),")"),2);case"list.get":{const B=this.descendInput(A.index);if(s.supportsNullishCoalescing){if(B.isAlwaysNumber())return new h("(".concat(this.referenceVariable(A.list),".value[(").concat(B.asNumber(),' | 0) - 1] ?? "")'),4);if(B instanceof Y&&"last"===B.constantValue)return new h("(".concat(this.referenceVariable(A.list),".value[").concat(this.referenceVariable(A.list),'.value.length - 1] ?? "")'),4)}return new h("listGet(".concat(this.referenceVariable(A.list),".value, ").concat(B.asUnknown(),")"),4)}case"list.indexOf":return new h("listIndexOf(".concat(this.referenceVariable(A.list),", ").concat(this.descendInput(A.item).asUnknown(),")"),1);case"list.length":return new h("".concat(this.referenceVariable(A.list),".value.length"),1);case"looks.size":return new h("Math.round(target.size)",1);case"looks.backdropName":return new h("stage.getCostumes()[stage.currentCostume].name",2);case"looks.backdropNumber":return new h("(stage.currentCostume + 1)",1);case"looks.costumeName":return new h("target.getCostumes()[target.currentCostume].name",2);case"looks.costumeNumber":return new h("(target.currentCostume + 1)",1);case"motion.direction":return new h("target.direction",1);case"motion.x":return new h("target.x",1);case"motion.y":return new h("target.y",1);case"mouse.down":return new h("runtime.ioDevices.mouse.getIsDown()",3);case"mouse.x":return new h("runtime.ioDevices.mouse.getScratchX()",1);case"mouse.y":return new h("runtime.ioDevices.mouse.getScratchY()",1);case"op.abs":return new h("Math.abs(".concat(this.descendInput(A.value).asNumber(),")"),1);case"op.acos":return new h("((Math.acos(".concat(this.descendInput(A.value).asNumber(),") * 180) / Math.PI)"),5);case"op.add":return new h("(".concat(this.descendInput(A.left).asNumber()," + ").concat(this.descendInput(A.right).asNumber(),")"),1);case"op.and":return new h("(".concat(this.descendInput(A.left).asBoolean()," && ").concat(this.descendInput(A.right).asBoolean(),")"),3);case"op.asin":return new h("((Math.asin(".concat(this.descendInput(A.value).asNumber(),") * 180) / Math.PI)"),5);case"op.atan":return new h("((Math.atan(".concat(this.descendInput(A.value).asNumber(),") * 180) / Math.PI)"),1);case"op.ceiling":return new h("Math.ceil(".concat(this.descendInput(A.value).asNumber(),")"),1);case"op.contains":return new h("(".concat(this.descendInput(A.string).asString(),".toLowerCase().indexOf(").concat(this.descendInput(A.contains).asString(),".toLowerCase()) !== -1)"),3);case"op.cos":return new h("(Math.round(Math.cos((Math.PI * ".concat(this.descendInput(A.value).asNumber(),") / 180) * 1e10) / 1e10)"),1);case"op.divide":return new h("(".concat(this.descendInput(A.left).asNumber()," / ").concat(this.descendInput(A.right).asNumber(),")"),5);case"op.equals":{const B=this.descendInput(A.left),t=this.descendInput(A.right);if(B.isNeverNumber()||t.isNeverNumber())return new h("(".concat(B.asString(),".toLowerCase() === ").concat(t.asString(),".toLowerCase())"),3);const e=B.isAlwaysNumber(),g=t.isAlwaysNumber();return e&&g||(e&&B instanceof Y&&F(B)||g&&t instanceof Y&&F(t))?new h("(".concat(B.asNumber()," === ").concat(t.asNumber(),")"),3):new h("compareEqual(".concat(B.asUnknown(),", ").concat(t.asUnknown(),")"),3)}case"op.e^":return new h("(Math.E ** ".concat(this.descendInput(A.value).asNumber(),")"),1);case"op.floor":return new h("Math.floor(".concat(this.descendInput(A.value).asNumber(),")"),1);case"op.greater":{const B=this.descendInput(A.left),t=this.descendInput(A.right);return B.isNeverNumber()||t.isNeverNumber()?new h("(".concat(B.asString(),".toLowerCase() > ").concat(t.asString(),".toLowerCase())"),3):B.isAlwaysNumber()&&t.isAlwaysNumber()?new h("(".concat(B.asNumber()," > ").concat(t.asNumber(),")"),3):new h("compareGreaterThan(".concat(B.asUnknown(),", ").concat(t.asUnknown(),")"),3)}case"op.join":return new h("(".concat(this.descendInput(A.left).asString()," + ").concat(this.descendInput(A.right).asString(),")"),2);case"op.length":return new h("".concat(this.descendInput(A.string).asString(),".length"),1);case"op.less":{const B=this.descendInput(A.left),t=this.descendInput(A.right);return B.isNeverNumber()||t.isNeverNumber()?new h("(".concat(B.asString(),".toLowerCase() < ").concat(t.asString(),".toLowerCase())"),3):B.isAlwaysNumber()&&t.isAlwaysNumber()?new h("(".concat(B.asNumber()," < ").concat(t.asNumber(),")"),3):new h("compareLessThan(".concat(B.asUnknown(),", ").concat(t.asUnknown(),")"),3)}case"op.letterOf":return new h("((".concat(this.descendInput(A.string).asString(),")[(").concat(this.descendInput(A.letter).asNumber(),' | 0) - 1] || "")'),2);case"op.ln":return new h("Math.log(".concat(this.descendInput(A.value).asNumber(),")"),5);case"op.log":return new h("(Math.log(".concat(this.descendInput(A.value).asNumber(),") / Math.LN10)"),5);case"op.mod":return this.descendedIntoModulo=!0,new h("mod(".concat(this.descendInput(A.left).asNumber(),", ").concat(this.descendInput(A.right).asNumber(),")"),5);case"op.multiply":return new h("(".concat(this.descendInput(A.left).asNumber()," * ").concat(this.descendInput(A.right).asNumber(),")"),5);case"op.not":return new h("!".concat(this.descendInput(A.operand).asBoolean()),3);case"op.or":return new h("(".concat(this.descendInput(A.left).asBoolean()," || ").concat(this.descendInput(A.right).asBoolean(),")"),3);case"op.random":return A.useInts?new h("randomInt(".concat(this.descendInput(A.low).asNumber(),", ").concat(this.descendInput(A.high).asNumber(),")"),1):A.useFloats?new h("randomFloat(".concat(this.descendInput(A.low).asNumber(),", ").concat(this.descendInput(A.high).asNumber(),")"),1):new h("runtime.ext_scratch3_operators._random(".concat(this.descendInput(A.low).asUnknown(),", ").concat(this.descendInput(A.high).asUnknown(),")"),1);case"op.round":return new h("Math.round(".concat(this.descendInput(A.value).asNumber(),")"),1);case"op.sin":return new h("(Math.round(Math.sin((Math.PI * ".concat(this.descendInput(A.value).asNumber(),") / 180) * 1e10) / 1e10)"),1);case"op.sqrt":return new h("Math.sqrt(".concat(this.descendInput(A.value).asNumber(),")"),5);case"op.subtract":return new h("(".concat(this.descendInput(A.left).asNumber()," - ").concat(this.descendInput(A.right).asNumber(),")"),1);case"op.tan":return new h("Math.tan(".concat(this.descendInput(A.value).asNumber()," * Math.PI / 180)"),1);case"op.10^":return new h("(10 ** ".concat(this.descendInput(A.value).asNumber(),")"),1);case"sensing.answer":return new h("runtime.ext_scratch3_sensing._answer",2);case"sensing.colorTouchingColor":return new h("target.colorIsTouchingColor(colorToList(".concat(this.descendInput(A.target).asUnknown(),"), colorToList(").concat(this.descendInput(A.mask).asUnknown(),"))"),3);case"sensing.date":return new h("(new Date().getDate())",1);case"sensing.dayofweek":return new h("(new Date().getDay() + 1)",1);case"sensing.daysSince2000":return new h("daysSince2000()",1);case"sensing.distance":return new h("distance(".concat(this.descendInput(A.target).asString(),")"),1);case"sensing.hour":return new h("(new Date().getHours())",1);case"sensing.minute":return new h("(new Date().getMinutes())",1);case"sensing.month":return new h("(new Date().getMonth() + 1)",1);case"sensing.of":return new h("runtime.ext_scratch3_sensing.getAttributeOf({OBJECT: ".concat(this.descendInput(A.object).asString(),', PROPERTY: "').concat(E(A.property),'" })'),4);case"sensing.second":return new h("(new Date().getSeconds())",1);case"sensing.touching":return new h("target.isTouchingObject(".concat(this.descendInput(A.object).asUnknown(),")"),3);case"sensing.touchingColor":return new h("target.isTouchingColor(colorToList(".concat(this.descendInput(A.color).asUnknown(),"))"),3);case"sensing.username":return new h("runtime.ioDevices.userData.getUsername()",2);case"sensing.year":return new h("(new Date().getFullYear())",1);case"timer.get":return new h("runtime.ioDevices.clock.projectTimer()",1);case"tw.lastKeyPressed":return new h("runtime.ioDevices.keyboard.getLastKeyPressed()",2);case"var.get":return this.descendVariable(A.variable);default:throw e.warn("JS: Unknown input: ".concat(A.kind),A),new Error("JS: Unknown input: ".concat(A.kind))}}descendStackedBlock(A){switch(A.kind){case"addons.call":this.source+='yield* callAddonBlock("'.concat(E(A.code),'","').concat(E(A.blockId),'",{'),this.yielded();for(const B of Object.keys(A.arguments)){const t=A.arguments[B];this.source+='"'.concat(E(B),'":').concat(this.descendInput(t).asSafe(),",")}this.source+="});\n";break;case"compat":{const B=this.isLastBlockInLoop();this.source+="".concat(this.generateCompatibilityLayerCall(A,B),";\n"),B&&(this.source+="if (hasResumedFromPromise) {hasResumedFromPromise = false;continue;}\n");break}case"control.createClone":this.source+="runtime.ext_scratch3_control._createClone(".concat(this.descendInput(A.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 B=this.localVariables.next();this.source+="var ".concat(B," = 0; "),this.source+="while (".concat(B," < ").concat(this.descendInput(A.count).asNumber(),") { "),this.source+="".concat(B,"++; "),this.source+="".concat(this.referenceVariable(A.variable),".value = ").concat(B,";\n"),this.descendStack(A.do,new D(!0)),this.yieldLoop(),this.source+="}\n";break}case"control.if":this.source+="if (".concat(this.descendInput(A.condition).asBoolean(),") {\n"),this.descendStack(A.whenTrue,new D(!1)),A.whenFalse.length&&(this.source+="} else {\n",this.descendStack(A.whenFalse,new D(!1))),this.source+="}\n";break;case"control.repeat":{const B=this.localVariables.next();this.source+="for (var ".concat(B," = ").concat(this.descendInput(A.times).asNumber(),"; ").concat(B," >= 0.5; ").concat(B,"--) {\n"),this.descendStack(A.do,new D(!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.isProcedure?this.source+="return;\n":this.retire();break;case"control.wait":{const B=this.localVariables.next();this.source+="thread.timer = timer();\n",this.source+="var ".concat(B," = Math.max(0, 1000 * ").concat(this.descendInput(A.seconds).asNumber(),");\n"),this.requestRedraw(),this.yieldNotWarp(),this.source+="while (thread.timer.timeElapsed() < ".concat(B,") {\n"),this.yieldNotWarpOrStuck(),this.source+="}\n",this.source+="thread.timer = null;\n";break}case"control.waitUntil":this.resetVariableInputs(),this.source+="while (!".concat(this.descendInput(A.condition).asBoolean(),") {\n"),this.yieldNotWarpOrStuck(),this.source+="}\n";break;case"control.while":this.resetVariableInputs(),this.source+="while (".concat(this.descendInput(A.condition).asBoolean(),") {\n"),this.descendStack(A.do,new D(!0)),this.yieldLoop(),this.source+="}\n";break;case"event.broadcast":this.source+='startHats("event_whenbroadcastreceived", { BROADCAST_OPTION: '.concat(this.descendInput(A.broadcast).asString()," });\n"),this.resetVariableInputs();break;case"event.broadcastAndWait":this.source+='yield* waitThreads(startHats("event_whenbroadcastreceived", { BROADCAST_OPTION: '.concat(this.descendInput(A.broadcast).asString()," }));\n"),this.yielded();break;case"list.add":{const B=this.referenceVariable(A.list);this.source+="".concat(B,".value.push(").concat(this.descendInput(A.item).asSafe(),");\n"),this.source+="".concat(B,"._monitorUpToDate = false;\n");break}case"list.delete":{const B=this.referenceVariable(A.list),t=this.descendInput(A.index);if(t instanceof Y){if("last"===t.constantValue){this.source+="".concat(B,".value.pop();\n"),this.source+="".concat(B,"._monitorUpToDate = false;\n");break}if(1==+t.constantValue){this.source+="".concat(B,".value.shift();\n"),this.source+="".concat(B,"._monitorUpToDate = false;\n");break}}this.source+="listDelete(".concat(B,", ").concat(t.asUnknown(),");\n");break}case"list.deleteAll":this.source+="".concat(this.referenceVariable(A.list),".value = [];\n");break;case"list.hide":this.source+='runtime.monitorBlocks.changeBlock({ id: "'.concat(E(A.list.id),'", element: "checkbox", value: false }, runtime);\n');break;case"list.insert":{const B=this.referenceVariable(A.list),t=this.descendInput(A.index),e=this.descendInput(A.item);if(t instanceof Y&&1==+t.constantValue){this.source+="".concat(B,".value.unshift(").concat(e.asSafe(),");\n"),this.source+="".concat(B,"._monitorUpToDate = false;\n");break}this.source+="listInsert(".concat(B,", ").concat(t.asUnknown(),", ").concat(e.asSafe(),");\n");break}case"list.replace":this.source+="listReplace(".concat(this.referenceVariable(A.list),", ").concat(this.descendInput(A.index).asUnknown(),", ").concat(this.descendInput(A.item).asSafe(),");\n");break;case"list.show":this.source+='runtime.monitorBlocks.changeBlock({ id: "'.concat(E(A.list.id),'", element: "checkbox", value: true }, runtime);\n');break;case"looks.backwardLayers":this.source+="target.goBackwardLayers(".concat(this.descendInput(A.layers).asNumber(),");\n");break;case"looks.clearEffects":this.source+="target.clearEffects();\n";break;case"looks.changeEffect":this.target.effects.hasOwnProperty(A.effect)&&(this.source+='target.setEffect("'.concat(E(A.effect),'", runtime.ext_scratch3_looks.clampEffect("').concat(E(A.effect),'", ').concat(this.descendInput(A.value).asNumber(),' + target.effects["').concat(E(A.effect),'"]));\n'));break;case"looks.changeSize":this.source+="target.setSize(target.size + ".concat(this.descendInput(A.size).asNumber(),");\n");break;case"looks.forwardLayers":this.source+="target.goForwardLayers(".concat(this.descendInput(A.layers).asNumber(),");\n");break;case"looks.goToBack":this.source+="target.goToBack();\n";break;case"looks.goToFront":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":this.target.effects.hasOwnProperty(A.effect)&&(this.source+='target.setEffect("'.concat(E(A.effect),'", runtime.ext_scratch3_looks.clampEffect("').concat(E(A.effect),'", ').concat(this.descendInput(A.value).asNumber(),"));\n"));break;case"looks.setSize":this.source+="target.setSize(".concat(this.descendInput(A.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(A.backdrop).asSafe(),");\n");break;case"looks.switchCostume":this.source+="runtime.ext_scratch3_looks._setCostume(target, ".concat(this.descendInput(A.costume).asSafe(),");\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(A.direction).asNumber(),");\n");break;case"motion.setRotationStyle":this.source+='target.setRotationStyle("'.concat(E(A.style),'");\n');break;case"motion.setXY":this.descendedIntoModulo=!1,this.source+="target.setXY(".concat(this.descendInput(A.x).asNumber(),", ").concat(this.descendInput(A.y).asNumber(),");\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(A.steps).asNumber(),", target);\n");break;case"noop":break;case"pen.clear":this.source+="".concat(o,".clear();\n");break;case"pen.down":this.source+="".concat(o,"._penDown(target);\n");break;case"pen.changeParam":this.source+="".concat(o,"._setOrChangeColorParam(").concat(this.descendInput(A.param).asString(),", ").concat(this.descendInput(A.value).asNumber(),", ").concat(w,", true);\n");break;case"pen.changeSize":this.source+="".concat(o,"._changePenSizeBy(").concat(this.descendInput(A.size).asNumber(),", target);\n");break;case"pen.legacyChangeHue":this.source+="".concat(o,"._changePenHueBy(").concat(this.descendInput(A.hue).asNumber(),", target);\n");break;case"pen.legacyChangeShade":this.source+="".concat(o,"._changePenShadeBy(").concat(this.descendInput(A.shade).asNumber(),", target);\n");break;case"pen.legacySetHue":this.source+="".concat(o,"._setPenHueToNumber(").concat(this.descendInput(A.hue).asNumber(),", target);\n");break;case"pen.legacySetShade":this.source+="".concat(o,"._setPenShadeToNumber(").concat(this.descendInput(A.shade).asNumber(),", target);\n");break;case"pen.setColor":this.source+="".concat(o,"._setPenColorToColor(").concat(this.descendInput(A.color).asUnknown(),", target);\n");break;case"pen.setParam":this.source+="".concat(o,"._setOrChangeColorParam(").concat(this.descendInput(A.param).asString(),", ").concat(this.descendInput(A.value).asNumber(),", ").concat(w,", false);\n");break;case"pen.setSize":this.source+="".concat(o,"._setPenSizeTo(").concat(this.descendInput(A.size).asNumber(),", target);\n");break;case"pen.stamp":this.source+="".concat(o,"._stamp(target);\n");break;case"pen.up":this.source+="".concat(o,"._penUp(target);\n");break;case"procedures.call":{const B=A.code,t=this.ir.procedures[B];if(null===t.stack)break;const e=!this.isWarp&&t.isWarp;if(e?this.source+="thread.warp++;\n":B===this.script.procedureCode&&this.yieldNotWarp(),t.yields&&(this.source+="yield* ",!this.script.yields))throw new Error("Script uses yielding procedure but is not marked as yielding.");if(this.source+='thread.procedures["'.concat(E(B),'"]('),t.arguments.length){const B=[];for(const t of A.arguments)B.push(this.descendInput(t).asSafe());this.source+=B.join(",")}this.source+=");\n",e&&(this.source+="thread.warp--;\n"),this.resetVariableInputs();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(E(A.variable.id),'", element: "checkbox", value: false }, runtime);\n');break;case"var.set":{const B=this.descendVariable(A.variable),t=this.descendInput(A.value);B.setInput(t),this.source+="".concat(B.source," = ").concat(t.asSafe(),";\n"),A.variable.isCloud&&(this.source+='runtime.ioDevices.cloud.requestUpdateVariable("'.concat(E(A.variable.name),'", ').concat(B.source,");\n"));break}case"var.show":this.source+='runtime.monitorBlocks.changeBlock({ id: "'.concat(E(A.variable.id),'", element: "checkbox", value: true }, runtime);\n');break;case"visualReport":this.source+='runtime.visualReport("'.concat(E(this.script.topBlockId),'", ').concat(this.descendInput(A.input).asUnknown(),");\n");break;default:throw e.warn("JS: Unknown stacked block: ".concat(A.kind),A),new Error("JS: Unknown stacked block: ".concat(A.kind))}}resetVariableInputs(){this.variableInputs={}}descendStack(A,B){this.resetVariableInputs(),this.pushFrame(B);for(let t=0;t{A.toString=()=>{throw new Error("toString unexpectedly called on ".concat(A.name||"object"))}}}},function(A,B){A.exports={supportsNullishCoalescing:(()=>{try{new Function("undefined ?? 3");return!0}catch(A){return!1}})()}},function(A,B){A.exports={OUTPUT_SHAPE_HEXAGONAL:1,OUTPUT_SHAPE_ROUND:2,OUTPUT_SHAPE_SQUARE:3}},function(A,B){A.exports=class{constructor(A){this._type=A,this._onOpen=null,this._onClose=null,this._onError=null,this._handleMessage=null,this._ws=null}open(){switch(this._type){case"BLE":this._ws=new WebSocket("wss://device-manager.scratch.mit.edu:20110/scratch/ble");break;case"BT":this._ws=new WebSocket("wss://device-manager.scratch.mit.edu:20110/scratch/bt");break;default:throw new Error("Unknown ScratchLink socket Type: ".concat(this._type))}if(!(this._onOpen&&this._onClose&&this._onError&&this._handleMessage))throw new Error("Must set open, close, message and error handlers before calling open on the socket");this._ws.onopen=this._onOpen,this._ws.onclose=this._onClose,this._ws.onerror=this._onError,this._ws.onmessage=this._onMessage.bind(this)}close(){this._ws.close(),this._ws=null}sendMessage(A){const B=JSON.stringify(A);this._ws.send(B)}setOnOpen(A){this._onOpen=A}setOnClose(A){this._onClose=A}setOnError(A){this._onError=A}setHandleMessage(A){this._handleMessage=A}isOpen(){return this._ws&&this._ws.readyState===this._ws.OPEN}_onMessage(A){const B=JSON.parse(A.data);this._handleMessage(B)}}},function(A,B,t){const e=t(20);A.exports=class{constructor(A){this._projectTimer=new e({now:()=>A.currentMSecs}),this._projectTimer.start(),this._pausedTime=null,this._paused=!1,this.runtime=A}projectTimer(){return this._paused?this._pausedTime/1e3:this._projectTimer.timeElapsed()/1e3}pause(){this._paused=!0,this._pausedTime=this._projectTimer.timeElapsed()}resume(){this._paused=!1;const A=this._projectTimer.timeElapsed()-this._pausedTime;this._projectTimer.startTime+=A}resetProjectTimer(){this._projectTimer.start()}}},function(A,B,t){const e=t(13),g=t(0);A.exports=class{constructor(A){this.provider=null,this.runtime=A,this.stage=null}setProvider(A){this.provider=A}setStage(A){this.stage=A}postData(A){A.varUpdate&&this.updateCloudVariable(A.varUpdate)}requestCreateVariable(A){this.runtime.canAddCloudVariable()&&this.provider&&this.provider.createVariable(A.name,A.value)}requestUpdateVariable(A,B){this.provider&&this.provider.updateVariable(A,B)}requestRenameVariable(A,B){this.provider&&this.provider.renameVariable(A,B)}requestDeleteVariable(A){this.provider&&this.provider.deleteVariable(A)}updateCloudVariable(A){const B=A.name,t=this.stage.lookupVariableByNameAndType(B,e.SCALAR_TYPE);t&&t.isCloud?t.value=A.value:g.warn("Received an update for a cloud variable that does not exist: ".concat(B))}clear(){this.provider&&(this.provider.requestCloseConnection(),this.provider=null,this.stage=null)}}},function(A,B,t){const e=t(1),g={SPACE:"space",LEFT:"left arrow",UP:"up arrow",RIGHT:"right arrow",DOWN:"down arrow",ENTER:"enter",BACKSPACE:"backspace",DELETE:"delete",SHIFT:"shift",CAPS_LOCK:"caps lock",SCROLL_LOCK:"scroll lock",CONTROL:"control",ESCAPE:"escape",INSERT:"insert",HOME:"home",END:"end",PAGE_UP:"page up",PAGE_DOWN:"page down"},i=Object.keys(g).map(A=>g[A]);A.exports=class{constructor(A){this._keysPressed=[],this.runtime=A,this.lastKeyPressed="",this._numeralKeyCodesToStringKey=new Map}_keyStringToScratchKey(A){switch(A=e.toString(A)){case" ":return g.SPACE;case"ArrowLeft":case"Left":return g.LEFT;case"ArrowUp":case"Up":return g.UP;case"Right":case"ArrowRight":return g.RIGHT;case"Down":case"ArrowDown":return g.DOWN;case"Enter":return g.ENTER;case"Backspace":return g.BACKSPACE;case"Delete":return g.DELETE;case"Shift":return g.SHIFT;case"CapsLock":return g.CAPS_LOCK;case"ScrollLock":return g.SCROLL_LOCK;case"Control":return g.CONTROL;case"Escape":return g.ESCAPE;case"Insert":return g.INSERT;case"Home":return g.HOME;case"End":return g.END;case"PageUp":return g.PAGE_UP;case"PageDown":return g.PAGE_DOWN}return A.length>1?"":A}_keyArgToScratchKey(A){if("number"==typeof A){if(A>=48&&A<=90)return String.fromCharCode(A);switch(A){case 32:return g.SPACE;case 37:return g.LEFT;case 38:return g.UP;case 39:return g.RIGHT;case 40:return g.DOWN}}return A=e.toString(A),i.includes(A)?A:(A.length>1&&(A=A[0])," "===A?g.SPACE:"\r"===A?g.ENTER:""===A?g.ESCAPE:A.toUpperCase())}postData(A){if(!A.key)return;const B=this._keyStringToScratchKey(A.key),t=1===B.length?B.toUpperCase():B;if(""===t)return;const e=this._keysPressed.indexOf(t);if(A.isDown?(this.lastKeyPressed=B,this.runtime.emit("KEY_PRESSED",t),e<0&&this._keysPressed.push(t)):e>-1&&this._keysPressed.splice(e,1),A.hasOwnProperty("keyCode")){const B=A.keyCode;if(this._numeralKeyCodesToStringKey.has(B)){const A=this._numeralKeyCodesToStringKey.get(B);if(A!==t){const B=this._keysPressed.indexOf(A);-1!==B&&this._keysPressed.splice(B,1)}}this._numeralKeyCodesToStringKey.set(B,t)}}getKeyIsDown(A){if("any"===A)return this._keysPressed.length>0;const B=this._keyArgToScratchKey(A);return this._keysPressed.indexOf(B)>-1}getLastKeyPressed(){return this.lastKeyPressed}}},function(A,B,t){const e=t(4);A.exports=class{constructor(A){this._clientX=0,this._clientY=0,this._scratchX=0,this._scratchY=0,this._buttons=new Set,this.usesRightClickDown=!1,this._isDown=!1,this.runtime=A}_activateClickHats(A){this.runtime.startHats("event_whenthisspriteclicked",null,A),this.runtime.startHats("event_whenstageclicked",null,A)}_pickTarget(A,B){if(this.runtime.renderer){const t=this.runtime.renderer.pick(A,B);for(let A=0;A0&&A.x0&&A.y0))return;B.KEY_OPTION="down arrow"}this.runtime.startHats("event_whenkeypressed",B)}}},function(A,B){A.exports=class{constructor(){this._username=""}postData(A){this._username=A.username}getUsername(){return this._username}}},function(A,B,t){const e=t(1);A.exports=class{constructor(A){this.runtime=A,this._counter=0,this.runtime.on("RUNTIME_DISPOSED",this.clearCounter.bind(this))}getPrimitives(){return{control_repeat:this.repeat,control_repeat_until:this.repeatUntil,control_while:this.repeatWhile,control_for_each:this.forEach,control_forever:this.forever,control_wait:this.wait,control_wait_until:this.waitUntil,control_if:this.if,control_if_else:this.ifElse,control_stop:this.stop,control_create_clone_of:this.createClone,control_delete_this_clone:this.deleteClone,control_get_counter:this.getCounter,control_incr_counter:this.incrCounter,control_clear_counter:this.clearCounter,control_all_at_once:this.allAtOnce}}getHats(){return{control_start_as_clone:{restartExistingThreads:!1}}}repeat(A,B){const t=Math.round(e.toNumber(A.TIMES));void 0===B.stackFrame.loopCounter&&(B.stackFrame.loopCounter=t),B.stackFrame.loopCounter--,B.stackFrame.loopCounter>=0&&B.startBranch(1,!0)}repeatUntil(A,B){e.toBoolean(A.CONDITION)||B.startBranch(1,!0)}repeatWhile(A,B){e.toBoolean(A.CONDITION)&&B.startBranch(1,!0)}forEach(A,B){const t=B.target.lookupOrCreateVariable(A.VARIABLE.id,A.VARIABLE.name);void 0===B.stackFrame.index&&(B.stackFrame.index=0),B.stackFrame.index{this.runtime.startHats("event_whenkeypressed",{KEY_OPTION:A}),this.runtime.startHats("event_whenkeypressed",{KEY_OPTION:"any"})})}getPrimitives(){return{event_whentouchingobject:this.touchingObject,event_broadcast:this.broadcast,event_broadcastandwait:this.broadcastAndWait,event_whengreaterthan:this.hatGreaterThanPredicate}}getHats(){return{event_whenflagclicked:{restartExistingThreads:!0},event_whenkeypressed:{restartExistingThreads:!1},event_whenthisspriteclicked:{restartExistingThreads:!0},event_whentouchingobject:{restartExistingThreads:!1,edgeActivated:!0},event_whenstageclicked:{restartExistingThreads:!0},event_whenbackdropswitchesto:{restartExistingThreads:!0},event_whengreaterthan:{restartExistingThreads:!1,edgeActivated:!0},event_whenbroadcastreceived:{restartExistingThreads:!0}}}touchingObject(A,B){return B.target.isTouchingObject(A.TOUCHINGOBJECTMENU)}hatGreaterThanPredicate(A,B){const t=e.toString(A.WHENGREATERTHANMENU).toLowerCase(),g=e.toNumber(A.VALUE);switch(t){case"timer":return B.ioQuery("clock","projectTimer")>g;case"loudness":return this.runtime.audioEngine&&this.runtime.audioEngine.getLoudness()>g}return!1}broadcast(A,B){const t=B.runtime.getTargetForStage().lookupBroadcastMsg(A.BROADCAST_OPTION.id,A.BROADCAST_OPTION.name);if(t){const A=t.name;B.startHats("event_whenbroadcastreceived",{BROADCAST_OPTION:A})}}broadcastAndWait(A,B){if(B.stackFrame.broadcastVar||(B.stackFrame.broadcastVar=B.runtime.getTargetForStage().lookupBroadcastMsg(A.BROADCAST_OPTION.id,A.BROADCAST_OPTION.name)),B.stackFrame.broadcastVar){const A=B.stackFrame.broadcastVar.name;if(!B.stackFrame.startedThreads&&(B.stackFrame.startedThreads=B.startHats("event_whenbroadcastreceived",{BROADCAST_OPTION:A}),0===B.stackFrame.startedThreads.length))return;const t=this;B.stackFrame.startedThreads.some(A=>-1!==t.runtime.threads.indexOf(A))&&(B.stackFrame.startedThreads.every(A=>t.runtime.isWaitingThread(A))?B.yieldTick():B.yield())}}}},function(A,B,t){const e=t(1),g=t(18),i=t(40),Q=t(10),n=t(19),s=t(59),r=t(4);class c{constructor(A){this.runtime=A,this._onTargetChanged=this._onTargetChanged.bind(this),this._onResetBubbles=this._onResetBubbles.bind(this),this._onTargetWillExit=this._onTargetWillExit.bind(this),this._updateBubble=this._updateBubble.bind(this),this.runtime.on("PROJECT_STOP_ALL",this._onResetBubbles),this.runtime.on("targetWasRemoved",this._onTargetWillExit),this.runtime.on(c.SAY_OR_THINK,this._updateBubble)}static get DEFAULT_BUBBLE_STATE(){return{drawableId:null,onSpriteRight:!0,skinId:null,text:"",type:"say",usageId:null}}static get STATE_KEY(){return"Scratch.looks"}static get SAY_OR_THINK(){return"SAY"}static get SAY_BUBBLE_LIMIT(){return 330}static get EFFECT_GHOST_LIMIT(){return{min:0,max:100}}static get EFFECT_BRIGHTNESS_LIMIT(){return{min:-100,max:100}}_getBubbleState(A){let B=A.getCustomState(c.STATE_KEY);return B||(B=g.simple(c.DEFAULT_BUBBLE_STATE),A.setCustomState(c.STATE_KEY,B)),B}_onTargetChanged(A){this._getBubbleState(A).drawableId&&this._positionBubble(A)}_onTargetWillExit(A){const B=this._getBubbleState(A);B.drawableId&&B.skinId&&(this.runtime.renderer.destroyDrawable(B.drawableId,n.SPRITE_LAYER),this.runtime.renderer.destroySkin(B.skinId),B.drawableId=null,B.skinId=null,this.runtime.requestRedraw()),A.removeListener(i.EVENT_TARGET_VISUAL_CHANGE,this._onTargetChanged)}_onResetBubbles(){for(let A=0;AQ.right&&g.left-t>Q.left?(B.onSpriteRight=!1,this._renderBubble(A)):!B.onSpriteRight&&g.left-t=.01&&A%1!=0&&(A=A.toFixed(2)),A=String(A).substr(0,c.SAY_BUBBLE_LIMIT))}_updateBubble(A,B,t){const e=this._getBubbleState(A);e.type=B,e.text=this._formatBubbleText(t),e.usageId=Q(),this._renderBubble(A)}getPrimitives(){return{looks_say:this.say,looks_sayforsecs:this.sayforsecs,looks_think:this.think,looks_thinkforsecs:this.thinkforsecs,looks_show:this.show,looks_hide:this.hide,looks_hideallsprites:()=>{},looks_switchcostumeto:this.switchCostume,looks_switchbackdropto:this.switchBackdrop,looks_switchbackdroptoandwait:this.switchBackdropAndWait,looks_nextcostume:this.nextCostume,looks_nextbackdrop:this.nextBackdrop,looks_changeeffectby:this.changeEffect,looks_seteffectto:this.setEffect,looks_cleargraphiceffects:this.clearEffects,looks_changesizeby:this.changeSize,looks_setsizeto:this.setSize,looks_changestretchby:()=>{},looks_setstretchto:()=>{},looks_gotofrontback:this.goToFrontBack,looks_goforwardbackwardlayers:this.goForwardBackwardLayers,looks_size:this.getSize,looks_costumenumbername:this.getCostumeNumberName,looks_backdropnumbername:this.getBackdropNumberName}}getMonitored(){return{looks_size:{isSpriteSpecific:!0,getId:A=>"".concat(A,"_size")},looks_costumenumbername:{isSpriteSpecific:!0,getId:(A,B)=>s("".concat(A,"_costumenumbername"),B)},looks_backdropnumbername:{getId:(A,B)=>s("backdropnumbername",B)}}}say(A,B){const t=A.MESSAGE;this._say(t,B.target)}_say(A,B){this.runtime.emit(c.SAY_OR_THINK,B,"say",A)}sayforsecs(A,B){this.say(A,B);const t=B.target,e=this._getBubbleState(t).usageId;return new Promise(B=>{this._bubbleTimeout=setTimeout(()=>{this._bubbleTimeout=null,this._getBubbleState(t).usageId===e&&this._updateBubble(t,"say",""),B()},1e3*A.SECS)})}think(A,B){this.runtime.emit(c.SAY_OR_THINK,B.target,"think",A.MESSAGE)}thinkforsecs(A,B){this.think(A,B);const t=B.target,e=this._getBubbleState(t).usageId;return new Promise(B=>{this._bubbleTimeout=setTimeout(()=>{this._bubbleTimeout=null,this._getBubbleState(t).usageId===e&&this._updateBubble(t,"think",""),B()},1e3*A.SECS)})}show(A,B){B.target.setVisible(!0),this._renderBubble(B.target)}hide(A,B){B.target.setVisible(!1),this._renderBubble(B.target)}_setCostume(A,B,t){if("number"==typeof B)A.setCostume(t?B:B-1);else{const g=A.getCostumeIndexByName(B.toString());-1!==g?A.setCostume(g):"next costume"===B?A.setCostume(A.currentCostume+1):"previous costume"===B?A.setCostume(A.currentCostume-1):isNaN(B)||e.isWhiteSpace(B)||A.setCostume(t?Number(B):Number(B)-1)}return[]}_setBackdrop(A,B,t){if("number"==typeof B)A.setCostume(t?B:B-1);else{const g=A.getCostumeIndexByName(B.toString());if(-1!==g)A.setCostume(g);else if("next backdrop"===B)A.setCostume(A.currentCostume+1);else if("previous backdrop"===B)A.setCostume(A.currentCostume-1);else if("random backdrop"===B){const B=A.getCostumes().length;if(B>1){const t=0,e=B-1,g=A.currentCostume,i=r.inclusiveRandIntWithout(t,e,g);A.setCostume(i)}}else isNaN(B)||e.isWhiteSpace(B)||A.setCostume(t?Number(B):Number(B)-1)}const g=A.getCostumes()[A.currentCostume].name;return this.runtime.startHats("event_whenbackdropswitchesto",{BACKDROP:g})}switchCostume(A,B){this._setCostume(B.target,A.COSTUME)}nextCostume(A,B){this._setCostume(B.target,B.target.currentCostume+1,!0)}switchBackdrop(A){this._setBackdrop(this.runtime.getTargetForStage(),A.BACKDROP)}switchBackdropAndWait(A,B){if(!B.stackFrame.startedThreads&&(B.stackFrame.startedThreads=this._setBackdrop(this.runtime.getTargetForStage(),A.BACKDROP),0===B.stackFrame.startedThreads.length))return;const t=this;B.stackFrame.startedThreads.some(A=>-1!==t.runtime.threads.indexOf(A))&&(B.stackFrame.startedThreads.every(A=>t.runtime.isWaitingThread(A))?B.yieldTick():B.yield())}nextBackdrop(){const A=this.runtime.getTargetForStage();this._setBackdrop(A,A.currentCostume+1,!0)}clampEffect(A,B){let t=B;switch(A){case"ghost":t=r.clamp(B,c.EFFECT_GHOST_LIMIT.min,c.EFFECT_GHOST_LIMIT.max);break;case"brightness":t=r.clamp(B,c.EFFECT_BRIGHTNESS_LIMIT.min,c.EFFECT_BRIGHTNESS_LIMIT.max)}return t}changeEffect(A,B){const t=e.toString(A.EFFECT).toLowerCase(),g=e.toNumber(A.CHANGE);if(!B.target.effects.hasOwnProperty(t))return;let i=g+B.target.effects[t];i=this.clampEffect(t,i),B.target.setEffect(t,i)}setEffect(A,B){const t=e.toString(A.EFFECT).toLowerCase();let g=e.toNumber(A.VALUE);g=this.clampEffect(t,g),B.target.setEffect(t,g)}clearEffects(A,B){B.target.clearEffects()}changeSize(A,B){const t=e.toNumber(A.CHANGE);B.target.setSize(B.target.size+t)}setSize(A,B){const t=e.toNumber(A.SIZE);B.target.setSize(t)}goToFrontBack(A,B){B.target.isStage||("front"===A.FRONT_BACK?B.target.goToFront():B.target.goToBack())}goForwardBackwardLayers(A,B){B.target.isStage||("forward"===A.FORWARD_BACKWARD?B.target.goForwardLayers(e.toNumber(A.NUM)):B.target.goBackwardLayers(e.toNumber(A.NUM)))}getSize(A,B){return Math.round(B.target.size)}getBackdropNumberName(A){const B=this.runtime.getTargetForStage();return"number"===A.NUMBER_NAME?B.currentCostume+1:B.getCostumes()[B.currentCostume].name}getCostumeNumberName(A,B){return"number"===A.NUMBER_NAME?B.target.currentCostume+1:B.target.getCostumes()[B.target.currentCostume].name}}A.exports=c},function(A,B,t){const e=t(1),g=t(4),i=t(20);A.exports=class{constructor(A){this.runtime=A}getPrimitives(){return{motion_movesteps:this.moveSteps,motion_gotoxy:this.goToXY,motion_goto:this.goTo,motion_turnright:this.turnRight,motion_turnleft:this.turnLeft,motion_pointindirection:this.pointInDirection,motion_pointtowards:this.pointTowards,motion_glidesecstoxy:this.glide,motion_glideto:this.glideTo,motion_ifonedgebounce:this.ifOnEdgeBounce,motion_setrotationstyle:this.setRotationStyle,motion_changexby:this.changeX,motion_setx:this.setX,motion_changeyby:this.changeY,motion_sety:this.setY,motion_xposition:this.getX,motion_yposition:this.getY,motion_direction:this.getDirection,motion_scroll_right:()=>{},motion_scroll_up:()=>{},motion_align_scene:()=>{},motion_xscroll:()=>{},motion_yscroll:()=>{}}}getMonitored(){return{motion_xposition:{isSpriteSpecific:!0,getId:A=>"".concat(A,"_xposition")},motion_yposition:{isSpriteSpecific:!0,getId:A=>"".concat(A,"_yposition")},motion_direction:{isSpriteSpecific:!0,getId:A=>"".concat(A,"_direction")}}}moveSteps(A,B){const t=e.toNumber(A.STEPS);this._moveSteps(t,B.target)}_moveSteps(A,B){const t=g.degToRad(90-B.direction),e=A*Math.cos(t),i=A*Math.sin(t);B.setXY(B.x+e,B.y+i)}goToXY(A,B){const t=e.toNumber(A.X),g=e.toNumber(A.Y);B.target.setXY(t,g)}getTargetXY(A,B){let t=0,g=0;if("_mouse_"===A)t=B.ioQuery("mouse","getScratchX"),g=B.ioQuery("mouse","getScratchY");else if("_random_"===A){const A=this.runtime.stageWidth,B=this.runtime.stageHeight;t=Math.round(A*(Math.random()-.5)),g=Math.round(B*(Math.random()-.5))}else{A=e.toString(A);const B=this.runtime.getSpriteTargetByName(A);if(!B)return;t=B.x,g=B.y}return[t,g]}goTo(A,B){const t=this.getTargetXY(A.TO,B);t&&B.target.setXY(t[0],t[1])}turnRight(A,B){const t=e.toNumber(A.DEGREES);B.target.setDirection(B.target.direction+t)}turnLeft(A,B){const t=e.toNumber(A.DEGREES);B.target.setDirection(B.target.direction-t)}pointInDirection(A,B){const t=e.toNumber(A.DIRECTION);B.target.setDirection(t)}pointTowards(A,B){let t=0,i=0;if("_mouse_"===A.TOWARDS)t=B.ioQuery("mouse","getScratchX"),i=B.ioQuery("mouse","getScratchY");else{if("_random_"===A.TOWARDS)return void B.target.setDirection(Math.round(360*Math.random())-180);{A.TOWARDS=e.toString(A.TOWARDS);const B=this.runtime.getSpriteTargetByName(A.TOWARDS);if(!B)return;t=B.x,i=B.y}}const Q=t-B.target.x,n=i-B.target.y,s=90-g.radToDeg(Math.atan2(n,Q));B.target.setDirection(s)}glide(A,B){if(B.stackFrame.timer){const A=B.stackFrame.timer.timeElapsed();if(A<1e3*B.stackFrame.duration){const t=A/(1e3*B.stackFrame.duration),e=t*(B.stackFrame.endX-B.stackFrame.startX),g=t*(B.stackFrame.endY-B.stackFrame.startY);B.target.setXY(B.stackFrame.startX+e,B.stackFrame.startY+g),B.yield()}else B.target.setXY(B.stackFrame.endX,B.stackFrame.endY)}else{if(B.stackFrame.timer=new i,B.stackFrame.timer.start(),B.stackFrame.duration=e.toNumber(A.SECS),B.stackFrame.startX=B.target.x,B.stackFrame.startY=B.target.y,B.stackFrame.endX=e.toNumber(A.X),B.stackFrame.endY=e.toNumber(A.Y),B.stackFrame.duration<=0)return void B.target.setXY(B.stackFrame.endX,B.stackFrame.endY);B.yield()}}glideTo(A,B){const t=this.getTargetXY(A.TO,B);t&&this.glide({SECS:A.SECS,X:t[0],Y:t[1]},B)}ifOnEdgeBounce(A,B){this._ifOnEdgeBounce(B.target)}_ifOnEdgeBounce(A){const B=A.getBounds();if(!B)return;const t=this.runtime.stageWidth,e=this.runtime.stageHeight,i=Math.max(0,t/2+B.left),Q=Math.max(0,e/2-B.top),n=Math.max(0,t/2-B.right),s=Math.max(0,e/2+B.bottom);let r="",c=1/0;if(i0)return;const E=g.degToRad(90-A.direction);let o=Math.cos(E),w=-Math.sin(E);"left"===r?o=Math.max(.2,Math.abs(o)):"top"===r?w=Math.max(.2,Math.abs(w)):"right"===r?o=0-Math.max(.2,Math.abs(o)):"bottom"===r&&(w=0-Math.max(.2,Math.abs(w)));const C=g.radToDeg(Math.atan2(w,o))+90;A.setDirection(C);const a=A.keepInFence(A.x,A.y);A.setXY(a[0],a[1])}setRotationStyle(A,B){B.target.setRotationStyle(A.STYLE)}changeX(A,B){const t=e.toNumber(A.DX);B.target.setXY(B.target.x+t,B.target.y)}setX(A,B){const t=e.toNumber(A.X);B.target.setXY(t,B.target.y)}changeY(A,B){const t=e.toNumber(A.DY);B.target.setXY(B.target.x,B.target.y+t)}setY(A,B){const t=e.toNumber(A.Y);B.target.setXY(B.target.x,t)}getX(A,B){return this.limitPrecision(B.target.x)}getY(A,B){return this.limitPrecision(B.target.y)}getDirection(A,B){return B.target.direction}limitPrecision(A){const B=Math.round(A),t=A-B;return Math.abs(t)<1e-9?B:A}}},function(A,B,t){const e=t(1),g=t(4);A.exports=class{constructor(A){this.runtime=A}getPrimitives(){return{operator_add:this.add,operator_subtract:this.subtract,operator_multiply:this.multiply,operator_divide:this.divide,operator_lt:this.lt,operator_equals:this.equals,operator_gt:this.gt,operator_and:this.and,operator_or:this.or,operator_not:this.not,operator_random:this.random,operator_join:this.join,operator_letter_of:this.letterOf,operator_length:this.length,operator_contains:this.contains,operator_mod:this.mod,operator_round:this.round,operator_mathop:this.mathop}}add(A){return e.toNumber(A.NUM1)+e.toNumber(A.NUM2)}subtract(A){return e.toNumber(A.NUM1)-e.toNumber(A.NUM2)}multiply(A){return e.toNumber(A.NUM1)*e.toNumber(A.NUM2)}divide(A){return e.toNumber(A.NUM1)/e.toNumber(A.NUM2)}lt(A){return e.compare(A.OPERAND1,A.OPERAND2)<0}equals(A){return 0===e.compare(A.OPERAND1,A.OPERAND2)}gt(A){return e.compare(A.OPERAND1,A.OPERAND2)>0}and(A){return e.toBoolean(A.OPERAND1)&&e.toBoolean(A.OPERAND2)}or(A){return e.toBoolean(A.OPERAND1)||e.toBoolean(A.OPERAND2)}not(A){return!e.toBoolean(A.OPERAND)}random(A){return this._random(A.FROM,A.TO)}_random(A,B){const t=e.toNumber(A),g=e.toNumber(B),i=t<=g?t:g,Q=t<=g?g:t;return i===Q?i:e.isInt(A)&&e.isInt(B)?i+Math.floor(Math.random()*(Q+1-i)):Math.random()*(Q-i)+i}join(A){return e.toString(A.STRING1)+e.toString(A.STRING2)}letterOf(A){const B=e.toNumber(A.LETTER)-1,t=e.toString(A.STRING);return B<0||B>=t.length?"":t.charAt(B)}length(A){return e.toString(A.STRING).length}contains(A){const B=function(A){return e.toString(A).toLowerCase()};return B(A.STRING1).includes(B(A.STRING2))}mod(A){const B=e.toNumber(A.NUM1),t=e.toNumber(A.NUM2);let g=B%t;return g/t<0&&(g+=t),g}round(A){return Math.round(e.toNumber(A.NUM))}mathop(A){const B=e.toString(A.OPERATOR).toLowerCase(),t=e.toNumber(A.NUM);switch(B){case"abs":return Math.abs(t);case"floor":return Math.floor(t);case"ceiling":return Math.ceil(t);case"sqrt":return Math.sqrt(t);case"sin":return parseFloat(Math.sin(Math.PI*t/180).toFixed(10));case"cos":return parseFloat(Math.cos(Math.PI*t/180).toFixed(10));case"tan":return g.tan(t);case"asin":return 180*Math.asin(t)/Math.PI;case"acos":return 180*Math.acos(t)/Math.PI;case"atan":return 180*Math.atan(t)/Math.PI;case"ln":return Math.log(t);case"log":return Math.log(t)/Math.LN10;case"e ^":return Math.exp(t);case"10 ^":return Math.pow(10,t)}return 0}}},function(A,B,t){const e=t(4),g=t(1),i=t(18);class Q{constructor(A){this.runtime=A,this.waitingSounds={},this.stopAllSounds=this.stopAllSounds.bind(this),this._stopWaitingSoundsForTarget=this._stopWaitingSoundsForTarget.bind(this),this._clearEffectsForAllTargets=this._clearEffectsForAllTargets.bind(this),this.runtime&&(this.runtime.on("PROJECT_STOP_ALL",this.stopAllSounds),this.runtime.on("PROJECT_STOP_ALL",this._clearEffectsForAllTargets),this.runtime.on("STOP_FOR_TARGET",this._stopWaitingSoundsForTarget),this.runtime.on("PROJECT_START",this._clearEffectsForAllTargets)),this._onTargetCreated=this._onTargetCreated.bind(this),this.runtime&&A.on("targetWasCreated",this._onTargetCreated)}static get STATE_KEY(){return"Scratch.sound"}static get DEFAULT_SOUND_STATE(){return{effects:{pitch:0,pan:0}}}static get MIDI_NOTE_RANGE(){return{min:36,max:96}}static get BEAT_RANGE(){return{min:0,max:100}}static get TEMPO_RANGE(){return{min:20,max:500}}static get EFFECT_RANGE(){return{pitch:{min:-360,max:360},pan:{min:-100,max:100}}}_getSoundState(A){let B=A.getCustomState(Q.STATE_KEY);return B||(B=i.simple(Q.DEFAULT_SOUND_STATE),A.setCustomState(Q.STATE_KEY,B),A.soundEffects=B.effects),B}_onTargetCreated(A,B){if(B){const t=B.getCustomState(Q.STATE_KEY);t&&A&&(A.setCustomState(Q.STATE_KEY,i.simple(t)),this._syncEffectsForTarget(A))}}getPrimitives(){return{sound_play:this.playSound,sound_playuntildone:this.playSoundAndWait,sound_stopallsounds:this.stopAllSounds,sound_seteffectto:this.setEffect,sound_changeeffectby:this.changeEffect,sound_cleareffects:this.clearEffects,sound_sounds_menu:this.soundsMenu,sound_beats_menu:this.beatsMenu,sound_effects_menu:this.effectsMenu,sound_setvolumeto:this.setVolume,sound_changevolumeby:this.changeVolume,sound_volume:this.getVolume}}getMonitored(){return{sound_volume:{isSpriteSpecific:!0,getId:A=>"".concat(A,"_volume")}}}playSound(A,B){this._playSound(A,B)}playSoundAndWait(A,B){return this._playSound(A,B,!0)}_playSound(A,B,t){const e=this._getSoundIndex(A.SOUND_MENU,B);if(e>=0){const{target:A}=B,{sprite:g}=A,{soundId:i}=g.sounds[e];if(g.soundBank)return!0===t?this._addWaitingSound(A.id,i):this._removeWaitingSound(A.id,i),g.soundBank.playSound(A,i)}}_addWaitingSound(A,B){this.waitingSounds[A]||(this.waitingSounds[A]=new Set),this.waitingSounds[A].add(B)}_removeWaitingSound(A,B){this.waitingSounds[A]&&this.waitingSounds[A].delete(B)}_getSoundIndex(A,B){const t=B.target.sprite.sounds.length;if(0===t)return-1;const g=this.getSoundIndexByName(A,B);if(-1!==g)return g;const i=parseInt(A,10);return isNaN(i)?-1:e.wrapClamp(i-1,0,t-1)}getSoundIndexByName(A,B){const t=B.target.sprite.sounds;for(let B=0;B{}}}getMonitored(){return{sensing_answer:{getId:()=>"answer"},sensing_loudness:{getId:()=>"loudness"},sensing_timer:{getId:()=>"timer"},sensing_current:{getId:(A,B)=>i("current",B)}}}_onAnswer(A){this._answer=A;const B=this._questionList.shift();if(B){const[A,t,e,g,i]=B;g&&!i&&this.runtime.emit("SAY",e,"say",""),t(),this._askNextQuestion()}}_resetAnswer(){this._answer=""}_enqueueAsk(A,B,t,e,g){this._questionList.push([A,B,t,e,g])}_askNextQuestion(){if(this._questionList.length>0){const[A,B,t,e,g]=this._questionList[0];e&&!g?(this.runtime.emit("SAY",t,"say",A),this.runtime.emit("QUESTION","")):this.runtime.emit("QUESTION",A)}}_clearAllQuestions(){this._questionList=[],this.runtime.emit("QUESTION",null)}_clearTargetQuestions(A){const B=this._questionList.length>0&&this._questionList[0][2]===A;this._questionList=this._questionList.filter(B=>B[2]!==A),B&&(this.runtime.emit("SAY",A,"say",""),this._questionList.length>0?this._askNextQuestion():this.runtime.emit("QUESTION",null))}askAndWait(A,B){const t=B.target;return new Promise(B=>{const e=this._questionList.length>0;this._enqueueAsk(String(A.QUESTION),B,t,t.visible,t.isStage),e||this._askNextQuestion()})}getAnswer(){return this._answer}touchingObject(A,B){return B.target.isTouchingObject(A.TOUCHINGOBJECTMENU)}touchingColor(A,B){const t=e.toRgbColorList(A.COLOR);return B.target.isTouchingColor(t)}colorTouchingColor(A,B){const t=e.toRgbColorList(A.COLOR),g=e.toRgbColorList(A.COLOR2);return B.target.colorIsTouchingColor(g,t)}distanceTo(A,B){if(B.target.isStage)return 1e4;let t=0,g=0;if("_mouse_"===A.DISTANCETOMENU)t=B.ioQuery("mouse","getScratchX"),g=B.ioQuery("mouse","getScratchY");else{A.DISTANCETOMENU=e.toString(A.DISTANCETOMENU);const B=this.runtime.getSpriteTargetByName(A.DISTANCETOMENU);if(!B)return 1e4;t=B.x,g=B.y}const i=B.target.x-t,Q=B.target.y-g;return Math.sqrt(i*i+Q*Q)}setDragMode(A,B){B.target.setDraggable("draggable"===A.DRAG_MODE)}getTimer(A,B){return B.ioQuery("clock","projectTimer")}resetTimer(A,B){B.ioQuery("clock","resetProjectTimer")}getMouseX(A,B){return B.ioQuery("mouse","getScratchX")}getMouseY(A,B){return B.ioQuery("mouse","getScratchY")}getMouseDown(A,B){return B.ioQuery("mouse","getIsDown")}current(A){const B=e.toString(A.CURRENTMENU).toLowerCase(),t=new Date;switch(B){case"year":return t.getFullYear();case"month":return t.getMonth()+1;case"date":return t.getDate();case"dayofweek":return t.getDay()+1;case"hour":return t.getHours();case"minute":return t.getMinutes();case"second":return t.getSeconds()}return 0}getKeyPressed(A,B){return B.ioQuery("keyboard","getKeyIsDown",[A.KEY_OPTION])}daysSince2000(){const A=new Date(2e3,0,1),B=new Date,t=B.getTimezoneOffset()-A.getTimezoneOffset();let e=B.valueOf()-A.valueOf();return e+=60*(B.getTimezoneOffset()-t)*1e3,e/864e5}getLoudness(){if(void 0===this.runtime.audioEngine)return-1;if(null===this.runtime.currentStepTime)return-1;return this._timer.time()-this._cachedLoudnessTimestamp10}getAttributeOf(A){let B;if("_stage_"===A.OBJECT?B=this.runtime.getTargetForStage():(A.OBJECT=e.toString(A.OBJECT),B=this.runtime.getSpriteTargetByName(A.OBJECT)),!B)return 0;if(B.isStage)switch(A.PROPERTY){case"background #":case"backdrop #":return B.currentCostume+1;case"backdrop name":return B.getCostumes()[B.currentCostume].name;case"volume":return B.volume}else switch(A.PROPERTY){case"x position":return B.x;case"y position":return B.y;case"direction":return B.direction;case"costume #":return B.currentCostume+1;case"costume name":return B.getCostumes()[B.currentCostume].name;case"size":return B.size;case"volume":return B.volume}const t=A.PROPERTY,g=B.lookupVariableByNameAndType(t,"",!0);return g?g.value:0}getUsername(A,B){return B.ioQuery("userData","getUsername")}}},function(A,B,t){const e=t(1);A.exports=class{constructor(A){this.runtime=A}getPrimitives(){return{data_variable:this.getVariable,data_setvariableto:this.setVariableTo,data_changevariableby:this.changeVariableBy,data_hidevariable:this.hideVariable,data_showvariable:this.showVariable,data_listcontents:this.getListContents,data_addtolist:this.addToList,data_deleteoflist:this.deleteOfList,data_deletealloflist:this.deleteAllOfList,data_insertatlist:this.insertAtList,data_replaceitemoflist:this.replaceItemOfList,data_itemoflist:this.getItemOfList,data_itemnumoflist:this.getItemNumOfList,data_lengthoflist:this.lengthOfList,data_listcontainsitem:this.listContainsItem,data_hidelist:this.hideList,data_showlist:this.showList}}getVariable(A,B){return B.target.lookupOrCreateVariable(A.VARIABLE.id,A.VARIABLE.name).value}setVariableTo(A,B){const t=B.target.lookupOrCreateVariable(A.VARIABLE.id,A.VARIABLE.name);t.value=A.VALUE,t.isCloud&&B.ioQuery("cloud","requestUpdateVariable",[t.name,A.VALUE])}changeVariableBy(A,B){const t=B.target.lookupOrCreateVariable(A.VARIABLE.id,A.VARIABLE.name),g=e.toNumber(t.value)+e.toNumber(A.VALUE);t.value=g,t.isCloud&&B.ioQuery("cloud","requestUpdateVariable",[t.name,g])}changeMonitorVisibility(A,B){this.runtime.monitorBlocks.changeBlock({id:A,element:"checkbox",value:B},this.runtime)}showVariable(A){this.changeMonitorVisibility(A.VARIABLE.id,!0)}hideVariable(A){this.changeMonitorVisibility(A.VARIABLE.id,!1)}showList(A){this.changeMonitorVisibility(A.LIST.id,!0)}hideList(A){this.changeMonitorVisibility(A.LIST.id,!1)}getListContents(A,B){const t=B.target.lookupOrCreateList(A.LIST.id,A.LIST.name);if(B.thread.updateMonitor)return t._monitorUpToDate?t.value:(t._monitorUpToDate=!0,t.value.slice());let e=!0;for(let A=0;A=0)return!0;for(let A=0;A{const B=A.renderer;for(const t of A.targets){const A=t._getRenderedDirectionAndScale();if(B&&t.interpolationData){const e=t.drawableID;B.updateDrawablePosition(e,[t.x,t.y]),B.updateDrawableDirectionScale(e,A.direction,A.scale),B.updateDrawableEffect(e,"ghost",t.effects.ghost)}t.visible&&!t.isStage?t.interpolationData={x:t.x,y:t.y,direction:A.direction,scale:A.scale,costume:t.currentCostume,ghost:t.effects.ghost}:t.interpolationData=null}},interpolate:(A,B)=>{const t=A.renderer;if(t)for(const e of A.targets){const A=e.interpolationData;if(!A)continue;if(!e.visible)continue;const g=e.drawableID,i=e.x-A.x,Q=e.y-A.y,n=Math.abs(i),s=Math.abs(Q);if(n>.1||s>.1){const e=t._allDrawables[g].getAABB(),r=Math.min(240,Math.max(50,1.5*(e.width+e.height)));if(Math.sqrt(n**2+s**2)0&&c<25){const A=e.effects.ghost+r*B;t.updateDrawableEffect(g,"ghost",A)}if(A.costume===e.currentCostume){let{direction:i,scale:Q}=e._getRenderedDirectionAndScale(),n=!1;if(i!==A.direction&&(i%90!=0||A.direction%90!=0)){const t=i*Math.PI/180,e=A.direction*Math.PI/180;i=180*Math.atan2(Math.sin(t)*B+Math.sin(e)*(1-B),Math.cos(t)*B+Math.cos(e)*(1-B))/Math.PI,n=!0}const s=A.scale;if((Q[0]!==s[0]||Q[1]!==s[1])&&Math.sign(Q[0])===Math.sign(s[0])&&Math.sign(Q[1])===Math.sign(s[1])){const A=Q[0]-s[0],t=Q[1]-s[1],e=Math.abs(A),g=Math.abs(t);e<100&&g<100&&(Q[0]=s[0]+A*B,Q[1]=s[1]+t*B,n=!0)}n&&t.updateDrawableDirectionScale(g,i,Q)}}}}},function(A,B){A.exports=A=>{A.effects.forEach(A=>{const B=A.prototype._set;A.prototype._set=function(A){this.__value!==A&&(this.__value=A,B.call(this,A))}})}},function(A,B,t){const{motionVector:e,scratchAtan2:g}=t(328);A.exports=class{constructor(){this.frameNumber=0,this.lastAnalyzedFrame=0,this.motionAmount=0,this.motionDirection=0,this.curr=null,this.prev=null,this._arrays=new ArrayBuffer(345600),this._curr=new Uint8ClampedArray(this._arrays,0,172800),this._prev=new Uint8ClampedArray(this._arrays,172800,172800)}reset(){this.frameNumber=0,this.lastAnalyzedFrame=0,this.motionAmount=this.motionDirection=0,this.prev=this.curr=null}addFrame(A){this.frameNumber++,this.prev=this.curr,this.curr=new Uint32Array(A.buffer.slice(0));const B=this._prev;this._prev=this._curr,this._curr=B;for(let A=0;A10&&(this.motionDirection=g(i,t))}getLocalMotion(A,B){if(this.curr&&this.prev){if(B.motionFrameNumber!==this.frameNumber){const{_prev:t,_curr:i}=this;A.updateCPURenderAttributes();const Q=A.getFastBounds(),n=Math.max(Math.floor(Q.left+240),1),s=Math.min(Math.floor(Q.right+240),479),r=Math.max(Math.floor(180-Q.top),1),c=Math.min(Math.floor(180-Q.bottom),359);let E=0,o=0,w=0,C=0,a=0,I=0;const h=[0,0,0];for(let B=r;B100&&(B.motionAmount=100),B.motionAmount>10/3&&(B.motionDirection=g(M,Y)),B.motionFrameNumber=this.frameNumber}}else B.motionAmount=B.motionDirection=-1}}},function(A,B){const t=180/Math.PI,e={u:0,v:0},g=function(A){return(A+270)%360-180};A.exports={motionVector:function(A,B,t,g,i,Q=e){const n=B*B-A*t;if(n){const e=-(i*B-g*t),s=-(B*g-A*i),r=8/n;Q.u=e*r,Q.v=s*r}else{const e=(B+A)*(B+A)+(t+B)*(t+B);if(e){const n=-(i+g)*(8/e);Q.u=(B+A)*n,Q.v=(t+B)*n}else Q.u=0,Q.v=0}return Q},scratchDegrees:g,scratchAtan2:function(A,B){return g(Math.atan2(A,B)*t)}}},function(A,B,t){const e=t(6),g=t(3),i=t(1),Q=t(5),n=t(10),s=t(330),r=t(32),c=t(4),E=t(61),o=t(0),w=129,C=130,a=131,I=225,h=32,Y=96,M=0,F=128,D=2,u=175,l=163,d=179,U=148,N=1,m=0,G=152,f=157,H=0,p=0,R=1,y=50,J=0,k=32,T={29:"color",30:"ultrasonic",32:"gyro",16:"touch",8:"mediumMotor",7:"largeMotor",126:"none",125:"none"},j={touch:0,color:1,ultrasonic:1,none:0},x={touch:"button",color:"brightness",ultrasonic:"distance"};class S{constructor(A,B,t){this._parent=A,this._index=B,this._type=t,this._direction=1,this._power=50,this._position=0,this._commandID=null,this._coastDelay=1e3}get type(){return this._type}set type(A){this._type=A}get direction(){return this._direction}set direction(A){this._direction=A<0?-1:1}get power(){return this._power}set power(A){this._power=A}get position(){return this._position}set position(A){let B=A[0]+256*A[1]+256*A[2]*256+256*A[3]*256*256;B>2147483647&&(B-=4294967296),this._position=B}turnOnFor(A){if(0===this._power)return;const B=this._portMask(this._index);let t=A,e=this._power*this._direction;const g=y;let i=[];i[0]=u,e<0&&(e*=-1,t*=-1);const Q=t<0?256-e:e;t=Math.abs(t);let n=g,s=g,r=t-2*g;r<0&&(n=Math.floor(t/2),r=0,s=t-n);const c=this._runValues(r);i=i.concat([H,B,w,255&Q,w,n]).concat(c.concat([w,s,R]));const E=this._parent.generateCommand(F,i);this._parent.send(E),this.coastAfter(A)}coastAfter(A){if(0===this._power)return;const B=n();this._commandID=B,setTimeout(()=>{this._commandID===B&&(this.coast(),this._commandID=null)},A+this._coastDelay)}coast(){if(0===this._power)return;const A=this._parent.generateCommand(F,[l,H,this._portMask(this._index),p]);this._parent.send(A,!1)}_runValues(A){return A<32767?[C,255&A,A>>8&255]:[a,255&A,A>>8&255,A>>16&255,A>>24&255]}_portMask(A){return Math.pow(2,A)}}class b{constructor(A,B){this._runtime=A,this._runtime.on("PROJECT_STOP_ALL",this.stopAll.bind(this)),this._extensionId=B,this._sensorPorts=[],this._motorPorts=[],this._sensors={distance:0,brightness:0,buttons:[0,0,0,0]},this._motors=[null,null,null,null],this._pollingInterval=150,this._pollingIntervalID=null,this._pollingCounter=0,this._bt=null,this._runtime.registerPeripheralExtension(B,this),this._rateLimiter=new E(40),this.reset=this.reset.bind(this),this._onConnect=this._onConnect.bind(this),this._onMessage=this._onMessage.bind(this),this._pollValues=this._pollValues.bind(this)}get distance(){let A=this._sensors.distance>100?100:this._sensors.distance;return A=A<0?0:A,A=Math.round(100*A)/100,A}get brightness(){return this._sensors.brightness}motor(A){return this._motors[A]}isButtonPressed(A){return 1===this._sensors.buttons[A]}beep(A,B){const t=this.generateCommand(F,[U,N,w,2,C,A,A>>8,C,B,B>>8]);this.send(t)}stopAll(){this.stopAllMotors(),this.stopSound()}stopSound(){const A=this.generateCommand(F,[U,m]);this.send(A,!1)}stopAllMotors(){this._motors.forEach(A=>{A&&A.coast()})}scan(){this._bt&&this._bt.disconnect(),this._bt=new s(this._runtime,this._extensionId,{majorDeviceClass:8,minorDeviceClass:1},this._onConnect,this.reset,this._onMessage)}connect(A){this._bt&&this._bt.connectPeripheral(A,"1234")}disconnect(){this._bt&&this._bt.disconnect(),this.reset()}reset(){this._sensorPorts=[],this._motorPorts=[],this._sensors={distance:0,brightness:0,buttons:[0,0,0,0]},this._motors=[null,null,null,null],this._pollingIntervalID&&(window.clearInterval(this._pollingIntervalID),this._pollingIntervalID=null)}isConnected(){let A=!1;return this._bt&&(A=this._bt.isConnected()),A}send(A,B=!0){return this.isConnected()?B&&!this._rateLimiter.okayToSend()?Promise.resolve():this._bt.sendMessage({message:r.uint8ArrayToBase64(A),encoding:"base64"}):Promise.resolve()}generateCommand(A,B,t=0){let e=[];e[2]=0,e[3]=0,e[4]=A,e[5]=255&t,e[6]=t>>8&&255,e=e.concat(B);const g=e.length-2;return e[0]=255&g,e[1]=g>>8&&255,e}_onConnect(){this._pollingIntervalID=window.setInterval(this._pollValues,this._pollingInterval)}_pollValues(){if(!this.isConnected())return void window.clearInterval(this._pollingIntervalID);const A=[];let B=0,t=0;if(this._pollingCounter%20==0)A[0]=G,A[1]=w,A[2]=k,A[3]=Y,A[4]=I,A[5]=h,B=33,this._updateDevices=!0;else{let e=0;for(let B=0;B<4;B++)"none"!==this._sensorPorts[B]&&(A[e+0]=f,A[e+1]=H,A[e+2]=B,A[e+3]=J,A[e+4]=j[this._sensorPorts[B]],A[e+5]=I,A[e+6]=4*t,e+=7),t++;for(let B=0;B<4;B++)A[e+0]=d,A[e+1]=H,A[e+2]=B,A[e+3]=I,A[e+4]=4*t,e+=5,t++;B=4*t}const e=this.generateCommand(M,A,B);this.send(e),this._pollingCounter++}_onMessage(A){const B=A.message,t=r.base64ToUint8Array(B);if(t[4]===D)if(this._updateDevices){for(let A=0;A<4;A++){const B=T[t[A+5]];this._sensorPorts[A]=B||"none"}for(let A=0;A<4;A++){const B=T[t[A+21]];this._motorPorts[A]=B||"none"}for(let A=0;A<4;A++){const B=this._motorPorts[A];"none"===B||this._motors[A]||(this._motors[A]=new S(this,A,B)),"none"===B&&this._motors[A]&&(this._motors[A]=null)}this._updateDevices=!1}else if(!this._sensorPorts.includes(void 0)&&!this._motorPorts.includes(void 0)){let A=5;for(let B=0;B<4;B++){const e=new Uint8Array([t[A],t[A+1],t[A+2],t[A+3]]).buffer,g=new DataView(e).getFloat32(0,!0);"button"===x[this._sensorPorts[B]]?this._sensors.buttons[B]=g||0:x[this._sensorPorts[B]]&&(this._sensors[x[this._sensorPorts[B]]]=g||0),A+=4}for(let B=0;B<4;B++){const e=[t[A],t[A+1],t[A+2],t[A+3]];this._motors[B]&&(this._motors[B].position=e),A+=4}}}}const z=["A","B","C","D"],L=["1","2","3","4"];class P{static get EXTENSION_ID(){return"ev3"}constructor(A){this.runtime=A,this._peripheral=new b(this.runtime,P.EXTENSION_ID),this._playNoteForPicker=this._playNoteForPicker.bind(this),this.runtime.on("PLAY_NOTE",this._playNoteForPicker)}getInfo(){return{id:P.EXTENSION_ID,name:"LEGO EV3",blockIconURI:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUwLjIgKDU1MDQ3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5ldjMtYmxvY2staWNvbjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJldjMtYmxvY2staWNvbiIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9ImV2MyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNS41MDAwMDAsIDMuNTAwMDAwKSIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZS1wYXRoIiBzdHJva2U9IiM3Qzg3QTUiIGZpbGw9IiNGRkZGRkYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgeD0iMC41IiB5PSIzLjU5IiB3aWR0aD0iMjgiIGhlaWdodD0iMjUuODEiIHJ4PSIxIj48L3JlY3Q+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUtcGF0aCIgc3Ryb2tlPSIjN0M4N0E1IiBmaWxsPSIjRTZFN0U4IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHg9IjIuNSIgeT0iMC41IiB3aWR0aD0iMjQiIGhlaWdodD0iMzIiIHJ4PSIxIj48L3JlY3Q+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUtcGF0aCIgc3Ryb2tlPSIjN0M4N0E1IiBmaWxsPSIjRkZGRkZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHg9IjIuNSIgeT0iMTQuNSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjEzIj48L3JlY3Q+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNC41LDEwLjUgTDE0LjUsMTQuNSIgaWQ9IlNoYXBlIiBzdHJva2U9IiM3Qzg3QTUiIGZpbGw9IiNFNkU3RTgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PC9wYXRoPgogICAgICAgICAgICA8cmVjdCBpZD0iUmVjdGFuZ2xlLXBhdGgiIGZpbGw9IiM0MTQ3NTciIHg9IjQuNSIgeT0iMi41IiB3aWR0aD0iMjAiIGhlaWdodD0iMTAiIHJ4PSIxIj48L3JlY3Q+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUtcGF0aCIgZmlsbD0iIzdDODdBNSIgb3BhY2l0eT0iMC41IiB4PSIxMy41IiB5PSIyMC4xMyIgd2lkdGg9IjIiIGhlaWdodD0iMiIgcng9IjAuNSI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNOS4wNiwyMC4xMyBMMTAuNTYsMjAuMTMgQzEwLjgzNjE0MjQsMjAuMTMgMTEuMDYsMjAuMzUzODU3NiAxMS4wNiwyMC42MyBMMTEuMDYsMjEuNjMgQzExLjA2LDIxLjkwNjE0MjQgMTAuODM2MTQyNCwyMi4xMyAxMC41NiwyMi4xMyBMOS4wNiwyMi4xMyBDOC41MDc3MTUyNSwyMi4xMyA4LjA2LDIxLjY4MjI4NDcgOC4wNiwyMS4xMyBDOC4wNiwyMC41Nzc3MTUzIDguNTA3NzE1MjUsMjAuMTMgOS4wNiwyMC4xMyBaIiBpZD0iU2hhcGUiIGZpbGw9IiM3Qzg3QTUiIG9wYWNpdHk9IjAuNSI+PC9wYXRoPgogICAgICAgICAgICA8cGF0aCBkPSJNMTguOTEsMjAuMTMgTDIwLjQyLDIwLjEzIEMyMC42OTYxNDI0LDIwLjEzIDIwLjkyLDIwLjM1Mzg1NzYgMjAuOTIsMjAuNjMgTDIwLjkyLDIxLjYzIEMyMC45MiwyMS45MDYxNDI0IDIwLjY5NjE0MjQsMjIuMTMgMjAuNDIsMjIuMTMgTDE4LjkyLDIyLjEzIEMxOC4zNjc3MTUzLDIyLjEzIDE3LjkyLDIxLjY4MjI4NDcgMTcuOTIsMjEuMTMgQzE3LjkxOTk3MjYsMjAuNTgxNTk3IDE4LjM2MTYyNDUsMjAuMTM1NDg0IDE4LjkxLDIwLjEzIFoiIGlkPSJTaGFwZSIgZmlsbD0iIzdDODdBNSIgb3BhY2l0eT0iMC41IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxOS40MjAwMDAsIDIxLjEzMDAwMCkgcm90YXRlKC0xODAuMDAwMDAwKSB0cmFuc2xhdGUoLTE5LjQyMDAwMCwgLTIxLjEzMDAwMCkgIj48L3BhdGg+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik04LjIzLDE3LjUgTDUsMTcuNSBDNC43MjM4NTc2MywxNy41IDQuNSwxNy4yNzYxNDI0IDQuNSwxNyBMNC41LDE0LjUgTDEwLjUsMTQuNSBMOC42NSwxNy4yOCBDOC41NTQ2Njk2MSwxNy40MTc5MDgyIDguMzk3NjUwMDYsMTcuNTAwMTU2NiA4LjIzLDE3LjUgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjN0M4N0E1IiBvcGFjaXR5PSIwLjUiPjwvcGF0aD4KICAgICAgICAgICAgPHBhdGggZD0iTTE4LjE1LDE4Ljg1IEwxNy42NSwxOS4zNSBDMTcuNTUyMzQxNiwxOS40NDQwNzU2IDE3LjQ5ODAzMzksMTkuNTc0NDE0MiAxNy41LDE5LjcxIEwxNy41LDIwIEMxNy41LDIwLjI3NjE0MjQgMTcuMjc2MTQyNCwyMC41IDE3LDIwLjUgTDE2LjUsMjAuNSBDMTYuMjIzODU3NiwyMC41IDE2LDIwLjI3NjE0MjQgMTYsMjAgQzE2LDE5LjcyMzg1NzYgMTUuNzc2MTQyNCwxOS41IDE1LjUsMTkuNSBMMTMuNSwxOS41IEMxMy4yMjM4NTc2LDE5LjUgMTMsMTkuNzIzODU3NiAxMywyMCBDMTMsMjAuMjc2MTQyNCAxMi43NzYxNDI0LDIwLjUgMTIuNSwyMC41IEwxMiwyMC41IEMxMS43MjM4NTc2LDIwLjUgMTEuNSwyMC4yNzYxNDI0IDExLjUsMjAgTDExLjUsMTkuNzEgQzExLjUwMTk2NjEsMTkuNTc0NDE0MiAxMS40NDc2NTg0LDE5LjQ0NDA3NTYgMTEuMzUsMTkuMzUgTDEwLjg1LDE4Ljg1IEMxMC42NTgyMTY3LDE4LjY1MjE4NjMgMTAuNjU4MjE2NywxOC4zMzc4MTM3IDEwLjg1LDE4LjE0IEwxMi4zNiwxNi42NSBDMTIuNDUwMjgwMywxNi41NTI4NjE3IDEyLjU3NzM5NjEsMTYuNDk4MzgzNSAxMi43MSwxNi41IEwxNi4yOSwxNi41IEMxNi40MjI2MDM5LDE2LjQ5ODM4MzUgMTYuNTQ5NzE5NywxNi41NTI4NjE3IDE2LjY0LDE2LjY1IEwxOC4xNSwxOC4xNCBDMTguMzQxNzgzMywxOC4zMzc4MTM3IDE4LjM0MTc4MzMsMTguNjUyMTg2MyAxOC4xNSwxOC44NSBaIiBpZD0iU2hhcGUiIGZpbGw9IiM3Qzg3QTUiIG9wYWNpdHk9IjAuNSI+PC9wYXRoPgogICAgICAgICAgICA8cGF0aCBkPSJNMTAuODUsMjMuNDUgTDExLjM1LDIyLjk1IEMxMS40NDc2NTg0LDIyLjg1NTkyNDQgMTEuNTAxOTY2MSwyMi43MjU1ODU4IDExLjUsMjIuNTkgTDExLjUsMjIuMyBDMTEuNSwyMi4wMjM4NTc2IDExLjcyMzg1NzYsMjEuOCAxMiwyMS44IEwxMi41LDIxLjggQzEyLjc3NjE0MjQsMjEuOCAxMywyMi4wMjM4NTc2IDEzLDIyLjMgQzEzLDIyLjU3NjE0MjQgMTMuMjIzODU3NiwyMi44IDEzLjUsMjIuOCBMMTUuNSwyMi44IEMxNS43NzYxNDI0LDIyLjggMTYsMjIuNTc2MTQyNCAxNiwyMi4zIEMxNiwyMi4wMjM4NTc2IDE2LjIyMzg1NzYsMjEuOCAxNi41LDIxLjggTDE3LDIxLjggQzE3LjI3NjE0MjQsMjEuOCAxNy41LDIyLjAyMzg1NzYgMTcuNSwyMi4zIEwxNy41LDIyLjU5IEMxNy40OTgwMzM5LDIyLjcyNTU4NTggMTcuNTUyMzQxNiwyMi44NTU5MjQ0IDE3LjY1LDIyLjk1IEwxOC4xNSwyMy40NSBDMTguMzQwNTcxNCwyMy42NDQ0MjE4IDE4LjM0MDU3MTQsMjMuOTU1NTc4MiAxOC4xNSwyNC4xNSBMMTYuNjQsMjUuNjUgQzE2LjU0OTcxOTcsMjUuNzQ3MTM4MyAxNi40MjI2MDM5LDI1LjgwMTYxNjUgMTYuMjksMjUuOCBMMTIuNzEsMjUuOCBDMTIuNTc3Mzk2MSwyNS44MDE2MTY1IDEyLjQ1MDI4MDMsMjUuNzQ3MTM4MyAxMi4zNiwyNS42NSBMMTAuODUsMjQuMTUgQzEwLjY1OTQyODYsMjMuOTU1NTc4MiAxMC42NTk0Mjg2LDIzLjY0NDQyMTggMTAuODUsMjMuNDUgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjN0M4N0E1IiBvcGFjaXR5PSIwLjUiPjwvcGF0aD4KICAgICAgICAgICAgPHBhdGggZD0iTTIxLjUsMjcuNSBMMjYuNSwyNy41IEwyNi41LDMxLjUgQzI2LjUsMzIuMDUyMjg0NyAyNi4wNTIyODQ3LDMyLjUgMjUuNSwzMi41IEwyMS41LDMyLjUgTDIxLjUsMjcuNSBaIiBpZD0iU2hhcGUiIHN0cm9rZT0iI0NDNEMyMyIgZmlsbD0iI0YxNUEyOSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",showStatusButton:!0,blocks:[{opcode:"motorTurnClockwise",text:Q({id:"ev3.motorTurnClockwise",default:"motor [PORT] turn this way for [TIME] seconds",description:"turn a motor clockwise for some time"}),blockType:g.COMMAND,arguments:{PORT:{type:e.STRING,menu:"motorPorts",defaultValue:0},TIME:{type:e.NUMBER,defaultValue:1}}},{opcode:"motorTurnCounterClockwise",text:Q({id:"ev3.motorTurnCounterClockwise",default:"motor [PORT] turn that way for [TIME] seconds",description:"turn a motor counter-clockwise for some time"}),blockType:g.COMMAND,arguments:{PORT:{type:e.STRING,menu:"motorPorts",defaultValue:0},TIME:{type:e.NUMBER,defaultValue:1}}},{opcode:"motorSetPower",text:Q({id:"ev3.motorSetPower",default:"motor [PORT] set power [POWER] %",description:"set a motor's power to some value"}),blockType:g.COMMAND,arguments:{PORT:{type:e.STRING,menu:"motorPorts",defaultValue:0},POWER:{type:e.NUMBER,defaultValue:100}}},{opcode:"getMotorPosition",text:Q({id:"ev3.getMotorPosition",default:"motor [PORT] position",description:"get the measured degrees a motor has turned"}),blockType:g.REPORTER,arguments:{PORT:{type:e.STRING,menu:"motorPorts",defaultValue:0}}},{opcode:"whenButtonPressed",text:Q({id:"ev3.whenButtonPressed",default:"when button [PORT] pressed",description:"when a button connected to a port is pressed"}),blockType:g.HAT,arguments:{PORT:{type:e.STRING,menu:"sensorPorts",defaultValue:0}}},{opcode:"whenDistanceLessThan",text:Q({id:"ev3.whenDistanceLessThan",default:"when distance < [DISTANCE]",description:"when the value measured by the distance sensor is less than some value"}),blockType:g.HAT,arguments:{DISTANCE:{type:e.NUMBER,defaultValue:5}}},{opcode:"whenBrightnessLessThan",text:Q({id:"ev3.whenBrightnessLessThan",default:"when brightness < [DISTANCE]",description:"when value measured by brightness sensor is less than some value"}),blockType:g.HAT,arguments:{DISTANCE:{type:e.NUMBER,defaultValue:50}}},{opcode:"buttonPressed",text:Q({id:"ev3.buttonPressed",default:"button [PORT] pressed?",description:"is a button on some port pressed?"}),blockType:g.BOOLEAN,arguments:{PORT:{type:e.STRING,menu:"sensorPorts",defaultValue:0}}},{opcode:"getDistance",text:Q({id:"ev3.getDistance",default:"distance",description:"gets measured distance"}),blockType:g.REPORTER},{opcode:"getBrightness",text:Q({id:"ev3.getBrightness",default:"brightness",description:"gets measured brightness"}),blockType:g.REPORTER},{opcode:"beep",text:Q({id:"ev3.beepNote",default:"beep note [NOTE] for [TIME] secs",description:"play some note on EV3 for some time"}),blockType:g.COMMAND,arguments:{NOTE:{type:e.NOTE,defaultValue:60},TIME:{type:e.NUMBER,defaultValue:.5}}}],menus:{motorPorts:{acceptReporters:!0,items:this._formatMenu(z)},sensorPorts:{acceptReporters:!0,items:this._formatMenu(L)}}}}motorTurnClockwise(A){const B=i.toNumber(A.PORT);let t=1e3*i.toNumber(A.TIME);return t=c.clamp(t,0,15e3),new Promise(A=>{this._forEachMotor(B,A=>{const B=this._peripheral.motor(A);B&&(B.direction=1,B.turnOnFor(t))}),setTimeout(A,t)})}motorTurnCounterClockwise(A){const B=i.toNumber(A.PORT);let t=1e3*i.toNumber(A.TIME);return t=c.clamp(t,0,15e3),new Promise(A=>{this._forEachMotor(B,A=>{const B=this._peripheral.motor(A);B&&(B.direction=-1,B.turnOnFor(t))}),setTimeout(A,t)})}motorSetPower(A){const B=i.toNumber(A.PORT),t=c.clamp(i.toNumber(A.POWER),0,100);this._forEachMotor(B,A=>{const B=this._peripheral.motor(A);B&&(B.power=t)})}getMotorPosition(A){const B=i.toNumber(A.PORT);if(![0,1,2,3].includes(B))return;const t=this._peripheral.motor(B);let e=0;return t&&(e=c.wrapClamp(t.position,0,360)),e}whenButtonPressed(A){const B=i.toNumber(A.PORT);if([0,1,2,3].includes(B))return this._peripheral.isButtonPressed(B)}whenDistanceLessThan(A){const B=c.clamp(i.toNumber(A.DISTANCE),0,100);return this._peripheral.distance{const e=440*Math.pow(2,(B-69+12)/12);this._peripheral.beep(e,t),setTimeout(A,t)})}_forEachMotor(A,B){let t;switch(A){case 0:t=[0];break;case 1:t=[1];break;case 2:t=[2];break;case 3:t=[3];break;default:o.warn("Invalid motor ID: ".concat(A)),t=[]}for(const A of t)B(A)}_formatMenu(A){const B=[];for(let t=0;tthis._handleRequestError(A))}connectPeripheral(A,B=null){const t={peripheralId:A};B&&(t.pin=B),this.sendRemoteRequest("connect",t).then(()=>{this._connected=!0,this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED),this._connectCallback()}).catch(A=>{this._handleRequestError(A)})}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}sendMessage(A){return this.sendRemoteRequest("send",A).catch(A=>{this.handleDisconnectError(A)})}didReceiveCall(A,B){switch(A){case"didDiscoverPeripheral":this._availablePeripherals[B.peripheralId]=B,this._runtime.emit(this._runtime.constructor.PERIPHERAL_LIST_UPDATE,this._availablePeripherals),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID);break;case"userDidPickPeripheral":this._availablePeripherals[B.peripheralId]=B,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"didReceiveMessage":this._messageCallback(B);break;default:return"nah"}}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(A,B,t){const e=t(5),g=t(6),i=t(3),Q=t(1),n={SPACE:"space",LEFT:"left arrow",UP:"up arrow",RIGHT:"right arrow",DOWN:"down arrow"};A.exports=class{constructor(A){this.runtime=A,this.frameToggle=!1,setInterval(()=>{this.frameToggle=!this.frameToggle},this.runtime.currentStepTime),this.keyPressed=this.keyPressed.bind(this),this.runtime.on("KEY_PRESSED",this.keyPressed),this._clearkeyPressBuffer=this._clearkeyPressBuffer.bind(this),this.runtime.on("PROJECT_STOP_ALL",this._clearkeyPressBuffer),this.sequences={},this.keyPressBuffer=[]}get KEY_TEXT_SHORT(){return{SPACE:e({id:"makeymakey.spaceKey",default:"space",description:"The space key on a computer keyboard."}),LEFT:e({id:"makeymakey.leftArrowShort",default:"left",description:"Short name for the left arrow key on a computer keyboard."}),UP:e({id:"makeymakey.upArrowShort",default:"up",description:"Short name for the up arrow key on a computer keyboard."}),RIGHT:e({id:"makeymakey.rightArrowShort",default:"right",description:"Short name for the right arrow key on a computer keyboard."}),DOWN:e({id:"makeymakey.downArrowShort",default:"down",description:"Short name for the down arrow key on a computer keyboard."})}}get DEFAULT_SEQUENCES(){return["".concat("LEFT"," ").concat("UP"," ").concat("RIGHT"),"".concat("RIGHT"," ").concat("UP"," ").concat("LEFT"),"".concat("LEFT"," ").concat("RIGHT"),"".concat("RIGHT"," ").concat("LEFT"),"".concat("UP"," ").concat("DOWN"),"".concat("DOWN"," ").concat("UP"),"".concat("UP"," ").concat("RIGHT"," ").concat("DOWN"," ").concat("LEFT"),"".concat("UP"," ").concat("LEFT"," ").concat("DOWN"," ").concat("RIGHT"),"".concat("UP"," ").concat("UP"," ").concat("DOWN"," ").concat("DOWN"," ")+"".concat("LEFT"," ").concat("RIGHT"," ").concat("LEFT"," ").concat("RIGHT")]}getInfo(){return{id:"makeymakey",name:"Makey Makey",blockIconURI:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHN0eWxlPi5zdDJ7ZmlsbDpyZWR9LnN0M3tmaWxsOiNlMGUwZTB9LnN0NHtmaWxsOm5vbmU7c3Ryb2tlOiM2NjY7c3Ryb2tlLXdpZHRoOi41O3N0cm9rZS1taXRlcmxpbWl0OjEwfTwvc3R5bGU+PHBhdGggZD0iTTM1IDI4SDVhMSAxIDAgMCAxLTEtMVYxMmMwLS42LjQtMSAxLTFoMzBjLjUgMCAxIC40IDEgMXYxNWMwIC41LS41IDEtMSAxeiIgZmlsbD0iI2ZmZiIgaWQ9IkxheWVyXzYiLz48ZyBpZD0iTGF5ZXJfNCI+PHBhdGggY2xhc3M9InN0MiIgZD0iTTQgMjVoMzJ2Mi43SDR6TTEzIDI0aC0yLjJhMSAxIDAgMCAxLTEtMXYtOS43YzAtLjYuNC0xIDEtMUgxM2MuNiAwIDEgLjQgMSAxVjIzYzAgLjYtLjUgMS0xIDF6Ii8+PHBhdGggY2xhc3M9InN0MiIgZD0iTTYuMSAxOS4zdi0yLjJjMC0uNS40LTEgMS0xaDkuN2MuNSAwIDEgLjUgMSAxdjIuMmMwIC41LS41IDEtMSAxSDcuMWExIDEgMCAwIDEtMS0xeiIvPjxjaXJjbGUgY2xhc3M9InN0MiIgY3g9IjIyLjgiIGN5PSIxOC4yIiByPSIzLjQiLz48Y2lyY2xlIGNsYXNzPSJzdDIiIGN4PSIzMC42IiBjeT0iMTguMiIgcj0iMy40Ii8+PHBhdGggY2xhc3M9InN0MiIgZD0iTTQuMiAyN2gzMS45di43SDQuMnoiLz48L2c+PGcgaWQ9IkxheWVyXzUiPjxjaXJjbGUgY2xhc3M9InN0MyIgY3g9IjIyLjgiIGN5PSIxOC4yIiByPSIyLjMiLz48Y2lyY2xlIGNsYXNzPSJzdDMiIGN4PSIzMC42IiBjeT0iMTguMiIgcj0iMi4zIi8+PHBhdGggY2xhc3M9InN0MyIgZD0iTTEyLjUgMjIuOWgtMS4yYy0uMyAwLS41LS4yLS41LS41VjE0YzAtLjMuMi0uNS41LS41aDEuMmMuMyAwIC41LjIuNS41djguNGMwIC4zLS4yLjUtLjUuNXoiLz48cGF0aCBjbGFzcz0ic3QzIiBkPSJNNy4yIDE4Ljd2LTEuMmMwLS4zLjItLjUuNS0uNWg4LjRjLjMgMCAuNS4yLjUuNXYxLjJjMCAuMy0uMi41LS41LjVINy43Yy0uMyAwLS41LS4yLS41LS41ek00IDI2aDMydjJINHoiLz48L2c+PGcgaWQ9IkxheWVyXzMiPjxwYXRoIGNsYXNzPSJzdDQiIGQ9Ik0zNS4yIDI3LjlINC44YTEgMSAwIDAgMS0xLTFWMTIuMWMwLS42LjUtMSAxLTFoMzAuNWMuNSAwIDEgLjQgMSAxVjI3YTEgMSAwIDAgMS0xLjEuOXoiLz48cGF0aCBjbGFzcz0ic3Q0IiBkPSJNMzUuMiAyNy45SDQuOGExIDEgMCAwIDEtMS0xVjEyLjFjMC0uNi41LTEgMS0xaDMwLjVjLjUgMCAxIC40IDEgMVYyN2ExIDEgMCAwIDEtMS4xLjl6Ii8+PC9nPjwvc3ZnPg==",blocks:[{opcode:"whenMakeyKeyPressed",text:e({id:"makeymakey.whenKeyPressed",default:"when [KEY] key pressed",description:"when a keyboard key is pressed"}),blockType:i.HAT,arguments:{KEY:{type:g.STRING,menu:"KEY",defaultValue:"SPACE"}}},{opcode:"whenCodePressed",text:e({id:"makeymakey.whenKeysPressedInOrder",default:"when [SEQUENCE] pressed in order",description:"when a sequence of keyboard keys is pressed in a specific order"}),blockType:i.HAT,arguments:{SEQUENCE:{type:g.STRING,menu:"SEQUENCE",defaultValue:this.DEFAULT_SEQUENCES[0]}}}],menus:{KEY:{acceptReporters:!0,items:[{text:e({id:"makeymakey.spaceKey",default:"space",description:"The space key on a computer keyboard."}),value:"SPACE"},{text:e({id:"makeymakey.upArrow",default:"up arrow",description:"The up arrow key on a computer keyboard."}),value:"UP"},{text:e({id:"makeymakey.downArrow",default:"down arrow",description:"The down arrow key on a computer keyboard."}),value:"DOWN"},{text:e({id:"makeymakey.rightArrow",default:"right arrow",description:"The right arrow key on a computer keyboard."}),value:"RIGHT"},{text:e({id:"makeymakey.leftArrow",default:"left arrow",description:"The left arrow key on a computer keyboard."}),value:"LEFT"},{text:"w",value:"w"},{text:"a",value:"a"},{text:"s",value:"s"},{text:"d",value:"d"},{text:"f",value:"f"},{text:"g",value:"g"}]},SEQUENCE:{acceptReporters:!0,items:this.buildSequenceMenu(this.DEFAULT_SEQUENCES)}}}}buildSequenceMenu(A){return A.map(A=>this.getMenuItemForSequenceString(A))}getMenuItemForSequenceString(A){let B=A.split(" ");return B=B.map(A=>this.KEY_TEXT_SHORT[A]),{text:B.join(" "),value:A}}whenMakeyKeyPressed(A,B){let t=A.KEY;n[A.KEY]&&(t=n[A.KEY]);return B.ioQuery("keyboard","getKeyIsDown",[t])&&this.frameToggle}keyPressed(A){A=(A=A.split(" ")[0]).toUpperCase(),this.keyPressBuffer.push(A),this.keyPressBuffer.length>100&&this.keyPressBuffer.shift();for(const A in this.sequences){const B=this.sequences[A].array;if(this.keyPressBuffer.length{this.sequences[A].completed=!1},100))}}_clearkeyPressBuffer(){this.keyPressBuffer=[]}addSequence(A,B){this.sequences.hasOwnProperty(A)||(this.sequences[A]={array:B,completed:!1})}whenCodePressed(A){const B=Q.toString(A.SEQUENCE).toUpperCase(),t=B.split(" ");if(!(t.length<2))return this.addSequence(B,t),this.sequences[B].completed}}},function(A,B,t){const e=t(6),g=t(3),i=t(1),Q=t(5),n=t(30),s=t(42),r=t(32),c=t(4),E=t(61),o=t(0),w="00001623-1212-efde-1623-785feabcd123",C="00001624-1212-efde-1623-785feabcd123",a=100,I=20,h=20,Y=21,M=23,F=37,D=38,u=39,l=40,d=1,U=2,N=4,m={A:55,B:56,C:1,D:2},G={A:0,B:1,C:2,D:3};let f=G;const H="any",p="none",R="red",y="blue",J="green",k="yellow",T="white",j="black",x={[p]:255,[R]:9,[y]:3,[J]:5,[k]:7,[T]:10,[j]:0},S={HUB_PROPERTIES:1,HUB_ACTIONS:2,HUB_ALERTS:3,HUB_ATTACHED_IO:4,ERROR:5,PORT_INPUT_FORMAT_SETUP_SINGLE:65,PORT_INPUT_FORMAT_SETUP_COMBINED:66,PORT_INFORMATION:67,PORT_MODEINFORMATION:68,PORT_VALUE:69,PORT_VALUE_COMBINED:70,PORT_INPUT_FORMAT:71,PORT_INPUT_FORMAT_COMBINED:72,OUTPUT:129,PORT_FEEDBACK:130},b=3,z=5,L=1,P=7,v=11,W=81,V=16,K=1,O=0,X=127,Z=0,_=1,q=0,$=0,AA=1,BA=0,tA=2,eA=0,gA=0,iA=1,QA=2,nA=3,sA=function(A){const B=new ArrayBuffer(4),t=new DataView(B);return t.setInt32(0,A),[t.getInt8(3),t.getInt8(2),t.getInt8(1),t.getInt8(0)]},rA=function(A){const B=Uint8Array.from(A);return new DataView(B.buffer).getInt32(0,!0)};class cA{constructor(A,B){this._parent=A,this._index=B,this._direction=1,this._power=50,this._position=0,this._status=gA,this._pendingDurationTimeoutId=null,this._pendingDurationTimeoutStartTime=null,this._pendingDurationTimeoutDelay=null,this._pendingRotationDestination=null,this._pendingRotationPromise=null,this.turnOff=this.turnOff.bind(this)}get direction(){return this._direction}set direction(A){this._direction=A<0?-1:1}get power(){return this._power}set power(A){this._power=0===A?0:c.scale(A,1,100,10,100)}get position(){return this._position}set position(A){this._position=A}get status(){return this._status}set status(A){this._clearRotationState(),this._clearDurationTimeout(),this._status=A}get pendingDurationTimeoutStartTime(){return this._pendingDurationTimeoutStartTime}get pendingDurationTimeoutDelay(){return this._pendingDurationTimeoutDelay}get pendingRotationDestination(){return this._pendingRotationDestination}get pendingRotationPromise(){return this._pendingRotationPromise}set pendingRotationPromise(A){this._pendingRotationPromise=A}_turnOn(){const A=this._parent.generateOutputCommand(this._index,V,P,[this.power*this.direction,c.clamp(this.power+10,0,100),Z]);this._parent.send(C,A)}turnOnForever(){this.status=iA,this._turnOn()}turnOnFor(A){A=Math.max(0,A),this.status=QA,this._turnOn(),this._setNewDurationTimeout(this.turnOff,A)}turnOnForDegrees(A,B){A=Math.max(0,A);const t=this._parent.generateOutputCommand(this._index,V^K,v,[...sA(A),this.power*this.direction*B,c.clamp(this.power+10,0,100),X,Z]);this.status=nA,this._pendingRotationDestination=this.position+A*this.direction*B,this._parent.send(C,t)}turnOff(A=!0){const B=this._parent.generateOutputCommand(this._index,V,L,[O]);this.status=gA,this._parent.send(C,B,A)}_clearDurationTimeout(){null!==this._pendingDurationTimeoutId&&(clearTimeout(this._pendingDurationTimeoutId),this._pendingDurationTimeoutId=null,this._pendingDurationTimeoutStartTime=null,this._pendingDurationTimeoutDelay=null)}_setNewDurationTimeout(A,B){this._clearDurationTimeout();const t=setTimeout(()=>{this._pendingDurationTimeoutId===t&&(this._pendingDurationTimeoutId=null,this._pendingDurationTimeoutStartTime=null,this._pendingDurationTimeoutDelay=null),A()},B);this._pendingDurationTimeoutId=t,this._pendingDurationTimeoutStartTime=Date.now(),this._pendingDurationTimeoutDelay=B}_clearRotationState(){null!==this._pendingRotationPromise&&(this._pendingRotationPromise(),this._pendingRotationPromise=null),this._pendingRotationDestination=null}}class EA{constructor(A,B){this._runtime=A,this._runtime.on("PROJECT_STOP_ALL",this.stopAll.bind(this)),this._extensionId=B,this._ports=[],this._motors=[],this._sensors={tiltX:0,tiltY:0,color:p,previousColor:p},this._colorSamples=[],this._ble=null,this._runtime.registerPeripheralExtension(B,this),this._rateLimiter=new E(I),this._pingDeviceId=null,this.reset=this.reset.bind(this),this._onConnect=this._onConnect.bind(this),this._onMessage=this._onMessage.bind(this),this._pingDevice=this._pingDevice.bind(this)}get tiltX(){return this._sensors.tiltX}get tiltY(){return this._sensors.tiltY}get color(){return this._sensors.color}get previousColor(){return this._sensors.previousColor}boostColorForIndex(A){return Object.keys(x).find(B=>x[B]===A)||p}motor(A){return this._motors[A]}stopAllMotors(){this._motors.forEach(A=>{A&&A.turnOff(!1)})}setLED(A){const B=[A>>16&255,A>>8&255,255&A],t=this.generateOutputCommand(this._ports.indexOf(M),V^K,W,[AA,...B]);return this.send(C,t)}setLEDMode(){const A=this.generateInputCommand(this._ports.indexOf(M),AA,0,!1);return this.send(C,A)}stopAll(){this.isConnected()&&this.stopAllMotors()}scan(){this._ble&&this._ble.disconnect(),this._ble=new s(this._runtime,this._extensionId,{filters:[{services:[w],manufacturerData:{919:{dataPrefix:[0,64],mask:[0,255]}}}],optionalServices:[]},this._onConnect,this.reset)}connect(A){this._ble&&this._ble.connectPeripheral(A)}disconnect(){this._ble&&this._ble.disconnect(),this.reset()}reset(){this._ports=[],this._motors=[],this._sensors={tiltX:0,tiltY:0,color:p,previousColor:p},this._pingDeviceId&&(window.clearInterval(this._pingDeviceId),this._pingDeviceId=null)}isConnected(){let A=!1;return this._ble&&(A=this._ble.isConnected()),A}send(A,B,t=!0){return this.isConnected()?t&&!this._rateLimiter.okayToSend()?Promise.resolve():this._ble.write(w,A,r.uint8ArrayToBase64(B),"base64"):Promise.resolve()}generateOutputCommand(A,B,t,e){const g=[0,S.OUTPUT,A,B,t,...e];return g.unshift(g.length+1),g}generateInputCommand(A,B,t,e){const g=[0,S.PORT_INPUT_FORMAT_SETUP_SINGLE,A,B].concat(sA(t)).concat([e]);return g.unshift(g.length+1),g}_onConnect(){this._ble.startNotifications(w,C,this._onMessage),this._pingDeviceId=window.setInterval(this._pingDevice,5e3),setTimeout(()=>{const A=[0,S.HUB_PROPERTIES,b,z];A.unshift(A.length+1),this.send(C,A,!1)},500)}_onMessage(A){const B=r.base64ToUint8Array(A),t=B[2],e=B[3];switch(t){case S.HUB_PROPERTIES:switch(B[3]){case b:{const A=rA([36,2,0,16]);rA(B.slice(5,B.length))5?(this._colorSamples.pop(),this._colorSamples.every((A,B,t)=>A===t[0])?(this._sensors.previousColor=this._sensors.color,this._sensors.color=this.boostColorForIndex(this._colorSamples[0])):this._sensors.color=p):this._sensors.color=p;break;case D:case u:this.motor(e).position=rA(B.slice(4,8));break;case Y:case h:case M:break;default:o.warn("Unknown sensor value! Type: ".concat(A))}break}case S.PORT_FEEDBACK:{const A=B[4],t=this.motor(e);if(t){const B=A&(U^N);!(A&d)&&B&&t.status===nA&&(t.status=gA)}break}case S.ERROR:o.warn("Error reported by hub: ".concat(B))}}_pingDevice(){this._ble.read(w,C,!1)}_registerSensorOrMotor(A,B){this._ports[A]=B,B!==u&&B!==D||(this._motors[A]=new cA(this,A));let t=null,e=1;switch(B){case u:case D:t=tA;break;case F:t=BA,e=0;break;case M:t=AA,this.setLEDMode(),this.setLED(255);break;case l:t=$;break;default:t=eA}const g=this.generateInputCommand(A,t,e,!0);this.send(C,g)}_clearPort(A){const B=this._ports[A];B===l&&(this._sensors.tiltX=this._sensors.tiltY=0),B===F&&(this._sensors.color=p),this._ports[A]="none",this._motors[A]=null}}const oA="A",wA="B",CA="C",aA="D",IA="AB",hA="ABCD",YA="this way",MA="that way",FA="reverse",DA="up",uA="down",lA="left",dA="right",UA="any";class NA{static get EXTENSION_ID(){return"boost"}static get TILT_THRESHOLD(){return 15}constructor(A){this.runtime=A,this._peripheral=new EA(this.runtime,NA.EXTENSION_ID)}getInfo(){return{id:NA.EXTENSION_ID,name:"BOOST",blockIconURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACpQTFRF////fIel5ufolZ62/2YavsPS+YZOkJmy9/j53+Hk6+zs6N/b6dfO////tDhMHAAAAA50Uk5T/////////////////wBFwNzIAAAA6ElEQVR42uzX2w6DIBAEUGDVtlr//3dLaLwgiwUd2z7MJPJg5EQWiGhGcAxBggQJEiT436CIfqXJPTn3MKNYYMSDFpoAmp24OaYgvwKnFgL2zvVTCwHrMoMi+nUQLFthaNCCa0iwclLkDgYVsQp0mzxuqXgK1MRzoCLWgkPXNN2wI/q6Kvt7u/cX0HtejN8x2sXpnpb8J8D3b0Keuhh3X975M+i0xNVbg3s1TIasgK21bQyGO+s2PykaGMYbge8KrNrssvkOWDXkErB8UuBHETjoYLkKBA8ZfuDkbwVBggQJEiR4MC8BBgDTtMZLx2nFCQAAAABJRU5ErkJggg==",showStatusButton:!0,blocks:[{opcode:"motorOnFor",text:Q({id:"boost.motorOnFor",default:"turn motor [MOTOR_ID] for [DURATION] seconds",description:"turn a motor on for some time"}),blockType:g.COMMAND,arguments:{MOTOR_ID:{type:e.STRING,menu:"MOTOR_ID",defaultValue:oA},DURATION:{type:e.NUMBER,defaultValue:1}}},{opcode:"motorOnForRotation",text:Q({id:"boost.motorOnForRotation",default:"turn motor [MOTOR_ID] for [ROTATION] rotations",description:"turn a motor on for rotation"}),blockType:g.COMMAND,arguments:{MOTOR_ID:{type:e.STRING,menu:"MOTOR_ID",defaultValue:oA},ROTATION:{type:e.NUMBER,defaultValue:1}}},{opcode:"motorOn",text:Q({id:"boost.motorOn",default:"turn motor [MOTOR_ID] on",description:"turn a motor on indefinitely"}),blockType:g.COMMAND,arguments:{MOTOR_ID:{type:e.STRING,menu:"MOTOR_ID",defaultValue:oA}}},{opcode:"motorOff",text:Q({id:"boost.motorOff",default:"turn motor [MOTOR_ID] off",description:"turn a motor off"}),blockType:g.COMMAND,arguments:{MOTOR_ID:{type:e.STRING,menu:"MOTOR_ID",defaultValue:oA}}},{opcode:"setMotorPower",text:Q({id:"boost.setMotorPower",default:"set motor [MOTOR_ID] speed to [POWER] %",description:"set the motor's speed without turning it on"}),blockType:g.COMMAND,arguments:{MOTOR_ID:{type:e.STRING,menu:"MOTOR_ID",defaultValue:hA},POWER:{type:e.NUMBER,defaultValue:100}}},{opcode:"setMotorDirection",text:Q({id:"boost.setMotorDirection",default:"set motor [MOTOR_ID] direction [MOTOR_DIRECTION]",description:"set the motor's turn direction without turning it on"}),blockType:g.COMMAND,arguments:{MOTOR_ID:{type:e.STRING,menu:"MOTOR_ID",defaultValue:oA},MOTOR_DIRECTION:{type:e.STRING,menu:"MOTOR_DIRECTION",defaultValue:YA}}},{opcode:"getMotorPosition",text:Q({id:"boost.getMotorPosition",default:"motor [MOTOR_REPORTER_ID] position",description:"the position returned by the motor"}),blockType:g.REPORTER,arguments:{MOTOR_REPORTER_ID:{type:e.STRING,menu:"MOTOR_REPORTER_ID",defaultValue:oA}}},{opcode:"whenColor",text:Q({id:"boost.whenColor",default:"when [COLOR] brick seen",description:"check for when color"}),blockType:g.HAT,arguments:{COLOR:{type:e.STRING,menu:"COLOR",defaultValue:H}}},{opcode:"seeingColor",text:Q({id:"boost.seeingColor",default:"seeing [COLOR] brick?",description:"is the color sensor seeing a certain color?"}),blockType:g.BOOLEAN,arguments:{COLOR:{type:e.STRING,menu:"COLOR",defaultValue:H}}},{opcode:"whenTilted",text:Q({id:"boost.whenTilted",default:"when tilted [TILT_DIRECTION_ANY]",description:"check when tilted in a certain direction"}),func:"isTilted",blockType:g.HAT,arguments:{TILT_DIRECTION_ANY:{type:e.STRING,menu:"TILT_DIRECTION_ANY",defaultValue:UA}}},{opcode:"getTiltAngle",text:Q({id:"boost.getTiltAngle",default:"tilt angle [TILT_DIRECTION]",description:"the angle returned by the tilt sensor"}),blockType:g.REPORTER,arguments:{TILT_DIRECTION:{type:e.STRING,menu:"TILT_DIRECTION",defaultValue:DA}}},{opcode:"setLightHue",text:Q({id:"boost.setLightHue",default:"set light color to [HUE]",description:"set the LED color"}),blockType:g.COMMAND,arguments:{HUE:{type:e.NUMBER,defaultValue:50}}}],menus:{MOTOR_ID:{acceptReporters:!0,items:[{text:"A",value:oA},{text:"B",value:wA},{text:"C",value:CA},{text:"D",value:aA},{text:"AB",value:IA},{text:"ABCD",value:hA}]},MOTOR_REPORTER_ID:{acceptReporters:!0,items:[{text:"A",value:oA},{text:"B",value:wA},{text:"C",value:CA},{text:"D",value:aA}]},MOTOR_DIRECTION:{acceptReporters:!0,items:[{text:Q({id:"boost.motorDirection.forward",default:"this way",description:"label for forward element in motor direction menu for LEGO Boost extension"}),value:YA},{text:Q({id:"boost.motorDirection.backward",default:"that way",description:"label for backward element in motor direction menu for LEGO Boost extension"}),value:MA},{text:Q({id:"boost.motorDirection.reverse",default:"reverse",description:"label for reverse element in motor direction menu for LEGO Boost extension"}),value:FA}]},TILT_DIRECTION:{acceptReporters:!0,items:[{text:Q({id:"boost.tiltDirection.up",default:"up",description:"label for up element in tilt direction menu for LEGO Boost extension"}),value:DA},{text:Q({id:"boost.tiltDirection.down",default:"down",description:"label for down element in tilt direction menu for LEGO Boost extension"}),value:uA},{text:Q({id:"boost.tiltDirection.left",default:"left",description:"label for left element in tilt direction menu for LEGO Boost extension"}),value:lA},{text:Q({id:"boost.tiltDirection.right",default:"right",description:"label for right element in tilt direction menu for LEGO Boost extension"}),value:dA}]},TILT_DIRECTION_ANY:{acceptReporters:!0,items:[{text:Q({id:"boost.tiltDirection.up",default:"up"}),value:DA},{text:Q({id:"boost.tiltDirection.down",default:"down"}),value:uA},{text:Q({id:"boost.tiltDirection.left",default:"left"}),value:lA},{text:Q({id:"boost.tiltDirection.right",default:"right"}),value:dA},{text:Q({id:"boost.tiltDirection.any",default:"any",description:"label for any element in tilt direction menu for LEGO Boost extension"}),value:UA}]},COLOR:{acceptReporters:!0,items:[{text:Q({id:"boost.color.red",default:"red",description:"the color red"}),value:R},{text:Q({id:"boost.color.blue",default:"blue",description:"the color blue"}),value:y},{text:Q({id:"boost.color.green",default:"green",description:"the color green"}),value:J},{text:Q({id:"boost.color.yellow",default:"yellow",description:"the color yellow"}),value:k},{text:Q({id:"boost.color.white",default:"white",desription:"the color white"}),value:T},{text:Q({id:"boost.color.black",default:"black",description:"the color black"}),value:j},{text:Q({id:"boost.color.any",default:"any color",description:"any color"}),value:H}]}}}}motorOnFor(A){let B=1e3*i.toNumber(A.DURATION);return B=c.clamp(B,0,15e3),new Promise(t=>{this._forEachMotor(A.MOTOR_ID,A=>{const t=this._peripheral.motor(A);t&&t.turnOnFor(B)}),setTimeout(t,B)})}motorOnForRotation(A){let B=360*i.toNumber(A.ROTATION);const t=Math.sign(B);B=Math.abs(c.clamp(B,-36e4,36e4));const e=[];this._forEachMotor(A.MOTOR_ID,A=>{e.push(A)});const g=e.map(A=>{const e=this._peripheral.motor(A);return e?0===e.power?Promise.resolve():new Promise(A=>{e.turnOnForDegrees(B,t),e.pendingRotationPromise=A}):null});return Promise.all(g).then(()=>{})}motorOn(A){return this._forEachMotor(A.MOTOR_ID,A=>{const B=this._peripheral.motor(A);B&&B.turnOnForever()}),new Promise(A=>{window.setTimeout(()=>{A()},a)})}motorOff(A){return this._forEachMotor(A.MOTOR_ID,A=>{const B=this._peripheral.motor(A);B&&B.turnOff()}),new Promise(A=>{window.setTimeout(()=>{A()},a)})}setMotorPower(A){return this._forEachMotor(A.MOTOR_ID,B=>{const t=this._peripheral.motor(B);if(t)switch(t.power=c.clamp(i.toNumber(A.POWER),0,100),t.status){case iA:t.turnOnForever();break;case QA:t.turnOnFor(t.pendingDurationTimeoutStartTime+t.pendingDurationTimeoutDelay-Date.now())}}),new Promise(A=>{window.setTimeout(()=>{A()},a)})}setMotorDirection(A){return this._forEachMotor(A.MOTOR_ID,B=>{const t=this._peripheral.motor(B);if(t){switch(A.MOTOR_DIRECTION){case YA:t.direction=1;break;case MA:t.direction=-1;break;case FA:t.direction=-t.direction;break;default:o.warn("Unknown motor direction in setMotorDirection: ".concat(A.DIRECTION))}if(t)switch(t.status){case iA:t.turnOnForever();break;case QA:t.turnOnFor(t.pendingDurationTimeoutStartTime+t.pendingDurationTimeoutDelay-Date.now())}}}),new Promise(A=>{window.setTimeout(()=>{A()},a)})}getMotorPosition(A){let B=null;switch(A.MOTOR_REPORTER_ID){case oA:B=f.A;break;case wA:B=f.B;break;case CA:B=f.C;break;case aA:B=f.D;break;default:return o.warn("Asked for a motor position that doesnt exist!"),!1}if(null!==B&&this._peripheral.motor(B)){let A=this._peripheral.motor(B).position;return B===f.A&&(A*=-1),c.wrapClamp(A,0,360)}return 0}_forEachMotor(A,B){let t;switch(A){case oA:t=[f.A];break;case wA:t=[f.B];break;case CA:t=[f.C];break;case aA:t=[f.D];break;case IA:t=[f.A,f.B];break;case hA:t=[f.A,f.B,f.C,f.D];break;default:o.warn("Invalid motor ID: ".concat(A)),t=[]}for(const A of t)B(A)}whenTilted(A){return this._isTilted(A.TILT_DIRECTION_ANY)}isTilted(A){return this._isTilted(A.TILT_DIRECTION_ANY)}getTiltAngle(A){return this._getTiltAngle(A.TILT_DIRECTION)}_isTilted(A){switch(A){case UA:return Math.abs(this._peripheral.tiltX)>=NA.TILT_THRESHOLD||Math.abs(this._peripheral.tiltY)>=NA.TILT_THRESHOLD;default:return this._getTiltAngle(A)>=NA.TILT_THRESHOLD}}_getTiltAngle(A){switch(A){case DA:return this._peripheral.tiltY>90?256-this._peripheral.tiltY:-this._peripheral.tiltY;case uA:return this._peripheral.tiltY>90?this._peripheral.tiltY-256:this._peripheral.tiltY;case lA:return this._peripheral.tiltX>90?this._peripheral.tiltX-256:this._peripheral.tiltX;case dA:return this._peripheral.tiltX>90?256-this._peripheral.tiltX:-this._peripheral.tiltX;default:o.warn("Unknown tilt direction in _getTiltAngle: ".concat(A))}}whenColor(A){return A.COLOR===H?this._peripheral.color!==p&&this._peripheral.color!==this._peripheral.previousColor:A.COLOR===this._peripheral.color}seeingColor(A){return A.COLOR===H?this._peripheral.color!==p:A.COLOR===this._peripheral.color}setLightHue(A){let B=i.toNumber(A.HUE);B=c.wrapClamp(B,0,100);const t=360*B/100,e=n.hsvToRgb({h:t,s:1,v:1}),g=n.rgbToDecimal(e);return this._peripheral._led=B,this._peripheral.setLED(g),new Promise(A=>{window.setTimeout(()=>{A()},a)})}}A.exports=NA},function(A,B,t){const e=t(6),g=t(3),i=t(0),Q=t(5),n=t(4),s=t(42),r=t(334),c=t(335),E={service:"d91714ef-28b9-4f91-ba16-f0d9a604f112",commandChar:"f4bf14a6-c7d5-4b6d-8aa8-df1a7c83adcb",responseChar:"b41e6675-a329-40e0-aa01-44d2f444babe"},o=1,w=2,C=3,a=4,I=5,h=6,Y=7;class M{constructor(A,B){this._runtime=A,this._ble=null,this._device=null,this._runtime.registerPeripheralExtension(B,this),this._extensionId=B,this._sensors={force:0,accelerationX:0,accelerationY:0,accelerationZ:0,spinSpeedX:0,spinSpeedY:0,spinSpeedZ:0},this._timeoutID=null,this.reset=this.reset.bind(this),this._onConnect=this._onConnect.bind(this)}scan(){this._ble&&this._ble.disconnect(),this._ble=new s(this._runtime,this._extensionId,{filters:[{namePrefix:"GDX-FOR"}],optionalServices:[E.service]},this._onConnect,this.reset)}connect(A){this._ble&&this._ble.connectPeripheral(A)}disconnect(){this._ble&&this._ble.disconnect(),this.reset()}reset(){this._sensors={force:0,accelerationX:0,accelerationY:0,accelerationZ:0,spinSpeedX:0,spinSpeedY:0,spinSpeedZ:0},this._timeoutID&&(window.clearInterval(this._timeoutID),this._timeoutID=null)}isConnected(){let A=!1;return this._ble&&(A=this._ble.isConnected()),A}_onConnect(){const A=new c(this._ble,E);r.createDevice(A,{open:!0,startMeasurements:!1}).then(A=>{this._device=A,this._device.keepValues=!1,this._device.sensors.forEach(A=>{A.setEnabled(!0)}),this._device.on("measurements-started",()=>{this._device.sensors.filter(A=>A.enabled).forEach(A=>{A.on("value-changed",A=>{this._onSensorValueChanged(A)})}),this._timeoutID=window.setInterval(()=>this._ble.handleDisconnectError("Force and Acceleration extension stopped receiving data"),4500)}),this._device.start(80)})}_onSensorValueChanged(A){switch(A.number){case o:this._sensors.force=n.clamp(2*A.value,-100,100);break;case w:this._sensors.accelerationX=A.value;break;case C:this._sensors.accelerationY=A.value;break;case a:this._sensors.accelerationZ=A.value;break;case I:this._sensors.spinSpeedX=this._spinSpeedFromGyro(A.value);break;case h:this._sensors.spinSpeedY=this._spinSpeedFromGyro(A.value);break;case Y:this._sensors.spinSpeedZ=this._spinSpeedFromGyro(A.value)}window.clearInterval(this._timeoutID),this._timeoutID=window.setInterval(()=>this._ble.handleDisconnectError("Force and Acceleration extension stopped receiving data"),4500)}_spinSpeedFromGyro(A){const B=1e3/this._runtime.currentStepTime;return A=n.radToDeg(A),A/=B,A*=-1}getForce(){return this._sensors.force}getTiltFrontBack(A=!1){const B=this.getAccelerationX(),t=this.getAccelerationY(),e=this.getAccelerationZ();let g=t*t+e*e;return g=Math.sqrt(g),g<.35?g=B<0?90:-90:(g=B/g,g=Math.atan(g),g=-1*n.radToDeg(g)),A&&(g*=-1),g}getTiltLeftRight(A=!1){const B=this.getAccelerationX(),t=this.getAccelerationY(),e=this.getAccelerationZ();let g=B*B+e*e;return g=Math.sqrt(g),g<.35?g=t<0?90:-90:(g=t/g,g=Math.atan(g),g=-1*n.radToDeg(g)),A&&(g*=-1),g}getAccelerationX(){return this._sensors.accelerationX}getAccelerationY(){return this._sensors.accelerationY}getAccelerationZ(){return this._sensors.accelerationZ}getSpinSpeedX(){return this._sensors.spinSpeedX}getSpinSpeedY(){return this._sensors.spinSpeedY}getSpinSpeedZ(){return this._sensors.spinSpeedZ}}const F="pushed",D="pulled",u="shaken",l="started falling",d="turned face up",U="turned face down",N="front",m="back",G="left",f="right",H="any",p="x",R="y",y="z";class J{static get EXTENSION_NAME(){return"Force and Acceleration"}static get EXTENSION_ID(){return"gdxfor"}get AXIS_MENU(){return[{text:"x",value:p},{text:"y",value:R},{text:"z",value:y}]}get TILT_MENU(){return[{text:Q({id:"gdxfor.tiltDirectionMenu.front",default:"front",description:"label for front element in tilt direction picker for gdxfor extension"}),value:N},{text:Q({id:"gdxfor.tiltDirectionMenu.back",default:"back",description:"label for back element in tilt direction picker for gdxfor extension"}),value:m},{text:Q({id:"gdxfor.tiltDirectionMenu.left",default:"left",description:"label for left element in tilt direction picker for gdxfor extension"}),value:G},{text:Q({id:"gdxfor.tiltDirectionMenu.right",default:"right",description:"label for right element in tilt direction picker for gdxfor extension"}),value:f}]}get TILT_MENU_ANY(){return[...this.TILT_MENU,{text:Q({id:"gdxfor.tiltDirectionMenu.any",default:"any",description:"label for any direction element in tilt direction picker for gdxfor extension"}),value:H}]}get PUSH_PULL_MENU(){return[{text:Q({id:"gdxfor.pushed",default:"pushed",description:"the force sensor was pushed inward"}),value:F},{text:Q({id:"gdxfor.pulled",default:"pulled",description:"the force sensor was pulled outward"}),value:D}]}get GESTURE_MENU(){return[{text:Q({id:"gdxfor.shaken",default:"shaken",description:"the sensor was shaken"}),value:u},{text:Q({id:"gdxfor.startedFalling",default:"started falling",description:"the sensor started free falling"}),value:l},{text:Q({id:"gdxfor.turnedFaceUp",default:"turned face up",description:"the sensor was turned to face up"}),value:d},{text:Q({id:"gdxfor.turnedFaceDown",default:"turned face down",description:"the sensor was turned to face down"}),value:U}]}constructor(A){this.runtime=A,this._peripheral=new M(this.runtime,J.EXTENSION_ID)}getInfo(){return{id:J.EXTENSION_ID,name:J.EXTENSION_NAME,blockIconURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAACCNJREFUeAHtnGtsFFUUgM+dfXbbbbcWaKHSFgrlkWgkJCb6A4kmJfiHIBYBpcFfRg1GEkmEVAvhFYw/TExMxGoICAECiZEIIUQCiiT4gh+KILRQCi2ENIV2t/ue6zl3u2Upu4XuzO4csCe587iPmXO/OWfunTszV4ABWfflQU+0p+9bTcLzEmS5gUPlvagAcVMXcMpnK1u+evW8QLYKaNkWpHKxnt6dQsqFjxo80p10Jt1vx7t30n62Ys+2IJUTUpDlqUNomgYutwsjhZFD5r6slBAOhUHX9YTe6D1GTmrIAhFeBZ2c4JFCpBiggmwlBR7pTGLUewxZYBIUWV7yqgb7g8lotuukt5ihqyELHCSEbusk931ExMxbjSkWSNxEyr3vysxZLFHWnDuT0CtFV6OKmmOBRrV4hMubZoGmMZA6lHTfgsLeHnBEIiCxUY86XRDw+sBfOgZ0m820U5lxIFYAncF+GNvVDo5QaLBu1ClyYTyF4tvd8lZltQgXFA6mW73BxoVt0ShUXG2VCp4QQdDEFqez4Bm7p7gaO0of422r3x4Ji/KrbdIexu4SE2FjgWO6OkCLx6gt6gxOiNV92tiY+ni1Ye1nu7dpQfk35ikru9EBN6unsEDIwgLJPQv8dwCfT3WPt+iFIfAUqM3vL7vpjmuz0KX1gkAfOMN33dxKkjwA9vsTDIS8uubdBZcyAWlqWtohQbRSuru/L1O2vMazAGiLxRKVFqDgDEdAaHCN0kU8Ply2vKWxABhzJZ5ipC6qHlRzfJxVz99S49GdYQEw7PYkuAmokZJ6fumlQUqiNpVSQ56i9JnyHMsCYMRdADGHk0ZyHM1b976XicH0rXtWYR57FPNSGQ7CAiCBCJQ8oXhI0FdmBiPfVnl9ZZmz5DmFDcA+HwIUOEYMcjL2+e57PbBp04HxONI4ifIEKC8TYQMwhs+7IU+hwBFOYQvB5qF8grbwJnRfQXnIhbkIG4AExF+ScE00w0X3AZLwisrDyH1JH1YAA8UlIG029FRZsu6TPfVJiIltWYIjMTLgLUlGs1izeRYmGtS383t9wnu7G2J6fH/Tln2LNUdExGLxvZSOQ1qCS/+P9CFhBZAUuj12PHgCvRJHZ7w4EnhYjya6hXGHQ2Jaxj4ilbVC2AFEUNBVXSdKb3WC29+rmISKiqFn7ARBadyEHUACFHM64VZlDTdWafVh1Yik1ZB5JEsLJGaVtosw37ld4TscWQHX4+oRWO1zWrAEWCR6oMnTCEXijmI1234MVvsPgV+WcmKndGHpwlNtZwbhkZYEkuI4CkuAXfpk0HGAPym0TXEchaUL39Br4JvQeljk+lwxOxBeCRQ3UrFHI+AMBsEV6gcnhlwIS4BU0RORV1V42EqnwnLgSyo3AsM3eA9bPOt8bAEOV6NUWGRZ9FYvHSx6R0pfYgkMmk2DCH1+Z7KwB5gKazjLGgpLgUOAuRZWALnDSncxLAOYCmskbqjhe02h5d6y0sFKF5cXgI8LrLwB9PTeGew6POwNnptlpYOVLi4nFjjuWts957rnBk8tomoZ+bjhPcqOcCcnAG34EaTqOjxmsNKxzQnAkX5wronsOry6zIn66ThljLNcg+W1a2Gi55+MCg6XcKl3NuxrbxouS87TLAcY1V0QV5+8jLyuEekeeSGTS1gOcM/lZpOrlN/DsRzOyi8CY2fLuwUum/wR1BT+ZUzrDKUv9D4LB9rXZEjNTfRjZYFS5r86ebfA3W0bcmMKFh01/5fMoorm6rSjAA2SNc2F8dvmQVWCgdy8fxg8gcEN0pWez80QUyyQFAqn/N9mhmK5PAYN7adecCPnMsUCCZ7U8ari4IGb87wJeKFDA/MlmHXBDVkgTR1CV4/gaThKzBoeKYpuSzqSrqSzEiFuJDayWxqyQJp3RUhYSKfWUSEz5iDIrhrZl8I5b37JvrTBT3wdpd43cOqT/WiJhq6ikQpkW5a8BxuS/X219uXZHoPKmdMUGdEgpWzTll3Kr95Z8VJK7N3NL7b/qHY2rnmdjd6G7oF3q/b/3RoFaPDajwIcBWiQgMHioxZoEKChfqDBc2csnmxtM2ZglMDKArFvduhBbLDv9sOD8oymA0xBCHVtl6+c7ey6Ibdt+3ox7WOoxMCmD4i68PrZkBQaEDUe1tnVqSyyfl79+vr6evz1C2jKogkYWEEc0JnViiZRqKuoqJiZtEJcn0GIsykewzhW2jJVZjzBamxsfK79ase/5MoXL106TnEDwfq36qgIF6HGjKyqFsNkDGMwUNxEDEmIHQTxyNGjH1AchvumBcC4vAuXVpiA+TDYMFDXiiZFoN+SrmMI7tixo/v3337diNtQUzNpPq1RChIra5ccAFKDUEwYLra2fnXu3PmtA0gojqbaVUNl23ft+pPiPW73U7RGYdGH5QCQYCg93C73075S34I5c+ZQa0s/B1Njou51tVVVatJAXcrED3Q4EI5plgsHgAQiSiRCoRD9ECeam9fPo32UJzFQYwJLlix9mdZ9fb1naY2iyiQ2rVtyAEi199Pi5M8/tdB62vRpzceOH3+toaHBh61w2clTp96sqq5ehUnxw0eO7KA8KKpMYtO6JZcOKTUeNRhsp0+ffmtilYI1VLf4+Qvn1784d+5ezEfW144hMR05blglpDgHSbqxt6Wl5Y8ZM6afKq8oL7LZHd54PH7H7w+cOPj9dx8uXbLk+ICynbhm4cJDr7LVMKmhoP5dphaWoFGrHMTAQrgBJCjkFdQHpPntqCUmiWCge14PBsvdFnUYlP8AMAKfKIKmYukAAAAASUVORK5CYII=",menuIconURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABGdBTUEAALGPC/xhBQAAA9dJREFUWAnNmE2IFEcUgF/9dE/v7LoaM9kkK4JBRA0EFBIPRm85hBAvEXHXwyo5eFE87GFcReMkObgJiQnkkJzEg9n8HIJixKNe1IMKihgiCbviwV11V3d0d3pmuqsqr5ppcEnb3TNVggVFVVe9eu+r97qqq4tASqp8/fsboQgmU0TMugi571K29bPy9ovPU8Sf16HbpQj3EkYFBcJcr5Am2nZfs94AIWVfqMQeHNwhICUBZ4ypUIA/X2sbIm2AW8AJK0lkEP6TJpfqwXgg4QxmF/fB7Gtvxk1G5ZKHU1CqTgPJoSUXYJYeohSUJu+qrqdVUGh2/pVX4VFffx77WaqBZkrkEFj271+qWH0sXcU3FBzyQe/Mg7B//LbKMTRTxNiDbsMHHjTJlyM7HEJIBHXs2KXFj+oTNSdoQOCYLS5jD9IwBMm5H8NplwwPb/QV4yEIcycaAza9IuA76B38fuz1OF5RXUkmHCdu6rg0BpSMgV/sAe7DdzGFrvvdi0D3mSZjQA0wt7REQsY+iWF0XbfFzyal8SLRxuteD+Du4h4Z/flbqaBHibAQtZmQtcZaAZSMwtTylaR/4vaw1ju5YhWG10pwwAqghmp2FeHO2+t11WqyM80W0m7vAOhsM1kD7CGz8L57Jsq6bitZC/GcWgLf1H6KuHT92cTDAFy/BgXMXm0OCpgV50Bo9kK3BqiBboabQMMU/WoL5im4jToeq/AIgXsiRx5KKCjcwPEsiAv/BQMu9EwyDHXd/3kqCOSzDk6t5/YglQKKeJwq+PNRmJI8kwSTaj1HZy5AhSHqnXkIvU9mMUwEw4Q5wTM57LUtkg8QPw/cdcBJ+PhvKJ0Gj80nGq6JXrg6/XFiX97GXIBpyqTieKpKViOl+WEhWXMaUavvvdIZ8Giy5+Lh3bwKm/t+Be3JazMfxc1tldY26rastiHcsQevTG9pw0znovkAcRWHzSDKnZtaOJLSfMFLB5RqtRBS4LbCurqLCy0YPkU3C0IIPEimMqR2ei7ZX2+KQdRi/WahNT/GmfOD4Vyzhx/66pcjp85dUvcmp6J8+txldXh07PPskdkS+V6EbD0vTOKlB0x9B/O6BS8ULly9PgE6x4kDPR/XX5pyYKj8xcCucsUmkNUQE0JvKKm2VioVK5HRE7UKOHbi6B94RzP+93jtpC0vWgXUF0hr3ipuw8uadwd3jXxoA9IK4Pah8t6BneV9GgjD28Svw1mlxFobgFbeFTz13cKbth93fDryp2CEq0a4hTA+aAPQ/ESJFDdvXLzzzrqNjlTqOP6uDeFf0uhvJ0ZP2QD8D6ZzU6u8YIbBAAAAAElFTkSuQmCC",showStatusButton:!0,blocks:[{opcode:"whenGesture",text:Q({id:"gdxfor.whenGesture",default:"when [GESTURE]",description:"when the sensor detects a gesture"}),blockType:g.HAT,arguments:{GESTURE:{type:e.STRING,menu:"gestureOptions",defaultValue:u}}},{opcode:"whenForcePushedOrPulled",text:Q({id:"gdxfor.whenForcePushedOrPulled",default:"when force sensor [PUSH_PULL]",description:"when the force sensor is pushed or pulled"}),blockType:g.HAT,arguments:{PUSH_PULL:{type:e.STRING,menu:"pushPullOptions",defaultValue:F}}},{opcode:"getForce",text:Q({id:"gdxfor.getForce",default:"force",description:"gets force"}),blockType:g.REPORTER},"---",{opcode:"whenTilted",text:Q({id:"gdxfor.whenTilted",default:"when tilted [TILT]",description:"when the sensor detects tilt"}),blockType:g.HAT,arguments:{TILT:{type:e.STRING,menu:"tiltAnyOptions",defaultValue:H}}},{opcode:"isTilted",text:Q({id:"gdxfor.isTilted",default:"tilted [TILT]?",description:"is the device tilted?"}),blockType:g.BOOLEAN,arguments:{TILT:{type:e.STRING,menu:"tiltAnyOptions",defaultValue:H}}},{opcode:"getTilt",text:Q({id:"gdxfor.getTilt",default:"tilt angle [TILT]",description:"gets tilt"}),blockType:g.REPORTER,arguments:{TILT:{type:e.STRING,menu:"tiltOptions",defaultValue:N}}},"---",{opcode:"isFreeFalling",text:Q({id:"gdxfor.isFreeFalling",default:"falling?",description:"is the device in free fall?"}),blockType:g.BOOLEAN},{opcode:"getSpinSpeed",text:Q({id:"gdxfor.getSpin",default:"spin speed [DIRECTION]",description:"gets spin speed"}),blockType:g.REPORTER,arguments:{DIRECTION:{type:e.STRING,menu:"axisOptions",defaultValue:y}}},{opcode:"getAcceleration",text:Q({id:"gdxfor.getAcceleration",default:"acceleration [DIRECTION]",description:"gets acceleration"}),blockType:g.REPORTER,arguments:{DIRECTION:{type:e.STRING,menu:"axisOptions",defaultValue:p}}}],menus:{pushPullOptions:{acceptReporters:!0,items:this.PUSH_PULL_MENU},gestureOptions:{acceptReporters:!0,items:this.GESTURE_MENU},axisOptions:{acceptReporters:!0,items:this.AXIS_MENU},tiltOptions:{acceptReporters:!0,items:this.TILT_MENU},tiltAnyOptions:{acceptReporters:!0,items:this.TILT_MENU_ANY}}}}whenForcePushedOrPulled(A){switch(A.PUSH_PULL){case F:return this._peripheral.getForce()<-5;case D:return this._peripheral.getForce()>5;default:return i.warn("unknown push/pull value in whenForcePushedOrPulled: ".concat(A.PUSH_PULL)),!1}}getForce(){return Math.round(this._peripheral.getForce())}whenGesture(A){switch(A.GESTURE){case u:return this.gestureMagnitude()>30;case l:return this.isFreeFalling();case d:return this._isFacing(d);case U:return this._isFacing(U);default:return i.warn("unknown gesture value in whenGesture: ".concat(A.GESTURE)),!1}}_isFacing(A){void 0===this._facingUp&&(this._facingUp=!1),void 0===this._facingDown&&(this._facingDown=!1);let B=9;switch((this._facingUp||this._facingDown)&&(B-=5),this._facingUp=this._peripheral.getAccelerationZ()>B,this._facingDown=this._peripheral.getAccelerationZ()<-1*B,A){case d:return this._facingUp;case U:return this._facingDown;default:return!1}}whenTilted(A){return this._isTilted(A.TILT)}isTilted(A){return this._isTilted(A.TILT)}getTilt(A){return this._getTiltAngle(A.TILT)}_isTilted(A){switch(A){case H:return this._getTiltAngle(N)>15||this._getTiltAngle(m)>15||this._getTiltAngle(G)>15||this._getTiltAngle(f)>15;default:return this._getTiltAngle(A)>15}}_getTiltAngle(A){if(!this._peripheral.isConnected())return 0;switch(A){case N:return Math.round(this._peripheral.getTiltFrontBack(!0));case m:return Math.round(this._peripheral.getTiltFrontBack(!1));case G:return Math.round(this._peripheral.getTiltLeftRight(!0));case f:return Math.round(this._peripheral.getTiltLeftRight(!1));default:i.warn("Unknown direction in getTilt: ".concat(A))}}getSpinSpeed(A){switch(A.DIRECTION){case p:return Math.round(this._peripheral.getSpinSpeedX());case R:return Math.round(this._peripheral.getSpinSpeedY());case y:return Math.round(this._peripheral.getSpinSpeedZ());default:i.warn("Unknown direction in getSpinSpeed: ".concat(A.DIRECTION))}}getAcceleration(A){switch(A.DIRECTION){case p:return Math.round(this._peripheral.getAccelerationX());case R:return Math.round(this._peripheral.getAccelerationY());case y:return Math.round(this._peripheral.getAccelerationZ());default:i.warn("Unknown direction in getAcceleration: ".concat(A.DIRECTION))}}magnitude(A,B,t){return Math.sqrt(A*A+B*B+t*t)}accelMagnitude(){return this.magnitude(this._peripheral.getAccelerationX(),this._peripheral.getAccelerationY(),this._peripheral.getAccelerationZ())}gestureMagnitude(){return this.accelMagnitude()-9.8}spinMagnitude(){return this.magnitude(this._peripheral.getSpinSpeedX(),this._peripheral.getSpinSpeedY(),this._peripheral.getSpinSpeedZ())}isFreeFalling(){if(!this._peripheral.isConnected())return!1;return this.accelMagnitude()<.5+.3*this.spinMagnitude()}}A.exports=J},function(A,B,t){A.exports=function(){"use strict";function B(A,B,t,e,g,i,Q){try{var n=A[i](Q),s=n.value}catch(A){return void t(A)}n.done?B(s):Promise.resolve(s).then(e,g)}function e(A){return function(){var t=this,e=arguments;return new Promise((function(g,i){var Q=A.apply(t,e);function n(A){B(Q,g,i,n,s,"next",A)}function s(A){B(Q,g,i,n,s,"throw",A)}n(void 0)}))}}function g(A,B){if(!(A instanceof B))throw new TypeError("Cannot call a class as a function")}function i(A,B){for(var t=0;t=0;--i){var Q=this.tryEntries[i],n=Q.completion;if("root"===Q.tryLoc)return e("end");if(Q.tryLoc<=this.prev){var s=g.call(Q,"catchLoc"),r=g.call(Q,"finallyLoc");if(s&&r){if(this.prev=0;--t){var e=this.tryEntries[t];if(e.tryLoc<=this.prev&&g.call(e,"finallyLoc")&&this.prev=0;--B){var t=this.tryEntries[B];if(t.finallyLoc===A)return this.complete(t.completion,t.afterLoc),f(t),a}},catch:function(A){for(var B=this.tryEntries.length-1;B>=0;--B){var t=this.tryEntries[B];if(t.tryLoc===A){var e=t.completion;if("throw"===e.type){var g=e.arg;f(t)}return g}}throw new Error("illegal catch attempt")},delegateYield:function(A,B,e){return this.delegate={iterator:p(A),resultName:B,nextLoc:e},"next"===this.method&&(this.arg=t),a}}}function F(A,B,t,e){var g=B&&B.prototype instanceof u?B:u,i=Object.create(g.prototype),Q=new H(e||[]);return i._invoke=function(A,B,t){var e=E;return function(g,i){if(e===w)throw new Error("Generator is already running");if(e===C){if("throw"===g)throw i;return R()}for(t.method=g,t.arg=i;;){var Q=t.delegate;if(Q){var n=m(Q,t);if(n){if(n===a)continue;return n}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(e===E)throw e=C,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);e=w;var s=D(A,B,t);if("normal"===s.type){if(e=t.done?C:o,s.arg===a)continue;return{value:s.arg,done:t.done}}"throw"===s.type&&(e=C,t.method="throw",t.arg=s.arg)}}}(A,t,Q),i}function D(A,B,t){try{return{type:"normal",arg:A.call(B,t)}}catch(A){return{type:"throw",arg:A}}}function u(){}function l(){}function d(){}function U(A){["next","throw","return"].forEach((function(B){A[B]=function(A){return this._invoke(B,A)}}))}function N(A){var B;this._invoke=function(t,e){function i(){return new Promise((function(B,i){!function B(t,e,i,Q){var n=D(A[t],A,e);if("throw"!==n.type){var s=n.arg,r=s.value;return r&&"object"==typeof r&&g.call(r,"__await")?Promise.resolve(r.__await).then((function(A){B("next",A,i,Q)}),(function(A){B("throw",A,i,Q)})):Promise.resolve(r).then((function(A){s.value=A,i(s)}),(function(A){return B("throw",A,i,Q)}))}Q(n.arg)}(t,e,B,i)}))}return B=B?B.then(i,i):i()}}function m(A,B){var e=A.iterator[B.method];if(e===t){if(B.delegate=null,"throw"===B.method){if(A.iterator.return&&(B.method="return",B.arg=t,m(A,B),"throw"===B.method))return a;B.method="throw",B.arg=new TypeError("The iterator does not provide a 'throw' method")}return a}var g=D(e,A.iterator,B.arg);if("throw"===g.type)return B.method="throw",B.arg=g.arg,B.delegate=null,a;var i=g.arg;return i?i.done?(B[A.resultName]=i.value,B.next=A.nextLoc,"return"!==B.method&&(B.method="next",B.arg=t),B.delegate=null,a):i:(B.method="throw",B.arg=new TypeError("iterator result is not an object"),B.delegate=null,a)}function G(A){var B={tryLoc:A[0]};1 in A&&(B.catchLoc=A[1]),2 in A&&(B.finallyLoc=A[2],B.afterLoc=A[3]),this.tryEntries.push(B)}function f(A){var B=A.completion||{};B.type="normal",delete B.arg,A.completion=B}function H(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(G,this),this.reset(!0)}function p(A){if(A){var B=A[Q];if(B)return B.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var e=-1,i=function B(){for(;++e-1)return t.splice(e,1),this._listenerMap.set(A,t),!0}return!1}},{key:"unbind",value:function(){this._listenerMap.clear()}},{key:"emit",value:function(A){for(var B=arguments.length,t=new Array(B>1?B-1:0),e=1;e0&&void 0!==arguments[0]?arguments[0]:{};g(this,A),this.type=B.type,this.mode=B.mode,this.minValue=B.minValue,this.maxValue=B.maxValue,this.uncertainty=B.uncertainty,this.minPeriod=B.minPeriod,this.maxPeriod=B.maxPeriod,this.typicalPeriod=B.typicalPeriod,this.granularity=B.granularity},D=function A(){var B=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};g(this,A),this.number=B.number,this.name=B.name,this.unit=B.unit,this.id=B.id,this.mutalExclusionMask=B.mutalExclusionMask,this.measurementInfo=B.measurementInfo},u=function(A){function B(A){var t;return g(this,B),(t=r(this,s(B).call(this))).number=A.number,t.name=A.name,t.unit=A.unit,t.specs=A,t.enabled=!1,t.values=[],t.value=null,t}return n(B,h),Q(B,[{key:"clear",value:function(){this.value=null,this.values=[]}},{key:"setValue",value:function(A,B){this.value=A,B&&this.values.push(this.value),this.emit("value-changed",this)}},{key:"setEnabled",value:function(A){this.enabled!==A&&(this.enabled=A,this.emit("state-changed",this))}}]),B}(),l=function(A){function B(A){var e;if(g(this,B),e=r(this,s(B).call(this)),"undefined"==typeof TextDecoder){var i=t(48);M=i.TextDecoder}else M=TextDecoder;return e.device=A,e.sensors=[],e.opened=!1,e.rollingCounter=0,e.collecting=!1,e.measurementPeriod=10,e.response=null,e.remainingResponseLength=0,e.defaultSensorsMask=0,e.keepValues=!0,e.minMeasurementPeriod=10,e.serialNumber="",e.orderCode="",e.name="",e}return n(B,h),Q(B,[{key:"getBatteryLevel",value:function(){var A=e(regeneratorRuntime.mark((function A(){var B;return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._getStatus();case 2:return B=A.sent,A.abrupt("return",B.battery);case 4:case"end":return A.stop()}}),A,this)})));return function(){return A.apply(this,arguments)}}()},{key:"getChargingState",value:function(){var A=e(regeneratorRuntime.mark((function A(){var B;return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._getStatus();case 2:return B=A.sent,A.abrupt("return",B.chargingStatus);case 4:case"end":return A.stop()}}),A,this)})));return function(){return A.apply(this,arguments)}}()},{key:"open",value:function(){var A=e(regeneratorRuntime.mark((function A(){var B,t=arguments;return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return B=t.length>0&&void 0!==t[0]&&t[0],A.prev=1,A.next=4,this._connect();case 4:return A.next=6,this._init();case 6:return A.next=8,this._getStatus();case 8:return A.next=10,this._getDeviceInfo();case 10:return A.next=12,this._getDefaultSensorsMask();case 12:return A.next=14,this._getAvailableSensors();case 14:this._onOpened(),B&&this.start(),A.next=21;break;case 18:A.prev=18,A.t0=A.catch(1),console.error(A.t0);case 21:case"end":return A.stop()}}),A,this,[[1,18]])})));return function(){return A.apply(this,arguments)}}()},{key:"close",value:function(){var A=e(regeneratorRuntime.mark((function A(){return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._stopMeasurements();case 2:return A.next=4,this._sendCommand(a.DISCONNECT);case 4:return A.abrupt("return",this._disconnect());case 5:case"end":return A.stop()}}),A,this)})));return function(){return A.apply(this,arguments)}}()},{key:"enableDefaultSensors",value:function(){for(var A=1,B=0;B<32;++B){if((this.defaultSensorsMask&A)===A){var t=this.getSensor(B);t&&t.setEnabled(!0)}A<<=1}}},{key:"start",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,B=this.sensors.filter((function(A){return A.enabled}));0===B.length&&(this.enableDefaultSensors(),B=this.sensors.filter((function(A){return A.enabled}))),B.forEach((function(A){return A.clear()})),A&&(this.measurementPeriod=A),this._startMeasurements()}},{key:"stop",value:function(){this._stopMeasurements()}},{key:"getSensor",value:function(A){return this.sensors.find((function(B){return B.number===A}))}},{key:"_connect",value:function(){var A=e(regeneratorRuntime.mark((function A(){var B=this;return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",this.device.setup({onClosed:function(){return B._onClosed()},onResponse:function(A){return B._handleResponse(A)}}));case 1:case"end":return A.stop()}}),A,this)})));return function(){return A.apply(this,arguments)}}()},{key:"_disconnect",value:function(){var A=e(regeneratorRuntime.mark((function A(){return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",this.device.close());case 1:case"end":return A.stop()}}),A,this)})));return function(){return A.apply(this,arguments)}}()},{key:"_init",value:function(){return this.collecting=!1,this.rollingCounter=255,this.writeQueue=[],this._sendCommand(a.INIT)}},{key:"_handleResponse",value:function(A){if("command notified: ".concat(Y(A.buffer)),this.remainingResponseLegnth>0){if(this.remainingResponseLegnth-=A.buffer.byteLength,this.response=new DataView((B=this.response.buffer,t=A.buffer.slice(0),(e=new Uint8Array(B.byteLength+t.byteLength)).set(new Uint8Array(B),0),e.set(new Uint8Array(t),B.byteLength),e.buffer)),this.remainingResponseLegnth>0)return}else this.response=A;var B,t,e,g=this.response.getUint8(1);if(g>this.response.buffer.byteLength)this.remainingResponseLegnth=g-this.response.buffer.byteLength;else switch("handle command: ".concat(Y(this.response.buffer)),this.response.getUint8(0)){case 32:this._processMeasurements(this.response);break;default:var i=this.response.getUint8(4),Q=this.response.getUint8(5),n=new DataView(this.response.buffer,6);this._resolveWriteCommand(i,Q,n),this.remainingResponseLegnth=0,this.response=null}}},{key:"_getSensorsWithMask",value:function(A){for(var B=[],t=1,e=0;e<32;++e){if((A&t)===t){var g=this.getSensor(e);g&&(B.push(g),"available: [".concat(A,"] ").concat(B[B.length-1].number))}t<<=1}return B}},{key:"_processMeasurements",value:function(A){var B=[],t=!0,e=0,g=0,i=A.getUint8(4);switch(i){case 6:B=this._getSensorsWithMask(A.getUint16(5,!0)),e=A.getUint8(7,!0),g=9;break;case 7:B=this._getSensorsWithMask(A.getUint32(5,!0)),e=A.getUint8(9,!0),g=11;break;case 10:case 8:B[0]=this.getSensor(A.getUint8(6)),e=A.getUint8(7,!0),g=8;break;case 11:case 9:B[0]=this.getSensor(A.getUint8(6)),e=A.getUint8(7,!0),g=8,t=!1;break;case 12:case 13:case 14:"Purposely Ignoring packet type: ".concat(i);break;default:"Unknown packet type: ".concat(i)}for(var Q=0;Q255?0:t}},{key:"_sendCommand",value:function(A){var B=new Uint8Array(a.HEADER.byteLength+A.byteLength);return B.set(new Uint8Array(a.HEADER),0),B.set(new Uint8Array(A),a.HEADER.byteLength),B[1]=B.length,B[2]=this._decRollingCounter(),B[3]=this._calculateChecksum(B),this._queueWriteCommand(B,0,B.length)}},{key:"_writeCommand",value:function(){var A=e(regeneratorRuntime.mark((function A(B,t,e){var g;return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(!(e>0)){A.next=12;break}return A.prev=1,e>20?(g=B.subarray(t,t+20),e-=20,t+=20):(g=B.subarray(t,t+e),e=0),A.next=5,this.device.writeCommand(g);case 5:A.next=10;break;case 7:A.prev=7,A.t0=A.catch(1),"Write Failure: ".concat(A.t0);case 10:A.next=0;break;case 12:case"end":return A.stop()}}),A,this,[[1,7]])})));return function(B,t,e){return A.apply(this,arguments)}}()},{key:"_queueWriteCommand",value:function(A,B,t){var e=this;"command queued: ".concat(Y(A));var g=new Promise((function(B,t){e.writeQueue.push({command:A[4],rollingCounter:A[2],resolve:B,reject:t}),setTimeout((function(){e.writeQueue=e.writeQueue.filter((function(B){return B.command===A[4]&&B.rollingCounter!==A[2]})),t(new Error("write command timed out after 5s. Command: ".concat(A[4].toString(16)," Rolling Counter: ").concat(A[2].toString(16))))}),1e4)}));return this._writeCommand(A,B,t),g}},{key:"_getStatus",value:function(){var A=e(regeneratorRuntime.mark((function A(){var B,t;return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._sendCommand(a.GET_STATUS);case 2:return B=A.sent,t={masterFirmwareVersion:"".concat(B.getUint8(2),".").concat(B.getUint8(3)),bleFirmwareVersion:"".concat(B.getUint8(6),".").concat(B.getUint8(9)),battery:B.getUint8(10),chargingStatus:"".concat(B.getUint8(11))},A.abrupt("return",t);case 5:case"end":return A.stop()}}),A,this)})));return function(){return A.apply(this,arguments)}}()},{key:"_getAvailableSensors",value:function(){var A=e(regeneratorRuntime.mark((function A(){var B,t,e=this;return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._sendCommand(a.GET_SENSOR_IDS).then((function(A){e.availableSensors=A.getUint32(0,!0),"Get Available Sensors Returned ".concat(e.availableSensors)}));case 2:B=1,t=0;case 4:if(!(t<31)){A.next=12;break}if((this.availableSensors&B)!==B){A.next=8;break}return A.next=8,this._getSensorInfo(t);case 8:B<<=1;case 9:++t,A.next=4;break;case 12:case"end":return A.stop()}}),A,this)})));return function(){return A.apply(this,arguments)}}()},{key:"_getDefaultSensorsMask",value:function(){var A=this;return this._sendCommand(a.GET_DEFAULT_SENSORS_MASK).then((function(B){A.defaultSensorsMask=B.getUint32(0,!0)}))}},{key:"_getDeviceInfo",value:function(){var A=this;return this._sendCommand(a.GET_INFO).then((function(B){var t=new M("utf-8");A.orderCode=t.decode(new Uint8Array(B.buffer,6,16).filter(I)),A.serialNumber=t.decode(new Uint8Array(B.buffer,22,16).filter(I)),A.name=t.decode(new Uint8Array(B.buffer,38,32).filter(I))}))}},{key:"_getSensorInfo",value:function(){var A=e(regeneratorRuntime.mark((function A(B){var t,e=this;return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return(t=new Uint8Array(a.GET_SENSOR_INFO))[1]=B,A.abrupt("return",this._sendCommand(t).then((function(A){var B=A.getUint32(2,!0);if(B>0){var t=new M("utf-8"),g=new F({type:A.getUint8(6),mode:A.getUint8(7),minValue:A.getFloat64(108,!0),maxValue:A.getFloat64(116,!0),uncertainty:A.getFloat64(100,!0),minPeriod:A.getUint32(124,!0)/1e3,maxPeriod:((A.getUint32(132,!0)<<32)+A.getUint32(128,!0))/1e3,typicalPeriod:A.getUint32(136,!0)/1e3,granularity:A.getUint32(140,!0)/1e3}),i=new D({number:A.getUint8(0),name:t.decode(new Uint8Array(A.buffer,14,60).filter(I)),unit:t.decode(new Uint8Array(A.buffer,74,32).filter(I)),mutalExclusiveMask:A.getUint32(144,!0),measurementInfo:g,sensorId:B}),Q=new u(i);e.sensors.push(Q),Q.on("state-changed",(function(){"Sensor Restart: ".concat(Q.number),Q.enabled&&(e.measurementPeriod=Q.specs.measurementInfo.typicalPeriod,e.sensors.forEach((function(A){if(Q.number!==A.number&&A.enabled){var B=1<e.measurementPeriod&&(e.measurementPeriod=A.specs.measurementInfo.typicalPeriod)}}))),e._restartMeasurements()}))}})));case 3:case"end":return A.stop()}}),A,this)})));return function(B){return A.apply(this,arguments)}}()},{key:"_restartMeasurements",value:function(){var A=e(regeneratorRuntime.mark((function A(){var B;return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(B=this.collecting,!this.collecting){A.next=10;break}return A.prev=2,A.next=5,this._stopMeasurements();case 5:A.next=10;break;case 7:A.prev=7,A.t0=A.catch(2),console.error(A.t0);case 10:if(this.collecting||!B){A.next=19;break}return A.prev=11,A.next=14,this._startMeasurements();case 14:A.next=19;break;case 16:A.prev=16,A.t1=A.catch(11),console.error(A.t1);case 19:case"end":return A.stop()}}),A,this,[[2,7],[11,16]])})));return function(){return A.apply(this,arguments)}}()},{key:"_setMeasurementPeriod",value:function(A){var B=new Uint8Array(a.SET_MEASUREMENT_PERIOD),t=1e3*this.minMeasurementPeriod;return A>0&255,B[4]=A>>8&255,B[5]=A>>16&255,B[6]=A>>24&255,this._sendCommand(B)}},{key:"_getEnabledChannelMask",value:function(){var A=0;return this.sensors.filter((function(A){return A.enabled})).forEach((function(B){A+=1<>0&255,t[4]=B>>8&255,t[5]=B>>16&255,t[6]=B>>24&255,A._sendCommand(t).then((function(B){0===B.getUint8(0)&&(A.collecting=!0,A.emit("measurements-started"))}))}))}},{key:"_stopMeasurements",value:function(){var A=this;return this._sendCommand(a.STOP_MEASUREMENTS).then((function(B){0===B.getUint8(0)&&(A.collecting=!1,A.emit("measurements-stopped"))}))}}]),B}(),d=function(){function A(B){g(this,A),this.webBluetoothNativeDevice=B,this.deviceCommand=null,this.deviceResponse=null}return Q(A,[{key:"writeCommand",value:function(){var A=e(regeneratorRuntime.mark((function A(B){return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",this.deviceCommand.writeValue(B));case 1:case"end":return A.stop()}}),A,this)})));return function(B){return A.apply(this,arguments)}}()},{key:"setup",value:function(){var A=e(regeneratorRuntime.mark((function A(B){var t,e,g,i,Q=this;return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return t=B.onClosed,e=B.onResponse,this.webBluetoothNativeDevice.addEventListener("gattserverdisconnected",t),A.prev=2,A.next=5,this.webBluetoothNativeDevice.gatt.connect();case 5:return g=A.sent,A.next=8,g.getPrimaryService("d91714ef-28b9-4f91-ba16-f0d9a604f112");case 8:return i=A.sent,A.next=11,i.getCharacteristics();case 11:A.sent.forEach((function(A){switch(A.uuid){case"f4bf14a6-c7d5-4b6d-8aa8-df1a7c83adcb":Q.deviceCommand=A;break;case"b41e6675-a329-40e0-aa01-44d2f444babe":Q.deviceResponse=A,Q.deviceResponse.addEventListener("characteristicvaluechanged",(function(A){var B=A.target.value;e(B)})),Q.deviceResponse.startNotifications();break;default:"No case found for ".concat(A.uuid)}})),A.next=18;break;case 15:A.prev=15,A.t0=A.catch(2),console.error(A.t0);case 18:if(this.deviceCommand&&this.deviceResponse){A.next=20;break}throw new Error("Expected command and response characteristics not found.");case 20:case"end":return A.stop()}}),A,this,[[2,15]])})));return function(B){return A.apply(this,arguments)}}()},{key:"close",value:function(){var A=e(regeneratorRuntime.mark((function A(){return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",this.webBluetoothNativeDevice.gatt.disconnect());case 1:case"end":return A.stop()}}),A,this)})));return function(){return A.apply(this,arguments)}}()},{key:"godirectAdapter",get:function(){return!0}}]),A}(),U={createDevice:function(){var A=e(regeneratorRuntime.mark((function A(B){var t,e,g,i,Q,n,s,r=arguments;return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(t=r.length>1&&void 0!==r[1]?r[1]:{},e=t.open,g=void 0===e||e,i=t.startMeasurements,Q=void 0===i||i,(n=B).godirectAdapter||(n=new d(B)),s=new l(n),!g){A.next=14;break}return A.prev=5,A.next=8,s.open(Q);case 8:A.next=14;break;case 10:throw A.prev=10,A.t0=A.catch(5),console.error(A.t0),A.t0;case 14:return A.abrupt("return",s);case 15:case"end":return A.stop()}}),A,this,[[5,10]])})));return function(B){return A.apply(this,arguments)}}(),selectDevice:function(){var A=e(regeneratorRuntime.mark((function A(){var B;return regeneratorRuntime.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(navigator.bluetooth){A.next=2;break}return A.abrupt("return",Promise.reject(new Error("No Web Bluetooth support.")));case 2:return A.next=4,navigator.bluetooth.requestDevice({filters:[{namePrefix:"GDX"}],optionalServices:["d91714ef-28b9-4f91-ba16-f0d9a604f112"]});case 4:return B=A.sent,A.abrupt("return",U.createDevice(B));case 6:case"end":return A.stop()}}),A,this)})));return function(){return A.apply(this,arguments)}}()};return U}()},function(A,B,t){const e=t(32);A.exports=class{constructor(A,{service:B,commandChar:t,responseChar:e}){this.socket=A,this._service=B,this._commandChar=t,this._responseChar=e,this._onResponse=this._onResponse.bind(this),this._deviceOnResponse=null}get godirectAdapter(){return!0}writeCommand(A){const B=e.uint8ArrayToBase64(A);return this.socket.write(this._service,this._commandChar,B,"base64")}setup({onResponse:A}){return this._deviceOnResponse=A,this.socket.startNotifications(this._service,this._responseChar,this._onResponse)}_onResponse(A){const B=e.base64ToUint8Array(A),t=new DataView(B.buffer);return this._deviceOnResponse(t)}}},function(A,B,t){const e=t(5),g=t(3),i=t(6),Q=t(1);A.exports=class{constructor(A){this.runtime=A}getInfo(){return{id:"tw",name:"TurboWarp",color1:"#ff4c4c",color2:"#e64444",docsURI:"https://docs.turbowarp.org/blocks",blocks:[{opcode:"getLastKeyPressed",text:e({id:"tw.blocks.lastKeyPressed",default:"last key pressed",description:"Block that returns the last key that was pressed"}),disableMonitor:!0,blockType:g.REPORTER},{opcode:"getButtonIsDown",text:e({id:"tw.blocks.buttonIsDown",default:"[MOUSE_BUTTON] mouse button down?",description:"Block that returns whether a specific mouse button is down"}),blockType:g.BOOLEAN,arguments:{MOUSE_BUTTON:{type:i.NUMBER,menu:"mouseButton",defaultValue:"0"}}}],menus:{mouseButton:{items:[{text:e({id:"tw.blocks.mouseButton.primary",default:"(0) primary",description:"Dropdown item to select primary (usually left) mouse button"}),value:"0"},{text:e({id:"tw.blocks.mouseButton.middle",default:"(1) middle",description:"Dropdown item to select middle mouse button"}),value:"1"},{text:e({id:"tw.blocks.mouseButton.secondary",default:"(2) secondary",description:"Dropdown item to select secondary (usually right) mouse button"}),value:"2"}],acceptReporters:!0}}}}getLastKeyPressed(A,B){return B.ioQuery("keyboard","getLastKeyPressed")}getButtonIsDown(A,B){const t=Q.toNumber(A.MOUSE_BUTTON);return B.ioQuery("mouse","getButtonIsDown",[t])}}},function(A,B,t){A.exports=function(){return t(125)('!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}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return 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=4)}([function(e,t,n){function r(){}n(12).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 o=i===e||void 0===i;return o&&(t.removeListener("item",n),t.removeListener("end",r),e.emit("unpipe")),o})),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(10);r.enable(),e.exports=r("vm")},function(e,t){var n={black:"#000",red:"#c23621",green:"#25bc26",yellow:"#bbbb00",blue:"#492ee1",magenta:"#d338d3",cyan:"#33bbc8",gray:"#808080",purple:"#708"};e.exports=function(e,t){return t?"color: #fff; background: "+n[e]+";":"color: "+n[e]+";"}},function(e,t){e.exports={isWorker:!0,centralDispatchService:self}},function(e,t,n){(function(e){const t=n(6),r=n(7),i=n(8),o=n(1),s=n(20),{isWorker:c}=n(3);e.Scratch=e.Scratch||{},e.Scratch.ArgumentType=t,e.Scratch.BlockType=r,e.Scratch.TargetType=s;const a=new class{constructor(){this.nextExtensionId=0,this.initialRegistrations=[],this.firstRegistrationPromise=new Promise(e=>{this.firstRegistrationCallback=e}),i.waitForConnection.then(()=>{i.call("extensions","allocateWorker").then(async e=>{const[t,n]=e;this.workerId=t;try{await(e=>{if(!c)return new Promise((t,n)=>{const r=document.createElement("script");r.onload=()=>t(),r.onerror=()=>n(new Error("Cannot run script")),r.src=e,document.body.appendChild(r)});importScripts(e)})(n),await this.firstRegistrationPromise;const e=this.initialRegistrations;this.initialRegistrations=null,Promise.all(e).then(()=>i.call("extensions","onWorkerInit",t))}catch(e){o.error(e),i.call("extensions","onWorkerInit",t,"".concat(e))}})}),this.extensions=[]}register(e){const t=this.nextExtensionId++;this.extensions.push(e);const n="extension.".concat(this.workerId,".").concat(t),r=i.setService(n,e).then(()=>i.call("extensions","registerExtensionService",n));return this.initialRegistrations&&(this.firstRegistrationCallback(),this.initialRegistrations.push(r)),r}};e.Scratch.extensions={register:a.register.bind(a)}}).call(this,n(5))},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){e.exports={ANGLE:"angle",BOOLEAN:"Boolean",COLOR:"color",NUMBER:"number",STRING:"string",MATRIX:"matrix",NOTE:"note",IMAGE:"image"}},function(e,t){e.exports={BOOLEAN:"Boolean",BUTTON:"button",COMMAND:"command",CONDITIONAL:"conditional",EVENT:"event",HAT:"hat",LOOP:"loop",REPORTER:"reporter"}},function(e,t,n){const r=n(9),i=n(1),{centralDispatchService:o}=n(3);e.exports=new class extends r{constructor(){super(),this._connectionPromise=new Promise(e=>{this._onConnect=e}),this.services={},this._onMessage=this._onMessage.bind(this,o),"undefined"!=typeof self&&(self.onmessage=this._onMessage)}get waitForConnection(){return this._connectionPromise}setService(e,t){return this.services.hasOwnProperty(e)&&i.warn("Worker dispatch replacing existing service provider for ".concat(e)),this.services[e]=t,this.waitForConnection.then(()=>this._remoteCall(o,"dispatch","setService",e))}_getServiceProvider(e){const t=this.services[e];return{provider:t||o,isRemote:!t}}_onDispatchMessage(e,t){let n;switch(t.method){case"handshake":n=this._onConnect();break;case"terminate":setTimeout(()=>self.close(),0),n=Promise.resolve();break;default:i.error("Worker dispatch received message for unknown method: ".concat(t.method))}return n}}},function(e,t,n){const r=n(1);e.exports=class{constructor(){this.callbacks=[],this.nextResponseId=0}call(e,t,...n){return this.transferCall(e,t,null,...n)}transferCall(e,t,n,...r){try{const{provider:i,isRemote:o}=this._getServiceProvider(e);if(i){if(o)return this._remoteTransferCall(i,e,t,n,...r);const s=i[t].apply(i,r);return Promise.resolve(s)}return Promise.reject(new Error("Service not found: ".concat(e)))}catch(e){return Promise.reject(e)}}_isRemoteService(e){return this._getServiceProvider(e).isRemote}_remoteCall(e,t,n,...r){return this._remoteTransferCall(e,t,n,null,...r)}_remoteTransferCall(e,t,n,r,...i){return new Promise((o,s)=>{const c=this._storeCallbacks(o,s);i.length>0&&"function"==typeof i[i.length-1].func&&(i.pop(),i.pop()),r?e.postMessage({service:t,method:n,responseId:c,args:i},r):e.postMessage({service:t,method:n,responseId:c,args:i})})}_storeCallbacks(e,t){const n=this.nextResponseId++;return this.callbacks[n]=[e,t],n}_deliverResponse(e,t){try{const[n,r]=this.callbacks[e];delete this.callbacks[e],t.error?r(t.error):n(t.result)}catch(e){r.error("Dispatch callback failed: ".concat(e))}}_onMessage(e,t){const n=t.data;let i;n.args=n.args||[],n.service?i="dispatch"===n.service?this._onDispatchMessage(e,n):this.call(n.service,n.method,...n.args):void 0===n.responseId?r.error("Dispatch caught malformed message from a worker: ".concat(JSON.stringify(t))):this._deliverResponse(n.responseId,n),i&&(void 0===n.responseId?r.error("Dispatch message missing required response ID: ".concat(JSON.stringify(t))):i.then(t=>e.postMessage({responseId:n.responseId,result:t}),t=>e.postMessage({responseId:n.responseId,error:"".concat(t)})))}_getServiceProvider(e){throw new Error("Could not get provider for ".concat(e,": _getServiceProvider not implemented"))}_onDispatchMessage(e,t){throw new Error("Unimplemented dispatch message handler cannot handle ".concat(t.method," method"))}}},function(e,t,n){var r=n(11),i=r.enable,o=r.disable,s="undefined"!=typeof navigator&&/chrome/i.test(navigator.userAgent),c=n(14);if(r.defaultBackend=s?c.minilog:c,"undefined"!=typeof window){try{r.enable(JSON.parse(window.localStorage.minilogSettings))}catch(e){}if(window.location&&window.location.search){var a=RegExp("[?&]minilog=([^&]*)").exec(window.location.search);a&&r.enable(decodeURIComponent(a[1]))}}r.enable=function(){i.call(r,!0);try{window.localStorage.minilogSettings=JSON.stringify(!0)}catch(e){}return this},r.disable=function(){o.call(r);try{delete window.localStorage.minilogSettings}catch(e){}return this},(e.exports=r).backends={array:n(17),browser:r.defaultBackend,localStorage:n(18),jQuery:n(19)}},function(e,t,n){var r=n(0),i=n(13),o=new r,s=Array.prototype.slice;(t=e.exports=function(e){var n=function(){return o.write(e,void 0,s.call(arguments)),n};return n.debug=function(){return o.write(e,"debug",s.call(arguments)),n},n.info=function(){return o.write(e,"info",s.call(arguments)),n},n.warn=function(){return o.write(e,"warn",s.call(arguments)),n},n.error=function(){return o.write(e,"error",s.call(arguments)),n},n.log=n.debug,n.suggest=t.suggest,n.format=o.format,n}).defaultBackend=t.defaultFormatter=null,t.pipe=function(e){return o.pipe(e)},t.end=t.unpipe=t.disable=function(e){return o.unpipe(e)},t.Transform=r,t.Filter=i,t.suggest=new i,t.enable=function(){return t.defaultFormatter?o.pipe(t.suggest).pipe(t.defaultFormatter).pipe(t.defaultBackend):o.pipe(t.suggest).pipe(t.defaultBackend)}},function(e,t){function n(){this._events={}}n.prototype={on:function(e,t){this._events||(this._events={});var n=this._events;return(n[e]||(n[e]=[])).push(t),this},removeListener:function(e,t){var n,r=this._events[e]||[];for(n=r.length-1;n>=0&&r[n];n--)r[n]!==t&&r[n].cb!==t||r.splice(n,1)},removeAllListeners:function(e){e?this._events[e]&&(this._events[e]=[]):this._events={}},listeners:function(e){return this._events&&this._events[e]||[]},emit:function(e){this._events||(this._events={});var t,n=Array.prototype.slice.call(arguments,1),r=this._events[e]||[];for(t=r.length-1;t>=0&&r[t];t--)r[t].apply(this,n);return this},when:function(e,t){return this.once(e,t,!0)},once:function(e,t,n){if(!t)return this;function r(){n||this.removeListener(e,r),t.apply(this,arguments)&&n&&this.removeListener(e,r)}return r.cb=t,this.on(e,r),this}},n.mixin=function(e){var t,r=n.prototype;for(t in r)r.hasOwnProperty(t)&&(e.prototype[t]=r[t])},e.exports=n},function(e,t,n){var r=n(0),i={debug:1,info:2,warn:3,error:4};function o(){this.enabled=!0,this.defaultResult=!0,this.clear()}function s(e,t){return e.n.test?e.n.test(t):e.n==t}r.mixin(o),o.prototype.allow=function(e,t){return this._white.push({n:e,l:i[t]}),this},o.prototype.deny=function(e,t){return this._black.push({n:e,l:i[t]}),this},o.prototype.clear=function(){return this._white=[],this._black=[],this},o.prototype.test=function(e,t){var n,r=Math.max(this._white.length,this._black.length);for(n=0;n=this._white[n].l)return!0;if(this._black[n]&&s(this._black[n],e)&&i[t]<=this._black[n].l)return!1}return this.defaultResult},o.prototype.write=function(e,t,n){if(!this.enabled||this.test(e,t))return this.emit("item",e,t,n)},e.exports=o},function(e,t,n){var r=n(0),i=/\\n+$/,o=new r;o.write=function(e,t,n){var r=n.length-1;if("undefined"!=typeof console&&console.log){if(console.log.apply)return console.log.apply(console,[e,t].concat(n));if(JSON&&JSON.stringify){n[r]&&"string"==typeof n[r]&&(n[r]=n[r].replace(i,""));try{for(r=0;r{this.loaded=!0,A&&A()};const t=this.toString(!0);B.src="data:image/svg+xml;utf8,".concat(encodeURIComponent(t)),this.loaded=!1}toString(A){return g(this._svgTag,A)}draw(A){if(!this.loaded)throw new Error("SVG image has not finished loading");this._drawFromImage(A)}_drawFromImage(A){if(null===this._cachedImage)return;const B=Number.isFinite(A)?A:1,t=this._measurements;this._canvas.width=t.width*B,this._canvas.height=t.height*B,this._canvas.width<=0||this._canvas.height<=0||this._cachedImage.naturalWidth<=0||this._cachedImage.naturalHeight<=0||(this._context.clearRect(0,0,this._canvas.width,this._canvas.height),this._context.setTransform(B,0,0,B,0,0),this._context.drawImage(this._cachedImage,0,0))}}},function(A,B){A.exports=function(A){const B=A.match(/]*>/);B&&-1===B[0].indexOf("xmlns=")&&(A=A.replace("]+?xlink:href=["'])data:img\/png/g,(A,B)=>"".concat(B,"data:image/png")));const t=/(<[^>]+?xmlns:(?!xml=)[^ ]+=)"http:\/\/www.w3.org\/XML\/1998\/namespace"/g;return null!==A.match(t)&&(A=A.replace(t,(A,B)=>"".concat(B,'"http://dummy.namespace"'))),A=(A=(A=A.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(A,B){A.exports={rgbToHsv:([A,B,t],e)=>{let g=0,i=0;(B/=255)<(t/=255)&&(i=B,B=t,t=i,g=-1),(A/=255){if(0===B)return e[0]=e[1]=e[2]=255*t+.5,e;const g=6*(A%=1)|0,i=6*A-g,Q=t*(1-B),n=t*(1-B*i),s=t*(1-B*(1-i));let r=0,c=0,E=0;switch(g){case 0:r=t,c=s,E=Q;break;case 1:r=n,c=t,E=Q;break;case 2:r=Q,c=t,E=s;break;case 3:r=Q,c=n,E=t;break;case 4:r=s,c=Q,E=t;break;case 5:r=t,c=Q,E=n}return e[0]=255*r+.5,e[1]=255*c+.5,e[2]=255*E+.5,e}}},function(A,B,t){const e=t(14),g=t(46),i=t(34),Q=t(35),n={color4f:[0,0,1,1],diameter:1},s=[0,0,0,0];A.exports=class extends i{constructor(A,B){super(A),this._renderer=B,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=B.getNativeSize(),this._resetAttributeIndexes(),this.a_lineColor=new Float32Array(65520),this.a_lineThicknessAndLength=new Float32Array(32760),this.a_penPoints=new Float32Array(65520),this.a_position=new Float32Array(32760);for(let A=0;Athis._enterDrawTexture(),exit:()=>this._exitDrawTexture()},this.onNativeSizeChanged=this.onNativeSizeChanged.bind(this),this._renderer.on(g.Events.NativeSizeChanged,this.onNativeSizeChanged),this._setCanvasSize(B.getNativeSize())}dispose(){this._renderer.removeListener(g.Events.NativeSizeChanged,this.onNativeSizeChanged),this._renderer.gl.deleteTexture(this._texture),this._texture=null,super.dispose()}get size(){return this._nativeSize}useNearest(A){return Math.max(A[0],A[1])>=100}getTexture(A){return this._texture}clear(){this._renderer.enterDrawRegion(this._usePenBufferDrawRegionId);const A=this._renderer.gl;A.clearColor(0,0,0,0),A.clear(A.COLOR_BUFFER_BIT),this._silhouetteDirty=!0}drawPoint(A,B,t){this.drawLine(A,B,t,B,t)}drawLine(A,B,t,e,g){const i=A.diameter||n.diameter,Q=1===i||3===i?.5:0;this._drawLineOnBuffer(A,B+Q,t+Q,e+Q,g+Q),this._silhouetteDirty=!0}_enterDrawLineOnBuffer(){this._resetAttributeIndexes();const A=this._renderer.gl;e.bindFramebufferInfo(A,this._framebuffer),A.viewport(0,0,this._size[0],this._size[1]);const B=this._lineShader;A.useProgram(B.program),e.setBuffersAndAttributes(A,B,this._lineBufferInfo);const t={u_skin:this._texture,u_stageSize:this._size};e.setUniforms(B,t)}_exitDrawLineOnBuffer(){this.a_lineColorIndex&&this._flushLines();const A=this._renderer.gl;e.bindFramebufferInfo(A,null)}_enterUsePenBuffer(){e.bindFramebufferInfo(this._renderer.gl,this._framebuffer)}_exitUsePenBuffer(){e.bindFramebufferInfo(this._renderer.gl,null)}_enterDrawTexture(){this._enterUsePenBuffer();const A=this._renderer.gl;A.viewport(0,0,this._size[0],this._size[1]),A.useProgram(this._drawTextureShader.program),e.setBuffersAndAttributes(A,this._drawTextureShader,this._renderer._bufferInfo)}_exitDrawTexture(){this._exitUsePenBuffer()}_drawPenTexture(A){this._renderer.enterDrawRegion(this._drawTextureRegionId);const B=this._renderer.gl,t=this._size[0],g=this._size[1],i={u_skin:A,u_projectionMatrix:e.m4.ortho(t/2,t/-2,g/-2,g/2,-1,1,e.m4.identity()),u_modelMatrix:e.m4.scaling(e.v3.create(t,g,0),e.m4.identity())};e.setTextureParameters(B,A,{minMag:B.NEAREST}),e.setUniforms(this._drawTextureShader,i),e.drawBufferInfo(B,this._renderer._bufferInfo,B.TRIANGLES)}_drawLineOnBuffer(A,B,t,e,g){this._renderer.enterDrawRegion(this._lineOnBufferDrawRegionId),this.a_lineColorIndex+24>this.a_lineColor.length&&this._flushLines();const i=A.color4f||n.color4f;s[0]=i[0]*i[3],s[1]=i[1]*i[3],s[2]=i[2]*i[3],s[3]=i[3],B*=this.renderQuality,t*=this.renderQuality;const Q=(e*=this.renderQuality)-B,r=(g*=this.renderQuality)-t,c=Math.sqrt(Q*Q+r*r),E=(A.diameter||n.diameter)*this.renderQuality;for(let A=0;A<6;A++)this.a_lineColor[this.a_lineColorIndex]=s[0],this.a_lineColorIndex++,this.a_lineColor[this.a_lineColorIndex]=s[1],this.a_lineColorIndex++,this.a_lineColor[this.a_lineColorIndex]=s[2],this.a_lineColorIndex++,this.a_lineColor[this.a_lineColorIndex]=s[3],this.a_lineColorIndex++,this.a_lineThicknessAndLength[this.a_lineThicknessAndLengthIndex]=E,this.a_lineThicknessAndLengthIndex++,this.a_lineThicknessAndLength[this.a_lineThicknessAndLengthIndex]=c,this.a_lineThicknessAndLengthIndex++,this.a_penPoints[this.a_penPointsIndex]=B,this.a_penPointsIndex++,this.a_penPoints[this.a_penPointsIndex]=-t,this.a_penPointsIndex++,this.a_penPoints[this.a_penPointsIndex]=Q,this.a_penPointsIndex++,this.a_penPoints[this.a_penPointsIndex]=-r,this.a_penPointsIndex++}_resetAttributeIndexes(){this.a_lineColorIndex=0,this.a_lineThicknessAndLengthIndex=0,this.a_penPointsIndex=0}_flushLines(){const A=this._renderer.gl,B=this._lineShader;this.a_lineColorIndex<1e3?(e.setAttribInfoBufferFromArray(A,this._lineBufferInfo.attribs.a_lineColor,new Float32Array(this.a_lineColor.buffer,0,this.a_lineColorIndex),0),e.setAttribInfoBufferFromArray(A,this._lineBufferInfo.attribs.a_penPoints,new Float32Array(this.a_penPoints.buffer,0,this.a_penPointsIndex),0),e.setAttribInfoBufferFromArray(A,this._lineBufferInfo.attribs.a_lineThicknessAndLength,new Float32Array(this.a_lineThicknessAndLength.buffer,0,this.a_lineThicknessAndLengthIndex),0)):(e.setAttribInfoBufferFromArray(A,this._lineBufferInfo.attribs.a_lineColor,this.a_lineColor),e.setAttribInfoBufferFromArray(A,this._lineBufferInfo.attribs.a_penPoints,this.a_penPoints),e.setAttribInfoBufferFromArray(A,this._lineBufferInfo.attribs.a_lineThicknessAndLength,this.a_lineThicknessAndLength)),e.setBuffersAndAttributes(A,B,this._lineBufferInfo),e.drawBufferInfo(A,this._lineBufferInfo,A.TRIANGLES,this.a_lineThicknessAndLengthIndex/2),this._resetAttributeIndexes(),this._silhouetteDirty=!0}onNativeSizeChanged(A){this._nativeSize=A.newSize,this._setCanvasSize(A.newSize),this.emit(i.Events.WasAltered)}_setCanvasSize(A){const[B,t]=A;if(this._size&&this._size[0]===B&&this._size[1]===t)return;this._size=A,this._rotationCenter[0]=this._nativeSize[0]/2,this._rotationCenter[1]=this._nativeSize[1]/2;const g=this._renderer.gl,i=this._texture;this._texture=e.createTexture(g,{mag:g.NEAREST,min:g.NEAREST,wrap:g.CLAMP_TO_EDGE,width:B,height:t});const Q=[{format:g.RGBA,attachment:this._texture}];this._framebuffer,this._framebuffer=e.createFramebufferInfo(g,Q,B,t),g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT),i&&this._drawPenTexture(i),this._silhouettePixels=new Uint8Array(Math.floor(B*t*4)),this._silhouetteImageData=new ImageData(B,t),this._silhouetteDirty=!0}setRenderQuality(A){this.renderQuality!==A&&(this.renderQuality=A,this._setCanvasSize([Math.round(this._nativeSize[0]*A),Math.round(this._nativeSize[1]*A)]))}updateSilhouette(){if(this._silhouetteDirty){this._renderer.enterDrawRegion(this._usePenBufferDrawRegionId);const A=this._renderer.gl;A.readPixels(0,0,this._size[0],this._size[1],A.RGBA,A.UNSIGNED_BYTE,this._silhouettePixels),this._silhouetteImageData.data.set(this._silhouettePixels),this._silhouette.update(this._silhouetteImageData,!0),this._silhouetteDirty=!1}}}},function(A,B,t){const e=t(14),g=t(34),{loadSvgString:i,serializeSvgToString:Q}=t(376),n=t(35);A.exports=class extends g{constructor(A,B){super(A),this._renderer=B,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(A,B){return 0==(B.enabledEffects&(n.EFFECT_INFO.fisheye.mask|n.EFFECT_INFO.whirl.mask|n.EFFECT_INFO.pixelate.mask|n.EFFECT_INFO.mosaic.mask))&&(B._direction%90==0&&(Math.abs(A[0])>99&&Math.abs(A[0])<101&&Math.abs(A[1])>99&&Math.abs(A[1])<101))}createMIP(A){const[B,t]=this._size;if(this._canvas.width=B*A,this._canvas.height=t*A,this._canvas.width<=0||this._canvas.height<=0||this._svgImage.naturalWidth<=0||this._svgImage.naturalHeight<=0)return super.getTexture();this._context.clearRect(0,0,this._canvas.width,this._canvas.height),this._context.setTransform(A,0,0,A,0,0),this._context.drawImage(this._svgImage,0,0);const g=this._context.getImageData(0,0,this._canvas.width,this._canvas.height),i={auto:!1,wrap:this._renderer.gl.CLAMP_TO_EDGE,src:g,premultiplyAlpha:!0},Q=e.createTexture(this._renderer.gl,i);return this._largestMIPScalethis._renderer.gl.deleteTexture(A)),this._scaledMIPs.length=0,this._largestMIPScale=0}setSVG(A,B){const t=i(A),e=Q(t,!0);this._svgImageLoaded=!1;const{x:n,y:s,width:r,height:c}=t.viewBox.baseVal;this._size[0]=r,this._size[1]=c,this._svgImage.onload=()=>{if(0===r||0===c)return void super.setEmptyImageData();const A=Math.ceil(Math.max(r,c));let t=2;for(;A*t<=2048;t*=2)this._maxTextureScale=t;this.resetMIPs(),void 0===B&&(B=this.calculateRotationCenter()),this._rotationCenter[0]=B[0]-n,this._rotationCenter[1]=B[1]-s,this._svgImageLoaded=!0,this.emit(g.Events.WasAltered)},this._svgImage.src="data:image/svg+xml;utf8,".concat(encodeURIComponent(e))}}},function(A,B,t){const e=t(377),g=t(381),i=t(144),Q=t(141),n=t(143),s=t(63),r=t(142);A.exports={BitmapAdapter:g,convertFonts:r,inlineSvgFonts:i,loadSvgString:Q,serializeSvgToString:n,SvgElement:s,SVGRenderer:e}},function(A,B,t){const e=t(141),g=t(143);A.exports=class{constructor(A){this._canvas=A||document.createElement("canvas"),this._context=this._canvas.getContext("2d"),this._measurements={x:0,y:0,width:0,height:0},this._cachedImage=null,this.loaded=!1}get canvas(){return this._canvas}get size(){return[this._measurements.width,this._measurements.height]}get viewOffset(){return[this._measurements.x,this._measurements.y]}loadString(A,B){this._cachedImage=null;const t=e(A,B);this._svgTag=t,this._measurements={width:t.viewBox.baseVal.width,height:t.viewBox.baseVal.height,x:t.viewBox.baseVal.x,y:t.viewBox.baseVal.y}}loadSVG(A,B,t){this.loadString(A,B),this._createSVGImage(t)}_createSVGImage(A){null===this._cachedImage&&(this._cachedImage=new Image);const B=this._cachedImage;B.onload=()=>{this.loaded=!0,A&&A()};const t=this.toString(!0);B.src="data:image/svg+xml;utf8,".concat(encodeURIComponent(t)),this.loaded=!1}toString(A){return g(this._svgTag,A)}draw(A){if(!this.loaded)throw new Error("SVG image has not finished loading");this._drawFromImage(A)}_drawFromImage(A){if(null===this._cachedImage)return;const B=Number.isFinite(A)?A:1,t=this._measurements;this._canvas.width=t.width*B,this._canvas.height=t.height*B,this._canvas.width<=0||this._canvas.height<=0||this._cachedImage.naturalWidth<=0||this._cachedImage.naturalHeight<=0||(this._context.clearRect(0,0,this._canvas.width,this._canvas.height),this._context.setTransform(B,0,0,B,0,0),this._context.drawImage(this._cachedImage,0,0))}}},function(A,B){A.exports=function(A){const B=A.match(/]*>/);B&&-1===B[0].indexOf("xmlns=")&&(A=A.replace("]+?xlink:href=["'])data:img\/png/g,(A,B)=>"".concat(B,"data:image/png")));const t=/(<[^>]+?xmlns:(?!xml=)[^ ]+=)"http:\/\/www.w3.org\/XML\/1998\/namespace"/g;return null!==A.match(t)&&(A=A.replace(t,(A,B)=>"".concat(B,'"http://dummy.namespace"'))),A=(A=(A=A.replace(/<(\/?)\s*svg:/g,"<$1")).replace(/[\s\S]*<\/metadata>/,"")).replace(/[\s\S]*<\/script>/,"