maze-blockly-wrapper 0.2.6 → 0.3.2
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.
- package/dist/blockly-CB1haBOu.cjs +329 -0
- package/dist/blockly-CB1haBOu.cjs.map +1 -0
- package/dist/blockly-D9trJ_x0.js +329 -0
- package/dist/blockly-D9trJ_x0.js.map +1 -0
- package/dist/blockly_compressed-Bdba50O4.js +21043 -0
- package/dist/{blockly_compressed-BMyLVN-Q.js.map → blockly_compressed-Bdba50O4.js.map} +1 -1
- package/dist/blockly_compressed-DKwMdvF1.cjs +21042 -0
- package/dist/{blockly_compressed-BSXJbxOI.cjs.map → blockly_compressed-DKwMdvF1.cjs.map} +1 -1
- package/dist/blocks-B05dnyOn.js +1707 -0
- package/dist/{blocks-B72zId9w.js.map → blocks-B05dnyOn.js.map} +1 -1
- package/dist/blocks-BabbRNKU.cjs +1707 -0
- package/dist/{blocks-GkRPBplU.cjs.map → blocks-BabbRNKU.cjs.map} +1 -1
- package/dist/components/BlocklyDebugTest.d.ts +30 -0
- package/dist/components/maze/MazeGame.d.ts +1 -0
- package/dist/index-C2TQzLih.js +5038 -0
- package/dist/index-C2TQzLih.js.map +1 -0
- package/dist/index-CeTmKa8Y.cjs +5053 -0
- package/dist/index-CeTmKa8Y.cjs.map +1 -0
- package/dist/index.cjs.js +34 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +32 -31
- package/dist/javascript-B767_urL.js +969 -0
- package/dist/{javascript-CBgY3c4m.js.map → javascript-B767_urL.js.map} +1 -1
- package/dist/javascript-Diow8phl.cjs +969 -0
- package/dist/{javascript-DCJc0bzp.cjs.map → javascript-Diow8phl.cjs.map} +1 -1
- package/dist/utils/blocklySetup.d.ts +4 -0
- package/package.json +1 -1
- package/dist/blockly-B8_W0qMx.js +0 -328
- package/dist/blockly-B8_W0qMx.js.map +0 -1
- package/dist/blockly-D-XLGkbZ.cjs +0 -2
- package/dist/blockly-D-XLGkbZ.cjs.map +0 -1
- package/dist/blockly_compressed-BMyLVN-Q.js +0 -15717
- package/dist/blockly_compressed-BSXJbxOI.cjs +0 -792
- package/dist/blocks-B72zId9w.js +0 -1316
- package/dist/blocks-GkRPBplU.cjs +0 -4
- package/dist/index-D10FGDwl.js +0 -3666
- package/dist/index-D10FGDwl.js.map +0 -1
- package/dist/index-I2TnBYCs.cjs +0 -74
- package/dist/index-I2TnBYCs.cjs.map +0 -1
- package/dist/javascript-CBgY3c4m.js +0 -819
- package/dist/javascript-DCJc0bzp.cjs +0 -219
package/dist/blocks-GkRPBplU.cjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Re=require("./index-I2TnBYCs.cjs"),Ae=require("./blockly_compressed-BSXJbxOI.cjs");var a={exports:{}},be=a.exports,b;function Le(){return b||(b=1,(function(L,ve){(function(I,t){L.exports=t(Ae.requireBlockly_compressed())})(be,function(I){var t=I.__namespace__,T=t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"variables_get_dynamic",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_dynamic_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableDynamicSetterGetter"]},{type:"variables_set_dynamic",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_dynamic_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableDynamicSetterGetter"]}]),N={customContextMenu:function(e){if(this.isInFlyout)(this.type==="variables_get_dynamic"||this.type==="variables_get_reporter_dynamic")&&(o={text:t.Msg$$module$build$src$core$msg.RENAME_VARIABLE,enabled:!0,callback:M(this)},i=this.getField("VAR").getText(),i={text:t.Msg$$module$build$src$core$msg.DELETE_VARIABLE.replace("%1",i),enabled:!0,callback:f(this)},e.unshift(o),e.unshift(i));else{if(this.type==="variables_get_dynamic")var s="variables_set_dynamic",o=t.Msg$$module$build$src$core$msg.VARIABLES_GET_CREATE_SET;else s="variables_get_dynamic",o=t.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET;var i=this.getField("VAR");s={type:s,fields:{VAR:i.saveState(!0)}},e.push({enabled:this.workspace.remainingCapacity()>0,text:o.replace("%1",i.getText()),callback:t.callbackFactory$$module$build$src$core$contextmenu(this,s)})}},onchange:function(e){e=this.getFieldValue("VAR"),e=t.getVariable$$module$build$src$core$variables(this.workspace,e),this.type==="variables_get_dynamic"?this.outputConnection.setCheck(e.getType()):this.getInput("VALUE").connection.setCheck(e.getType())}},M=function(e){return function(){const s=e.workspace,o=e.getField("VAR").getVariable();t.renameVariable$$module$build$src$core$variables(s,o)}},f=function(e){return function(){const s=e.getField("VAR").getVariable();s&&t.deleteVariable$$module$build$src$core$variables(s.getWorkspace(),s,e)}};t.registerMixin$$module$build$src$core$extensions("contextMenu_variableDynamicSetterGetter",N),t.defineBlocks$$module$build$src$core$common(T);var C={blocks:T},d=t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"variables_get",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableSetterGetter"]},{type:"variables_set",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableSetterGetter"]}]),P={customContextMenu:function(e){if(this.isInFlyout)(this.type==="variables_get"||this.type==="variables_get_reporter")&&(o={text:t.Msg$$module$build$src$core$msg.RENAME_VARIABLE,enabled:!0,callback:D(this)},i=this.getField("VAR").getText(),i={text:t.Msg$$module$build$src$core$msg.DELETE_VARIABLE.replace("%1",i),enabled:!0,callback:B(this)},e.unshift(o),e.unshift(i));else{if(this.type==="variables_get")var s="variables_set",o=t.Msg$$module$build$src$core$msg.VARIABLES_GET_CREATE_SET;else s="variables_get",o=t.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET;var i=this.getField("VAR");s={type:s,fields:{VAR:i.saveState(!0)}},e.push({enabled:this.workspace.remainingCapacity()>0,text:o.replace("%1",i.getText()),callback:t.callbackFactory$$module$build$src$core$contextmenu(this,s)})}}},D=function(e){return function(){const s=e.workspace,o=e.getField("VAR").getVariable();t.renameVariable$$module$build$src$core$variables(s,o)}},B=function(e){return function(){const s=e.getField("VAR").getVariable();s&&t.deleteVariable$$module$build$src$core$variables(s.getWorkspace(),s,e)}};t.registerMixin$$module$build$src$core$extensions("contextMenu_variableSetterGetter",P),t.defineBlocks$$module$build$src$core$common(d);var y={blocks:d},n=t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"text",message0:"%1",args0:[{type:"field_input",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["text_quotes","parent_tooltip_when_inline"]},{type:"text_join",message0:"",output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_JOIN_HELPURL}",tooltip:"%{BKY_TEXT_JOIN_TOOLTIP}",mutator:"text_join_mutator"},{type:"text_create_join_container",message0:"%{BKY_TEXT_CREATE_JOIN_TITLE_JOIN} %1 %2",args0:[{type:"input_dummy"},{type:"input_statement",name:"STACK"}],style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_TOOLTIP}",enableContextMenu:!1},{type:"text_create_join_item",message0:"%{BKY_TEXT_CREATE_JOIN_ITEM_TITLE_ITEM}",previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_ITEM_TOOLTIP}",enableContextMenu:!1},{type:"text_append",message0:"%{BKY_TEXT_APPEND_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_TEXT_APPEND_VARIABLE}"},{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,style:"text_blocks",extensions:["text_append_tooltip"]},{type:"text_length",message0:"%{BKY_TEXT_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"text_blocks",tooltip:"%{BKY_TEXT_LENGTH_TOOLTIP}",helpUrl:"%{BKY_TEXT_LENGTH_HELPURL}"},{type:"text_isEmpty",message0:"%{BKY_TEXT_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"text_blocks",tooltip:"%{BKY_TEXT_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_TEXT_ISEMPTY_HELPURL}"},{type:"text_indexOf",message0:"%{BKY_TEXT_INDEXOF_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"END",options:[["%{BKY_TEXT_INDEXOF_OPERATOR_FIRST}","FIRST"],["%{BKY_TEXT_INDEXOF_OPERATOR_LAST}","LAST"]]},{type:"input_value",name:"FIND",check:"String"}],output:"Number",style:"text_blocks",helpUrl:"%{BKY_TEXT_INDEXOF_HELPURL}",inputsInline:!0,extensions:["text_indexOf_tooltip"]},{type:"text_charAt",message0:"%{BKY_TEXT_CHARAT_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"WHERE",options:[["%{BKY_TEXT_CHARAT_FROM_START}","FROM_START"],["%{BKY_TEXT_CHARAT_FROM_END}","FROM_END"],["%{BKY_TEXT_CHARAT_FIRST}","FIRST"],["%{BKY_TEXT_CHARAT_LAST}","LAST"],["%{BKY_TEXT_CHARAT_RANDOM}","RANDOM"]]}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_CHARAT_HELPURL}",inputsInline:!0,mutator:"text_charAt_mutator"}]),k={init:function(){this.WHERE_OPTIONS_1=[[t.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_START_FROM_START,"FROM_START"],[t.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_START_FROM_END,"FROM_END"],[t.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[t.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_END_FROM_START,"FROM_START"],[t.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_END_FROM_END,"FROM_END"],[t.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_END_LAST,"LAST"]],this.setHelpUrl(t.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_HELPURL),this.setStyle("text_blocks"),this.appendValueInput("STRING").setCheck("String").appendField(t.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT);const e=s=>{const o=t.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this["WHERE_OPTIONS_"+s]});return o.setValidator(function(i){const l=this.getValue();i=i==="FROM_START"||i==="FROM_END",i!==(l==="FROM_START"||l==="FROM_END")&&this.getSourceBlock().updateAt_(s,i)}),o};this.appendDummyInput("WHERE1_INPUT").appendField(e(1),"WHERE1"),this.appendDummyInput("AT1"),this.appendDummyInput("WHERE2_INPUT").appendField(e(2),"WHERE2"),this.appendDummyInput("AT2"),t.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL&&this.appendDummyInput("TAIL").appendField(t.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL),this.setInputsInline(!0),this.setOutput(!0,"String"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(t.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TOOLTIP)},mutationToDom:function(){const e=t.createElement$$module$build$src$core$utils$xml("mutation");var s=this.getInput("AT1")instanceof t.ValueInput$$module$build$src$core$inputs$value_input;return e.setAttribute("at1",`${s}`),s=this.getInput("AT2")instanceof t.ValueInput$$module$build$src$core$inputs$value_input,e.setAttribute("at2",`${s}`),e},domToMutation:function(e){const s=e.getAttribute("at1")==="true";e=e.getAttribute("at2")==="true",this.updateAt_(1,s),this.updateAt_(2,e)},updateAt_:function(e,s){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),s?(this.appendValueInput("AT"+e).setCheck("Number"),t.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+e).appendField(t.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+e),e===2&&t.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(t.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL)),e===1&&(this.moveInputBefore("AT1","WHERE2_INPUT"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","WHERE2_INPUT"))}};n.text_getSubstring=k,n.text_changeCase={init:function(){const e=[[t.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE,"UPPERCASE"],[t.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE,"LOWERCASE"],[t.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_OPERATOR_TITLECASE,"TITLECASE"]];this.setHelpUrl(t.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_HELPURL),this.setStyle("text_blocks"),this.appendValueInput("TEXT").setCheck("String").appendField(t.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:e}),"CASE"),this.setOutput(!0,"String"),this.setTooltip(t.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_TOOLTIP)}},n.text_trim={init:function(){const e=[[t.Msg$$module$build$src$core$msg.TEXT_TRIM_OPERATOR_BOTH,"BOTH"],[t.Msg$$module$build$src$core$msg.TEXT_TRIM_OPERATOR_LEFT,"LEFT"],[t.Msg$$module$build$src$core$msg.TEXT_TRIM_OPERATOR_RIGHT,"RIGHT"]];this.setHelpUrl(t.Msg$$module$build$src$core$msg.TEXT_TRIM_HELPURL),this.setStyle("text_blocks"),this.appendValueInput("TEXT").setCheck("String").appendField(t.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:e}),"MODE"),this.setOutput(!0,"String"),this.setTooltip(t.Msg$$module$build$src$core$msg.TEXT_TRIM_TOOLTIP)}},n.text_print={init:function(){this.jsonInit({message0:t.Msg$$module$build$src$core$msg.TEXT_PRINT_TITLE,args0:[{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:t.Msg$$module$build$src$core$msg.TEXT_PRINT_TOOLTIP,helpUrl:t.Msg$$module$build$src$core$msg.TEXT_PRINT_HELPURL})}};var g={updateType_:function(e){this.outputConnection.setCheck(e==="NUMBER"?"Number":"String")},mutationToDom:function(){const e=t.createElement$$module$build$src$core$utils$xml("mutation");return e.setAttribute("type",this.getFieldValue("TYPE")),e},domToMutation:function(e){this.updateType_(e.getAttribute("type"))}};n.text_prompt_ext=Object.assign({},g,{init:function(){var e=[[t.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[t.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl(t.Msg$$module$build$src$core$msg.TEXT_PROMPT_HELPURL),this.setStyle("text_blocks"),e=t.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:e}),e.setValidator(s=>{this.updateType_(s)}),this.appendValueInput("TEXT").appendField(e,"TYPE"),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?t.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:t.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}}),n.text_prompt=Object.assign({},g,{init:function(){this.mixin(_);var e=[[t.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[t.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl(t.Msg$$module$build$src$core$msg.TEXT_PROMPT_HELPURL),this.setStyle("text_blocks"),e=t.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:e}),e.setValidator(s=>{this.updateType_(s)}),this.appendDummyInput().appendField(e,"TYPE").appendField(this.newQuote_(!0)).appendField(t.fromJson$$module$build$src$core$field_registry({type:"field_input",text:""}),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?t.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:t.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}}),n.text_count={init:function(){this.jsonInit({message0:t.Msg$$module$build$src$core$msg.TEXT_COUNT_MESSAGE0,args0:[{type:"input_value",name:"SUB",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"Number",inputsInline:!0,style:"text_blocks",tooltip:t.Msg$$module$build$src$core$msg.TEXT_COUNT_TOOLTIP,helpUrl:t.Msg$$module$build$src$core$msg.TEXT_COUNT_HELPURL})}},n.text_replace={init:function(){this.jsonInit({message0:t.Msg$$module$build$src$core$msg.TEXT_REPLACE_MESSAGE0,args0:[{type:"input_value",name:"FROM",check:"String"},{type:"input_value",name:"TO",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:t.Msg$$module$build$src$core$msg.TEXT_REPLACE_TOOLTIP,helpUrl:t.Msg$$module$build$src$core$msg.TEXT_REPLACE_HELPURL})}},n.text_reverse={init:function(){this.jsonInit({message0:t.Msg$$module$build$src$core$msg.TEXT_REVERSE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:t.Msg$$module$build$src$core$msg.TEXT_REVERSE_TOOLTIP,helpUrl:t.Msg$$module$build$src$core$msg.TEXT_REVERSE_HELPURL})}};var _={QUOTE_IMAGE_LEFT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",QUOTE_IMAGE_RIGHT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==",QUOTE_IMAGE_WIDTH:12,QUOTE_IMAGE_HEIGHT:12,quoteField_:function(e){for(let s=0,o;o=this.inputList[s];s++)for(let i=0,l;l=o.fieldRow[i];i++)if(e===l.name){o.insertFieldAt(i,this.newQuote_(!0)),o.insertFieldAt(i+2,this.newQuote_(!1));return}console.warn('field named "'+e+'" not found in '+this.toDevString())},newQuote_:function(e){return e=this.RTL?!e:e,t.fromJson$$module$build$src$core$field_registry({type:"field_image",src:e?this.QUOTE_IMAGE_LEFT_DATAURI:this.QUOTE_IMAGE_RIGHT_DATAURI,width:this.QUOTE_IMAGE_WIDTH,height:this.QUOTE_IMAGE_HEIGHT,alt:e?"“":"”"})}},U=function(){this.mixin(_),this.quoteField_("TEXT")},F={itemCount_:0,mutationToDom:function(){const e=t.createElement$$module$build$src$core$utils$xml("mutation");return e.setAttribute("items",`${this.itemCount_}`),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(e){this.itemCount_=e.itemCount,this.updateShape_()},decompose:function(e){const s=e.newBlock("text_create_join_container");s.initSvg();let o=s.getInput("STACK").connection;for(let i=0;i<this.itemCount_;i++){const l=e.newBlock("text_create_join_item");l.initSvg(),o.connect(l.previousConnection),o=l.nextConnection}return s},compose:function(e){var s=e.getInputTargetBlock("STACK");for(e=[];s;)s.isInsertionMarker()||e.push(s.valueConnection_),s=s.getNextBlock();for(s=0;s<this.itemCount_;s++){const o=this.getInput("ADD"+s).connection.targetConnection;o&&!e.includes(o)&&o.disconnect()}for(this.itemCount_=e.length,this.updateShape_(),s=0;s<this.itemCount_;s++){let o;(o=e[s])==null||o.reconnect(this,"ADD"+s)}},saveConnections:function(e){e=e.getInputTargetBlock("STACK");let s=0;for(;e;){if(e.isInsertionMarker()){e=e.getNextBlock();continue}const o=this.getInput("ADD"+s);e.valueConnection_=o&&o.connection.targetConnection,e=e.getNextBlock(),s++}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1));for(var e=0;e<this.itemCount_;e++)if(!this.getInput("ADD"+e)){const s=this.appendValueInput("ADD"+e).setAlign(t.Align$$module$build$src$core$inputs$align.RIGHT);e===0&&s.appendField(t.Msg$$module$build$src$core$msg.TEXT_JOIN_TITLE_CREATEWITH)}for(e=this.itemCount_;this.getInput("ADD"+e);e++)this.removeInput("ADD"+e)}},v=function(){this.mixin(_),this.itemCount_=2,this.updateShape_(),this.setMutator(new t.MutatorIcon$$module$build$src$core$icons$mutator_icon(["text_create_join_item"],this))};t.register$$module$build$src$core$extensions("text_append_tooltip",t.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_TEXT_APPEND_TOOLTIP}","VAR"));var x=function(){this.setTooltip(()=>t.Msg$$module$build$src$core$msg.TEXT_INDEXOF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))},H={isAt_:!1,mutationToDom:function(){const e=t.createElement$$module$build$src$core$utils$xml("mutation");return e.setAttribute("at",`${this.isAt_}`),e},domToMutation:function(e){e=e.getAttribute("at")!=="false",this.updateAt_(e)},updateAt_:function(e){this.removeInput("AT",!0),this.removeInput("ORDINAL",!0),e&&(this.appendValueInput("AT").setCheck("Number"),t.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(t.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)),t.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(t.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL)),this.isAt_=e}},V=function(){this.getField("WHERE").setValidator(function(e){e=e==="FROM_START"||e==="FROM_END";const s=this.getSourceBlock();e!==s.isAt_&&s.updateAt_(e)}),this.updateAt_(!0),this.setTooltip(()=>{var e=this.getFieldValue("WHERE");let s=t.Msg$$module$build$src$core$msg.TEXT_CHARAT_TOOLTIP;return(e==="FROM_START"||e==="FROM_END")&&(e=e==="FROM_START"?t.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:t.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP)&&(s+=" "+e.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),s})};t.register$$module$build$src$core$extensions("text_indexOf_tooltip",x),t.register$$module$build$src$core$extensions("text_quotes",U),t.registerMixin$$module$build$src$core$extensions("quote_image_mixin",_),t.registerMutator$$module$build$src$core$extensions("text_join_mutator",F,v),t.registerMutator$$module$build$src$core$extensions("text_charAt_mutator",H,V),t.defineBlocks$$module$build$src$core$common(n);var G={blocks:n},$={},O={setStatements_:function(e){this.hasStatements_!==e&&(e?(this.appendStatementInput("STACK").appendField(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=e)},updateParams_:function(){let e="";this.arguments_.length&&(e=t.Msg$$module$build$src$core$msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),t.disable$$module$build$src$core$events$utils();try{this.setFieldValue(e,"PARAMS")}finally{t.enable$$module$build$src$core$events$utils()}},mutationToDom:function(e){const s=t.createElement$$module$build$src$core$utils$xml("mutation");e&&s.setAttribute("name",this.getFieldValue("NAME"));for(let o=0;o<this.argumentVarModels_.length;o++){const i=t.createElement$$module$build$src$core$utils$xml("arg"),l=this.argumentVarModels_[o];i.setAttribute("name",l.getName()),i.setAttribute("varid",l.getId()),e&&this.paramIds_&&i.setAttribute("paramId",this.paramIds_[o]),s.appendChild(i)}return this.hasStatements_||s.setAttribute("statements","false"),s},domToMutation:function(e){this.arguments_=[],this.argumentVarModels_=[];for(let o=0,i;i=e.childNodes[o];o++)if(i.nodeName.toLowerCase()==="arg"){var s=i;const l=s.getAttribute("name");s=s.getAttribute("varid")||s.getAttribute("varId"),this.arguments_.push(l),s=t.getOrCreateVariablePackage$$module$build$src$core$variables(this.workspace,s,l,""),s!==null?this.argumentVarModels_.push(s):console.log(`Failed to create a variable named "${l}", ignoring.`)}this.updateParams_(),t.mutateCallers$$module$build$src$core$procedures(this),this.setStatements_(e.getAttribute("statements")!=="false")},saveExtraState:function(){if(!this.argumentVarModels_.length&&this.hasStatements_)return null;const e=Object.create(null);if(this.argumentVarModels_.length){e.params=[];for(let s=0;s<this.argumentVarModels_.length;s++)e.params.push({name:this.argumentVarModels_[s].getName(),id:this.argumentVarModels_[s].getId()})}return this.hasStatements_||(e.hasStatements=!1),e},loadExtraState:function(e){if(this.arguments_=[],this.argumentVarModels_=[],e.params)for(let o=0;o<e.params.length;o++){var s=e.params[o];s=t.getOrCreateVariablePackage$$module$build$src$core$variables(this.workspace,s.id,s.name,""),this.arguments_.push(s.getName()),this.argumentVarModels_.push(s)}this.updateParams_(),t.mutateCallers$$module$build$src$core$procedures(this),this.setStatements_(e.hasStatements!==!1)},decompose:function(e){const s=t.createElement$$module$build$src$core$utils$xml("block");s.setAttribute("type","procedures_mutatorcontainer");var o=t.createElement$$module$build$src$core$utils$xml("statement");o.setAttribute("name","STACK"),s.appendChild(o);for(let l=0;l<this.arguments_.length;l++){const r=t.createElement$$module$build$src$core$utils$xml("block");r.setAttribute("type","procedures_mutatorarg");var i=t.createElement$$module$build$src$core$utils$xml("field");i.setAttribute("name","NAME");const c=t.createTextNode$$module$build$src$core$utils$xml(this.arguments_[l]);i.appendChild(c),r.appendChild(i),i=t.createElement$$module$build$src$core$utils$xml("next"),r.appendChild(i),o.appendChild(r),o=i}return e=t.domToBlock$$module$build$src$core$xml(s,e),this.type==="procedures_defreturn"?e.setFieldValue(this.hasStatements_,"STATEMENTS"):e.removeInput("STATEMENT_INPUT"),t.mutateCallers$$module$build$src$core$procedures(this),e},compose:function(e){this.arguments_=[],this.paramIds_=[],this.argumentVarModels_=[];let s=e.getInputTargetBlock("STACK");for(;s&&!s.isInsertionMarker();){var o=s.getFieldValue("NAME");this.arguments_.push(o),o=this.workspace.getVariable(o,""),this.argumentVarModels_.push(o),this.paramIds_.push(s.id),s=s.nextConnection&&s.nextConnection.targetBlock()}if(this.updateParams_(),t.mutateCallers$$module$build$src$core$procedures(this),e=e.getFieldValue("STATEMENTS"),e!==null&&(e=e==="TRUE",this.hasStatements_!==e))if(e){this.setStatements_(!0);var i;(i=this.statementConnection_)==null||i.reconnect(this,"STACK"),this.statementConnection_=null}else i=this.getInput("STACK").connection,(this.statementConnection_=i.targetConnection)&&(i=i.targetBlock(),i.unplug(),i.bumpNeighbours()),this.setStatements_(!1)},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},renameVarById:function(e,s){var o=this.workspace.getVariableById(e);if(o.getType()===""){o=o.getName(),s=this.workspace.getVariableById(s);var i=!1;for(let l=0;l<this.argumentVarModels_.length;l++)this.argumentVarModels_[l].getId()===e&&(this.arguments_[l]=s.getName(),this.argumentVarModels_[l]=s,i=!0);i&&(this.displayRenamedVar_(o,s.getName()),t.mutateCallers$$module$build$src$core$procedures(this))}},updateVarName:function(e){const s=e.getName();let o=!1,i;for(let l=0;l<this.argumentVarModels_.length;l++)this.argumentVarModels_[l].getId()===e.getId()&&(i=this.arguments_[l],this.arguments_[l]=s,o=!0);o&&(this.displayRenamedVar_(i,s),t.mutateCallers$$module$build$src$core$procedures(this))},displayRenamedVar_:function(e,s){this.updateParams_();var o=this.getIcon(t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE);if(o&&o.bubbleIsVisible()){o=o.getWorkspace().getAllBlocks(!1);for(let i=0,l;l=o[i];i++)l.type==="procedures_mutatorarg"&&t.Names$$module$build$src$core$names.equals(e,l.getFieldValue("NAME"))&&l.setFieldValue(s,"NAME")}},customContextMenu:function(e){if(!this.isInFlyout){var s=this.getFieldValue("NAME"),o={type:this.callType_,extraState:{name:s,params:this.arguments_}};if(e.push({enabled:!0,text:t.Msg$$module$build$src$core$msg.PROCEDURES_CREATE_DO.replace("%1",s),callback:t.callbackFactory$$module$build$src$core$contextmenu(this,o)}),!this.isCollapsed())for(s=0;s<this.argumentVarModels_.length;s++){o=this.argumentVarModels_[s];const i={type:"variables_get",fields:{VAR:{name:o.getName(),id:o.getId(),type:o.getType()}}};e.push({enabled:!0,text:t.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET.replace("%1",o.getName()),callback:t.callbackFactory$$module$build$src$core$contextmenu(this,i)})}}}};$.procedures_defnoreturn=Object.assign({},O,{init:function(){var e=t.findLegalName$$module$build$src$core$procedures("",this);e=t.fromJson$$module$build$src$core$field_registry({type:"field_input",text:e}),e.setValidator(t.rename$$module$build$src$core$procedures),e.setSpellcheck(!1),this.appendDummyInput().appendField(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_TITLE).appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new t.MutatorIcon$$module$build$src$core$icons$mutator_icon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&t.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},callType_:"procedures_callnoreturn"}),$.procedures_defreturn=Object.assign({},O,{init:function(){var e=t.findLegalName$$module$build$src$core$procedures("",this);e=t.fromJson$$module$build$src$core$field_registry({type:"field_input",text:e}),e.setValidator(t.rename$$module$build$src$core$procedures),e.setSpellcheck(!1),this.appendDummyInput().appendField(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_TITLE).appendField(e,"NAME").appendField("","PARAMS"),this.appendValueInput("RETURN").setAlign(t.Align$$module$build$src$core$inputs$align.RIGHT).appendField(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_RETURN),this.setMutator(new t.MutatorIcon$$module$build$src$core$icons$mutator_icon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&t.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_COMMENT&&this.setCommentText(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_TOOLTIP),this.setHelpUrl(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},callType_:"procedures_callreturn"});var Y={init:function(){this.appendDummyInput().appendField(t.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORCONTAINER_TITLE),this.appendStatementInput("STACK"),this.appendDummyInput("STATEMENT_INPUT").appendField(t.Msg$$module$build$src$core$msg.PROCEDURES_ALLOW_STATEMENTS).appendField(t.fromJson$$module$build$src$core$field_registry({type:"field_checkbox",checked:!0}),"STATEMENTS"),this.setStyle("procedure_blocks"),this.setTooltip(t.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP),this.contextMenu=!1}};$.procedures_mutatorcontainer=Y;var K=class extends t.FieldTextInput$$module$build$src$core$field_textinput{constructor(){super(...arguments),this.editingInteractively=!1}showEditor_(e){super.showEditor_(e),this.editingInteractively=!0,this.editingVariable=void 0}onFinishEditing_(e){super.onFinishEditing_(e),this.editingInteractively=!1}},X={init:function(){const e=new K(t.DEFAULT_ARG$$module$build$src$core$procedures,this.validator_);this.appendDummyInput().appendField(t.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORARG_TITLE).appendField(e,"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(t.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORARG_TOOLTIP),this.contextMenu=!1},validator_:function(e){var s=this.getSourceBlock();const o=s.workspace.getRootWorkspace();if(e=e.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,""),!e)return null;const i=(s.workspace.targetWorkspace||s.workspace).getAllBlocks(!1),l=e.toLowerCase();for(let r=0;r<i.length;r++){if(i[r].id===this.getSourceBlock().id)continue;const c=i[r].getFieldValue("NAME");if(c&&c.toLowerCase()===l)return null}return s.isInFlyout||((s=o.getVariable(e,""))&&s.getName()!==e&&o.renameVariableById(s.getId(),e),s||(this.editingInteractively?this.editingVariable?o.renameVariableById(this.editingVariable.getId(),e):this.editingVariable=o.createVariable(e,""):o.createVariable(e,""))),e}};$.procedures_mutatorarg=X;var h="DISABLED_PROCEDURE_DEFINITION",S={getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(e,s){t.Names$$module$build$src$core$names.equals(e,this.getProcedureCall())&&(this.setFieldValue(s,"NAME"),this.setTooltip((this.outputConnection?t.Msg$$module$build$src$core$msg.PROCEDURES_CALLRETURN_TOOLTIP:t.Msg$$module$build$src$core$msg.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",s)))},setProcedureParameters_:function(e,s){var o=t.getDefinition$$module$build$src$core$procedures(this.getProcedureCall(),this.workspace);if((o=(o=o&&o.getIcon(t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE))&&o.bubbleIsVisible())?this.setCollapsed(!1):(this.quarkConnections_={},this.quarkIds_=null),e.join(`
|
|
2
|
-
`)===this.arguments_.join(`
|
|
3
|
-
`))this.quarkIds_=s;else{if(s.length!==e.length)throw RangeError("paramNames and paramIds must be the same length.");this.quarkIds_||(this.quarkConnections_={},this.quarkIds_=[]);for(let l=0;l<this.arguments_.length;l++){var i=this.getInput("ARG"+l);i&&(i=i.connection.targetConnection,this.quarkConnections_[this.quarkIds_[l]]=i,o&&i&&!s.includes(this.quarkIds_[l])&&(i.disconnect(),i.getSourceBlock().bumpNeighbours()))}for(this.arguments_=[].concat(e),this.argumentVarModels_=[],e=0;e<this.arguments_.length;e++)o=t.getOrCreateVariablePackage$$module$build$src$core$variables(this.workspace,null,this.arguments_[e],""),this.argumentVarModels_.push(o);if(this.updateShape_(),this.quarkIds_=s){for(s=0;s<this.arguments_.length;s++)if(e=this.quarkIds_[s],e in this.quarkConnections_){let l;(l=this.quarkConnections_[e])!=null&&l.reconnect(this,"ARG"+s)||delete this.quarkConnections_[e]}}}},updateShape_:function(){for(var e=0;e<this.arguments_.length;e++){var s=this.getField("ARGNAME"+e);if(s){t.disable$$module$build$src$core$events$utils();try{s.setValue(this.arguments_[e])}finally{t.enable$$module$build$src$core$events$utils()}}else s=t.fromJson$$module$build$src$core$field_registry({type:"field_label",text:this.arguments_[e]}),this.appendValueInput("ARG"+e).setAlign(t.Align$$module$build$src$core$inputs$align.RIGHT).appendField(s,"ARGNAME"+e)}for(e=this.arguments_.length;this.getInput("ARG"+e);e++)this.removeInput("ARG"+e);(e=this.getInput("TOPROW"))&&(this.arguments_.length?this.getField("WITH")||e.appendField(t.Msg$$module$build$src$core$msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"):this.getField("WITH")&&e.removeField("WITH"))},mutationToDom:function(){const e=t.createElement$$module$build$src$core$utils$xml("mutation");e.setAttribute("name",this.getProcedureCall());for(let s=0;s<this.arguments_.length;s++){const o=t.createElement$$module$build$src$core$utils$xml("arg");o.setAttribute("name",this.arguments_[s]),e.appendChild(o)}return e},domToMutation:function(e){var s=e.getAttribute("name");this.renameProcedure(this.getProcedureCall(),s),s=[];const o=[];for(let i=0,l;l=e.childNodes[i];i++)l.nodeName.toLowerCase()==="arg"&&(s.push(l.getAttribute("name")),o.push(l.getAttribute("paramId")));this.setProcedureParameters_(s,o)},saveExtraState:function(){const e=Object.create(null);return e.name=this.getProcedureCall(),this.arguments_.length&&(e.params=this.arguments_),e},loadExtraState:function(e){if(this.renameProcedure(this.getProcedureCall(),e.name),e=e.params){const s=[];s.length=e.length,s.fill(null),this.setProcedureParameters_(e,s)}},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},onchange:function(e){if(this.workspace&&!this.workspace.isFlyout&&e.recordUndo)if(e.type===t.BLOCK_CREATE$$module$build$src$core$events$events&&e.ids.includes(this.id)){var s=this.getProcedureCall(),o=t.getDefinition$$module$build$src$core$procedures(s,this.workspace);if(!o||o.type===this.defType_&&JSON.stringify(o.getVars())===JSON.stringify(this.arguments_)||(o=null),o)o.isEnabled()||(this.setDisabledReason(!0,h),this.setWarningText(t.Msg$$module$build$src$core$msg.PROCEDURES_CALL_DISABLED_DEF_WARNING.replace("%1",s)));else{t.setGroup$$module$build$src$core$events$utils(e.group),e=t.createElement$$module$build$src$core$utils$xml("xml"),s=t.createElement$$module$build$src$core$utils$xml("block"),s.setAttribute("type",this.defType_),o=this.getRelativeToSurfaceXY();var i=o.y+t.config$$module$build$src$core$config.snapRadius*2;s.setAttribute("x",`${o.x+t.config$$module$build$src$core$config.snapRadius*(this.RTL?-1:1)}`),s.setAttribute("y",`${i}`),o=this.mutationToDom(),s.appendChild(o),o=t.createElement$$module$build$src$core$utils$xml("field"),o.setAttribute("name","NAME"),i=this.getProcedureCall();const l=t.findLegalName$$module$build$src$core$procedures(i,this);i!==l&&this.renameProcedure(i,l),o.appendChild(t.createTextNode$$module$build$src$core$utils$xml(i)),s.appendChild(o),e.appendChild(s),t.domToWorkspace$$module$build$src$core$xml(e,this.workspace),t.setGroup$$module$build$src$core$events$utils(!1)}}else e.type===t.BLOCK_DELETE$$module$build$src$core$events$events?(s=this.getProcedureCall(),t.getDefinition$$module$build$src$core$procedures(s,this.workspace)||(t.setGroup$$module$build$src$core$events$utils(e.group),this.dispose(!0),t.setGroup$$module$build$src$core$events$utils(!1))):e.type===t.BLOCK_CHANGE$$module$build$src$core$events$events&&e.element==="disabled"&&(s=this.getProcedureCall(),(i=t.getDefinition$$module$build$src$core$procedures(s,this.workspace))&&i.id===e.blockId&&((o=t.getGroup$$module$build$src$core$events$utils())&&console.log("Saw an existing group while responding to a definition change"),t.setGroup$$module$build$src$core$events$utils(e.group),e=i.isEnabled(),this.setDisabledReason(!e,h),this.setWarningText(e?null:t.Msg$$module$build$src$core$msg.PROCEDURES_CALL_DISABLED_DEF_WARNING.replace("%1",s)),t.setGroup$$module$build$src$core$events$utils(o)))},customContextMenu:function(e){if(this.workspace.isMovable()){var s=this.getProcedureCall(),o=this.workspace;e.push({enabled:!0,text:t.Msg$$module$build$src$core$msg.PROCEDURES_HIGHLIGHT_DEF,callback:function(){const i=t.getDefinition$$module$build$src$core$procedures(s,o);i&&(o.centerOnBlock(i.id),t.getFocusManager$$module$build$src$core$focus_manager().focusNode(i))}})}}};$.procedures_callnoreturn=Object.assign({},S,{init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(t.Msg$$module$build$src$core$msg.PROCEDURES_CALLNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null},defType_:"procedures_defnoreturn"}),$.procedures_callreturn=Object.assign({},S,{init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setOutput(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(t.Msg$$module$build$src$core$msg.PROCEDURES_CALLRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null},defType_:"procedures_defreturn"});var w="UNPARENTED_IFRETURN",W={init:function(){this.appendValueInput("CONDITION").setCheck("Boolean").appendField(t.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_IF),this.appendValueInput("VALUE").appendField(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(t.Msg$$module$build$src$core$msg.PROCEDURES_IFRETURN_TOOLTIP),this.setHelpUrl(t.Msg$$module$build$src$core$msg.PROCEDURES_IFRETURN_HELPURL),this.hasReturnValue_=!0},mutationToDom:function(){const e=t.createElement$$module$build$src$core$utils$xml("mutation");return e.setAttribute("value",String(Number(this.hasReturnValue_))),e},domToMutation:function(e){this.hasReturnValue_=e.getAttribute("value")==="1",this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(e){if(!(this.workspace.isDragging&&this.workspace.isDragging()||e.type!==t.BLOCK_MOVE$$module$build$src$core$events$events&&e.type!==t.BLOCK_CREATE$$module$build$src$core$events$events)){e=!1;var s=this;do{if(this.FUNCTION_TYPES.includes(s.type)){e=!0;break}s=s.getSurroundParent()}while(s);if(e?(s.type==="procedures_defnoreturn"&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):s.type!=="procedures_defreturn"||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null)):this.setWarningText(t.Msg$$module$build$src$core$msg.PROCEDURES_IFRETURN_WARNING),!this.isInFlyout)try{t.setRecordUndo$$module$build$src$core$events$utils(!1),this.setDisabledReason(!e,w)}finally{t.setRecordUndo$$module$build$src$core$events$utils(!0)}}},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn"]};$.procedures_ifreturn=W,t.defineBlocks$$module$build$src$core$common($);var J={blocks:$},m=t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"math_number",message0:"%1",args0:[{type:"field_number",name:"NUM",value:0}],output:"Number",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",style:"math_blocks",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_arithmetic",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ADDITION_SYMBOL}","ADD"],["%{BKY_MATH_SUBTRACTION_SYMBOL}","MINUS"],["%{BKY_MATH_MULTIPLICATION_SYMBOL}","MULTIPLY"],["%{BKY_MATH_DIVISION_SYMBOL}","DIVIDE"],["%{BKY_MATH_POWER_SYMBOL}","POWER"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ARITHMETIC_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_single",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_SINGLE_OP_ROOT}","ROOT"],["%{BKY_MATH_SINGLE_OP_ABSOLUTE}","ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_SINGLE_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_trig",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_TRIG_SIN}","SIN"],["%{BKY_MATH_TRIG_COS}","COS"],["%{BKY_MATH_TRIG_TAN}","TAN"],["%{BKY_MATH_TRIG_ASIN}","ASIN"],["%{BKY_MATH_TRIG_ACOS}","ACOS"],["%{BKY_MATH_TRIG_ATAN}","ATAN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_TRIG_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_constant",message0:"%1",args0:[{type:"field_dropdown",name:"CONSTANT",options:[["π","PI"],["e","E"],["φ","GOLDEN_RATIO"],["sqrt(2)","SQRT2"],["sqrt(½)","SQRT1_2"],["∞","INFINITY"]]}],output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTANT_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTANT_HELPURL}"},{type:"math_number_property",message0:"%1 %2",args0:[{type:"input_value",name:"NUMBER_TO_CHECK",check:"Number"},{type:"field_dropdown",name:"PROPERTY",options:[["%{BKY_MATH_IS_EVEN}","EVEN"],["%{BKY_MATH_IS_ODD}","ODD"],["%{BKY_MATH_IS_PRIME}","PRIME"],["%{BKY_MATH_IS_WHOLE}","WHOLE"],["%{BKY_MATH_IS_POSITIVE}","POSITIVE"],["%{BKY_MATH_IS_NEGATIVE}","NEGATIVE"],["%{BKY_MATH_IS_DIVISIBLE_BY}","DIVISIBLE_BY"]]}],inputsInline:!0,output:"Boolean",style:"math_blocks",tooltip:"%{BKY_MATH_IS_TOOLTIP}",mutator:"math_is_divisibleby_mutator"},{type:"math_change",message0:"%{BKY_MATH_CHANGE_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_MATH_CHANGE_TITLE_ITEM}"},{type:"input_value",name:"DELTA",check:"Number"}],previousStatement:null,nextStatement:null,style:"variable_blocks",helpUrl:"%{BKY_MATH_CHANGE_HELPURL}",extensions:["math_change_tooltip"]},{type:"math_round",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ROUND_OPERATOR_ROUND}","ROUND"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDUP}","ROUNDUP"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDDOWN}","ROUNDDOWN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ROUND_HELPURL}",tooltip:"%{BKY_MATH_ROUND_TOOLTIP}"},{type:"math_on_list",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ONLIST_OPERATOR_SUM}","SUM"],["%{BKY_MATH_ONLIST_OPERATOR_MIN}","MIN"],["%{BKY_MATH_ONLIST_OPERATOR_MAX}","MAX"],["%{BKY_MATH_ONLIST_OPERATOR_AVERAGE}","AVERAGE"],["%{BKY_MATH_ONLIST_OPERATOR_MEDIAN}","MEDIAN"],["%{BKY_MATH_ONLIST_OPERATOR_MODE}","MODE"],["%{BKY_MATH_ONLIST_OPERATOR_STD_DEV}","STD_DEV"],["%{BKY_MATH_ONLIST_OPERATOR_RANDOM}","RANDOM"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ONLIST_HELPURL}",mutator:"math_modes_of_list_mutator",extensions:["math_op_tooltip"]},{type:"math_modulo",message0:"%{BKY_MATH_MODULO_TITLE}",args0:[{type:"input_value",name:"DIVIDEND",check:"Number"},{type:"input_value",name:"DIVISOR",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_MODULO_TOOLTIP}",helpUrl:"%{BKY_MATH_MODULO_HELPURL}"},{type:"math_constrain",message0:"%{BKY_MATH_CONSTRAIN_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"Number"},{type:"input_value",name:"LOW",check:"Number"},{type:"input_value",name:"HIGH",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTRAIN_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTRAIN_HELPURL}"},{type:"math_random_int",message0:"%{BKY_MATH_RANDOM_INT_TITLE}",args0:[{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_INT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_INT_HELPURL}"},{type:"math_random_float",message0:"%{BKY_MATH_RANDOM_FLOAT_TITLE_RANDOM}",output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_FLOAT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_FLOAT_HELPURL}"},{type:"math_atan2",message0:"%{BKY_MATH_ATAN2_TITLE}",args0:[{type:"input_value",name:"X",check:"Number"},{type:"input_value",name:"Y",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_ATAN2_TOOLTIP}",helpUrl:"%{BKY_MATH_ATAN2_HELPURL}"}]),q={ADD:"%{BKY_MATH_ARITHMETIC_TOOLTIP_ADD}",MINUS:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MINUS}",MULTIPLY:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MULTIPLY}",DIVIDE:"%{BKY_MATH_ARITHMETIC_TOOLTIP_DIVIDE}",POWER:"%{BKY_MATH_ARITHMETIC_TOOLTIP_POWER}",ROOT:"%{BKY_MATH_SINGLE_TOOLTIP_ROOT}",ABS:"%{BKY_MATH_SINGLE_TOOLTIP_ABS}",NEG:"%{BKY_MATH_SINGLE_TOOLTIP_NEG}",LN:"%{BKY_MATH_SINGLE_TOOLTIP_LN}",LOG10:"%{BKY_MATH_SINGLE_TOOLTIP_LOG10}",EXP:"%{BKY_MATH_SINGLE_TOOLTIP_EXP}",POW10:"%{BKY_MATH_SINGLE_TOOLTIP_POW10}",SIN:"%{BKY_MATH_TRIG_TOOLTIP_SIN}",COS:"%{BKY_MATH_TRIG_TOOLTIP_COS}",TAN:"%{BKY_MATH_TRIG_TOOLTIP_TAN}",ASIN:"%{BKY_MATH_TRIG_TOOLTIP_ASIN}",ACOS:"%{BKY_MATH_TRIG_TOOLTIP_ACOS}",ATAN:"%{BKY_MATH_TRIG_TOOLTIP_ATAN}",SUM:"%{BKY_MATH_ONLIST_TOOLTIP_SUM}",MIN:"%{BKY_MATH_ONLIST_TOOLTIP_MIN}",MAX:"%{BKY_MATH_ONLIST_TOOLTIP_MAX}",AVERAGE:"%{BKY_MATH_ONLIST_TOOLTIP_AVERAGE}",MEDIAN:"%{BKY_MATH_ONLIST_TOOLTIP_MEDIAN}",MODE:"%{BKY_MATH_ONLIST_TOOLTIP_MODE}",STD_DEV:"%{BKY_MATH_ONLIST_TOOLTIP_STD_DEV}",RANDOM:"%{BKY_MATH_ONLIST_TOOLTIP_RANDOM}"};t.register$$module$build$src$core$extensions("math_op_tooltip",t.buildTooltipForDropdown$$module$build$src$core$extensions("OP",q));var Q={mutationToDom:function(){const e=t.createElement$$module$build$src$core$utils$xml("mutation"),s=this.getFieldValue("PROPERTY")==="DIVISIBLE_BY";return e.setAttribute("divisor_input",String(s)),e},domToMutation:function(e){e=e.getAttribute("divisor_input")==="true",this.updateShape_(e)},updateShape_:function(e){const s=this.getInput("DIVISOR");e?s||this.appendValueInput("DIVISOR").setCheck("Number"):s&&this.removeInput("DIVISOR")}},j=function(){this.getField("PROPERTY").setValidator(function(e){e=e==="DIVISIBLE_BY",this.getSourceBlock().updateShape_(e)})};t.registerMutator$$module$build$src$core$extensions("math_is_divisibleby_mutator",Q,j),t.register$$module$build$src$core$extensions("math_change_tooltip",t.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_MATH_CHANGE_TOOLTIP}","VAR"));var z={updateType_:function(e){e==="MODE"?this.outputConnection.setCheck("Array"):this.outputConnection.setCheck("Number")},mutationToDom:function(){const e=t.createElement$$module$build$src$core$utils$xml("mutation");return e.setAttribute("op",this.getFieldValue("OP")),e},domToMutation:function(e){if(e=e.getAttribute("op"),e===null)throw new TypeError("xmlElement had no op attribute");this.updateType_(e)}},Z=function(){this.getField("OP").setValidator((function(e){this.updateType_(e)}).bind(this))};t.registerMutator$$module$build$src$core$extensions("math_modes_of_list_mutator",z,Z),t.defineBlocks$$module$build$src$core$common(m);var ee={blocks:m},p=t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"controls_repeat_ext",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"input_value",name:"TIMES",check:"Number"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_repeat",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"field_number",name:"TIMES",value:10,min:0,precision:1}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_whileUntil",message0:"%1 %2",args0:[{type:"field_dropdown",name:"MODE",options:[["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}","WHILE"],["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}","UNTIL"]]},{type:"input_value",name:"BOOL",check:"Boolean"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_WHILEUNTIL_HELPURL}",extensions:["controls_whileUntil_tooltip"]},{type:"controls_for",message0:"%{BKY_CONTROLS_FOR_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"input_value",name:"BY",check:"Number",align:"RIGHT"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOR_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_for_tooltip"]},{type:"controls_forEach",message0:"%{BKY_CONTROLS_FOREACH_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Array"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOREACH_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_forEach_tooltip"]},{type:"controls_flow_statements",message0:"%1",args0:[{type:"field_dropdown",name:"FLOW",options:[["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}","BREAK"],["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}","CONTINUE"]]}],previousStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}",suppressPrefixSuffix:!0,extensions:["controls_flow_tooltip","controls_flow_in_loop_check"]}]),te={WHILE:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}",UNTIL:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}"};t.register$$module$build$src$core$extensions("controls_whileUntil_tooltip",t.buildTooltipForDropdown$$module$build$src$core$extensions("MODE",te));var se={BREAK:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}",CONTINUE:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}"};t.register$$module$build$src$core$extensions("controls_flow_tooltip",t.buildTooltipForDropdown$$module$build$src$core$extensions("FLOW",se));var oe={customContextMenu:function(e){if(!this.isInFlyout){var s=this.getField("VAR"),o=s.getVariable().getName();this.isCollapsed()||o===null||(s={type:"variables_get",fields:{VAR:s.saveState(!0)}},e.push({enabled:!0,text:t.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET.replace("%1",o),callback:t.callbackFactory$$module$build$src$core$contextmenu(this,s)}))}}};t.registerMixin$$module$build$src$core$extensions("contextMenu_newGetVariableBlock",oe),t.register$$module$build$src$core$extensions("controls_for_tooltip",t.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_CONTROLS_FOR_TOOLTIP}","VAR")),t.register$$module$build$src$core$extensions("controls_forEach_tooltip",t.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_CONTROLS_FOREACH_TOOLTIP}","VAR"));var R=new Set(["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"]),ie="CONTROL_FLOW_NOT_IN_LOOP",le={getSurroundLoop:function(){let e=this;do{if(R.has(e.type))return e;e=e.getSurroundParent()}while(e);return null},onchange:function(e){const s=this.workspace;if(s.isDragging&&!s.isDragging()&&(e.type===t.BLOCK_MOVE$$module$build$src$core$events$events||e.type===t.BLOCK_CREATE$$module$build$src$core$events$events)&&(e=!!this.getSurroundLoop(),this.setWarningText(e?null:t.Msg$$module$build$src$core$msg.CONTROLS_FLOW_STATEMENTS_WARNING),!this.isInFlyout))try{t.setRecordUndo$$module$build$src$core$events$utils(!1),this.setDisabledReason(!e,ie)}finally{t.setRecordUndo$$module$build$src$core$events$utils(!0)}}};t.registerMixin$$module$build$src$core$extensions("controls_flow_in_loop_check",le),t.defineBlocks$$module$build$src$core$common(p);var re={blocks:p,loopTypes:R},E=t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"logic_boolean",message0:"%1",args0:[{type:"field_dropdown",name:"BOOL",options:[["%{BKY_LOGIC_BOOLEAN_TRUE}","TRUE"],["%{BKY_LOGIC_BOOLEAN_FALSE}","FALSE"]]}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_BOOLEAN_TOOLTIP}",helpUrl:"%{BKY_LOGIC_BOOLEAN_HELPURL}"},{type:"controls_if",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],previousStatement:null,nextStatement:null,style:"logic_blocks",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",suppressPrefixSuffix:!0,mutator:"controls_if_mutator",extensions:["controls_if_tooltip"]},{type:"controls_ifelse",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],message2:"%{BKY_CONTROLS_IF_MSG_ELSE} %1",args2:[{type:"input_statement",name:"ELSE"}],previousStatement:null,nextStatement:null,style:"logic_blocks",tooltip:"%{BKYCONTROLS_IF_TOOLTIP_2}",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",suppressPrefixSuffix:!0,extensions:["controls_if_tooltip"]},{type:"logic_compare",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A"},{type:"field_dropdown",name:"OP",options:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]]},{type:"input_value",name:"B"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",extensions:["logic_op_tooltip"]},{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",name:"IF",check:"Boolean"}],message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]},{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},{type:"controls_if_elseif",message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]),ne={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}",LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"};t.register$$module$build$src$core$extensions("logic_op_tooltip",t.buildTooltipForDropdown$$module$build$src$core$extensions("OP",ne));var ue={elseifCount_:0,elseCount_:0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const e=t.createElement$$module$build$src$core$utils$xml("mutation");return this.elseifCount_&&e.setAttribute("elseif",String(this.elseifCount_)),this.elseCount_&&e.setAttribute("else","1"),e},domToMutation:function(e){this.elseifCount_=parseInt(e.getAttribute("elseif"),10)||0,this.elseCount_=parseInt(e.getAttribute("else"),10)||0,this.rebuildShape_()},saveExtraState:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const e=Object.create(null);return this.elseifCount_&&(e.elseIfCount=this.elseifCount_),this.elseCount_&&(e.hasElse=!0),e},loadExtraState:function(e){this.elseifCount_=e.elseIfCount||0,this.elseCount_=e.hasElse?1:0,this.updateShape_()},decompose:function(e){const s=e.newBlock("controls_if_if");s.initSvg();let o=s.nextConnection;for(let i=1;i<=this.elseifCount_;i++){const l=e.newBlock("controls_if_elseif");l.initSvg(),o.connect(l.previousConnection),o=l.nextConnection}return this.elseCount_&&(e=e.newBlock("controls_if_else"),e.initSvg(),o.connect(e.previousConnection)),s},compose:function(e){e=e.nextConnection.targetBlock(),this.elseCount_=this.elseifCount_=0;const s=[null],o=[null];let i=null;for(;e;){if(!e.isInsertionMarker())switch(e.type){case"controls_if_elseif":this.elseifCount_++,s.push(e.valueConnection_),o.push(e.statementConnection_);break;case"controls_if_else":this.elseCount_++,i=e.statementConnection_;break;default:throw TypeError("Unknown block type: "+e.type)}e=e.getNextBlock()}this.updateShape_(),this.reconnectChildBlocks_(s,o,i)},saveConnections:function(e){e=e.nextConnection.targetBlock();let s=1;for(;e;){if(!e.isInsertionMarker())switch(e.type){case"controls_if_elseif":var o=this.getInput("IF"+s);const i=this.getInput("DO"+s);e.valueConnection_=o&&o.connection.targetConnection,e.statementConnection_=i&&i.connection.targetConnection,s++;break;case"controls_if_else":o=this.getInput("ELSE"),e.statementConnection_=o&&o.connection.targetConnection;break;default:throw TypeError("Unknown block type: "+e.type)}e=e.getNextBlock()}},rebuildShape_:function(){const e=[null],s=[null];let o=null;this.getInput("ELSE")&&(o=this.getInput("ELSE").connection.targetConnection);for(let i=1;this.getInput("IF"+i);i++){const l=this.getInput("IF"+i),r=this.getInput("DO"+i);e.push(l.connection.targetConnection),s.push(r.connection.targetConnection)}this.updateShape_(),this.reconnectChildBlocks_(e,s,o)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);e++)this.removeInput("IF"+e),this.removeInput("DO"+e);for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck("Boolean").appendField(t.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(t.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(t.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,s,o){for(let i=1;i<=this.elseifCount_;i++){let l;(l=e[i])==null||l.reconnect(this,"IF"+i);let r;(r=s[i])==null||r.reconnect(this,"DO"+i)}o?.reconnect(this,"ELSE")}};t.registerMutator$$module$build$src$core$extensions("controls_if_mutator",ue,null,["controls_if_elseif","controls_if_else"]);var $e=function(){this.setTooltip((function(){if(this.elseifCount_||this.elseCount_){if(!this.elseifCount_&&this.elseCount_)return t.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_2;if(this.elseifCount_&&!this.elseCount_)return t.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_3;if(this.elseifCount_&&this.elseCount_)return t.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_4}else return t.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_1;return""}).bind(this))};t.register$$module$build$src$core$extensions("controls_if_tooltip",$e);var _e={onchange:function(e){this.prevBlocks_||(this.prevBlocks_=[null,null]);var s=this.getInputTargetBlock("A");const o=this.getInputTargetBlock("B");s&&o&&!this.workspace.connectionChecker.doTypeChecks(s.outputConnection,o.outputConnection)&&(t.setGroup$$module$build$src$core$events$utils(e.group),e=this.prevBlocks_[0],e!==s&&(s.unplug(),!e||e.isDisposed()||e.isShadow()||this.getInput("A").connection.connect(e.outputConnection)),s=this.prevBlocks_[1],s!==o&&(o.unplug(),!s||s.isDisposed()||s.isShadow()||this.getInput("B").connection.connect(s.outputConnection)),this.bumpNeighbours(),t.setGroup$$module$build$src$core$events$utils(!1)),this.prevBlocks_[0]=this.getInputTargetBlock("A"),this.prevBlocks_[1]=this.getInputTargetBlock("B")}},ce=function(){this.mixin(_e)};t.register$$module$build$src$core$extensions("logic_compare",ce);var ae={prevParentConnection_:null,onchange:function(e){const s=this.getInputTargetBlock("THEN"),o=this.getInputTargetBlock("ELSE"),i=this.outputConnection.targetConnection;if((s||o)&&i)for(let l=0;l<2;l++){const r=l===1?s:o;r&&!r.workspace.connectionChecker.doTypeChecks(r.outputConnection,i)&&(t.setGroup$$module$build$src$core$events$utils(e.group),i===this.prevParentConnection_?(this.unplug(),i.getSourceBlock().bumpNeighbours()):(r.unplug(),r.bumpNeighbours()),t.setGroup$$module$build$src$core$events$utils(!1))}this.prevParentConnection_=i}};t.registerMixin$$module$build$src$core$extensions("logic_ternary",ae),t.defineBlocks$$module$build$src$core$common(E);var Te={blocks:E},u=t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}",args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]),de={init:function(){this.setHelpUrl(t.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_HELPURL),this.setStyle("list_blocks"),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Array"),this.setMutator(new t.MutatorIcon$$module$build$src$core$icons$mutator_icon(["lists_create_with_item"],this)),this.setTooltip(t.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){const e=t.createElement$$module$build$src$core$utils$xml("mutation");return e.setAttribute("items",String(this.itemCount_)),e},domToMutation:function(e){if(e=e.getAttribute("items"),!e)throw new TypeError("element did not have items");this.itemCount_=parseInt(e,10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(e){this.itemCount_=e.itemCount,this.updateShape_()},decompose:function(e){const s=e.newBlock("lists_create_with_container");s.initSvg();let o=s.getInput("STACK").connection;for(let i=0;i<this.itemCount_;i++){const l=e.newBlock("lists_create_with_item");if(l.initSvg(),!l.previousConnection)throw Error("itemBlock has no previousConnection");o.connect(l.previousConnection),o=l.nextConnection}return s},compose:function(e){var s=e.getInputTargetBlock("STACK");for(e=[];s;)s.isInsertionMarker()||e.push(s.valueConnection_),s=s.getNextBlock();for(s=0;s<this.itemCount_;s++){const o=this.getInput("ADD"+s).connection.targetConnection;o&&!e.includes(o)&&o.disconnect()}for(this.itemCount_=e.length,this.updateShape_(),s=0;s<this.itemCount_;s++){let o;(o=e[s])==null||o.reconnect(this,"ADD"+s)}},saveConnections:function(e){e=e.getInputTargetBlock("STACK");let s=0;for(;e;){if(e.isInsertionMarker()){e=e.getNextBlock();continue}const o=this.getInput("ADD"+s);let i;e.valueConnection_=(i=o)==null?void 0:i.connection.targetConnection,e=e.getNextBlock(),s++}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(t.Msg$$module$build$src$core$msg.LISTS_CREATE_EMPTY_TITLE);for(var e=0;e<this.itemCount_;e++)if(!this.getInput("ADD"+e)){const s=this.appendValueInput("ADD"+e).setAlign(t.Align$$module$build$src$core$inputs$align.RIGHT);e===0&&s.appendField(t.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_INPUT_WITH)}for(e=this.itemCount_;this.getInput("ADD"+e);e++)this.removeInput("ADD"+e)}};u.lists_create_with=de;var me={init:function(){this.setStyle("list_blocks"),this.appendDummyInput().appendField(t.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(t.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}};u.lists_create_with_container=me;var pe={init:function(){this.setStyle("list_blocks"),this.appendDummyInput().appendField(t.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(t.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}};u.lists_create_with_item=pe;var Ee={init:function(){var e=[[t.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_FIRST,"FIRST"],[t.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_LAST,"LAST"]];if(this.setHelpUrl(t.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_HELPURL),this.setStyle("list_blocks"),this.setOutput(!0,"Number"),this.appendValueInput("VALUE").setCheck("Array").appendField(t.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_INPUT_IN_LIST),e=t.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:e}),!e)throw Error("field_dropdown not found");this.appendValueInput("FIND").appendField(e,"END"),this.setInputsInline(!0),this.setTooltip(()=>t.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))}};u.lists_indexOf=Ee;var Ie={init:function(){var e=[[t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET,"GET"],[t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_HELPURL),this.setStyle("list_blocks"),e=t.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:e}),e.setValidator(function(s){s=s==="REMOVE",this.getSourceBlock().updateStatement_(s)}),this.appendValueInput("VALUE").setCheck("Array").appendField(t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_INPUT_IN_LIST),this.appendDummyInput().appendField(e,"MODE").appendField("","SPACE"),e=t.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS}),e.setValidator(function(s){const o=this.getValue();s=s==="FROM_START"||s==="FROM_END",s!==(o==="FROM_START"||o==="FROM_END")&&this.getSourceBlock().updateAt_(s)}),this.appendDummyInput().appendField(e,"WHERE"),this.appendDummyInput("AT"),t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0),this.setTooltip(()=>{const s=this.getFieldValue("MODE"),o=this.getFieldValue("WHERE");let i="";switch(s+" "+o){case"GET FROM_START":case"GET FROM_END":i=t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET FIRST":i=t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case"GET LAST":i=t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case"GET RANDOM":i=t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":i=t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE FIRST":i=t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case"GET_REMOVE LAST":i=t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case"GET_REMOVE RANDOM":i=t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case"REMOVE FROM_START":case"REMOVE FROM_END":i=t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case"REMOVE FIRST":i=t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case"REMOVE LAST":i=t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case"REMOVE RANDOM":i=t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}return(o==="FROM_START"||o==="FROM_END")&&(i+=" "+(o==="FROM_START"?t.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:t.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),i})},mutationToDom:function(){const e=t.createElement$$module$build$src$core$utils$xml("mutation");e.setAttribute("statement",String(!this.outputConnection));const s=this.getInput("AT")instanceof t.ValueInput$$module$build$src$core$inputs$value_input;return e.setAttribute("at",String(s)),e},domToMutation:function(e){const s=e.getAttribute("statement")==="true";this.updateStatement_(s),e=e.getAttribute("at")!=="false",this.updateAt_(e)},saveExtraState:function(){return this.outputConnection?null:{isStatement:!0}},loadExtraState:function(e){e.isStatement?this.updateStatement_(!0):typeof e=="string"&&this.domToMutation(t.textToDom$$module$build$src$core$utils$xml(e))},updateStatement_:function(e){e!==!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck("Number"),t.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(t.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"),t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}};u.lists_getIndex=Ie;var ge={init:function(){var e=[[t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_SET,"SET"],[t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[t.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_IN_LIST),e=t.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:e}),this.appendDummyInput().appendField(e,"MODE").appendField("","SPACE"),e=t.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS}),e.setValidator(function(s){const o=this.getValue();s=s==="FROM_START"||s==="FROM_END",s!==(o==="FROM_START"||o==="FROM_END")&&this.getSourceBlock().updateAt_(s)}),this.appendDummyInput().appendField(e,"WHERE"),this.appendDummyInput("AT"),this.appendValueInput("TO").appendField(t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_TO),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP),this.updateAt_(!0),this.setTooltip(()=>{const s=this.getFieldValue("MODE"),o=this.getFieldValue("WHERE");let i="";switch(s+" "+o){case"SET FROM_START":case"SET FROM_END":i=t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case"SET FIRST":i=t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case"SET LAST":i=t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case"SET RANDOM":i=t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case"INSERT FROM_START":case"INSERT FROM_END":i=t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case"INSERT FIRST":i=t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case"INSERT LAST":i=t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case"INSERT RANDOM":i=t.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}return(o==="FROM_START"||o==="FROM_END")&&(i+=" "+t.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),i})},mutationToDom:function(){const e=t.createElement$$module$build$src$core$utils$xml("mutation"),s=this.getInput("AT")instanceof t.ValueInput$$module$build$src$core$inputs$value_input;return e.setAttribute("at",String(s)),e},domToMutation:function(e){e=e.getAttribute("at")!=="false",this.updateAt_(e)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck("Number"),t.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(t.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"),this.moveInputBefore("AT","TO"),this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL","TO")}};u.lists_setIndex=ge;var Oe={init:function(){this.WHERE_OPTIONS_1=[[t.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[t.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[t.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[t.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[t.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[t.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(t.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(t.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_INPUT_IN_LIST);const e=s=>{const o=t.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this["WHERE_OPTIONS_"+s]});return o.setValidator(function(i){const l=this.getValue();i=i==="FROM_START"||i==="FROM_END",i!==(l==="FROM_START"||l==="FROM_END")&&this.getSourceBlock().updateAt_(s,i)}),o};this.appendDummyInput("WHERE1_INPUT").appendField(e(1),"WHERE1"),this.appendDummyInput("AT1"),this.appendDummyInput("WHERE2_INPUT").appendField(e(2),"WHERE2"),this.appendDummyInput("AT2"),t.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(t.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(t.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){const e=t.createElement$$module$build$src$core$utils$xml("mutation");var s=this.getInput("AT1")instanceof t.ValueInput$$module$build$src$core$inputs$value_input;return e.setAttribute("at1",String(s)),s=this.getInput("AT2")instanceof t.ValueInput$$module$build$src$core$inputs$value_input,e.setAttribute("at2",String(s)),e},domToMutation:function(e){const s=e.getAttribute("at1")==="true";e=e.getAttribute("at2")==="true",this.updateAt_(1,s),this.updateAt_(2,e)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(e,s){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),s?(this.appendValueInput("AT"+e).setCheck("Number"),t.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+e).appendField(t.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+e),e===1&&(this.moveInputBefore("AT1","WHERE2_INPUT"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","WHERE2_INPUT")),t.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};u.lists_getSublist=Oe,u.lists_sort={init:function(){this.jsonInit({message0:"%{BKY_LISTS_SORT_TITLE}",args0:[{type:"field_dropdown",name:"TYPE",options:[["%{BKY_LISTS_SORT_TYPE_NUMERIC}","NUMERIC"],["%{BKY_LISTS_SORT_TYPE_TEXT}","TEXT"],["%{BKY_LISTS_SORT_TYPE_IGNORECASE}","IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[["%{BKY_LISTS_SORT_ORDER_ASCENDING}","1"],["%{BKY_LISTS_SORT_ORDER_DESCENDING}","-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_SORT_TOOLTIP}",helpUrl:"%{BKY_LISTS_SORT_HELPURL}"})}},u.lists_split={init:function(){const e=t.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:[[t.Msg$$module$build$src$core$msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[t.Msg$$module$build$src$core$msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]]});if(!e)throw Error("field_dropdown not found");e.setValidator(s=>{this.updateType_(s)}),this.setHelpUrl(t.Msg$$module$build$src$core$msg.LISTS_SPLIT_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("INPUT").setCheck("String").appendField(e,"MODE"),this.appendValueInput("DELIM").setCheck("String").appendField(t.Msg$$module$build$src$core$msg.LISTS_SPLIT_WITH_DELIMITER),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.setTooltip(()=>{const s=this.getFieldValue("MODE");if(s==="SPLIT")return t.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_SPLIT;if(s==="JOIN")return t.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_JOIN;throw Error("Unknown mode: "+s)})},updateType_:function(e){if(this.getFieldValue("MODE")!==e){const s=this.getInput("INPUT").connection;s.setShadowDom(null);const o=s.targetBlock();o&&(s.disconnect(),o.isShadow()?o.dispose(!1):this.bumpNeighbours())}e==="SPLIT"?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){const e=t.createElement$$module$build$src$core$utils$xml("mutation");return e.setAttribute("mode",this.getFieldValue("MODE")),e},domToMutation:function(e){this.updateType_(e.getAttribute("mode"))},saveExtraState:function(){return{mode:this.getFieldValue("MODE")}},loadExtraState:function(e){this.updateType_(e.mode)}},t.defineBlocks$$module$build$src$core$common(u);var he={blocks:u},Se=Object.assign({},u,E,p,m,$,n,d,T),A={blocks:Se,lists:he,logic:Te,loops:re,math:ee,procedures:J,texts:G,variables:y,variablesDynamic:C};return A.__namespace__=t,A})})(a)),a.exports}var Ne=Le();const Me=Re.getDefaultExportFromCjs(Ne),{blocks:fe,lists:Ce,logic:Pe,loops:De,math:Be,procedures:ye,texts:ke,variables:Ue,variablesDynamic:Fe}=Me;exports.blocks=fe;exports.lists=Ce;exports.logic=Pe;exports.loops=De;exports.math=Be;exports.procedures=ye;exports.texts=ke;exports.variables=Ue;exports.variablesDynamic=Fe;
|
|
4
|
-
//# sourceMappingURL=blocks-GkRPBplU.cjs.map
|