scratchblocks-plus 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * scratchblocks-plus v1.1.0
2
+ * scratchblocks-plus v1.1.1
3
3
  * https://luyifei2011.github.io/scratchblocks-plus
4
4
  * Make pictures of Scratch blocks from text.
5
5
  *
@@ -8,5 +8,5 @@
8
8
  * @license MIT
9
9
  */
10
10
 
11
- const t={pen:"pen",video:"sensing",music:"sound"},e={...t,faceSensing:"faceSensing",tts:"tts",translate:"translate",microbit:"microbit",gdxfor:"gdxfor",wedo:"wedo",makeymakey:"makeymakey",ev3:"ev3",boost:"boost"},s={wedo2:"wedo",text2speech:"tts"};const i=[{id:"MOTION_GOTO_POINTER",value:"mouse-pointer"},{id:"MOTION_GOTO_RANDOM",value:"random position"},{id:"MOTION_GLIDETO_POINTER",value:"mouse-pointer"},{id:"MOTION_GLIDETO_RANDOM",value:"random position"},{id:"MOTION_POINTTOWARDS_POINTER",value:"mouse-pointer"},{id:"MOTION_POINTTOWARDS_RANDOM",value:"random direction"},{id:"MOTION_SETROTATIONSTYLE_LEFTRIGHT",value:"left-right"},{id:"MOTION_SETROTATIONSTYLE_DONTROTATE",value:"don't rotate"},{id:"MOTION_SETROTATIONSTYLE_ALLAROUND",value:"all around"},{id:"LOOKS_NEXTBACKDROP",value:"next backdrop",parents:["LOOKS_SWITCHBACKDROPTO"]},{id:"LOOKS_PREVIOUSBACKDROP",value:"previous backdrop",parents:["LOOKS_SWITCHBACKDROPTO"]},{id:"LOOKS_RANDOMBACKDROP",value:"random backdrop",parents:["LOOKS_SWITCHBACKDROPTO"]},{id:"LOOKS_EFFECT_COLOR",value:"color",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_EFFECT_FISHEYE",value:"fisheye",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_EFFECT_WHIRL",value:"whirl",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_EFFECT_PIXELATE",value:"pixelate",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_EFFECT_MOSAIC",value:"mosaic",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_EFFECT_BRIGHTNESS",value:"brightness",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_EFFECT_GHOST",value:"ghost",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_GOTOFRONTBACK_FRONT",value:"front"},{id:"LOOKS_GOTOFRONTBACK_BACK",value:"back"},{id:"LOOKS_GOFORWARDBACKWARDLAYERS_FORWARD",value:"forward"},{id:"LOOKS_GOFORWARDBACKWARDLAYERS_BACKWARD",value:"backward"},{id:"LOOKS_NUMBERNAME_NUMBER",value:"number",parents:["LOOKS_COSTUMENUMBERNAME","LOOKS_BACKDROPNUMBERNAME"]},{id:"LOOKS_NUMBERNAME_NAME",value:"name",parents:["LOOKS_COSTUMENUMBERNAME","LOOKS_BACKDROPNUMBERNAME"]},{id:"SOUND_EFFECTS_PITCH",value:"pitch",parents:["SOUND_CHANGEEFFECTBY","SOUND_SETEFFECTO"]},{id:"SOUND_EFFECTS_PAN",value:"pan left/right",parents:["SOUND_CHANGEEFFECTBY","SOUND_SETEFFECTO"]},{id:"EVENT_WHENKEYPRESSED_SPACE",value:"space",parents:["EVENT_WHENKEYPRESSED","SENSING_KEYPRESSED","makeymakey.whenKeyPressed"]},{id:"EVENT_WHENKEYPRESSED_LEFT",value:"left arrow",parents:["EVENT_WHENKEYPRESSED","SENSING_KEYPRESSED","makeymakey.whenKeyPressed"]},{id:"EVENT_WHENKEYPRESSED_RIGHT",value:"right arrow",parents:["EVENT_WHENKEYPRESSED","SENSING_KEYPRESSED","makeymakey.whenKeyPressed"]},{id:"EVENT_WHENKEYPRESSED_DOWN",value:"down arrow",parents:["EVENT_WHENKEYPRESSED","SENSING_KEYPRESSED","makeymakey.whenKeyPressed"]},{id:"EVENT_WHENKEYPRESSED_UP",value:"up arrow",parents:["EVENT_WHENKEYPRESSED","SENSING_KEYPRESSED","makeymakey.whenKeyPressed"]},{id:"EVENT_WHENKEYPRESSED_ANY",value:"any",parents:["EVENT_WHENKEYPRESSED","SENSING_KEYPRESSED"]},{id:"EVENT_WHENGREATERTHAN_TIMER",value:"timer",parents:["EVENT_WHENGREATERTHAN"]},{id:"EVENT_WHENGREATERTHAN_LOUDNESS",value:"loudness",parents:["EVENT_WHENGREATERTHAN"]},{id:"CONTROL_STOP_ALL",value:"all"},{id:"CONTROL_STOP_THIS",value:"this script"},{id:"CONTROL_STOP_OTHER",value:"other scripts in sprite"},{id:"CONTROL_CREATECLONEOF_MYSELF",value:"myself"},{id:"SENSING_TOUCHINGOBJECT_POINTER",value:"mouse-pointer"},{id:"SENSING_TOUCHINGOBJECT_EDGE",value:"edge"},{id:"SENSING_DISTANCETO_POINTER",value:"mouse-pointer"},{id:"SENSING_SETDRAGMODE_DRAGGABLE",value:"draggable"},{id:"SENSING_SETDRAGMODE_NOTDRAGGABLE",value:"not draggable"},{id:"SENSING_OF_XPOSITION",value:"x position"},{id:"SENSING_OF_YPOSITION",value:"y position"},{id:"SENSING_OF_DIRECTION",value:"direction"},{id:"SENSING_OF_COSTUMENUMBER",value:"costume #"},{id:"SENSING_OF_COSTUMENAME",value:"costume name"},{id:"SENSING_OF_SIZE",value:"size"},{id:"SENSING_OF_VOLUME",value:"volume"},{id:"SENSING_OF_BACKDROPNUMBER",value:"backdrop #"},{id:"SENSING_OF_BACKDROPNAME",value:"backdrop name"},{id:"SENSING_OF_STAGE",value:"Stage"},{id:"SENSING_CURRENT_YEAR",value:"year"},{id:"SENSING_CURRENT_MONTH",value:"month"},{id:"SENSING_CURRENT_DATE",value:"date"},{id:"SENSING_CURRENT_DAYOFWEEK",value:"day of week"},{id:"SENSING_CURRENT_HOUR",value:"hour"},{id:"SENSING_CURRENT_MINUTE",value:"minute"},{id:"SENSING_CURRENT_SECOND",value:"second"},{id:"OPERATORS_MATHOP_ABS",value:"abs"},{id:"OPERATORS_MATHOP_FLOOR",value:"floor"},{id:"OPERATORS_MATHOP_CEILING",value:"ceiling"},{id:"OPERATORS_MATHOP_SQRT",value:"sqrt"},{id:"OPERATORS_MATHOP_SIN",value:"sin"},{id:"OPERATORS_MATHOP_COS",value:"cos"},{id:"OPERATORS_MATHOP_TAN",value:"tan"},{id:"OPERATORS_MATHOP_ASIN",value:"asin"},{id:"OPERATORS_MATHOP_ACOS",value:"acos"},{id:"OPERATORS_MATHOP_ATAN",value:"atan"},{id:"OPERATORS_MATHOP_LN",value:"ln"},{id:"OPERATORS_MATHOP_LOG",value:"log"},{id:"OPERATORS_MATHOP_EEXP",value:"e ^"},{id:"OPERATORS_MATHOP_10EXP",value:"10 ^"},{id:"music.drumSnare",value:"(1) Snare Drum"},{id:"music.drumBass",value:"(2) Bass Drum"},{id:"music.drumSideStick",value:"(3) Side Stick"},{id:"music.drumCrashCymbal",value:"(4) Crash Cymbal"},{id:"music.drumOpenHiHat",value:"(5) Open Hi-Hat"},{id:"music.drumClosedHiHat",value:"(6) Closed Hi-Hat"},{id:"music.drumTambourine",value:"(7) Tambourine"},{id:"music.drumHandClap",value:"(8) Hand Clap"},{id:"music.drumClaves",value:"(9) Claves"},{id:"music.drumWoodBlock",value:"(10) Wood Block"},{id:"music.drumCowbell",value:"(11) Cowbell"},{id:"music.drumTriangle",value:"(12) Triangle"},{id:"music.drumBongo",value:"(13) Bongo"},{id:"music.drumConga",value:"(14) Conga"},{id:"music.drumCabasa",value:"(15) Cabasa"},{id:"music.drumGuiro",value:"(16) Guiro"},{id:"music.drumVibraslap",value:"(17) Vibraslap"},{id:"music.drumCuica",value:"(18) Cuica"},{id:"music.instrumentPiano",value:"(1) Piano"},{id:"music.instrumentElectricPiano",value:"(2) Electric Piano"},{id:"music.instrumentOrgan",value:"(3) Organ"},{id:"music.instrumentGuitar",value:"(4) Guitar"},{id:"music.instrumentElectricGuitar",value:"(5) Electric Guitar"},{id:"music.instrumentBass",value:"(6) Bass"},{id:"music.instrumentPizzicato",value:"(7) Pizzicato"},{id:"music.instrumentCello",value:"(8) Cello"},{id:"music.instrumentTrombone",value:"(9) Trombone"},{id:"music.instrumentClarinet",value:"(10) Clarinet"},{id:"music.instrumentSaxophone",value:"(11) Saxophone"},{id:"music.instrumentFlute",value:"(12) Flute"},{id:"music.instrumentWoodenFlute",value:"(13) Wooden Flute"},{id:"music.instrumentBassoon",value:"(14) Bassoon"},{id:"music.instrumentChoir",value:"(15) Choir"},{id:"music.instrumentVibraphone",value:"(16) Vibraphone"},{id:"music.instrumentMusicBox",value:"(17) Music Box"},{id:"music.instrumentSteelDrum",value:"(18) Steel Drum"},{id:"music.instrumentMarimba",value:"(19) Marimba"},{id:"music.instrumentSynthLead",value:"(20) Synth Lead"},{id:"music.instrumentSynthPad",value:"(21) Synth Pad"},{id:"pen.colorMenu.color",value:"color",parents:["pen.setColorParam","pen.changeColorParam"]},{id:"pen.colorMenu.saturation",value:"saturation",parents:["pen.setColorParam","pen.changeColorParam"]},{id:"pen.colorMenu.brightness",value:"brightness",parents:["pen.setColorParam","pen.changeColorParam"]},{id:"pen.colorMenu.transparency",value:"transparency",parents:["pen.setColorParam","pen.changeColorParam"]},{id:"videoSensing.direction",value:"direction",parents:["videoSensing.videoOn"]},{id:"videoSensing.motion",value:"motion",parents:["videoSensing.videoOn"]},{id:"videoSensing.sprite",value:"sprite",parents:["videoSensing.videoOn"]},{id:"videoSensing.stage",value:"stage",parents:["videoSensing.videoOn"]},{id:"videoSensing.off",value:"off",parents:["videoSensing.videoToggle"]},{id:"videoSensing.on",value:"on",parents:["videoSensing.videoToggle"]},{id:"videoSensing.onFlipped",value:"on flipped",parents:["videoSensing.videoToggle"]},{id:"text2speech.alto",value:"alto",parents:["text2speech.setVoiceBlock"]},{id:"text2speech.tenor",value:"tenor",parents:["text2speech.setVoiceBlock"]},{id:"text2speech.squeak",value:"squeak",parents:["text2speech.setVoiceBlock"]},{id:"text2speech.giant",value:"giant",parents:["text2speech.setVoiceBlock"]},{id:"text2speech.kitten",value:"kitten",parents:["text2speech.setVoiceBlock"]},{id:"makeymakey.upArrowShort",value:"up",parents:["makeymakey.whenKeyPressed"]},{id:"makeymakey.downArrowShort",value:"down",parents:["makeymakey.whenKeyPressed"]},{id:"makeymakey.leftArrowShort",value:"left",parents:["makeymakey.whenKeyPressed"]},{id:"makeymakey.rightArrowShort",value:"right",parents:["makeymakey.whenKeyPressed"]},{id:"microbit.buttonsMenu.any",value:"any",parents:["microbit.whenButtonPressed","microbit.isButtonPressed"]},{id:"microbit.gesturesMenu.jumped",value:"jumped",parents:["microbit.whenGesture"]},{id:"microbit.gesturesMenu.moved",value:"moved",parents:["microbit.whenGesture"]},{id:"microbit.gesturesMenu.shaken",value:"shaken",parents:["microbit.whenGesture"]},{id:"microbit.tiltDirectionMenu.any",value:"any",parents:["microbit.whenTilted","microbit.isTilted"]},{id:"microbit.tiltDirectionMenu.back",value:"back",parents:["microbit.whenTilted","microbit.isTilted","microbit.tiltAngle"]},{id:"microbit.tiltDirectionMenu.front",value:"front",parents:["microbit.whenTilted","microbit.isTilted","microbit.tiltAngle"]},{id:"microbit.tiltDirectionMenu.left",value:"left",parents:["microbit.whenTilted","microbit.isTilted","microbit.tiltAngle"]},{id:"microbit.tiltDirectionMenu.right",value:"right",parents:["microbit.whenTilted","microbit.isTilted","microbit.tiltAngle"]},{id:"boost.motorDirection.backward",value:"that way",parents:["boost.setMotorDirection"]},{id:"boost.motorDirection.forward",value:"this way",parents:["boost.setMotorDirection"]},{id:"boost.motorDirection.reverse",value:"reverse",parents:["boost.setMotorDirection"]},{id:"boost.color.any",value:"any color",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.color.black",value:"black",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.color.blue",value:"blue",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.color.green",value:"green",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.color.red",value:"red",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.color.white",value:"white",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.color.yellow",value:"yellow",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.tiltDirection.any",value:"any",parents:["boost.whenTilted"]},{id:"boost.tiltDirection.up",value:"up",parents:["boost.whenTilted","boost.getTiltAngle"]},{id:"boost.tiltDirection.down",value:"down",parents:["boost.whenTilted","boost.getTiltAngle"]},{id:"boost.tiltDirection.left",value:"left",parents:["boost.whenTilted","boost.getTiltAngle"]},{id:"boost.tiltDirection.right",value:"right",parents:["boost.whenTilted","boost.getTiltAngle"]},{id:"wedo2.motorId.a",value:"motor A",parents:["wedo2.motorOnFor","wedo2.motorOn","wedo2.motorOff","wedo2.startMotorPower","wedo2.setMotorDirection"]},{id:"wedo2.motorId.b",value:"motor B",parents:["wedo2.motorOnFor","wedo2.motorOn","wedo2.motorOff","wedo2.startMotorPower","wedo2.setMotorDirection"]},{id:"wedo2.motorId.all",value:"all motors",parents:["wedo2.motorOnFor","wedo2.motorOn","wedo2.motorOff","wedo2.startMotorPower","wedo2.setMotorDirection"]},{id:"wedo2.motorId.default",value:"motor",parents:["wedo2.motorOnFor","wedo2.motorOn","wedo2.motorOff","wedo2.startMotorPower","wedo2.setMotorDirection"]},{id:"wedo2.motorDirection.forward",value:"this way",parents:["wedo2.setMotorDirection"]},{id:"wedo2.motorDirection.backward",value:"that way",parents:["wedo2.setMotorDirection"]},{id:"wedo2.motorDirection.reverse",value:"reverse",parents:["wedo2.setMotorDirection"]},{id:"wedo2.tiltDirection.any",value:"any",parents:["wedo2.whenTilted","wedo2.isTilted"]},{id:"wedo2.tiltDirection.up",value:"up",parents:["wedo2.whenTilted","wedo2.isTilted","wedo2.getTiltAngle"]},{id:"wedo2.tiltDirection.down",value:"down",parents:["wedo2.whenTilted","wedo2.isTilted","wedo2.getTiltAngle"]},{id:"wedo2.tiltDirection.left",value:"left",parents:["wedo2.whenTilted","wedo2.isTilted","wedo2.getTiltAngle"]},{id:"wedo2.tiltDirection.right",value:"right",parents:["wedo2.whenTilted","wedo2.isTilted","wedo2.getTiltAngle"]},{id:"gdxfor.pulled",value:"pulled",parents:["gdxfor.whenForcePushedOrPulled"]},{id:"gdxfor.pushed",value:"pushed",parents:["gdxfor.whenForcePushedOrPulled"]},{id:"gdxfor.shaken",value:"shaken",parents:["gdxfor.whenGesture"]},{id:"gdxfor.startedFalling",value:"started falling",parents:["gdxfor.whenGesture"]},{id:"gdxfor.turnedFaceDown",value:"turned face down",parents:["gdxfor.whenGesture"]},{id:"gdxfor.turnedFaceUp",value:"turned face up",parents:["gdxfor.whenGesture"]},{id:"gdxfor.tiltDirectionMenu.front",value:"front",parents:["gdxfor.whenTilted","gdxfor.isTilted","gdxfor.getTilt"]},{id:"gdxfor.tiltDirectionMenu.back",value:"back",parents:["gdxfor.whenTilted","gdxfor.isTilted","gdxfor.getTilt"]},{id:"gdxfor.tiltDirectionMenu.left",value:"left",parents:["gdxfor.whenTilted","gdxfor.isTilted","gdxfor.getTilt"]},{id:"gdxfor.tiltDirectionMenu.right",value:"right",parents:["gdxfor.whenTilted","gdxfor.isTilted","gdxfor.getTilt"]},{id:"gdxfor.tiltDirectionMenu.any",value:"any",parents:["gdxfor.whenTilted","gdxfor.isTilted"]}];const o=["motion","looks","sound","variables","list","events","control","sensing","operators","custom","custom-arg","extension","grey","obsolete",...Object.keys(e),...Object.keys(s)],a=["hat","cap","stack","boolean","reporter","ring","cat"],r=["ar","ckb","fa","he"],n=/%([0-9]+)/,l=/(%[a-zA-Z0-9](?:\.[a-zA-Z0-9]+)?)/,c=RegExp(l.source,"g"),h=/(@[a-zA-Z]+)/,p=RegExp(`${l.source}|${h.source}| +`,"g"),d=/^#(?:[0-9a-fA-F]{3}){1,2}?$/;function u(t){const e=n.exec(t);return e?+e[1]:0}function g(t){const e=t.split(p).filter((t=>t)),s=e.filter((t=>l.test(t)));return{spec:t,parts:e,inputs:s,hash:f(t)}}function f(t){return b(t.replace(c," _ "))}function b(t){return t.replace(/_/g," _ ").replace(/ +/g," ").replace(/[,%?:]/g,"").replace(/ß/g,"ss").replace(/ä/g,"a").replace(/ö/g,"o").replace(/ü/g,"u").replace(". . .","...").replace(/^…$/,"...").trim().toLowerCase()}const m={},V=[{id:"MOTION_MOVESTEPS",selector:"forward:",spec:"move %1 steps",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_TURNRIGHT",selector:"turnRight:",spec:"turn @turnRight %1 degrees",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_TURNLEFT",selector:"turnLeft:",spec:"turn @turnLeft %1 degrees",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_POINTINDIRECTION",selector:"heading:",spec:"point in direction %1",inputs:["%d.direction"],shape:"stack",category:"motion"},{id:"MOTION_POINTTOWARDS",selector:"pointTowards:",spec:"point towards %1",inputs:["%m.spriteOrMouse"],shape:"stack",category:"motion"},{id:"MOTION_GOTOXY",selector:"gotoX:y:",spec:"go to x:%1 y:%2",inputs:["%n","%n"],shape:"stack",category:"motion"},{id:"MOTION_GOTO",selector:"gotoSpriteOrMouse:",spec:"go to %1",inputs:["%m.location"],shape:"stack",category:"motion"},{id:"MOTION_GLIDESECSTOXY",selector:"glideSecs:toX:y:elapsed:from:",spec:"glide %1 secs to x:%2 y:%3",inputs:["%n","%n","%n"],shape:"stack",category:"motion"},{id:"MOTION_GLIDETO",spec:"glide %1 secs to %2",inputs:["%n","%m.location"],shape:"stack",category:"motion"},{id:"MOTION_CHANGEXBY",selector:"changeXposBy:",spec:"change x by %1",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_SETX",selector:"xpos:",spec:"set x to %1",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_CHANGEYBY",selector:"changeYposBy:",spec:"change y by %1",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_SETY",selector:"ypos:",spec:"set y to %1",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_SETROTATIONSTYLE",selector:"setRotationStyle",spec:"set rotation style %1",inputs:["%m.rotationStyle"],shape:"stack",category:"motion"},{id:"LOOKS_SAYFORSECS",selector:"say:duration:elapsed:from:",spec:"say %1 for %2 seconds",inputs:["%s","%n"],shape:"stack",category:"looks"},{id:"LOOKS_SAY",selector:"say:",spec:"say %1",inputs:["%s"],shape:"stack",category:"looks"},{id:"LOOKS_THINKFORSECS",selector:"think:duration:elapsed:from:",spec:"think %1 for %2 seconds",inputs:["%s","%n"],shape:"stack",category:"looks"},{id:"LOOKS_THINK",selector:"think:",spec:"think %1",inputs:["%s"],shape:"stack",category:"looks"},{id:"LOOKS_SHOW",selector:"show",spec:"show",inputs:[],shape:"stack",category:"looks"},{id:"LOOKS_HIDE",selector:"hide",spec:"hide",inputs:[],shape:"stack",category:"looks"},{id:"LOOKS_SWITCHCOSTUMETO",selector:"lookLike:",spec:"switch costume to %1",inputs:["%m.costume"],shape:"stack",category:"looks"},{id:"LOOKS_NEXTCOSTUME",selector:"nextCostume",spec:"next costume",inputs:[],shape:"stack",category:"looks"},{id:"LOOKS_NEXTBACKDROP_BLOCK",selector:"nextScene",spec:"next backdrop",inputs:[],shape:"stack",category:"looks"},{id:"LOOKS_SWITCHBACKDROPTO",selector:"startScene",spec:"switch backdrop to %1",inputs:["%m.backdrop"],shape:"stack",category:"looks"},{id:"LOOKS_SWITCHBACKDROPTOANDWAIT",selector:"startSceneAndWait",spec:"switch backdrop to %1 and wait",inputs:["%m.backdrop"],shape:"stack",category:"looks"},{id:"LOOKS_CHANGEEFFECTBY",selector:"changeGraphicEffect:by:",spec:"change %1 effect by %2",inputs:["%m.effect","%n"],shape:"stack",category:"looks"},{id:"LOOKS_SETEFFECTTO",selector:"setGraphicEffect:to:",spec:"set %1 effect to %2",inputs:["%m.effect","%n"],shape:"stack",category:"looks"},{id:"LOOKS_CLEARGRAPHICEFFECTS",selector:"filterReset",spec:"clear graphic effects",inputs:[],shape:"stack",category:"looks"},{id:"LOOKS_CHANGESIZEBY",selector:"changeSizeBy:",spec:"change size by %1",inputs:["%n"],shape:"stack",category:"looks"},{id:"LOOKS_SETSIZETO",selector:"setSizeTo:",spec:"set size to %1%",inputs:["%n"],shape:"stack",category:"looks"},{selector:"comeToFront",spec:"go to front",inputs:[],shape:"stack",category:"looks"},{id:"LOOKS_GOTOFRONTBACK",spec:"go to %1 layer",inputs:["%m"],shape:"stack",category:"looks"},{selector:"goBackByLayers:",spec:"go back %1 layers",inputs:["%n"],shape:"stack",category:"looks"},{id:"LOOKS_GOFORWARDBACKWARDLAYERS",spec:"go %1 %2 layers",inputs:["%m","%n"],shape:"stack",category:"looks"},{id:"SOUND_PLAY",selector:"playSound:",spec:"start sound %1",inputs:["%m.sound"],shape:"stack",category:"sound"},{id:"SOUND_CHANGEEFFECTBY",spec:"change %1 effect by %2",inputs:["%m","%n"],shape:"stack",category:"sound"},{id:"SOUND_SETEFFECTO",spec:"set %1 effect to %2",inputs:["%m","%n"],shape:"stack",category:"sound"},{id:"SOUND_CLEAREFFECTS",spec:"clear sound effects",inputs:[],shape:"stack",category:"sound"},{id:"SOUND_PLAYUNTILDONE",selector:"doPlaySoundAndWait",spec:"play sound %1 until done",inputs:["%m.sound"],shape:"stack",category:"sound"},{id:"SOUND_STOPALLSOUNDS",selector:"stopAllSounds",spec:"stop all sounds",inputs:[],shape:"stack",category:"sound"},{id:"music.playDrumForBeats",selector:"playDrum",spec:"play drum %1 for %2 beats",inputs:["%d.drum","%n"],shape:"stack",category:"music"},{id:"music.restForBeats",selector:"rest:elapsed:from:",spec:"rest for %1 beats",inputs:["%n"],shape:"stack",category:"music"},{id:"music.playNoteForBeats",selector:"noteOn:duration:elapsed:from:",spec:"play note %1 for %2 beats",inputs:["%d.note","%n"],shape:"stack",category:"music"},{id:"music.setInstrument",selector:"instrument:",spec:"set instrument to %1",inputs:["%d.instrument"],shape:"stack",category:"music"},{id:"SOUND_CHANGEVOLUMEBY",selector:"changeVolumeBy:",spec:"change volume by %1",inputs:["%n"],shape:"stack",category:"sound"},{id:"SOUND_SETVOLUMETO",selector:"setVolumeTo:",spec:"set volume to %1%",inputs:["%n"],shape:"stack",category:"sound"},{id:"music.changeTempo",selector:"changeTempoBy:",spec:"change tempo by %1",inputs:["%n"],shape:"stack",category:"music"},{selector:"setTempoTo:",spec:"set tempo to %1 bpm",inputs:["%n"],shape:"stack",category:"sound"},{id:"music.setTempo",selector:"setTempoTo:",spec:"set tempo to %1",inputs:["%n"],shape:"stack",category:"music"},{id:"pen.clear",selector:"clearPenTrails",spec:"erase all",inputs:[],shape:"stack",category:"pen"},{id:"pen.stamp",selector:"stampCostume",spec:"stamp",inputs:[],shape:"stack",category:"pen"},{id:"pen.penDown",selector:"putPenDown",spec:"pen down",inputs:[],shape:"stack",category:"pen"},{id:"pen.penUp",selector:"putPenUp",spec:"pen up",inputs:[],shape:"stack",category:"pen"},{id:"pen.setColor",selector:"penColor:",spec:"set pen color to %1",inputs:["%c"],shape:"stack",category:"pen"},{id:"pen.changeHue",selector:"changePenHueBy:",spec:"change pen color by %1",inputs:["%n"],shape:"stack",category:"pen"},{id:"pen.setColorParam",spec:"set pen %1 to %2",inputs:["%m.color","%c"],shape:"stack",category:"pen"},{id:"pen.changeColorParam",spec:"change pen %1 by %2",inputs:["%m.color","%n"],shape:"stack",category:"pen"},{id:"pen.setHue",selector:"setPenHueTo:",spec:"set pen color to %1",inputs:["%n"],shape:"stack",category:"pen"},{id:"pen.changeShade",selector:"changePenShadeBy:",spec:"change pen shade by %1",inputs:["%n"],shape:"stack",category:"pen"},{id:"pen.setShade",selector:"setPenShadeTo:",spec:"set pen shade to %1",inputs:["%n"],shape:"stack",category:"pen"},{id:"pen.changeSize",selector:"changePenSizeBy:",spec:"change pen size by %1",inputs:["%n"],shape:"stack",category:"pen"},{id:"pen.setSize",selector:"penSize:",spec:"set pen size to %1",inputs:["%n"],shape:"stack",category:"pen"},{id:"EVENT_WHENFLAGCLICKED",selector:"whenGreenFlag",spec:"when @greenFlag clicked",inputs:[],shape:"hat",category:"events"},{id:"EVENT_WHENKEYPRESSED",selector:"whenKeyPressed",spec:"when %1 key pressed",inputs:["%m.key"],shape:"hat",category:"events"},{id:"EVENT_WHENTHISSPRITECLICKED",selector:"whenClicked",spec:"when this sprite clicked",inputs:[],shape:"hat",category:"events"},{id:"EVENT_WHENSTAGECLICKED",spec:"when stage clicked",inputs:[],shape:"hat",category:"events"},{id:"EVENT_WHENBACKDROPSWITCHESTO",selector:"whenSceneStarts",spec:"when backdrop switches to %1",inputs:["%m.backdrop"],shape:"hat",category:"events"},{id:"EVENT_WHENGREATERTHAN",selector:"whenSensorGreaterThan",spec:"when %1 > %2",inputs:["%m.triggerSensor","%n"],shape:"hat",category:"events"},{id:"EVENT_WHENBROADCASTRECEIVED",selector:"whenIReceive",spec:"when I receive %1",inputs:["%m.broadcast"],shape:"hat",category:"events"},{id:"EVENT_BROADCAST",selector:"broadcast:",spec:"broadcast %1",inputs:["%m.broadcast"],shape:"stack",category:"events"},{id:"EVENT_BROADCASTANDWAIT",selector:"doBroadcastAndWait",spec:"broadcast %1 and wait",inputs:["%m.broadcast"],shape:"stack",category:"events"},{id:"CONTROL_WAIT",selector:"wait:elapsed:from:",spec:"wait %1 seconds",inputs:["%n"],shape:"stack",category:"control"},{id:"CONTROL_REPEAT",selector:"doRepeat",spec:"repeat %1",inputs:["%n"],shape:"c-block",category:"control",hasLoopArrow:!0},{id:"CONTROL_FOREVER",selector:"doForever",spec:"forever",inputs:[],shape:"c-block cap",category:"control",hasLoopArrow:!0},{id:"CONTROL_IF",selector:"doIf",spec:"if %1 then",inputs:["%b"],shape:"c-block",category:"control"},{id:"CONTROL_WAITUNTIL",selector:"doWaitUntil",spec:"wait until %1",inputs:["%b"],shape:"stack",category:"control"},{id:"CONTROL_REPEATUNTIL",selector:"doUntil",spec:"repeat until %1",inputs:["%b"],shape:"c-block",category:"control",hasLoopArrow:!0},{id:"CONTROL_STOP",selector:"stopScripts",spec:"stop %1",inputs:["%m.stop"],shape:"cap",category:"control"},{id:"CONTROL_STARTASCLONE",selector:"whenCloned",spec:"when I start as a clone",inputs:[],shape:"hat",category:"control"},{id:"CONTROL_CREATECLONEOF",selector:"createCloneOf",spec:"create clone of %1",inputs:["%m.spriteOnly"],shape:"stack",category:"control"},{id:"CONTROL_DELETETHISCLONE",selector:"deleteClone",spec:"delete this clone",inputs:[],shape:"cap",category:"control"},{id:"SENSING_ASKANDWAIT",selector:"doAsk",spec:"ask %1 and wait",inputs:["%s"],shape:"stack",category:"sensing"},{id:"videoSensing.videoToggle",selector:"setVideoState",spec:"turn video %1",inputs:["%m.videoState"],shape:"stack",category:"video"},{id:"videoSensing.setVideoTransparency",selector:"setVideoTransparency",spec:"set video transparency to %1%",inputs:["%n"],shape:"stack",category:"video"},{id:"videoSensing.whenMotionGreaterThan",spec:"when video motion > %1",inputs:["%n"],shape:"hat",category:"video"},{id:"SENSING_RESETTIMER",selector:"timerReset",spec:"reset timer",inputs:[],shape:"stack",category:"sensing"},{id:"DATA_SETVARIABLETO",selector:"setVar:to:",spec:"set %1 to %2",inputs:["%m.var","%s"],shape:"stack",category:"variables"},{id:"DATA_CHANGEVARIABLEBY",selector:"changeVar:by:",spec:"change %1 by %2",inputs:["%m.var","%n"],shape:"stack",category:"variables"},{id:"DATA_SHOWVARIABLE",selector:"showVariable:",spec:"show variable %1",inputs:["%m.var"],shape:"stack",category:"variables"},{id:"DATA_HIDEVARIABLE",selector:"hideVariable:",spec:"hide variable %1",inputs:["%m.var"],shape:"stack",category:"variables"},{id:"DATA_ADDTOLIST",selector:"append:toList:",spec:"add %1 to %2",inputs:["%s","%m.list"],shape:"stack",category:"list"},{id:"DATA_DELETEOFLIST",selector:"deleteLine:ofList:",spec:"delete %1 of %2",inputs:["%d.listDeleteItem","%m.list"],shape:"stack",category:"list"},{id:"DATA_DELETEALLOFLIST",spec:"delete all of %1",inputs:["%m.list"],shape:"stack",category:"list"},{id:"MOTION_IFONEDGEBOUNCE",selector:"bounceOffEdge",spec:"if on edge, bounce",inputs:[],shape:"stack",category:"motion"},{id:"DATA_INSERTATLIST",selector:"insert:at:ofList:",spec:"insert %1 at %2 of %3",inputs:["%s","%d.listItem","%m.list"],shape:"stack",category:"list"},{id:"DATA_REPLACEITEMOFLIST",selector:"setLine:ofList:to:",spec:"replace item %1 of %2 with %3",inputs:["%d.listItem","%m.list","%s"],shape:"stack",category:"list"},{id:"DATA_SHOWLIST",selector:"showList:",spec:"show list %1",inputs:["%m.list"],shape:"stack",category:"list"},{id:"DATA_HIDELIST",selector:"hideList:",spec:"hide list %1",inputs:["%m.list"],shape:"stack",category:"list"},{id:"SENSING_OF_XPOSITION",selector:"xpos",spec:"x position",inputs:[],shape:"reporter",category:"motion"},{id:"SENSING_OF_YPOSITION",selector:"ypos",spec:"y position",inputs:[],shape:"reporter",category:"motion"},{id:"SENSING_OF_DIRECTION",selector:"heading",spec:"direction",inputs:[],shape:"reporter",category:"motion"},{id:"SENSING_OF_COSTUMENUMBER",selector:"costumeIndex",spec:"costume #",inputs:[],shape:"reporter",category:"looks"},{id:"LOOKS_COSTUMENUMBERNAME",selector:"LOOKS_COSTUMENUMBERNAME",spec:"costume %1",inputs:["%m"],shape:"reporter",category:"looks"},{id:"SENSING_OF_SIZE",selector:"scale",spec:"size",inputs:[],shape:"reporter",category:"looks"},{id:"SENSING_OF_BACKDROPNAME",selector:"sceneName",spec:"backdrop name",inputs:[],shape:"reporter",category:"looks"},{id:"LOOKS_BACKDROPNUMBERNAME",spec:"backdrop %1",inputs:["%m"],shape:"reporter",category:"looks"},{id:"SENSING_OF_BACKDROPNUMBER",selector:"backgroundIndex",spec:"backdrop #",inputs:[],shape:"reporter",category:"looks"},{id:"SOUND_VOLUME",selector:"volume",spec:"volume",inputs:[],shape:"reporter",category:"sound"},{id:"music.getTempo",selector:"tempo",spec:"tempo",inputs:[],shape:"reporter",category:"music"},{id:"SENSING_TOUCHINGOBJECT",selector:"touching:",spec:"touching %1?",inputs:["%m.touching"],shape:"boolean",category:"sensing"},{id:"SENSING_TOUCHINGCOLOR",selector:"touchingColor:",spec:"touching color %1?",inputs:["%c"],shape:"boolean",category:"sensing"},{id:"SENSING_COLORISTOUCHINGCOLOR",selector:"color:sees:",spec:"color %1 is touching %2?",inputs:["%c","%c"],shape:"boolean",category:"sensing"},{id:"SENSING_DISTANCETO",selector:"distanceTo:",spec:"distance to %1",inputs:["%m.spriteOrMouse"],shape:"reporter",category:"sensing"},{id:"SENSING_ANSWER",selector:"answer",spec:"answer",inputs:[],shape:"reporter",category:"sensing"},{id:"SENSING_KEYPRESSED",selector:"keyPressed:",spec:"key %1 pressed?",inputs:["%m.key"],shape:"boolean",category:"sensing"},{id:"SENSING_MOUSEDOWN",selector:"mousePressed",spec:"mouse down?",inputs:[],shape:"boolean",category:"sensing"},{id:"SENSING_MOUSEX",selector:"mouseX",spec:"mouse x",inputs:[],shape:"reporter",category:"sensing"},{id:"SENSING_MOUSEY",selector:"mouseY",spec:"mouse y",inputs:[],shape:"reporter",category:"sensing"},{id:"SENSING_SETDRAGMODE",spec:"set drag mode %1",inputs:["%m"],shape:"stack",category:"sensing"},{id:"SENSING_LOUDNESS",selector:"soundLevel",spec:"loudness",inputs:[],shape:"reporter",category:"sensing"},{id:"videoSensing.videoOn",selector:"senseVideoMotion",spec:"video %1 on %2",inputs:["%m.videoMotionType","%m.stageOrThis"],shape:"reporter",category:"video"},{id:"SENSING_TIMER",selector:"timer",spec:"timer",inputs:[],shape:"reporter",category:"sensing"},{id:"SENSING_OF",selector:"getAttribute:of:",spec:"%1 of %2",inputs:["%m.attribute","%m.spriteOrStage"],shape:"reporter",category:"sensing"},{id:"SENSING_CURRENT",selector:"timeAndDate",spec:"current %1",inputs:["%m.timeAndDate"],shape:"reporter",category:"sensing"},{id:"SENSING_DAYSSINCE2000",selector:"timestamp",spec:"days since 2000",inputs:[],shape:"reporter",category:"sensing"},{id:"SENSING_USERNAME",selector:"getUserName",spec:"username",inputs:[],shape:"reporter",category:"sensing"},{id:"OPERATORS_ADD",selector:"+",spec:"%1 + %2",inputs:["%n","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_SUBTRACT",selector:"-",spec:"%1 - %2",inputs:["%n","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_MULTIPLY",selector:"*",spec:"%1 * %2",inputs:["%n","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_DIVIDE",selector:"/",spec:"%1 / %2",inputs:["%n","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_RANDOM",selector:"randomFrom:to:",spec:"pick random %1 to %2",inputs:["%n","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_LT",selector:"<",spec:"%1 < %2",inputs:["%s","%s"],shape:"boolean",category:"operators"},{id:"OPERATORS_EQUALS",selector:"=",spec:"%1 = %2",inputs:["%s","%s"],shape:"boolean",category:"operators"},{id:"OPERATORS_GT",selector:">",spec:"%1 > %2",inputs:["%s","%s"],shape:"boolean",category:"operators"},{id:"OPERATORS_AND",selector:"&",spec:"%1 and %2",inputs:["%b","%b"],shape:"boolean",category:"operators"},{id:"OPERATORS_OR",selector:"|",spec:"%1 or %2",inputs:["%b","%b"],shape:"boolean",category:"operators"},{id:"OPERATORS_NOT",selector:"not",spec:"not %1",inputs:["%b"],shape:"boolean",category:"operators"},{id:"OPERATORS_JOIN",selector:"concatenate:with:",spec:"join %1 %2",inputs:["%s","%s"],shape:"reporter",category:"operators"},{id:"OPERATORS_LETTEROF",selector:"letter:of:",spec:"letter %1 of %2",inputs:["%n","%s"],shape:"reporter",category:"operators"},{id:"OPERATORS_LENGTH",selector:"stringLength:",spec:"length of %1",inputs:["%s"],shape:"reporter",category:"operators"},{id:"OPERATORS_MOD",selector:"%",spec:"%1 mod %2",inputs:["%n","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_ROUND",selector:"rounded",spec:"round %1",inputs:["%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_MATHOP",selector:"computeFunction:of:",spec:"%1 of %2",inputs:["%m.mathOp","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_CONTAINS",spec:"%1 contains %2?",inputs:["%s","%s"],shape:"boolean",category:"operators"},{id:"DATA_ITEMOFLIST",selector:"getLine:ofList:",spec:"item %1 of %2",inputs:["%d.listItem","%m.list"],shape:"reporter",category:"list"},{id:"DATA_ITEMNUMOFLIST",spec:"item # of %1 in %2",inputs:["%s","%m.list"],shape:"reporter",category:"list"},{id:"DATA_LENGTHOFLIST",selector:"lineCountOfList:",spec:"length of %1",inputs:["%m.list"],shape:"reporter",category:"list"},{id:"DATA_LISTCONTAINSITEM",selector:"list:contains:",spec:"%1 contains %2?",inputs:["%m.list","%s"],shape:"boolean",category:"list"},{id:"CONTROL_ELSE",spec:"else",inputs:[],shape:"celse",category:"control"},{id:"scratchblocks:end",spec:"end",inputs:[],shape:"cend",category:"control"},{id:"scratchblocks:ellipsis",spec:". . .",inputs:[],shape:"stack",category:"grey"},{id:"scratchblocks:addInput",spec:"%1 @addInput",inputs:["%n"],shape:"ring",category:"grey"},{id:"SENSING_USERID",spec:"user id",inputs:[],shape:"reporter",category:"obsolete"},{selector:"doIf",spec:"if %1",inputs:["%b"],shape:"c-block",category:"obsolete"},{selector:"doForeverIf",spec:"forever if %1",inputs:["%b"],shape:"c-block cap",category:"obsolete"},{selector:"doReturn",spec:"stop script",inputs:[],shape:"cap",category:"obsolete"},{selector:"stopAll",spec:"stop all",inputs:[],shape:"cap",category:"obsolete"},{selector:"lookLike:",spec:"switch to costume %1",inputs:["%m.costume"],shape:"stack",category:"obsolete"},{selector:"nextScene",spec:"next background",inputs:[],shape:"stack",category:"obsolete"},{selector:"startScene",spec:"switch to background %1",inputs:["%m.backdrop"],shape:"stack",category:"obsolete"},{selector:"backgroundIndex",spec:"background #",inputs:[],shape:"reporter",category:"obsolete"},{id:"SENSING_LOUD",selector:"isLoud",spec:"loud?",inputs:[],shape:"boolean",category:"obsolete"},{id:"faceSensing.goToPart",spec:"go to %1",inputs:["%m"],shape:"stack",category:"faceSensing"},{id:"faceSensing.pointInFaceTiltDirection",spec:"point in direction of face tilt",inputs:[],shape:"stack",category:"faceSensing"},{id:"faceSensing.setSizeToFaceSize",spec:"set size to face size",inputs:[],shape:"stack",category:"faceSensing"},{id:"faceSensing.whenTilted",spec:"when face tilts %1",inputs:["%m"],shape:"hat",category:"faceSensing"},{id:"faceSensing.whenSpriteTouchesPart",spec:"when this sprite touches a %1",inputs:["%m"],shape:"hat",category:"faceSensing"},{id:"faceSensing.whenFaceDetected",spec:"when a face is detected",inputs:[],shape:"hat",category:"faceSensing"},{id:"faceSensing.faceDetected",spec:"a face is detected?",inputs:[],shape:"boolean",category:"faceSensing"},{id:"faceSensing.faceTilt",spec:"face tilt",inputs:[],shape:"reporter",category:"faceSensing"},{id:"faceSensing.faceSize",spec:"face size",inputs:[],shape:"reporter",category:"faceSensing"},{id:"text2speech.speakAndWaitBlock",spec:"speak %1",inputs:["%s"],shape:"stack",category:"tts"},{id:"text2speech.setVoiceBlock",spec:"set voice to %1",inputs:["%m"],shape:"stack",category:"tts"},{id:"text2speech.setLanguageBlock",spec:"set language to %1",inputs:["%m"],shape:"stack",category:"tts"},{id:"translate.translateBlock",spec:"translate %1 to %2",inputs:["%s","%m"],shape:"reporter",category:"translate"},{id:"translate.viewerLanguage",spec:"language",shape:"reporter",category:"translate"},{id:"makeymakey.whenKeyPressed",spec:"when %1 key pressed",inputs:["%m"],shape:"hat",category:"makeymakey"},{id:"makeymakey.whenKeysPressedInOrder",spec:"when %1 pressed in order",inputs:["%m"],shape:"hat",category:"makeymakey"},{id:"microbit.whenButtonPressed",spec:"when %1 button pressed",inputs:["%m"],shape:"hat",category:"microbit"},{id:"microbit.isButtonPressed",spec:"%1 button pressed?",inputs:["%m"],shape:"boolean",category:"microbit"},{id:"microbit.whenGesture",spec:"when %1",inputs:["%m"],shape:"hat",category:"microbit"},{id:"microbit.displaySymbol",spec:"display %1",inputs:["%m"],shape:"stack",category:"microbit"},{id:"microbit.displayText",spec:"display text %1",inputs:["%s"],shape:"stack",category:"microbit"},{id:"microbit.clearDisplay",spec:"clear display",shape:"stack",category:"microbit"},{id:"microbit.whenTilted",spec:"when tilted %1",inputs:["%m"],shape:"hat",category:"microbit"},{id:"microbit.isTilted",spec:"tilted %1?",inputs:["%m"],shape:"boolean",category:"microbit"},{id:"microbit.tiltAngle",spec:"tilt angle %1",inputs:["%m"],shape:"reporter",category:"microbit"},{id:"microbit.whenPinConnected",spec:"when pin %1 connected",inputs:["%m"],shape:"hat",category:"microbit"},{id:"ev3.motorTurnClockwise",spec:"motor %1 turn this way for %2 seconds",inputs:["%m","%n"],shape:"stack",category:"ev3"},{id:"ev3.motorTurnCounterClockwise",spec:"motor %1 turn that way for %2 seconds",inputs:["%m","%n"],shape:"stack",category:"ev3"},{id:"ev3.motorSetPower",spec:"motor %1 set power %2%",inputs:["%m","%n"],shape:"stack",category:"ev3"},{id:"ev3.getMotorPosition",spec:"motor %1 position",inputs:["%m"],shape:"reporter",category:"ev3"},{id:"ev3.whenButtonPressed",spec:"when button %1 pressed",inputs:["%m"],shape:"hat",category:"ev3"},{id:"ev3.whenDistanceLessThan",spec:"when distance < %1",inputs:["%n"],shape:"hat",category:"ev3"},{id:"ev3.whenBrightnessLessThan",spec:"when brightness < %1",inputs:["%n"],shape:"hat",category:"ev3"},{id:"ev3.buttonPressed",spec:"button %1 pressed?",inputs:["%m"],shape:"boolean",category:"ev3"},{id:"ev3.getDistance",spec:"distance",shape:"reporter",category:"ev3"},{id:"ev3.getBrightness",spec:"brightness",shape:"reporter",category:"ev3"},{id:"ev3.beepNote",spec:"beep note %1 for %2 secs",inputs:["%d.note","%n"],shape:"stack",category:"ev3"},{id:"wedo2.motorOn",spec:"turn %1 on",inputs:["%m.motor"],shape:"stack",category:"wedo"},{id:"wedo2.motorOff",spec:"turn %1 off",inputs:["%m.motor"],shape:"stack",category:"wedo"},{id:"wedo2.startMotorPower",spec:"set %1 power to %2",inputs:["%m.motor","%n"],shape:"stack",category:"wedo"},{id:"wedo2.setMotorDirection",spec:"set %1 direction to %2",inputs:["%m.motor2","%m.motorDirection"],shape:"stack",category:"wedo"},{id:"wedo2.whenDistance",spec:"when distance %1 %2",inputs:["%m.lessMore","%n"],shape:"hat",category:"wedo"},{id:"wedo2.getDistance",spec:"distance",inputs:[],shape:"reporter",category:"wedo"},{id:"wedo2.motorOnFor",spec:"turn %1 on for %2 seconds",inputs:["%m.motor","%n"],shape:"stack",category:"wedo"},{id:"wedo2.setLightHue",spec:"set light color to %1",inputs:["%n"],shape:"stack",category:"wedo"},{id:"wedo2.playNoteFor",spec:"play note %1 for %2 seconds",inputs:["%n","%n"],shape:"stack",category:"wedo"},{id:"wedo2.whenTilted",spec:"when tilted %1",inputs:["%m.xxx"],shape:"hat",category:"wedo"},{id:"wedo2.isTilted",spec:"tilted %1?",inputs:["%m"],shape:"boolean",category:"wedo"},{id:"wedo2.getTiltAngle",spec:"tilt angle %1",inputs:["%m.xxx"],shape:"reporter",category:"wedo"},{id:"gdxfor.whenGesture",spec:"when %1",inputs:["%m"],shape:"hat",category:"gdxfor"},{id:"gdxfor.whenForcePushedOrPulled",spec:"when force sensor %1",inputs:["%m"],shape:"hat",category:"gdxfor"},{id:"gdxfor.getForce",spec:"force",shape:"reporter",category:"gdxfor"},{id:"gdxfor.whenTilted",spec:"when tilted %1",inputs:["%m"],shape:"hat",category:"gdxfor"},{id:"gdxfor.isTilted",spec:"tilted %1?",inputs:["%m"],shape:"boolean",category:"gdxfor"},{id:"gdxfor.getTilt",spec:"tilt angle %1",inputs:["%m"],shape:"reporter",category:"gdxfor"},{id:"gdxfor.isFreeFalling",spec:"falling?",shape:"boolean",category:"gdxfor"},{id:"gdxfor.getSpin",spec:"spin speed %1",inputs:["%m"],shape:"reporter",category:"gdxfor"},{id:"gdxfor.getAcceleration",spec:"acceleration %1",inputs:["%m"],shape:"reporter",category:"gdxfor"},{id:"boost.motorOnFor",spec:"turn motor %1 for %2 seconds",inputs:["%m","%n"],shape:"stack",category:"boost"},{id:"boost.motorOnForRotation",spec:"turn motor %1 for %2 rotations",inputs:["%m","%n"],shape:"stack",category:"boost"},{id:"boost.motorOn",spec:"turn motor %1 on",inputs:["%m"],shape:"stack",category:"boost"},{id:"boost.motorOff",spec:"turn motor %1 off",inputs:["%m"],shape:"stack",category:"boost"},{id:"boost.setMotorPower",spec:"set motor %1 speed to %2%",inputs:["%m","%n"],shape:"stack",category:"boost"},{id:"boost.setMotorDirection",spec:"set motor %1 direction %2",inputs:["%m","%m"],shape:"stack",category:"boost"},{id:"boost.getMotorPosition",spec:"motor %1 position",inputs:["%m"],shape:"reporter",category:"boost"},{id:"boost.whenColor",spec:"when %1 brick seen",inputs:["%m"],shape:"hat",category:"boost"},{id:"boost.seeingColor",spec:"seeing %1 brick?",inputs:["%m"],shape:"boolean",category:"boost"},{id:"boost.whenTilted",spec:"when tilted %1",inputs:["%m"],shape:"hat",category:"boost"},{id:"boost.getTiltAngle",spec:"tilt angle %1",inputs:["%m"],shape:"reporter",category:"boost"},{id:"boost.setLightHue",spec:"set light color to %1",inputs:["%n"],shape:"stack",category:"boost"}].map((t=>{if(!t.id){if(!t.selector)throw Error("Missing ID: "+t.spec);t.id="sb2:"+t.selector}if(!t.spec)throw Error("Missing spec: "+t.id);const e={id:t.id,spec:t.spec,parts:t.spec.split(p).filter((t=>t)),selector:t.selector||"sb3:"+t.id,inputs:null==t.inputs?[]:t.inputs,shape:t.shape,category:t.category,hasLoopArrow:!!t.hasLoopArrow};if(m[e.id])throw Error("Duplicate ID: "+e.id);return m[e.id]=e,e})),A={"@greenFlag":"⚑","@turnRight":"↻","@turnLeft":"↺","@addInput":"▸","@delInput":"◂"},k={};function w(t){Object.keys(t).forEach((e=>function(t,e){const s=e.blocksByHash={};Object.keys(e.commands).forEach((t=>{const i=e.commands[t],o=m[t],a=f(i);s[a]||(s[a]=[]),s[a].push(o);const r=h.exec(o.spec);if(r){const t=r[0],e=a.replace(f(t),A[t]);s[e]||(s[e]=[]),s[e].push(o)}})),e.nativeAliases={},Object.keys(e.aliases).forEach((t=>{const i=e.aliases[t],o=m[i];if(void 0===o)throw Error(`Invalid alias '${i}'`);const a=f(t);s[a]||(s[a]=[]),s[a].push(o),e.nativeAliases[i]||(e.nativeAliases[i]=[]),e.nativeAliases[i].push(t)})),Object.keys(e.renamedBlocks||{}).forEach((t=>{const s=e.renamedBlocks[t];if(!m[s])throw Error("Unknown ID: "+s);const i=m[s],o=f(t);v.blocksByHash[o]||(v.blocksByHash[o]=[]),v.blocksByHash[o].push(i)})),e.nativeDropdowns={},Object.keys(e.dropdowns).forEach((t=>{const s=e.dropdowns[t].value,i=e.dropdowns[t].parents;e.nativeDropdowns[s]||(e.nativeDropdowns[s]=[]),e.nativeDropdowns[s].push({id:t,parents:i})})),e.code=t,k[t]=e}(e,t[e])))}const v={aliases:{"turn ccw %1 degrees":"MOTION_TURNLEFT","turn left %1 degrees":"MOTION_TURNLEFT","turn cw %1 degrees":"MOTION_TURNRIGHT","turn right %1 degrees":"MOTION_TURNRIGHT","when flag clicked":"EVENT_WHENFLAGCLICKED","when gf clicked":"EVENT_WHENFLAGCLICKED","when green flag clicked":"EVENT_WHENFLAGCLICKED"},renamedBlocks:{"say %1 for %2 secs":"LOOKS_SAYFORSECS","think %1 for %2 secs":"LOOKS_THINKFORSECS","play sound %1":"SOUND_PLAY","wait %1 secs":"CONTROL_WAIT",clear:"pen.clear"},definePrefix:["define"],defineSuffix:[],ignorelt:["when distance"],math:["abs","floor","ceiling","sqrt","sin","cos","tan","asin","acos","atan","ln","log","e ^","10 ^"],name:"English",faceParts:["nose","mouth","left eye","right eye","between eyes","left ear","right ear","top of head"],soundEffects:["pitch","pan left/right"],microbitWhen:["moved","shaken","jumped"],osis:["other scripts in sprite","other scripts in stage"],dropdowns:{},commands:{}};function y(t,e){if(!m[t])throw Error("Unknown ID: "+t);m[t].accepts=e}function E(t,e,s){y(t,((t,e,i)=>s(e,i))),y(e,((t,e,i)=>!s(e,i)))}function S(t,e,s){const i=[];for(const t of e){if(!t)continue;const e=t.shape||"";(e.endsWith("dropdown")||"dropdown"===e)&&null!=t.value&&i.push(t.value)}if(!i.length)return t;const o=new Map;for(const t of s)for(const e of i)if(t.nativeDropdowns&&Object.prototype.hasOwnProperty.call(t.nativeDropdowns,e)){const s=t.nativeDropdowns[e];s&&s.length&&(o.has(e)||o.set(e,[]),o.get(e).push(...s))}if(!o.size)return t;const a=t.filter((t=>{const e=[t.id,t.selector&&t.selector.replace(/^sb3:/,""),t.selector].filter(Boolean);for(const t of o.values())for(const s of t){if(!s)continue;if((Array.isArray(s.parents)?s.parents:[]).some((t=>e.includes(t))))return!0;if(s.id&&e.includes(s.id))return!0}return!1}));return a.length?a:t}function O(t){const e=[];for(const s of t.children){if(!s.isLabel)return;e.push(s.value)}return e.join(" ")}function T(t,e){if(!t)throw Error("Assertion failed! "+(e||""))}V.forEach((t=>{v.commands[t.id]=t.spec})),(i.forEach((t=>{if(!t.parents)if(t.id.startsWith("music.drum"))t.parents=["music.playDrumForBeats"];else if(t.id.startsWith("music.instrument"))t.parents=["music.setInstrument"];else{const e=t.id.lastIndexOf("_"),s=-1!==e?t.id.substring(0,e):null;t.parents=s?[s]:null}})),i).forEach((t=>{v.dropdowns[t.id]={value:t.value,parents:t.parents||[]}})),v.dropdowns={...v.dropdowns,...function(t){const e={};return["left up right","right up left","left right","right left","up down","down up","up right down left","up left down right","up up down down left right left right"].forEach(((s,i)=>{e["makeymakey.sequence."+i]={value:s.replaceAll("left",t["makeymakey.leftArrowShort"].value).replaceAll("right",t["makeymakey.rightArrowShort"].value).replaceAll("up",t["makeymakey.upArrowShort"].value).replaceAll("down",t["makeymakey.downArrowShort"].value),parents:["makeymakey.whenKeysPressedInOrder"]}})),e}(v.dropdowns),"translate.language.am":{value:"Amharic",parents:["translate.translateBlock"]},"translate.language.ar":{value:"Arabic",parents:["translate.translateBlock"]},"translate.language.az":{value:"Azerbaijani",parents:["translate.translateBlock"]},"translate.language.eu":{value:"Basque",parents:["translate.translateBlock"]},"translate.language.bg":{value:"Bulgarian",parents:["translate.translateBlock"]},"translate.language.ca":{value:"Catalan",parents:["translate.translateBlock"]},"translate.language.zh-cn":{value:"Chinese (Simplified)",parents:["translate.translateBlock"]},"translate.language.zh-tw":{value:"Chinese (Traditional)",parents:["translate.translateBlock"]},"translate.language.hr":{value:"Croatian",parents:["translate.translateBlock"]},"translate.language.cs":{value:"Czech",parents:["translate.translateBlock"]},"translate.language.da":{value:"Danish",parents:["translate.translateBlock"]},"translate.language.nl":{value:"Dutch",parents:["translate.translateBlock"]},"translate.language.en":{value:"English",parents:["translate.translateBlock"]},"translate.language.et":{value:"Estonian",parents:["translate.translateBlock"]},"translate.language.fi":{value:"Finnish",parents:["translate.translateBlock"]},"translate.language.fr":{value:"French",parents:["translate.translateBlock"]},"translate.language.gl":{value:"Galician",parents:["translate.translateBlock"]},"translate.language.de":{value:"German",parents:["translate.translateBlock"]},"translate.language.el":{value:"Greek",parents:["translate.translateBlock"]},"translate.language.he":{value:"Hebrew",parents:["translate.translateBlock"]},"translate.language.hu":{value:"Hungarian",parents:["translate.translateBlock"]},"translate.language.is":{value:"Icelandic",parents:["translate.translateBlock"]},"translate.language.id":{value:"Indonesian",parents:["translate.translateBlock"]},"translate.language.ga":{value:"Irish",parents:["translate.translateBlock"]},"translate.language.it":{value:"Italian",parents:["translate.translateBlock"]},"translate.language.ja":{value:"Japanese",parents:["translate.translateBlock"]},"translate.language.ko":{value:"Korean",parents:["translate.translateBlock"]},"translate.language.lv":{value:"Latvian",parents:["translate.translateBlock"]},"translate.language.lt":{value:"Lithuanian",parents:["translate.translateBlock"]},"translate.language.mi":{value:"Maori",parents:["translate.translateBlock"]},"translate.language.nb":{value:"Norwegian",parents:["translate.translateBlock"]},"translate.language.fa":{value:"Persian",parents:["translate.translateBlock"]},"translate.language.pl":{value:"Polish",parents:["translate.translateBlock"]},"translate.language.pt":{value:"Portuguese",parents:["translate.translateBlock"]},"translate.language.ro":{value:"Romanian",parents:["translate.translateBlock"]},"translate.language.ru":{value:"Russian",parents:["translate.translateBlock"]},"translate.language.gd":{value:"Scots Gaelic",parents:["translate.translateBlock"]},"translate.language.sr":{value:"Serbian",parents:["translate.translateBlock"]},"translate.language.sk":{value:"Slovak",parents:["translate.translateBlock"]},"translate.language.sl":{value:"Slovenian",parents:["translate.translateBlock"]},"translate.language.es":{value:"Spanish",parents:["translate.translateBlock"]},"translate.language.sv":{value:"Swedish",parents:["translate.translateBlock"]},"translate.language.th":{value:"Thai",parents:["translate.translateBlock"]},"translate.language.tr":{value:"Turkish",parents:["translate.translateBlock"]},"translate.language.uk":{value:"Ukrainian",parents:["translate.translateBlock"]},"translate.language.vi":{value:"Vietnamese",parents:["translate.translateBlock"]},"translate.language.cy":{value:"Welsh",parents:["translate.translateBlock"]},"translate.language.zu":{value:"Zulu",parents:["translate.translateBlock"]},"text2speech.language.ar":{value:"Arabic",parents:["text2speech.setLanguageBlock"]},"text2speech.language.zh-cn":{value:"Chinese (Mandarin)",parents:["text2speech.setLanguageBlock"]},"text2speech.language.da":{value:"Danish",parents:["text2speech.setLanguageBlock"]},"text2speech.language.nl":{value:"Dutch",parents:["text2speech.setLanguageBlock"]},"text2speech.language.en":{value:"English",parents:["text2speech.setLanguageBlock"]},"text2speech.language.fr":{value:"French",parents:["text2speech.setLanguageBlock"]},"text2speech.language.de":{value:"German",parents:["text2speech.setLanguageBlock"]},"text2speech.language.hi":{value:"Hindi",parents:["text2speech.setLanguageBlock"]},"text2speech.language.is":{value:"Icelandic",parents:["text2speech.setLanguageBlock"]},"text2speech.language.it":{value:"Italian",parents:["text2speech.setLanguageBlock"]},"text2speech.language.ja":{value:"Japanese",parents:["text2speech.setLanguageBlock"]},"text2speech.language.ko":{value:"Korean",parents:["text2speech.setLanguageBlock"]},"text2speech.language.nb":{value:"Norwegian",parents:["text2speech.setLanguageBlock"]},"text2speech.language.pl":{value:"Polish",parents:["text2speech.setLanguageBlock"]},"text2speech.language.pt-br":{value:"Portuguese (Brazilian)",parents:["text2speech.setLanguageBlock"]},"text2speech.language.pt":{value:"Portuguese",parents:["text2speech.setLanguageBlock"]},"text2speech.language.ro":{value:"Romanian",parents:["text2speech.setLanguageBlock"]},"text2speech.language.ru":{value:"Russian",parents:["text2speech.setLanguageBlock"]},"text2speech.language.es":{value:"Spanish",parents:["text2speech.setLanguageBlock"]},"text2speech.language.es-419":{value:"Spanish (Latin American)",parents:["text2speech.setLanguageBlock"]},"text2speech.language.sv":{value:"Swedish",parents:["text2speech.setLanguageBlock"]},"text2speech.language.tr":{value:"Turkish",parents:["text2speech.setLanguageBlock"]},"text2speech.language.cy":{value:"Welsh",parents:["text2speech.setLanguageBlock"]}},w({en:v}),E("OPERATORS_MATHOP","SENSING_OF",((t,e)=>{const s=t[0];if(!s.isInput)return;const i=s.value;return e.math.includes(i)})),E("SOUND_CHANGEEFFECTBY","LOOKS_CHANGEEFFECTBY",((t,e)=>{for(const s of t)if("dropdown"===s.shape){const t=s.value;for(const s of e.soundEffects)if(b(s)===b(t))return!0}return!1})),E("SOUND_SETEFFECTO","LOOKS_SETEFFECTTO",((t,e)=>{for(const s of t)if("dropdown"===s.shape){const t=s.value;for(const s of e.soundEffects)if(b(s)===b(t))return!0}return!1})),E("DATA_LENGTHOFLIST","OPERATORS_LENGTH",((t,e)=>{const s=t[t.length-1];if(s.isInput)return"dropdown"===s.shape})),E("DATA_LISTCONTAINSITEM","OPERATORS_CONTAINS",((t,e)=>{const s=t[0];if(s.isInput)return"dropdown"===s.shape})),E("pen.setColor","pen.setHue",((t,e)=>{const s=t[t.length-1];return s.isInput&&s.isColor||s.isBlock})),E("faceSensing.goToPart","MOTION_GOTO",((t,e)=>{for(const s of t)if("dropdown"===s.shape){const t=s.value;for(const s of e.faceParts)if(b(s)===b(t))return!0}return!1})),E("microbit.whenGesture","gdxfor.whenGesture",((t,e)=>{for(const s of t)if("dropdown"===s.shape){const t=s.value;for(const s of e.microbitWhen)if(b(s)===b(t))return!0}return!1})),E("ev3.buttonPressed","microbit.isButtonPressed",((t,e)=>{for(const e of t)if("dropdown"===e.shape)switch(b(e.value)){case"1":case"2":case"3":case"4":return!0}return!1})),function(t,e){if(!m[t])throw Error("Unknown ID: "+t);m[t].specialCase=e}("CONTROL_STOP",((t,e,s)=>{const i=e[e.length-1];if(!i.isInput)return;const o=i.value;return s.osis.includes(o)?{...m.CONTROL_STOP,shape:"stack"}:void 0}));class L{constructor(t,e){this.value=t,this.cls=e||"",this.el=null,this.height=12,this.metrics=null,this.x=0}get isLabel(){return!0}stringify(){return"<"===this.value||">"===this.value?this.value:this.value.replace(/([<>[\](){}\\])/g,"\\$1").replace(/:{2,}/g,(t=>":"+"\\:".repeat(t.length-1)))}}class R{constructor(t){this.name=t,this.isArrow="loopArrow"===t,T(R.icons[t],"no info for icon "+t)}get isIcon(){return!0}static get icons(){return{greenFlag:!0,stopSign:!0,turnLeft:!0,turnRight:!0,loopArrow:!0,addInput:!0,delInput:!0,list:!0}}stringify(){return A["@"+this.name]||""}}class C{constructor(t){const e=Array.isArray(t)?t:[];this.rows=e.map((t=>Array.isArray(t)?t.slice():[t]));const s=this.rows.reduce(((t,e)=>Math.max(t,e.length)),0);for(let t=0;t<this.rows.length;t++){const e=this.rows[t];for(;e.length<s;)e.push(!1)}}get isMatrix(){return!0}stringify(){return`{${this.rows.map((t=>t.map((t=>t?"1":"0")).join(""))).join(",")}}`}translate(){}}class N{constructor(t,e){this.shape=t,this.value=e,this.isRound="number"===t||"number-dropdown"===t,this.isBoolean="boolean"===t,this.isStack="stack"===t,this.isInset="boolean"===t||"stack"===t||"reporter"===t,this.isColor="color"===t,this.isMatrix="matrix"===t,this.hasArrow="dropdown"===t||"number-dropdown"===t,this.isDarker="boolean"===t||"stack"===t||"dropdown"===t,this.isSquare="string"===t||"color"===t||"dropdown"===t;const s=e&&"object"==typeof e&&e.isMatrix;this.hasLabel=!(this.isColor||this.isInset||this.isMatrix||s),this.label=this.hasLabel?new L(e,"literal-"+this.shape):null,this.x=0}get isInput(){return!0}stringify(t=""){if(this.isColor)return T("#"===this.value[0]),`[${this.value}]`;if(this.value&&"object"==typeof this.value&&this.value.isMatrix){const e=this.value.stringify(),s=Math.max(0,function(t){if(!t)return 0;t+="";let e=0;const s=/[\u2E80-\u2EFF\u2F00-\u2FDF\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF\uFF00-\uFFEF]/u;for(const i of t)e+=s.test(i)?2:1;return e}(t)+2),i=" ".repeat(s);return`({${e.slice(1,-1).split(",").map(((t,e)=>0===e?t:`\n${i}${t}`)).join(",")}} v)`}let e=this.value?this.value+"":"";return this.isSquare&&(e=e.replace(/([\]\\])/g,"\\$1")),this.isRound&&(e=e.replace(/([()[<])/g,"\\$1")),e=e.replace(/ v$/," \\v"),this.hasArrow?e+=" v":d.test(e)&&(e="\\"+e),this.isRound?`(${e})`:this.isSquare?`[${e}]`:this.isBoolean?"<>":this.isStack?"{}":e}translate(t){if(this.hasArrow){if(this.value&&"object"==typeof this.value&&this.value.isMatrix)return;this.menu&&(this.value=t.dropdowns[this.menu].value),this.label=new L(this.value,"literal-"+this.shape)}}}class M{constructor(t,e,s){T(t),this.info={...t},this.children=e,this.comment=s||null,this.diff=null,this.blockPath=null;const i=this.info.shape;this.isHat="hat"===i||"cat"===i||"define-hat"===i,this.hasPuzzle="stack"===i||"hat"===i||"cat"===i||"c-block"===i||"define-hat"===i,this.isFinal=/cap/.test(i),this.isCommand="stack"===i||"cap"===i||/block/.test(i),this.isOutline="outline"===i,this.isReporter="reporter"===i,this.isBoolean="boolean"===i,this.isRing="ring"===i,this.hasScript=/block/.test(i),this.isElse="celse"===i,this.isEnd="cend"===i}get isBlock(){return!0}stringify(t){let e=null,s=!1,i="",o=this.children.map(((t,o,a)=>{if(t.isIcon&&(s=!0),e||t.isLabel||t.isIcon||(e=t),t.isScript)return i="",`\n${function(t){return t.split("\n").map((t=>" "+t)).join("\n")}(t.stringify()).trimEnd()}\n`;const r=t.isInput?t.stringify(i):t.stringify(),n=r.trim();if(r.includes("\n")){const t=r.split("\n");i=t[t.length-1].trim()+" "}else i+=n+" ";let l=a[o+1];l=l&&"loopArrow"===l.name?a[o+2]:l;return n+(!(l&&l.isScript)?" ":"")})).join("").trim();if("reporter"===this.info.shape&&d.test(o))return`(\\${o})`;const a=this.info.language;if(s&&a&&this.info.selector){const t=a.nativeAliases[this.info.id];if(t&&t.length){let s=t[0];return l.test(s)&&e&&(s=s.replace(l,e.stringify())),s}}let r=t||"";return(!1===this.info.categoryIsDefault||"custom-arg"===this.info.category&&(this.isReporter||this.isBoolean)||"custom"===this.info.category&&"stack"===this.info.shape)&&(r&&(r+=" "),this.info.isReset&&"obsolete"===this.info.category?r+="reset":r+=this.info.category),!1===this.info.shapeIsDefault&&(r&&(r+=" "),r+=this.info.shape),r&&(o+=" :: "+r),this.hasScript?o+"\n"+(Object.keys(a.aliases).find((t=>"scratchblocks:end"===a.aliases[t]))||"end"):"reporter"===this.info.shape?`(${o})`:"boolean"===this.info.shape?`<${o}>`:o}translate(t,e){if(!t)throw Error("Missing language");const s=this.info.id;if(!s)return;if("PROCEDURES_DEFINITION"===s){const e=this.children.find((t=>t.isOutline));this.children=[];for(const e of t.definePrefix)this.children.push(new L(e));this.children.push(e);for(const e of t.defineSuffix)this.children.push(new L(e));return}if("PROCEDURES_CALL"===s)return void this.children.forEach((e=>{e.isLabel||e.isIcon||e.translate(t)}));const i=this.info.language.commands[s],o=t.commands[s];if(!o)return;const a=g(o),n=this.children.filter((t=>!t.isLabel&&!t.isIcon));e||n.forEach((e=>e.translate(t)));const l=g(i).parts.map((t=>u(t))).filter((t=>t));let c=0;const p=l.map((t=>(c=Math.max(c,t),n[t-1]))),d=n.slice(c);this.children=a.parts.map((t=>{if(!(t=t.trim()))return;const e=u(t);return e?p[e-1]:h.test(t)?new R(t.slice(1)):new L(t)})).filter((t=>t)),d.forEach(((e,s)=>{1===s&&"CONTROL_IF"===this.info.id&&this.children.push(new L(t.commands.CONTROL_ELSE)),this.children.push(e)})),this.info.language=t,this.info.isRTL=r.includes(t.code),this.info.categoryIsDefault=!0}}class B{constructor(t,e){this.label=new L(t,"comment-label"),this.width=null,this.hasBlock=e}get isComment(){return!0}stringify(){return"// "+this.label.value.trim()}}class x{constructor(t){T(t),this.child=t,t.isBlock?(this.shape=t.info.shape,this.info=t.info):this.shape="stack"}get isGlow(){return!0}stringify(){if(this.child.isBlock)return this.child.stringify("+");return this.child.stringify().split("\n").map((t=>"+ "+t)).join("\n")}translate(t){this.child.translate(t)}}class I{constructor(t){this.blocks=t,this.isEmpty=!t.length,this.isFinal=!this.isEmpty&&t[t.length-1].isFinal,this.scriptIndex=null}get isScript(){return!0}stringify(){return this.blocks.map((t=>{let e=t.stringify();if(t.comment)if(t.isBlock&&t.hasScript){const s=" "+t.comment.stringify(),i=e.indexOf("\n");-1!==i?e=e.slice(0,i)+s+e.slice(i):e+=s}else e+=" "+t.comment.stringify();return e})).join("\n")}translate(t){this.blocks.forEach((e=>e.translate&&e.translate(t)))}}class P{constructor(t){this.scripts=t,this.blockMap=new Map}stringify(){return this.scripts.map((t=>t.stringify())).join("\n\n")}translate(t){this.scripts.forEach((e=>e.translate(t)))}getBlockByPath(t){return this.blockMap.get(t)||null}}function D(t,e,s){let i=[];Array.isArray(e[e.length-1])&&(i=e.pop());const n=[];for(const t of e)t.isLabel?n.push(t.value):t.isIcon?n.push("@"+t.name):n.push("_");const l=n.join(" "),c=t.hash=b(l);let p,u;if(!i.includes("reset")){const a=function(t,e,s,i,a){for(const r of i)if(Object.prototype.hasOwnProperty.call(r.blocksByHash,t)){let n=r.blocksByHash[t];if(a&&a.length){const t=new Set(n.map((t=>t.category)).filter(Boolean));for(const s of a)if(s&&t.has(s)){const t=n.filter((t=>t.category===s));if(1===t.length){const s=t[0];if(!("reporter"===e.shape&&"reporter"!==s.shape&&"ring"!==s.shape||"boolean"===e.shape&&"boolean"!==s.shape))return{type:s,lang:r}}else if(t.length>1){n=t;break}}const s=a.find((t=>o.includes(t)));if(s){const t=n.filter((t=>t.category===s));if(t.length){if(1===t.length)return{type:t[0],lang:r};n=t}}}n.length>1&&(n=S(n,s,i));for(let t of n)if(("reporter"!==e.shape||"reporter"===t.shape||"ring"===t.shape)&&("boolean"!==e.shape||"boolean"===t.shape)&&(!(n.length>1&&t.accepts)||t.accepts(e,s,r)))return t.specialCase&&(t=t.specialCase(e,s,r)||t),{type:t,lang:r}}}(c,t,e,s,i);if(a)p=a.lang,u=a.type,t.language=p,t.isRTL=r.includes(p.code),("ring"===u.shape?"reporter"===t.shape:"stack"===t.shape)&&(t.shape=u.shape),t.category=u.category,t.categoryIsDefault=!0,u.selector&&(t.selector=u.selector),u.id&&(t.id=u.id),t.hasLoopArrow=u.hasLoopArrow,". . ."===u.spec&&(e=[new L(". . .")]);else for(const i of s){if(!F(e,i))continue;t.shape="define-hat",t.category="custom";const o=e.splice(i.definePrefix.length,e.length-i.defineSuffix.length).map((t=>{if(t.isInput&&t.isBoolean)t=D({shape:"boolean",argument:"boolean",category:"custom-arg"},[new L("")],s);else if(!t.isInput||"string"!==t.shape&&"number"!==t.shape)(t.isReporter||t.isBoolean)&&(t.info.categoryIsDefault&&(t.info.category="custom-arg"),t.info.argument=t.isBoolean?"boolean":"number");else{const e=t.value.split(/ +/g).map((t=>new L(t)));t=D({shape:"reporter",argument:"string"===t.shape?"string":"number",category:"custom-arg"},e,s)}return t})),a=new M({shape:"outline",category:"custom",categoryIsDefault:!0,hasLoopArrow:!1},o);e.splice(i.definePrefix.length,0,a);break}}!function(t,e){for(const s of e)d.test(s)?(t.color=s,t.category="",t.categoryIsDefault=!1):o.includes(s)?(t.category=s,t.categoryIsDefault=!1):a.includes(s)?(t.shape=s,t.shapeIsDefault=!1):"loop"===s?t.hasLoopArrow=!0:"+"===s||"-"===s?t.diff=s:"reset"===s&&(t.categoryIsDefault=!1,t.isReset=!0)}(t,i),e.forEach((e=>{e.hasArrow&&(e.menu=function(t,e,s){for(const i of s)if(Object.prototype.hasOwnProperty.call(i.nativeDropdowns,t)){const s=i.nativeDropdowns[t];for(const{id:t,parents:i}of s)if(i.includes(e))return t}}(e.value,t.id,s))})),t.hasLoopArrow&&e.push(new R("loopArrow"));const g=new M(t,e);return u&&h.test(u.spec)&&g.translate(p,!0),"+"===t.diff?new x(g):(g.diff=t.diff,g)}function F(t,e){if(t.length<e.definePrefix.length)return!1;if(t.length<e.defineSuffix.length)return!1;for(let s=0;s<e.definePrefix.length;s++){const i=e.definePrefix[s],o=t[s];if(!o.isLabel||b(o.value)!==b(i))return!1}for(let s=1;s<=e.defineSuffix.length;s++){const i=e.defineSuffix[e.defineSuffix.length-s],o=t[t.length-s];if(!o.isLabel||b(o.value)!==b(i))return!1}return!0}function _(t,e){let s,i=t[0],o=0;function a(){i=t[++o]}function r(){return t[o+1]}function n(){for(let e=o+1;e<t.length;e++)if(" "!==t[e])return t[e]}let l=[];function c(t,s){const i=s.filter((t=>!t.isLabel)).length;return D({shape:t,category:"reporter"!==t||i?"obsolete":"variables",categoryIsDefault:!0,hasLoopArrow:!1},s,e)}function h(t,e){return new N(t,e)}function p(t){const e=[];let s;for(;i&&"\n"!==i;){if(("<"===i||">"===i)&&">"===t&&1===e.length&&!e[e.length-1].isLabel){const t=n();if("["===t||"("===t||"<"===t||"{"===t){s=null,e.push(new L(i)),a();continue}}if(i===t)break;if("/"===i&&"/"===r()&&!t)break;switch(i){case"[":s=null,e.push(u());break;case"(":s=null,e.push(f());break;case"<":s=null,e.push(b());break;case"{":s=null,e.push(m());break;case" ":case"\t":a(),s=null;break;case"◂":case"▸":e.push(V()),s=null;break;case"@":{a();let t="";for(;i&&/[a-zA-Z]/.test(i);)t+=i,a();"cloud"===t?e.push(new L("☁")):e.push(Object.prototype.hasOwnProperty.call(R.icons,t)?new R(t):new L("@"+t)),s=null;break}case"\\":a();case":":if(":"===i&&":"===r())return e.push(A(t)),e;default:s||e.push(s=new L("")),s.value+=i,a()}}return e}function u(){a();let t="",e=!1;const s="\\"===i;for(;i&&"]"!==i&&"\n"!==i;){if("\\"===i){if(a(),"v"===i&&(e=!0),!i)break}else e=!1;t+=i,a()}return"]"===i&&a(),!s&&d.test(t)?new N("color",t):!e&&/ v$/.test(t)?h("dropdown",t.slice(0,t.length-2)):new N("string",t)}function g(t){const e=p(t);if(i&&"\n"===i&&(s=!0,a()),0!==e.length){if(1===e.length){const t=e[0];if(t.isBlock&&(t.isReporter||t.isBoolean||t.isRing))return t}return c("stack",e)}}function f(){a();const e="\\"===i;if("{"===i){const e=o,s=i;let r=1,n="";for(a();i&&r>0;){if("{"===i)r++;else if("}"===i&&(r--,0===r))break;n+=i,a()}if("}"===i&&0===r){a();let e=0;for(;e<t.length&&" "===t[o+e];)e++;if(o+e<t.length&&"v"===t[o+e]&&o+e+1<t.length&&")"===t[o+e+1]){o+=e,i=t[o],a(),a();const s=[];let r="";for(let t=0;t<n.length;t++){const e=n[t];if("\n"!==e&&" "!==e&&"\t"!==e)if(","===e){if(r.trim()){const t=r.trim().split("").map((t=>"1"===t));s.push(t),r=""}}else r+=e}if(r.trim()){const t=r.trim().split("").map((t=>"1"===t));s.push(t)}const l=new C(s);return new N("number-dropdown",l,null)}}o=e,i=s}if(" "===i&&(a(),"v"===i&&")"===r()))return a(),a(),new N("number-dropdown","");const s=p(")");if(i&&")"===i&&a(),0===s.length)return new N("number","");if(1===s.length&&s[0].isLabel){const t=s[0].value;if(/^[0-9e.-]*$/.test(t))return new N("number",t);if(!e&&d.test(t))return new N("color",t)}if(s.length>1&&s.every((t=>t.isLabel))){if("v"===s[s.length-1].value){s.pop();return h("number-dropdown",s.map((t=>t.value)).join(" "))}}const n=c("reporter",s);if(n.info&&"ring"===n.info.shape){const t=n.children[0];t&&t.isInput&&"number"===t.shape&&""===t.value?n.children[0]=new N("reporter"):(t&&t.isScript&&t.isEmpty||t&&t.isBlock&&!t.children.length)&&(n.children[0]=new N("stack"))}return n}function b(){a();const t=p(">");return i&&">"===i&&a(),0===t.length?new N("boolean"):c("boolean",t)}function m(){a(),s=!1;const t=H((function(){for(;i&&"}"!==i;){const t=g("}");if(t)return t}}));let e=[];return t.forEach((t=>{e=e.concat(t.blocks)})),"}"===i&&a(),s?new I(e):(function(t){if(!t)throw Error("Assertion failed! ")}(e.length<=1),e.length?e[0]:c("stack",[]))}function V(){const t=i;switch(a(),t){case"▸":return new R("addInput");case"◂":return new R("delInput");default:return}}function A(t){a(),a();const e=[];let s="";for(;i&&"\n"!==i&&i!==t;){if(" "===i)s&&(e.push(s),s="");else{if("/"===i&&"/"===r())break;s+=i}a()}return s&&e.push(s),e}function k(){let t;"+"!==i&&"-"!==i||(t=i,a());const e=g();if("/"===i&&"/"===r()){const t=function(t){a(),a();let e="";for(;i&&"\n"!==i&&i!==t;)e+=i,a();return i&&"\n"===i&&a(),new B(e,!0)}();if(t.hasBlock=e&&e.children.length,!t.hasBlock)return t;e.comment=t}return e&&(e.diff=t),e}return e.map((t=>{l=l.concat(t.define)})),()=>{if(!i)return;return k()||"NL"}}function H(t){let e=t();function s(){e=t()}function i(){const t=e;if(s(),t.hasScript)for(;;){const i=o();if(t.children.push(new I(i)),!e||!e.isElse){e&&e.isEnd&&s();break}for(const s of e.children)t.children.push(s);s()}return t}function o(){const t=[];for(;e;){if("NL"===e){s();continue}if(!e.isCommand)return t;const o=i(),a="+"===o.diff;if(a&&(o.diff=null),a){const e=t[t.length-1];let s=[];e&&e.isGlow&&(t.pop(),s=e.child.isScript?e.child.blocks:[e.child]),s.push(o),t.push(new x(new I(s)))}else t.push(o)}return t}return function(){for(;"NL"===e;)s();const t=[];for(;e;){let o=[];for(;e&&"NL"!==e;){let e=i();const s="+"===e.diff;if(s&&(e.diff=null),(e.isElse||e.isEnd)&&(e=new M({...e.info,shape:"stack"},e.children)),s){const t=o[o.length-1];let s=[];t&&t.isGlow&&(o.pop(),s=t.child.isScript?t.child.blocks:[t.child]),s.push(e),o.push(new x(new I(s)))}else if(e.isHat)o.length&&t.push(new I(o)),o=[e];else{if(e.isFinal){o.push(e);break}if(!e.isCommand){o.length&&t.push(new I(o)),t.push(new I([e])),o=[];break}o.push(e)}}for(o.length&&t.push(new I(o));"NL"===e;)s()}return t}()}function G(t,e){t.isScript?t.blocks=t.blocks.map((t=>(G(t,e),e(t)||t))):t.isBlock?t.children=t.children.map((t=>(G(t,e),e(t)||t))):t.isGlow&&G(t.child,e)}const z={"append:toList:":1,"deleteLine:ofList:":1,"insert:at:ofList:":2,"setLine:ofList:to:":1,"showList:":0,"hideList:":0};function K(t,e){if((e={inline:!1,languages:["en"],...e}).dialect)throw Error("Option 'dialect' no longer supported");t=(t=t.replace(/&lt;/g,"<")).replace(/&gt;/g,">"),e.inline&&(t=t.replace(/\n/g," "));const s=e.languages.map((t=>{const e=k[t];if(!e)throw Error(`Unknown language: '${t}'`);return e})),i=H(_(t,s));!function(t){const e=Object.create(null),s=new Set;t.forEach((t=>{const i=new Set;G(t,(t=>{if(t.isBlock)if("define-hat"===t.info.shape){const s=t.children.find((t=>t.isOutline));if(!s)return;const o=[],a=[];for(const t of s.children)if(t.isLabel)a.push(t.value);else if(t.isBlock){if(!t.info.argument)return;a.push({number:"%n",string:"%s",boolean:"%b"}[t.info.argument]);const e=O(t);o.push(e),i.add(e)}const r=a.join(" "),n=f(r),l={spec:r,names:o};e[n]||(e[n]=l),t.info.id="PROCEDURES_DEFINITION",t.info.selector="procDef",t.info.call=l.spec,t.info.names=l.names,t.info.category="custom"}else if(t.info.categoryIsDefault&&(t.isReporter||t.isBoolean)){const e=O(t);i.has(e)&&(t.info.category="custom-arg",t.info.categoryIsDefault=!1,t.info.selector="getParam")}else if(Object.prototype.hasOwnProperty.call(z,t.info.selector)){const e=z[t.info.selector],i=t.children.filter((t=>!t.isLabel))[e];i&&i.isInput&&s.add(i.value)}}))})),t.forEach((t=>{G(t,(t=>{if(t.info&&(t.info.categoryIsDefault&&"obsolete"===t.info.category||"custom"===t.info.category&&!t.info.selector)){const s=e[t.info.hash];return void(s&&(t.info.id="PROCEDURES_CALL",t.info.selector="call",t.info.call=s.spec,t.info.names=s.names,t.info.category="custom"))}let i,o;t.isReporter&&"variables"===t.info.category&&t.info.categoryIsDefault&&(t.info.selector="readVariable",i=O(t),o=t.info),i&&s.has(i)&&(o.category="list",o.categoryIsDefault=!1,o.selector="contentsOfList:")}))}))}(i);const o=new P(i);return function(t){function e(t,i,o){if(!t||!t.isBlock)return;t.blockPath=i,o.set(i,t);let a=0;for(const r of t.children)if(r.isBlock)a++,e(r,`${i}.${a}`,o);else if(r.isScript){a++;let t=0;for(const n of r.blocks)t++,n.isBlock?e(n,`${i}.${a}.${t}`,o):n.isGlow&&s(n,`${i}.${a}.${t}`,o)}else r.isGlow&&(a++,s(r,`${i}.${a}`,o))}function s(t,i,o){if(!t||!t.isGlow)return;const a=t.child;if(a.isBlock)e(a,i,o);else if(a.isScript){let t=0;for(const r of a.blocks)t++,r.isBlock?e(r,`${i}.${t}`,o):r.isGlow&&s(r,`${i}.${t}`,o)}}t.scripts.forEach(((i,o)=>{i.scriptIndex=o+1;let a=0;for(const r of i.blocks){a++;const i=`${o+1}.${a}`;r.isBlock?e(r,i,t.blockMap):r.isGlow&&s(r,i,t.blockMap)}}))}(o),o}function U(t,e){if(!t)throw Error("Assertion failed! "+e)}let j,W;const Y={textContent:!0};let Z=class t{static init(e){j=e.document;const s=e.DOMParser;W=(new s).parseFromString("<xml></xml>","application/xml"),t.XMLSerializer=e.XMLSerializer}static makeCanvas(){return j.createElement("canvas")}static cdata(t){return W.createCDATASection(t)}static el(e,s){const i=j.createElementNS("http://www.w3.org/2000/svg",e);return t.setProps(i,s)}static setProps(t,e){for(const s in e){const i=e[s]+"";Y[s]?t[s]=i:null!=e[s]&&Object.prototype.hasOwnProperty.call(e,s)&&t.setAttributeNS(null,s,i)}return t}static withChildren(t,e){for(const s of e)t.appendChild(s);return t}static group(e){return t.withChildren(t.el("g"),e)}static newSVG(e,s,i){return t.el("svg",{version:"1.1",width:e*i,height:s*i,viewBox:`0 0 ${e} ${s}`})}static polygon(e){return t.el("polygon",{...e,points:e.points.join(" ")})}static path(e){return t.el("path",{...e,path:null,d:e.path.join(" ")})}static text(e,s,i,o){return t.el("text",{...o,x:e,y:s,textContent:i})}static symbol(e){return t.el("use",{href:e})}static move(e,s,i){return t.setProps(i,{transform:`translate(${e} ${s})`}),i}static translatePath(t,e,s){let i=!0;const o=s.split(/\s+/),a=[];for(let s=0;s<o.length;s++){let r=o[s];if("A"!==r)/[A-Za-z]/.test(r)?U(i,"translatePath: invalid argument"):(r=+r,r+=i?t:e,i=!i),a.push(r);else{const t=s+5;for(a.push("A");s<t;)a.push(o[++s])}}return a.join(" ")}static rect(e,s,i){return t.el("rect",{...i,x:0,y:0,width:e,height:s})}static ellipse(e,s,i){return t.el("ellipse",{...i,cx:e/2,cy:s/2,rx:e/2,ry:s/2})}static arc(t,e,s,i,o,a){return`L ${t} ${e} A ${o} ${a} 0 0 1 ${s} ${i}`}static arcw(t,e,s,i,o,a){return`L ${t} ${e} A ${o} ${a} 0 0 0 ${s} ${i}`}static roundedPath(e,s){const i=s/2;return["M",i,0,t.arc(e-i,0,e-i,s,i,i),t.arc(i,s,i,0,i,i),"Z"]}static roundedRect(e,s,i){return t.path({...i,path:t.roundedPath(e,s)})}static pointedPath(t,e){const s=e/2;return["M",s,0,"L",t-s,0,t,s,"L",t,s,t-s,e,"L",s,e,0,s,"L",0,s,s,0,"Z"]}static pointedRect(e,s,i){return t.path({...i,path:t.pointedPath(e,s)})}static getTop(t){return`M 0 3\n L 3 0\n L 13 0\n L 16 3\n L 24 3\n L 27 0\n L ${t-3} 0\n L ${t} 3`}static getRingTop(t){return`M 0 3\n L 3 0\n L 7 0\n L 10 3\n L 16 3\n L 19 0\n L ${t-3} 0\n L ${t} 3`}static getRightAndBottom(t,e,s,i){void 0===i&&(i=0);let o=["L",t,e-3,"L",t-3,e];return s&&(o=o.concat(["L",i+27,e,"L",i+24,e+3,"L",i+16,e+3,"L",i+13,e])),o=i>0?o.concat(["L",i+2,e,"L",i,e+2]):o.concat(["L",i+3,e,"L",0,e-3]),o.join(" ")}static getArm(t,e){return`L 15 ${e-2}\n L 17 ${e}\n L ${t-3} ${e}\n L ${t} ${e+3}`}static stackRect(e,s,i){return t.path({...i,path:[t.getTop(e),t.getRightAndBottom(e,s,!0,0),"Z"]})}static capPath(e,s){return[t.getTop(e),t.getRightAndBottom(e,s,!1,0),"Z"]}static capRect(e,s,i){return t.path({...i,path:t.capPath(e,s)})}static hatRect(e,s,i){return t.path({...i,path:["M",0,12,t.arc(0,12,80,10,80,80),"L",e-3,10,"L",e,13,t.getRightAndBottom(e,s,!0),"Z"]})}static curve(t,e,s,i,o){const a=(e+i)/2;return`${Math.round((t+s)/2+(o=o||.42)*(i-e))} ${Math.round(a-o*(s-t))} ${s} ${i}`}static procHatBase(e,s,i,o){return i=Math.min(.2,35/e),t.path({...o,path:["M",0,15,"Q",t.curve(0,15,e,15,i),t.getRightAndBottom(e,s,!0),"M",-1,13,"Q",t.curve(-1,13,e+1,13,i),"Q",t.curve(e+1,13,e,16,.6),"Q",t.curve(e,16,0,16,-i),"Q",t.curve(0,16,-1,13,.6),"Z"]})}static procHatCap(e,s,i){return t.path({path:["M",-1,13,"Q",t.curve(-1,13,e+1,13,i),"Q",t.curve(e+1,13,e,16,.6),"Q",t.curve(e,16,0,16,-i),"Q",t.curve(0,16,-1,13,.6),"Z"],class:"sb-define-hat-cap"})}static procHatRect(e,s,i){const o=s-52,a=Math.min(.2,35/e);return t.move(0,o,t.group([t.procHatBase(e,52,a,i),t.procHatCap(e,52,a)]))}static mouthRect(e,s,i,o,a){let r=o[0].height;const n=[t.getTop(e),t.getRightAndBottom(e,r,!0,15)];for(let s=1;s<o.length;s+=2){const a=s+2===o.length;r+=o[s].height-3,n.push(t.getArm(e,r));const l=!(a&&i),c=a?0:15;r+=o[s+1].height+3,n.push(t.getRightAndBottom(e,r,l,c))}return t.path({...a,path:n})}static ringRect(e,s,i,o,a,r,n){const l="reporter"===r?t.roundedPath:"boolean"===r?t.pointedPath:t.capPath;return t.path({...n,path:["M",8,0,t.arcw(8,0,0,8,8,8),t.arcw(0,s-8,8,s,8,8),t.arcw(e-8,s,e,s-8,8,8),t.arcw(e,8,e-8,0,8,8),"Z",t.translatePath(4,i||4,l(o,a).join(" "))],"fill-rule":"even-odd"})}static commentRect(e,s,i){return t.path({...i,class:"sb-comment",path:["M",6,0,t.arc(e-6,0,e,6,6,6),t.arc(e,s-6,e-6,s,6,6),t.arc(6,s,0,s-6,6,6),t.arc(0,6,6,0,6,6),"Z"]})}static commentLine(e,s){return t.move(-e,9,t.rect(e,2,{...s,class:"sb-comment-line"}))}static strikethroughLine(e,s){return t.path({...s,path:["M",0,0,"L",e,0],class:"sb-diff sb-diff-del"})}};class X{constructor(t,e){this.el=Z.el("filter",{...e,id:t,x0:"-50%",y0:"-50%",width:"200%",height:"200%"}),this.highestId=0}fe(t,e,s){const i=`${t.toLowerCase().replace(/gaussian|osite/,"")}-${++this.highestId}`;return this.el.appendChild(Z.withChildren(Z.el("fe"+t,{...e,result:i}),s||[])),i}comp(t,e,s,i){return this.fe("Composite",{...i,operator:t,in:e,in2:s})}subtract(t,e){return this.comp("arithmetic",t,e,{k2:1,k3:-1})}offset(t,e,s){return this.fe("Offset",{in:s,dx:t,dy:e})}flood(t,e,s){return this.fe("Flood",{in:s,"flood-color":t,"flood-opacity":e})}blur(t,e){return this.fe("GaussianBlur",{in:e,stdDeviation:`${t} ${t}`})}colorMatrix(t,e){return this.fe("ColorMatrix",{in:t,type:"matrix",values:e.join(" ")})}merge(t){this.fe("Merge",{},t.map((t=>Z.el("feMergeNode",{in:t}))))}}let Q=class t{static get cssContent(){return"@keyframes sb-blink-animation{0%{fill:#fbf883}50%{fill:#fbf883;animation-timing-function:step-start}}.sb-label{font-family:Lucida Grande,Verdana,Arial,DejaVu Sans,sans-serif;font-weight:700;fill:#fff;font-size:10px;word-spacing:1px}.sb-obsolete{fill:#d42828}.sb-motion{fill:#4a6cd4}.sb-looks{fill:#8a55d7}.sb-sound{fill:#bb42c3}.sb-pen{fill:#0e9a6c}.sb-events{fill:#c88330}.sb-control{fill:#e1a91a}.sb-sensing{fill:#2ca5e2}.sb-operators{fill:#5cb712}.sb-variables{fill:#ee7d16}.sb-list{fill:#cc5b22}.sb-custom{fill:#632d99}.sb-custom-arg{fill:#5947b1}.sb-extension{fill:#4b4a60}.sb-grey{fill:#969696}.sb-bevel{filter:url(#bevelFilter)}.sb-input{filter:url(#inputBevelFilter)}.sb-input-number,.sb-input-number-dropdown,.sb-input-string{fill:#fff}.sb-literal-dropdown,.sb-literal-number,.sb-literal-number-dropdown,.sb-literal-string{font-weight:400;font-size:9px;word-spacing:0}.sb-literal-number,.sb-literal-number-dropdown,.sb-literal-string{fill:#000}.sb-darker{filter:url(#inputDarkFilter)}.sb-outline{stroke:#fff;stroke-opacity:.2;stroke-width:2;fill:none}.sb-comment,.sb-define-hat-cap{stroke:#632d99;stroke-width:1;fill:#8e2ec2}.sb-comment{fill:#ffffa5;stroke:#d0d1d2}.sb-comment-line{fill:#ffff80}.sb-comment-label{font-family:Helvetica,Arial,DejaVu Sans,sans-serif;font-weight:700;fill:#5c5d5f;word-spacing:0;font-size:12px}.sb-diff{fill:none;stroke:#000}.sb-diff-ins{stroke-width:2px}.sb-diff-del{stroke-width:3px}.sb-highlight:not(.sb-blink){fill:#fbf883!important}.sb-blink{animation:sb-blink-animation .5s 3}"}static makeIcons(){return[Z.el("path",{d:"M1.504 21L0 19.493 4.567 0h1.948l-.5 2.418s1.002-.502 3.006 0c2.006.503 3.008 2.01 6.517 2.01 3.508 0 4.463-.545 4.463-.545l-.823 9.892s-2.137 1.005-5.144.696c-3.007-.307-3.007-2.007-6.014-2.51-3.008-.502-4.512.503-4.512.503L1.504 21z",fill:"#3f8d15",id:"greenFlag"}),Z.el("polygon",{points:"6.3,0.4725 12.516,0.4725 18.585,6.3 18.585,12.495 12.495,18.585 6.3,18.585 0.483,12.495 0.483,6.3 ",fill:"#bb0010",id:"stopSign"}),Z.el("path",{d:"M6.724 0C3.01 0 0 2.91 0 6.5c0 2.316 1.253 4.35 3.14 5.5H5.17v-1.256C3.364 10.126 2.07 8.46 2.07 6.5 2.07 4.015 4.152 2 6.723 2c1.14 0 2.184.396 2.993 1.053L8.31 4.13c-.45.344-.398.826.11 1.08L15 8.5 13.858.992c-.083-.547-.514-.714-.963-.37l-1.532 1.172A6.825 6.825 0 0 0 6.723 0z",fill:"#fff",id:"turnRight"}),Z.el("path",{d:"M3.637 1.794A6.825 6.825 0 0 1 8.277 0C11.99 0 15 2.91 15 6.5c0 2.316-1.253 4.35-3.14 5.5H9.83v-1.256c1.808-.618 3.103-2.285 3.103-4.244 0-2.485-2.083-4.5-4.654-4.5-1.14 0-2.184.396-2.993 1.053L6.69 4.13c.45.344.398.826-.11 1.08L0 8.5 1.142.992c.083-.547.514-.714.963-.37l1.532 1.172z",fill:"#fff",id:"turnLeft"}),Z.el("path",{d:"M0 0L4 4L0 8Z",fill:"#111",id:"addInput"}),Z.el("path",{d:"M4 0L4 8L0 4Z",fill:"#111",id:"delInput"}),Z.setProps(Z.group([Z.el("path",{d:"M8 0l2 -2l0 -3l3 0l-4 -5l-4 5l3 0l0 3l-8 0l0 2",fill:"#000",opacity:"0.3"}),Z.move(-1,-1,Z.el("path",{d:"M8 0l2 -2l0 -3l3 0l-4 -5l-4 5l3 0l0 3l-8 0l0 2",fill:"#fff",opacity:"0.9"}))]),{id:"loopArrow"}),Z.setProps(Z.group([Z.el("rect",{x:"0",y:"0",width:"12",height:"14",fill:"#000",opacity:"0.25"}),Z.el("rect",{x:"1",y:"1",width:"1",height:"13",fill:"#fff"}),Z.el("rect",{x:"11",y:"1",width:"1",height:"13",fill:"#fff"}),Z.el("rect",{x:"2",y:"1",width:"9",height:"1",fill:"#fff"}),Z.el("rect",{x:"2",y:"5",width:"9",height:"1",fill:"#fff"}),Z.el("rect",{x:"2",y:"9",width:"9",height:"1",fill:"#fff"}),Z.el("rect",{x:"2",y:"13",width:"9",height:"1",fill:"#fff"}),Z.el("rect",{x:"2",y:"2",width:"9",height:"2",fill:"#ea8d1c"}),Z.el("rect",{x:"2",y:"6",width:"9",height:"2",fill:"#ea8d1c"}),Z.el("rect",{x:"2",y:"10",width:"9",height:"2",fill:"#ea8d1c"}),Z.el("rect",{x:"11",y:"0",width:"1",height:"1",fill:"#ea8d1c"}),Z.el("rect",{x:"0",y:"13",width:"1",height:"1",fill:"#ea8d1c"})]),{id:"list"})]}static makeStyle(){const e=Z.el("style");return e.appendChild(Z.cdata(t.cssContent)),e}static bevelFilter(t,e){const s=new X(t),i="SourceAlpha",o=e?-1:1,a=s.blur(1,i);return s.merge(["SourceGraphic",s.comp("in",s.flood("#fff",.15),s.subtract(i,s.offset(+o,+o,a))),s.comp("in",s.flood("#000",.7),s.subtract(i,s.offset(-o,-o,a)))]),s.el}static darkFilter(t){const e=new X(t);return e.merge(["SourceGraphic",e.comp("in",e.flood("#000",.2),"SourceAlpha")]),e.el}static darkRect(t,e,s,i){return Z.setProps(Z.group([Z.setProps(i,{class:`sb-${s} sb-darker`})]),{width:t,height:e})}static get defaultFontFamily(){return"Lucida Grande, Verdana, Arial, DejaVu Sans, sans-serif"}};const{defaultFontFamily:q,makeStyle:$,makeIcons:J,darkRect:tt,bevelFilter:et,darkFilter:st}=Q;let it=class t{constructor(t){Object.assign(this,t),this.el=null,this.height=12,this.metrics=null,this.x=0}get isLabel(){return!0}draw(){return this.el}get width(){return this.metrics.width}measure(){const e=this.value,s="sb-"+this.cls;this.el=Z.text(0,10,e,{class:"sb-label "+s});let i=t.metricsCache[s];if(i||(i=t.metricsCache[s]=Object.create(null)),Object.hasOwnProperty.call(i,e))this.metrics=i[e];else{const s=/comment-label/.test(this.cls)?"bold 12px Helvetica, Arial, DejaVu Sans, sans-serif":/literal/.test(this.cls)?"normal 9px "+q:"bold 10px "+q;this.metrics=i[e]=t.measure(e,s)}}static measure(e,s){const i=t.measuring;i.font=s;return{width:i.measureText(e).width+.5|0}}};it.metricsCache={},it.toMeasure=[];let ot=class t{constructor(e){Object.assign(this,e);const s=t.icons[this.name];if(!s)throw Error("no info for icon: "+this.name);Object.assign(this,s)}get isIcon(){return!0}draw(){return Z.symbol("#"+this.name,{width:this.width,height:this.height})}static get icons(){return{greenFlag:{width:20,height:21,dy:-2},stopSign:{width:20,height:20},turnLeft:{width:15,height:12,dy:1},turnRight:{width:15,height:12,dy:1},loopArrow:{width:14,height:11},addInput:{width:4,height:8},delInput:{width:4,height:8},list:{width:12,height:14}}}},at=class{constructor(t){if(Object.assign(this,t),this.x=0,this.rows&&this.rows.length>0){const t=this.rows.length,e=this.rows[0].length,s=.5,i=10-(t-1)*s;this.cellSize=Math.max(1,Math.floor(i/t)),this.width=e*(this.cellSize+s)-s,this.height=t*(this.cellSize+s)-s}else this.width=0,this.height=0,this.cellSize=0}get isMatrix(){return!0}measure(){}draw(t){if(!this.rows||0===this.rows.length)return Z.group([]);const e=this.cellSize,s=e+.5,i=[];for(let o=0;o<this.rows.length;o++){const a=this.rows[o];for(let r=0;r<a.length;r++){const n=r*s,l=o*s,c=!0===a[r],h=Z.el("rect",{x:n,y:l,width:e,height:e,"stroke-width":0});c?h.setAttribute("fill","#FFFFFF"):h.classList.add("sb-"+t.info.category),i.push(h)}}return Z.group(i)}},rt=class t{constructor(t){Object.assign(this,t),t.label&&(this.label=dt(t.label)),t.value&&t.value.isMatrix&&(this.matrixView=new at(t.value)),this.x=0}measure(){this.hasLabel&&this.label.measure(),this.matrixView&&this.matrixView.measure()}static get shapes(){return{string:Z.rect,number:Z.roundedRect,"number-dropdown":Z.roundedRect,color:Z.rect,dropdown:Z.rect,boolean:Z.pointedRect,stack:Z.stackRect,reporter:Z.roundedRect}}draw(e){let s,i,o;const a=!!this.matrixView;if(a){o=4;s=this.matrixView.width+o+4,this.height=14}else this.hasLabel?(i=this.label.draw(),s=Math.max(14,this.label.width+("string"===this.shape||"number-dropdown"===this.shape?6:9))):s=this.isInset?30:this.isColor?13:null;this.hasArrow&&(s+=10),this.width=s;const r=this.height=a?14:this.isRound||this.isColor?13:14,n=a?"number-dropdown":this.shape;let l=t.shapes[n](s,r);this.isColor?Z.setProps(l,{fill:this.value}):(this.isDarker||a)&&(l=tt(s,r,e.info.category,l),e.info.color&&Z.setProps(l,{fill:e.info.color}));const c=Z.group([Z.setProps(l,{class:"sb-input sb-input-"+(a?"number-dropdown":this.shape)})]);if(a){const t=o,s=(r-this.matrixView.height)/2,i=this.matrixView.draw(e);c.appendChild(Z.move(t,s,i))}if(this.hasLabel){const t=this.isRound?5:4;c.appendChild(Z.move(t,0,i))}if(this.hasArrow){const t="dropdown"===this.shape?5:4;c.appendChild(Z.move(s-10,t,Z.polygon({points:[7,0,3.5,4,0,0],fill:"#000",opacity:"0.6"})))}return c}},nt=class i{constructor(i){Object.assign(this,i),this.children=i.children.map(dt),this.comment=this.comment?dt(this.comment):null,this.block=i,Object.prototype.hasOwnProperty.call(s,this.info.category)&&(this.info.category=s[this.info.category]),Object.prototype.hasOwnProperty.call(t,this.info.category)?this.info.category=t[this.info.category]:Object.prototype.hasOwnProperty.call(e,this.info.category)&&(this.info.category="extension"),this.x=0,this.width=null,this.height=null,this.firstLine=null,this.innerWidth=null}get isBlock(){return!0}measure(){for(const t of this.children)t.measure&&t.measure();this.comment&&this.comment.measure()}static get shapes(){return{stack:Z.stackRect,"c-block":Z.stackRect,"if-block":Z.stackRect,celse:Z.stackRect,cend:Z.stackRect,cap:Z.capRect,reporter:Z.roundedRect,boolean:Z.pointedRect,hat:Z.hatRect,cat:Z.hatRect,"define-hat":Z.procHatRect,ring:Z.roundedRect}}drawSelf(t,e,s){if(s.length>1)return Z.mouthRect(t,e,this.isFinal,s,{class:`sb-${this.info.category} sb-bevel`});if("outline"===this.info.shape)return Z.setProps(Z.stackRect(t,e),{class:"sb-outline"});if(this.isRing){const s=this.children[0];if(s&&(s.isStack||s.isBlock||s.isScript)){const i=s.isScript?"stack":s.isStack?s.shape:s.info.shape;return Z.ringRect(t,e,s.y,s.width,s.height,i,{class:`sb-${this.info.category} sb-bevel`})}}const o=i.shapes[this.info.shape];if(!o)throw Error("no shape func: "+this.info.shape);return o(t,e,{class:`sb-${this.info.category} sb-bevel`})}minDistance(t){return this.isBoolean?t.isReporter?4+t.height/4|0:t.isLabel?5+t.height/2|0:t.isBoolean||"boolean"===t.shape?5:2+t.height/2|0:this.isReporter?t.isInput&&t.isRound||(t.isReporter||t.isBoolean)&&!t.hasScript?0:t.isLabel?2+t.height/2|0:t.height/2-2|0:0}static get padding(){return{hat:[15,6,2],cat:[15,6,2],"define-hat":[21,8,9],reporter:[3,4,1],boolean:[3,4,2],cap:[6,6,2],"c-block":[3,6,2],"if-block":[3,6,2],ring:[4,4,2],null:[4,6,2]}}draw(){const t="define-hat"===this.info.shape;let e=this.children;const s=i.padding[this.info.shape]||i.padding.null;let o=s[0];const a=s[1],r=s[2];let n=0;const l=function(t){this.y=t,this.width=0,this.height=t?13:16,this.children=[]};let c=0,h=0,p=new l(n);const d=t=>{0===u.length?p.height+=o+r:(p.height+=t?0:2,p.y-=1),n+=p.height,u.push(p)};if(this.info.isRTL){let t=0;const s=()=>{e=e.slice(0,t).concat(e.slice(t,i).reverse()).concat(e.slice(i))};let i;for(i=0;i<e.length;i++)e[i].isScript&&(s(),t=i+1);t<i&&s()}const u=[];for(let t=0;t<e.length;t++){const s=e[t];if(s.el=s.draw(this),s.isScript&&this.isCommand)this.hasScript=!0,d(),s.y=n,u.push(s),h=Math.max(h,Math.max(1,s.width)),s.height=Math.max(12,s.height)+3,n+=s.height,p=new l(n);else if(s.isArrow)p.children.push(s);else{const e=t>0?30:0,i=this.isCommand?0:this.minDistance(s),o=this.isCommand?s.isBlock||s.isInput?e:0:i;o&&!u.length&&p.width<o-a&&(p.width=o-a),s.x=p.width,p.width+=s.width,c=Math.max(c,p.width+Math.max(0,i-a)),p.width+=4,s.isLabel||(p.height=Math.max(p.height,s.height)),p.children.push(s)}}if(d(!0),c=Math.max(c+2*a,this.isHat||this.hasScript?83:this.isCommand||this.isOutline||this.isRing?39:20),this.height=n,this.width=h?Math.max(c,15+h):c,t){const t=Math.min(26,3.5+.13*c|0)-18;this.height+=t,o+=2*t}this.firstLine=u[0],this.innerWidth=c;const g=[];for(const e of u){if(e.isScript){g.push(Z.move(15,e.y,e.el));continue}const s=e.height;for(const i of e.children){if(i.isArrow){g.push(Z.move(c-15,this.height-3,i.el));continue}let n=o+(s-i.height-o-r)/2-1;if(t&&i.isLabel?n+=3:i.isIcon&&(n+=0|i.dy),!(this.isRing&&(i.y=e.y+n|0,i.isInset)||(g.push(Z.move(a+i.x,e.y+n|0,i.el)),"+"!==i.diff))){const t=Z.insEllipse(i.width,i.height);g.push(Z.move(a+i.x,e.y+n|0,t))}}}const f=this.drawSelf(c,this.height,u);g.splice(0,0,f),this.info.color&&Z.setProps(f,{fill:this.info.color});const b=Z.group(g);return this.block&&this.block.blockPath&&Z.setProps(b,{"data-block-path":this.block.blockPath}),b}},lt=class t{constructor(t){Object.assign(this,t),this.label=dt(t.label),this.width=null}get isComment(){return!0}static get lineLength(){return 12}get height(){return 20}measure(){this.label.measure()}draw(){const e=this.label.draw();return this.width=this.label.width+16,Z.group([Z.commentLine(this.hasBlock?t.lineLength:0,6),Z.commentRect(this.width,this.height,{class:"sb-comment"}),Z.move(8,4,e)])}},ct=class{constructor(t){Object.assign(this,t),this.child=dt(t.child),this.width=null,this.height=null,this.y=0}get isGlow(){return!0}measure(){this.child.measure()}drawSelf(){const t=this.child;let e;const s=this.width,i=this.height-1;return e=t.isScript?!t.isEmpty&&t.blocks[0].isHat?Z.hatRect(s,i):t.isFinal?Z.capRect(s,i):Z.stackRect(s,i):t.drawSelf(s,i,[]),Z.setProps(e,{class:"sb-diff sb-diff-ins"})}draw(){const t=this.child,e=t.isScript?t.draw(!0):t.draw();return this.width=t.width,this.height=t.isBlock&&t.firstLine.height||t.height,Z.group([e,this.drawSelf()])}},ht=class{constructor(t){Object.assign(this,t),this.blocks=t.blocks.map(dt),this.y=0}get isScript(){return!0}measure(){for(const t of this.blocks)t.measure()}draw(t){const e=[];let s=0;this.width=0;for(const i of this.blocks){const o=t?0:2,a=i.draw();e.push(Z.move(o,s,a)),this.width=Math.max(this.width,i.width);if("-"===i.diff){const t=i.width,a=i.firstLine.height||i.height;e.push(Z.move(o,s+a/2+1,Z.strikethroughLine(t))),this.width=Math.max(this.width,i.width)}s+=i.height;const r=i.comment;if(r){const t=i.firstLine,o=i.innerWidth+2+lt.lineLength,a=s-i.height+t.height/2,n=r.draw();e.push(Z.move(o,a-r.height/2,n)),this.width=Math.max(this.width,o+r.width)}}this.height=s,t||this.isFinal||(this.height+=3);const i=this.blocks[this.blocks.length-1];return!t&&i.isGlow&&(this.height+=2),Z.group(e)}},pt=class{constructor(t,e){Object.assign(this,t),this.scripts=t.scripts.map(dt),this.doc=t,this.width=null,this.height=null,this.el=null,this.defs=null,this.scale=e.scale,this.elementMap=new Map}measure(){this.scripts.forEach((t=>t.measure()))}render(t){if("function"==typeof t)throw Error("render() no longer takes a callback");this.measure();let e=0,s=0;const i=[];for(const t of this.scripts)s&&(s+=10),t.y=s,i.push(Z.move(0,s,t.draw())),s+=t.height,e=Math.max(e,t.width+4);this.width=e,this.height=s;const o=Z.newSVG(e,s,this.scale);return o.appendChild(this.defs=Z.withChildren(Z.el("defs"),[et("bevelFilter",!1),et("inputBevelFilter",!0),st("inputDarkFilter"),...J()])),o.appendChild(Z.group(i)),this.el=o,this._buildElementMap(),o}_buildElementMap(){if(!this.el)return;this.elementMap.clear();this.el.querySelectorAll("[data-block-path]").forEach((t=>{const e=t.getAttribute("data-block-path");e&&this.elementMap.set(e,{el:t})}))}getElementByPath(t){const e=this.elementMap.get(t);return e?e.el:null}highlightBlock(t,e={}){const s=this.getElementByPath(t);if(!s)return!1;const i=s.firstElementChild;return i&&(i.classList.remove("sb-highlight","sb-blink"),i.getBBox(),i.classList.add("sb-highlight"),e.blink&&i.classList.add("sb-blink")),!0}clearHighlight(t=null){if(t){const e=this.getElementByPath(t);if(e){const t=e.firstElementChild;t&&t.classList.remove("sb-highlight","sb-blink")}}else{this.el.querySelectorAll(".sb-highlight").forEach((t=>{t.classList.remove("sb-highlight","sb-blink")}))}}exportSVGString(){if(null==this.el)throw Error("call draw() first");const t=$();this.defs.appendChild(t);const e=(new Z.XMLSerializer).serializeToString(this.el);return this.defs.removeChild(t),e}exportSVG(){return"data:image/svg+xml;utf8,"+this.exportSVGString().replace(/[#]/g,encodeURIComponent)}toCanvas(t,e){e=e||1;const s=Z.makeCanvas();s.width=Math.max(1,this.width*e*this.scale),s.height=Math.max(1,this.height*e*this.scale);const i=s.getContext("2d"),o=new Image;o.src=this.exportSVG(),o.onload=()=>{i.save(),i.scale(e,e),i.drawImage(o,0,0),i.restore(),t(s)}}exportPNG(t,e){this.toCanvas((e=>{URL&&URL.createObjectURL&&Blob&&e.toBlob?e.toBlob((e=>{t(URL.createObjectURL(e))}),"image/png"):t(e.toDataURL("image/png"))}),e)}};const dt=(t,e)=>new((t=>{switch(t.constructor){case L:return it;case R:return ot;case N:return rt;case M:return nt;case B:return lt;case x:return ct;case I:return ht;case P:return pt;default:throw Error("no view for "+t.constructor.name)}})(t))(t,e);const ut=Q.makeStyle;let gt,ft;const bt={textContent:!0};class mt{static init(t){gt=t.document;const e=t.DOMParser;ft=(new e).parseFromString("<xml></xml>","application/xml"),mt.XMLSerializer=t.XMLSerializer}static makeCanvas(){return gt.createElement("canvas")}static cdata(t){return ft.createCDATASection(t)}static el(t,e){const s=gt.createElementNS("http://www.w3.org/2000/svg",t);return mt.setProps(s,e)}static setProps(t,e){for(const s in e){const i=e[s]+"";bt[s]?t[s]=i:null!=e[s]&&Object.prototype.hasOwnProperty.call(e,s)&&t.setAttributeNS(null,s,i)}return t}static withChildren(t,e){for(const s of e)t.appendChild(s);return t}static group(t){return mt.withChildren(mt.el("g"),t)}static newSVG(t,e,s){return mt.el("svg",{version:"1.1",width:t*s,height:e*s,viewBox:`0 0 ${t*s} ${e*s}`})}static polygon(t){return mt.el("polygon",{...t,points:t.points.join(" ")})}static path(t){return mt.el("path",{...t,path:null,d:t.path.join(" ")})}static text(t,e,s,i){return mt.el("text",{...i,x:t,y:e,textContent:s})}static symbol(t){return mt.el("use",{href:t})}static move(t,e,s){return mt.setProps(s,{transform:`translate(${t} ${e})`}),s}static rect(t,e,s){return mt.el("rect",{...s,x:0,y:0,width:t,height:e})}static roundRect(t,e,s){return mt.rect(t,e,{...s,rx:4,ry:4})}static pillRect(t,e,s){const i=e/2;return mt.rect(t,e,{...s,rx:i,ry:i})}static pointedPath(t,e){const s=e/2;return[`M ${s} 0`,`L ${t-s} 0 ${t} ${s}`,`L ${t} ${s} ${t-s} ${e}`,`L ${s} ${e} 0 ${s}`,`L 0 ${s} ${s} 0`,"Z"]}static pointedRect(t,e,s){return mt.path({...s,path:mt.pointedPath(t,e)})}static topNotch(t,e){return`c 2 0 3 1 4 2\n l 4 4\n c 1 1 2 2 4 2\n h 12\n c 2 0 3 -1 4 -2\n l 4 -4\n c 1 -1 2 -2 4 -2\n L ${t-4} ${e}\n a 4 4 0 0 1 4 4`}static getTop(t){return"M 0 4\n A 4 4 0 0 1 4 0\n H 12 "+mt.topNotch(t,0)}static getRingTop(t){return`M 0 3\n L 3 0\n L 7 0\n L 10 3\n L 16 3\n L 19 0\n L ${t-3} 0\n L ${t} 3`}static getRightAndBottom(t,e,s,i){void 0===i&&(i=0);let o=[`L ${t} ${e-4}`,"a 4 4 0 0 1 -4 4"];return s&&(o=o.concat([`L ${i+48} ${e}`,"c -2 0 -3 1 -4 2","l -4 4","c -1 1 -2 2 -4 2","h -12","c -2 0 -3 -1 -4 -2","l -4 -4","c -1 -1 -2 -2 -4 -2"])),0===i?(o.push("L",i+4,e),o.push("a 4 4 0 0 1 -4 -4")):(o.push("L",i+4,e),o.push("a 4 4 0 0 0 -4 4")),o.join(" ")}static getArm(t,e){return`L 16 ${e-4}\n a 4 4 0 0 0 4 4\n L 28 ${e} ${mt.topNotch(t,e)}`}static getArmNoNotch(t,e){return`L 16 ${e-4}\n a 4 4 0 0 0 4 4\n L 28 ${e} L ${t-4} ${e}\n a 4 4 0 0 1 4 4`}static stackRect(t,e,s){return mt.path({...s,path:[mt.getTop(t),mt.getRightAndBottom(t,e,!0,0),"Z"]})}static capPath(t,e){return[mt.getTop(t),mt.getRightAndBottom(t,e,!1,0),"Z"]}static capRect(t,e,s){return mt.path({...s,path:mt.capPath(t,e)})}static getHatTop(t){return`M 0 16 c 25,-22 71,-22 96,0 L ${t-4} 16 a 4 4 0 0 1 4 4`}static getCatTop(t){return`M 0 32\n c2.6,-2.3 5.5,-4.3 8.5,-6.2c-1,-12.5 5.3,-23.3 8.4,-24.8c3.7,-1.8 16.5,13.1 18.4,15.4c8.4,-1.3 17,-1.3 25.4,0c1.9,-2.3 14.7,-17.2 18.4,-15.4c3.1,1.5 9.4,12.3 8.4,24.8c3,1.8 5.9,3.9 8.5,6.1\n L ${t-4} 32\n a 4 4 0 0 1 4 4`}static hatRect(t,e,s){return mt.path({...s,path:[mt.getHatTop(t),mt.getRightAndBottom(t,e,!0,0),"Z"]})}static catHat(t,e,s){return mt.group([mt.path({...s,path:[mt.getCatTop(t),mt.getRightAndBottom(t,e,!0,0),"Z"]}),mt.move(0,32,mt.setProps(mt.group([mt.el("circle",{cx:29.1,cy:-3.3,r:3.4}),mt.el("circle",{cx:59.2,cy:-3.3,r:3.4}),mt.el("path",{d:"M45.6,0.1c-0.9,0-1.7-0.3-2.3-0.9c-0.6,0.6-1.3,0.9-2.2,0.9c-0.9,0-1.8-0.3-2.3-0.9c-1-1.1-1.1-2.6-1.1-2.8c0-0.5,0.5-1,1-1l0,0c0.6,0,1,0.5,1,1c0,0.4,0.1,1.7,1.4,1.7c0.5,0,0.7-0.2,0.8-0.3c0.3-0.3,0.4-1,0.4-1.3c0-0.1,0-0.1,0-0.2c0-0.5,0.5-1,1-1l0,0c0.5,0,1,0.4,1,1c0,0,0,0.1,0,0.2c0,0.3,0.1,0.9,0.4,1.2C44.8-2.2,45-2,45.5-2s0.7-0.2,0.8-0.3c0.3-0.4,0.4-1.1,0.3-1.3c0-0.5,0.4-1,0.9-1.1c0.5,0,1,0.4,1.1,0.9c0,0.2,0.1,1.8-0.8,2.8C47.5-0.4,46.8,0.1,45.6,0.1z"})]),{fill:"#000","fill-opacity":.6})),mt.move(0,32,mt.el("path",{d:"M73.1-15.6c1.7-4.2,4.5-9.1,5.8-8.5c1.6,0.8,5.4,7.9,5,15.4c0,0.6-0.7,0.7-1.1,0.5c-3-1.6-6.4-2.8-8.6-3.6C72.8-12.3,72.4-13.7,73.1-15.6z",fill:"#FFD5E6",transform:"translate(0, 32)"})),mt.move(0,32,mt.el("path",{d:"M22.4-15.6c-1.7-4.2-4.5-9.1-5.8-8.5c-1.6,0.8-5.4,7.9-5,15.4c0,0.6,0.7,0.7,1.1,0.5c3-1.6,6.4-2.8,8.6-3.6C22.8-12.3,23.2-13.7,22.4-15.6z",fill:"#FFD5E6",transform:"translate(0, 32)"}))])}static getProcHatTop(t){return`M 0 20 a 20 20 0 0 1 20 -20 L ${t-20} 0 a 20,20 0 0,1 20,20`}static procHatRect(t,e,s){return mt.path({...s,path:[mt.getProcHatTop(t),mt.getRightAndBottom(t,e,!0,0),"Z"]})}static mouthRect(t,e,s,i,o){let a=i[0].height;const r=[mt.getTop(t),mt.getRightAndBottom(t,a,!0,16)];for(let e=1;e<i.length;e+=2){const o=e+2===i.length,n=i[e];a+=n.height-3,n.isFinal?r.push(mt.getArmNoNotch(t,a)):r.push(mt.getArm(t,a));const l=!(o&&s),c=o?0:16;a+=i[e+1].height+3,r.push(mt.getRightAndBottom(t,a,l,c))}return r.push("Z"),mt.path({...o,path:r})}static commentRect(t,e,s){return mt.roundRect(t,e,{...s,class:"sb3-comment"})}static commentLine(t,e){return mt.move(-t,9,mt.rect(t,2,{...e,class:"sb3-comment-line"}))}static strikethroughLine(t,e){return mt.path({...e,path:["M",0,0,"L",t,0],class:"sb3-diff sb3-diff-del"})}}const Vt=new Set(["dropdownArrow","turnRight","turnLeft","loopArrow","musicBlock","penBlock","videoBlock","faceSensingBlock","ttsBlock","translationBlock"]);class At{static get cssContent(){return"@keyframes sb3-blink-animation{0%{fill:#fbf883}50%{fill:#fbf883;animation-timing-function:step-start}}.sb3-label{font-weight:500;font-size:12pt;font-family:Helvetica Neue,Helvetica,sans-serif}.sb3-literal-dropdown,.sb3-literal-number,.sb3-literal-number-dropdown,.sb3-literal-string{word-spacing:0}.sb3-diff{fill:none;stroke:#000}.sb3-diff-ins{stroke-width:2px}.sb3-diff-del{stroke-width:3px}.sb3-highlight:not(.sb3-blink):not(.sb3-highlight-colorShift){fill:#fbf883!important}.sb3-blink{animation:sb3-blink-animation .5s 3}svg .sb3-motion{fill:#4c97ff;stroke:#3373cc}svg .sb3-motion-alt{fill:#4280d7}svg .sb3-motion-dark{fill:#3373cc}svg .sb3-looks{fill:#96f;stroke:#774dcb}svg .sb3-looks-alt{fill:#855cd6}svg .sb3-looks-dark{fill:#774dcb}svg .sb3-sound{fill:#cf63cf;stroke:#bd42bd}svg .sb3-sound-alt{fill:#c94fc9}svg .sb3-sound-dark{fill:#bd42bd}svg .sb3-control{fill:#ffab19;stroke:#cf8b17}svg .sb3-control-alt{fill:#ec9c13}svg .sb3-control-dark{fill:#cf8b17}svg .sb3-events{fill:#ffbf00;stroke:#c90}svg .sb3-events-alt{fill:#e6ac00}svg .sb3-events-dark{fill:#c90}svg .sb3-sensing{fill:#5cb1d6;stroke:#2e8eb8}svg .sb3-sensing-alt{fill:#47a8d1}svg .sb3-sensing-dark{fill:#2e8eb8}svg .sb3-operators{fill:#59c059;stroke:#389438}svg .sb3-operators-alt{fill:#46b946}svg .sb3-operators-dark{fill:#389438}svg .sb3-variables{fill:#ff8c1a;stroke:#db6e00}svg .sb3-variables-alt{fill:#ff8000}svg .sb3-variables-dark{fill:#db6e00}svg .sb3-list{fill:#ff661a;stroke:#e64d00}svg .sb3-list-alt{fill:#f50}svg .sb3-list-dark{fill:#e64d00}svg .sb3-custom{fill:#ff6680;stroke:#f35}svg .sb3-custom-alt{fill:#ff4d6a}svg .sb3-custom-dark{fill:#f35}svg .sb3-extension{fill:#0fbd8c;stroke:#0b8e69}svg .sb3-extension-alt{fill:#0da57a}svg .sb3-extension-dark{fill:#0b8e69}svg .sb3-obsolete{fill:#ed4242;stroke:#ca2b2b}svg .sb3-obsolete-alt{fill:#db3333}svg .sb3-obsolete-dark{fill:#ca2b2b}svg .sb3-grey{fill:#bfbfbf;stroke:#909090}svg .sb3-grey-alt{fill:#b2b2b2}svg .sb3-grey-dark{fill:#909090}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-motion{fill:#80b5ff!important;stroke:#3373cc!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-looks{fill:#ccb3ff!important;stroke:#774dcb!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-sound{fill:#e19de1!important;stroke:#bd42bd!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-control{fill:#ffbe4c!important;stroke:#cf8b17!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-events{fill:#ffd966!important;stroke:#c90!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-sensing{fill:#85c4e0!important;stroke:#2e8eb8!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-operators{fill:#7ece7e!important;stroke:#389438!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-variables{fill:#ffa54c!important;stroke:#db6e00!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-list{fill:#f96!important;stroke:#e64d00!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-custom{fill:#f9a!important;stroke:#f35!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-extension{fill:#13ecaf!important;stroke:#0b8e69!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-obsolete{fill:#fc6666!important;stroke:#d32121!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-grey{fill:#bfbfbf!important;stroke:#959595!important}svg .sb3-label{fill:#fff}svg .sb3-input-color{stroke:#fff}svg .sb3-input-number,svg .sb3-input-string{fill:#fff}svg .sb3-literal-number,svg .sb3-literal-string{fill:#575e75}svg .sb3-custom-arg{fill:#ff6680;stroke:#f35}svg .sb3-extension-line{stroke:#0da57a}svg.scratchblocks-style-scratch3-high-contrast .sb3-motion{fill:#80b5ff;stroke:#3373cc}svg.scratchblocks-style-scratch3-high-contrast .sb3-motion-alt{fill:#b3d2ff}svg.scratchblocks-style-scratch3-high-contrast .sb3-motion-dark{fill:#3373cc}svg.scratchblocks-style-scratch3-high-contrast .sb3-looks{fill:#ccb3ff;stroke:#774dcb}svg.scratchblocks-style-scratch3-high-contrast .sb3-looks-alt{fill:#dcf}svg.scratchblocks-style-scratch3-high-contrast .sb3-looks-dark{fill:#774dcb}svg.scratchblocks-style-scratch3-high-contrast .sb3-sound{fill:#e19de1;stroke:#bd42bd}svg.scratchblocks-style-scratch3-high-contrast .sb3-sound-alt{fill:#ffb3ff}svg.scratchblocks-style-scratch3-high-contrast .sb3-sound-dark{fill:#bd42bd}svg.scratchblocks-style-scratch3-high-contrast .sb3-control{fill:#ffbe4c;stroke:#cf8b17}svg.scratchblocks-style-scratch3-high-contrast .sb3-control-alt{fill:#ffda99}svg.scratchblocks-style-scratch3-high-contrast .sb3-control-dark{fill:#cf8b17}svg.scratchblocks-style-scratch3-high-contrast .sb3-events{fill:#ffd966;stroke:#c90}svg.scratchblocks-style-scratch3-high-contrast .sb3-events-alt{fill:#ffecb3}svg.scratchblocks-style-scratch3-high-contrast .sb3-events-dark{fill:#c90}svg.scratchblocks-style-scratch3-high-contrast .sb3-sensing{fill:#85c4e0;stroke:#2e8eb8}svg.scratchblocks-style-scratch3-high-contrast .sb3-sensing-alt{fill:#aed8ea}svg.scratchblocks-style-scratch3-high-contrast .sb3-sensing-dark{fill:#2e8eb8}svg.scratchblocks-style-scratch3-high-contrast .sb3-operators{fill:#7ece7e;stroke:#389438}svg.scratchblocks-style-scratch3-high-contrast .sb3-operators-alt{fill:#b5e3b5}svg.scratchblocks-style-scratch3-high-contrast .sb3-operators-dark{fill:#389438}svg.scratchblocks-style-scratch3-high-contrast .sb3-variables{fill:#ffa54c;stroke:#db6e00}svg.scratchblocks-style-scratch3-high-contrast .sb3-variables-alt{fill:#fc9}svg.scratchblocks-style-scratch3-high-contrast .sb3-variables-dark{fill:#db6e00}svg.scratchblocks-style-scratch3-high-contrast .sb3-list{fill:#f96;stroke:#e64d00}svg.scratchblocks-style-scratch3-high-contrast .sb3-list-alt{fill:#ffcab0}svg.scratchblocks-style-scratch3-high-contrast .sb3-list-dark{fill:#e64d00}svg.scratchblocks-style-scratch3-high-contrast .sb3-custom{fill:#f9a;stroke:#f35}svg.scratchblocks-style-scratch3-high-contrast .sb3-custom-alt{fill:#ffccd5}svg.scratchblocks-style-scratch3-high-contrast .sb3-custom-dark{fill:#f35}svg.scratchblocks-style-scratch3-high-contrast .sb3-extension{fill:#13ecaf;stroke:#0b8e69}svg.scratchblocks-style-scratch3-high-contrast .sb3-extension-alt{fill:#75f0cd}svg.scratchblocks-style-scratch3-high-contrast .sb3-extension-dark{fill:#0b8e69}svg.scratchblocks-style-scratch3-high-contrast .sb3-obsolete{fill:#fc6666;stroke:#d32121}svg.scratchblocks-style-scratch3-high-contrast .sb3-obsolete-alt{fill:#fcb0b0}svg.scratchblocks-style-scratch3-high-contrast .sb3-obsolete-dark{fill:#d32121}svg.scratchblocks-style-scratch3-high-contrast .sb3-grey{fill:#bfbfbf;stroke:#959595}svg.scratchblocks-style-scratch3-high-contrast .sb3-grey-alt{fill:#b2b2b2}svg.scratchblocks-style-scratch3-high-contrast .sb3-grey-dark{fill:#959595}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-motion{fill:#4c97ff!important;stroke:#3373cc!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-looks{fill:#96f!important;stroke:#774dcb!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-sound{fill:#cf63cf!important;stroke:#bd42bd!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-control{fill:#ffab19!important;stroke:#cf8b17!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-events{fill:#ffbf00!important;stroke:#c90!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-sensing{fill:#5cb1d6!important;stroke:#2e8eb8!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-operators{fill:#59c059!important;stroke:#389438!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-variables{fill:#ff8c1a!important;stroke:#db6e00!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-list{fill:#ff661a!important;stroke:#e64d00!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-custom{fill:#ff6680!important;stroke:#f35!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-extension{fill:#0fbd8c!important;stroke:#0b8e69!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-obsolete{fill:#ed4242!important;stroke:#ca2b2b!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-grey{fill:#bfbfbf!important;stroke:#909090!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-label{fill:#000}svg.scratchblocks-style-scratch3-high-contrast .sb3-input-color{stroke:#fff}svg.scratchblocks-style-scratch3-high-contrast .sb3-input-number,svg.scratchblocks-style-scratch3-high-contrast .sb3-input-string{fill:#fff}svg.scratchblocks-style-scratch3-high-contrast .sb3-literal-number,svg.scratchblocks-style-scratch3-high-contrast .sb3-literal-string{fill:#000}svg.scratchblocks-style-scratch3-high-contrast .sb3-custom-arg{fill:#f9a;stroke:#f35}svg.scratchblocks-style-scratch3-high-contrast .sb3-extension-line{stroke:#75f0cd}.sb3-comment{fill:#ffffa5;stroke:#d0d1d2;stroke-width:1}.sb3-comment-line{fill:#ffff80}.sb3-comment-label,.sb3-label.sb3-comment-label{font-weight:400;font-size:12pt;font-family:Helvetica Neue,Helvetica,sans-serif;fill:#000;word-spacing:0}"}static makeCommonIcons(){return[mt.setProps(mt.group([mt.el("path",{d:"M20.8 3.7c-.4-.2-.9-.1-1.2.2-2 1.6-4.8 1.6-6.8 0-2.3-1.9-5.6-2.3-8.3-1v-.4c0-.6-.5-1-1-1s-1 .4-1 1v18.8c0 .5.5 1 1 1h.1c.5 0 1-.5 1-1v-6.4c1-.7 2.1-1.2 3.4-1.3 1.2 0 2.4.4 3.4 1.2 2.9 2.3 7 2.3 9.8 0 .3-.2.4-.5.4-.9V4.7c0-.5-.3-.9-.8-1zm-.3 10.2C18 16 14.4 16 11.9 14c-1.1-.9-2.5-1.4-4-1.4-1.2.1-2.3.5-3.4 1.1V4c2.5-1.4 5.5-1.1 7.7.6 2.4 1.9 5.7 1.9 8.1 0h.2l.1.1-.1 9.2z",fill:"#45993d"}),mt.el("path",{d:"M20.6 4.8l-.1 9.1v.1c-2.5 2-6.1 2-8.6 0-1.1-.9-2.5-1.4-4-1.4-1.2.1-2.3.5-3.4 1.1V4c2.5-1.4 5.5-1.1 7.7.6 2.4 1.9 5.7 1.9 8.1 0h.2c0 .1.1.1.1.2z",fill:"#4cbf56"})]),{id:"sb3-greenFlag"}),mt.setProps(mt.el("polygon",{points:"6.6,0.5 13.12,0.5 19.5,6.6 19.5,13.12 13.12,19.5 6.6,19.5 0.5,13.12 0.5,6.6 ",fill:"#ec5959",stroke:"#b84848","stroke-linejoin":"round","stroke-linecap":"round"}),{id:"sb3-stopSign"}),mt.el("path",{d:"M0 0L4 4L0 8Z",fill:"#111",id:"sb3-addInput"}),mt.el("path",{d:"M4 0L4 8L0 4Z",fill:"#111",id:"sb3-delInput"}),mt.setProps(mt.group([mt.el("rect",{x:"0",y:"0",width:"15",height:"18",fill:"#fff"}),mt.el("rect",{x:"1",y:"1",width:"13",height:"4",fill:"#ff920f"}),mt.el("rect",{x:"1",y:"7",width:"13",height:"4",fill:"#ff920f"}),mt.el("rect",{x:"1",y:"13",width:"13",height:"4",fill:"#ff920f"})]),{id:"sb3-list"}),mt.el("image",{id:"sb3-microbitBlock",width:"40px",height:"40px",href:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAACmlBMVEUAAAArKysrIB8lJCNBRlY2O0U9X48sKCvOoBQzKzMnJyfrswi/xdDRoxN2dnbToxPosgnmsAq/lxo6MSq0kCLOoRXKnhbEmhc7LRooJCTcqQ7OoBXstAjpsgi9lhuvjCCPdSd4Zyg2NjZMi+Slhyq8lR5CR1fZqBG+lh3ttQjFnBnLnhbDmhqZore3kh5ARlW2kR6qiCGcfyU6QEtyYyd4ZSDSoxOGdDedgizLnhfgrA25kx9YXWqbgCxMUWDfqwzcqg/VphBBR1ecpLmcgSzHmxijq77BmRprYkOOlKZARlVGdbabo7m3kRxGcrKwjB9ARVSIjaCZobuVeyahgh+VdyE8XIOLayBIOydBR1f/vwBMl//m5+g+Q1JlanY6P0uCiJjj5OU9QVBARVQ/RFP9vgBFZpjk5ebwtgbzuAR0eotARlZITl3d3+KNlKRQVmRNUmGxs7mRlJtUW2nLnhfInRfpsQn1uQS/wsa0t7qlp62doKeKjpeBg41YXmxCSlvGyMtHb6xCUGlCTGBJgdJDSFVobXlMlPhLhtq/wchIesFGbqpDVXRXXGxCTGNiXEe+lh1LjuzP0dRJg9RIfslJfMW9v8RGbKRFY5Jzd4NdYm88QE1+bjrQpCHQohTxtwVLkPDa3OHd3t9If826vMCusLZHcrGIj6F6gpaDho9ESlpITFOQeTLcqhnEmhnqsw34uwVKkfNNhdi6vMRLUWBPUFC7lzDWpx31uQjutQj6vAP5+frZ29zZ2dvW2NtHc7JGbKVFaJx/hpl/hpdxd4hzd4JDWHpDUm5UWWiZhEh3aT6WfC/EnSqtiyW/lxzBmRpKi+VQgMhRermqq7BSdrCLjpVEXYVEW4A/SFtOT1BaV0pxZUCpjT2xkTcYNOUYAAAAWXRSTlMADBgV5DRLEdcIE+3Z2QLt6unOI/zp1dEcDf7z7eu9qVtFBPv7+/fx7u3p3NnOzcq0lXZENzD6+fj39vTm5uXk4t3c2tbS0c/NvrCopKKcm4yLbGpiTUA3JzDAPbYAAAQqSURBVFjD7dX1fxJhHMDxE+MIRRFrdnd3d3fr9ziwhsVsmC2K6HRTtzlb0ens2uzu7m79X3z4HufdwTNvj/qbfPYaPDe+vMf23AEXL168/6bBTfoWx5r0GskxVMhsoDfg3Lb12LlzIwz0zKZYzzy0lkPVKtXdutXw++o2a5UQ7SUMcqibGpA8kD09slX0azRkazwISB5Inn4D+ShwrNYjIHpQQA96mqPAYlqPgOhBAT0oUpgGyh6C6EHYWz11e7jbO9hAxUMQPezR6+wtW0nBlJzV7CB62nIyN/mB5H/ouM0G0j3ITIXsAMDUVMjcygbSPQgqrzCNDaR7sCEzO2cLKSvlLNP/ED1qgbRbh0m37viBAUSPvU/BYFZWcAMFRI+9HW/fOFLSgAaixw6erZWS5qeBVG+XKwlghWsuwALXHIA5rgUAc10r1KADvViwKNDaLO4EWCQuA5gnLgVYKs4DWCYuUoPoFRhcKa4FWCwuB1gizgeYLy4BWC4uBqWPq9Cjg55EJ5bogUi7J0wBmDwhMXzjBHBOmAyQSG4wnPd4cJ4Kejbem4gdTQL9NPN00Hlk0jRs//0p+puinaeDs0XxwMFtk8RZM6fob4pmPl/wxtqkOcemIai7Kco8HTx/88Ns8dBxgMcrEdTfFKcyP/9m1xhwwbV30sBGCdTPqczPu9Y5BoTzZODAg6S5kT9Zf1PU8+fz25TrTJuizOd32kjtL9CmaOfpJ/Zd5UTV3RTtfP6X3mfl0tNNuVSpILYp5xHL25ccFUQv9cwGhrcvPZB4jgiovyn6IHrrZFB/U/RBf6rD8f4sgqzRwTtZQfKZGPiXm4Kxb8rff6awgf9sU5jTB9O79G63BqTW1C5baQ9geNSwvnIEJ8s2PCkPXqhTtlM6HUxvWpiv3h6kyozmDY2egnzUkjc3/3X0bAjPt3gW+VWVxvFtSn6hgi9acxzfeI001yiBs46pI7/AkjzHVSgjg5XIkwvXB+xbcxNnGraHCmZUr8nxJS/g3AlC1KzujQgnOpo5axufDFasYLUa2gK2p2ohzlTtJB2sV6NCNSECCtUq1Kj3CxSq2luXlY8gufF4e9PkCLiwpWFULg38+qKiILgFYe9Lr++07zSur4SXr7zeV5Gj0z5vxt69GVcFt1vI874kS6/0pDIZsWB6crLgzhNI+wRhOrm7Sr5n4HIhWeW5yRJ/EBYuS4+5yUN5Vy9fuewT6GDouQq8qAFDITX4/XmuDF788eTJRQpoD4PTT6nAXA14KVcNhshgBDx16VTokk9oZo4Czf0JiEkgpoCYApJkEPMJwxOiQFONDn8DlrRbuWjRXrWEzWKzlOhnLNfHWN5S2Va5cndjufLG8uWMpRs0sFmqdMNliRKlS1nIlw2Xxh5kWaVKC0NNLiarqdAfZ+LixYsX77f9BFJt17cXqnnkAAAAAElFTkSuQmCC"}),mt.setProps(mt.group([mt.el("path",{d:"M23.513 11.17h-.73c-.319 0-.576.213-.576.478v1.08h1.882v-1.08c0-.265-.258-.479-.576-.479",fill:"#7C87A5"}),mt.el("path",{d:"M24.91 11.17h-.73c-.319 0-.576.213-.576.478v1.08h1.882v-1.08c0-.265-.258-.479-.576-.479z"}),mt.el("path",{d:"M9.54 11.17h-.728c-.32 0-.576.213-.576.478v1.08h1.882v-1.08c0-.265-.257-.479-.577-.479",fill:"#7C87A5"}),mt.el("path",{d:"M10.938 11.17h-.729c-.32 0-.576.213-.576.478v1.08h1.882v-1.08c0-.265-.257-.479-.577-.479z"}),mt.el("path",{d:"M26.305 11.17h-.73c-.318 0-.574.213-.574.478v1.08h1.882v-1.08c0-.265-.26-.479-.578-.479",fill:"#7C87A5"}),mt.el("path",{d:"M27.702 11.17h-.73c-.318 0-.574.213-.574.478v1.08h1.882v-1.08c0-.265-.26-.479-.578-.479z"}),mt.el("path",{d:"M29.101 11.17h-.73c-.318 0-.576.213-.576.478v1.08h1.882v-1.08c0-.265-.258-.479-.576-.479",fill:"#7C87A5"}),mt.el("path",{d:"M30.498 11.17h-.73c-.318 0-.576.213-.576.478v1.08h1.882v-1.08c0-.265-.258-.479-.576-.479z"}),mt.el("path",{d:"M17.925 11.17h-.73c-.319 0-.577.213-.577.478v1.08h1.883v-1.08c0-.265-.258-.479-.576-.479",fill:"#7C87A5"}),mt.el("path",{d:"M19.322 11.17h-.73c-.319 0-.577.213-.577.478v1.08h1.883v-1.08c0-.265-.258-.479-.576-.479z"}),mt.el("path",{d:"M20.717 11.17h-.73c-.319 0-.575.213-.575.478v1.08h1.883v-1.08c0-.265-.26-.479-.578-.479",fill:"#7C87A5"}),mt.el("path",{d:"M22.114 11.17h-.73c-.319 0-.575.213-.575.478v1.08h1.883v-1.08c0-.265-.26-.479-.578-.479z"}),mt.el("path",{d:"M15.129 11.17H14.4c-.32 0-.576.213-.576.478v1.08h1.883v-1.08c0-.265-.258-.479-.578-.479",fill:"#7C87A5"}),mt.el("path",{d:"M16.526 11.17h-.729c-.32 0-.576.213-.576.478v1.08h1.883v-1.08c0-.265-.258-.479-.578-.479z"}),mt.el("path",{d:"M12.335 11.17h-.73c-.319 0-.575.213-.575.478v1.08h1.882v-1.08c0-.265-.26-.479-.577-.479",fill:"#7C87A5"}),mt.el("path",{d:"M13.732 11.17h-.73c-.319 0-.575.213-.575.478v1.08h1.883v-1.08c0-.265-.26-.479-.578-.479z"}),mt.el("path",{d:"M31.893 11.17h-.73c-.318 0-.574.213-.574.478v1.08h1.882v-1.08c0-.265-.26-.479-.578-.479",fill:"#7C87A5"}),mt.el("path",{d:"M33.29 11.17h-.73c-.318 0-.574.213-.574.478v1.08h1.882v-1.08c0-.265-.26-.479-.578-.479z"}),mt.el("path",{d:"M33.647 28.407H15.765V12.533h17.882c.52 0 .941.445.941.992v13.89c0 .547-.421.992-.94.992",fill:"#FFF"}),mt.el("path",{d:"M33.647 28.407H15.765V12.533h17.882c.52 0 .941.445.941.992v13.89c0 .547-.421.992-.94.992z",stroke:"#7C87A5","stroke-width":".893"}),mt.el("path",{d:"M15.765 28.407H5.412c-.52 0-.941-.445-.941-.993V16.502c0-2.19 1.686-3.969 3.764-3.969h15.06-3.766c-2.078 0-3.764 1.778-3.764 3.969v11.905z",fill:"#FFF"}),mt.el("path",{d:"M15.765 28.407H5.412c-.52 0-.941-.445-.941-.993V16.502c0-2.19 1.686-3.969 3.764-3.969h15.06-3.766c-2.078 0-3.764 1.778-3.764 3.969v11.905z",stroke:"#7C87A5","stroke-width":".893"}),mt.el("path",{d:"M12.941 12.533H11.06c-1.559 0-2.824 1.334-2.824 2.977v1.986c0 .547.422.992.941.992H12c.52 0 .941-.445.941-.992V15.51c0-1.643 1.265-2.977 2.824-2.977h.94-3.764z",fill:"#4C97FF"}),mt.el("path",{d:"M12.941 12.533H11.06c-1.559 0-2.824 1.334-2.824 2.977v1.986c0 .547.422.992.941.992H12c.52 0 .941-.445.941-.992V15.51c0-1.643 1.265-2.977 2.824-2.977h.94-3.764z",stroke:"#3D79CC","stroke-width":".893"}),mt.el("path",{stroke:"#7C87A5","stroke-width":".893",d:"M4.47 20.474h27.961l2.157 2.974"}),mt.el("path",{d:"M15.765 28.407H5.412c-.52 0-.941-.445-.941-.993V16.502c0-2.19 1.686-3.969 3.764-3.969h15.06-3.766c-2.078 0-3.764 1.778-3.764 3.969v11.905z",stroke:"#7C87A5","stroke-width":".893"}),mt.el("path",{d:"M21.307 18.964h-.73c-.319 0-.576.214-.576.479v1.08h1.882v-1.08c0-.265-.258-.479-.576-.479",fill:"#7C87A5"}),mt.el("path",{d:"M21.307 18.964h-.73c-.319 0-.576.214-.576.479v1.08h1.882v-1.08c0-.265-.258-.479-.576-.479z"}),mt.el("path",{d:"M24.178 18.964h-.728c-.32 0-.576.214-.576.479v1.08h1.882v-1.08c0-.265-.258-.479-.578-.479",fill:"#7C87A5"}),mt.el("path",{d:"M24.178 18.964h-.728c-.32 0-.576.214-.576.479v1.08h1.882v-1.08c0-.265-.258-.479-.578-.479z"}),mt.el("path",{d:"M27.051 18.964h-.73c-.318 0-.576.214-.576.479v1.08h1.882v-1.08c0-.265-.257-.479-.576-.479",fill:"#7C87A5"}),mt.el("path",{d:"M27.051 18.964h-.73c-.318 0-.576.214-.576.479v1.08h1.882v-1.08c0-.265-.257-.479-.576-.479z"}),mt.el("path",{d:"M29.923 18.964h-.729c-.32 0-.576.214-.576.479v1.08h1.883v-1.08c0-.265-.258-.479-.578-.479",fill:"#7C87A5"}),mt.el("path",{d:"M29.923 18.964h-.729c-.32 0-.576.214-.576.479v1.08h1.883v-1.08c0-.265-.258-.479-.578-.479z"}),mt.el("path",{d:"M33.647 28.407H15.765V20.47H32.43l2.157 2.978v3.966c0 .548-.421.993-.94.993",fill:"#E6E7E8"}),mt.el("path",{d:"M33.647 28.407H15.765V20.47H32.43l2.157 2.978v3.966c0 .548-.421.993-.94.993z",stroke:"#7C87A5","stroke-width":".893"}),mt.el("path",{d:"M15.765 28.407H5.412c-.52 0-.941-.445-.941-.993V20.47h11.294v7.937z",fill:"#E6E7E8"}),mt.el("path",{d:"M15.765 28.407H5.412c-.52 0-.941-.445-.941-.993V20.47h11.294v7.937z",stroke:"#7C87A5","stroke-width":".893"}),mt.el("path",{fill:"#E6E7E8",d:"M19.53 24.438h11.294V20.47H19.529z"}),mt.el("path",{stroke:"#7C87A5","stroke-width":".893",d:"M19.53 24.438h11.294V20.47H19.529zm12.902-3.964l2.157-2.794"})]),{id:"sb3-wedoBlock",fill:"none"}),mt.setProps(mt.group([mt.el("rect",{stroke:"#7C87A5",fill:"#FFF",x:".5",y:"3.59",width:"28",height:"25.81",rx:"1"}),mt.el("rect",{stroke:"#7C87A5",fill:"#E6E7E8",x:"2.5",y:".5",width:"24",height:"32",rx:"1"}),mt.el("path",{stroke:"#7C87A5",fill:"#FFF",d:"M2.5 14.5h24v13h-24z"}),mt.el("path",{d:"M14.5 10.5v4",stroke:"#7C87A5",fill:"#E6E7E8"}),mt.el("rect",{fill:"#414757",x:"4.5",y:"2.5",width:"20",height:"10",rx:"1"}),mt.el("rect",{fill:"#7C87A5",opacity:".5",x:"13.5",y:"20.13",width:"2",height:"2",rx:".5"}),mt.el("path",{d:"M9.06 20.13h1.5a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1.5a1 1 0 0 1 0-2zM19.93 22.13h-1.51a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h1.5a1 1 0 0 1 .01 2zM8.23 17.5H5a.5.5 0 0 1-.5-.5v-2.5h6l-1.85 2.78a.51.51 0 0 1-.42.22zM18.15 18.85l-.5.5a.49.49 0 0 0-.15.36V20a.5.5 0 0 1-.5.5h-.5a.5.5 0 0 1-.5-.5.5.5 0 0 0-.5-.5h-2a.5.5 0 0 0-.5.5.5.5 0 0 1-.5.5H12a.5.5 0 0 1-.5-.5v-.29a.49.49 0 0 0-.15-.36l-.5-.5a.51.51 0 0 1 0-.71l1.51-1.49a.47.47 0 0 1 .35-.15h3.58a.47.47 0 0 1 .35.15l1.51 1.49a.51.51 0 0 1 0 .71zM10.85 23.45l.5-.5a.49.49 0 0 0 .15-.36v-.29a.5.5 0 0 1 .5-.5h.5a.5.5 0 0 1 .5.5.5.5 0 0 0 .5.5h2a.5.5 0 0 0 .5-.5.5.5 0 0 1 .5-.5h.5a.5.5 0 0 1 .5.5v.29a.49.49 0 0 0 .15.36l.5.5a.5.5 0 0 1 0 .7l-1.51 1.5a.47.47 0 0 1-.35.15h-3.58a.47.47 0 0 1-.35-.15l-1.51-1.5a.5.5 0 0 1 0-.7z",fill:"#7C87A5",opacity:".5"}),mt.el("path",{d:"M21.5 27.5h5v4a1 1 0 0 1-1 1h-4v-5z",stroke:"#CC4C23",fill:"#F15A29"})]),{transform:"translate(5.5 3.5)",id:"sb3-ev3Block"}),mt.setProps(mt.group([mt.el("path",{d:"M35 28H5a1 1 0 0 1-1-1V12c0-.6.4-1 1-1h30c.5 0 1 .4 1 1v15c0 .5-.5 1-1 1z",fill:"#fff"}),mt.el("path",{fill:"red",d:"M4 25h32v2.7H4zm9-1h-2.2a1 1 0 0 1-1-1v-9.7c0-.6.4-1 1-1H13c.6 0 1 .4 1 1V23c0 .6-.5 1-1 1z"}),mt.el("path",{fill:"red",d:"M6.1 19.3v-2.2c0-.5.4-1 1-1h9.7c.5 0 1 .5 1 1v2.2c0 .5-.5 1-1 1H7.1a1 1 0 0 1-1-1z"}),mt.el("circle",{fill:"red",cx:"22.8",cy:"18.2",r:"3.4"}),mt.el("circle",{fill:"red",cx:"30.6",cy:"18.2",r:"3.4"}),mt.el("path",{fill:"red",d:"M4.2 27h31.9v.7H4.2z"}),mt.el("circle",{fill:"#e0e0e0",cx:"22.8",cy:"18.2",r:"2.3"}),mt.el("circle",{fill:"#e0e0e0",cx:"30.6",cy:"18.2",r:"2.3"}),mt.el("path",{fill:"#e0e0e0",d:"M12.5 22.9h-1.2c-.3 0-.5-.2-.5-.5V14c0-.3.2-.5.5-.5h1.2c.3 0 .5.2.5.5v8.4c0 .3-.2.5-.5.5z"}),mt.el("path",{fill:"#e0e0e0",d:"M7.2 18.7v-1.2c0-.3.2-.5.5-.5h8.4c.3 0 .5.2.5.5v1.2c0 .3-.2.5-.5.5H7.7c-.3 0-.5-.2-.5-.5zM4 26h32v2H4z"}),mt.el("path",{stroke:"#666","stroke-width":".5",d:"M35.2 27.9H4.8a1 1 0 0 1-1-1V12.1c0-.6.5-1 1-1h30.5c.5 0 1 .4 1 1V27a1 1 0 0 1-1.1.9z"}),mt.el("path",{stroke:"#666","stroke-width":".5",d:"M35.2 27.9H4.8a1 1 0 0 1-1-1V12.1c0-.6.5-1 1-1h30.5c.5 0 1 .4 1 1V27a1 1 0 0 1-1.1.9z"})]),{id:"sb3-makeymakeyBlock",fill:"none"}),mt.el("image",{id:"sb3-gdxforBlock",width:"40px",height:"40px",href:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAABAlBMVEUAAAABAQEAAAB9h6YAAAAAAAAAAAB8iKZ7iKaAjKvm5+h+iqhcXFxGR0d8iKbj5OV9iKZ8h6be3+Db3d19h6acnJ0AAAB7nrDh4uPh4uN9iabZ2tt9iKbX19nJycnExsZ8iKe+wMC7vL2Eka/g4ePU1dV8iKZ9iKZ9iKd+iKitra2RkZGLjo5wcHCLi7l0oqJV//9csdZ8h6WFkq//vwDm5+iEka79vgJ6iql9iaaHk6tgq9Btm71+iadmo8dzk7OCj6yAjKp/iqhiqc1qnsB4jKtgrNFwl7d1tLTgtCxpocN0krJ2j65ossWNtZSbt4LAulHWsDnasTTuvhXzvg9zk7TzqAfaAAAAMXRSTlMAJiLoFBwI8q4a+0c4M/nr3tnQwKxYDAnk2726tbGMh4J9dinXq56ddG9nT01ACwsDk/+seAAAAidJREFUWMPt2Olu2kAUhuE5NvuaBAhZm7TpvufgMXaBbmAghOzp/d9KD7RW6yaqPeL7YVV9/471aBgfCXnUH7ULNhtkF96qv1dgwwoxoM08cDsJcwfMdgwonoiJPRFjQXkscQM3Adhxk4NuJwkoDx0nSp5NDTiae958NEaBwzkvC4YYcOxx7fCoeJhnrwcBv7H9TklFm08R4JD5SEkiMg8B4IjXwsV1HgHAPu+EizsQcMbr2B0OufZz7X0NcIZSwC9+rD3nADI2/fCtrHEfAvZ8Liqp6PuIwZZO+ZmSnspcY8AZ55WU5xkElDwuK1Vm7xgFTjhfLud5AgPHAUvBGARKvYnnTXpp/gvAg9PLyykSPLt1nNszIHjuSOdAcNp1nO4UeYYXNzcX0UH62P+0AnjH8lgCgL8s/+uXzwZgrOV2JAMwxpIMwRjLHIyxzMEYyxyMWgAwYiHAzm99iLQ6eOJEul4d7Ea6WhG8W7rAE+fertHgVXp+clpB9Oet64M/wH2TKwI/FrRFTH6JIZ6NvmZpxoDtptlFULOtzGPWy+4/r//gvwKGgcC90NtTqIg2dIuyClaWDvTjKlDMLba4UaUMcIuVbd0gyiGwjGVlFuKWfkQZhEfSQnypd8mCvOHGvkA5quo6EQSs6yrlNumN3obs0KKGHJ70QD+hLOQMW7r0sFI5KJVeY+bGkr1JopKlEG0StXbrW/uvQGMookXLLPFAZYTMJju/7z6rRW1MZcnIAAAAAElFTkSuQmCC"}),mt.el("image",{id:"sb3-boostBlock",width:"40px",height:"40px",href:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQBAMAAAB8P++eAAAAKlBMVEUAAAD///98h6Xm5+iVnrb/Zhq+w9L5hk73+Pnf4eSQmbLr7Ozo39vp184hSCf6AAAAAXRSTlMAQObYZgAAAOFJREFUSMftlDEOgjAUhonhAi1sLvIk7NDJDTYu0LhzBzcXruHoDTyFB/BCNi30KU3InzioSb++hAS+vPfKa5pEIpHvk7a8gpf8ISWINtlg4i7ZFOKVTBlqsUR+ItYZJG7VzQQgMqGYd7zWRArpULEAe5Q/J9JMj4rluC7uleNw7TFRXcoREDnlinjX57eUsvRTn8+AE0/6OKV0g5buYTTyWFFr/XAp3aDzed4yFJWnKbhPbtaXXohDNYlDJWz4zSxEokkkEjb496AiVtqAbIYgYNGWBmhgES+NX6SRSORfeAJMWajr95DdqQAAAABJRU5ErkJggg=="})]}static makeOriginalIcons(){return[...At.makeCommonIcons(),mt.setProps(mt.group([mt.el("path",{d:"M12.71 2.44A2.41 2.41 0 0 1 12 4.16L8.08 8.08a2.45 2.45 0 0 1-3.45 0L.72 4.16A2.42 2.42 0 0 1 0 2.44 2.48 2.48 0 0 1 .71.71C1 .47 1.43 0 6.36 0s5.39.46 5.64.71a2.44 2.44 0 0 1 .71 1.73z",fill:"#231f20",opacity:".1"}),mt.el("path",{d:"M6.36 7.79a1.43 1.43 0 0 1-1-.42L1.42 3.45a1.44 1.44 0 0 1 0-2c.56-.56 9.31-.56 9.87 0a1.44 1.44 0 0 1 0 2L7.37 7.37a1.43 1.43 0 0 1-1.01.42z",fill:"#fff"})]),{id:"sb3-dropdownArrow",transform:"scale(0.94413847364)"}),mt.setProps(mt.group([mt.el("path",{d:"M22.68 12.2a1.6 1.6 0 0 1-1.27.63h-7.69a1.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 .8A4.25 4.25 0 0 0 7.2 10.6a5.06 5.06 0 0 0 .54 4.62A5.58 5.58 0 0 0 12 17.74a2.26 2.26 0 0 1-.16 4.52A10.25 10.25 0 0 1 3.74 18a10.14 10.14 0 0 1-1.49-9.22 9.7 9.7 0 0 1 2.83-4.14A9.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-.26 1.39z",fill:"#3d79cc"}),mt.el("path",{d:"M21.38 11.83h-7.61a.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.82 9.16 9.16 0 0 1-1.4-8.37A8.51 8.51 0 0 1 5.71 5.4a8.76 8.76 0 0 1 4.11-1.92 9.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-.62.75z",fill:"#fff"})]),{id:"sb3-turnRight"}),mt.setProps(mt.group([mt.el("path",{d:"M20.34 18.21a10.24 10.24 0 0 1-8.1 4.22 2.26 2.26 0 0 1-.16-4.52 5.58 5.58 0 0 0 4.25-2.53 5.06 5.06 0 0 0 .54-4.62A4.25 4.25 0 0 0 15.55 9a4.31 4.31 0 0 0-2-.8 4.82 4.82 0 0 0-3.15.8l1.12 1.41A1.59 1.59 0 0 1 10.36 13H2.67a1.56 1.56 0 0 1-1.26-.63A1.54 1.54 0 0 1 1.13 11l1.72-7.43A1.59 1.59 0 0 1 4.38 2.4a1.57 1.57 0 0 1 1.24.6L6.7 4.35a10.66 10.66 0 0 1 7.72-1.68A9.88 9.88 0 0 1 19 4.81 9.61 9.61 0 0 1 21.83 9a10.08 10.08 0 0 1-1.49 9.21z",fill:"#3d79cc"}),mt.el("path",{d:"M19.56 17.65a9.29 9.29 0 0 1-7.35 3.83 1.31 1.31 0 0 1-.08-2.62 6.53 6.53 0 0 0 5-2.92 6.05 6.05 0 0 0 .67-5.51 5.32 5.32 0 0 0-1.64-2.16 5.21 5.21 0 0 0-2.48-1A5.86 5.86 0 0 0 9 8.84L10.74 11a.59.59 0 0 1-.43 1H2.7a.6.6 0 0 1-.6-.75l1.71-7.42a.59.59 0 0 1 1-.21l1.67 2.1a9.71 9.71 0 0 1 7.75-2.07 8.84 8.84 0 0 1 4.12 1.92 8.68 8.68 0 0 1 2.54 3.72 9.14 9.14 0 0 1-1.33 8.36z",fill:"#fff"})]),{id:"sb3-turnLeft"}),mt.setProps(mt.group([mt.el("path",{d:"M23.3 11c-.3.6-.9 1-1.5 1h-1.6c-.1 1.3-.5 2.5-1.1 3.6-.9 1.7-2.3 3.2-4.1 4.1-1.7.9-3.6 1.2-5.5.9-1.8-.3-3.5-1.1-4.9-2.3-.7-.7-.7-1.9 0-2.6.6-.6 1.6-.7 2.3-.2H7c.9.6 1.9.9 2.9.9s1.9-.3 2.7-.9c1.1-.8 1.8-2.1 1.8-3.5h-1.5c-.9 0-1.7-.7-1.7-1.7 0-.4.2-.9.5-1.2l4.4-4.4c.7-.6 1.7-.6 2.4 0L23 9.2c.5.5.6 1.2.3 1.8z",fill:"#cf8b17"}),mt.el("path",{d:"M21.8 11h-2.6c0 1.5-.3 2.9-1 4.2-.8 1.6-2.1 2.8-3.7 3.6-1.5.8-3.3 1.1-4.9.8-1.6-.2-3.2-1-4.4-2.1-.4-.3-.4-.9-.1-1.2.3-.4.9-.4 1.2-.1 1 .7 2.2 1.1 3.4 1.1s2.3-.3 3.3-1c.9-.6 1.6-1.5 2-2.6.3-.9.4-1.8.2-2.8h-2.4c-.4 0-.7-.3-.7-.7 0-.2.1-.3.2-.4l4.4-4.4c.3-.3.7-.3.9 0L22 9.8c.3.3.4.6.3.9s-.3.3-.5.3z",fill:"#fff"})]),{id:"sb3-loopArrow"}),mt.setProps(mt.group([mt.el("path",{d:"M28.456 21.675c-.009-.312-.087-.825-.256-1.702-.096-.495-.612-3.022-.753-3.73-.395-1.98-.76-3.92-1.142-6.113-.732-4.223-.693-6.05.344-6.527.502-.23 1.06-.081 1.842.35.413.227 2.181 1.365 2.07 1.296 1.993 1.243 3.463 1.775 4.928 1.549 1.527-.237 2.505-.06 2.877.618.348.635.015 1.416-.729 2.18-1.473 1.516-3.976 2.514-5.849 2.023-.822-.218-1.238-.464-2.38-1.266a9.737 9.737 0 0 0-.095-.066c.047.593.264 1.74.717 3.803.294 1.336 2.079 9.187 2.637 11.674l.002.012c.529 2.637-1.872 4.724-5.235 4.724-3.29 0-6.363-1.988-6.862-4.528-.53-2.64 1.873-4.734 5.233-4.734a8.411 8.411 0 0 1 2.65.437zM11.46 27.666c-.01-.319-.091-.84-.266-1.738-.09-.46-.595-2.937-.753-3.727-.39-1.96-.752-3.892-1.131-6.07-.732-4.224-.692-6.052.344-6.527.502-.23 1.06-.082 1.841.349.414.228 2.181 1.365 2.07 1.296 1.992 1.243 3.461 1.775 4.925 1.549 1.525-.24 2.504-.064 2.876.614.348.635.015 1.415-.728 2.18-1.474 1.517-3.977 2.513-5.847 2.017-.822-.218-1.237-.463-2.38-1.266a9.729 9.729 0 0 0-.094-.065c.047.593.264 1.74.717 3.802.294 1.337 2.078 9.19 2.636 11.675l.003.013c.517 2.638-1.884 4.732-5.234 4.732-3.286 0-6.359-1.993-6.87-4.54-.518-2.639 1.885-4.73 5.242-4.73.904 0 1.802.15 2.65.436z",stroke:"#000","stroke-opacity":".1"}),mt.el("path",{d:"M32.18 25.874C32.636 28.157 30.512 30 27.433 30c-3.07 0-5.923-1.843-6.372-4.126-.458-2.285 1.665-4.136 4.743-4.136.647 0 1.283.084 1.89.234a7 7 0 0 1 .938.302c.87-.02-.104-2.294-1.835-12.229-2.134-12.303 3.06-1.87 8.768-2.753 5.708-.885.076 4.82-3.65 3.844-3.724-.987-4.65-7.153.263 14.738zm-16.998 5.99C15.63 34.148 13.507 36 10.439 36c-3.068 0-5.92-1.852-6.379-4.136-.448-2.284 1.674-4.135 4.751-4.135 1.002 0 1.974.197 2.854.544.822-.055-.15-2.377-1.862-12.228-2.133-12.303 3.059-1.87 8.764-2.753 5.706-.894.076 4.821-3.648 3.834-3.723-.987-4.648-7.152.263 14.738z",fill:"#FFF"})]),{id:"sb3-musicBlock",fill:"none"}),mt.setProps(mt.group([mt.el("path",{d:"M8.753 34.602l-4.251 1.779 1.784-4.236c1.218-2.892 2.907-5.423 5.03-7.538L31.066 4.93c.846-.842 2.65-.41 4.032.967 1.38 1.375 1.816 3.173.97 4.015L16.318 29.59c-2.123 2.116-4.664 3.799-7.565 5.012",fill:"#FFF"}),mt.el("path",{d:"M29.41 6.111s-4.45-2.379-8.202 5.771c-1.734 3.766-4.35 1.546-4.35 1.546"}),mt.el("path",{d:"M36.42 8.825c0 .463-.14.873-.432 1.164l-9.335 9.301c.282-.29.41-.668.41-1.12 0-.874-.507-1.963-1.406-2.868-1.362-1.358-3.147-1.8-4.002-.99L30.99 5.01c.844-.84 2.65-.41 4.035.96.898.904 1.396 1.982 1.396 2.855M10.515 33.774a23.74 23.74 0 0 1-1.764.83L4.5 36.382l1.786-4.235c.258-.604.529-1.186.833-1.757.69.183 1.449.625 2.109 1.282.659.658 1.102 1.412 1.287 2.102",fill:"#4C97FF"}),mt.el("path",{d:"M36.498 8.748c0 .464-.141.874-.433 1.165l-19.742 19.68c-2.131 2.111-4.673 3.793-7.572 5.01L4.5 36.381l.974-2.317 1.925-.808c2.899-1.218 5.441-2.899 7.572-5.01l19.742-19.68c.292-.292.432-.702.432-1.165 0-.647-.27-1.4-.779-2.123.249.172.498.377.736.614.898.905 1.396 1.983 1.396 2.856",fill:"#575E75",opacity:".15"}),mt.el("path",{d:"M18.45 12.831a.904.904 0 1 1-1.807 0 .904.904 0 0 1 1.807 0z",fill:"#575E75"})]),{id:"sb3-penBlock",stroke:"#575E75",fill:"none","stroke-linejoin":"round"}),mt.setProps(mt.group([mt.el("circle",{opacity:.25,cx:32,cy:16,r:4.5}),mt.el("circle",{opacity:.5,cx:32,cy:12,r:4.5}),mt.el("circle",{opacity:.75,cx:32,cy:8,r:4.5}),mt.el("circle",{cx:32,cy:4,r:4.5}),mt.el("path",{d:"M22.672 4.42l-6.172 4V6.1c0-2.01-1.563-3.6-3.5-3.6H4.1C2.076 2.5.5 4.076.5 6.1V14c0 1.927 1.584 3.512 3.6 3.6H13c1.902 0 3.5-1.653 3.5-3.6v-2.283l6.257 3.754.097.075c.02.02.098.054.146.054.267 0 .5-.217.5-.5V4.8c0 .037-.056-.094-.129-.243-.145-.242-.43-.299-.7-.137z",fill:"#4D4D4D","stroke-linejoin":"round"})]),{id:"sb3-videoBlock",stroke:"#000",fill:"#FFF","stroke-opacity":.15}),mt.setProps(mt.group([mt.el("circle",{cx:8.35,cy:9.65,r:.97,fill:"#FFF"}),mt.el("circle",{cx:14.19,cy:9.65,r:.97,fill:"#FFF"}),mt.el("path",{d:"M11.27 4.14c-3.94 0-7.13 3.19-7.13 7.13s3.19 7.13 7.13 7.13 7.13-3.19 7.13-7.13-3.19-7.13-7.13-7.13m0 1.3c3.22 0 5.84 2.61 5.84 5.84s-2.61 5.84-5.84 5.84-5.84-2.61-5.84-5.84 2.61-5.84 5.84-5.84",fill:"#FFF"}),mt.el("path",{d:"M17.57 13.88c.57-.15 1.02-.6 1.17-1.17l.35-1.3c.16-.61 1.04-.61 1.2 0l.35 1.3c.15.57.6 1.02 1.18 1.17l1.3.35c.61.16.61 1.04 0 1.2l-1.3.35c-.57.15-1.02.6-1.18 1.17l-.35 1.3c-.17.62-1.04.62-1.2 0l-.35-1.3c-.15-.57-.6-1.02-1.17-1.17l-1.3-.35c-.61-.17-.61-1.04 0-1.2l1.3-.35Zm-16-11.43c.43-.12.76-.45.88-.88l.26-.98c.12-.46.78-.46.9 0l.26.98c.12.43.45.76.88.88l.98.26c.46.12.46.78 0 .9l-.98.26c-.43.11-.77.45-.88.88l-.26.98c-.12.46-.78.46-.9 0l-.26-.98a1.26 1.26 0 0 0-.88-.88l-.98-.26c-.46-.12-.46-.78 0-.9z",fill:"#ffbf00","fill-rule":"evenodd",stroke:"#0b8e69","stroke-miterlimit":"2","stroke-width":".5"}),mt.el("path",{d:"M12.68 12.53c.2-.3.6-.38.9-.18s.38.6.18.9c-.56.83-1.41 1.26-2.48 1.26s-1.93-.43-2.48-1.26c-.2-.3-.12-.7.18-.9s.7-.12.9.18c.31.46.75.68 1.41.68s1.1-.22 1.41-.68Z",fill:"#FFF"}),mt.el("path",{d:"M20.89 6.06a.57.57 0 0 1-.57-.57V2.2h-3.31c-.31 0-.57-.25-.57-.57s.25-.57.57-.57h3.88c.31 0 .57.25.57.57v3.86c0 .31-.25.57-.57.57M5.44 21.46H1.59a.57.57 0 0 1-.57-.57v-3.82c0-.31.25-.57.57-.57s.57.25.57.57v3.25h3.28c.31 0 .57.25.57.57s-.25.57-.57.57",fill:"#0b8e69"})]),{id:"sb3-faceSensingBlock",transform:"scale(1.67785234899 1.67785234899)"}),mt.setProps(mt.group([mt.el("path",{d:"M25.644 20.5c-1.667 1.937-4.539 3.429-5.977 3.429a1.25 1.25 0 0 1-.557-.137c-.372-.186-.61-.542-.61-1.03 0-.105.017-.207.05-.308.076-.236.624-.986.727-1.173.27-.484.462-1.075.566-1.865A8.5 8.5 0 0 1 24 3.5h4a8.5 8.5 0 1 1 0 17h-2.356z",fill:"#FFF"}),mt.el("path",{d:"M15.5 21.67c0-1.016-1.494-1.586-2.387-.782l-2.7 2.163A5.958 5.958 0 0 1 6.7 24.33h-.4c-1.035 0-1.8.69-1.8 1.573v4.235c0 .883.765 1.572 1.8 1.572h.4c1.458 0 2.754.423 3.82 1.287l2.598 2.161c.908.75 2.382.188 2.382-.876V21.67z",fill:"#4D4D4D"})]),{id:"sb3-ttsBlock",stroke:"#000","stroke-opacity":.15}),mt.el("image",{id:"sb3-translateBlock",width:"40px",height:"40px",href:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAA21BMVEUAAAAAAAAAAAAAAADS0tIAAABHR0cAAADX19cAAAAAAACkpKRqamq2traurq6WlpbV1dWEhITHx8fPz8/Ly8vDw8O9vb0AAABMTEz////Z2dlXXnVMl//g4ODu7u7m5ub4+PhPmf/x8fH09PT6+vri4uNRmv/r6+1uqv/0+P9Ynv/p8v+rrrphZ33S5f+51v9ho/+1uMKBhpfH3v+Wmqhrcoacxf+Pvv/KzNSgpLGLkKDd6/+rzf9npv/AwsuDtv98s/90rv9jpP9GieeOrtm5ubl2fI7Z4u56otk5hEFfAAAAGXRSTlMAJhgM1wYyHvIkEWpBhXhc5U+uybyhk0YvleQYgwAABDpJREFUWMPtmNl6mzAQhQMCBAYbvLX1GIwxi7e2TtosTdKk+/L+T1QBVoQtJHDby5yLROYTPzOagSM4e9az6oVUrDgKxh39//Bwb+QBkTZ2VL3hypYilKWicpY6gmWcTCbxIoSh0xHjOkZXA4m0rlGcrcBsslcSmrYq4qm2GczmE6Hms6A8W4GQHZ1BTxXweuTCErGz1TEEaTpLymML6HVq87VhIWPRs21yNu679guNXn9hOnWVMUwanzxG0yCTdYQQts195umwJmnUDSatFHQRPaVvljkl4CAuRlWrCfD9uiZEbR+ObrnjfRDhwHUtdAi0gK/vLtts+VqDVfIMjZSmLEycBuD1D4kK8MHc+Ju3/FFQaHdXc4rBU/8NiCE+OJyAIQKuz32qjA7O1xzwqMtiUETAXeRzinZcyoPgsPpDcco3q9WD729WhTI/e1itbriUzwwtqPI0Q5et4ZoA6SDj1pCWOeB44qJ88aOiIB8j/xMH5IiUJwG+jfyHPMCNH20FQEpkPGnbnBeFuI78Fd82VWJCeTyQCzHb3pMCb8VAQhxBCkPKkzf2Z9J9mR9dCxqb3tBO17EoTw4ky0f0VXSnUCGE6LDp1tvlwK0cyNQMJA1DlL3Px8TenvTjpcAN5cD7VVSsoR992c4oS+aGcuDbzxFBfVqvv5L/375DCzeUAXfnOW5TJHudffvdzg3FwPdZvnbX6/LXr+9t3ZCzAAaMNh/X9BdAWzcUm9T2vnrpk91QbqOhLEDeDZuNHkBSX94Nm7ciAJOWAkW8WZIDl1MikAD57ZwceJsDL0VAfsPJwgzzO5cHvsmBb2IJkAlhB5InntlXlJcc8MO00GMzsHTbsMJDdU+hOxIeCfKuXYQu7ZJ5oDmExwPjfAEvyZ9lGyDW9tOWMH6l1z4nLwjrQ572RRugAvMS57mq4MH7czq9Kgpz1QZoDcI4DsHrWUjw4E1JbLeTSZ5z2gLYMTTwBnaOEwBvS1Ke86UUyF7isKpLrIHkSvVGBORdUQx8nFb0KAUy38aSCO8I510hMrhrBOrGEFIYGToPZM+Fn+XwiraiAMh2Uwnb+3DAC9Z/t3TIA2W7MwZkYbH+uZIC+f0jD3z9+vXF05hIAJTtcK3TLIDnMSLnhqeZlDo8eksYqH/3UskWPz7aCuDTX3urMiA5ejHCp7+YV4W9gxBnMFJP/XRwKNT3IEhLZpIGQMp86seNY6LlutRQgrFr6dLPLyELjm44eemIWt6C+JP0A1HffCIm4GDEw2jvpNTxbIwQ0kUTUYUYkgYTSXfMBU1Ee+G6fSwkOlpA/RFcJCR2erRHkllKSjNWhdd+NQbqkJrgunyPhKBIprpeiZyLZtEeCRNWQdlUZPU8yF1yYJ1J1HGGEC5iknS8pN0tRtoDDzTSNDLpqjMu2s4b9fBZg/TcJVHjrA7GSl/JZz7rWbX6A0ZzUfwVEqfrAAAAAElFTkSuQmCC"})]}static makeHighContrastIcons(){return[...At.makeCommonIcons(),mt.setProps(mt.group([mt.el("path",{d:"M12.71 2.44A2.41 2.41 0 0 1 12 4.16L8.08 8.08a2.45 2.45 0 0 1-3.45 0L.72 4.16A2.42 2.42 0 0 1 0 2.44 2.48 2.48 0 0 1 .71.71C1 .47 1.43 0 6.36 0s5.39.46 5.64.71a2.44 2.44 0 0 1 .71 1.73z",fill:"#231f20",opacity:".1"}),mt.el("path",{d:"M6.36 7.79a1.43 1.43 0 0 1-1-.42L1.42 3.45a1.44 1.44 0 0 1 0-2c.56-.56 9.31-.56 9.87 0a1.44 1.44 0 0 1 0 2L7.37 7.37a1.43 1.43 0 0 1-1.01.42z",fill:"#000"})]),{id:"sb3-dropdownArrow-high-contrast",transform:"scale(0.944)"}),mt.setProps(mt.group([mt.el("path",{d:"M22.68 12.2a1.6 1.6 0 0 1-1.27.63h-7.69a1.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 .8A4.25 4.25 0 0 0 7.2 10.6a5.06 5.06 0 0 0 .54 4.62A5.58 5.58 0 0 0 12 17.74a2.26 2.26 0 0 1-.16 4.52A10.25 10.25 0 0 1 3.74 18a10.14 10.14 0 0 1-1.49-9.22 9.7 9.7 0 0 1 2.83-4.14A9.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-.26 1.39z",fill:"#000"}),mt.el("path",{d:"M21.38 11.83h-7.61a.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.82 9.16 9.16 0 0 1-1.4-8.37A8.51 8.51 0 0 1 5.71 5.4a8.76 8.76 0 0 1 4.11-1.92 9.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-.62.75z",fill:"#000"})]),{id:"sb3-turnRight-high-contrast"}),mt.setProps(mt.group([mt.el("path",{d:"M20.34 18.21a10.24 10.24 0 0 1-8.1 4.22 2.26 2.26 0 0 1-.16-4.52 5.58 5.58 0 0 0 4.25-2.53 5.06 5.06 0 0 0 .54-4.62A4.25 4.25 0 0 0 15.55 9a4.31 4.31 0 0 0-2-.8 4.82 4.82 0 0 0-3.15.8l1.12 1.41A1.59 1.59 0 0 1 10.36 13H2.67a1.56 1.56 0 0 1-1.26-.63A1.54 1.54 0 0 1 1.13 11l1.72-7.43A1.59 1.59 0 0 1 4.38 2.4a1.57 1.57 0 0 1 1.24.6L6.7 4.35a10.66 10.66 0 0 1 7.72-1.68A9.88 9.88 0 0 1 19 4.81 9.61 9.61 0 0 1 21.83 9a10.08 10.08 0 0 1-1.49 9.21z",fill:"#000"}),mt.el("path",{d:"M19.56 17.65a9.29 9.29 0 0 1-7.35 3.83 1.31 1.31 0 0 1-.08-2.62 6.53 6.53 0 0 0 5-2.92 6.05 6.05 0 0 0 .67-5.51 5.32 5.32 0 0 0-1.64-2.16 5.21 5.21 0 0 0-2.48-1A5.86 5.86 0 0 0 9 8.84L10.74 11a.59.59 0 0 1-.43 1H2.7a.6.6 0 0 1-.6-.75l1.71-7.42a.59.59 0 0 1 1-.21l1.67 2.1a9.71 9.71 0 0 1 7.75-2.07 8.84 8.84 0 0 1 4.12 1.92 8.68 8.68 0 0 1 2.54 3.72 9.14 9.14 0 0 1-1.33 8.36z",fill:"#000"})]),{id:"sb3-turnLeft-high-contrast"}),mt.setProps(mt.group([mt.el("path",{d:"M23.3 11c-.3.6-.9 1-1.5 1h-1.6c-.1 1.3-.5 2.5-1.1 3.6-.9 1.7-2.3 3.2-4.1 4.1-1.7.9-3.6 1.2-5.5.9-1.8-.3-3.5-1.1-4.9-2.3-.7-.7-.7-1.9 0-2.6.6-.6 1.6-.7 2.3-.2H7c.9.6 1.9.9 2.9.9s1.9-.3 2.7-.9c1.1-.8 1.8-2.1 1.8-3.5h-1.5c-.9 0-1.7-.7-1.7-1.7 0-.4.2-.9.5-1.2l4.4-4.4c.7-.6 1.7-.6 2.4 0L23 9.2c.5.5.6 1.2.3 1.8z",fill:"#000"}),mt.el("path",{d:"M21.8 11h-2.6c0 1.5-.3 2.9-1 4.2-.8 1.6-2.1 2.8-3.7 3.6-1.5.8-3.3 1.1-4.9.8-1.6-.2-3.2-1-4.4-2.1-.4-.3-.4-.9-.1-1.2.3-.4.9-.4 1.2-.1 1 .7 2.2 1.1 3.4 1.1s2.3-.3 3.3-1c.9-.6 1.6-1.5 2-2.6.3-.9.4-1.8.2-2.8h-2.4c-.4 0-.7-.3-.7-.7 0-.2.1-.3.2-.4l4.4-4.4c.3-.3.7-.3.9 0L22 9.8c.3.3.4.6.3.9s-.3.3-.5.3z",fill:"#000"})]),{id:"sb3-loopArrow-high-contrast"}),mt.setProps(mt.group([mt.el("path",{d:"M28.456 21.675c-.009-.312-.087-.825-.256-1.702-.096-.495-.612-3.022-.753-3.73-.395-1.98-.76-3.92-1.142-6.113-.732-4.223-.693-6.05.344-6.527.502-.23 1.06-.081 1.842.35.413.227 2.181 1.365 2.07 1.296 1.993 1.243 3.463 1.775 4.928 1.549 1.527-.237 2.505-.06 2.877.618.348.635.015 1.416-.729 2.18-1.473 1.516-3.976 2.514-5.849 2.023-.822-.218-1.238-.464-2.38-1.266a9.737 9.737 0 0 0-.095-.066c.047.593.264 1.74.717 3.803.294 1.336 2.079 9.187 2.637 11.674l.002.012c.529 2.637-1.872 4.724-5.235 4.724-3.29 0-6.363-1.988-6.862-4.528-.53-2.64 1.873-4.734 5.233-4.734a8.411 8.411 0 0 1 2.65.437zM11.46 27.666c-.01-.319-.091-.84-.266-1.738-.09-.46-.595-2.937-.753-3.727-.39-1.96-.752-3.892-1.131-6.07-.732-4.224-.692-6.052.344-6.527.502-.23 1.06-.082 1.841.349.414.228 2.181 1.365 2.07 1.296 1.992 1.243 3.461 1.775 4.925 1.549 1.525-.24 2.504-.064 2.876.614.348.635.015 1.415-.728 2.18-1.474 1.517-3.977 2.513-5.847 2.017-.822-.218-1.237-.463-2.38-1.266a9.729 9.729 0 0 0-.094-.065c.047.593.264 1.74.717 3.802.294 1.337 2.078 9.19 2.636 11.675l.003.013c.517 2.638-1.884 4.732-5.234 4.732-3.286 0-6.359-1.993-6.87-4.54-.518-2.639 1.885-4.73 5.242-4.73.904 0 1.802.15 2.65.436z",stroke:"#000"}),mt.el("path",{d:"M32.18 25.874C32.636 28.157 30.512 30 27.433 30c-3.07 0-5.923-1.843-6.372-4.126-.458-2.285 1.665-4.136 4.743-4.136.647 0 1.283.084 1.89.234a7 7 0 0 1 .938.302c.87-.02-.104-2.294-1.835-12.229-2.134-12.303 3.06-1.87 8.768-2.753 5.708-.885.076 4.82-3.65 3.844-3.724-.987-4.65-7.153.263 14.738zm-16.998 5.99C15.63 34.148 13.507 36 10.439 36c-3.068 0-5.92-1.852-6.379-4.136-.448-2.284 1.674-4.135 4.751-4.135 1.002 0 1.974.197 2.854.544.822-.055-.15-2.377-1.862-12.228-2.133-12.303 3.059-1.87 8.764-2.753 5.706-.894.076 4.821-3.648 3.834-3.723-.987-4.648-7.152.263 14.738z",fill:"#000"})]),{id:"sb3-musicBlock-high-contrast",fill:"none"}),mt.setProps(mt.group([mt.el("path",{d:"M8.753 34.602l-4.251 1.779 1.784-4.236c1.218-2.892 2.907-5.423 5.03-7.538L31.066 4.93c.846-.842 2.65-.41 4.032.967 1.38 1.375 1.816 3.173.97 4.015L16.318 29.59c-2.123 2.116-4.664 3.799-7.565 5.012",fill:"#FFF"}),mt.el("path",{d:"M29.41 6.111s-4.45-2.379-8.202 5.771c-1.734 3.766-4.35 1.546-4.35 1.546"}),mt.el("path",{d:"M36.42 8.825c0 .463-.14.873-.432 1.164l-9.335 9.301c.282-.29.41-.668.41-1.12 0-.874-.507-1.963-1.406-2.868-1.362-1.358-3.147-1.8-4.002-.99L30.99 5.01c.844-.84 2.65-.41 4.035.96.898.904 1.396 1.982 1.396 2.855M10.515 33.774a23.74 23.74 0 0 1-1.764.83L4.5 36.382l1.786-4.235c.258-.604.529-1.186.833-1.757.69.183 1.449.625 2.109 1.282.659.658 1.102 1.412 1.287 2.102",fill:"#4C97FF"}),mt.el("path",{d:"M36.498 8.748c0 .464-.141.874-.433 1.165l-19.742 19.68c-2.131 2.111-4.673 3.793-7.572 5.01L4.5 36.381l.974-2.317 1.925-.808c2.899-1.218 5.441-2.899 7.572-5.01l19.742-19.68c.292-.292.432-.702.432-1.165 0-.647-.27-1.4-.779-2.123.249.172.498.377.736.614.898.905 1.396 1.983 1.396 2.856",fill:"#0b8e69",opacity:".15"}),mt.el("path",{d:"M18.45 12.831a.904.904 0 1 1-1.807 0 .904.904 0 0 1 1.807 0z",fill:"#0b8e69"})]),{id:"sb3-penBlock-high-contrast",stroke:"#0b8e69",fill:"none","stroke-linejoin":"round"}),mt.setProps(mt.group([mt.el("circle",{opacity:.25,cx:32,cy:16,r:4.5}),mt.el("circle",{opacity:.5,cx:32,cy:12,r:4.5}),mt.el("circle",{opacity:.75,cx:32,cy:8,r:4.5}),mt.el("circle",{cx:32,cy:4,r:4.5}),mt.el("path",{d:"M22.672 4.42l-6.172 4V6.1c0-2.01-1.563-3.6-3.5-3.6H4.1C2.076 2.5.5 4.076.5 6.1V14c0 1.927 1.584 3.512 3.6 3.6H13c1.902 0 3.5-1.653 3.5-3.6v-2.283l6.257 3.754.097.075c.02.02.098.054.146.054.267 0 .5-.217.5-.5V4.8c0 .037-.056-.094-.129-.243-.145-.242-.43-.299-.7-.137z",fill:"#000","stroke-linejoin":"round"})]),{id:"sb3-videoBlock-high-contrast",stroke:"#0b8e69",fill:"#FFF","stroke-opacity":.15}),mt.setProps(mt.group([mt.el("circle",{fill:"#231f20",cx:8.35,cy:9.65,r:.97}),mt.el("circle",{fill:"#231f20",cx:14.19,cy:9.65,r:.97}),mt.el("path",{d:"M11.27 4.14c-3.94 0-7.13 3.19-7.13 7.13s3.19 7.13 7.13 7.13 7.13-3.19 7.13-7.13-3.19-7.13-7.13-7.13m0 1.3c3.22 0 5.84 2.61 5.84 5.84s-2.61 5.84-5.84 5.84-5.84-2.61-5.84-5.84 2.61-5.84 5.84-5.84",fill:"#231f20"}),mt.el("path",{d:"M17.57 13.88c.57-.15 1.02-.6 1.17-1.17l.35-1.3c.16-.61 1.04-.61 1.2 0l.35 1.3c.15.57.6 1.02 1.18 1.17l1.3.35c.61.16.61 1.04 0 1.2l-1.3.35c-.57.15-1.02.6-1.18 1.17l-.35 1.3c-.17.62-1.04.62-1.2 0l-.35-1.3c-.15-.57-.6-1.02-1.17-1.17l-1.3-.35c-.61-.17-.61-1.04 0-1.2l1.3-.35Zm-16-11.43c.43-.12.76-.45.88-.88l.26-.98c.12-.46.78-.46.9 0l.26.98c.12.43.45.76.88.88l.98.26c.46.12.46.78 0 .9l-.98.26c-.43.11-.77.45-.88.88l-.26.98c-.12.46-.78.46-.9 0l-.26-.98a1.26 1.26 0 0 0-.88-.88l-.98-.26c-.46-.12-.46-.78 0-.9z",fill:"#ffbf00","fill-rule":"evenodd",stroke:"#0b8e69","stroke-miterlimit":"2","stroke-width":".5"}),mt.el("path",{d:"M12.68 12.53c.2-.3.6-.38.9-.18s.38.6.18.9c-.56.83-1.41 1.26-2.48 1.26s-1.93-.43-2.48-1.26c-.2-.3-.12-.7.18-.9s.7-.12.9.18c.31.46.75.68 1.41.68s1.1-.22 1.41-.68Z",fill:"#231f20"}),mt.el("path",{d:"M20.89 6.06a.57.57 0 0 1-.57-.57V2.2h-3.31c-.31 0-.57-.25-.57-.57s.25-.57.57-.57h3.88c.31 0 .57.25.57.57v3.86c0 .31-.25.57-.57.57M5.44 21.46H1.59a.57.57 0 0 1-.57-.57v-3.82c0-.31.25-.57.57-.57s.57.25.57.57v3.25h3.28c.31 0 .57.25.57.57s-.25.57-.57.57",fill:"#0b8e69"})]),{id:"sb3-faceSensingBlock-high-contrast",transform:"scale(1.67785234899 1.67785234899)"}),mt.setProps(mt.group([mt.el("path",{d:"M25.644 20.5c-1.667 1.937-4.539 3.429-5.977 3.429a1.25 1.25 0 0 1-.557-.137c-.372-.186-.61-.542-.61-1.03 0-.105.017-.207.05-.308.076-.236.624-.986.727-1.173.27-.484.462-1.075.566-1.865A8.5 8.5 0 0 1 24 3.5h4a8.5 8.5 0 1 1 0 17h-2.356z",fill:"#FFF",stroke:"#0b8e69"}),mt.el("path",{d:"M15.5 21.67c0-1.016-1.494-1.586-2.387-.782l-2.7 2.163A5.958 5.958 0 0 1 6.7 24.33h-.4c-1.035 0-1.8.69-1.8 1.573v4.235c0 .883.765 1.572 1.8 1.572h.4c1.458 0 2.754.423 3.82 1.287l2.598 2.161c.908.75 2.382.188 2.382-.876V21.67z",fill:"#000"})]),{id:"sb3-ttsBlock-high-contrast","stroke-opacity":.15}),mt.el("image",{id:"sb3-translateBlock-high-contrast",width:"40px",height:"40px",href:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAxoAAARjCAMAAADfFKLnAAABhlBMVEUAAAALjWkOj2oLjmkAAAAQj2wkmnkYlHILj2kLjmkAAAAAAABsu6VouaIJjmgimncAAAAAAAALjml0v6kAAAAAAAAAAAAATzhjt6A9pogVk28XlHAVk28ZlHEAAAAAAAAAAAANj2oAAAAJj2oAAAAAAAByvahsu6VVsZcqnXwAAAAAAAAAAAAMj2oQkWsAAAAPkGwAAABHqo4AAAAclnMcl3MKj2kXlHIXk3EAAAALj2gAAAD///8AAAB9w6+ExrONyrmHyLWrzv/3+/r8/v6Fx7VpqP/0+fh7s/9Ml//4/PvK59/4+//u9f/l8P/V5v9vrP9an/9Smv/o6OjMzMwrKysDAwPp8//e7P+w0f+axf9xrf9kpf9jpP9ho/9Nl//e3t7E5Nu+4dfT09OUzb2QzLuZmZlMrJKGhoYpnHxlZWVgYGBCQkINDQ30+P/J4P/D3P+11P+Nvf90rv9Jlvby8vLc3Nyl1cik1ce+vr6DxrKlpaWfn58xnJZBpJWJiYl+fn4fHx9PedmHAAAAPHRSTlMAd4OAxg/0wohyDv78+Tj16Ik6+ux+WAb79e7mvbCemW1rZDYXC/n39PTw39u8t7RVNvX11NLDm5qOWx0x5AFdAAAGd0lEQVR42uzbV3faQBCG4XGChMEU4wLujntv6WXXIUAwxd3Gvfea3nv+eQaBcgS5ztV8zwWMfsB7js7uiAAAAAAAAP6fgKfCwRMg1l49OBzqJgC5DLfZO+nQa7oNovq2Ia2rJwhArFZ/QpVI+Fspr57b8BKAUAEzrgpmXhSHjBmgvDGtQwQglKdWFaU27KnWQ0TekEvruvYwAYh08ym3ML0ei8V2NvlnfZofn98gorC2DBKASFYaq8md9MLW1kJ6O7lqp9Hj0qzqFgGIxGlYtjeUepPkwU6D20AZIJidRmxhZnbxtTMN8rpQBshlpzGdTL2dTzjSYJEnBCCVnYaaS++uqb9pAEhnpzGXXFycn1PZo2g0ejpiL410EYBQhTRepnZTs2vz776f+yYd/EG3QQAiWVd+s+nNV/yX+NEQVyXiDS0EIFKNmeAEZlRe9jyuysSDNQQgkrsvo4qOfOofvgoCEMloNWs/cgNTx9FT+7RqaUV/KI7PcFoFYgVG+7iMxpbK+19UwU+tfyENEC/SvK+yAw8cdxy5XO53AmmAdI8bD/qbxh13HMv67Ex/RhogXVfzvQ6DHGlc6L09fYk0AJgjjalrza7fIw2QrjtSksZXfXFycqm/IQ0QrrPK5XWmcbWylD+/vUIaIFtnldaFNjx+lbd8qNjhMq78QDQug7l6eAwE46pMxsSiCAhVpy1hYu7y9cKM300AMoXbOQ5XyEvMaAn6opbjKQ7jkw9L6SBZSOsxe66pqLSMNnIb/hG8TYFk3mqt66nMw4Gs2m+OEIBgE9zGcFtZHeNN/Qe3OwhAsu5HQ3fq2qiU0XG3Cd+GAwAAAAD8YQ8OBAAAAACA/F8bQVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVYQ8OBAAAAACA/F8bQVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV2IMDAQAAAAAg/9dGUFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUV9uBAAAAAAADI/7URVFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWFPTgQAAAAAADyf20EVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVhDw4EAAAAAID8XxtBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVXYgwMBAAAAACD/10ZQVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVRX24EAAAAAAAMj/tRFUVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVYU9OBAAAAAAAPJ/bQRVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWEPDgQAAAAAgPxfG0FVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVdiDAwEAAAAAIP/XRlBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVFfbgQAAAAAAAyP+1EVRVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVhT04EAAAAAAA8n9tBFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVYQ8OBAAAAACA/F8bQVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV2oNDAgAAAABB/1/7wgQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMArKwCvdMdAc1YAAAAASUVORK5CYII="})]}static iconName(t,e){return"high-contrast"===e&&Vt.has(t)?t+"-high-contrast":t}static makeStyle(){const t=mt.el("style");return t.appendChild(mt.cdata(At.cssContent)),t}static get defaultFont(){return"500 12pt Helvetica Neue, Helvetica, sans-serif"}static get commentFont(){return"400 12pt Helvetica Neue, Helvetica, sans-serif"}}const{defaultFont:kt,commentFont:wt,makeStyle:vt,makeOriginalIcons:yt,makeHighContrastIcons:Et,iconName:St}=At;function Ot(t,e){if(t.classList)t.classList.add(e);else{const s=(t.getAttribute("class")||"").split(/\s+/).filter(Boolean);s.includes(e)||(s.push(e),t.setAttribute("class",s.join(" ")))}}class Tt{constructor(t){Object.assign(this,t),this.el=null,this.height=12,this.metrics=null,this.x=0}get isLabel(){return!0}draw(t){return this.el}get width(){return this.metrics.width}measure(){const t=this.value,e="sb3-"+this.cls;this.el=mt.text(0,13.1,t,{class:"sb3-label "+e});let s=Tt.metricsCache[e];if(s||(s=Tt.metricsCache[e]=Object.create(null)),Object.hasOwnProperty.call(s,t))this.metrics=s[t];else{const e=/comment-label/.test(this.cls)?wt:kt;this.metrics=s[t]=Tt.measure(t,e)}}static measure(t,e){const s=Tt.measuring;s.font=e;return{width:s.measureText(t).width}}}Tt.metricsCache={},Tt.toMeasure=[];class Lt{constructor(t){Object.assign(this,t);const e=Lt.icons[this.name];if(!e)throw Error("no info for icon: "+this.name);Object.assign(this,e)}get isIcon(){return!0}draw(t){return mt.symbol("#sb3-"+St(this.name,t),{width:this.width,height:this.height})}static get icons(){return{greenFlag:{width:20,height:21,dy:-1},stopSign:{width:20,height:20},turnLeft:{width:24,height:24},turnRight:{width:24,height:24},loopArrow:{width:24,height:24},addInput:{width:4,height:8},delInput:{width:4,height:8},list:{width:15,height:18},musicBlock:{width:40,height:40},penBlock:{width:40,height:40},videoBlock:{width:40,height:40,dy:10},faceSensingBlock:{width:40,height:40,dy:3.9932885906},ttsBlock:{width:40,height:40},translateBlock:{width:40,height:40},wedoBlock:{width:40,height:40},ev3Block:{width:40,height:40},microbitBlock:{width:40,height:40},makeymakeyBlock:{width:40,height:40},gdxforBlock:{width:40,height:40},boostBlock:{width:40,height:40}}}}class Rt{constructor(){this.width=1,this.height=40,this.x=0}get isLine(){return!0}measure(){}draw(t,e){return mt.el("line",{class:"sb3-extension-line","stroke-linecap":"round",x1:0,y1:0,x2:0,y2:40})}}class Ct{constructor(t){if(Object.assign(this,t),this.x=0,this.rows&&this.rows.length>0){const t=this.rows.length,e=this.rows[0].length,s=1,i=26-(t-1)*s;this.cellSize=Math.max(1,Math.floor(i/t)),this.width=e*(this.cellSize+s)-s,this.height=t*(this.cellSize+s)-s}else this.width=0,this.height=0,this.cellSize=0}get isMatrix(){return!0}measure(){}draw(t,e){if(!this.rows||0===this.rows.length)return mt.group([]);const s=this.cellSize,i=s+1,o=[];for(let t=0;t<this.rows.length;t++){const a=this.rows[t];for(let r=0;r<a.length;r++){const n=r*i,l=t*i,c=!0===a[r],h=mt.el("rect",{x:n,y:l,width:s,height:s,rx:1,ry:1,"stroke-width":0});c?h.setAttribute("fill","#FFFFFF"):h.classList.add("sb3-"+e.info.category),o.push(h)}}return mt.group(o)}}class Nt{constructor(t){Object.assign(this,t),t.label&&(this.label=Dt(t.label)),t.value&&t.value.isMatrix&&(this.matrixView=new Ct(t.value)),this.isBoolean="boolean"===this.shape,this.isDropdown="dropdown"===this.shape,this.isRound=!(this.isBoolean||this.isDropdown),this.x=0}get isInput(){return!0}measure(){this.hasLabel&&this.label.measure(),this.matrixView&&this.matrixView.measure()}static get shapes(){return{string:mt.pillRect,number:mt.pillRect,"number-dropdown":mt.pillRect,color:mt.pillRect,dropdown:mt.roundRect,boolean:mt.pointedRect,stack:mt.stackRect,reporter:mt.pillRect}}draw(t,e){let s,i,o;const a=!!this.matrixView;if(a){o=11;s=this.matrixView.width+o+31,this.height=32}else this.isBoolean?s=48:this.isColor?s=40:this.hasLabel?(i=this.label.draw(t),this.hasArrow?(o=11,s=this.label.width+o+31):(o=this.label.width>=18?11:(40-this.label.width)/2,s=this.label.width+2*o),i=mt.move(o,9,i)):s=this.isInset?30:null;this.width=s;const r=this.height||32;this.height=r;const n=Nt.shapes[this.shape](s,r);mt.setProps(n,{class:`${this.isColor?"":"sb3-"+e.info.category} sb3-input sb3-input-${this.shape}`}),this.isColor?mt.setProps(n,{fill:this.value}):"dropdown"===this.shape?e.info.color&&mt.setProps(n,{fill:e.info.color,stroke:"rgba(0, 0, 0, 0.2)"}):"number-dropdown"===this.shape?(Ot(n,`sb3-${e.info.category}-alt`),e.info.color&&mt.setProps(n,{fill:"rgba(0, 0, 0, 0.1)",stroke:"rgba(0, 0, 0, 0.15)"})):"boolean"===this.shape&&(!function(t,e){if(t.classList)t.classList.remove(e);else{const s=(t.getAttribute("class")||"").split(/\s+/).filter((t=>t!==e));s.length?t.setAttribute("class",s.join(" ")):t.removeAttribute("class")}}(n,"sb3-"+e.info.category),Ot(n,`sb3-${e.info.category}-dark`),e.info.color&&mt.setProps(n,{fill:"rgba(0, 0, 0, 0.15)"}));const l=mt.group([n]);if(a){const s=o,i=(r-this.matrixView.height)/2,a=this.matrixView.draw(t,e);l.appendChild(mt.move(s,i,a))}return this.hasLabel&&l.appendChild(i),this.hasArrow&&l.appendChild(mt.move(s-24,32===r?12.8505114083:(r-32)/2+12.8505114083,mt.symbol("high-contrast"===t?"#sb3-dropdownArrow-high-contrast":"#sb3-dropdownArrow",{}))),l}}class Mt{constructor(t){Object.assign(this,t),this.children=t.children.map(Dt),this.comment=this.comment?Dt(this.comment):null,this.isRound=this.isReporter,this.block=t,this.info={...t.info},Object.prototype.hasOwnProperty.call(s,this.info.category)&&(this.info.category=s[this.info.category]),Object.prototype.hasOwnProperty.call(e,this.info.category)&&(this.children.unshift(new Rt),this.children.unshift(new Lt({name:this.info.category+"Block"})),this.info.category="extension"),this.x=0,this.width=null,this.height=null,this.firstLine=null,this.innerWidth=null}get isBlock(){return!0}measure(){for(const t of this.children)t.measure&&t.measure();this.comment&&this.comment.measure()}static get shapes(){return{stack:mt.stackRect,"c-block":mt.stackRect,"if-block":mt.stackRect,celse:mt.stackRect,cend:mt.stackRect,cap:mt.capRect,reporter:mt.pillRect,boolean:mt.pointedRect,hat:mt.hatRect,cat:mt.catHat,"define-hat":mt.procHatRect,ring:mt.pillRect}}drawSelf(t,e,s,i){if(i.length>1)return mt.mouthRect(e,s,this.isFinal,i,{class:"sb3-"+this.info.category});if("outline"===this.info.shape)return mt.setProps(mt.stackRect(e,s),{class:`sb3-${this.info.category} sb3-${this.info.category}-alt`});if(this.isRing){const t=this.children[0];if(t&&(t.isInput||t.isBlock||t.isScript))return mt.roundRect(e,s,{class:"sb3-"+this.info.category})}const o=Mt.shapes[this.info.shape];if(!o)throw Error("no shape func: "+this.info.shape);return o(e,s,{class:"sb3-"+this.info.category})}static get padding(){return{hat:[24,8],cat:[24,8],"define-hat":[20,16],null:[4,4]}}horizontalPadding(t){if(this.isRound){if(t.isIcon)return 16;if(t.isLabel)return 12;if(t.isDropdown)return 12;if(t.isBoolean)return 12;if(t.isRound)return 4}else if(this.isBoolean){if(t.isIcon)return 24;if(t.isLabel)return 20;if(t.isDropdown)return 20;if(t.isRound&&t.isBlock)return 24;if(t.isRound)return 20;if(t.isBoolean)return 8}return 8}marginBetween(t,e){return t.isLabel&&e.isLabel?4.447998046875:8}draw(t){const e="define-hat"===this.info.shape;let s=this.children;const i=this.isCommand,o=Mt.padding[this.info.shape]||Mt.padding.null,a=o[0],r=o[1];let n="cat"===this.info.shape?16:0;const l=function(t){this.y=t,this.width=0,this.height=i?40:32,this.children=[]};let c=0,h=0,p=new l(n);const d=()=>{0===u.length?p.height+=a+r:(p.height-=11,p.y-=2),n+=p.height,u.push(p)};if(this.info.isRTL){let t=0;const e=()=>{s=s.slice(0,t).concat(s.slice(t,i).reverse()).concat(s.slice(i))};let i;for(i=0;i<s.length;i++)s[i].isScript&&(e(),t=i+1);t<i&&e()}const u=[];let g,f;for(let e=0;e<s.length;e++){const i=s[e];if(i.el=i.draw(t,this),i.isScript&&this.isCommand)this.hasScript=!0,d(),i.y=n-1,u.push(i),h=Math.max(h,Math.max(1,i.width)),i.height=Math.max(29,i.height+3)-2,n+=i.height,p=new l(n),g=null;else if(i.isArrow)p.children.push(i),g=i;else{if(u.length||(f=i),g&&(p.width+=this.marginBetween(g,i)),null!=s[0]){const t=48-this.horizontalPadding(s[0]);(this.isCommand||this.isOutline)&&!i.isLabel&&!i.isIcon&&p.width<t&&(p.width=t)}i.isIcon&&0===e&&this.isCommand&&(p.height=Math.max(p.height,i.height+8)),i.x=p.width,p.width+=i.width,c=Math.max(c,p.width),i.isLabel||(p.height=Math.max(p.height,i.height)),p.children.push(i),g=i}}d();let b=s.length?this.horizontalPadding(s[0]):0;c+=b+(s.length?this.horizontalPadding(f):0);const m=c;c=Math.max(this.hasScript?160:this.isHat?100:this.isCommand||this.isOutline?64:this.isReporter?48:0,c),this.isReporter&&(b+=(c-m)/2),this.height=n,this.width=h?Math.max(c,15+h):c,this.firstLine=u[0],this.innerWidth=c;const V=[];for(let t=0;t<u.length;t++){const s=u[t];if(s.isScript){V.push(mt.move(16,s.y,s.el));continue}const i=s.height;for(let o=0;o<s.children.length;o++){const n=s.children[o];if(n.isArrow){V.push(mt.move(c-32,this.height-28,n.el));continue}let l=a+(i-n.height-a-r)/2;n.isLabel&&0===t?l-=1:e&&n.isLabel?l+=3:n.isIcon&&(l+=0|n.dy,this.isCommand&&0===t&&0===o&&(l+=4));let h=b+n.x;n.dx&&(h+=n.dx),V.push(mt.move(h,s.y+l|0,n.el))}}const A=this.drawSelf(t,c,this.height,u);V.splice(0,0,A),this.info.color&&mt.setProps(A,{fill:this.info.color,stroke:"rgba(0, 0, 0, 0.2)"});const k=mt.group(V);return this.block&&this.block.blockPath&&mt.setProps(k,{"data-block-path":this.block.blockPath}),k}}class Bt{constructor(t){Object.assign(this,t),this.label=Dt(t.label),this.width=null}get isComment(){return!0}static get lineLength(){return 12}get height(){return 20}measure(){this.label.measure()}draw(t){const e=this.label.draw(t);return this.width=this.label.width+16,mt.group([mt.commentLine(this.hasBlock?Bt.lineLength:0,6),mt.commentRect(this.width,this.height,{class:"sb3-comment"}),mt.move(8,4,e)])}}class xt{constructor(t){Object.assign(this,t),this.child=Dt(t.child),this.width=null,this.height=null,this.y=0}get isGlow(){return!0}measure(){this.child.measure()}drawSelf(t){const e=this.child;let s;const i=this.width,o=this.height-1;return s=e.isScript?!e.isEmpty&&e.blocks[0].isHat?mt.hatRect(i,o):e.isFinal?mt.capRect(i,o):mt.stackRect(i,o):e.drawSelf(t,i,o,[]),mt.setProps(s,{class:"sb3-diff sb3-diff-ins"})}draw(t){const e=this.child,s=e.isScript?e.draw(t,!0):e.draw(t);return this.width=e.width,this.height=e.isBlock&&e.firstLine.height||e.height,mt.group([s,this.drawSelf(t)])}}class It{constructor(t){Object.assign(this,t),this.blocks=t.blocks.map(Dt),this.y=0}get isScript(){return!0}measure(){for(const t of this.blocks)t.measure()}draw(t,e){const s=[];let i=1;this.width=0;for(const o of this.blocks){const a=e?0:2,r=o.draw(t);s.push(mt.move(a,i,r)),this.width=Math.max(this.width,o.width);if("-"===o.diff){const t=o.width,e=o.firstLine.height||o.height;s.push(mt.move(a,i+e/2+1,mt.strikethroughLine(t))),this.width=Math.max(this.width,o.width)}i+=o.height;const n=o.comment;if(n){const e=o.firstLine,a=o.innerWidth+2+Bt.lineLength,r=i-o.height+e.height/2,l=n.draw(t);s.push(mt.move(a,r-n.height/2,l)),this.width=Math.max(this.width,a+n.width)}}const o=this.blocks[this.blocks.length-1];return this.height=i+1,e||this.isFinal||(this.height+=o.hasPuzzle?8:0),!e&&o.isGlow&&(this.height+=7),mt.group(s)}}class Pt{constructor(t,e){Object.assign(this,t),this.scripts=t.scripts.map(Dt),this.doc=t,this.width=null,this.height=null,this.el=null,this.defs=null,this.scale=e.scale,this.iconStyle=e.style.replace("scratch3-",""),this.elementMap=new Map}measure(){this.scripts.forEach((t=>{t.measure()}))}render(t){if("function"==typeof t)throw Error("render() no longer takes a callback");this.measure();let e=0,s=0;const i=[];for(let t=0;t<this.scripts.length;t++){const o=this.scripts[t];s&&(s+=10),o.y=s,i.push(mt.move(0,s,o.draw(this.iconStyle))),s+=o.height,t!==this.scripts.length-1&&(s+=36),e=Math.max(e,o.width+4)}this.width=e,this.height=s;const o=mt.newSVG(e,s,this.scale),a="high-contrast"===this.iconStyle?Et():yt();return o.appendChild(this.defs=mt.withChildren(mt.el("defs"),a)),o.appendChild(mt.setProps(mt.group(i),{style:`transform: scale(${this.scale})`})),this.el=o,this._buildElementMap(),o}_buildElementMap(){if(!this.el)return;this.elementMap.clear();this.el.querySelectorAll("[data-block-path]").forEach((t=>{const e=t.getAttribute("data-block-path");e&&this.elementMap.set(e,{el:t})}))}getElementByPath(t){const e=this.elementMap.get(t);return e?e.el:null}highlightBlock(t,e={}){const s=this.getElementByPath(t);if(!s)return!1;const i=s.firstElementChild;return i&&(i.classList.remove("sb3-highlight","sb3-highlight-colorShift","sb3-blink"),i.getBBox(),i.classList.add("sb3-highlight"),e.colorShift&&i.classList.add("sb3-highlight-colorShift"),e.blink&&i.classList.add("sb3-blink")),!0}clearHighlight(t=null){if(t){const e=this.getElementByPath(t);if(e){const t=e.firstElementChild;t&&t.classList.remove("sb3-highlight","sb3-highlight-colorShift","sb3-blink")}}else{this.el.querySelectorAll(".sb3-highlight").forEach((t=>{t.classList.remove("sb3-highlight","sb3-highlight-colorShift","sb3-blink")}))}}exportSVGString(){if(null==this.el)throw Error("call draw() first");const t=vt();this.defs.appendChild(t);const e=(new mt.XMLSerializer).serializeToString(this.el);return this.defs.removeChild(t),e}exportSVG(){return"data:image/svg+xml;utf8,"+this.exportSVGString().replace(/[#]/g,encodeURIComponent)}toCanvas(t,e){e=e||1;const s=mt.makeCanvas();s.width=Math.max(1,this.width*e*this.scale),s.height=Math.max(1,this.height*e*this.scale);const i=s.getContext("2d"),o=new Image;o.src=this.exportSVG(),o.onload=()=>{i.save(),i.scale(e,e),i.drawImage(o,0,0),i.restore(),t(s)}}exportPNG(t,e){this.toCanvas((e=>{URL&&URL.createObjectURL&&Blob&&e.toBlob?e.toBlob((e=>{t(URL.createObjectURL(e))}),"image/png"):t(e.toDataURL("image/png"))}),e)}}const Dt=(t,e)=>new((t=>{switch(t.constructor){case L:return Tt;case R:return Lt;case N:return Nt;case M:return Mt;case B:return Bt;case x:return xt;case I:return It;case P:return Pt;default:throw Error("no view for "+t.constructor.name)}})(t))(t,e);const Ft=At.makeStyle;const _t=function(t){const e=t.document;function s(t,e){if((e={style:"scratch2",...e}).scale=e.scale||1,"scratch2"===e.style)return dt(t,e);if(/^scratch3($|-)/.test(e.style))return Dt(t,e);throw Error("Unknown style: "+e.style)}function i(t,e){if("function"==typeof e)throw Error("render() no longer takes a callback");const i=s(t,e).render();return i.classList.add("scratchblocks-style-"+e.style),i}function o(t,s){s={inline:!1,...s};const i=t.innerHTML.replace(/<br>\s?|\n|\r\n|\r/gi,"\n"),o=e.createElement("pre");o.innerHTML=i;let a=o.textContent;return s.inline&&(a=a.replace("\n","")),a}function a(t,s,i,o){let a;if(o.inline){a=e.createElement("span");let t="scratchblocks scratchblocks-inline";i.scripts[0]&&!i.scripts[0].isEmpty&&(t+=" scratchblocks-inline-"+i.scripts[0].blocks[0].shape),a.className=t,a.style.display="inline-block",a.style.verticalAlign="middle"}else a=e.createElement("div"),a.className="scratchblocks";a.appendChild(s),t.innerHTML="",t.appendChild(a)}return function(t){Z.init(t),it.measuring=Z.makeCanvas().getContext("2d")}(t),function(t){mt.init(t),Tt.measuring=mt.makeCanvas().getContext("2d")}(t),{allLanguages:k,loadLanguages:w,stringify:function(t){return t.stringify()},Label:L,Icon:R,Input:N,Block:M,Comment:B,Script:I,Document:P,newView:s,read:o,parse:K,replace:a,render:i,renderMatching:function(t,s){t=t||"pre.blocks",s={style:"scratch2",inline:!1,languages:["en"],scale:1,read:o,parse:K,render:i,replace:a,...s};[].slice.apply(e.querySelectorAll(t)).forEach((t=>{const e=s.read(t,s),i=s.parse(e,s),o=s.render(i,s);s.replace(t,o,i,s)}))},appendStyles:function(){e.head.appendChild(ut()),e.head.appendChild(Ft())},highlightBlock:function(t,e,s={}){return!(!t||"function"!=typeof t.highlightBlock)&&t.highlightBlock(e,s)},clearHighlight:function(t,e=null){t&&"function"==typeof t.clearHighlight&&t.clearHighlight(e)},getBlockByPath:function(t,e){return t&&"function"==typeof t.getBlockByPath?t.getBlockByPath(e):null},getElementByPath:function(t,e){return t&&"function"==typeof t.getElementByPath?t.getElementByPath(e):null}}}(window);_t.appendStyles();export{_t as default};
11
+ const t={pen:"pen",video:"sensing",music:"sound"},e={...t,faceSensing:"faceSensing",tts:"tts",translate:"translate",microbit:"microbit",gdxfor:"gdxfor",wedo:"wedo",makeymakey:"makeymakey",ev3:"ev3",boost:"boost"},s={wedo2:"wedo",text2speech:"tts"};const i=[{id:"MOTION_GOTO_POINTER",value:"mouse-pointer"},{id:"MOTION_GOTO_RANDOM",value:"random position"},{id:"MOTION_GLIDETO_POINTER",value:"mouse-pointer"},{id:"MOTION_GLIDETO_RANDOM",value:"random position"},{id:"MOTION_POINTTOWARDS_POINTER",value:"mouse-pointer"},{id:"MOTION_POINTTOWARDS_RANDOM",value:"random direction"},{id:"MOTION_SETROTATIONSTYLE_LEFTRIGHT",value:"left-right"},{id:"MOTION_SETROTATIONSTYLE_DONTROTATE",value:"don't rotate"},{id:"MOTION_SETROTATIONSTYLE_ALLAROUND",value:"all around"},{id:"LOOKS_NEXTBACKDROP",value:"next backdrop",parents:["LOOKS_SWITCHBACKDROPTO"]},{id:"LOOKS_PREVIOUSBACKDROP",value:"previous backdrop",parents:["LOOKS_SWITCHBACKDROPTO"]},{id:"LOOKS_RANDOMBACKDROP",value:"random backdrop",parents:["LOOKS_SWITCHBACKDROPTO"]},{id:"LOOKS_EFFECT_COLOR",value:"color",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_EFFECT_FISHEYE",value:"fisheye",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_EFFECT_WHIRL",value:"whirl",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_EFFECT_PIXELATE",value:"pixelate",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_EFFECT_MOSAIC",value:"mosaic",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_EFFECT_BRIGHTNESS",value:"brightness",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_EFFECT_GHOST",value:"ghost",parents:["LOOKS_SETEFFECTTO","LOOKS_CHANGEEFFECTBY"]},{id:"LOOKS_GOTOFRONTBACK_FRONT",value:"front"},{id:"LOOKS_GOTOFRONTBACK_BACK",value:"back"},{id:"LOOKS_GOFORWARDBACKWARDLAYERS_FORWARD",value:"forward"},{id:"LOOKS_GOFORWARDBACKWARDLAYERS_BACKWARD",value:"backward"},{id:"LOOKS_NUMBERNAME_NUMBER",value:"number",parents:["LOOKS_COSTUMENUMBERNAME","LOOKS_BACKDROPNUMBERNAME"]},{id:"LOOKS_NUMBERNAME_NAME",value:"name",parents:["LOOKS_COSTUMENUMBERNAME","LOOKS_BACKDROPNUMBERNAME"]},{id:"SOUND_EFFECTS_PITCH",value:"pitch",parents:["SOUND_CHANGEEFFECTBY","SOUND_SETEFFECTO"]},{id:"SOUND_EFFECTS_PAN",value:"pan left/right",parents:["SOUND_CHANGEEFFECTBY","SOUND_SETEFFECTO"]},{id:"EVENT_WHENKEYPRESSED_SPACE",value:"space",parents:["EVENT_WHENKEYPRESSED","SENSING_KEYPRESSED","makeymakey.whenKeyPressed"]},{id:"EVENT_WHENKEYPRESSED_LEFT",value:"left arrow",parents:["EVENT_WHENKEYPRESSED","SENSING_KEYPRESSED","makeymakey.whenKeyPressed"]},{id:"EVENT_WHENKEYPRESSED_RIGHT",value:"right arrow",parents:["EVENT_WHENKEYPRESSED","SENSING_KEYPRESSED","makeymakey.whenKeyPressed"]},{id:"EVENT_WHENKEYPRESSED_DOWN",value:"down arrow",parents:["EVENT_WHENKEYPRESSED","SENSING_KEYPRESSED","makeymakey.whenKeyPressed"]},{id:"EVENT_WHENKEYPRESSED_UP",value:"up arrow",parents:["EVENT_WHENKEYPRESSED","SENSING_KEYPRESSED","makeymakey.whenKeyPressed"]},{id:"EVENT_WHENKEYPRESSED_ANY",value:"any",parents:["EVENT_WHENKEYPRESSED","SENSING_KEYPRESSED"]},{id:"EVENT_WHENGREATERTHAN_TIMER",value:"timer",parents:["EVENT_WHENGREATERTHAN"]},{id:"EVENT_WHENGREATERTHAN_LOUDNESS",value:"loudness",parents:["EVENT_WHENGREATERTHAN"]},{id:"CONTROL_STOP_ALL",value:"all"},{id:"CONTROL_STOP_THIS",value:"this script"},{id:"CONTROL_STOP_OTHER",value:"other scripts in sprite"},{id:"CONTROL_CREATECLONEOF_MYSELF",value:"myself"},{id:"SENSING_TOUCHINGOBJECT_POINTER",value:"mouse-pointer"},{id:"SENSING_TOUCHINGOBJECT_EDGE",value:"edge"},{id:"SENSING_DISTANCETO_POINTER",value:"mouse-pointer"},{id:"SENSING_SETDRAGMODE_DRAGGABLE",value:"draggable"},{id:"SENSING_SETDRAGMODE_NOTDRAGGABLE",value:"not draggable"},{id:"SENSING_OF_XPOSITION",value:"x position"},{id:"SENSING_OF_YPOSITION",value:"y position"},{id:"SENSING_OF_DIRECTION",value:"direction"},{id:"SENSING_OF_COSTUMENUMBER",value:"costume #"},{id:"SENSING_OF_COSTUMENAME",value:"costume name"},{id:"SENSING_OF_SIZE",value:"size"},{id:"SENSING_OF_VOLUME",value:"volume"},{id:"SENSING_OF_BACKDROPNUMBER",value:"backdrop #"},{id:"SENSING_OF_BACKDROPNAME",value:"backdrop name"},{id:"SENSING_OF_STAGE",value:"Stage"},{id:"SENSING_CURRENT_YEAR",value:"year"},{id:"SENSING_CURRENT_MONTH",value:"month"},{id:"SENSING_CURRENT_DATE",value:"date"},{id:"SENSING_CURRENT_DAYOFWEEK",value:"day of week"},{id:"SENSING_CURRENT_HOUR",value:"hour"},{id:"SENSING_CURRENT_MINUTE",value:"minute"},{id:"SENSING_CURRENT_SECOND",value:"second"},{id:"OPERATORS_MATHOP_ABS",value:"abs"},{id:"OPERATORS_MATHOP_FLOOR",value:"floor"},{id:"OPERATORS_MATHOP_CEILING",value:"ceiling"},{id:"OPERATORS_MATHOP_SQRT",value:"sqrt"},{id:"OPERATORS_MATHOP_SIN",value:"sin"},{id:"OPERATORS_MATHOP_COS",value:"cos"},{id:"OPERATORS_MATHOP_TAN",value:"tan"},{id:"OPERATORS_MATHOP_ASIN",value:"asin"},{id:"OPERATORS_MATHOP_ACOS",value:"acos"},{id:"OPERATORS_MATHOP_ATAN",value:"atan"},{id:"OPERATORS_MATHOP_LN",value:"ln"},{id:"OPERATORS_MATHOP_LOG",value:"log"},{id:"OPERATORS_MATHOP_EEXP",value:"e ^"},{id:"OPERATORS_MATHOP_10EXP",value:"10 ^"},{id:"music.drumSnare",value:"(1) Snare Drum"},{id:"music.drumBass",value:"(2) Bass Drum"},{id:"music.drumSideStick",value:"(3) Side Stick"},{id:"music.drumCrashCymbal",value:"(4) Crash Cymbal"},{id:"music.drumOpenHiHat",value:"(5) Open Hi-Hat"},{id:"music.drumClosedHiHat",value:"(6) Closed Hi-Hat"},{id:"music.drumTambourine",value:"(7) Tambourine"},{id:"music.drumHandClap",value:"(8) Hand Clap"},{id:"music.drumClaves",value:"(9) Claves"},{id:"music.drumWoodBlock",value:"(10) Wood Block"},{id:"music.drumCowbell",value:"(11) Cowbell"},{id:"music.drumTriangle",value:"(12) Triangle"},{id:"music.drumBongo",value:"(13) Bongo"},{id:"music.drumConga",value:"(14) Conga"},{id:"music.drumCabasa",value:"(15) Cabasa"},{id:"music.drumGuiro",value:"(16) Guiro"},{id:"music.drumVibraslap",value:"(17) Vibraslap"},{id:"music.drumCuica",value:"(18) Cuica"},{id:"music.instrumentPiano",value:"(1) Piano"},{id:"music.instrumentElectricPiano",value:"(2) Electric Piano"},{id:"music.instrumentOrgan",value:"(3) Organ"},{id:"music.instrumentGuitar",value:"(4) Guitar"},{id:"music.instrumentElectricGuitar",value:"(5) Electric Guitar"},{id:"music.instrumentBass",value:"(6) Bass"},{id:"music.instrumentPizzicato",value:"(7) Pizzicato"},{id:"music.instrumentCello",value:"(8) Cello"},{id:"music.instrumentTrombone",value:"(9) Trombone"},{id:"music.instrumentClarinet",value:"(10) Clarinet"},{id:"music.instrumentSaxophone",value:"(11) Saxophone"},{id:"music.instrumentFlute",value:"(12) Flute"},{id:"music.instrumentWoodenFlute",value:"(13) Wooden Flute"},{id:"music.instrumentBassoon",value:"(14) Bassoon"},{id:"music.instrumentChoir",value:"(15) Choir"},{id:"music.instrumentVibraphone",value:"(16) Vibraphone"},{id:"music.instrumentMusicBox",value:"(17) Music Box"},{id:"music.instrumentSteelDrum",value:"(18) Steel Drum"},{id:"music.instrumentMarimba",value:"(19) Marimba"},{id:"music.instrumentSynthLead",value:"(20) Synth Lead"},{id:"music.instrumentSynthPad",value:"(21) Synth Pad"},{id:"pen.colorMenu.color",value:"color",parents:["pen.setColorParam","pen.changeColorParam"]},{id:"pen.colorMenu.saturation",value:"saturation",parents:["pen.setColorParam","pen.changeColorParam"]},{id:"pen.colorMenu.brightness",value:"brightness",parents:["pen.setColorParam","pen.changeColorParam"]},{id:"pen.colorMenu.transparency",value:"transparency",parents:["pen.setColorParam","pen.changeColorParam"]},{id:"videoSensing.direction",value:"direction",parents:["videoSensing.videoOn"]},{id:"videoSensing.motion",value:"motion",parents:["videoSensing.videoOn"]},{id:"videoSensing.sprite",value:"sprite",parents:["videoSensing.videoOn"]},{id:"videoSensing.stage",value:"stage",parents:["videoSensing.videoOn"]},{id:"videoSensing.off",value:"off",parents:["videoSensing.videoToggle"]},{id:"videoSensing.on",value:"on",parents:["videoSensing.videoToggle"]},{id:"videoSensing.onFlipped",value:"on flipped",parents:["videoSensing.videoToggle"]},{id:"text2speech.alto",value:"alto",parents:["text2speech.setVoiceBlock"]},{id:"text2speech.tenor",value:"tenor",parents:["text2speech.setVoiceBlock"]},{id:"text2speech.squeak",value:"squeak",parents:["text2speech.setVoiceBlock"]},{id:"text2speech.giant",value:"giant",parents:["text2speech.setVoiceBlock"]},{id:"text2speech.kitten",value:"kitten",parents:["text2speech.setVoiceBlock"]},{id:"makeymakey.upArrowShort",value:"up",parents:["makeymakey.whenKeyPressed"]},{id:"makeymakey.downArrowShort",value:"down",parents:["makeymakey.whenKeyPressed"]},{id:"makeymakey.leftArrowShort",value:"left",parents:["makeymakey.whenKeyPressed"]},{id:"makeymakey.rightArrowShort",value:"right",parents:["makeymakey.whenKeyPressed"]},{id:"microbit.buttonsMenu.any",value:"any",parents:["microbit.whenButtonPressed","microbit.isButtonPressed"]},{id:"microbit.gesturesMenu.jumped",value:"jumped",parents:["microbit.whenGesture"]},{id:"microbit.gesturesMenu.moved",value:"moved",parents:["microbit.whenGesture"]},{id:"microbit.gesturesMenu.shaken",value:"shaken",parents:["microbit.whenGesture"]},{id:"microbit.tiltDirectionMenu.any",value:"any",parents:["microbit.whenTilted","microbit.isTilted"]},{id:"microbit.tiltDirectionMenu.back",value:"back",parents:["microbit.whenTilted","microbit.isTilted","microbit.tiltAngle"]},{id:"microbit.tiltDirectionMenu.front",value:"front",parents:["microbit.whenTilted","microbit.isTilted","microbit.tiltAngle"]},{id:"microbit.tiltDirectionMenu.left",value:"left",parents:["microbit.whenTilted","microbit.isTilted","microbit.tiltAngle"]},{id:"microbit.tiltDirectionMenu.right",value:"right",parents:["microbit.whenTilted","microbit.isTilted","microbit.tiltAngle"]},{id:"boost.motorDirection.backward",value:"that way",parents:["boost.setMotorDirection"]},{id:"boost.motorDirection.forward",value:"this way",parents:["boost.setMotorDirection"]},{id:"boost.motorDirection.reverse",value:"reverse",parents:["boost.setMotorDirection"]},{id:"boost.color.any",value:"any color",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.color.black",value:"black",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.color.blue",value:"blue",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.color.green",value:"green",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.color.red",value:"red",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.color.white",value:"white",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.color.yellow",value:"yellow",parents:["boost.whenColor","boost.seeingColor"]},{id:"boost.tiltDirection.any",value:"any",parents:["boost.whenTilted"]},{id:"boost.tiltDirection.up",value:"up",parents:["boost.whenTilted","boost.getTiltAngle"]},{id:"boost.tiltDirection.down",value:"down",parents:["boost.whenTilted","boost.getTiltAngle"]},{id:"boost.tiltDirection.left",value:"left",parents:["boost.whenTilted","boost.getTiltAngle"]},{id:"boost.tiltDirection.right",value:"right",parents:["boost.whenTilted","boost.getTiltAngle"]},{id:"wedo2.motorId.a",value:"motor A",parents:["wedo2.motorOnFor","wedo2.motorOn","wedo2.motorOff","wedo2.startMotorPower","wedo2.setMotorDirection"]},{id:"wedo2.motorId.b",value:"motor B",parents:["wedo2.motorOnFor","wedo2.motorOn","wedo2.motorOff","wedo2.startMotorPower","wedo2.setMotorDirection"]},{id:"wedo2.motorId.all",value:"all motors",parents:["wedo2.motorOnFor","wedo2.motorOn","wedo2.motorOff","wedo2.startMotorPower","wedo2.setMotorDirection"]},{id:"wedo2.motorId.default",value:"motor",parents:["wedo2.motorOnFor","wedo2.motorOn","wedo2.motorOff","wedo2.startMotorPower","wedo2.setMotorDirection"]},{id:"wedo2.motorDirection.forward",value:"this way",parents:["wedo2.setMotorDirection"]},{id:"wedo2.motorDirection.backward",value:"that way",parents:["wedo2.setMotorDirection"]},{id:"wedo2.motorDirection.reverse",value:"reverse",parents:["wedo2.setMotorDirection"]},{id:"wedo2.tiltDirection.any",value:"any",parents:["wedo2.whenTilted","wedo2.isTilted"]},{id:"wedo2.tiltDirection.up",value:"up",parents:["wedo2.whenTilted","wedo2.isTilted","wedo2.getTiltAngle"]},{id:"wedo2.tiltDirection.down",value:"down",parents:["wedo2.whenTilted","wedo2.isTilted","wedo2.getTiltAngle"]},{id:"wedo2.tiltDirection.left",value:"left",parents:["wedo2.whenTilted","wedo2.isTilted","wedo2.getTiltAngle"]},{id:"wedo2.tiltDirection.right",value:"right",parents:["wedo2.whenTilted","wedo2.isTilted","wedo2.getTiltAngle"]},{id:"gdxfor.pulled",value:"pulled",parents:["gdxfor.whenForcePushedOrPulled"]},{id:"gdxfor.pushed",value:"pushed",parents:["gdxfor.whenForcePushedOrPulled"]},{id:"gdxfor.shaken",value:"shaken",parents:["gdxfor.whenGesture"]},{id:"gdxfor.startedFalling",value:"started falling",parents:["gdxfor.whenGesture"]},{id:"gdxfor.turnedFaceDown",value:"turned face down",parents:["gdxfor.whenGesture"]},{id:"gdxfor.turnedFaceUp",value:"turned face up",parents:["gdxfor.whenGesture"]},{id:"gdxfor.tiltDirectionMenu.front",value:"front",parents:["gdxfor.whenTilted","gdxfor.isTilted","gdxfor.getTilt"]},{id:"gdxfor.tiltDirectionMenu.back",value:"back",parents:["gdxfor.whenTilted","gdxfor.isTilted","gdxfor.getTilt"]},{id:"gdxfor.tiltDirectionMenu.left",value:"left",parents:["gdxfor.whenTilted","gdxfor.isTilted","gdxfor.getTilt"]},{id:"gdxfor.tiltDirectionMenu.right",value:"right",parents:["gdxfor.whenTilted","gdxfor.isTilted","gdxfor.getTilt"]},{id:"gdxfor.tiltDirectionMenu.any",value:"any",parents:["gdxfor.whenTilted","gdxfor.isTilted"]}];const o=["motion","looks","sound","variables","list","events","control","sensing","operators","custom","custom-arg","extension","grey","obsolete",...Object.keys(e),...Object.keys(s)],a=["hat","cap","stack","boolean","reporter","ring","cat"],r=["ar","ckb","fa","he"],n=/%([0-9]+)/,l=/(%[a-zA-Z0-9](?:\.[a-zA-Z0-9]+)?)/,c=RegExp(l.source,"g"),h=/(@[a-zA-Z]+)/,p=RegExp(`${l.source}|${h.source}| +`,"g"),d=/^#(?:[0-9a-fA-F]{3}){1,2}?$/;function u(t){const e=n.exec(t);return e?+e[1]:0}function g(t){const e=t.split(p).filter((t=>t)),s=e.filter((t=>l.test(t)));return{spec:t,parts:e,inputs:s,hash:f(t)}}function f(t){return b(t.replace(c," _ "))}function b(t){return t.replace(/_/g," _ ").replace(/ +/g," ").replace(/[,%?:]/g,"").replace(/ß/g,"ss").replace(/ä/g,"a").replace(/ö/g,"o").replace(/ü/g,"u").replace(". . .","...").replace(/^…$/,"...").trim().toLowerCase()}const m={},V=[{id:"MOTION_MOVESTEPS",selector:"forward:",spec:"move %1 steps",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_TURNRIGHT",selector:"turnRight:",spec:"turn @turnRight %1 degrees",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_TURNLEFT",selector:"turnLeft:",spec:"turn @turnLeft %1 degrees",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_POINTINDIRECTION",selector:"heading:",spec:"point in direction %1",inputs:["%d.direction"],shape:"stack",category:"motion"},{id:"MOTION_POINTTOWARDS",selector:"pointTowards:",spec:"point towards %1",inputs:["%m.spriteOrMouse"],shape:"stack",category:"motion"},{id:"MOTION_GOTOXY",selector:"gotoX:y:",spec:"go to x:%1 y:%2",inputs:["%n","%n"],shape:"stack",category:"motion"},{id:"MOTION_GOTO",selector:"gotoSpriteOrMouse:",spec:"go to %1",inputs:["%m.location"],shape:"stack",category:"motion"},{id:"MOTION_GLIDESECSTOXY",selector:"glideSecs:toX:y:elapsed:from:",spec:"glide %1 secs to x:%2 y:%3",inputs:["%n","%n","%n"],shape:"stack",category:"motion"},{id:"MOTION_GLIDETO",spec:"glide %1 secs to %2",inputs:["%n","%m.location"],shape:"stack",category:"motion"},{id:"MOTION_CHANGEXBY",selector:"changeXposBy:",spec:"change x by %1",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_SETX",selector:"xpos:",spec:"set x to %1",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_CHANGEYBY",selector:"changeYposBy:",spec:"change y by %1",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_SETY",selector:"ypos:",spec:"set y to %1",inputs:["%n"],shape:"stack",category:"motion"},{id:"MOTION_SETROTATIONSTYLE",selector:"setRotationStyle",spec:"set rotation style %1",inputs:["%m.rotationStyle"],shape:"stack",category:"motion"},{id:"LOOKS_SAYFORSECS",selector:"say:duration:elapsed:from:",spec:"say %1 for %2 seconds",inputs:["%s","%n"],shape:"stack",category:"looks"},{id:"LOOKS_SAY",selector:"say:",spec:"say %1",inputs:["%s"],shape:"stack",category:"looks"},{id:"LOOKS_THINKFORSECS",selector:"think:duration:elapsed:from:",spec:"think %1 for %2 seconds",inputs:["%s","%n"],shape:"stack",category:"looks"},{id:"LOOKS_THINK",selector:"think:",spec:"think %1",inputs:["%s"],shape:"stack",category:"looks"},{id:"LOOKS_SHOW",selector:"show",spec:"show",inputs:[],shape:"stack",category:"looks"},{id:"LOOKS_HIDE",selector:"hide",spec:"hide",inputs:[],shape:"stack",category:"looks"},{id:"LOOKS_SWITCHCOSTUMETO",selector:"lookLike:",spec:"switch costume to %1",inputs:["%m.costume"],shape:"stack",category:"looks"},{id:"LOOKS_NEXTCOSTUME",selector:"nextCostume",spec:"next costume",inputs:[],shape:"stack",category:"looks"},{id:"LOOKS_NEXTBACKDROP_BLOCK",selector:"nextScene",spec:"next backdrop",inputs:[],shape:"stack",category:"looks"},{id:"LOOKS_SWITCHBACKDROPTO",selector:"startScene",spec:"switch backdrop to %1",inputs:["%m.backdrop"],shape:"stack",category:"looks"},{id:"LOOKS_SWITCHBACKDROPTOANDWAIT",selector:"startSceneAndWait",spec:"switch backdrop to %1 and wait",inputs:["%m.backdrop"],shape:"stack",category:"looks"},{id:"LOOKS_CHANGEEFFECTBY",selector:"changeGraphicEffect:by:",spec:"change %1 effect by %2",inputs:["%m.effect","%n"],shape:"stack",category:"looks"},{id:"LOOKS_SETEFFECTTO",selector:"setGraphicEffect:to:",spec:"set %1 effect to %2",inputs:["%m.effect","%n"],shape:"stack",category:"looks"},{id:"LOOKS_CLEARGRAPHICEFFECTS",selector:"filterReset",spec:"clear graphic effects",inputs:[],shape:"stack",category:"looks"},{id:"LOOKS_CHANGESIZEBY",selector:"changeSizeBy:",spec:"change size by %1",inputs:["%n"],shape:"stack",category:"looks"},{id:"LOOKS_SETSIZETO",selector:"setSizeTo:",spec:"set size to %1%",inputs:["%n"],shape:"stack",category:"looks"},{selector:"comeToFront",spec:"go to front",inputs:[],shape:"stack",category:"looks"},{id:"LOOKS_GOTOFRONTBACK",spec:"go to %1 layer",inputs:["%m"],shape:"stack",category:"looks"},{selector:"goBackByLayers:",spec:"go back %1 layers",inputs:["%n"],shape:"stack",category:"looks"},{id:"LOOKS_GOFORWARDBACKWARDLAYERS",spec:"go %1 %2 layers",inputs:["%m","%n"],shape:"stack",category:"looks"},{id:"SOUND_PLAY",selector:"playSound:",spec:"start sound %1",inputs:["%m.sound"],shape:"stack",category:"sound"},{id:"SOUND_CHANGEEFFECTBY",spec:"change %1 effect by %2",inputs:["%m","%n"],shape:"stack",category:"sound"},{id:"SOUND_SETEFFECTO",spec:"set %1 effect to %2",inputs:["%m","%n"],shape:"stack",category:"sound"},{id:"SOUND_CLEAREFFECTS",spec:"clear sound effects",inputs:[],shape:"stack",category:"sound"},{id:"SOUND_PLAYUNTILDONE",selector:"doPlaySoundAndWait",spec:"play sound %1 until done",inputs:["%m.sound"],shape:"stack",category:"sound"},{id:"SOUND_STOPALLSOUNDS",selector:"stopAllSounds",spec:"stop all sounds",inputs:[],shape:"stack",category:"sound"},{id:"music.playDrumForBeats",selector:"playDrum",spec:"play drum %1 for %2 beats",inputs:["%d.drum","%n"],shape:"stack",category:"music"},{id:"music.restForBeats",selector:"rest:elapsed:from:",spec:"rest for %1 beats",inputs:["%n"],shape:"stack",category:"music"},{id:"music.playNoteForBeats",selector:"noteOn:duration:elapsed:from:",spec:"play note %1 for %2 beats",inputs:["%d.note","%n"],shape:"stack",category:"music"},{id:"music.setInstrument",selector:"instrument:",spec:"set instrument to %1",inputs:["%d.instrument"],shape:"stack",category:"music"},{id:"SOUND_CHANGEVOLUMEBY",selector:"changeVolumeBy:",spec:"change volume by %1",inputs:["%n"],shape:"stack",category:"sound"},{id:"SOUND_SETVOLUMETO",selector:"setVolumeTo:",spec:"set volume to %1%",inputs:["%n"],shape:"stack",category:"sound"},{id:"music.changeTempo",selector:"changeTempoBy:",spec:"change tempo by %1",inputs:["%n"],shape:"stack",category:"music"},{selector:"setTempoTo:",spec:"set tempo to %1 bpm",inputs:["%n"],shape:"stack",category:"sound"},{id:"music.setTempo",selector:"setTempoTo:",spec:"set tempo to %1",inputs:["%n"],shape:"stack",category:"music"},{id:"pen.clear",selector:"clearPenTrails",spec:"erase all",inputs:[],shape:"stack",category:"pen"},{id:"pen.stamp",selector:"stampCostume",spec:"stamp",inputs:[],shape:"stack",category:"pen"},{id:"pen.penDown",selector:"putPenDown",spec:"pen down",inputs:[],shape:"stack",category:"pen"},{id:"pen.penUp",selector:"putPenUp",spec:"pen up",inputs:[],shape:"stack",category:"pen"},{id:"pen.setColor",selector:"penColor:",spec:"set pen color to %1",inputs:["%c"],shape:"stack",category:"pen"},{id:"pen.changeHue",selector:"changePenHueBy:",spec:"change pen color by %1",inputs:["%n"],shape:"stack",category:"pen"},{id:"pen.setColorParam",spec:"set pen %1 to %2",inputs:["%m.color","%c"],shape:"stack",category:"pen"},{id:"pen.changeColorParam",spec:"change pen %1 by %2",inputs:["%m.color","%n"],shape:"stack",category:"pen"},{id:"pen.setHue",selector:"setPenHueTo:",spec:"set pen color to %1",inputs:["%n"],shape:"stack",category:"pen"},{id:"pen.changeShade",selector:"changePenShadeBy:",spec:"change pen shade by %1",inputs:["%n"],shape:"stack",category:"pen"},{id:"pen.setShade",selector:"setPenShadeTo:",spec:"set pen shade to %1",inputs:["%n"],shape:"stack",category:"pen"},{id:"pen.changeSize",selector:"changePenSizeBy:",spec:"change pen size by %1",inputs:["%n"],shape:"stack",category:"pen"},{id:"pen.setSize",selector:"penSize:",spec:"set pen size to %1",inputs:["%n"],shape:"stack",category:"pen"},{id:"EVENT_WHENFLAGCLICKED",selector:"whenGreenFlag",spec:"when @greenFlag clicked",inputs:[],shape:"hat",category:"events"},{id:"EVENT_WHENKEYPRESSED",selector:"whenKeyPressed",spec:"when %1 key pressed",inputs:["%m.key"],shape:"hat",category:"events"},{id:"EVENT_WHENTHISSPRITECLICKED",selector:"whenClicked",spec:"when this sprite clicked",inputs:[],shape:"hat",category:"events"},{id:"EVENT_WHENSTAGECLICKED",spec:"when stage clicked",inputs:[],shape:"hat",category:"events"},{id:"EVENT_WHENBACKDROPSWITCHESTO",selector:"whenSceneStarts",spec:"when backdrop switches to %1",inputs:["%m.backdrop"],shape:"hat",category:"events"},{id:"EVENT_WHENGREATERTHAN",selector:"whenSensorGreaterThan",spec:"when %1 > %2",inputs:["%m.triggerSensor","%n"],shape:"hat",category:"events"},{id:"EVENT_WHENBROADCASTRECEIVED",selector:"whenIReceive",spec:"when I receive %1",inputs:["%m.broadcast"],shape:"hat",category:"events"},{id:"EVENT_BROADCAST",selector:"broadcast:",spec:"broadcast %1",inputs:["%m.broadcast"],shape:"stack",category:"events"},{id:"EVENT_BROADCASTANDWAIT",selector:"doBroadcastAndWait",spec:"broadcast %1 and wait",inputs:["%m.broadcast"],shape:"stack",category:"events"},{id:"CONTROL_WAIT",selector:"wait:elapsed:from:",spec:"wait %1 seconds",inputs:["%n"],shape:"stack",category:"control"},{id:"CONTROL_REPEAT",selector:"doRepeat",spec:"repeat %1",inputs:["%n"],shape:"c-block",category:"control",hasLoopArrow:!0},{id:"CONTROL_FOREVER",selector:"doForever",spec:"forever",inputs:[],shape:"c-block cap",category:"control",hasLoopArrow:!0},{id:"CONTROL_IF",selector:"doIf",spec:"if %1 then",inputs:["%b"],shape:"c-block",category:"control"},{id:"CONTROL_WAITUNTIL",selector:"doWaitUntil",spec:"wait until %1",inputs:["%b"],shape:"stack",category:"control"},{id:"CONTROL_REPEATUNTIL",selector:"doUntil",spec:"repeat until %1",inputs:["%b"],shape:"c-block",category:"control",hasLoopArrow:!0},{id:"CONTROL_STOP",selector:"stopScripts",spec:"stop %1",inputs:["%m.stop"],shape:"cap",category:"control"},{id:"CONTROL_STARTASCLONE",selector:"whenCloned",spec:"when I start as a clone",inputs:[],shape:"hat",category:"control"},{id:"CONTROL_CREATECLONEOF",selector:"createCloneOf",spec:"create clone of %1",inputs:["%m.spriteOnly"],shape:"stack",category:"control"},{id:"CONTROL_DELETETHISCLONE",selector:"deleteClone",spec:"delete this clone",inputs:[],shape:"cap",category:"control"},{id:"SENSING_ASKANDWAIT",selector:"doAsk",spec:"ask %1 and wait",inputs:["%s"],shape:"stack",category:"sensing"},{id:"videoSensing.videoToggle",selector:"setVideoState",spec:"turn video %1",inputs:["%m.videoState"],shape:"stack",category:"video"},{id:"videoSensing.setVideoTransparency",selector:"setVideoTransparency",spec:"set video transparency to %1%",inputs:["%n"],shape:"stack",category:"video"},{id:"videoSensing.whenMotionGreaterThan",spec:"when video motion > %1",inputs:["%n"],shape:"hat",category:"video"},{id:"SENSING_RESETTIMER",selector:"timerReset",spec:"reset timer",inputs:[],shape:"stack",category:"sensing"},{id:"DATA_SETVARIABLETO",selector:"setVar:to:",spec:"set %1 to %2",inputs:["%m.var","%s"],shape:"stack",category:"variables"},{id:"DATA_CHANGEVARIABLEBY",selector:"changeVar:by:",spec:"change %1 by %2",inputs:["%m.var","%n"],shape:"stack",category:"variables"},{id:"DATA_SHOWVARIABLE",selector:"showVariable:",spec:"show variable %1",inputs:["%m.var"],shape:"stack",category:"variables"},{id:"DATA_HIDEVARIABLE",selector:"hideVariable:",spec:"hide variable %1",inputs:["%m.var"],shape:"stack",category:"variables"},{id:"DATA_ADDTOLIST",selector:"append:toList:",spec:"add %1 to %2",inputs:["%s","%m.list"],shape:"stack",category:"list"},{id:"DATA_DELETEOFLIST",selector:"deleteLine:ofList:",spec:"delete %1 of %2",inputs:["%d.listDeleteItem","%m.list"],shape:"stack",category:"list"},{id:"DATA_DELETEALLOFLIST",spec:"delete all of %1",inputs:["%m.list"],shape:"stack",category:"list"},{id:"MOTION_IFONEDGEBOUNCE",selector:"bounceOffEdge",spec:"if on edge, bounce",inputs:[],shape:"stack",category:"motion"},{id:"DATA_INSERTATLIST",selector:"insert:at:ofList:",spec:"insert %1 at %2 of %3",inputs:["%s","%d.listItem","%m.list"],shape:"stack",category:"list"},{id:"DATA_REPLACEITEMOFLIST",selector:"setLine:ofList:to:",spec:"replace item %1 of %2 with %3",inputs:["%d.listItem","%m.list","%s"],shape:"stack",category:"list"},{id:"DATA_SHOWLIST",selector:"showList:",spec:"show list %1",inputs:["%m.list"],shape:"stack",category:"list"},{id:"DATA_HIDELIST",selector:"hideList:",spec:"hide list %1",inputs:["%m.list"],shape:"stack",category:"list"},{id:"SENSING_OF_XPOSITION",selector:"xpos",spec:"x position",inputs:[],shape:"reporter",category:"motion"},{id:"SENSING_OF_YPOSITION",selector:"ypos",spec:"y position",inputs:[],shape:"reporter",category:"motion"},{id:"SENSING_OF_DIRECTION",selector:"heading",spec:"direction",inputs:[],shape:"reporter",category:"motion"},{id:"SENSING_OF_COSTUMENUMBER",selector:"costumeIndex",spec:"costume #",inputs:[],shape:"reporter",category:"looks"},{id:"LOOKS_COSTUMENUMBERNAME",selector:"LOOKS_COSTUMENUMBERNAME",spec:"costume %1",inputs:["%m"],shape:"reporter",category:"looks"},{id:"SENSING_OF_SIZE",selector:"scale",spec:"size",inputs:[],shape:"reporter",category:"looks"},{id:"SENSING_OF_BACKDROPNAME",selector:"sceneName",spec:"backdrop name",inputs:[],shape:"reporter",category:"looks"},{id:"LOOKS_BACKDROPNUMBERNAME",spec:"backdrop %1",inputs:["%m"],shape:"reporter",category:"looks"},{id:"SENSING_OF_BACKDROPNUMBER",selector:"backgroundIndex",spec:"backdrop #",inputs:[],shape:"reporter",category:"looks"},{id:"SOUND_VOLUME",selector:"volume",spec:"volume",inputs:[],shape:"reporter",category:"sound"},{id:"music.getTempo",selector:"tempo",spec:"tempo",inputs:[],shape:"reporter",category:"music"},{id:"SENSING_TOUCHINGOBJECT",selector:"touching:",spec:"touching %1?",inputs:["%m.touching"],shape:"boolean",category:"sensing"},{id:"SENSING_TOUCHINGCOLOR",selector:"touchingColor:",spec:"touching color %1?",inputs:["%c"],shape:"boolean",category:"sensing"},{id:"SENSING_COLORISTOUCHINGCOLOR",selector:"color:sees:",spec:"color %1 is touching %2?",inputs:["%c","%c"],shape:"boolean",category:"sensing"},{id:"SENSING_DISTANCETO",selector:"distanceTo:",spec:"distance to %1",inputs:["%m.spriteOrMouse"],shape:"reporter",category:"sensing"},{id:"SENSING_ANSWER",selector:"answer",spec:"answer",inputs:[],shape:"reporter",category:"sensing"},{id:"SENSING_KEYPRESSED",selector:"keyPressed:",spec:"key %1 pressed?",inputs:["%m.key"],shape:"boolean",category:"sensing"},{id:"SENSING_MOUSEDOWN",selector:"mousePressed",spec:"mouse down?",inputs:[],shape:"boolean",category:"sensing"},{id:"SENSING_MOUSEX",selector:"mouseX",spec:"mouse x",inputs:[],shape:"reporter",category:"sensing"},{id:"SENSING_MOUSEY",selector:"mouseY",spec:"mouse y",inputs:[],shape:"reporter",category:"sensing"},{id:"SENSING_SETDRAGMODE",spec:"set drag mode %1",inputs:["%m"],shape:"stack",category:"sensing"},{id:"SENSING_LOUDNESS",selector:"soundLevel",spec:"loudness",inputs:[],shape:"reporter",category:"sensing"},{id:"videoSensing.videoOn",selector:"senseVideoMotion",spec:"video %1 on %2",inputs:["%m.videoMotionType","%m.stageOrThis"],shape:"reporter",category:"video"},{id:"SENSING_TIMER",selector:"timer",spec:"timer",inputs:[],shape:"reporter",category:"sensing"},{id:"SENSING_OF",selector:"getAttribute:of:",spec:"%1 of %2",inputs:["%m.attribute","%m.spriteOrStage"],shape:"reporter",category:"sensing"},{id:"SENSING_CURRENT",selector:"timeAndDate",spec:"current %1",inputs:["%m.timeAndDate"],shape:"reporter",category:"sensing"},{id:"SENSING_DAYSSINCE2000",selector:"timestamp",spec:"days since 2000",inputs:[],shape:"reporter",category:"sensing"},{id:"SENSING_USERNAME",selector:"getUserName",spec:"username",inputs:[],shape:"reporter",category:"sensing"},{id:"OPERATORS_ADD",selector:"+",spec:"%1 + %2",inputs:["%n","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_SUBTRACT",selector:"-",spec:"%1 - %2",inputs:["%n","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_MULTIPLY",selector:"*",spec:"%1 * %2",inputs:["%n","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_DIVIDE",selector:"/",spec:"%1 / %2",inputs:["%n","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_RANDOM",selector:"randomFrom:to:",spec:"pick random %1 to %2",inputs:["%n","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_LT",selector:"<",spec:"%1 < %2",inputs:["%s","%s"],shape:"boolean",category:"operators"},{id:"OPERATORS_EQUALS",selector:"=",spec:"%1 = %2",inputs:["%s","%s"],shape:"boolean",category:"operators"},{id:"OPERATORS_GT",selector:">",spec:"%1 > %2",inputs:["%s","%s"],shape:"boolean",category:"operators"},{id:"OPERATORS_AND",selector:"&",spec:"%1 and %2",inputs:["%b","%b"],shape:"boolean",category:"operators"},{id:"OPERATORS_OR",selector:"|",spec:"%1 or %2",inputs:["%b","%b"],shape:"boolean",category:"operators"},{id:"OPERATORS_NOT",selector:"not",spec:"not %1",inputs:["%b"],shape:"boolean",category:"operators"},{id:"OPERATORS_JOIN",selector:"concatenate:with:",spec:"join %1 %2",inputs:["%s","%s"],shape:"reporter",category:"operators"},{id:"OPERATORS_LETTEROF",selector:"letter:of:",spec:"letter %1 of %2",inputs:["%n","%s"],shape:"reporter",category:"operators"},{id:"OPERATORS_LENGTH",selector:"stringLength:",spec:"length of %1",inputs:["%s"],shape:"reporter",category:"operators"},{id:"OPERATORS_MOD",selector:"%",spec:"%1 mod %2",inputs:["%n","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_ROUND",selector:"rounded",spec:"round %1",inputs:["%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_MATHOP",selector:"computeFunction:of:",spec:"%1 of %2",inputs:["%m.mathOp","%n"],shape:"reporter",category:"operators"},{id:"OPERATORS_CONTAINS",spec:"%1 contains %2?",inputs:["%s","%s"],shape:"boolean",category:"operators"},{id:"DATA_ITEMOFLIST",selector:"getLine:ofList:",spec:"item %1 of %2",inputs:["%d.listItem","%m.list"],shape:"reporter",category:"list"},{id:"DATA_ITEMNUMOFLIST",spec:"item # of %1 in %2",inputs:["%s","%m.list"],shape:"reporter",category:"list"},{id:"DATA_LENGTHOFLIST",selector:"lineCountOfList:",spec:"length of %1",inputs:["%m.list"],shape:"reporter",category:"list"},{id:"DATA_LISTCONTAINSITEM",selector:"list:contains:",spec:"%1 contains %2?",inputs:["%m.list","%s"],shape:"boolean",category:"list"},{id:"CONTROL_ELSE",spec:"else",inputs:[],shape:"celse",category:"control"},{id:"scratchblocks:end",spec:"end",inputs:[],shape:"cend",category:"control"},{id:"scratchblocks:ellipsis",spec:". . .",inputs:[],shape:"stack",category:"grey"},{id:"scratchblocks:addInput",spec:"%1 @addInput",inputs:["%n"],shape:"ring",category:"grey"},{id:"SENSING_USERID",spec:"user id",inputs:[],shape:"reporter",category:"obsolete"},{selector:"doIf",spec:"if %1",inputs:["%b"],shape:"c-block",category:"obsolete"},{selector:"doForeverIf",spec:"forever if %1",inputs:["%b"],shape:"c-block cap",category:"obsolete"},{selector:"doReturn",spec:"stop script",inputs:[],shape:"cap",category:"obsolete"},{selector:"stopAll",spec:"stop all",inputs:[],shape:"cap",category:"obsolete"},{selector:"lookLike:",spec:"switch to costume %1",inputs:["%m.costume"],shape:"stack",category:"obsolete"},{selector:"nextScene",spec:"next background",inputs:[],shape:"stack",category:"obsolete"},{selector:"startScene",spec:"switch to background %1",inputs:["%m.backdrop"],shape:"stack",category:"obsolete"},{selector:"backgroundIndex",spec:"background #",inputs:[],shape:"reporter",category:"obsolete"},{id:"SENSING_LOUD",selector:"isLoud",spec:"loud?",inputs:[],shape:"boolean",category:"obsolete"},{id:"faceSensing.goToPart",spec:"go to %1",inputs:["%m"],shape:"stack",category:"faceSensing"},{id:"faceSensing.pointInFaceTiltDirection",spec:"point in direction of face tilt",inputs:[],shape:"stack",category:"faceSensing"},{id:"faceSensing.setSizeToFaceSize",spec:"set size to face size",inputs:[],shape:"stack",category:"faceSensing"},{id:"faceSensing.whenTilted",spec:"when face tilts %1",inputs:["%m"],shape:"hat",category:"faceSensing"},{id:"faceSensing.whenSpriteTouchesPart",spec:"when this sprite touches a %1",inputs:["%m"],shape:"hat",category:"faceSensing"},{id:"faceSensing.whenFaceDetected",spec:"when a face is detected",inputs:[],shape:"hat",category:"faceSensing"},{id:"faceSensing.faceDetected",spec:"a face is detected?",inputs:[],shape:"boolean",category:"faceSensing"},{id:"faceSensing.faceTilt",spec:"face tilt",inputs:[],shape:"reporter",category:"faceSensing"},{id:"faceSensing.faceSize",spec:"face size",inputs:[],shape:"reporter",category:"faceSensing"},{id:"text2speech.speakAndWaitBlock",spec:"speak %1",inputs:["%s"],shape:"stack",category:"tts"},{id:"text2speech.setVoiceBlock",spec:"set voice to %1",inputs:["%m"],shape:"stack",category:"tts"},{id:"text2speech.setLanguageBlock",spec:"set language to %1",inputs:["%m"],shape:"stack",category:"tts"},{id:"translate.translateBlock",spec:"translate %1 to %2",inputs:["%s","%m"],shape:"reporter",category:"translate"},{id:"translate.viewerLanguage",spec:"language",shape:"reporter",category:"translate"},{id:"makeymakey.whenKeyPressed",spec:"when %1 key pressed",inputs:["%m"],shape:"hat",category:"makeymakey"},{id:"makeymakey.whenKeysPressedInOrder",spec:"when %1 pressed in order",inputs:["%m"],shape:"hat",category:"makeymakey"},{id:"microbit.whenButtonPressed",spec:"when %1 button pressed",inputs:["%m"],shape:"hat",category:"microbit"},{id:"microbit.isButtonPressed",spec:"%1 button pressed?",inputs:["%m"],shape:"boolean",category:"microbit"},{id:"microbit.whenGesture",spec:"when %1",inputs:["%m"],shape:"hat",category:"microbit"},{id:"microbit.displaySymbol",spec:"display %1",inputs:["%m"],shape:"stack",category:"microbit"},{id:"microbit.displayText",spec:"display text %1",inputs:["%s"],shape:"stack",category:"microbit"},{id:"microbit.clearDisplay",spec:"clear display",shape:"stack",category:"microbit"},{id:"microbit.whenTilted",spec:"when tilted %1",inputs:["%m"],shape:"hat",category:"microbit"},{id:"microbit.isTilted",spec:"tilted %1?",inputs:["%m"],shape:"boolean",category:"microbit"},{id:"microbit.tiltAngle",spec:"tilt angle %1",inputs:["%m"],shape:"reporter",category:"microbit"},{id:"microbit.whenPinConnected",spec:"when pin %1 connected",inputs:["%m"],shape:"hat",category:"microbit"},{id:"ev3.motorTurnClockwise",spec:"motor %1 turn this way for %2 seconds",inputs:["%m","%n"],shape:"stack",category:"ev3"},{id:"ev3.motorTurnCounterClockwise",spec:"motor %1 turn that way for %2 seconds",inputs:["%m","%n"],shape:"stack",category:"ev3"},{id:"ev3.motorSetPower",spec:"motor %1 set power %2%",inputs:["%m","%n"],shape:"stack",category:"ev3"},{id:"ev3.getMotorPosition",spec:"motor %1 position",inputs:["%m"],shape:"reporter",category:"ev3"},{id:"ev3.whenButtonPressed",spec:"when button %1 pressed",inputs:["%m"],shape:"hat",category:"ev3"},{id:"ev3.whenDistanceLessThan",spec:"when distance < %1",inputs:["%n"],shape:"hat",category:"ev3"},{id:"ev3.whenBrightnessLessThan",spec:"when brightness < %1",inputs:["%n"],shape:"hat",category:"ev3"},{id:"ev3.buttonPressed",spec:"button %1 pressed?",inputs:["%m"],shape:"boolean",category:"ev3"},{id:"ev3.getDistance",spec:"distance",shape:"reporter",category:"ev3"},{id:"ev3.getBrightness",spec:"brightness",shape:"reporter",category:"ev3"},{id:"ev3.beepNote",spec:"beep note %1 for %2 secs",inputs:["%d.note","%n"],shape:"stack",category:"ev3"},{id:"wedo2.motorOn",spec:"turn %1 on",inputs:["%m.motor"],shape:"stack",category:"wedo"},{id:"wedo2.motorOff",spec:"turn %1 off",inputs:["%m.motor"],shape:"stack",category:"wedo"},{id:"wedo2.startMotorPower",spec:"set %1 power to %2",inputs:["%m.motor","%n"],shape:"stack",category:"wedo"},{id:"wedo2.setMotorDirection",spec:"set %1 direction to %2",inputs:["%m.motor2","%m.motorDirection"],shape:"stack",category:"wedo"},{id:"wedo2.whenDistance",spec:"when distance %1 %2",inputs:["%m.lessMore","%n"],shape:"hat",category:"wedo"},{id:"wedo2.getDistance",spec:"distance",inputs:[],shape:"reporter",category:"wedo"},{id:"wedo2.motorOnFor",spec:"turn %1 on for %2 seconds",inputs:["%m.motor","%n"],shape:"stack",category:"wedo"},{id:"wedo2.setLightHue",spec:"set light color to %1",inputs:["%n"],shape:"stack",category:"wedo"},{id:"wedo2.playNoteFor",spec:"play note %1 for %2 seconds",inputs:["%n","%n"],shape:"stack",category:"wedo"},{id:"wedo2.whenTilted",spec:"when tilted %1",inputs:["%m.xxx"],shape:"hat",category:"wedo"},{id:"wedo2.isTilted",spec:"tilted %1?",inputs:["%m"],shape:"boolean",category:"wedo"},{id:"wedo2.getTiltAngle",spec:"tilt angle %1",inputs:["%m.xxx"],shape:"reporter",category:"wedo"},{id:"gdxfor.whenGesture",spec:"when %1",inputs:["%m"],shape:"hat",category:"gdxfor"},{id:"gdxfor.whenForcePushedOrPulled",spec:"when force sensor %1",inputs:["%m"],shape:"hat",category:"gdxfor"},{id:"gdxfor.getForce",spec:"force",shape:"reporter",category:"gdxfor"},{id:"gdxfor.whenTilted",spec:"when tilted %1",inputs:["%m"],shape:"hat",category:"gdxfor"},{id:"gdxfor.isTilted",spec:"tilted %1?",inputs:["%m"],shape:"boolean",category:"gdxfor"},{id:"gdxfor.getTilt",spec:"tilt angle %1",inputs:["%m"],shape:"reporter",category:"gdxfor"},{id:"gdxfor.isFreeFalling",spec:"falling?",shape:"boolean",category:"gdxfor"},{id:"gdxfor.getSpin",spec:"spin speed %1",inputs:["%m"],shape:"reporter",category:"gdxfor"},{id:"gdxfor.getAcceleration",spec:"acceleration %1",inputs:["%m"],shape:"reporter",category:"gdxfor"},{id:"boost.motorOnFor",spec:"turn motor %1 for %2 seconds",inputs:["%m","%n"],shape:"stack",category:"boost"},{id:"boost.motorOnForRotation",spec:"turn motor %1 for %2 rotations",inputs:["%m","%n"],shape:"stack",category:"boost"},{id:"boost.motorOn",spec:"turn motor %1 on",inputs:["%m"],shape:"stack",category:"boost"},{id:"boost.motorOff",spec:"turn motor %1 off",inputs:["%m"],shape:"stack",category:"boost"},{id:"boost.setMotorPower",spec:"set motor %1 speed to %2%",inputs:["%m","%n"],shape:"stack",category:"boost"},{id:"boost.setMotorDirection",spec:"set motor %1 direction %2",inputs:["%m","%m"],shape:"stack",category:"boost"},{id:"boost.getMotorPosition",spec:"motor %1 position",inputs:["%m"],shape:"reporter",category:"boost"},{id:"boost.whenColor",spec:"when %1 brick seen",inputs:["%m"],shape:"hat",category:"boost"},{id:"boost.seeingColor",spec:"seeing %1 brick?",inputs:["%m"],shape:"boolean",category:"boost"},{id:"boost.whenTilted",spec:"when tilted %1",inputs:["%m"],shape:"hat",category:"boost"},{id:"boost.getTiltAngle",spec:"tilt angle %1",inputs:["%m"],shape:"reporter",category:"boost"},{id:"boost.setLightHue",spec:"set light color to %1",inputs:["%n"],shape:"stack",category:"boost"}].map((t=>{if(!t.id){if(!t.selector)throw Error("Missing ID: "+t.spec);t.id="sb2:"+t.selector}if(!t.spec)throw Error("Missing spec: "+t.id);const e={id:t.id,spec:t.spec,parts:t.spec.split(p).filter((t=>t)),selector:t.selector||"sb3:"+t.id,inputs:null==t.inputs?[]:t.inputs,shape:t.shape,category:t.category,hasLoopArrow:!!t.hasLoopArrow};if(m[e.id])throw Error("Duplicate ID: "+e.id);return m[e.id]=e,e})),A={"@greenFlag":"⚑","@turnRight":"↻","@turnLeft":"↺","@addInput":"▸","@delInput":"◂"},k={};function w(t){Object.keys(t).forEach((e=>function(t,e){const s=e.blocksByHash={};Object.keys(e.commands).forEach((t=>{const i=e.commands[t],o=m[t],a=f(i);s[a]||(s[a]=[]),s[a].push(o);const r=h.exec(o.spec);if(r){const t=r[0],e=a.replace(f(t),A[t]);s[e]||(s[e]=[]),s[e].push(o)}})),e.nativeAliases={},Object.keys(e.aliases).forEach((t=>{const i=e.aliases[t],o=m[i];if(void 0===o)throw Error(`Invalid alias '${i}'`);const a=f(t);s[a]||(s[a]=[]),s[a].push(o),e.nativeAliases[i]||(e.nativeAliases[i]=[]),e.nativeAliases[i].push(t)})),Object.keys(e.renamedBlocks||{}).forEach((t=>{const s=e.renamedBlocks[t];if(!m[s])throw Error("Unknown ID: "+s);const i=m[s],o=f(t);v.blocksByHash[o]||(v.blocksByHash[o]=[]),v.blocksByHash[o].push(i)})),e.nativeDropdowns={},Object.keys(e.dropdowns).forEach((t=>{const s=e.dropdowns[t].value,i=e.dropdowns[t].parents;e.nativeDropdowns[s]||(e.nativeDropdowns[s]=[]),e.nativeDropdowns[s].push({id:t,parents:i})})),e.code=t,k[t]=e}(e,t[e])))}const v={aliases:{"turn ccw %1 degrees":"MOTION_TURNLEFT","turn left %1 degrees":"MOTION_TURNLEFT","turn cw %1 degrees":"MOTION_TURNRIGHT","turn right %1 degrees":"MOTION_TURNRIGHT","when flag clicked":"EVENT_WHENFLAGCLICKED","when gf clicked":"EVENT_WHENFLAGCLICKED","when green flag clicked":"EVENT_WHENFLAGCLICKED"},renamedBlocks:{"say %1 for %2 secs":"LOOKS_SAYFORSECS","think %1 for %2 secs":"LOOKS_THINKFORSECS","play sound %1":"SOUND_PLAY","wait %1 secs":"CONTROL_WAIT",clear:"pen.clear"},definePrefix:["define"],defineSuffix:[],ignorelt:["when distance"],math:["abs","floor","ceiling","sqrt","sin","cos","tan","asin","acos","atan","ln","log","e ^","10 ^"],name:"English",faceParts:["nose","mouth","left eye","right eye","between eyes","left ear","right ear","top of head"],soundEffects:["pitch","pan left/right"],microbitWhen:["moved","shaken","jumped"],osis:["other scripts in sprite","other scripts in stage"],dropdowns:{},commands:{}};function y(t,e){if(!m[t])throw Error("Unknown ID: "+t);m[t].accepts=e}function E(t,e,s){y(t,((t,e,i)=>s(e,i))),y(e,((t,e,i)=>!s(e,i)))}function S(t,e,s){const i=[];for(const t of e){if(!t)continue;const e=t.shape||"";(e.endsWith("dropdown")||"dropdown"===e)&&null!=t.value&&i.push(t.value)}if(!i.length)return t;const o=new Map;for(const t of s)for(const e of i)if(t.nativeDropdowns&&Object.prototype.hasOwnProperty.call(t.nativeDropdowns,e)){const s=t.nativeDropdowns[e];s&&s.length&&(o.has(e)||o.set(e,[]),o.get(e).push(...s))}if(!o.size)return t;const a=t.filter((t=>{const e=[t.id,t.selector&&t.selector.replace(/^sb3:/,""),t.selector].filter(Boolean);for(const t of o.values())for(const s of t){if(!s)continue;if((Array.isArray(s.parents)?s.parents:[]).some((t=>e.includes(t))))return!0;if(s.id&&e.includes(s.id))return!0}return!1}));return a.length?a:t}function O(t){const e=[];for(const s of t.children){if(!s.isLabel)return;e.push(s.value)}return e.join(" ")}function T(t,e){if(!t)throw Error("Assertion failed! "+(e||""))}V.forEach((t=>{v.commands[t.id]=t.spec})),(i.forEach((t=>{if(!t.parents)if(t.id.startsWith("music.drum"))t.parents=["music.playDrumForBeats"];else if(t.id.startsWith("music.instrument"))t.parents=["music.setInstrument"];else{const e=t.id.lastIndexOf("_"),s=-1!==e?t.id.substring(0,e):null;t.parents=s?[s]:null}})),i).forEach((t=>{v.dropdowns[t.id]={value:t.value,parents:t.parents||[]}})),v.dropdowns={...v.dropdowns,...function(t){const e={};return["left up right","right up left","left right","right left","up down","down up","up right down left","up left down right","up up down down left right left right"].forEach(((s,i)=>{e["makeymakey.sequence."+i]={value:s.replaceAll("left",t["makeymakey.leftArrowShort"].value).replaceAll("right",t["makeymakey.rightArrowShort"].value).replaceAll("up",t["makeymakey.upArrowShort"].value).replaceAll("down",t["makeymakey.downArrowShort"].value),parents:["makeymakey.whenKeysPressedInOrder"]}})),e}(v.dropdowns),"translate.language.am":{value:"Amharic",parents:["translate.translateBlock"]},"translate.language.ar":{value:"Arabic",parents:["translate.translateBlock"]},"translate.language.az":{value:"Azerbaijani",parents:["translate.translateBlock"]},"translate.language.eu":{value:"Basque",parents:["translate.translateBlock"]},"translate.language.bg":{value:"Bulgarian",parents:["translate.translateBlock"]},"translate.language.ca":{value:"Catalan",parents:["translate.translateBlock"]},"translate.language.zh-cn":{value:"Chinese (Simplified)",parents:["translate.translateBlock"]},"translate.language.zh-tw":{value:"Chinese (Traditional)",parents:["translate.translateBlock"]},"translate.language.hr":{value:"Croatian",parents:["translate.translateBlock"]},"translate.language.cs":{value:"Czech",parents:["translate.translateBlock"]},"translate.language.da":{value:"Danish",parents:["translate.translateBlock"]},"translate.language.nl":{value:"Dutch",parents:["translate.translateBlock"]},"translate.language.en":{value:"English",parents:["translate.translateBlock"]},"translate.language.et":{value:"Estonian",parents:["translate.translateBlock"]},"translate.language.fi":{value:"Finnish",parents:["translate.translateBlock"]},"translate.language.fr":{value:"French",parents:["translate.translateBlock"]},"translate.language.gl":{value:"Galician",parents:["translate.translateBlock"]},"translate.language.de":{value:"German",parents:["translate.translateBlock"]},"translate.language.el":{value:"Greek",parents:["translate.translateBlock"]},"translate.language.he":{value:"Hebrew",parents:["translate.translateBlock"]},"translate.language.hu":{value:"Hungarian",parents:["translate.translateBlock"]},"translate.language.is":{value:"Icelandic",parents:["translate.translateBlock"]},"translate.language.id":{value:"Indonesian",parents:["translate.translateBlock"]},"translate.language.ga":{value:"Irish",parents:["translate.translateBlock"]},"translate.language.it":{value:"Italian",parents:["translate.translateBlock"]},"translate.language.ja":{value:"Japanese",parents:["translate.translateBlock"]},"translate.language.ko":{value:"Korean",parents:["translate.translateBlock"]},"translate.language.lv":{value:"Latvian",parents:["translate.translateBlock"]},"translate.language.lt":{value:"Lithuanian",parents:["translate.translateBlock"]},"translate.language.mi":{value:"Maori",parents:["translate.translateBlock"]},"translate.language.nb":{value:"Norwegian",parents:["translate.translateBlock"]},"translate.language.fa":{value:"Persian",parents:["translate.translateBlock"]},"translate.language.pl":{value:"Polish",parents:["translate.translateBlock"]},"translate.language.pt":{value:"Portuguese",parents:["translate.translateBlock"]},"translate.language.ro":{value:"Romanian",parents:["translate.translateBlock"]},"translate.language.ru":{value:"Russian",parents:["translate.translateBlock"]},"translate.language.gd":{value:"Scots Gaelic",parents:["translate.translateBlock"]},"translate.language.sr":{value:"Serbian",parents:["translate.translateBlock"]},"translate.language.sk":{value:"Slovak",parents:["translate.translateBlock"]},"translate.language.sl":{value:"Slovenian",parents:["translate.translateBlock"]},"translate.language.es":{value:"Spanish",parents:["translate.translateBlock"]},"translate.language.sv":{value:"Swedish",parents:["translate.translateBlock"]},"translate.language.th":{value:"Thai",parents:["translate.translateBlock"]},"translate.language.tr":{value:"Turkish",parents:["translate.translateBlock"]},"translate.language.uk":{value:"Ukrainian",parents:["translate.translateBlock"]},"translate.language.vi":{value:"Vietnamese",parents:["translate.translateBlock"]},"translate.language.cy":{value:"Welsh",parents:["translate.translateBlock"]},"translate.language.zu":{value:"Zulu",parents:["translate.translateBlock"]},"text2speech.language.ar":{value:"Arabic",parents:["text2speech.setLanguageBlock"]},"text2speech.language.zh-cn":{value:"Chinese (Mandarin)",parents:["text2speech.setLanguageBlock"]},"text2speech.language.da":{value:"Danish",parents:["text2speech.setLanguageBlock"]},"text2speech.language.nl":{value:"Dutch",parents:["text2speech.setLanguageBlock"]},"text2speech.language.en":{value:"English",parents:["text2speech.setLanguageBlock"]},"text2speech.language.fr":{value:"French",parents:["text2speech.setLanguageBlock"]},"text2speech.language.de":{value:"German",parents:["text2speech.setLanguageBlock"]},"text2speech.language.hi":{value:"Hindi",parents:["text2speech.setLanguageBlock"]},"text2speech.language.is":{value:"Icelandic",parents:["text2speech.setLanguageBlock"]},"text2speech.language.it":{value:"Italian",parents:["text2speech.setLanguageBlock"]},"text2speech.language.ja":{value:"Japanese",parents:["text2speech.setLanguageBlock"]},"text2speech.language.ko":{value:"Korean",parents:["text2speech.setLanguageBlock"]},"text2speech.language.nb":{value:"Norwegian",parents:["text2speech.setLanguageBlock"]},"text2speech.language.pl":{value:"Polish",parents:["text2speech.setLanguageBlock"]},"text2speech.language.pt-br":{value:"Portuguese (Brazilian)",parents:["text2speech.setLanguageBlock"]},"text2speech.language.pt":{value:"Portuguese",parents:["text2speech.setLanguageBlock"]},"text2speech.language.ro":{value:"Romanian",parents:["text2speech.setLanguageBlock"]},"text2speech.language.ru":{value:"Russian",parents:["text2speech.setLanguageBlock"]},"text2speech.language.es":{value:"Spanish",parents:["text2speech.setLanguageBlock"]},"text2speech.language.es-419":{value:"Spanish (Latin American)",parents:["text2speech.setLanguageBlock"]},"text2speech.language.sv":{value:"Swedish",parents:["text2speech.setLanguageBlock"]},"text2speech.language.tr":{value:"Turkish",parents:["text2speech.setLanguageBlock"]},"text2speech.language.cy":{value:"Welsh",parents:["text2speech.setLanguageBlock"]}},w({en:v}),E("OPERATORS_MATHOP","SENSING_OF",((t,e)=>{const s=t[0];if(!s.isInput)return;const i=s.value;return e.math.includes(i)})),E("SOUND_CHANGEEFFECTBY","LOOKS_CHANGEEFFECTBY",((t,e)=>{for(const s of t)if("dropdown"===s.shape){const t=s.value;for(const s of e.soundEffects)if(b(s)===b(t))return!0}return!1})),E("SOUND_SETEFFECTO","LOOKS_SETEFFECTTO",((t,e)=>{for(const s of t)if("dropdown"===s.shape){const t=s.value;for(const s of e.soundEffects)if(b(s)===b(t))return!0}return!1})),E("DATA_LENGTHOFLIST","OPERATORS_LENGTH",((t,e)=>{const s=t[t.length-1];if(s.isInput)return"dropdown"===s.shape})),E("DATA_LISTCONTAINSITEM","OPERATORS_CONTAINS",((t,e)=>{const s=t[0];if(s.isInput)return"dropdown"===s.shape})),E("pen.setColor","pen.setHue",((t,e)=>{const s=t[t.length-1];return s.isInput&&s.isColor||s.isBlock})),E("faceSensing.goToPart","MOTION_GOTO",((t,e)=>{for(const s of t)if("dropdown"===s.shape){const t=s.value;for(const s of e.faceParts)if(b(s)===b(t))return!0}return!1})),E("microbit.whenGesture","gdxfor.whenGesture",((t,e)=>{for(const s of t)if("dropdown"===s.shape){const t=s.value;for(const s of e.microbitWhen)if(b(s)===b(t))return!0}return!1})),E("ev3.buttonPressed","microbit.isButtonPressed",((t,e)=>{for(const e of t)if("dropdown"===e.shape)switch(b(e.value)){case"1":case"2":case"3":case"4":return!0}return!1})),function(t,e){if(!m[t])throw Error("Unknown ID: "+t);m[t].specialCase=e}("CONTROL_STOP",((t,e,s)=>{const i=e[e.length-1];if(!i.isInput)return;const o=i.value;return s.osis.includes(o)?{...m.CONTROL_STOP,shape:"stack"}:void 0}));class L{constructor(t,e){this.value=t,this.cls=e||"",this.el=null,this.height=12,this.metrics=null,this.x=0}get isLabel(){return!0}stringify(){return"<"===this.value||">"===this.value?this.value:this.value.replace(/([<>[\](){}\\])/g,"\\$1").replace(/:{2,}/g,(t=>":"+"\\:".repeat(t.length-1)))}}class R{constructor(t){this.name=t,this.isArrow="loopArrow"===t,T(R.icons[t],"no info for icon "+t)}get isIcon(){return!0}static get icons(){return{greenFlag:!0,stopSign:!0,turnLeft:!0,turnRight:!0,loopArrow:!0,addInput:!0,delInput:!0,list:!0}}stringify(){return A["@"+this.name]||""}}class C{constructor(t){const e=Array.isArray(t)?t:[];this.rows=e.map((t=>Array.isArray(t)?t.slice():[t]));const s=this.rows.reduce(((t,e)=>Math.max(t,e.length)),0);for(let t=0;t<this.rows.length;t++){const e=this.rows[t];for(;e.length<s;)e.push(!1)}}get isMatrix(){return!0}stringify(){return`{${this.rows.map((t=>t.map((t=>t?"1":"0")).join(""))).join(",")}}`}translate(){}}class N{constructor(t,e){this.shape=t,this.value=e,this.isRound="number"===t||"number-dropdown"===t,this.isBoolean="boolean"===t,this.isStack="stack"===t,this.isInset="boolean"===t||"stack"===t||"reporter"===t,this.isColor="color"===t,this.isMatrix="matrix"===t,this.hasArrow="dropdown"===t||"number-dropdown"===t,this.isDarker="boolean"===t||"stack"===t||"dropdown"===t,this.isSquare="string"===t||"color"===t||"dropdown"===t;const s=e&&"object"==typeof e&&e.isMatrix;this.hasLabel=!(this.isColor||this.isInset||this.isMatrix||s),this.label=this.hasLabel?new L(e,"literal-"+this.shape):null,this.x=0}get isInput(){return!0}stringify(t=""){if(this.isColor)return T("#"===this.value[0]),`[${this.value}]`;if(this.value&&"object"==typeof this.value&&this.value.isMatrix){const e=this.value.stringify(),s=Math.max(0,function(t){if(!t)return 0;t+="";let e=0;const s=/[\u2E80-\u2EFF\u2F00-\u2FDF\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF\uFF00-\uFFEF]/u;for(const i of t)e+=s.test(i)?2:1;return e}(t)+2),i=" ".repeat(s);return`({${e.slice(1,-1).split(",").map(((t,e)=>0===e?t:`\n${i}${t}`)).join(",")}} v)`}let e=this.value?this.value+"":"";return this.isSquare&&(e=e.replace(/([\]\\])/g,"\\$1")),this.isRound&&(e=e.replace(/([()[<])/g,"\\$1")),e=e.replace(/ v$/," \\v"),this.hasArrow?e+=" v":d.test(e)&&(e="\\"+e),this.isRound?`(${e})`:this.isSquare?`[${e}]`:this.isBoolean?"<>":this.isStack?"{}":e}translate(t){if(this.hasArrow){if(this.value&&"object"==typeof this.value&&this.value.isMatrix)return;this.menu&&(this.value=t.dropdowns[this.menu].value),this.label=new L(this.value,"literal-"+this.shape)}}}class M{constructor(t,e,s){T(t),this.info={...t},this.children=e,this.comment=s||null,this.diff=null,this.blockPath=null;const i=this.info.shape;this.isHat="hat"===i||"cat"===i||"define-hat"===i,this.hasPuzzle="stack"===i||"hat"===i||"cat"===i||"c-block"===i||"define-hat"===i,this.isFinal=/cap/.test(i),this.isCommand="stack"===i||"cap"===i||/block/.test(i),this.isOutline="outline"===i,this.isReporter="reporter"===i,this.isBoolean="boolean"===i,this.isRing="ring"===i,this.hasScript=/block/.test(i),this.isElse="celse"===i,this.isEnd="cend"===i}get isBlock(){return!0}stringify(t){let e=null,s=!1,i="",o=this.children.map(((t,o,a)=>{if(t.isIcon&&(s=!0),e||t.isLabel||t.isIcon||(e=t),t.isScript)return i="",`\n${function(t){return t.split("\n").map((t=>" "+t)).join("\n")}(t.stringify()).trimEnd()}\n`;const r=t.isInput?t.stringify(i):t.stringify(),n=r.trim();if(r.includes("\n")){const t=r.split("\n");i=t[t.length-1].trim()+" "}else i+=n+" ";let l=a[o+1];l=l&&"loopArrow"===l.name?a[o+2]:l;return n+(!(l&&l.isScript)?" ":"")})).join("").trim();if("reporter"===this.info.shape&&d.test(o))return`(\\${o})`;const a=this.info.language;if(s&&a&&this.info.selector){const t=a.nativeAliases[this.info.id];if(t&&t.length){let s=t[0];return l.test(s)&&e&&(s=s.replace(l,e.stringify())),s}}let r=t||"";return(!1===this.info.categoryIsDefault||"custom-arg"===this.info.category&&(this.isReporter||this.isBoolean)||"custom"===this.info.category&&"stack"===this.info.shape)&&(r&&(r+=" "),this.info.isReset&&"obsolete"===this.info.category?r+="reset":r+=this.info.category),!1===this.info.shapeIsDefault&&(r&&(r+=" "),r+=this.info.shape),r&&(o+=" :: "+r),this.hasScript?o+"\n"+(Object.keys(a.aliases).find((t=>"scratchblocks:end"===a.aliases[t]))||"end"):"reporter"===this.info.shape?`(${o})`:"boolean"===this.info.shape?`<${o}>`:o}translate(t,e){if(!t)throw Error("Missing language");const s=this.info.id;if(!s)return;if("PROCEDURES_DEFINITION"===s){const e=this.children.find((t=>t.isOutline));this.children=[];for(const e of t.definePrefix)this.children.push(new L(e));this.children.push(e);for(const e of t.defineSuffix)this.children.push(new L(e));return}if("PROCEDURES_CALL"===s)return void this.children.forEach((e=>{e.isLabel||e.isIcon||e.translate(t)}));const i=this.info.language.commands[s],o=t.commands[s];if(!o)return;const a=g(o),n=this.children.filter((t=>!t.isLabel&&!t.isIcon));e||n.forEach((e=>e.translate(t)));const l=g(i).parts.map((t=>u(t))).filter((t=>t));let c=0;const p=l.map((t=>(c=Math.max(c,t),n[t-1]))),d=n.slice(c);this.children=a.parts.map((t=>{if(!(t=t.trim()))return;const e=u(t);return e?p[e-1]:h.test(t)?new R(t.slice(1)):new L(t)})).filter((t=>t)),d.forEach(((e,s)=>{1===s&&"CONTROL_IF"===this.info.id&&this.children.push(new L(t.commands.CONTROL_ELSE)),this.children.push(e)})),this.info.language=t,this.info.isRTL=r.includes(t.code),this.info.categoryIsDefault=!0}}class B{constructor(t,e){this.label=new L(t,"comment-label"),this.width=null,this.hasBlock=e}get isComment(){return!0}stringify(){return"// "+this.label.value.trim()}}class x{constructor(t){T(t),this.child=t,t.isBlock?(this.shape=t.info.shape,this.info=t.info):this.shape="stack"}get isGlow(){return!0}stringify(){if(this.child.isBlock)return this.child.stringify("+");return this.child.stringify().split("\n").map((t=>"+ "+t)).join("\n")}translate(t){this.child.translate(t)}}class I{constructor(t){this.blocks=t,this.isEmpty=!t.length,this.isFinal=!this.isEmpty&&t[t.length-1].isFinal,this.scriptIndex=null}get isScript(){return!0}stringify(){return this.blocks.map((t=>{let e=t.stringify();if(t.comment)if(t.isBlock&&t.hasScript){const s=" "+t.comment.stringify(),i=e.indexOf("\n");-1!==i?e=e.slice(0,i)+s+e.slice(i):e+=s}else e+=" "+t.comment.stringify();return e})).join("\n")}translate(t){this.blocks.forEach((e=>e.translate&&e.translate(t)))}}class P{constructor(t){this.scripts=t,this.blockMap=new Map}stringify(){return this.scripts.map((t=>t.stringify())).join("\n\n")}translate(t){this.scripts.forEach((e=>e.translate(t)))}getBlockByPath(t){return this.blockMap.get(t)||null}}function D(t,e,s){let i=[];Array.isArray(e[e.length-1])&&(i=e.pop());const n=[];for(const t of e)t.isLabel?n.push(t.value):t.isIcon?n.push("@"+t.name):n.push("_");const l=n.join(" "),c=t.hash=b(l);let p,u;if(!i.includes("reset")){const a=function(t,e,s,i,a){for(const r of i)if(Object.prototype.hasOwnProperty.call(r.blocksByHash,t)){let n=r.blocksByHash[t];if(a&&a.length){const t=new Set(n.map((t=>t.category)).filter(Boolean));for(const s of a)if(s&&t.has(s)){const t=n.filter((t=>t.category===s));if(1===t.length){const s=t[0];if(!("reporter"===e.shape&&"reporter"!==s.shape&&"ring"!==s.shape||"boolean"===e.shape&&"boolean"!==s.shape))return{type:s,lang:r}}else if(t.length>1){n=t;break}}const s=a.find((t=>o.includes(t)));if(s){const t=n.filter((t=>t.category===s));if(t.length){if(1===t.length)return{type:t[0],lang:r};n=t}}}n.length>1&&(n=S(n,s,i));for(let t of n)if(("reporter"!==e.shape||"reporter"===t.shape||"ring"===t.shape)&&("boolean"!==e.shape||"boolean"===t.shape)&&(!(n.length>1&&t.accepts)||t.accepts(e,s,r)))return t.specialCase&&(t=t.specialCase(e,s,r)||t),{type:t,lang:r}}}(c,t,e,s,i);if(a)p=a.lang,u=a.type,t.language=p,t.isRTL=r.includes(p.code),("ring"===u.shape?"reporter"===t.shape:"stack"===t.shape)&&(t.shape=u.shape),t.category=u.category,t.categoryIsDefault=!0,u.selector&&(t.selector=u.selector),u.id&&(t.id=u.id),t.hasLoopArrow=u.hasLoopArrow,". . ."===u.spec&&(e=[new L(". . .")]);else for(const i of s){if(!F(e,i))continue;t.shape="define-hat",t.category="custom";const o=e.splice(i.definePrefix.length,e.length-i.defineSuffix.length).map((t=>{if(t.isInput&&t.isBoolean)t=D({shape:"boolean",argument:"boolean",category:"custom-arg"},[new L("")],s);else if(!t.isInput||"string"!==t.shape&&"number"!==t.shape)(t.isReporter||t.isBoolean)&&(t.info.categoryIsDefault&&(t.info.category="custom-arg"),t.info.argument=t.isBoolean?"boolean":"number");else{const e=t.value.split(/ +/g).map((t=>new L(t)));t=D({shape:"reporter",argument:"string"===t.shape?"string":"number",category:"custom-arg"},e,s)}return t})),a=new M({shape:"outline",category:"custom",categoryIsDefault:!0,hasLoopArrow:!1},o);e.splice(i.definePrefix.length,0,a);break}}!function(t,e){for(const s of e)d.test(s)?(t.color=s,t.category="",t.categoryIsDefault=!1):o.includes(s)?(t.category=s,t.categoryIsDefault=!1):a.includes(s)?(t.shape=s,t.shapeIsDefault=!1):"loop"===s?t.hasLoopArrow=!0:"+"===s||"-"===s?t.diff=s:"reset"===s&&(t.categoryIsDefault=!1,t.isReset=!0)}(t,i),e.forEach((e=>{e.hasArrow&&(e.menu=function(t,e,s){for(const i of s)if(Object.prototype.hasOwnProperty.call(i.nativeDropdowns,t)){const s=i.nativeDropdowns[t];for(const{id:t,parents:i}of s)if(i.includes(e))return t}}(e.value,t.id,s))})),t.hasLoopArrow&&e.push(new R("loopArrow"));const g=new M(t,e);return u&&h.test(u.spec)&&g.translate(p,!0),"+"===t.diff?new x(g):(g.diff=t.diff,g)}function F(t,e){if(t.length<e.definePrefix.length)return!1;if(t.length<e.defineSuffix.length)return!1;for(let s=0;s<e.definePrefix.length;s++){const i=e.definePrefix[s],o=t[s];if(!o.isLabel||b(o.value)!==b(i))return!1}for(let s=1;s<=e.defineSuffix.length;s++){const i=e.defineSuffix[e.defineSuffix.length-s],o=t[t.length-s];if(!o.isLabel||b(o.value)!==b(i))return!1}return!0}function _(t,e){let s,i=t[0],o=0;function a(){i=t[++o]}function r(){return t[o+1]}function n(){for(let e=o+1;e<t.length;e++)if(" "!==t[e])return t[e]}let l=[];function c(t,s){const i=s.filter((t=>!t.isLabel)).length;return D({shape:t,category:"reporter"!==t||i?"obsolete":"variables",categoryIsDefault:!0,hasLoopArrow:!1},s,e)}function h(t,e){return new N(t,e)}function p(t){const e=[];let s;for(;i&&"\n"!==i;){if(("<"===i||">"===i)&&">"===t&&1===e.length&&!e[e.length-1].isLabel){const t=n();if("["===t||"("===t||"<"===t||"{"===t){s=null,e.push(new L(i)),a();continue}}if(i===t)break;if("/"===i&&"/"===r()&&!t)break;switch(i){case"[":s=null,e.push(u());break;case"(":s=null,e.push(f());break;case"<":s=null,e.push(b());break;case"{":s=null,e.push(m());break;case" ":case"\t":a(),s=null;break;case"◂":case"▸":e.push(V()),s=null;break;case"@":{a();let t="";for(;i&&/[a-zA-Z]/.test(i);)t+=i,a();"cloud"===t?e.push(new L("☁")):e.push(Object.prototype.hasOwnProperty.call(R.icons,t)?new R(t):new L("@"+t)),s=null;break}case"\\":a();case":":if(":"===i&&":"===r())return e.push(A(t)),e;default:s||e.push(s=new L("")),s.value+=i,a()}}return e}function u(){a();let t="",e=!1;const s="\\"===i;for(;i&&"]"!==i&&"\n"!==i;){if("\\"===i){if(a(),"v"===i&&(e=!0),!i)break}else e=!1;t+=i,a()}return"]"===i&&a(),!s&&d.test(t)?new N("color",t):!e&&/ v$/.test(t)?h("dropdown",t.slice(0,t.length-2)):new N("string",t)}function g(t){const e=p(t);if(i&&"\n"===i&&(s=!0,a()),0!==e.length){if(1===e.length){const t=e[0];if(t.isBlock&&(t.isReporter||t.isBoolean||t.isRing))return t}return c("stack",e)}}function f(){a();const e="\\"===i;if("{"===i){const e=o,s=i;let r=1,n="";for(a();i&&r>0;){if("{"===i)r++;else if("}"===i&&(r--,0===r))break;n+=i,a()}if("}"===i&&0===r){a();let e=0;for(;e<t.length&&" "===t[o+e];)e++;if(o+e<t.length&&"v"===t[o+e]&&o+e+1<t.length&&")"===t[o+e+1]){o+=e,i=t[o],a(),a();const s=[];let r="";for(let t=0;t<n.length;t++){const e=n[t];if("\n"!==e&&" "!==e&&"\t"!==e)if(","===e){if(r.trim()){const t=r.trim().split("").map((t=>"1"===t));s.push(t),r=""}}else r+=e}if(r.trim()){const t=r.trim().split("").map((t=>"1"===t));s.push(t)}const l=new C(s);return new N("number-dropdown",l,null)}}o=e,i=s}if(" "===i&&(a(),"v"===i&&")"===r()))return a(),a(),new N("number-dropdown","");const s=p(")");if(i&&")"===i&&a(),0===s.length)return new N("number","");if(1===s.length&&s[0].isLabel){const t=s[0].value;if(/^[0-9e.-]*$/.test(t))return new N("number",t);if(!e&&d.test(t))return new N("color",t)}if(s.length>1&&s.every((t=>t.isLabel))){if("v"===s[s.length-1].value){s.pop();return h("number-dropdown",s.map((t=>t.value)).join(" "))}}const n=c("reporter",s);if(n.info&&"ring"===n.info.shape){const t=n.children[0];t&&t.isInput&&"number"===t.shape&&""===t.value?n.children[0]=new N("reporter"):(t&&t.isScript&&t.isEmpty||t&&t.isBlock&&!t.children.length)&&(n.children[0]=new N("stack"))}return n}function b(){a();const t=p(">");return i&&">"===i&&a(),0===t.length?new N("boolean"):c("boolean",t)}function m(){a(),s=!1;const t=H((function(){for(;i&&"}"!==i;){const t=g("}");if(t)return t}}));let e=[];return t.forEach((t=>{e=e.concat(t.blocks)})),"}"===i&&a(),s?new I(e):(function(t){if(!t)throw Error("Assertion failed! ")}(e.length<=1),e.length?e[0]:c("stack",[]))}function V(){const t=i;switch(a(),t){case"▸":return new R("addInput");case"◂":return new R("delInput");default:return}}function A(t){a(),a();const e=[];let s="";for(;i&&"\n"!==i&&i!==t;){if(" "===i)s&&(e.push(s),s="");else{if("/"===i&&"/"===r())break;s+=i}a()}return s&&e.push(s),e}function k(){let t;"+"!==i&&"-"!==i||(t=i,a());const e=g();if("/"===i&&"/"===r()){const t=function(t){a(),a();let e="";for(;i&&"\n"!==i&&i!==t;)e+=i,a();return i&&"\n"===i&&a(),new B(e,!0)}();if(t.hasBlock=e&&e.children.length,!t.hasBlock)return t;e.comment=t}return e&&(e.diff=t),e}return e.map((t=>{l=l.concat(t.define)})),()=>{if(!i)return;return k()||"NL"}}function H(t){let e=t();function s(){e=t()}function i(){const t=e;if(s(),t.hasScript)for(;;){const i=o();if(t.children.push(new I(i)),!e||!e.isElse){e&&e.isEnd&&s();break}for(const s of e.children)t.children.push(s);s()}return t}function o(){const t=[];for(;e;){if("NL"===e){s();continue}if(!e.isCommand)return t;const o=i(),a="+"===o.diff;if(a&&(o.diff=null),a){const e=t[t.length-1];let s=[];e&&e.isGlow&&(t.pop(),s=e.child.isScript?e.child.blocks:[e.child]),s.push(o),t.push(new x(new I(s)))}else t.push(o)}return t}return function(){for(;"NL"===e;)s();const t=[];for(;e;){let o=[];for(;e&&"NL"!==e;){let e=i();const s="+"===e.diff;if(s&&(e.diff=null),(e.isElse||e.isEnd)&&(e=new M({...e.info,shape:"stack"},e.children)),s){const t=o[o.length-1];let s=[];t&&t.isGlow&&(o.pop(),s=t.child.isScript?t.child.blocks:[t.child]),s.push(e),o.push(new x(new I(s)))}else if(e.isHat)o.length&&t.push(new I(o)),o=[e];else{if(e.isFinal){o.push(e);break}if(!e.isCommand){o.length&&t.push(new I(o)),t.push(new I([e])),o=[];break}o.push(e)}}for(o.length&&t.push(new I(o));"NL"===e;)s()}return t}()}function G(t,e){t.isScript?t.blocks=t.blocks.map((t=>(G(t,e),e(t)||t))):t.isBlock?t.children=t.children.map((t=>(G(t,e),e(t)||t))):t.isGlow&&G(t.child,e)}const z={"append:toList:":1,"deleteLine:ofList:":1,"insert:at:ofList:":2,"setLine:ofList:to:":1,"showList:":0,"hideList:":0};function K(t,e){if((e={inline:!1,languages:["en"],...e}).dialect)throw Error("Option 'dialect' no longer supported");t=(t=t.replace(/&lt;/g,"<")).replace(/&gt;/g,">"),e.inline&&(t=t.replace(/\n/g," "));const s=e.languages.map((t=>{const e=k[t];if(!e)throw Error(`Unknown language: '${t}'`);return e})),i=H(_(t,s));!function(t){const e=Object.create(null),s=new Set;t.forEach((t=>{const i=new Set;G(t,(t=>{if(t.isBlock)if("define-hat"===t.info.shape){const s=t.children.find((t=>t.isOutline));if(!s)return;const o=[],a=[];for(const t of s.children)if(t.isLabel)a.push(t.value);else if(t.isBlock){if(!t.info.argument)return;a.push({number:"%n",string:"%s",boolean:"%b"}[t.info.argument]);const e=O(t);o.push(e),i.add(e)}const r=a.join(" "),n=f(r),l={spec:r,names:o};e[n]||(e[n]=l),t.info.id="PROCEDURES_DEFINITION",t.info.selector="procDef",t.info.call=l.spec,t.info.names=l.names,t.info.category="custom"}else if(t.info.categoryIsDefault&&(t.isReporter||t.isBoolean)){const e=O(t);i.has(e)&&(t.info.category="custom-arg",t.info.categoryIsDefault=!1,t.info.selector="getParam")}else if(Object.prototype.hasOwnProperty.call(z,t.info.selector)){const e=z[t.info.selector],i=t.children.filter((t=>!t.isLabel))[e];i&&i.isInput&&s.add(i.value)}}))})),t.forEach((t=>{G(t,(t=>{if(t.info&&(t.info.categoryIsDefault&&"obsolete"===t.info.category||"custom"===t.info.category&&!t.info.selector)){const s=e[t.info.hash];return void(s&&(t.info.id="PROCEDURES_CALL",t.info.selector="call",t.info.call=s.spec,t.info.names=s.names,t.info.category="custom"))}let i,o;t.isReporter&&"variables"===t.info.category&&t.info.categoryIsDefault&&(t.info.selector="readVariable",i=O(t),o=t.info),i&&s.has(i)&&(o.category="list",o.categoryIsDefault=!1,o.selector="contentsOfList:")}))}))}(i);const o=new P(i);return function(t){function e(t,i,o){if(!t||!t.isBlock)return;t.blockPath=i,o.set(i,t);let a=0;for(const r of t.children)if(r.isBlock)a++,e(r,`${i}.${a}`,o);else if(r.isScript){a++;let t=0;for(const n of r.blocks)t++,n.isBlock?e(n,`${i}.${a}.${t}`,o):n.isGlow&&s(n,`${i}.${a}.${t}`,o)}else r.isGlow&&(a++,s(r,`${i}.${a}`,o))}function s(t,i,o){if(!t||!t.isGlow)return;const a=t.child;if(a.isBlock)e(a,i,o);else if(a.isScript){let t=0;for(const r of a.blocks)t++,r.isBlock?e(r,`${i}.${t}`,o):r.isGlow&&s(r,`${i}.${t}`,o)}}t.scripts.forEach(((i,o)=>{i.scriptIndex=o+1;let a=0;for(const r of i.blocks){a++;const i=`${o+1}.${a}`;r.isBlock?e(r,i,t.blockMap):r.isGlow&&s(r,i,t.blockMap)}}))}(o),o}function U(t,e){if(!t)throw Error("Assertion failed! "+e)}let j,W;const Y={textContent:!0};let Z=class t{static init(e){j=e.document;const s=e.DOMParser;W=(new s).parseFromString("<xml></xml>","application/xml"),t.XMLSerializer=e.XMLSerializer}static makeCanvas(){return j.createElement("canvas")}static cdata(t){return W.createCDATASection(t)}static el(e,s){const i=j.createElementNS("http://www.w3.org/2000/svg",e);return t.setProps(i,s)}static setProps(t,e){for(const s in e){const i=e[s]+"";Y[s]?t[s]=i:null!=e[s]&&Object.prototype.hasOwnProperty.call(e,s)&&t.setAttributeNS(null,s,i)}return t}static withChildren(t,e){for(const s of e)t.appendChild(s);return t}static group(e){return t.withChildren(t.el("g"),e)}static newSVG(e,s,i){return t.el("svg",{version:"1.1",width:e*i,height:s*i,viewBox:`0 0 ${e} ${s}`})}static polygon(e){return t.el("polygon",{...e,points:e.points.join(" ")})}static path(e){return t.el("path",{...e,path:null,d:e.path.join(" ")})}static text(e,s,i,o){return t.el("text",{...o,x:e,y:s,textContent:i})}static symbol(e){return t.el("use",{href:e})}static move(e,s,i){return t.setProps(i,{transform:`translate(${e} ${s})`}),i}static translatePath(t,e,s){let i=!0;const o=s.split(/\s+/),a=[];for(let s=0;s<o.length;s++){let r=o[s];if("A"!==r)/[A-Za-z]/.test(r)?U(i,"translatePath: invalid argument"):(r=+r,r+=i?t:e,i=!i),a.push(r);else{const t=s+5;for(a.push("A");s<t;)a.push(o[++s])}}return a.join(" ")}static rect(e,s,i){return t.el("rect",{...i,x:0,y:0,width:e,height:s})}static ellipse(e,s,i){return t.el("ellipse",{...i,cx:e/2,cy:s/2,rx:e/2,ry:s/2})}static arc(t,e,s,i,o,a){return`L ${t} ${e} A ${o} ${a} 0 0 1 ${s} ${i}`}static arcw(t,e,s,i,o,a){return`L ${t} ${e} A ${o} ${a} 0 0 0 ${s} ${i}`}static roundedPath(e,s){const i=s/2;return["M",i,0,t.arc(e-i,0,e-i,s,i,i),t.arc(i,s,i,0,i,i),"Z"]}static roundedRect(e,s,i){return t.path({...i,path:t.roundedPath(e,s)})}static pointedPath(t,e){const s=e/2;return["M",s,0,"L",t-s,0,t,s,"L",t,s,t-s,e,"L",s,e,0,s,"L",0,s,s,0,"Z"]}static pointedRect(e,s,i){return t.path({...i,path:t.pointedPath(e,s)})}static getTop(t){return`M 0 3\n L 3 0\n L 13 0\n L 16 3\n L 24 3\n L 27 0\n L ${t-3} 0\n L ${t} 3`}static getRingTop(t){return`M 0 3\n L 3 0\n L 7 0\n L 10 3\n L 16 3\n L 19 0\n L ${t-3} 0\n L ${t} 3`}static getRightAndBottom(t,e,s,i){void 0===i&&(i=0);let o=["L",t,e-3,"L",t-3,e];return s&&(o=o.concat(["L",i+27,e,"L",i+24,e+3,"L",i+16,e+3,"L",i+13,e])),o=i>0?o.concat(["L",i+2,e,"L",i,e+2]):o.concat(["L",i+3,e,"L",0,e-3]),o.join(" ")}static getArm(t,e){return`L 15 ${e-2}\n L 17 ${e}\n L ${t-3} ${e}\n L ${t} ${e+3}`}static stackRect(e,s,i){return t.path({...i,path:[t.getTop(e),t.getRightAndBottom(e,s,!0,0),"Z"]})}static capPath(e,s){return[t.getTop(e),t.getRightAndBottom(e,s,!1,0),"Z"]}static capRect(e,s,i){return t.path({...i,path:t.capPath(e,s)})}static hatRect(e,s,i){return t.path({...i,path:["M",0,12,t.arc(0,12,80,10,80,80),"L",e-3,10,"L",e,13,t.getRightAndBottom(e,s,!0),"Z"]})}static curve(t,e,s,i,o){const a=(e+i)/2;return`${Math.round((t+s)/2+(o=o||.42)*(i-e))} ${Math.round(a-o*(s-t))} ${s} ${i}`}static procHatBase(e,s,i,o){return i=Math.min(.2,35/e),t.path({...o,path:["M",0,15,"Q",t.curve(0,15,e,15,i),t.getRightAndBottom(e,s,!0),"M",-1,13,"Q",t.curve(-1,13,e+1,13,i),"Q",t.curve(e+1,13,e,16,.6),"Q",t.curve(e,16,0,16,-i),"Q",t.curve(0,16,-1,13,.6),"Z"]})}static procHatCap(e,s,i){return t.path({path:["M",-1,13,"Q",t.curve(-1,13,e+1,13,i),"Q",t.curve(e+1,13,e,16,.6),"Q",t.curve(e,16,0,16,-i),"Q",t.curve(0,16,-1,13,.6),"Z"],class:"sb-define-hat-cap"})}static procHatRect(e,s,i){const o=s-52,a=Math.min(.2,35/e);return t.move(0,o,t.group([t.procHatBase(e,52,a,i),t.procHatCap(e,52,a)]))}static mouthRect(e,s,i,o,a){let r=o[0].height;const n=[t.getTop(e),t.getRightAndBottom(e,r,!0,15)];for(let s=1;s<o.length;s+=2){const a=s+2===o.length;r+=o[s].height-3,n.push(t.getArm(e,r));const l=!(a&&i),c=a?0:15;r+=o[s+1].height+3,n.push(t.getRightAndBottom(e,r,l,c))}return t.path({...a,path:n})}static ringRect(e,s,i,o,a,r,n){const l="reporter"===r?t.roundedPath:"boolean"===r?t.pointedPath:t.capPath;return t.path({...n,path:["M",8,0,t.arcw(8,0,0,8,8,8),t.arcw(0,s-8,8,s,8,8),t.arcw(e-8,s,e,s-8,8,8),t.arcw(e,8,e-8,0,8,8),"Z",t.translatePath(4,i||4,l(o,a).join(" "))],"fill-rule":"even-odd"})}static commentRect(e,s,i){return t.path({...i,class:"sb-comment",path:["M",6,0,t.arc(e-6,0,e,6,6,6),t.arc(e,s-6,e-6,s,6,6),t.arc(6,s,0,s-6,6,6),t.arc(0,6,6,0,6,6),"Z"]})}static commentLine(e,s){return t.move(-e,9,t.rect(e,2,{...s,class:"sb-comment-line"}))}static strikethroughLine(e,s){return t.path({...s,path:["M",0,0,"L",e,0],class:"sb-diff sb-diff-del"})}};class X{constructor(t,e){this.el=Z.el("filter",{...e,id:t,x0:"-50%",y0:"-50%",width:"200%",height:"200%"}),this.highestId=0}fe(t,e,s){const i=`${t.toLowerCase().replace(/gaussian|osite/,"")}-${++this.highestId}`;return this.el.appendChild(Z.withChildren(Z.el("fe"+t,{...e,result:i}),s||[])),i}comp(t,e,s,i){return this.fe("Composite",{...i,operator:t,in:e,in2:s})}subtract(t,e){return this.comp("arithmetic",t,e,{k2:1,k3:-1})}offset(t,e,s){return this.fe("Offset",{in:s,dx:t,dy:e})}flood(t,e,s){return this.fe("Flood",{in:s,"flood-color":t,"flood-opacity":e})}blur(t,e){return this.fe("GaussianBlur",{in:e,stdDeviation:`${t} ${t}`})}colorMatrix(t,e){return this.fe("ColorMatrix",{in:t,type:"matrix",values:e.join(" ")})}merge(t){this.fe("Merge",{},t.map((t=>Z.el("feMergeNode",{in:t}))))}}let Q=class t{static get cssContent(){return"@keyframes sb-blink-animation{0%{fill:#fbf883}50%{fill:#fbf883;animation-timing-function:step-start}}.sb-label{font-family:Lucida Grande,Verdana,Arial,DejaVu Sans,sans-serif;font-weight:700;fill:#fff;font-size:10px;word-spacing:1px}.sb-obsolete{fill:#d42828}.sb-motion{fill:#4a6cd4}.sb-looks{fill:#8a55d7}.sb-sound{fill:#bb42c3}.sb-pen{fill:#0e9a6c}.sb-events{fill:#c88330}.sb-control{fill:#e1a91a}.sb-sensing{fill:#2ca5e2}.sb-operators{fill:#5cb712}.sb-variables{fill:#ee7d16}.sb-list{fill:#cc5b22}.sb-custom{fill:#632d99}.sb-custom-arg{fill:#5947b1}.sb-extension{fill:#4b4a60}.sb-grey{fill:#969696}.sb-bevel{filter:url(#bevelFilter)}.sb-input{filter:url(#inputBevelFilter)}.sb-input-number,.sb-input-number-dropdown,.sb-input-string{fill:#fff}.sb-literal-dropdown,.sb-literal-number,.sb-literal-number-dropdown,.sb-literal-string{font-weight:400;font-size:9px;word-spacing:0}.sb-literal-number,.sb-literal-number-dropdown,.sb-literal-string{fill:#000}.sb-darker{filter:url(#inputDarkFilter)}.sb-outline{stroke:#fff;stroke-opacity:.2;stroke-width:2;fill:none}.sb-comment,.sb-define-hat-cap{stroke:#632d99;stroke-width:1;fill:#8e2ec2}.sb-comment{fill:#ffffa5;stroke:#d0d1d2}.sb-comment-line{fill:#ffff80}.sb-comment-label{font-family:Helvetica,Arial,DejaVu Sans,sans-serif;font-weight:700;fill:#5c5d5f;word-spacing:0;font-size:12px}.sb-diff{fill:none;stroke:#000}.sb-diff-ins{stroke-width:2px}.sb-diff-del{stroke-width:3px}.sb-highlight:not(.sb-blink){fill:#fbf883!important}.sb-blink{animation:sb-blink-animation .5s 3}"}static makeIcons(){return[Z.el("path",{d:"M1.504 21L0 19.493 4.567 0h1.948l-.5 2.418s1.002-.502 3.006 0c2.006.503 3.008 2.01 6.517 2.01 3.508 0 4.463-.545 4.463-.545l-.823 9.892s-2.137 1.005-5.144.696c-3.007-.307-3.007-2.007-6.014-2.51-3.008-.502-4.512.503-4.512.503L1.504 21z",fill:"#3f8d15",id:"greenFlag"}),Z.el("polygon",{points:"6.3,0.4725 12.516,0.4725 18.585,6.3 18.585,12.495 12.495,18.585 6.3,18.585 0.483,12.495 0.483,6.3 ",fill:"#bb0010",id:"stopSign"}),Z.el("path",{d:"M6.724 0C3.01 0 0 2.91 0 6.5c0 2.316 1.253 4.35 3.14 5.5H5.17v-1.256C3.364 10.126 2.07 8.46 2.07 6.5 2.07 4.015 4.152 2 6.723 2c1.14 0 2.184.396 2.993 1.053L8.31 4.13c-.45.344-.398.826.11 1.08L15 8.5 13.858.992c-.083-.547-.514-.714-.963-.37l-1.532 1.172A6.825 6.825 0 0 0 6.723 0z",fill:"#fff",id:"turnRight"}),Z.el("path",{d:"M3.637 1.794A6.825 6.825 0 0 1 8.277 0C11.99 0 15 2.91 15 6.5c0 2.316-1.253 4.35-3.14 5.5H9.83v-1.256c1.808-.618 3.103-2.285 3.103-4.244 0-2.485-2.083-4.5-4.654-4.5-1.14 0-2.184.396-2.993 1.053L6.69 4.13c.45.344.398.826-.11 1.08L0 8.5 1.142.992c.083-.547.514-.714.963-.37l1.532 1.172z",fill:"#fff",id:"turnLeft"}),Z.el("path",{d:"M0 0L4 4L0 8Z",fill:"#111",id:"addInput"}),Z.el("path",{d:"M4 0L4 8L0 4Z",fill:"#111",id:"delInput"}),Z.setProps(Z.group([Z.el("path",{d:"M8 0l2 -2l0 -3l3 0l-4 -5l-4 5l3 0l0 3l-8 0l0 2",fill:"#000",opacity:"0.3"}),Z.move(-1,-1,Z.el("path",{d:"M8 0l2 -2l0 -3l3 0l-4 -5l-4 5l3 0l0 3l-8 0l0 2",fill:"#fff",opacity:"0.9"}))]),{id:"loopArrow"}),Z.setProps(Z.group([Z.el("rect",{x:"0",y:"0",width:"12",height:"14",fill:"#000",opacity:"0.25"}),Z.el("rect",{x:"1",y:"1",width:"1",height:"13",fill:"#fff"}),Z.el("rect",{x:"11",y:"1",width:"1",height:"13",fill:"#fff"}),Z.el("rect",{x:"2",y:"1",width:"9",height:"1",fill:"#fff"}),Z.el("rect",{x:"2",y:"5",width:"9",height:"1",fill:"#fff"}),Z.el("rect",{x:"2",y:"9",width:"9",height:"1",fill:"#fff"}),Z.el("rect",{x:"2",y:"13",width:"9",height:"1",fill:"#fff"}),Z.el("rect",{x:"2",y:"2",width:"9",height:"2",fill:"#ea8d1c"}),Z.el("rect",{x:"2",y:"6",width:"9",height:"2",fill:"#ea8d1c"}),Z.el("rect",{x:"2",y:"10",width:"9",height:"2",fill:"#ea8d1c"}),Z.el("rect",{x:"11",y:"0",width:"1",height:"1",fill:"#ea8d1c"}),Z.el("rect",{x:"0",y:"13",width:"1",height:"1",fill:"#ea8d1c"})]),{id:"list"})]}static makeStyle(){const e=Z.el("style");return e.appendChild(Z.cdata(t.cssContent)),e}static bevelFilter(t,e){const s=new X(t),i="SourceAlpha",o=e?-1:1,a=s.blur(1,i);return s.merge(["SourceGraphic",s.comp("in",s.flood("#fff",.15),s.subtract(i,s.offset(+o,+o,a))),s.comp("in",s.flood("#000",.7),s.subtract(i,s.offset(-o,-o,a)))]),s.el}static darkFilter(t){const e=new X(t);return e.merge(["SourceGraphic",e.comp("in",e.flood("#000",.2),"SourceAlpha")]),e.el}static darkRect(t,e,s,i){return Z.setProps(Z.group([Z.setProps(i,{class:`sb-${s} sb-darker`})]),{width:t,height:e})}static get defaultFontFamily(){return"Lucida Grande, Verdana, Arial, DejaVu Sans, sans-serif"}};const{defaultFontFamily:q,makeStyle:$,makeIcons:J,darkRect:tt,bevelFilter:et,darkFilter:st}=Q;function it(t,e){if(t.classList)t.classList.add(e);else{const s=(t.getAttribute("class")||"").split(/\s+/).filter(Boolean);s.includes(e)||(s.push(e),t.setAttribute("class",s.join(" ")))}}let ot=class t{constructor(t){Object.assign(this,t),this.el=null,this.height=12,this.metrics=null,this.x=0}get isLabel(){return!0}draw(){return this.el}get width(){return this.metrics.width}measure(){const e=this.value,s="sb-"+this.cls;this.el=Z.text(0,10,e,{class:"sb-label "+s});let i=t.metricsCache[s];if(i||(i=t.metricsCache[s]=Object.create(null)),Object.hasOwnProperty.call(i,e))this.metrics=i[e];else{const s=/comment-label/.test(this.cls)?"bold 12px Helvetica, Arial, DejaVu Sans, sans-serif":/literal/.test(this.cls)?"normal 9px "+q:"bold 10px "+q;this.metrics=i[e]=t.measure(e,s)}}static measure(e,s){const i=t.measuring;i.font=s;return{width:i.measureText(e).width+.5|0}}};ot.metricsCache={},ot.toMeasure=[];let at=class t{constructor(e){Object.assign(this,e);const s=t.icons[this.name];if(!s)throw Error("no info for icon: "+this.name);Object.assign(this,s)}get isIcon(){return!0}draw(){return Z.symbol("#"+this.name,{width:this.width,height:this.height})}static get icons(){return{greenFlag:{width:20,height:21,dy:-2},stopSign:{width:20,height:20},turnLeft:{width:15,height:12,dy:1},turnRight:{width:15,height:12,dy:1},loopArrow:{width:14,height:11},addInput:{width:4,height:8},delInput:{width:4,height:8},list:{width:12,height:14}}}},rt=class{constructor(t){if(Object.assign(this,t),this.x=0,this.rows&&this.rows.length>0){const t=this.rows.length,e=this.rows[0].length,s=.5,i=10-(t-1)*s;this.cellSize=Math.max(1,Math.floor(i/t)),this.width=e*(this.cellSize+s)-s,this.height=t*(this.cellSize+s)-s}else this.width=0,this.height=0,this.cellSize=0}get isMatrix(){return!0}measure(){}draw(t){if(!this.rows||0===this.rows.length)return Z.group([]);const e=this.cellSize,s=e+.5,i=[];for(let o=0;o<this.rows.length;o++){const a=this.rows[o];for(let r=0;r<a.length;r++){const n=r*s,l=o*s,c=!0===a[r],h=Z.el("rect",{x:n,y:l,width:e,height:e,"stroke-width":0});c?h.setAttribute("fill","#FFFFFF"):it(h,"sb-"+t.info.category),i.push(h)}}return Z.group(i)}},nt=class t{constructor(t){Object.assign(this,t),t.label&&(this.label=ut(t.label)),t.value&&t.value.isMatrix&&(this.matrixView=new rt(t.value)),this.x=0}measure(){this.hasLabel&&this.label.measure(),this.matrixView&&this.matrixView.measure()}static get shapes(){return{string:Z.rect,number:Z.roundedRect,"number-dropdown":Z.roundedRect,color:Z.rect,dropdown:Z.rect,boolean:Z.pointedRect,stack:Z.stackRect,reporter:Z.roundedRect}}draw(e){let s,i,o;const a=!!this.matrixView;if(a){o=4;s=this.matrixView.width+o+4,this.height=14}else this.hasLabel?(i=this.label.draw(),s=Math.max(14,this.label.width+("string"===this.shape||"number-dropdown"===this.shape?6:9))):s=this.isInset?30:this.isColor?13:null;this.hasArrow&&(s+=10),this.width=s;const r=this.height=a?14:this.isRound||this.isColor?13:14,n=a?"number-dropdown":this.shape;let l=t.shapes[n](s,r);this.isColor?Z.setProps(l,{fill:this.value}):(this.isDarker||a)&&(l=tt(s,r,e.info.category,l),e.info.color&&Z.setProps(l,{fill:e.info.color}));const c=Z.group([Z.setProps(l,{class:"sb-input sb-input-"+(a?"number-dropdown":this.shape)})]);if(a){const t=o,s=(r-this.matrixView.height)/2,i=this.matrixView.draw(e);c.appendChild(Z.move(t,s,i))}if(this.hasLabel){const t=this.isRound?5:4;c.appendChild(Z.move(t,0,i))}if(this.hasArrow){const t="dropdown"===this.shape?5:4;c.appendChild(Z.move(s-10,t,Z.polygon({points:[7,0,3.5,4,0,0],fill:"#000",opacity:"0.6"})))}return c}},lt=class i{constructor(i){Object.assign(this,i),this.children=i.children.map(ut),this.comment=this.comment?ut(this.comment):null,this.block=i,Object.prototype.hasOwnProperty.call(s,this.info.category)&&(this.info.category=s[this.info.category]),Object.prototype.hasOwnProperty.call(t,this.info.category)?this.info.category=t[this.info.category]:Object.prototype.hasOwnProperty.call(e,this.info.category)&&(this.info.category="extension"),this.x=0,this.width=null,this.height=null,this.firstLine=null,this.innerWidth=null}get isBlock(){return!0}measure(){for(const t of this.children)t.measure&&t.measure();this.comment&&this.comment.measure()}static get shapes(){return{stack:Z.stackRect,"c-block":Z.stackRect,"if-block":Z.stackRect,celse:Z.stackRect,cend:Z.stackRect,cap:Z.capRect,reporter:Z.roundedRect,boolean:Z.pointedRect,hat:Z.hatRect,cat:Z.hatRect,"define-hat":Z.procHatRect,ring:Z.roundedRect}}drawSelf(t,e,s){if(s.length>1)return Z.mouthRect(t,e,this.isFinal,s,{class:`sb-${this.info.category} sb-bevel`});if("outline"===this.info.shape)return Z.setProps(Z.stackRect(t,e),{class:"sb-outline"});if(this.isRing){const s=this.children[0];if(s&&(s.isStack||s.isBlock||s.isScript)){const i=s.isScript?"stack":s.isStack?s.shape:s.info.shape;return Z.ringRect(t,e,s.y,s.width,s.height,i,{class:`sb-${this.info.category} sb-bevel`})}}const o=i.shapes[this.info.shape];if(!o)throw Error("no shape func: "+this.info.shape);return o(t,e,{class:`sb-${this.info.category} sb-bevel`})}minDistance(t){return this.isBoolean?t.isReporter?4+t.height/4|0:t.isLabel?5+t.height/2|0:t.isBoolean||"boolean"===t.shape?5:2+t.height/2|0:this.isReporter?t.isInput&&t.isRound||(t.isReporter||t.isBoolean)&&!t.hasScript?0:t.isLabel?2+t.height/2|0:t.height/2-2|0:0}static get padding(){return{hat:[15,6,2],cat:[15,6,2],"define-hat":[21,8,9],reporter:[3,4,1],boolean:[3,4,2],cap:[6,6,2],"c-block":[3,6,2],"if-block":[3,6,2],ring:[4,4,2],null:[4,6,2]}}draw(){const t="define-hat"===this.info.shape;let e=this.children;const s=i.padding[this.info.shape]||i.padding.null;let o=s[0];const a=s[1],r=s[2];let n=0;const l=function(t){this.y=t,this.width=0,this.height=t?13:16,this.children=[]};let c=0,h=0,p=new l(n);const d=t=>{0===u.length?p.height+=o+r:(p.height+=t?0:2,p.y-=1),n+=p.height,u.push(p)};if(this.info.isRTL){let t=0;const s=()=>{e=e.slice(0,t).concat(e.slice(t,i).reverse()).concat(e.slice(i))};let i;for(i=0;i<e.length;i++)e[i].isScript&&(s(),t=i+1);t<i&&s()}const u=[];for(let t=0;t<e.length;t++){const s=e[t];if(s.el=s.draw(this),s.isScript&&this.isCommand)this.hasScript=!0,d(),s.y=n,u.push(s),h=Math.max(h,Math.max(1,s.width)),s.height=Math.max(12,s.height)+3,n+=s.height,p=new l(n);else if(s.isArrow)p.children.push(s);else{const e=t>0?30:0,i=this.isCommand?0:this.minDistance(s),o=this.isCommand?s.isBlock||s.isInput?e:0:i;o&&!u.length&&p.width<o-a&&(p.width=o-a),s.x=p.width,p.width+=s.width,c=Math.max(c,p.width+Math.max(0,i-a)),p.width+=4,s.isLabel||(p.height=Math.max(p.height,s.height)),p.children.push(s)}}if(d(!0),c=Math.max(c+2*a,this.isHat||this.hasScript?83:this.isCommand||this.isOutline||this.isRing?39:20),this.height=n,this.width=h?Math.max(c,15+h):c,t){const t=Math.min(26,3.5+.13*c|0)-18;this.height+=t,o+=2*t}this.firstLine=u[0],this.innerWidth=c;const g=[];for(const e of u){if(e.isScript){g.push(Z.move(15,e.y,e.el));continue}const s=e.height;for(const i of e.children){if(i.isArrow){g.push(Z.move(c-15,this.height-3,i.el));continue}let n=o+(s-i.height-o-r)/2-1;if(t&&i.isLabel?n+=3:i.isIcon&&(n+=0|i.dy),!(this.isRing&&(i.y=e.y+n|0,i.isInset)||(g.push(Z.move(a+i.x,e.y+n|0,i.el)),"+"!==i.diff))){const t=Z.insEllipse(i.width,i.height);g.push(Z.move(a+i.x,e.y+n|0,t))}}}const f=this.drawSelf(c,this.height,u);g.splice(0,0,f),this.info.color&&Z.setProps(f,{fill:this.info.color});const b=Z.group(g);return this.block&&this.block.blockPath&&Z.setProps(b,{"data-block-path":this.block.blockPath}),b}},ct=class t{constructor(t){Object.assign(this,t),this.label=ut(t.label),this.width=null}get isComment(){return!0}static get lineLength(){return 12}get height(){return 20}measure(){this.label.measure()}draw(){const e=this.label.draw();return this.width=this.label.width+16,Z.group([Z.commentLine(this.hasBlock?t.lineLength:0,6),Z.commentRect(this.width,this.height,{class:"sb-comment"}),Z.move(8,4,e)])}},ht=class{constructor(t){Object.assign(this,t),this.child=ut(t.child),this.width=null,this.height=null,this.y=0}get isGlow(){return!0}measure(){this.child.measure()}drawSelf(){const t=this.child;let e;const s=this.width,i=this.height-1;return e=t.isScript?!t.isEmpty&&t.blocks[0].isHat?Z.hatRect(s,i):t.isFinal?Z.capRect(s,i):Z.stackRect(s,i):t.drawSelf(s,i,[]),Z.setProps(e,{class:"sb-diff sb-diff-ins"})}draw(){const t=this.child,e=t.isScript?t.draw(!0):t.draw();return this.width=t.width,this.height=t.isBlock&&t.firstLine.height||t.height,Z.group([e,this.drawSelf()])}},pt=class{constructor(t){Object.assign(this,t),this.blocks=t.blocks.map(ut),this.y=0}get isScript(){return!0}measure(){for(const t of this.blocks)t.measure()}draw(t){const e=[];let s=0;this.width=0;for(const i of this.blocks){const o=t?0:2,a=i.draw();e.push(Z.move(o,s,a)),this.width=Math.max(this.width,i.width);if("-"===i.diff){const t=i.width,a=i.firstLine.height||i.height;e.push(Z.move(o,s+a/2+1,Z.strikethroughLine(t))),this.width=Math.max(this.width,i.width)}s+=i.height;const r=i.comment;if(r){const t=i.firstLine,o=i.innerWidth+2+ct.lineLength,a=s-i.height+t.height/2,n=r.draw();e.push(Z.move(o,a-r.height/2,n)),this.width=Math.max(this.width,o+r.width)}}this.height=s,t||this.isFinal||(this.height+=3);const i=this.blocks[this.blocks.length-1];return!t&&i.isGlow&&(this.height+=2),Z.group(e)}},dt=class{constructor(t,e){Object.assign(this,t),this.scripts=t.scripts.map(ut),this.doc=t,this.width=null,this.height=null,this.el=null,this.defs=null,this.scale=e.scale,this.elementMap=new Map}measure(){this.scripts.forEach((t=>t.measure()))}render(t){if("function"==typeof t)throw Error("render() no longer takes a callback");this.measure();let e=0,s=0;const i=[];for(const t of this.scripts)s&&(s+=10),t.y=s,i.push(Z.move(0,s,t.draw())),s+=t.height,e=Math.max(e,t.width+4);this.width=e,this.height=s;const o=Z.newSVG(e,s,this.scale);return o.appendChild(this.defs=Z.withChildren(Z.el("defs"),[et("bevelFilter",!1),et("inputBevelFilter",!0),st("inputDarkFilter"),...J()])),o.appendChild(Z.group(i)),this.el=o,this._buildElementMap(),o}_buildElementMap(){if(!this.el||!this.el.querySelectorAll)return;this.elementMap.clear();this.el.querySelectorAll("[data-block-path]").forEach((t=>{const e=t.getAttribute("data-block-path");e&&this.elementMap.set(e,{el:t})}))}getElementByPath(t){const e=this.elementMap.get(t);return e?e.el:null}highlightBlock(t,e={}){const s=this.getElementByPath(t);if(!s)return!1;const i=s.firstElementChild;return i&&(i.classList.remove("sb-highlight","sb-blink"),i.getBBox(),i.classList.add("sb-highlight"),e.blink&&i.classList.add("sb-blink")),!0}clearHighlight(t=null){if(t){const e=this.getElementByPath(t);if(e){const t=e.firstElementChild;t&&t.classList.remove("sb-highlight","sb-blink")}}else{this.el.querySelectorAll(".sb-highlight").forEach((t=>{t.classList.remove("sb-highlight","sb-blink")}))}}exportSVGString(){if(null==this.el)throw Error("call draw() first");const t=$();this.defs.appendChild(t);const e=(new Z.XMLSerializer).serializeToString(this.el);return this.defs.removeChild(t),e}exportSVG(){return"data:image/svg+xml;utf8,"+this.exportSVGString().replace(/[#]/g,encodeURIComponent)}toCanvas(t,e){e=e||1;const s=Z.makeCanvas();s.width=Math.max(1,this.width*e*this.scale),s.height=Math.max(1,this.height*e*this.scale);const i=s.getContext("2d"),o=new Image;o.src=this.exportSVG(),o.onload=()=>{i.save(),i.scale(e,e),i.drawImage(o,0,0),i.restore(),t(s)}}exportPNG(t,e){this.toCanvas((e=>{URL&&URL.createObjectURL&&Blob&&e.toBlob?e.toBlob((e=>{t(URL.createObjectURL(e))}),"image/png"):t(e.toDataURL("image/png"))}),e)}};const ut=(t,e)=>new((t=>{switch(t.constructor){case L:return ot;case R:return at;case N:return nt;case M:return lt;case B:return ct;case x:return ht;case I:return pt;case P:return dt;default:throw Error("no view for "+t.constructor.name)}})(t))(t,e);const gt=Q.makeStyle;let ft,bt;const mt={textContent:!0};class Vt{static init(t){ft=t.document;const e=t.DOMParser;bt=(new e).parseFromString("<xml></xml>","application/xml"),Vt.XMLSerializer=t.XMLSerializer}static makeCanvas(){return ft.createElement("canvas")}static cdata(t){return bt.createCDATASection(t)}static el(t,e){const s=ft.createElementNS("http://www.w3.org/2000/svg",t);return Vt.setProps(s,e)}static setProps(t,e){for(const s in e){const i=e[s]+"";mt[s]?t[s]=i:null!=e[s]&&Object.prototype.hasOwnProperty.call(e,s)&&t.setAttributeNS(null,s,i)}return t}static withChildren(t,e){for(const s of e)t.appendChild(s);return t}static group(t){return Vt.withChildren(Vt.el("g"),t)}static newSVG(t,e,s){return Vt.el("svg",{version:"1.1",width:t*s,height:e*s,viewBox:`0 0 ${t*s} ${e*s}`})}static polygon(t){return Vt.el("polygon",{...t,points:t.points.join(" ")})}static path(t){return Vt.el("path",{...t,path:null,d:t.path.join(" ")})}static text(t,e,s,i){return Vt.el("text",{...i,x:t,y:e,textContent:s})}static symbol(t){return Vt.el("use",{href:t})}static move(t,e,s){return Vt.setProps(s,{transform:`translate(${t} ${e})`}),s}static rect(t,e,s){return Vt.el("rect",{...s,x:0,y:0,width:t,height:e})}static roundRect(t,e,s){return Vt.rect(t,e,{...s,rx:4,ry:4})}static pillRect(t,e,s){const i=e/2;return Vt.rect(t,e,{...s,rx:i,ry:i})}static pointedPath(t,e){const s=e/2;return[`M ${s} 0`,`L ${t-s} 0 ${t} ${s}`,`L ${t} ${s} ${t-s} ${e}`,`L ${s} ${e} 0 ${s}`,`L 0 ${s} ${s} 0`,"Z"]}static pointedRect(t,e,s){return Vt.path({...s,path:Vt.pointedPath(t,e)})}static topNotch(t,e){return`c 2 0 3 1 4 2\n l 4 4\n c 1 1 2 2 4 2\n h 12\n c 2 0 3 -1 4 -2\n l 4 -4\n c 1 -1 2 -2 4 -2\n L ${t-4} ${e}\n a 4 4 0 0 1 4 4`}static getTop(t){return"M 0 4\n A 4 4 0 0 1 4 0\n H 12 "+Vt.topNotch(t,0)}static getRingTop(t){return`M 0 3\n L 3 0\n L 7 0\n L 10 3\n L 16 3\n L 19 0\n L ${t-3} 0\n L ${t} 3`}static getRightAndBottom(t,e,s,i){void 0===i&&(i=0);let o=[`L ${t} ${e-4}`,"a 4 4 0 0 1 -4 4"];return s&&(o=o.concat([`L ${i+48} ${e}`,"c -2 0 -3 1 -4 2","l -4 4","c -1 1 -2 2 -4 2","h -12","c -2 0 -3 -1 -4 -2","l -4 -4","c -1 -1 -2 -2 -4 -2"])),0===i?(o.push("L",i+4,e),o.push("a 4 4 0 0 1 -4 -4")):(o.push("L",i+4,e),o.push("a 4 4 0 0 0 -4 4")),o.join(" ")}static getArm(t,e){return`L 16 ${e-4}\n a 4 4 0 0 0 4 4\n L 28 ${e} ${Vt.topNotch(t,e)}`}static getArmNoNotch(t,e){return`L 16 ${e-4}\n a 4 4 0 0 0 4 4\n L 28 ${e} L ${t-4} ${e}\n a 4 4 0 0 1 4 4`}static stackRect(t,e,s){return Vt.path({...s,path:[Vt.getTop(t),Vt.getRightAndBottom(t,e,!0,0),"Z"]})}static capPath(t,e){return[Vt.getTop(t),Vt.getRightAndBottom(t,e,!1,0),"Z"]}static capRect(t,e,s){return Vt.path({...s,path:Vt.capPath(t,e)})}static getHatTop(t){return`M 0 16 c 25,-22 71,-22 96,0 L ${t-4} 16 a 4 4 0 0 1 4 4`}static getCatTop(t){return`M 0 32\n c2.6,-2.3 5.5,-4.3 8.5,-6.2c-1,-12.5 5.3,-23.3 8.4,-24.8c3.7,-1.8 16.5,13.1 18.4,15.4c8.4,-1.3 17,-1.3 25.4,0c1.9,-2.3 14.7,-17.2 18.4,-15.4c3.1,1.5 9.4,12.3 8.4,24.8c3,1.8 5.9,3.9 8.5,6.1\n L ${t-4} 32\n a 4 4 0 0 1 4 4`}static hatRect(t,e,s){return Vt.path({...s,path:[Vt.getHatTop(t),Vt.getRightAndBottom(t,e,!0,0),"Z"]})}static catHat(t,e,s){return Vt.group([Vt.path({...s,path:[Vt.getCatTop(t),Vt.getRightAndBottom(t,e,!0,0),"Z"]}),Vt.move(0,32,Vt.setProps(Vt.group([Vt.el("circle",{cx:29.1,cy:-3.3,r:3.4}),Vt.el("circle",{cx:59.2,cy:-3.3,r:3.4}),Vt.el("path",{d:"M45.6,0.1c-0.9,0-1.7-0.3-2.3-0.9c-0.6,0.6-1.3,0.9-2.2,0.9c-0.9,0-1.8-0.3-2.3-0.9c-1-1.1-1.1-2.6-1.1-2.8c0-0.5,0.5-1,1-1l0,0c0.6,0,1,0.5,1,1c0,0.4,0.1,1.7,1.4,1.7c0.5,0,0.7-0.2,0.8-0.3c0.3-0.3,0.4-1,0.4-1.3c0-0.1,0-0.1,0-0.2c0-0.5,0.5-1,1-1l0,0c0.5,0,1,0.4,1,1c0,0,0,0.1,0,0.2c0,0.3,0.1,0.9,0.4,1.2C44.8-2.2,45-2,45.5-2s0.7-0.2,0.8-0.3c0.3-0.4,0.4-1.1,0.3-1.3c0-0.5,0.4-1,0.9-1.1c0.5,0,1,0.4,1.1,0.9c0,0.2,0.1,1.8-0.8,2.8C47.5-0.4,46.8,0.1,45.6,0.1z"})]),{fill:"#000","fill-opacity":.6})),Vt.move(0,32,Vt.el("path",{d:"M73.1-15.6c1.7-4.2,4.5-9.1,5.8-8.5c1.6,0.8,5.4,7.9,5,15.4c0,0.6-0.7,0.7-1.1,0.5c-3-1.6-6.4-2.8-8.6-3.6C72.8-12.3,72.4-13.7,73.1-15.6z",fill:"#FFD5E6",transform:"translate(0, 32)"})),Vt.move(0,32,Vt.el("path",{d:"M22.4-15.6c-1.7-4.2-4.5-9.1-5.8-8.5c-1.6,0.8-5.4,7.9-5,15.4c0,0.6,0.7,0.7,1.1,0.5c3-1.6,6.4-2.8,8.6-3.6C22.8-12.3,23.2-13.7,22.4-15.6z",fill:"#FFD5E6",transform:"translate(0, 32)"}))])}static getProcHatTop(t){return`M 0 20 a 20 20 0 0 1 20 -20 L ${t-20} 0 a 20,20 0 0,1 20,20`}static procHatRect(t,e,s){return Vt.path({...s,path:[Vt.getProcHatTop(t),Vt.getRightAndBottom(t,e,!0,0),"Z"]})}static mouthRect(t,e,s,i,o){let a=i[0].height;const r=[Vt.getTop(t),Vt.getRightAndBottom(t,a,!0,16)];for(let e=1;e<i.length;e+=2){const o=e+2===i.length,n=i[e];a+=n.height-3,n.isFinal?r.push(Vt.getArmNoNotch(t,a)):r.push(Vt.getArm(t,a));const l=!(o&&s),c=o?0:16;a+=i[e+1].height+3,r.push(Vt.getRightAndBottom(t,a,l,c))}return r.push("Z"),Vt.path({...o,path:r})}static commentRect(t,e,s){return Vt.roundRect(t,e,{...s,class:"sb3-comment"})}static commentLine(t,e){return Vt.move(-t,9,Vt.rect(t,2,{...e,class:"sb3-comment-line"}))}static strikethroughLine(t,e){return Vt.path({...e,path:["M",0,0,"L",t,0],class:"sb3-diff sb3-diff-del"})}}const At=new Set(["dropdownArrow","turnRight","turnLeft","loopArrow","musicBlock","penBlock","videoBlock","faceSensingBlock","ttsBlock","translationBlock"]);class kt{static get cssContent(){return"@keyframes sb3-blink-animation{0%{fill:#fbf883}50%{fill:#fbf883;animation-timing-function:step-start}}.sb3-label{font-weight:500;font-size:12pt;font-family:Helvetica Neue,Helvetica,sans-serif}.sb3-literal-dropdown,.sb3-literal-number,.sb3-literal-number-dropdown,.sb3-literal-string{word-spacing:0}.sb3-diff{fill:none;stroke:#000}.sb3-diff-ins{stroke-width:2px}.sb3-diff-del{stroke-width:3px}.sb3-highlight:not(.sb3-blink):not(.sb3-highlight-colorShift){fill:#fbf883!important}.sb3-blink{animation:sb3-blink-animation .5s 3}svg .sb3-motion{fill:#4c97ff;stroke:#3373cc}svg .sb3-motion-alt{fill:#4280d7}svg .sb3-motion-dark{fill:#3373cc}svg .sb3-looks{fill:#96f;stroke:#774dcb}svg .sb3-looks-alt{fill:#855cd6}svg .sb3-looks-dark{fill:#774dcb}svg .sb3-sound{fill:#cf63cf;stroke:#bd42bd}svg .sb3-sound-alt{fill:#c94fc9}svg .sb3-sound-dark{fill:#bd42bd}svg .sb3-control{fill:#ffab19;stroke:#cf8b17}svg .sb3-control-alt{fill:#ec9c13}svg .sb3-control-dark{fill:#cf8b17}svg .sb3-events{fill:#ffbf00;stroke:#c90}svg .sb3-events-alt{fill:#e6ac00}svg .sb3-events-dark{fill:#c90}svg .sb3-sensing{fill:#5cb1d6;stroke:#2e8eb8}svg .sb3-sensing-alt{fill:#47a8d1}svg .sb3-sensing-dark{fill:#2e8eb8}svg .sb3-operators{fill:#59c059;stroke:#389438}svg .sb3-operators-alt{fill:#46b946}svg .sb3-operators-dark{fill:#389438}svg .sb3-variables{fill:#ff8c1a;stroke:#db6e00}svg .sb3-variables-alt{fill:#ff8000}svg .sb3-variables-dark{fill:#db6e00}svg .sb3-list{fill:#ff661a;stroke:#e64d00}svg .sb3-list-alt{fill:#f50}svg .sb3-list-dark{fill:#e64d00}svg .sb3-custom{fill:#ff6680;stroke:#f35}svg .sb3-custom-alt{fill:#ff4d6a}svg .sb3-custom-dark{fill:#f35}svg .sb3-extension{fill:#0fbd8c;stroke:#0b8e69}svg .sb3-extension-alt{fill:#0da57a}svg .sb3-extension-dark{fill:#0b8e69}svg .sb3-obsolete{fill:#ed4242;stroke:#ca2b2b}svg .sb3-obsolete-alt{fill:#db3333}svg .sb3-obsolete-dark{fill:#ca2b2b}svg .sb3-grey{fill:#bfbfbf;stroke:#909090}svg .sb3-grey-alt{fill:#b2b2b2}svg .sb3-grey-dark{fill:#909090}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-motion{fill:#80b5ff!important;stroke:#3373cc!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-looks{fill:#ccb3ff!important;stroke:#774dcb!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-sound{fill:#e19de1!important;stroke:#bd42bd!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-control{fill:#ffbe4c!important;stroke:#cf8b17!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-events{fill:#ffd966!important;stroke:#c90!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-sensing{fill:#85c4e0!important;stroke:#2e8eb8!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-operators{fill:#7ece7e!important;stroke:#389438!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-variables{fill:#ffa54c!important;stroke:#db6e00!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-list{fill:#f96!important;stroke:#e64d00!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-custom{fill:#f9a!important;stroke:#f35!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-extension{fill:#13ecaf!important;stroke:#0b8e69!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-obsolete{fill:#fc6666!important;stroke:#d32121!important}svg .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-grey{fill:#bfbfbf!important;stroke:#959595!important}svg .sb3-label{fill:#fff}svg .sb3-input-color{stroke:#fff}svg .sb3-input-number,svg .sb3-input-string{fill:#fff}svg .sb3-literal-number,svg .sb3-literal-string{fill:#575e75}svg .sb3-custom-arg{fill:#ff6680;stroke:#f35}svg .sb3-extension-line{stroke:#0da57a}svg.scratchblocks-style-scratch3-high-contrast .sb3-motion{fill:#80b5ff;stroke:#3373cc}svg.scratchblocks-style-scratch3-high-contrast .sb3-motion-alt{fill:#b3d2ff}svg.scratchblocks-style-scratch3-high-contrast .sb3-motion-dark{fill:#3373cc}svg.scratchblocks-style-scratch3-high-contrast .sb3-looks{fill:#ccb3ff;stroke:#774dcb}svg.scratchblocks-style-scratch3-high-contrast .sb3-looks-alt{fill:#dcf}svg.scratchblocks-style-scratch3-high-contrast .sb3-looks-dark{fill:#774dcb}svg.scratchblocks-style-scratch3-high-contrast .sb3-sound{fill:#e19de1;stroke:#bd42bd}svg.scratchblocks-style-scratch3-high-contrast .sb3-sound-alt{fill:#ffb3ff}svg.scratchblocks-style-scratch3-high-contrast .sb3-sound-dark{fill:#bd42bd}svg.scratchblocks-style-scratch3-high-contrast .sb3-control{fill:#ffbe4c;stroke:#cf8b17}svg.scratchblocks-style-scratch3-high-contrast .sb3-control-alt{fill:#ffda99}svg.scratchblocks-style-scratch3-high-contrast .sb3-control-dark{fill:#cf8b17}svg.scratchblocks-style-scratch3-high-contrast .sb3-events{fill:#ffd966;stroke:#c90}svg.scratchblocks-style-scratch3-high-contrast .sb3-events-alt{fill:#ffecb3}svg.scratchblocks-style-scratch3-high-contrast .sb3-events-dark{fill:#c90}svg.scratchblocks-style-scratch3-high-contrast .sb3-sensing{fill:#85c4e0;stroke:#2e8eb8}svg.scratchblocks-style-scratch3-high-contrast .sb3-sensing-alt{fill:#aed8ea}svg.scratchblocks-style-scratch3-high-contrast .sb3-sensing-dark{fill:#2e8eb8}svg.scratchblocks-style-scratch3-high-contrast .sb3-operators{fill:#7ece7e;stroke:#389438}svg.scratchblocks-style-scratch3-high-contrast .sb3-operators-alt{fill:#b5e3b5}svg.scratchblocks-style-scratch3-high-contrast .sb3-operators-dark{fill:#389438}svg.scratchblocks-style-scratch3-high-contrast .sb3-variables{fill:#ffa54c;stroke:#db6e00}svg.scratchblocks-style-scratch3-high-contrast .sb3-variables-alt{fill:#fc9}svg.scratchblocks-style-scratch3-high-contrast .sb3-variables-dark{fill:#db6e00}svg.scratchblocks-style-scratch3-high-contrast .sb3-list{fill:#f96;stroke:#e64d00}svg.scratchblocks-style-scratch3-high-contrast .sb3-list-alt{fill:#ffcab0}svg.scratchblocks-style-scratch3-high-contrast .sb3-list-dark{fill:#e64d00}svg.scratchblocks-style-scratch3-high-contrast .sb3-custom{fill:#f9a;stroke:#f35}svg.scratchblocks-style-scratch3-high-contrast .sb3-custom-alt{fill:#ffccd5}svg.scratchblocks-style-scratch3-high-contrast .sb3-custom-dark{fill:#f35}svg.scratchblocks-style-scratch3-high-contrast .sb3-extension{fill:#13ecaf;stroke:#0b8e69}svg.scratchblocks-style-scratch3-high-contrast .sb3-extension-alt{fill:#75f0cd}svg.scratchblocks-style-scratch3-high-contrast .sb3-extension-dark{fill:#0b8e69}svg.scratchblocks-style-scratch3-high-contrast .sb3-obsolete{fill:#fc6666;stroke:#d32121}svg.scratchblocks-style-scratch3-high-contrast .sb3-obsolete-alt{fill:#fcb0b0}svg.scratchblocks-style-scratch3-high-contrast .sb3-obsolete-dark{fill:#d32121}svg.scratchblocks-style-scratch3-high-contrast .sb3-grey{fill:#bfbfbf;stroke:#959595}svg.scratchblocks-style-scratch3-high-contrast .sb3-grey-alt{fill:#b2b2b2}svg.scratchblocks-style-scratch3-high-contrast .sb3-grey-dark{fill:#959595}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-motion{fill:#4c97ff!important;stroke:#3373cc!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-looks{fill:#96f!important;stroke:#774dcb!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-sound{fill:#cf63cf!important;stroke:#bd42bd!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-control{fill:#ffab19!important;stroke:#cf8b17!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-events{fill:#ffbf00!important;stroke:#c90!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-sensing{fill:#5cb1d6!important;stroke:#2e8eb8!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-operators{fill:#59c059!important;stroke:#389438!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-variables{fill:#ff8c1a!important;stroke:#db6e00!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-list{fill:#ff661a!important;stroke:#e64d00!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-custom{fill:#ff6680!important;stroke:#f35!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-extension{fill:#0fbd8c!important;stroke:#0b8e69!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-obsolete{fill:#ed4242!important;stroke:#ca2b2b!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-highlight.sb3-highlight-colorShift:not(.sb3-blink).sb3-grey{fill:#bfbfbf!important;stroke:#909090!important}svg.scratchblocks-style-scratch3-high-contrast .sb3-label{fill:#000}svg.scratchblocks-style-scratch3-high-contrast .sb3-input-color{stroke:#fff}svg.scratchblocks-style-scratch3-high-contrast .sb3-input-number,svg.scratchblocks-style-scratch3-high-contrast .sb3-input-string{fill:#fff}svg.scratchblocks-style-scratch3-high-contrast .sb3-literal-number,svg.scratchblocks-style-scratch3-high-contrast .sb3-literal-string{fill:#000}svg.scratchblocks-style-scratch3-high-contrast .sb3-custom-arg{fill:#f9a;stroke:#f35}svg.scratchblocks-style-scratch3-high-contrast .sb3-extension-line{stroke:#75f0cd}.sb3-comment{fill:#ffffa5;stroke:#d0d1d2;stroke-width:1}.sb3-comment-line{fill:#ffff80}.sb3-comment-label,.sb3-label.sb3-comment-label{font-weight:400;font-size:12pt;font-family:Helvetica Neue,Helvetica,sans-serif;fill:#000;word-spacing:0}"}static makeCommonIcons(){return[Vt.setProps(Vt.group([Vt.el("path",{d:"M20.8 3.7c-.4-.2-.9-.1-1.2.2-2 1.6-4.8 1.6-6.8 0-2.3-1.9-5.6-2.3-8.3-1v-.4c0-.6-.5-1-1-1s-1 .4-1 1v18.8c0 .5.5 1 1 1h.1c.5 0 1-.5 1-1v-6.4c1-.7 2.1-1.2 3.4-1.3 1.2 0 2.4.4 3.4 1.2 2.9 2.3 7 2.3 9.8 0 .3-.2.4-.5.4-.9V4.7c0-.5-.3-.9-.8-1zm-.3 10.2C18 16 14.4 16 11.9 14c-1.1-.9-2.5-1.4-4-1.4-1.2.1-2.3.5-3.4 1.1V4c2.5-1.4 5.5-1.1 7.7.6 2.4 1.9 5.7 1.9 8.1 0h.2l.1.1-.1 9.2z",fill:"#45993d"}),Vt.el("path",{d:"M20.6 4.8l-.1 9.1v.1c-2.5 2-6.1 2-8.6 0-1.1-.9-2.5-1.4-4-1.4-1.2.1-2.3.5-3.4 1.1V4c2.5-1.4 5.5-1.1 7.7.6 2.4 1.9 5.7 1.9 8.1 0h.2c0 .1.1.1.1.2z",fill:"#4cbf56"})]),{id:"sb3-greenFlag"}),Vt.setProps(Vt.el("polygon",{points:"6.6,0.5 13.12,0.5 19.5,6.6 19.5,13.12 13.12,19.5 6.6,19.5 0.5,13.12 0.5,6.6 ",fill:"#ec5959",stroke:"#b84848","stroke-linejoin":"round","stroke-linecap":"round"}),{id:"sb3-stopSign"}),Vt.el("path",{d:"M0 0L4 4L0 8Z",fill:"#111",id:"sb3-addInput"}),Vt.el("path",{d:"M4 0L4 8L0 4Z",fill:"#111",id:"sb3-delInput"}),Vt.setProps(Vt.group([Vt.el("rect",{x:"0",y:"0",width:"15",height:"18",fill:"#fff"}),Vt.el("rect",{x:"1",y:"1",width:"13",height:"4",fill:"#ff920f"}),Vt.el("rect",{x:"1",y:"7",width:"13",height:"4",fill:"#ff920f"}),Vt.el("rect",{x:"1",y:"13",width:"13",height:"4",fill:"#ff920f"})]),{id:"sb3-list"}),Vt.el("image",{id:"sb3-microbitBlock",width:"40px",height:"40px",href:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAACmlBMVEUAAAArKysrIB8lJCNBRlY2O0U9X48sKCvOoBQzKzMnJyfrswi/xdDRoxN2dnbToxPosgnmsAq/lxo6MSq0kCLOoRXKnhbEmhc7LRooJCTcqQ7OoBXstAjpsgi9lhuvjCCPdSd4Zyg2NjZMi+Slhyq8lR5CR1fZqBG+lh3ttQjFnBnLnhbDmhqZore3kh5ARlW2kR6qiCGcfyU6QEtyYyd4ZSDSoxOGdDedgizLnhfgrA25kx9YXWqbgCxMUWDfqwzcqg/VphBBR1ecpLmcgSzHmxijq77BmRprYkOOlKZARlVGdbabo7m3kRxGcrKwjB9ARVSIjaCZobuVeyahgh+VdyE8XIOLayBIOydBR1f/vwBMl//m5+g+Q1JlanY6P0uCiJjj5OU9QVBARVQ/RFP9vgBFZpjk5ebwtgbzuAR0eotARlZITl3d3+KNlKRQVmRNUmGxs7mRlJtUW2nLnhfInRfpsQn1uQS/wsa0t7qlp62doKeKjpeBg41YXmxCSlvGyMtHb6xCUGlCTGBJgdJDSFVobXlMlPhLhtq/wchIesFGbqpDVXRXXGxCTGNiXEe+lh1LjuzP0dRJg9RIfslJfMW9v8RGbKRFY5Jzd4NdYm88QE1+bjrQpCHQohTxtwVLkPDa3OHd3t9If826vMCusLZHcrGIj6F6gpaDho9ESlpITFOQeTLcqhnEmhnqsw34uwVKkfNNhdi6vMRLUWBPUFC7lzDWpx31uQjutQj6vAP5+frZ29zZ2dvW2NtHc7JGbKVFaJx/hpl/hpdxd4hzd4JDWHpDUm5UWWiZhEh3aT6WfC/EnSqtiyW/lxzBmRpKi+VQgMhRermqq7BSdrCLjpVEXYVEW4A/SFtOT1BaV0pxZUCpjT2xkTcYNOUYAAAAWXRSTlMADBgV5DRLEdcIE+3Z2QLt6unOI/zp1dEcDf7z7eu9qVtFBPv7+/fx7u3p3NnOzcq0lXZENzD6+fj39vTm5uXk4t3c2tbS0c/NvrCopKKcm4yLbGpiTUA3JzDAPbYAAAQqSURBVFjD7dX1fxJhHMDxE+MIRRFrdnd3d3fr9ziwhsVsmC2K6HRTtzlb0ens2uzu7m79X3z4HufdwTNvj/qbfPYaPDe+vMf23AEXL168/6bBTfoWx5r0GskxVMhsoDfg3Lb12LlzIwz0zKZYzzy0lkPVKtXdutXw++o2a5UQ7SUMcqibGpA8kD09slX0azRkazwISB5Inn4D+ShwrNYjIHpQQA96mqPAYlqPgOhBAT0oUpgGyh6C6EHYWz11e7jbO9hAxUMQPezR6+wtW0nBlJzV7CB62nIyN/mB5H/ouM0G0j3ITIXsAMDUVMjcygbSPQgqrzCNDaR7sCEzO2cLKSvlLNP/ED1qgbRbh0m37viBAUSPvU/BYFZWcAMFRI+9HW/fOFLSgAaixw6erZWS5qeBVG+XKwlghWsuwALXHIA5rgUAc10r1KADvViwKNDaLO4EWCQuA5gnLgVYKs4DWCYuUoPoFRhcKa4FWCwuB1gizgeYLy4BWC4uBqWPq9Cjg55EJ5bogUi7J0wBmDwhMXzjBHBOmAyQSG4wnPd4cJ4Kejbem4gdTQL9NPN00Hlk0jRs//0p+puinaeDs0XxwMFtk8RZM6fob4pmPl/wxtqkOcemIai7Kco8HTx/88Ns8dBxgMcrEdTfFKcyP/9m1xhwwbV30sBGCdTPqczPu9Y5BoTzZODAg6S5kT9Zf1PU8+fz25TrTJuizOd32kjtL9CmaOfpJ/Zd5UTV3RTtfP6X3mfl0tNNuVSpILYp5xHL25ccFUQv9cwGhrcvPZB4jgiovyn6IHrrZFB/U/RBf6rD8f4sgqzRwTtZQfKZGPiXm4Kxb8rff6awgf9sU5jTB9O79G63BqTW1C5baQ9geNSwvnIEJ8s2PCkPXqhTtlM6HUxvWpiv3h6kyozmDY2egnzUkjc3/3X0bAjPt3gW+VWVxvFtSn6hgi9acxzfeI001yiBs46pI7/AkjzHVSgjg5XIkwvXB+xbcxNnGraHCmZUr8nxJS/g3AlC1KzujQgnOpo5axufDFasYLUa2gK2p2ohzlTtJB2sV6NCNSECCtUq1Kj3CxSq2luXlY8gufF4e9PkCLiwpWFULg38+qKiILgFYe9Lr++07zSur4SXr7zeV5Gj0z5vxt69GVcFt1vI874kS6/0pDIZsWB6crLgzhNI+wRhOrm7Sr5n4HIhWeW5yRJ/EBYuS4+5yUN5Vy9fuewT6GDouQq8qAFDITX4/XmuDF788eTJRQpoD4PTT6nAXA14KVcNhshgBDx16VTokk9oZo4Czf0JiEkgpoCYApJkEPMJwxOiQFONDn8DlrRbuWjRXrWEzWKzlOhnLNfHWN5S2Va5cndjufLG8uWMpRs0sFmqdMNliRKlS1nIlw2Xxh5kWaVKC0NNLiarqdAfZ+LixYsX77f9BFJt17cXqnnkAAAAAElFTkSuQmCC"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M23.513 11.17h-.73c-.319 0-.576.213-.576.478v1.08h1.882v-1.08c0-.265-.258-.479-.576-.479",fill:"#7C87A5"}),Vt.el("path",{d:"M24.91 11.17h-.73c-.319 0-.576.213-.576.478v1.08h1.882v-1.08c0-.265-.258-.479-.576-.479z"}),Vt.el("path",{d:"M9.54 11.17h-.728c-.32 0-.576.213-.576.478v1.08h1.882v-1.08c0-.265-.257-.479-.577-.479",fill:"#7C87A5"}),Vt.el("path",{d:"M10.938 11.17h-.729c-.32 0-.576.213-.576.478v1.08h1.882v-1.08c0-.265-.257-.479-.577-.479z"}),Vt.el("path",{d:"M26.305 11.17h-.73c-.318 0-.574.213-.574.478v1.08h1.882v-1.08c0-.265-.26-.479-.578-.479",fill:"#7C87A5"}),Vt.el("path",{d:"M27.702 11.17h-.73c-.318 0-.574.213-.574.478v1.08h1.882v-1.08c0-.265-.26-.479-.578-.479z"}),Vt.el("path",{d:"M29.101 11.17h-.73c-.318 0-.576.213-.576.478v1.08h1.882v-1.08c0-.265-.258-.479-.576-.479",fill:"#7C87A5"}),Vt.el("path",{d:"M30.498 11.17h-.73c-.318 0-.576.213-.576.478v1.08h1.882v-1.08c0-.265-.258-.479-.576-.479z"}),Vt.el("path",{d:"M17.925 11.17h-.73c-.319 0-.577.213-.577.478v1.08h1.883v-1.08c0-.265-.258-.479-.576-.479",fill:"#7C87A5"}),Vt.el("path",{d:"M19.322 11.17h-.73c-.319 0-.577.213-.577.478v1.08h1.883v-1.08c0-.265-.258-.479-.576-.479z"}),Vt.el("path",{d:"M20.717 11.17h-.73c-.319 0-.575.213-.575.478v1.08h1.883v-1.08c0-.265-.26-.479-.578-.479",fill:"#7C87A5"}),Vt.el("path",{d:"M22.114 11.17h-.73c-.319 0-.575.213-.575.478v1.08h1.883v-1.08c0-.265-.26-.479-.578-.479z"}),Vt.el("path",{d:"M15.129 11.17H14.4c-.32 0-.576.213-.576.478v1.08h1.883v-1.08c0-.265-.258-.479-.578-.479",fill:"#7C87A5"}),Vt.el("path",{d:"M16.526 11.17h-.729c-.32 0-.576.213-.576.478v1.08h1.883v-1.08c0-.265-.258-.479-.578-.479z"}),Vt.el("path",{d:"M12.335 11.17h-.73c-.319 0-.575.213-.575.478v1.08h1.882v-1.08c0-.265-.26-.479-.577-.479",fill:"#7C87A5"}),Vt.el("path",{d:"M13.732 11.17h-.73c-.319 0-.575.213-.575.478v1.08h1.883v-1.08c0-.265-.26-.479-.578-.479z"}),Vt.el("path",{d:"M31.893 11.17h-.73c-.318 0-.574.213-.574.478v1.08h1.882v-1.08c0-.265-.26-.479-.578-.479",fill:"#7C87A5"}),Vt.el("path",{d:"M33.29 11.17h-.73c-.318 0-.574.213-.574.478v1.08h1.882v-1.08c0-.265-.26-.479-.578-.479z"}),Vt.el("path",{d:"M33.647 28.407H15.765V12.533h17.882c.52 0 .941.445.941.992v13.89c0 .547-.421.992-.94.992",fill:"#FFF"}),Vt.el("path",{d:"M33.647 28.407H15.765V12.533h17.882c.52 0 .941.445.941.992v13.89c0 .547-.421.992-.94.992z",stroke:"#7C87A5","stroke-width":".893"}),Vt.el("path",{d:"M15.765 28.407H5.412c-.52 0-.941-.445-.941-.993V16.502c0-2.19 1.686-3.969 3.764-3.969h15.06-3.766c-2.078 0-3.764 1.778-3.764 3.969v11.905z",fill:"#FFF"}),Vt.el("path",{d:"M15.765 28.407H5.412c-.52 0-.941-.445-.941-.993V16.502c0-2.19 1.686-3.969 3.764-3.969h15.06-3.766c-2.078 0-3.764 1.778-3.764 3.969v11.905z",stroke:"#7C87A5","stroke-width":".893"}),Vt.el("path",{d:"M12.941 12.533H11.06c-1.559 0-2.824 1.334-2.824 2.977v1.986c0 .547.422.992.941.992H12c.52 0 .941-.445.941-.992V15.51c0-1.643 1.265-2.977 2.824-2.977h.94-3.764z",fill:"#4C97FF"}),Vt.el("path",{d:"M12.941 12.533H11.06c-1.559 0-2.824 1.334-2.824 2.977v1.986c0 .547.422.992.941.992H12c.52 0 .941-.445.941-.992V15.51c0-1.643 1.265-2.977 2.824-2.977h.94-3.764z",stroke:"#3D79CC","stroke-width":".893"}),Vt.el("path",{stroke:"#7C87A5","stroke-width":".893",d:"M4.47 20.474h27.961l2.157 2.974"}),Vt.el("path",{d:"M15.765 28.407H5.412c-.52 0-.941-.445-.941-.993V16.502c0-2.19 1.686-3.969 3.764-3.969h15.06-3.766c-2.078 0-3.764 1.778-3.764 3.969v11.905z",stroke:"#7C87A5","stroke-width":".893"}),Vt.el("path",{d:"M21.307 18.964h-.73c-.319 0-.576.214-.576.479v1.08h1.882v-1.08c0-.265-.258-.479-.576-.479",fill:"#7C87A5"}),Vt.el("path",{d:"M21.307 18.964h-.73c-.319 0-.576.214-.576.479v1.08h1.882v-1.08c0-.265-.258-.479-.576-.479z"}),Vt.el("path",{d:"M24.178 18.964h-.728c-.32 0-.576.214-.576.479v1.08h1.882v-1.08c0-.265-.258-.479-.578-.479",fill:"#7C87A5"}),Vt.el("path",{d:"M24.178 18.964h-.728c-.32 0-.576.214-.576.479v1.08h1.882v-1.08c0-.265-.258-.479-.578-.479z"}),Vt.el("path",{d:"M27.051 18.964h-.73c-.318 0-.576.214-.576.479v1.08h1.882v-1.08c0-.265-.257-.479-.576-.479",fill:"#7C87A5"}),Vt.el("path",{d:"M27.051 18.964h-.73c-.318 0-.576.214-.576.479v1.08h1.882v-1.08c0-.265-.257-.479-.576-.479z"}),Vt.el("path",{d:"M29.923 18.964h-.729c-.32 0-.576.214-.576.479v1.08h1.883v-1.08c0-.265-.258-.479-.578-.479",fill:"#7C87A5"}),Vt.el("path",{d:"M29.923 18.964h-.729c-.32 0-.576.214-.576.479v1.08h1.883v-1.08c0-.265-.258-.479-.578-.479z"}),Vt.el("path",{d:"M33.647 28.407H15.765V20.47H32.43l2.157 2.978v3.966c0 .548-.421.993-.94.993",fill:"#E6E7E8"}),Vt.el("path",{d:"M33.647 28.407H15.765V20.47H32.43l2.157 2.978v3.966c0 .548-.421.993-.94.993z",stroke:"#7C87A5","stroke-width":".893"}),Vt.el("path",{d:"M15.765 28.407H5.412c-.52 0-.941-.445-.941-.993V20.47h11.294v7.937z",fill:"#E6E7E8"}),Vt.el("path",{d:"M15.765 28.407H5.412c-.52 0-.941-.445-.941-.993V20.47h11.294v7.937z",stroke:"#7C87A5","stroke-width":".893"}),Vt.el("path",{fill:"#E6E7E8",d:"M19.53 24.438h11.294V20.47H19.529z"}),Vt.el("path",{stroke:"#7C87A5","stroke-width":".893",d:"M19.53 24.438h11.294V20.47H19.529zm12.902-3.964l2.157-2.794"})]),{id:"sb3-wedoBlock",fill:"none"}),Vt.setProps(Vt.group([Vt.el("rect",{stroke:"#7C87A5",fill:"#FFF",x:".5",y:"3.59",width:"28",height:"25.81",rx:"1"}),Vt.el("rect",{stroke:"#7C87A5",fill:"#E6E7E8",x:"2.5",y:".5",width:"24",height:"32",rx:"1"}),Vt.el("path",{stroke:"#7C87A5",fill:"#FFF",d:"M2.5 14.5h24v13h-24z"}),Vt.el("path",{d:"M14.5 10.5v4",stroke:"#7C87A5",fill:"#E6E7E8"}),Vt.el("rect",{fill:"#414757",x:"4.5",y:"2.5",width:"20",height:"10",rx:"1"}),Vt.el("rect",{fill:"#7C87A5",opacity:".5",x:"13.5",y:"20.13",width:"2",height:"2",rx:".5"}),Vt.el("path",{d:"M9.06 20.13h1.5a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1.5a1 1 0 0 1 0-2zM19.93 22.13h-1.51a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h1.5a1 1 0 0 1 .01 2zM8.23 17.5H5a.5.5 0 0 1-.5-.5v-2.5h6l-1.85 2.78a.51.51 0 0 1-.42.22zM18.15 18.85l-.5.5a.49.49 0 0 0-.15.36V20a.5.5 0 0 1-.5.5h-.5a.5.5 0 0 1-.5-.5.5.5 0 0 0-.5-.5h-2a.5.5 0 0 0-.5.5.5.5 0 0 1-.5.5H12a.5.5 0 0 1-.5-.5v-.29a.49.49 0 0 0-.15-.36l-.5-.5a.51.51 0 0 1 0-.71l1.51-1.49a.47.47 0 0 1 .35-.15h3.58a.47.47 0 0 1 .35.15l1.51 1.49a.51.51 0 0 1 0 .71zM10.85 23.45l.5-.5a.49.49 0 0 0 .15-.36v-.29a.5.5 0 0 1 .5-.5h.5a.5.5 0 0 1 .5.5.5.5 0 0 0 .5.5h2a.5.5 0 0 0 .5-.5.5.5 0 0 1 .5-.5h.5a.5.5 0 0 1 .5.5v.29a.49.49 0 0 0 .15.36l.5.5a.5.5 0 0 1 0 .7l-1.51 1.5a.47.47 0 0 1-.35.15h-3.58a.47.47 0 0 1-.35-.15l-1.51-1.5a.5.5 0 0 1 0-.7z",fill:"#7C87A5",opacity:".5"}),Vt.el("path",{d:"M21.5 27.5h5v4a1 1 0 0 1-1 1h-4v-5z",stroke:"#CC4C23",fill:"#F15A29"})]),{transform:"translate(5.5 3.5)",id:"sb3-ev3Block"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M35 28H5a1 1 0 0 1-1-1V12c0-.6.4-1 1-1h30c.5 0 1 .4 1 1v15c0 .5-.5 1-1 1z",fill:"#fff"}),Vt.el("path",{fill:"red",d:"M4 25h32v2.7H4zm9-1h-2.2a1 1 0 0 1-1-1v-9.7c0-.6.4-1 1-1H13c.6 0 1 .4 1 1V23c0 .6-.5 1-1 1z"}),Vt.el("path",{fill:"red",d:"M6.1 19.3v-2.2c0-.5.4-1 1-1h9.7c.5 0 1 .5 1 1v2.2c0 .5-.5 1-1 1H7.1a1 1 0 0 1-1-1z"}),Vt.el("circle",{fill:"red",cx:"22.8",cy:"18.2",r:"3.4"}),Vt.el("circle",{fill:"red",cx:"30.6",cy:"18.2",r:"3.4"}),Vt.el("path",{fill:"red",d:"M4.2 27h31.9v.7H4.2z"}),Vt.el("circle",{fill:"#e0e0e0",cx:"22.8",cy:"18.2",r:"2.3"}),Vt.el("circle",{fill:"#e0e0e0",cx:"30.6",cy:"18.2",r:"2.3"}),Vt.el("path",{fill:"#e0e0e0",d:"M12.5 22.9h-1.2c-.3 0-.5-.2-.5-.5V14c0-.3.2-.5.5-.5h1.2c.3 0 .5.2.5.5v8.4c0 .3-.2.5-.5.5z"}),Vt.el("path",{fill:"#e0e0e0",d:"M7.2 18.7v-1.2c0-.3.2-.5.5-.5h8.4c.3 0 .5.2.5.5v1.2c0 .3-.2.5-.5.5H7.7c-.3 0-.5-.2-.5-.5zM4 26h32v2H4z"}),Vt.el("path",{stroke:"#666","stroke-width":".5",d:"M35.2 27.9H4.8a1 1 0 0 1-1-1V12.1c0-.6.5-1 1-1h30.5c.5 0 1 .4 1 1V27a1 1 0 0 1-1.1.9z"}),Vt.el("path",{stroke:"#666","stroke-width":".5",d:"M35.2 27.9H4.8a1 1 0 0 1-1-1V12.1c0-.6.5-1 1-1h30.5c.5 0 1 .4 1 1V27a1 1 0 0 1-1.1.9z"})]),{id:"sb3-makeymakeyBlock",fill:"none"}),Vt.el("image",{id:"sb3-gdxforBlock",width:"40px",height:"40px",href:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAABAlBMVEUAAAABAQEAAAB9h6YAAAAAAAAAAAB8iKZ7iKaAjKvm5+h+iqhcXFxGR0d8iKbj5OV9iKZ8h6be3+Db3d19h6acnJ0AAAB7nrDh4uPh4uN9iabZ2tt9iKbX19nJycnExsZ8iKe+wMC7vL2Eka/g4ePU1dV8iKZ9iKZ9iKd+iKitra2RkZGLjo5wcHCLi7l0oqJV//9csdZ8h6WFkq//vwDm5+iEka79vgJ6iql9iaaHk6tgq9Btm71+iadmo8dzk7OCj6yAjKp/iqhiqc1qnsB4jKtgrNFwl7d1tLTgtCxpocN0krJ2j65ossWNtZSbt4LAulHWsDnasTTuvhXzvg9zk7TzqAfaAAAAMXRSTlMAJiLoFBwI8q4a+0c4M/nr3tnQwKxYDAnk2726tbGMh4J9dinXq56ddG9nT01ACwsDk/+seAAAAidJREFUWMPt2Olu2kAUhuE5NvuaBAhZm7TpvufgMXaBbmAghOzp/d9KD7RW6yaqPeL7YVV9/471aBgfCXnUH7ULNhtkF96qv1dgwwoxoM08cDsJcwfMdgwonoiJPRFjQXkscQM3Adhxk4NuJwkoDx0nSp5NDTiae958NEaBwzkvC4YYcOxx7fCoeJhnrwcBv7H9TklFm08R4JD5SEkiMg8B4IjXwsV1HgHAPu+EizsQcMbr2B0OufZz7X0NcIZSwC9+rD3nADI2/fCtrHEfAvZ8Liqp6PuIwZZO+ZmSnspcY8AZ55WU5xkElDwuK1Vm7xgFTjhfLud5AgPHAUvBGARKvYnnTXpp/gvAg9PLyykSPLt1nNszIHjuSOdAcNp1nO4UeYYXNzcX0UH62P+0AnjH8lgCgL8s/+uXzwZgrOV2JAMwxpIMwRjLHIyxzMEYyxyMWgAwYiHAzm99iLQ6eOJEul4d7Ea6WhG8W7rAE+fertHgVXp+clpB9Oet64M/wH2TKwI/FrRFTH6JIZ6NvmZpxoDtptlFULOtzGPWy+4/r//gvwKGgcC90NtTqIg2dIuyClaWDvTjKlDMLba4UaUMcIuVbd0gyiGwjGVlFuKWfkQZhEfSQnypd8mCvOHGvkA5quo6EQSs6yrlNumN3obs0KKGHJ70QD+hLOQMW7r0sFI5KJVeY+bGkr1JopKlEG0StXbrW/uvQGMookXLLPFAZYTMJju/7z6rRW1MZcnIAAAAAElFTkSuQmCC"}),Vt.el("image",{id:"sb3-boostBlock",width:"40px",height:"40px",href:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQBAMAAAB8P++eAAAAKlBMVEUAAAD///98h6Xm5+iVnrb/Zhq+w9L5hk73+Pnf4eSQmbLr7Ozo39vp184hSCf6AAAAAXRSTlMAQObYZgAAAOFJREFUSMftlDEOgjAUhonhAi1sLvIk7NDJDTYu0LhzBzcXruHoDTyFB/BCNi30KU3InzioSb++hAS+vPfKa5pEIpHvk7a8gpf8ISWINtlg4i7ZFOKVTBlqsUR+ItYZJG7VzQQgMqGYd7zWRArpULEAe5Q/J9JMj4rluC7uleNw7TFRXcoREDnlinjX57eUsvRTn8+AE0/6OKV0g5buYTTyWFFr/XAp3aDzed4yFJWnKbhPbtaXXohDNYlDJWz4zSxEokkkEjb496AiVtqAbIYgYNGWBmhgES+NX6SRSORfeAJMWajr95DdqQAAAABJRU5ErkJggg=="})]}static makeOriginalIcons(){return[...kt.makeCommonIcons(),Vt.setProps(Vt.group([Vt.el("path",{d:"M12.71 2.44A2.41 2.41 0 0 1 12 4.16L8.08 8.08a2.45 2.45 0 0 1-3.45 0L.72 4.16A2.42 2.42 0 0 1 0 2.44 2.48 2.48 0 0 1 .71.71C1 .47 1.43 0 6.36 0s5.39.46 5.64.71a2.44 2.44 0 0 1 .71 1.73z",fill:"#231f20",opacity:".1"}),Vt.el("path",{d:"M6.36 7.79a1.43 1.43 0 0 1-1-.42L1.42 3.45a1.44 1.44 0 0 1 0-2c.56-.56 9.31-.56 9.87 0a1.44 1.44 0 0 1 0 2L7.37 7.37a1.43 1.43 0 0 1-1.01.42z",fill:"#fff"})]),{id:"sb3-dropdownArrow",transform:"scale(0.94413847364)"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M22.68 12.2a1.6 1.6 0 0 1-1.27.63h-7.69a1.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 .8A4.25 4.25 0 0 0 7.2 10.6a5.06 5.06 0 0 0 .54 4.62A5.58 5.58 0 0 0 12 17.74a2.26 2.26 0 0 1-.16 4.52A10.25 10.25 0 0 1 3.74 18a10.14 10.14 0 0 1-1.49-9.22 9.7 9.7 0 0 1 2.83-4.14A9.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-.26 1.39z",fill:"#3d79cc"}),Vt.el("path",{d:"M21.38 11.83h-7.61a.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.82 9.16 9.16 0 0 1-1.4-8.37A8.51 8.51 0 0 1 5.71 5.4a8.76 8.76 0 0 1 4.11-1.92 9.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-.62.75z",fill:"#fff"})]),{id:"sb3-turnRight"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M20.34 18.21a10.24 10.24 0 0 1-8.1 4.22 2.26 2.26 0 0 1-.16-4.52 5.58 5.58 0 0 0 4.25-2.53 5.06 5.06 0 0 0 .54-4.62A4.25 4.25 0 0 0 15.55 9a4.31 4.31 0 0 0-2-.8 4.82 4.82 0 0 0-3.15.8l1.12 1.41A1.59 1.59 0 0 1 10.36 13H2.67a1.56 1.56 0 0 1-1.26-.63A1.54 1.54 0 0 1 1.13 11l1.72-7.43A1.59 1.59 0 0 1 4.38 2.4a1.57 1.57 0 0 1 1.24.6L6.7 4.35a10.66 10.66 0 0 1 7.72-1.68A9.88 9.88 0 0 1 19 4.81 9.61 9.61 0 0 1 21.83 9a10.08 10.08 0 0 1-1.49 9.21z",fill:"#3d79cc"}),Vt.el("path",{d:"M19.56 17.65a9.29 9.29 0 0 1-7.35 3.83 1.31 1.31 0 0 1-.08-2.62 6.53 6.53 0 0 0 5-2.92 6.05 6.05 0 0 0 .67-5.51 5.32 5.32 0 0 0-1.64-2.16 5.21 5.21 0 0 0-2.48-1A5.86 5.86 0 0 0 9 8.84L10.74 11a.59.59 0 0 1-.43 1H2.7a.6.6 0 0 1-.6-.75l1.71-7.42a.59.59 0 0 1 1-.21l1.67 2.1a9.71 9.71 0 0 1 7.75-2.07 8.84 8.84 0 0 1 4.12 1.92 8.68 8.68 0 0 1 2.54 3.72 9.14 9.14 0 0 1-1.33 8.36z",fill:"#fff"})]),{id:"sb3-turnLeft"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M23.3 11c-.3.6-.9 1-1.5 1h-1.6c-.1 1.3-.5 2.5-1.1 3.6-.9 1.7-2.3 3.2-4.1 4.1-1.7.9-3.6 1.2-5.5.9-1.8-.3-3.5-1.1-4.9-2.3-.7-.7-.7-1.9 0-2.6.6-.6 1.6-.7 2.3-.2H7c.9.6 1.9.9 2.9.9s1.9-.3 2.7-.9c1.1-.8 1.8-2.1 1.8-3.5h-1.5c-.9 0-1.7-.7-1.7-1.7 0-.4.2-.9.5-1.2l4.4-4.4c.7-.6 1.7-.6 2.4 0L23 9.2c.5.5.6 1.2.3 1.8z",fill:"#cf8b17"}),Vt.el("path",{d:"M21.8 11h-2.6c0 1.5-.3 2.9-1 4.2-.8 1.6-2.1 2.8-3.7 3.6-1.5.8-3.3 1.1-4.9.8-1.6-.2-3.2-1-4.4-2.1-.4-.3-.4-.9-.1-1.2.3-.4.9-.4 1.2-.1 1 .7 2.2 1.1 3.4 1.1s2.3-.3 3.3-1c.9-.6 1.6-1.5 2-2.6.3-.9.4-1.8.2-2.8h-2.4c-.4 0-.7-.3-.7-.7 0-.2.1-.3.2-.4l4.4-4.4c.3-.3.7-.3.9 0L22 9.8c.3.3.4.6.3.9s-.3.3-.5.3z",fill:"#fff"})]),{id:"sb3-loopArrow"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M28.456 21.675c-.009-.312-.087-.825-.256-1.702-.096-.495-.612-3.022-.753-3.73-.395-1.98-.76-3.92-1.142-6.113-.732-4.223-.693-6.05.344-6.527.502-.23 1.06-.081 1.842.35.413.227 2.181 1.365 2.07 1.296 1.993 1.243 3.463 1.775 4.928 1.549 1.527-.237 2.505-.06 2.877.618.348.635.015 1.416-.729 2.18-1.473 1.516-3.976 2.514-5.849 2.023-.822-.218-1.238-.464-2.38-1.266a9.737 9.737 0 0 0-.095-.066c.047.593.264 1.74.717 3.803.294 1.336 2.079 9.187 2.637 11.674l.002.012c.529 2.637-1.872 4.724-5.235 4.724-3.29 0-6.363-1.988-6.862-4.528-.53-2.64 1.873-4.734 5.233-4.734a8.411 8.411 0 0 1 2.65.437zM11.46 27.666c-.01-.319-.091-.84-.266-1.738-.09-.46-.595-2.937-.753-3.727-.39-1.96-.752-3.892-1.131-6.07-.732-4.224-.692-6.052.344-6.527.502-.23 1.06-.082 1.841.349.414.228 2.181 1.365 2.07 1.296 1.992 1.243 3.461 1.775 4.925 1.549 1.525-.24 2.504-.064 2.876.614.348.635.015 1.415-.728 2.18-1.474 1.517-3.977 2.513-5.847 2.017-.822-.218-1.237-.463-2.38-1.266a9.729 9.729 0 0 0-.094-.065c.047.593.264 1.74.717 3.802.294 1.337 2.078 9.19 2.636 11.675l.003.013c.517 2.638-1.884 4.732-5.234 4.732-3.286 0-6.359-1.993-6.87-4.54-.518-2.639 1.885-4.73 5.242-4.73.904 0 1.802.15 2.65.436z",stroke:"#000","stroke-opacity":".1"}),Vt.el("path",{d:"M32.18 25.874C32.636 28.157 30.512 30 27.433 30c-3.07 0-5.923-1.843-6.372-4.126-.458-2.285 1.665-4.136 4.743-4.136.647 0 1.283.084 1.89.234a7 7 0 0 1 .938.302c.87-.02-.104-2.294-1.835-12.229-2.134-12.303 3.06-1.87 8.768-2.753 5.708-.885.076 4.82-3.65 3.844-3.724-.987-4.65-7.153.263 14.738zm-16.998 5.99C15.63 34.148 13.507 36 10.439 36c-3.068 0-5.92-1.852-6.379-4.136-.448-2.284 1.674-4.135 4.751-4.135 1.002 0 1.974.197 2.854.544.822-.055-.15-2.377-1.862-12.228-2.133-12.303 3.059-1.87 8.764-2.753 5.706-.894.076 4.821-3.648 3.834-3.723-.987-4.648-7.152.263 14.738z",fill:"#FFF"})]),{id:"sb3-musicBlock",fill:"none"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M8.753 34.602l-4.251 1.779 1.784-4.236c1.218-2.892 2.907-5.423 5.03-7.538L31.066 4.93c.846-.842 2.65-.41 4.032.967 1.38 1.375 1.816 3.173.97 4.015L16.318 29.59c-2.123 2.116-4.664 3.799-7.565 5.012",fill:"#FFF"}),Vt.el("path",{d:"M29.41 6.111s-4.45-2.379-8.202 5.771c-1.734 3.766-4.35 1.546-4.35 1.546"}),Vt.el("path",{d:"M36.42 8.825c0 .463-.14.873-.432 1.164l-9.335 9.301c.282-.29.41-.668.41-1.12 0-.874-.507-1.963-1.406-2.868-1.362-1.358-3.147-1.8-4.002-.99L30.99 5.01c.844-.84 2.65-.41 4.035.96.898.904 1.396 1.982 1.396 2.855M10.515 33.774a23.74 23.74 0 0 1-1.764.83L4.5 36.382l1.786-4.235c.258-.604.529-1.186.833-1.757.69.183 1.449.625 2.109 1.282.659.658 1.102 1.412 1.287 2.102",fill:"#4C97FF"}),Vt.el("path",{d:"M36.498 8.748c0 .464-.141.874-.433 1.165l-19.742 19.68c-2.131 2.111-4.673 3.793-7.572 5.01L4.5 36.381l.974-2.317 1.925-.808c2.899-1.218 5.441-2.899 7.572-5.01l19.742-19.68c.292-.292.432-.702.432-1.165 0-.647-.27-1.4-.779-2.123.249.172.498.377.736.614.898.905 1.396 1.983 1.396 2.856",fill:"#575E75",opacity:".15"}),Vt.el("path",{d:"M18.45 12.831a.904.904 0 1 1-1.807 0 .904.904 0 0 1 1.807 0z",fill:"#575E75"})]),{id:"sb3-penBlock",stroke:"#575E75",fill:"none","stroke-linejoin":"round"}),Vt.setProps(Vt.group([Vt.el("circle",{opacity:.25,cx:32,cy:16,r:4.5}),Vt.el("circle",{opacity:.5,cx:32,cy:12,r:4.5}),Vt.el("circle",{opacity:.75,cx:32,cy:8,r:4.5}),Vt.el("circle",{cx:32,cy:4,r:4.5}),Vt.el("path",{d:"M22.672 4.42l-6.172 4V6.1c0-2.01-1.563-3.6-3.5-3.6H4.1C2.076 2.5.5 4.076.5 6.1V14c0 1.927 1.584 3.512 3.6 3.6H13c1.902 0 3.5-1.653 3.5-3.6v-2.283l6.257 3.754.097.075c.02.02.098.054.146.054.267 0 .5-.217.5-.5V4.8c0 .037-.056-.094-.129-.243-.145-.242-.43-.299-.7-.137z",fill:"#4D4D4D","stroke-linejoin":"round"})]),{id:"sb3-videoBlock",stroke:"#000",fill:"#FFF","stroke-opacity":.15}),Vt.setProps(Vt.group([Vt.el("circle",{cx:8.35,cy:9.65,r:.97,fill:"#FFF"}),Vt.el("circle",{cx:14.19,cy:9.65,r:.97,fill:"#FFF"}),Vt.el("path",{d:"M11.27 4.14c-3.94 0-7.13 3.19-7.13 7.13s3.19 7.13 7.13 7.13 7.13-3.19 7.13-7.13-3.19-7.13-7.13-7.13m0 1.3c3.22 0 5.84 2.61 5.84 5.84s-2.61 5.84-5.84 5.84-5.84-2.61-5.84-5.84 2.61-5.84 5.84-5.84",fill:"#FFF"}),Vt.el("path",{d:"M17.57 13.88c.57-.15 1.02-.6 1.17-1.17l.35-1.3c.16-.61 1.04-.61 1.2 0l.35 1.3c.15.57.6 1.02 1.18 1.17l1.3.35c.61.16.61 1.04 0 1.2l-1.3.35c-.57.15-1.02.6-1.18 1.17l-.35 1.3c-.17.62-1.04.62-1.2 0l-.35-1.3c-.15-.57-.6-1.02-1.17-1.17l-1.3-.35c-.61-.17-.61-1.04 0-1.2l1.3-.35Zm-16-11.43c.43-.12.76-.45.88-.88l.26-.98c.12-.46.78-.46.9 0l.26.98c.12.43.45.76.88.88l.98.26c.46.12.46.78 0 .9l-.98.26c-.43.11-.77.45-.88.88l-.26.98c-.12.46-.78.46-.9 0l-.26-.98a1.26 1.26 0 0 0-.88-.88l-.98-.26c-.46-.12-.46-.78 0-.9z",fill:"#ffbf00","fill-rule":"evenodd",stroke:"#0b8e69","stroke-miterlimit":"2","stroke-width":".5"}),Vt.el("path",{d:"M12.68 12.53c.2-.3.6-.38.9-.18s.38.6.18.9c-.56.83-1.41 1.26-2.48 1.26s-1.93-.43-2.48-1.26c-.2-.3-.12-.7.18-.9s.7-.12.9.18c.31.46.75.68 1.41.68s1.1-.22 1.41-.68Z",fill:"#FFF"}),Vt.el("path",{d:"M20.89 6.06a.57.57 0 0 1-.57-.57V2.2h-3.31c-.31 0-.57-.25-.57-.57s.25-.57.57-.57h3.88c.31 0 .57.25.57.57v3.86c0 .31-.25.57-.57.57M5.44 21.46H1.59a.57.57 0 0 1-.57-.57v-3.82c0-.31.25-.57.57-.57s.57.25.57.57v3.25h3.28c.31 0 .57.25.57.57s-.25.57-.57.57",fill:"#0b8e69"})]),{id:"sb3-faceSensingBlock",transform:"scale(1.67785234899 1.67785234899)"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M25.644 20.5c-1.667 1.937-4.539 3.429-5.977 3.429a1.25 1.25 0 0 1-.557-.137c-.372-.186-.61-.542-.61-1.03 0-.105.017-.207.05-.308.076-.236.624-.986.727-1.173.27-.484.462-1.075.566-1.865A8.5 8.5 0 0 1 24 3.5h4a8.5 8.5 0 1 1 0 17h-2.356z",fill:"#FFF"}),Vt.el("path",{d:"M15.5 21.67c0-1.016-1.494-1.586-2.387-.782l-2.7 2.163A5.958 5.958 0 0 1 6.7 24.33h-.4c-1.035 0-1.8.69-1.8 1.573v4.235c0 .883.765 1.572 1.8 1.572h.4c1.458 0 2.754.423 3.82 1.287l2.598 2.161c.908.75 2.382.188 2.382-.876V21.67z",fill:"#4D4D4D"})]),{id:"sb3-ttsBlock",stroke:"#000","stroke-opacity":.15}),Vt.el("image",{id:"sb3-translateBlock",width:"40px",height:"40px",href:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAA21BMVEUAAAAAAAAAAAAAAADS0tIAAABHR0cAAADX19cAAAAAAACkpKRqamq2traurq6WlpbV1dWEhITHx8fPz8/Ly8vDw8O9vb0AAABMTEz////Z2dlXXnVMl//g4ODu7u7m5ub4+PhPmf/x8fH09PT6+vri4uNRmv/r6+1uqv/0+P9Ynv/p8v+rrrphZ33S5f+51v9ho/+1uMKBhpfH3v+Wmqhrcoacxf+Pvv/KzNSgpLGLkKDd6/+rzf9npv/AwsuDtv98s/90rv9jpP9GieeOrtm5ubl2fI7Z4u56otk5hEFfAAAAGXRSTlMAJhgM1wYyHvIkEWpBhXhc5U+uybyhk0YvleQYgwAABDpJREFUWMPtmNl6mzAQhQMCBAYbvLX1GIwxi7e2TtosTdKk+/L+T1QBVoQtJHDby5yLROYTPzOagSM4e9az6oVUrDgKxh39//Bwb+QBkTZ2VL3hypYilKWicpY6gmWcTCbxIoSh0xHjOkZXA4m0rlGcrcBsslcSmrYq4qm2GczmE6Hms6A8W4GQHZ1BTxXweuTCErGz1TEEaTpLymML6HVq87VhIWPRs21yNu679guNXn9hOnWVMUwanzxG0yCTdYQQts195umwJmnUDSatFHQRPaVvljkl4CAuRlWrCfD9uiZEbR+ObrnjfRDhwHUtdAi0gK/vLtts+VqDVfIMjZSmLEycBuD1D4kK8MHc+Ju3/FFQaHdXc4rBU/8NiCE+OJyAIQKuz32qjA7O1xzwqMtiUETAXeRzinZcyoPgsPpDcco3q9WD729WhTI/e1itbriUzwwtqPI0Q5et4ZoA6SDj1pCWOeB44qJ88aOiIB8j/xMH5IiUJwG+jfyHPMCNH20FQEpkPGnbnBeFuI78Fd82VWJCeTyQCzHb3pMCb8VAQhxBCkPKkzf2Z9J9mR9dCxqb3tBO17EoTw4ky0f0VXSnUCGE6LDp1tvlwK0cyNQMJA1DlL3Px8TenvTjpcAN5cD7VVSsoR992c4oS+aGcuDbzxFBfVqvv5L/375DCzeUAXfnOW5TJHudffvdzg3FwPdZvnbX6/LXr+9t3ZCzAAaMNh/X9BdAWzcUm9T2vnrpk91QbqOhLEDeDZuNHkBSX94Nm7ciAJOWAkW8WZIDl1MikAD57ZwceJsDL0VAfsPJwgzzO5cHvsmBb2IJkAlhB5InntlXlJcc8MO00GMzsHTbsMJDdU+hOxIeCfKuXYQu7ZJ5oDmExwPjfAEvyZ9lGyDW9tOWMH6l1z4nLwjrQ572RRugAvMS57mq4MH7czq9Kgpz1QZoDcI4DsHrWUjw4E1JbLeTSZ5z2gLYMTTwBnaOEwBvS1Ke86UUyF7isKpLrIHkSvVGBORdUQx8nFb0KAUy38aSCO8I510hMrhrBOrGEFIYGToPZM+Fn+XwiraiAMh2Uwnb+3DAC9Z/t3TIA2W7MwZkYbH+uZIC+f0jD3z9+vXF05hIAJTtcK3TLIDnMSLnhqeZlDo8eksYqH/3UskWPz7aCuDTX3urMiA5ejHCp7+YV4W9gxBnMFJP/XRwKNT3IEhLZpIGQMp86seNY6LlutRQgrFr6dLPLyELjm44eemIWt6C+JP0A1HffCIm4GDEw2jvpNTxbIwQ0kUTUYUYkgYTSXfMBU1Ee+G6fSwkOlpA/RFcJCR2erRHkllKSjNWhdd+NQbqkJrgunyPhKBIprpeiZyLZtEeCRNWQdlUZPU8yF1yYJ1J1HGGEC5iknS8pN0tRtoDDzTSNDLpqjMu2s4b9fBZg/TcJVHjrA7GSl/JZz7rWbX6A0ZzUfwVEqfrAAAAAElFTkSuQmCC"})]}static makeHighContrastIcons(){return[...kt.makeCommonIcons(),Vt.setProps(Vt.group([Vt.el("path",{d:"M12.71 2.44A2.41 2.41 0 0 1 12 4.16L8.08 8.08a2.45 2.45 0 0 1-3.45 0L.72 4.16A2.42 2.42 0 0 1 0 2.44 2.48 2.48 0 0 1 .71.71C1 .47 1.43 0 6.36 0s5.39.46 5.64.71a2.44 2.44 0 0 1 .71 1.73z",fill:"#231f20",opacity:".1"}),Vt.el("path",{d:"M6.36 7.79a1.43 1.43 0 0 1-1-.42L1.42 3.45a1.44 1.44 0 0 1 0-2c.56-.56 9.31-.56 9.87 0a1.44 1.44 0 0 1 0 2L7.37 7.37a1.43 1.43 0 0 1-1.01.42z",fill:"#000"})]),{id:"sb3-dropdownArrow-high-contrast",transform:"scale(0.944)"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M22.68 12.2a1.6 1.6 0 0 1-1.27.63h-7.69a1.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 .8A4.25 4.25 0 0 0 7.2 10.6a5.06 5.06 0 0 0 .54 4.62A5.58 5.58 0 0 0 12 17.74a2.26 2.26 0 0 1-.16 4.52A10.25 10.25 0 0 1 3.74 18a10.14 10.14 0 0 1-1.49-9.22 9.7 9.7 0 0 1 2.83-4.14A9.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-.26 1.39z",fill:"#000"}),Vt.el("path",{d:"M21.38 11.83h-7.61a.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.82 9.16 9.16 0 0 1-1.4-8.37A8.51 8.51 0 0 1 5.71 5.4a8.76 8.76 0 0 1 4.11-1.92 9.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-.62.75z",fill:"#000"})]),{id:"sb3-turnRight-high-contrast"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M20.34 18.21a10.24 10.24 0 0 1-8.1 4.22 2.26 2.26 0 0 1-.16-4.52 5.58 5.58 0 0 0 4.25-2.53 5.06 5.06 0 0 0 .54-4.62A4.25 4.25 0 0 0 15.55 9a4.31 4.31 0 0 0-2-.8 4.82 4.82 0 0 0-3.15.8l1.12 1.41A1.59 1.59 0 0 1 10.36 13H2.67a1.56 1.56 0 0 1-1.26-.63A1.54 1.54 0 0 1 1.13 11l1.72-7.43A1.59 1.59 0 0 1 4.38 2.4a1.57 1.57 0 0 1 1.24.6L6.7 4.35a10.66 10.66 0 0 1 7.72-1.68A9.88 9.88 0 0 1 19 4.81 9.61 9.61 0 0 1 21.83 9a10.08 10.08 0 0 1-1.49 9.21z",fill:"#000"}),Vt.el("path",{d:"M19.56 17.65a9.29 9.29 0 0 1-7.35 3.83 1.31 1.31 0 0 1-.08-2.62 6.53 6.53 0 0 0 5-2.92 6.05 6.05 0 0 0 .67-5.51 5.32 5.32 0 0 0-1.64-2.16 5.21 5.21 0 0 0-2.48-1A5.86 5.86 0 0 0 9 8.84L10.74 11a.59.59 0 0 1-.43 1H2.7a.6.6 0 0 1-.6-.75l1.71-7.42a.59.59 0 0 1 1-.21l1.67 2.1a9.71 9.71 0 0 1 7.75-2.07 8.84 8.84 0 0 1 4.12 1.92 8.68 8.68 0 0 1 2.54 3.72 9.14 9.14 0 0 1-1.33 8.36z",fill:"#000"})]),{id:"sb3-turnLeft-high-contrast"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M23.3 11c-.3.6-.9 1-1.5 1h-1.6c-.1 1.3-.5 2.5-1.1 3.6-.9 1.7-2.3 3.2-4.1 4.1-1.7.9-3.6 1.2-5.5.9-1.8-.3-3.5-1.1-4.9-2.3-.7-.7-.7-1.9 0-2.6.6-.6 1.6-.7 2.3-.2H7c.9.6 1.9.9 2.9.9s1.9-.3 2.7-.9c1.1-.8 1.8-2.1 1.8-3.5h-1.5c-.9 0-1.7-.7-1.7-1.7 0-.4.2-.9.5-1.2l4.4-4.4c.7-.6 1.7-.6 2.4 0L23 9.2c.5.5.6 1.2.3 1.8z",fill:"#000"}),Vt.el("path",{d:"M21.8 11h-2.6c0 1.5-.3 2.9-1 4.2-.8 1.6-2.1 2.8-3.7 3.6-1.5.8-3.3 1.1-4.9.8-1.6-.2-3.2-1-4.4-2.1-.4-.3-.4-.9-.1-1.2.3-.4.9-.4 1.2-.1 1 .7 2.2 1.1 3.4 1.1s2.3-.3 3.3-1c.9-.6 1.6-1.5 2-2.6.3-.9.4-1.8.2-2.8h-2.4c-.4 0-.7-.3-.7-.7 0-.2.1-.3.2-.4l4.4-4.4c.3-.3.7-.3.9 0L22 9.8c.3.3.4.6.3.9s-.3.3-.5.3z",fill:"#000"})]),{id:"sb3-loopArrow-high-contrast"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M28.456 21.675c-.009-.312-.087-.825-.256-1.702-.096-.495-.612-3.022-.753-3.73-.395-1.98-.76-3.92-1.142-6.113-.732-4.223-.693-6.05.344-6.527.502-.23 1.06-.081 1.842.35.413.227 2.181 1.365 2.07 1.296 1.993 1.243 3.463 1.775 4.928 1.549 1.527-.237 2.505-.06 2.877.618.348.635.015 1.416-.729 2.18-1.473 1.516-3.976 2.514-5.849 2.023-.822-.218-1.238-.464-2.38-1.266a9.737 9.737 0 0 0-.095-.066c.047.593.264 1.74.717 3.803.294 1.336 2.079 9.187 2.637 11.674l.002.012c.529 2.637-1.872 4.724-5.235 4.724-3.29 0-6.363-1.988-6.862-4.528-.53-2.64 1.873-4.734 5.233-4.734a8.411 8.411 0 0 1 2.65.437zM11.46 27.666c-.01-.319-.091-.84-.266-1.738-.09-.46-.595-2.937-.753-3.727-.39-1.96-.752-3.892-1.131-6.07-.732-4.224-.692-6.052.344-6.527.502-.23 1.06-.082 1.841.349.414.228 2.181 1.365 2.07 1.296 1.992 1.243 3.461 1.775 4.925 1.549 1.525-.24 2.504-.064 2.876.614.348.635.015 1.415-.728 2.18-1.474 1.517-3.977 2.513-5.847 2.017-.822-.218-1.237-.463-2.38-1.266a9.729 9.729 0 0 0-.094-.065c.047.593.264 1.74.717 3.802.294 1.337 2.078 9.19 2.636 11.675l.003.013c.517 2.638-1.884 4.732-5.234 4.732-3.286 0-6.359-1.993-6.87-4.54-.518-2.639 1.885-4.73 5.242-4.73.904 0 1.802.15 2.65.436z",stroke:"#000"}),Vt.el("path",{d:"M32.18 25.874C32.636 28.157 30.512 30 27.433 30c-3.07 0-5.923-1.843-6.372-4.126-.458-2.285 1.665-4.136 4.743-4.136.647 0 1.283.084 1.89.234a7 7 0 0 1 .938.302c.87-.02-.104-2.294-1.835-12.229-2.134-12.303 3.06-1.87 8.768-2.753 5.708-.885.076 4.82-3.65 3.844-3.724-.987-4.65-7.153.263 14.738zm-16.998 5.99C15.63 34.148 13.507 36 10.439 36c-3.068 0-5.92-1.852-6.379-4.136-.448-2.284 1.674-4.135 4.751-4.135 1.002 0 1.974.197 2.854.544.822-.055-.15-2.377-1.862-12.228-2.133-12.303 3.059-1.87 8.764-2.753 5.706-.894.076 4.821-3.648 3.834-3.723-.987-4.648-7.152.263 14.738z",fill:"#000"})]),{id:"sb3-musicBlock-high-contrast",fill:"none"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M8.753 34.602l-4.251 1.779 1.784-4.236c1.218-2.892 2.907-5.423 5.03-7.538L31.066 4.93c.846-.842 2.65-.41 4.032.967 1.38 1.375 1.816 3.173.97 4.015L16.318 29.59c-2.123 2.116-4.664 3.799-7.565 5.012",fill:"#FFF"}),Vt.el("path",{d:"M29.41 6.111s-4.45-2.379-8.202 5.771c-1.734 3.766-4.35 1.546-4.35 1.546"}),Vt.el("path",{d:"M36.42 8.825c0 .463-.14.873-.432 1.164l-9.335 9.301c.282-.29.41-.668.41-1.12 0-.874-.507-1.963-1.406-2.868-1.362-1.358-3.147-1.8-4.002-.99L30.99 5.01c.844-.84 2.65-.41 4.035.96.898.904 1.396 1.982 1.396 2.855M10.515 33.774a23.74 23.74 0 0 1-1.764.83L4.5 36.382l1.786-4.235c.258-.604.529-1.186.833-1.757.69.183 1.449.625 2.109 1.282.659.658 1.102 1.412 1.287 2.102",fill:"#4C97FF"}),Vt.el("path",{d:"M36.498 8.748c0 .464-.141.874-.433 1.165l-19.742 19.68c-2.131 2.111-4.673 3.793-7.572 5.01L4.5 36.381l.974-2.317 1.925-.808c2.899-1.218 5.441-2.899 7.572-5.01l19.742-19.68c.292-.292.432-.702.432-1.165 0-.647-.27-1.4-.779-2.123.249.172.498.377.736.614.898.905 1.396 1.983 1.396 2.856",fill:"#0b8e69",opacity:".15"}),Vt.el("path",{d:"M18.45 12.831a.904.904 0 1 1-1.807 0 .904.904 0 0 1 1.807 0z",fill:"#0b8e69"})]),{id:"sb3-penBlock-high-contrast",stroke:"#0b8e69",fill:"none","stroke-linejoin":"round"}),Vt.setProps(Vt.group([Vt.el("circle",{opacity:.25,cx:32,cy:16,r:4.5}),Vt.el("circle",{opacity:.5,cx:32,cy:12,r:4.5}),Vt.el("circle",{opacity:.75,cx:32,cy:8,r:4.5}),Vt.el("circle",{cx:32,cy:4,r:4.5}),Vt.el("path",{d:"M22.672 4.42l-6.172 4V6.1c0-2.01-1.563-3.6-3.5-3.6H4.1C2.076 2.5.5 4.076.5 6.1V14c0 1.927 1.584 3.512 3.6 3.6H13c1.902 0 3.5-1.653 3.5-3.6v-2.283l6.257 3.754.097.075c.02.02.098.054.146.054.267 0 .5-.217.5-.5V4.8c0 .037-.056-.094-.129-.243-.145-.242-.43-.299-.7-.137z",fill:"#000","stroke-linejoin":"round"})]),{id:"sb3-videoBlock-high-contrast",stroke:"#0b8e69",fill:"#FFF","stroke-opacity":.15}),Vt.setProps(Vt.group([Vt.el("circle",{fill:"#231f20",cx:8.35,cy:9.65,r:.97}),Vt.el("circle",{fill:"#231f20",cx:14.19,cy:9.65,r:.97}),Vt.el("path",{d:"M11.27 4.14c-3.94 0-7.13 3.19-7.13 7.13s3.19 7.13 7.13 7.13 7.13-3.19 7.13-7.13-3.19-7.13-7.13-7.13m0 1.3c3.22 0 5.84 2.61 5.84 5.84s-2.61 5.84-5.84 5.84-5.84-2.61-5.84-5.84 2.61-5.84 5.84-5.84",fill:"#231f20"}),Vt.el("path",{d:"M17.57 13.88c.57-.15 1.02-.6 1.17-1.17l.35-1.3c.16-.61 1.04-.61 1.2 0l.35 1.3c.15.57.6 1.02 1.18 1.17l1.3.35c.61.16.61 1.04 0 1.2l-1.3.35c-.57.15-1.02.6-1.18 1.17l-.35 1.3c-.17.62-1.04.62-1.2 0l-.35-1.3c-.15-.57-.6-1.02-1.17-1.17l-1.3-.35c-.61-.17-.61-1.04 0-1.2l1.3-.35Zm-16-11.43c.43-.12.76-.45.88-.88l.26-.98c.12-.46.78-.46.9 0l.26.98c.12.43.45.76.88.88l.98.26c.46.12.46.78 0 .9l-.98.26c-.43.11-.77.45-.88.88l-.26.98c-.12.46-.78.46-.9 0l-.26-.98a1.26 1.26 0 0 0-.88-.88l-.98-.26c-.46-.12-.46-.78 0-.9z",fill:"#ffbf00","fill-rule":"evenodd",stroke:"#0b8e69","stroke-miterlimit":"2","stroke-width":".5"}),Vt.el("path",{d:"M12.68 12.53c.2-.3.6-.38.9-.18s.38.6.18.9c-.56.83-1.41 1.26-2.48 1.26s-1.93-.43-2.48-1.26c-.2-.3-.12-.7.18-.9s.7-.12.9.18c.31.46.75.68 1.41.68s1.1-.22 1.41-.68Z",fill:"#231f20"}),Vt.el("path",{d:"M20.89 6.06a.57.57 0 0 1-.57-.57V2.2h-3.31c-.31 0-.57-.25-.57-.57s.25-.57.57-.57h3.88c.31 0 .57.25.57.57v3.86c0 .31-.25.57-.57.57M5.44 21.46H1.59a.57.57 0 0 1-.57-.57v-3.82c0-.31.25-.57.57-.57s.57.25.57.57v3.25h3.28c.31 0 .57.25.57.57s-.25.57-.57.57",fill:"#0b8e69"})]),{id:"sb3-faceSensingBlock-high-contrast",transform:"scale(1.67785234899 1.67785234899)"}),Vt.setProps(Vt.group([Vt.el("path",{d:"M25.644 20.5c-1.667 1.937-4.539 3.429-5.977 3.429a1.25 1.25 0 0 1-.557-.137c-.372-.186-.61-.542-.61-1.03 0-.105.017-.207.05-.308.076-.236.624-.986.727-1.173.27-.484.462-1.075.566-1.865A8.5 8.5 0 0 1 24 3.5h4a8.5 8.5 0 1 1 0 17h-2.356z",fill:"#FFF",stroke:"#0b8e69"}),Vt.el("path",{d:"M15.5 21.67c0-1.016-1.494-1.586-2.387-.782l-2.7 2.163A5.958 5.958 0 0 1 6.7 24.33h-.4c-1.035 0-1.8.69-1.8 1.573v4.235c0 .883.765 1.572 1.8 1.572h.4c1.458 0 2.754.423 3.82 1.287l2.598 2.161c.908.75 2.382.188 2.382-.876V21.67z",fill:"#000"})]),{id:"sb3-ttsBlock-high-contrast","stroke-opacity":.15}),Vt.el("image",{id:"sb3-translateBlock-high-contrast",width:"40px",height:"40px",href:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAxoAAARjCAMAAADfFKLnAAABhlBMVEUAAAALjWkOj2oLjmkAAAAQj2wkmnkYlHILj2kLjmkAAAAAAABsu6VouaIJjmgimncAAAAAAAALjml0v6kAAAAAAAAAAAAATzhjt6A9pogVk28XlHAVk28ZlHEAAAAAAAAAAAANj2oAAAAJj2oAAAAAAAByvahsu6VVsZcqnXwAAAAAAAAAAAAMj2oQkWsAAAAPkGwAAABHqo4AAAAclnMcl3MKj2kXlHIXk3EAAAALj2gAAAD///8AAAB9w6+ExrONyrmHyLWrzv/3+/r8/v6Fx7VpqP/0+fh7s/9Ml//4/PvK59/4+//u9f/l8P/V5v9vrP9an/9Smv/o6OjMzMwrKysDAwPp8//e7P+w0f+axf9xrf9kpf9jpP9ho/9Nl//e3t7E5Nu+4dfT09OUzb2QzLuZmZlMrJKGhoYpnHxlZWVgYGBCQkINDQ30+P/J4P/D3P+11P+Nvf90rv9Jlvby8vLc3Nyl1cik1ce+vr6DxrKlpaWfn58xnJZBpJWJiYl+fn4fHx9PedmHAAAAPHRSTlMAd4OAxg/0wohyDv78+Tj16Ik6+ux+WAb79e7mvbCemW1rZDYXC/n39PTw39u8t7RVNvX11NLDm5qOWx0x5AFdAAAGd0lEQVR42uzbV3faQBCG4XGChMEU4wLujntv6WXXIUAwxd3Gvfea3nv+eQaBcgS5ztV8zwWMfsB7js7uiAAAAAAAAP6fgKfCwRMg1l49OBzqJgC5DLfZO+nQa7oNovq2Ia2rJwhArFZ/QpVI+Fspr57b8BKAUAEzrgpmXhSHjBmgvDGtQwQglKdWFaU27KnWQ0TekEvruvYwAYh08ym3ML0ei8V2NvlnfZofn98gorC2DBKASFYaq8md9MLW1kJ6O7lqp9Hj0qzqFgGIxGlYtjeUepPkwU6D20AZIJidRmxhZnbxtTMN8rpQBshlpzGdTL2dTzjSYJEnBCCVnYaaS++uqb9pAEhnpzGXXFycn1PZo2g0ejpiL410EYBQhTRepnZTs2vz776f+yYd/EG3QQAiWVd+s+nNV/yX+NEQVyXiDS0EIFKNmeAEZlRe9jyuysSDNQQgkrsvo4qOfOofvgoCEMloNWs/cgNTx9FT+7RqaUV/KI7PcFoFYgVG+7iMxpbK+19UwU+tfyENEC/SvK+yAw8cdxy5XO53AmmAdI8bD/qbxh13HMv67Ex/RhogXVfzvQ6DHGlc6L09fYk0AJgjjalrza7fIw2QrjtSksZXfXFycqm/IQ0QrrPK5XWmcbWylD+/vUIaIFtnldaFNjx+lbd8qNjhMq78QDQug7l6eAwE46pMxsSiCAhVpy1hYu7y9cKM300AMoXbOQ5XyEvMaAn6opbjKQ7jkw9L6SBZSOsxe66pqLSMNnIb/hG8TYFk3mqt66nMw4Gs2m+OEIBgE9zGcFtZHeNN/Qe3OwhAsu5HQ3fq2qiU0XG3Cd+GAwAAAAD8YQ8OBAAAAACA/F8bQVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVYQ8OBAAAAACA/F8bQVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV2IMDAQAAAAAg/9dGUFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUV9uBAAAAAAADI/7URVFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWFPTgQAAAAAADyf20EVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVhDw4EAAAAAID8XxtBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVXYgwMBAAAAACD/10ZQVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVRX24EAAAAAAAMj/tRFUVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVYU9OBAAAAAAAPJ/bQRVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWEPDgQAAAAAgPxfG0FVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVdiDAwEAAAAAIP/XRlBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVFfbgQAAAAAAAyP+1EVRVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVhT04EAAAAAAA8n9tBFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVYQ8OBAAAAACA/F8bQVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV2oNDAgAAAABB/1/7wgQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMArKwCvdMdAc1YAAAAASUVORK5CYII="})]}static iconName(t,e){return"high-contrast"===e&&At.has(t)?t+"-high-contrast":t}static makeStyle(){const t=Vt.el("style");return t.appendChild(Vt.cdata(kt.cssContent)),t}static get defaultFont(){return"500 12pt Helvetica Neue, Helvetica, sans-serif"}static get commentFont(){return"400 12pt Helvetica Neue, Helvetica, sans-serif"}}const{defaultFont:wt,commentFont:vt,makeStyle:yt,makeOriginalIcons:Et,makeHighContrastIcons:St,iconName:Ot}=kt;function Tt(t,e){if(t.classList)t.classList.add(e);else{const s=(t.getAttribute("class")||"").split(/\s+/).filter(Boolean);s.includes(e)||(s.push(e),t.setAttribute("class",s.join(" ")))}}class Lt{constructor(t){Object.assign(this,t),this.el=null,this.height=12,this.metrics=null,this.x=0}get isLabel(){return!0}draw(t){return this.el}get width(){return this.metrics.width}measure(){const t=this.value,e="sb3-"+this.cls;this.el=Vt.text(0,13.1,t,{class:"sb3-label "+e});let s=Lt.metricsCache[e];if(s||(s=Lt.metricsCache[e]=Object.create(null)),Object.hasOwnProperty.call(s,t))this.metrics=s[t];else{const e=/comment-label/.test(this.cls)?vt:wt;this.metrics=s[t]=Lt.measure(t,e)}}static measure(t,e){const s=Lt.measuring;s.font=e;return{width:s.measureText(t).width}}}Lt.metricsCache={},Lt.toMeasure=[];class Rt{constructor(t){Object.assign(this,t);const e=Rt.icons[this.name];if(!e)throw Error("no info for icon: "+this.name);Object.assign(this,e)}get isIcon(){return!0}draw(t){return Vt.symbol("#sb3-"+Ot(this.name,t),{width:this.width,height:this.height})}static get icons(){return{greenFlag:{width:20,height:21,dy:-1},stopSign:{width:20,height:20},turnLeft:{width:24,height:24},turnRight:{width:24,height:24},loopArrow:{width:24,height:24},addInput:{width:4,height:8},delInput:{width:4,height:8},list:{width:15,height:18},musicBlock:{width:40,height:40},penBlock:{width:40,height:40},videoBlock:{width:40,height:40,dy:10},faceSensingBlock:{width:40,height:40,dy:3.9932885906},ttsBlock:{width:40,height:40},translateBlock:{width:40,height:40},wedoBlock:{width:40,height:40},ev3Block:{width:40,height:40},microbitBlock:{width:40,height:40},makeymakeyBlock:{width:40,height:40},gdxforBlock:{width:40,height:40},boostBlock:{width:40,height:40}}}}class Ct{constructor(){this.width=1,this.height=40,this.x=0}get isLine(){return!0}measure(){}draw(t,e){return Vt.el("line",{class:"sb3-extension-line","stroke-linecap":"round",x1:0,y1:0,x2:0,y2:40})}}class Nt{constructor(t){if(Object.assign(this,t),this.x=0,this.rows&&this.rows.length>0){const t=this.rows.length,e=this.rows[0].length,s=1,i=26-(t-1)*s;this.cellSize=Math.max(1,Math.floor(i/t)),this.width=e*(this.cellSize+s)-s,this.height=t*(this.cellSize+s)-s}else this.width=0,this.height=0,this.cellSize=0}get isMatrix(){return!0}measure(){}draw(t,e){if(!this.rows||0===this.rows.length)return Vt.group([]);const s=this.cellSize,i=s+1,o=[];for(let t=0;t<this.rows.length;t++){const a=this.rows[t];for(let r=0;r<a.length;r++){const n=r*i,l=t*i,c=!0===a[r],h=Vt.el("rect",{x:n,y:l,width:s,height:s,rx:1,ry:1,"stroke-width":0});c?h.setAttribute("fill","#FFFFFF"):Tt(h,"sb3-"+e.info.category),o.push(h)}}return Vt.group(o)}}class Mt{constructor(t){Object.assign(this,t),t.label&&(this.label=Ft(t.label)),t.value&&t.value.isMatrix&&(this.matrixView=new Nt(t.value)),this.isBoolean="boolean"===this.shape,this.isDropdown="dropdown"===this.shape,this.isRound=!(this.isBoolean||this.isDropdown),this.x=0}get isInput(){return!0}measure(){this.hasLabel&&this.label.measure(),this.matrixView&&this.matrixView.measure()}static get shapes(){return{string:Vt.pillRect,number:Vt.pillRect,"number-dropdown":Vt.pillRect,color:Vt.pillRect,dropdown:Vt.roundRect,boolean:Vt.pointedRect,stack:Vt.stackRect,reporter:Vt.pillRect}}draw(t,e){let s,i,o;const a=!!this.matrixView;if(a){o=11;s=this.matrixView.width+o+31,this.height=32}else this.isBoolean?s=48:this.isColor?s=40:this.hasLabel?(i=this.label.draw(t),this.hasArrow?(o=11,s=this.label.width+o+31):(o=this.label.width>=18?11:(40-this.label.width)/2,s=this.label.width+2*o),i=Vt.move(o,9,i)):s=this.isInset?30:null;this.width=s;const r=this.height||32;this.height=r;const n=Mt.shapes[this.shape](s,r);Vt.setProps(n,{class:`${this.isColor?"":"sb3-"+e.info.category} sb3-input sb3-input-${this.shape}`}),this.isColor?Vt.setProps(n,{fill:this.value}):"dropdown"===this.shape?e.info.color&&Vt.setProps(n,{fill:e.info.color,stroke:"rgba(0, 0, 0, 0.2)"}):"number-dropdown"===this.shape?(Tt(n,`sb3-${e.info.category}-alt`),e.info.color&&Vt.setProps(n,{fill:"rgba(0, 0, 0, 0.1)",stroke:"rgba(0, 0, 0, 0.15)"})):"boolean"===this.shape&&(!function(t,e){if(t.classList)t.classList.remove(e);else{const s=(t.getAttribute("class")||"").split(/\s+/).filter((t=>t!==e));s.length?t.setAttribute("class",s.join(" ")):t.removeAttribute("class")}}(n,"sb3-"+e.info.category),Tt(n,`sb3-${e.info.category}-dark`),e.info.color&&Vt.setProps(n,{fill:"rgba(0, 0, 0, 0.15)"}));const l=Vt.group([n]);if(a){const s=o,i=(r-this.matrixView.height)/2,a=this.matrixView.draw(t,e);l.appendChild(Vt.move(s,i,a))}return this.hasLabel&&l.appendChild(i),this.hasArrow&&l.appendChild(Vt.move(s-24,32===r?12.8505114083:(r-32)/2+12.8505114083,Vt.symbol("high-contrast"===t?"#sb3-dropdownArrow-high-contrast":"#sb3-dropdownArrow",{}))),l}}class Bt{constructor(t){Object.assign(this,t),this.children=t.children.map(Ft),this.comment=this.comment?Ft(this.comment):null,this.isRound=this.isReporter,this.block=t,this.info={...t.info},Object.prototype.hasOwnProperty.call(s,this.info.category)&&(this.info.category=s[this.info.category]),Object.prototype.hasOwnProperty.call(e,this.info.category)&&(this.children.unshift(new Ct),this.children.unshift(new Rt({name:this.info.category+"Block"})),this.info.category="extension"),this.x=0,this.width=null,this.height=null,this.firstLine=null,this.innerWidth=null}get isBlock(){return!0}measure(){for(const t of this.children)t.measure&&t.measure();this.comment&&this.comment.measure()}static get shapes(){return{stack:Vt.stackRect,"c-block":Vt.stackRect,"if-block":Vt.stackRect,celse:Vt.stackRect,cend:Vt.stackRect,cap:Vt.capRect,reporter:Vt.pillRect,boolean:Vt.pointedRect,hat:Vt.hatRect,cat:Vt.catHat,"define-hat":Vt.procHatRect,ring:Vt.pillRect}}drawSelf(t,e,s,i){if(i.length>1)return Vt.mouthRect(e,s,this.isFinal,i,{class:"sb3-"+this.info.category});if("outline"===this.info.shape)return Vt.setProps(Vt.stackRect(e,s),{class:`sb3-${this.info.category} sb3-${this.info.category}-alt`});if(this.isRing){const t=this.children[0];if(t&&(t.isInput||t.isBlock||t.isScript))return Vt.roundRect(e,s,{class:"sb3-"+this.info.category})}const o=Bt.shapes[this.info.shape];if(!o)throw Error("no shape func: "+this.info.shape);return o(e,s,{class:"sb3-"+this.info.category})}static get padding(){return{hat:[24,8],cat:[24,8],"define-hat":[20,16],null:[4,4]}}horizontalPadding(t){if(this.isRound){if(t.isIcon)return 16;if(t.isLabel)return 12;if(t.isDropdown)return 12;if(t.isBoolean)return 12;if(t.isRound)return 4}else if(this.isBoolean){if(t.isIcon)return 24;if(t.isLabel)return 20;if(t.isDropdown)return 20;if(t.isRound&&t.isBlock)return 24;if(t.isRound)return 20;if(t.isBoolean)return 8}return 8}marginBetween(t,e){return t.isLabel&&e.isLabel?4.447998046875:8}draw(t){const e="define-hat"===this.info.shape;let s=this.children;const i=this.isCommand,o=Bt.padding[this.info.shape]||Bt.padding.null,a=o[0],r=o[1];let n="cat"===this.info.shape?16:0;const l=function(t){this.y=t,this.width=0,this.height=i?40:32,this.children=[]};let c=0,h=0,p=new l(n);const d=()=>{0===u.length?p.height+=a+r:(p.height-=11,p.y-=2),n+=p.height,u.push(p)};if(this.info.isRTL){let t=0;const e=()=>{s=s.slice(0,t).concat(s.slice(t,i).reverse()).concat(s.slice(i))};let i;for(i=0;i<s.length;i++)s[i].isScript&&(e(),t=i+1);t<i&&e()}const u=[];let g,f;for(let e=0;e<s.length;e++){const i=s[e];if(i.el=i.draw(t,this),i.isScript&&this.isCommand)this.hasScript=!0,d(),i.y=n-1,u.push(i),h=Math.max(h,Math.max(1,i.width)),i.height=Math.max(29,i.height+3)-2,n+=i.height,p=new l(n),g=null;else if(i.isArrow)p.children.push(i),g=i;else{if(u.length||(f=i),g&&(p.width+=this.marginBetween(g,i)),null!=s[0]){const t=48-this.horizontalPadding(s[0]);(this.isCommand||this.isOutline)&&!i.isLabel&&!i.isIcon&&p.width<t&&(p.width=t)}i.isIcon&&0===e&&this.isCommand&&(p.height=Math.max(p.height,i.height+8)),i.x=p.width,p.width+=i.width,c=Math.max(c,p.width),i.isLabel||(p.height=Math.max(p.height,i.height)),p.children.push(i),g=i}}d();let b=s.length?this.horizontalPadding(s[0]):0;c+=b+(s.length?this.horizontalPadding(f):0);const m=c;c=Math.max(this.hasScript?160:this.isHat?100:this.isCommand||this.isOutline?64:this.isReporter?48:0,c),this.isReporter&&(b+=(c-m)/2),this.height=n,this.width=h?Math.max(c,15+h):c,this.firstLine=u[0],this.innerWidth=c;const V=[];for(let t=0;t<u.length;t++){const s=u[t];if(s.isScript){V.push(Vt.move(16,s.y,s.el));continue}const i=s.height;for(let o=0;o<s.children.length;o++){const n=s.children[o];if(n.isArrow){V.push(Vt.move(c-32,this.height-28,n.el));continue}let l=a+(i-n.height-a-r)/2;n.isLabel&&0===t?l-=1:e&&n.isLabel?l+=3:n.isIcon&&(l+=0|n.dy,this.isCommand&&0===t&&0===o&&(l+=4));let h=b+n.x;n.dx&&(h+=n.dx),V.push(Vt.move(h,s.y+l|0,n.el))}}const A=this.drawSelf(t,c,this.height,u);V.splice(0,0,A),this.info.color&&Vt.setProps(A,{fill:this.info.color,stroke:"rgba(0, 0, 0, 0.2)"});const k=Vt.group(V);return this.block&&this.block.blockPath&&Vt.setProps(k,{"data-block-path":this.block.blockPath}),k}}class xt{constructor(t){Object.assign(this,t),this.label=Ft(t.label),this.width=null}get isComment(){return!0}static get lineLength(){return 12}get height(){return 20}measure(){this.label.measure()}draw(t){const e=this.label.draw(t);return this.width=this.label.width+16,Vt.group([Vt.commentLine(this.hasBlock?xt.lineLength:0,6),Vt.commentRect(this.width,this.height,{class:"sb3-comment"}),Vt.move(8,4,e)])}}class It{constructor(t){Object.assign(this,t),this.child=Ft(t.child),this.width=null,this.height=null,this.y=0}get isGlow(){return!0}measure(){this.child.measure()}drawSelf(t){const e=this.child;let s;const i=this.width,o=this.height-1;return s=e.isScript?!e.isEmpty&&e.blocks[0].isHat?Vt.hatRect(i,o):e.isFinal?Vt.capRect(i,o):Vt.stackRect(i,o):e.drawSelf(t,i,o,[]),Vt.setProps(s,{class:"sb3-diff sb3-diff-ins"})}draw(t){const e=this.child,s=e.isScript?e.draw(t,!0):e.draw(t);return this.width=e.width,this.height=e.isBlock&&e.firstLine.height||e.height,Vt.group([s,this.drawSelf(t)])}}class Pt{constructor(t){Object.assign(this,t),this.blocks=t.blocks.map(Ft),this.y=0}get isScript(){return!0}measure(){for(const t of this.blocks)t.measure()}draw(t,e){const s=[];let i=1;this.width=0;for(const o of this.blocks){const a=e?0:2,r=o.draw(t);s.push(Vt.move(a,i,r)),this.width=Math.max(this.width,o.width);if("-"===o.diff){const t=o.width,e=o.firstLine.height||o.height;s.push(Vt.move(a,i+e/2+1,Vt.strikethroughLine(t))),this.width=Math.max(this.width,o.width)}i+=o.height;const n=o.comment;if(n){const e=o.firstLine,a=o.innerWidth+2+xt.lineLength,r=i-o.height+e.height/2,l=n.draw(t);s.push(Vt.move(a,r-n.height/2,l)),this.width=Math.max(this.width,a+n.width)}}const o=this.blocks[this.blocks.length-1];return this.height=i+1,e||this.isFinal||(this.height+=o.hasPuzzle?8:0),!e&&o.isGlow&&(this.height+=7),Vt.group(s)}}class Dt{constructor(t,e){Object.assign(this,t),this.scripts=t.scripts.map(Ft),this.doc=t,this.width=null,this.height=null,this.el=null,this.defs=null,this.scale=e.scale,this.iconStyle=e.style.replace("scratch3-",""),this.elementMap=new Map}measure(){this.scripts.forEach((t=>{t.measure()}))}render(t){if("function"==typeof t)throw Error("render() no longer takes a callback");this.measure();let e=0,s=0;const i=[];for(let t=0;t<this.scripts.length;t++){const o=this.scripts[t];s&&(s+=10),o.y=s,i.push(Vt.move(0,s,o.draw(this.iconStyle))),s+=o.height,t!==this.scripts.length-1&&(s+=36),e=Math.max(e,o.width+4)}this.width=e,this.height=s;const o=Vt.newSVG(e,s,this.scale),a="high-contrast"===this.iconStyle?St():Et();return o.appendChild(this.defs=Vt.withChildren(Vt.el("defs"),a)),o.appendChild(Vt.setProps(Vt.group(i),{style:`transform: scale(${this.scale})`})),this.el=o,this._buildElementMap(),o}_buildElementMap(){if(!this.el||!this.el.querySelectorAll)return;this.elementMap.clear();this.el.querySelectorAll("[data-block-path]").forEach((t=>{const e=t.getAttribute("data-block-path");e&&this.elementMap.set(e,{el:t})}))}getElementByPath(t){const e=this.elementMap.get(t);return e?e.el:null}highlightBlock(t,e={}){const s=this.getElementByPath(t);if(!s)return!1;const i=s.firstElementChild;return i&&(i.classList.remove("sb3-highlight","sb3-highlight-colorShift","sb3-blink"),i.getBBox(),i.classList.add("sb3-highlight"),e.colorShift&&i.classList.add("sb3-highlight-colorShift"),e.blink&&i.classList.add("sb3-blink")),!0}clearHighlight(t=null){if(t){const e=this.getElementByPath(t);if(e){const t=e.firstElementChild;t&&t.classList.remove("sb3-highlight","sb3-highlight-colorShift","sb3-blink")}}else{this.el.querySelectorAll(".sb3-highlight").forEach((t=>{t.classList.remove("sb3-highlight","sb3-highlight-colorShift","sb3-blink")}))}}exportSVGString(){if(null==this.el)throw Error("call draw() first");const t=yt();this.defs.appendChild(t);const e=(new Vt.XMLSerializer).serializeToString(this.el);return this.defs.removeChild(t),e}exportSVG(){return"data:image/svg+xml;utf8,"+this.exportSVGString().replace(/[#]/g,encodeURIComponent)}toCanvas(t,e){e=e||1;const s=Vt.makeCanvas();s.width=Math.max(1,this.width*e*this.scale),s.height=Math.max(1,this.height*e*this.scale);const i=s.getContext("2d"),o=new Image;o.src=this.exportSVG(),o.onload=()=>{i.save(),i.scale(e,e),i.drawImage(o,0,0),i.restore(),t(s)}}exportPNG(t,e){this.toCanvas((e=>{URL&&URL.createObjectURL&&Blob&&e.toBlob?e.toBlob((e=>{t(URL.createObjectURL(e))}),"image/png"):t(e.toDataURL("image/png"))}),e)}}const Ft=(t,e)=>new((t=>{switch(t.constructor){case L:return Lt;case R:return Rt;case N:return Mt;case M:return Bt;case B:return xt;case x:return It;case I:return Pt;case P:return Dt;default:throw Error("no view for "+t.constructor.name)}})(t))(t,e);const _t=kt.makeStyle;const Ht=function(t){const e=t.document;function s(t,e){if((e={style:"scratch2",...e}).scale=e.scale||1,"scratch2"===e.style)return ut(t,e);if(/^scratch3($|-)/.test(e.style))return Ft(t,e);throw Error("Unknown style: "+e.style)}function i(t,e){if("function"==typeof e)throw Error("render() no longer takes a callback");const i=s(t,e).render();return i.classList.add("scratchblocks-style-"+e.style),i}function o(t,s){s={inline:!1,...s};const i=t.innerHTML.replace(/<br>\s?|\n|\r\n|\r/gi,"\n"),o=e.createElement("pre");o.innerHTML=i;let a=o.textContent;return s.inline&&(a=a.replace("\n","")),a}function a(t,s,i,o){let a;if(o.inline){a=e.createElement("span");let t="scratchblocks scratchblocks-inline";i.scripts[0]&&!i.scripts[0].isEmpty&&(t+=" scratchblocks-inline-"+i.scripts[0].blocks[0].shape),a.className=t,a.style.display="inline-block",a.style.verticalAlign="middle"}else a=e.createElement("div"),a.className="scratchblocks";a.appendChild(s),t.innerHTML="",t.appendChild(a)}return function(t){Z.init(t),ot.measuring=Z.makeCanvas().getContext("2d")}(t),function(t){Vt.init(t),Lt.measuring=Vt.makeCanvas().getContext("2d")}(t),{allLanguages:k,loadLanguages:w,stringify:function(t){return t.stringify()},Label:L,Icon:R,Input:N,Block:M,Comment:B,Script:I,Document:P,newView:s,read:o,parse:K,replace:a,render:i,renderMatching:function(t,s){t=t||"pre.blocks",s={style:"scratch2",inline:!1,languages:["en"],scale:1,read:o,parse:K,render:i,replace:a,...s};[].slice.apply(e.querySelectorAll(t)).forEach((t=>{const e=s.read(t,s),i=s.parse(e,s),o=s.render(i,s);s.replace(t,o,i,s)}))},appendStyles:function(){e.head.appendChild(gt()),e.head.appendChild(_t())},highlightBlock:function(t,e,s={}){return!(!t||"function"!=typeof t.highlightBlock)&&t.highlightBlock(e,s)},clearHighlight:function(t,e=null){t&&"function"==typeof t.clearHighlight&&t.clearHighlight(e)},getBlockByPath:function(t,e){return t&&"function"==typeof t.getBlockByPath?t.getBlockByPath(e):null},getElementByPath:function(t,e){return t&&"function"==typeof t.getElementByPath?t.getElementByPath(e):null}}}(window);Ht.appendStyles();export{Ht as default};
12
12
  //# sourceMappingURL=scratchblocks-plus.min.es.js.map