forked from google/blockly
-
Notifications
You must be signed in to change notification settings - Fork 14
/
blocks_compressed.js
215 lines (213 loc) · 93.1 KB
/
blocks_compressed.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
// Do not edit this file; automatically generated by build.py.
'use strict';
// Copyright 2012 Google Inc. Apache License 2.0
Blockly.Blocks.colour={};Blockly.Blocks.colour.HUE=20;Blockly.Blocks.colour_picker={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",colour:Blockly.Blocks.colour.HUE,tooltip:Blockly.Msg.COLOUR_PICKER_TOOLTIP,helpUrl:Blockly.Msg.COLOUR_PICKER_HELPURL})},typeblock:Blockly.Msg.COLOUR_PICKER_TYPEBLOCK};
Blockly.Blocks.colour_random={init:function(){this.jsonInit({message0:Blockly.Msg.COLOUR_RANDOM_TITLE,output:"Colour",colour:Blockly.Blocks.colour.HUE,tooltip:Blockly.Msg.COLOUR_RANDOM_TOOLTIP,helpUrl:Blockly.Msg.COLOUR_RANDOM_HELPURL})},typeblock:Blockly.Msg.COLOUR_RANDOM_TYPEBLOCK};
Blockly.Blocks.colour_rgb={init:function(){this.setHelpUrl(Blockly.Msg.COLOUR_RGB_HELPURL);this.setColour(Blockly.Blocks.colour.HUE);this.appendValueInput("RED").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_TITLE).appendField(Blockly.Msg.COLOUR_RGB_RED);this.appendValueInput("GREEN").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_GREEN);this.appendValueInput("BLUE").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_BLUE);
this.setOutput(!0,"Colour");this.setTooltip(Blockly.Msg.COLOUR_RGB_TOOLTIP)},typeblock:Blockly.Msg.COLOUR_RGB_TYPEBLOCK};
Blockly.Blocks.colour_blend={init:function(){this.setHelpUrl(Blockly.Msg.COLOUR_BLEND_HELPURL);this.setColour(Blockly.Blocks.colour.HUE);this.appendValueInput("COLOUR1").setCheck("Colour").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_BLEND_TITLE).appendField(Blockly.Msg.COLOUR_BLEND_COLOUR1);this.appendValueInput("COLOUR2").setCheck("Colour").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_BLEND_COLOUR2);this.appendValueInput("RATIO").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_BLEND_RATIO);
this.setOutput(!0,"Colour");this.setTooltip(Blockly.Msg.COLOUR_BLEND_TOOLTIP)},typeblock:Blockly.Msg.COLOUR_BLEND_TYPEBLOCK};Blockly.Blocks.lists={};Blockly.Blocks.lists.HUE=260;Blockly.Blocks.lists_create_empty={init:function(){this.jsonInit({message0:Blockly.Msg.LISTS_CREATE_EMPTY_TITLE,output:"Array",colour:Blockly.Blocks.lists.HUE,tooltip:Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP,helpUrl:Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL})},typeblock:Blockly.Msg.LISTS_CREATE_EMPTY_TYPEBLOCK};
Blockly.Blocks.lists_create_with={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_CREATE_WITH_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.workspace.options.useMutators?this.setMutator(new Blockly.Mutator(["lists_create_with_item"])):this.appendAddSubGroup(Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH,"items",null,Blockly.Msg.LISTS_CREATE_EMPTY_TITLE);this.itemCount_=1;this.updateShape_();this.setOutput(!0,"Array");this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP)},getAddSubName:function(a,
b){return"ADD"+b},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("items",this.itemCount_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);this.updateShape_()},decompose:function(a){var b=Blockly.Block.obtain(a,"lists_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,d=0;d<this.itemCount_;d++){var e=Blockly.Block.obtain(a,"lists_create_with_item");e.initSvg();c.connect(e.previousConnection);c=e.nextConnection}return b},
compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)a[b]&&this.getInput("ADD"+b).connection.connect(a[b])},saveConnections:function(a){a=a.getInputTargetBlock("STACK");for(var b=0;a;){var c=this.getInput("ADD"+b);a.valueConnection_=c&&c.connection.targetConnection;b++;a=a.nextConnection&&a.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");
else for(var a=0;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(Blockly.Msg.LISTS_CREATE_EMPTY_TITLE);else for(a=0;a<this.itemCount_;a++){var b=this.appendValueInput("ADD"+a);0==a&&b.appendField(Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH)}},getOutput:function(){for(var a=[],b=0;b<this.itemCount_;b++)a=this.getInputCollectionOutput("ADD"+b,"Array",a);return a},typeblock:[{entry:Blockly.Msg.LISTS_CREATE_WITH_TYPEBLOCK,mutatorAttributes:{items:2}}]};
Blockly.Blocks.lists_create_with_container={init:function(){this.setColour(Blockly.Blocks.lists.HUE);this.appendDummyInput().appendField(Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP);this.contextMenu=!1}};
Blockly.Blocks.lists_create_with_item={init:function(){this.setColour(Blockly.Blocks.lists.HUE);this.appendDummyInput().appendField(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP);this.contextMenu=!1}};
Blockly.Blocks.lists_repeat={init:function(){this.jsonInit({message0:Blockly.Msg.LISTS_REPEAT_TITLE,args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",colour:Blockly.Blocks.lists.HUE,tooltip:Blockly.Msg.LISTS_REPEAT_TOOLTIP,helpUrl:Blockly.Msg.LISTS_REPEAT_HELPURL})},getOutput:function(){return this.getInputCollectionOutput("ITEM","Array")},typeblock:[{entry:Blockly.Msg.LISTS_REPEAT_TYPEBLOCK,values:{NUM:5}}]};
Blockly.Blocks.lists_length={init:function(){this.jsonInit({message0:Blockly.Msg.LISTS_LENGTH_TITLE,args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",colour:Blockly.Blocks.lists.HUE,tooltip:Blockly.Msg.LISTS_LENGTH_TOOLTIP,helpUrl:Blockly.Msg.LISTS_LENGTH_HELPURL})},typeblock:Blockly.Msg.LISTS_LENGTH_TYPEBLOCK};
Blockly.Blocks.lists_isEmpty={init:function(){this.jsonInit({message0:Blockly.Msg.LISTS_ISEMPTY_TITLE,args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",colour:Blockly.Blocks.lists.HUE,tooltip:Blockly.Msg.LISTS_ISEMPTY_TOOLTIP,helpUrl:Blockly.Msg.LISTS_ISEMPTY_HELPURL})},typeblock:Blockly.Msg.LISTS_ISEMPTY_TYPEBLOCK};
Blockly.Blocks.lists_indexOf={init:function(){var a=[[Blockly.Msg.LISTS_INDEX_OF_FIRST,"FIRST"],[Blockly.Msg.LISTS_INDEX_OF_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.LISTS_INDEX_OF_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.setOutput(!0,"Number");this.appendValueInput("VALUE").setCheck("Array").appendField(Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST);this.appendValueInput("FIND").appendField(new Blockly.FieldDropdown(a),"END");this.setInputsInline(!0);this.setTooltip(Blockly.Msg.LISTS_INDEX_OF_TOOLTIP)},
typeblock:[{entry:Blockly.Msg.LISTS_INDEX_OF_FIRST_TYPEBLOCK,fields:{END:"FIRST"}},{entry:Blockly.Msg.LISTS_INDEX_OF_LAST_TYPEBLOCK,fields:{END:"LAST"}}]};
Blockly.Blocks.lists_getIndex={init:function(){var a=[[Blockly.Msg.LISTS_GET_INDEX_GET,"GET"],[Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[Blockly.Msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[Blockly.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_INDEX_FIRST,"FIRST"],[Blockly.Msg.LISTS_GET_INDEX_LAST,"LAST"],[Blockly.Msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]];this.setHelpUrl(Blockly.Msg.LISTS_GET_INDEX_HELPURL);
this.setColour(Blockly.Blocks.lists.HUE);a=new Blockly.FieldDropdown(a,function(a){this.sourceBlock_.updateStatement_("REMOVE"==a)});this.appendValueInput("VALUE").setCheck("Array").appendField(Blockly.Msg.LISTS_GET_INDEX_INPUT_IN_LIST);this.appendDummyInput().appendField(a,"MODE").appendField("","SPACE");this.appendDummyInput("AT");Blockly.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Blockly.Msg.LISTS_GET_INDEX_TAIL);this.setInputsInline(!0);this.setOutput(!0);this.updateAt_(!0);
var b=this;this.setTooltip(function(){var a=b.getFieldValue("MODE")+"_"+b.getFieldValue("WHERE");return Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_"+a]})},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("statement",!this.outputConnection);var b=this.getInput("AT").type==Blockly.INPUT_VALUE;a.setAttribute("at",b);return a},domToMutation:function(a){var b="true"==a.getAttribute("statement");this.updateStatement_(b);a="false"!=a.getAttribute("at");this.updateAt_(a)},updateStatement_:function(a){a!=
!this.outputConnection&&(this.unplug(!0,!0),a?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(a){this.removeInput("AT");this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");var b=new Blockly.FieldDropdown(this.WHERE_OPTIONS,
function(b){var d="FROM_START"==b||"FROM_END"==b;if(d!=a){var e=this.sourceBlock_;e.updateAt_(d);e.setFieldValue(b,"WHERE");return null}});this.getInput("AT").appendField(b,"WHERE");Blockly.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)},typeblock:function(){for(var a=[],b=["GET","GET_REMOVE","REMOVE"],c=["FROM_START","FROM_END","FIRST","LAST","RANDOM"],d=0;d<b.length;d++)for(var e=b[d],f=0;f<c.length;f++){var g=c[f];a.push({entry:Blockly.Msg["LISTS_GET_INDEX_"+e+"_"+g+"_TYPEBLOCK"],
values:{VALUE:'<shadow type="variables_get"><field name="VAR">list</field></shadow>'},fields:{MODE:e,WHERE:g}})}return a}};
Blockly.Blocks.lists_setIndex={init:function(){var a=[[Blockly.Msg.LISTS_SET_INDEX_SET,"SET"],[Blockly.Msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[Blockly.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_INDEX_FIRST,"FIRST"],[Blockly.Msg.LISTS_GET_INDEX_LAST,"LAST"],[Blockly.Msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]];this.setHelpUrl(Blockly.Msg.LISTS_SET_INDEX_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.appendValueInput("LIST").setCheck("Array").appendField(Blockly.Msg.LISTS_SET_INDEX_INPUT_IN_LIST);
this.appendDummyInput().appendField(new Blockly.FieldDropdown(a),"MODE").appendField("","SPACE");this.appendDummyInput("AT");this.appendValueInput("TO").appendField(Blockly.Msg.LISTS_SET_INDEX_INPUT_TO);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.LISTS_SET_INDEX_TOOLTIP);this.updateAt_(!0);var b=this;this.setTooltip(function(){var a=b.getFieldValue("MODE")+"_"+b.getFieldValue("WHERE");return Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_"+a]})},
mutationToDom:function(){var a=document.createElement("mutation"),b=this.getInput("AT").type==Blockly.INPUT_VALUE;a.setAttribute("at",b);return a},domToMutation:function(a){a="false"!=a.getAttribute("at");this.updateAt_(a)},updateAt_:function(a){this.removeInput("AT");this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");var b=new Blockly.FieldDropdown(this.WHERE_OPTIONS,
function(b){var d="FROM_START"==b||"FROM_END"==b;if(d!=a){var e=this.sourceBlock_;e.updateAt_(d);e.setFieldValue(b,"WHERE");return null}});this.moveInputBefore("AT","TO");this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL","TO");this.getInput("AT").appendField(b,"WHERE")},typeblock:function(){for(var a=[],b=["SET","INSERT"],c=["FROM_START","FROM_END","FIRST","LAST","RANDOM"],d=0;d<b.length;d++)for(var e=b[d],f=0;f<c.length;f++){var g=c[f];a.push({entry:Blockly.Msg["LISTS_SET_INDEX_"+e+"_"+g+
"_TYPEBLOCK"],values:{LIST:'<shadow type="variables_get"><field name="VAR">list</field></shadow>'},fields:{MODE:e,WHERE:g}})}return a}};
Blockly.Blocks.lists_getSublist={init:function(){this.WHERE_OPTIONS_1=[[Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.LISTS_GET_SUBLIST_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);
this.appendValueInput("LIST").setCheck("Array").appendField(Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST);this.appendDummyInput("AT1");this.appendDummyInput("AT2");Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(Blockly.Msg.LISTS_GET_SUBLIST_TAIL);this.setInputsInline(!0);this.setOutput(!0,"Array");this.updateAt_(1,!0);this.updateAt_(2,!0);this.setTooltip(Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation"),b=this.getInput("AT1").type==
Blockly.INPUT_VALUE;a.setAttribute("at1",b);b=this.getInput("AT2").type==Blockly.INPUT_VALUE;a.setAttribute("at2",b);return a},domToMutation:function(a){var b="true"==a.getAttribute("at1");a="true"==a.getAttribute("at2");this.updateAt_(1,b);this.updateAt_(2,a)},updateAt_:function(a,b){this.removeInput("AT"+a);this.removeInput("ORDINAL"+a,!0);b?(this.appendValueInput("AT"+a).setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+a).appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):
this.appendDummyInput("AT"+a);var c=new Blockly.FieldDropdown(this["WHERE_OPTIONS_"+a],function(c){var e="FROM_START"==c||"FROM_END"==c;if(e!=b){var f=this.sourceBlock_;f.updateAt_(a,e);f.setFieldValue(c,"WHERE"+a);return null}});this.getInput("AT"+a).appendField(c,"WHERE"+a);1==a&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"));Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)},typeblock:[{entry:Blockly.Msg.LISTS_GET_SUBLIST_TYPEBLOCK,
values:{LIST:'<shadow type="variables_get"><field name="VAR">list</field></shadow>'}}]};
Blockly.Blocks.lists_split={init:function(){var a=this,b=new Blockly.FieldDropdown([[Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]],function(b){a.updateType_(b)});this.setHelpUrl(Blockly.Msg.LISTS_SPLIT_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.appendValueInput("INPUT").setCheck("String").appendField(b,"MODE");this.appendValueInput("DELIM").setCheck("String").appendField(Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER);this.setInputsInline(!0);
this.setOutput(!0,"Array");this.setTooltip(function(){var b=a.getFieldValue("MODE");if("SPLIT"==b)return Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT;if("JOIN"==b)return Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN;throw"Unknown mode: "+b;})},updateType_:function(a){"SPLIT"==a?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("mode",
this.getFieldValue("MODE"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("mode"))},typeblock:[{entry:Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT_TYPEBLOCK,values:{DELIM:'<shadow type="text"><field name="TEXT">,</field></shadow>'},fields:{MODE:"SPLIT"}},{entry:Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST_TYPEBLOCK,values:{DELIM:'<shadow type="text"><field name="TEXT">,</field></shadow>'},fields:{MODE:"SPLIT"}}]};Blockly.Blocks.logic={};Blockly.Blocks.logic.HUE=210;
Blockly.Blocks.controls_if={init:function(){if(!this.workspace.options.useMutators){var a=new Blockly.FieldClickImage(this.addPng,17,17,Blockly.Msg.CONTROLS_IF_ADD_TOOLTIP);a.setChangeHandler(this.doAddField)}this.setHelpUrl(Blockly.Msg.CONTROLS_IF_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);var b=this.appendValueInput("IF0").setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_IF);this.workspace.options.useMutators||b.appendField(a,"IF_ADD");this.appendStatementInput("DO0").appendField(Blockly.Msg.CONTROLS_IF_MSG_THEN);
this.setPreviousStatement(!0);this.setNextStatement(!0);this.workspace.options.useMutators&&this.setMutator(new Blockly.Mutator(["controls_if_elseif","controls_if_else"]));var c=this;this.setTooltip(function(){if(c.elseifCount_||c.elseCount_){if(!c.elseifCount_&&c.elseCount_)return Blockly.Msg.CONTROLS_IF_TOOLTIP_2;if(c.elseifCount_&&!c.elseCount_)return Blockly.Msg.CONTROLS_IF_TOOLTIP_3;if(c.elseifCount_&&c.elseCount_)return Blockly.Msg.CONTROLS_IF_TOOLTIP_4}else return Blockly.Msg.CONTROLS_IF_TOOLTIP_1;
return""});this.elseCount_=this.elseifCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var a=document.createElement("mutation");this.elseifCount_&&a.setAttribute("elseif",this.elseifCount_);this.elseCount_&&a.setAttribute("else",1);return a},domToMutation:function(a){this.elseifCount_=parseInt(a.getAttribute("elseif"),10);this.elseCount_=parseInt(a.getAttribute("else"),10);this.updateAddSubShape()},doAddField:function(a){this.elseCount_?this.elseifCount_++:this.elseCount_=
1;this.updateAddSubShape()},doRemoveElseifField:function(a){var b=a.getPrivate().pos;a=this.elseifCount_+1;0<this.elseifCount_&&this.elseifCount_--;var c=this.getInput("IF"+b);c&&c.connection&&c.connection.targetConnection&&c.connection.targetConnection.sourceBlock_.unplug(!0,!0);var d=this.getInput("DO"+b);d&&d.connection&&d.connection.targetConnection&&d.connection.targetConnection.sourceBlock_.unplug(!0,!0);for(b+=1;b<a;b++){var e=this.getInput("IF"+b),f=this.getInput("DO"+b);if(null!=e&&e.connection&&
e.connection.targetConnection){var g=e.connection.targetConnection;g.sourceBlock_.unplug(!1,!1);c.connection.connect(g)}null!=f&&f.connection&&f.connection.targetConnection&&(g=f.connection.targetConnection,g.sourceBlock_.unplug(!1,!1),d.connection.connect(g));c=e;d=f}this.updateAddSubShape()},doRemoveElseField:function(a){this.elseCount_=0;this.updateAddSubShape()},updateAddSubShape:function(){for(var a=this.elseifCount_+1;null!=this.getInput("IF"+a);)this.removeInput("IF"+a),this.removeInput("DO"+
a),a++;this.elseCount_||null!=this.getInput("ELSE")&&this.removeInput("ELSE");var b=this.getInputIndex("DO0");goog.asserts.assert(-1!=b,"Named input DO0 not found.");if(-1!==b){b++;for(a=1;a<this.elseifCount_+1;a++,b+=2){var c=this.getInput("IF"+a);if(null==c){c=null;this.workspace.options.useMutators||(c=new Blockly.FieldClickImage(this.subPng,17,17,Blockly.Msg.CONTROLS_IF_ELSEIF_REMOVE_TOOLTIP),c.setPrivate({name:"IF",pos:a}),c.setChangeHandler(this.doRemoveElseifField));var d=this.appendValueInput("IF"+
a).setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSEIF);c&&d.appendField(c);this.appendStatementInput("DO"+a).appendField(Blockly.Msg.CONTROLS_IF_MSG_THEN);b<this.inputList.length-1&&(this.moveNumberedInputBefore(this.inputList.length-1,b),this.moveNumberedInputBefore(this.inputList.length-1,b))}}this.elseCount_&&(c=this.getInput("ELSE"),null==c&&(c=null,this.workspace.options.useMutators||(c=new Blockly.FieldClickImage(this.subPng,17,17,Blockly.Msg.CONTROLS_IF_ELSE_REMOVE_TOOLTIP),
c.setChangeHandler(this.doRemoveElseField)),a=this.appendStatementInput("ELSE").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSE),c&&a.appendField(c)))}this.rendered&&(this.render(),this.bumpNeighbours_(),this.workspace.fireChangeEvent())},decompose:function(a){var b=Blockly.Block.obtain(a,"controls_if_if");b.initSvg();for(var c=b.getInput("STACK").connection,d=1;d<=this.elseifCount_;d++){var e=Blockly.Block.obtain(a,"controls_if_elseif");e.initSvg();c.connect(e.previousConnection);c=e.nextConnection}this.elseCount_&&
(a=Blockly.Block.obtain(a,"controls_if_else"),a.initSvg(),c.connect(a.previousConnection));return b},compose:function(a){this.elseCount_&&this.removeInput("ELSE");this.elseCount_=0;for(var b=this.elseifCount_;0<b;b--)this.removeInput("IF"+b),this.removeInput("DO"+b);this.elseifCount_=0;for(a=a.getInputTargetBlock("STACK");a;){switch(a.type){case "controls_if_elseif":this.elseifCount_++;var b=this.appendValueInput("IF"+this.elseifCount_).setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSEIF),
c=this.appendStatementInput("DO"+this.elseifCount_);c.appendField(Blockly.Msg.CONTROLS_IF_MSG_THEN);a.valueConnection_&&b.connection.connect(a.valueConnection_);a.statementConnection_&&c.connection.connect(a.statementConnection_);break;case "controls_if_else":this.elseCount_++;b=this.appendStatementInput("ELSE");b.appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSE);a.statementConnection_&&b.connection.connect(a.statementConnection_);break;default:throw"Unknown block type.";}a=a.nextConnection&&a.nextConnection.targetBlock()}},
saveConnections:function(a){a=a.getInputTargetBlock("STACK");for(var b=1;a;){switch(a.type){case "controls_if_elseif":var c=this.getInput("IF"+b),d=this.getInput("DO"+b);a.valueConnection_=c&&c.connection.targetConnection;a.statementConnection_=d&&d.connection.targetConnection;b++;break;case "controls_if_else":d=this.getInput("ELSE");a.statementConnection_=d&&d.connection.targetConnection;break;default:throw"Unknown block type.";}a=a.nextConnection&&a.nextConnection.targetBlock()}},typeblock:[{entry:Blockly.Msg.CONTROLS_IF_TYPEBLOCK},
{entry:Blockly.Msg.CONTROLS_IF_ELSIF_TYPEBLOCK,mutatorAttributes:{elseif:1}},{entry:Blockly.Msg.CONTROLS_IF_ELSIF_ELSE_TYPEBLOCK,mutatorAttributes:{elseif:1,"else":1}},{entry:Blockly.Msg.CONTROLS_IF_ELSE_TYPEBLOCK,mutatorAttributes:{"else":1}}]};
Blockly.Blocks.controls_if_if={init:function(){this.setColour(Blockly.Blocks.logic.HUE);this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_IF_IF_TITLE_IF);this.appendStatementInput("STACK");this.setTooltip(Blockly.Msg.CONTROLS_IF_IF_TOOLTIP);this.contextMenu=!1}};
Blockly.Blocks.controls_if_elseif={init:function(){this.setColour(Blockly.Blocks.logic.HUE);this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP);this.contextMenu=!1}};
Blockly.Blocks.controls_if_else={init:function(){this.setColour(Blockly.Blocks.logic.HUE);this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE);this.setPreviousStatement(!0);this.setTooltip(Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP);this.contextMenu=!1}};
Blockly.Blocks.logic_compare={init:function(){var a=this.RTL?[["=","EQ"],["\u2260","NEQ"],[">","LT"],["\u2265","LTE"],["<","GT"],["\u2264","GTE"]]:[["=","EQ"],["\u2260","NEQ"],["<","LT"],["\u2264","LTE"],[">","GT"],["\u2265","GTE"]];this.setHelpUrl(Blockly.Msg.LOGIC_COMPARE_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.setOutput(!0,"Boolean");this.appendValueInput("A");this.appendValueInput("B").appendField(new Blockly.FieldDropdown(a),"OP");this.setInputsInline(!0);var b=this;this.setTooltip(function(){var a=
b.getFieldValue("OP");return{EQ:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[a]});this.prevBlocks_=[null,null]},onchange:function(){var a=this.getInputTargetBlock("A"),b=this.getInputTargetBlock("B");if(a&&b&&!a.outputConnection.checkType_(b.outputConnection))for(var c=0;c<this.prevBlocks_.length;c++){var d=
this.prevBlocks_[c];if(d===a||d===b)d.setParent(null),d.bumpNeighbours_()}this.prevBlocks_[0]=a;this.prevBlocks_[1]=b},typeblock:Blockly.Msg.LOGIC_COMPARE_TYPEBLOCK};
Blockly.Blocks.logic_operation={init:function(){var a=[[Blockly.Msg.LOGIC_OPERATION_AND,"AND"],[Blockly.Msg.LOGIC_OPERATION_OR,"OR"]];this.setHelpUrl(Blockly.Msg.LOGIC_OPERATION_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.setOutput(!0,"Boolean");this.appendValueInput("A").setCheck("Boolean");this.appendValueInput("B").setCheck("Boolean").appendField(new Blockly.FieldDropdown(a),"OP");this.setInputsInline(!0);var b=this;this.setTooltip(function(){var a=b.getFieldValue("OP");return{AND:Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND,
OR:Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR}[a]})},typeblock:[{entry:Blockly.Msg.LOGIC_OPERATION_OR_TYPEBLOCK,fields:{OP:"OR"}},{entry:Blockly.Msg.LOGIC_OPERATION_AND_TYPEBLOCK,fields:{OP:"AND"}}]};Blockly.Blocks.logic_negate={init:function(){this.jsonInit({message0:Blockly.Msg.LOGIC_NEGATE_TITLE,args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",colour:Blockly.Blocks.logic.HUE,tooltip:Blockly.Msg.LOGIC_NEGATE_TOOLTIP,helpUrl:Blockly.Msg.LOGIC_NEGATE_HELPURL})},typeblock:Blockly.Msg.LOGIC_NEGATE_TYPEBLOCK};
Blockly.Blocks.logic_boolean={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"BOOL",options:[[Blockly.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Blockly.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]]}],output:"Boolean",colour:Blockly.Blocks.logic.HUE,tooltip:Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP,helpUrl:Blockly.Msg.LOGIC_BOOLEAN_HELPURL})},typeblock:[{entry:Blockly.Msg.LOGIC_BOOLEAN_TRUE_TYPEBLOCK,fields:{BOOL:"TRUE"}},{entry:Blockly.Msg.LOGIC_BOOLEAN_FALSE_TYPEBLOCK,fields:{BOOL:"FALSE"}}]};
Blockly.Blocks.logic_null={init:function(){this.jsonInit({message0:Blockly.Msg.LOGIC_NULL,output:null,colour:Blockly.Blocks.logic.HUE,tooltip:Blockly.Msg.LOGIC_NULL_TOOLTIP,helpUrl:Blockly.Msg.LOGIC_NULL_HELPURL})},typeblock:Blockly.Msg.LOGIC_NULL_TYPEBLOCK};
Blockly.Blocks.logic_ternary={init:function(){this.setHelpUrl(Blockly.Msg.LOGIC_TERNARY_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.appendValueInput("IF").setCheck("Boolean").appendField(Blockly.Msg.LOGIC_TERNARY_CONDITION);this.appendValueInput("THEN").appendField(Blockly.Msg.LOGIC_TERNARY_IF_TRUE);this.appendValueInput("ELSE").appendField(Blockly.Msg.LOGIC_TERNARY_IF_FALSE);this.setOutput(!0);this.setTooltip(Blockly.Msg.LOGIC_TERNARY_TOOLTIP);this.prevParentConnection_=null},onchange:function(){var a=
this.getInputTargetBlock("THEN"),b=this.getInputTargetBlock("ELSE"),c=this.outputConnection.targetConnection;if((a||b)&&c)for(var d=0;2>d;d++){var e=1==d?a:b;e&&!e.outputConnection.checkType_(c)&&(c===this.prevParentConnection_?(this.setParent(null),c.sourceBlock_.bumpNeighbours_()):(e.setParent(null),e.bumpNeighbours_()))}this.prevParentConnection_=c},typeblock:Blockly.Msg.LOGIC_TERNARY_TYPEBLOCK};Blockly.Blocks.loops={};Blockly.Blocks.loops.HUE=120;
Blockly.Blocks.controls_repeat_ext={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES",check:"Number"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,tooltip:Blockly.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Blockly.Msg.CONTROLS_REPEAT_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)},isLoop:!0,typeblock:[{entry:Blockly.Msg.CONTROLS_REPEAT_TYPEBLOCK,values:{TIMES:10}}]};
Blockly.Blocks.controls_repeat={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"field_input",name:"TIMES",text:"10"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,tooltip:Blockly.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Blockly.Msg.CONTROLS_REPEAT_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO);this.getField("TIMES").setChangeHandler(Blockly.FieldTextInput.nonnegativeIntegerValidator)},isLoop:!0};
Blockly.Blocks.controls_whileUntil={init:function(){var a=[[Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]];this.setHelpUrl(Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL);this.setColour(Blockly.Blocks.loops.HUE);this.appendValueInput("BOOL").setCheck("Boolean").appendField(new Blockly.FieldDropdown(a),"MODE");this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO);this.setPreviousStatement(!0);this.setNextStatement(!0);
var b=this;this.setTooltip(function(){var a=b.getFieldValue("MODE");return{WHILE:Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[a]})},isLoop:!0,typeblock:[{entry:Blockly.Msg.CONTROLS_WHILEUNTIL_WHILE_TYPEBLOCK,fields:{MODE:"WHILE"}},{entry:Blockly.Msg.CONTROLS_WHILEUNTIL_UNTIL_TYPEBLOCK,fields:{MODE:"UNTIL"}}]};
Blockly.Blocks.controls_for={init:function(){this.jsonInit({message0:Blockly.Msg.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"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,helpUrl:Blockly.Msg.CONTROLS_FOR_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_FOR_INPUT_DO);
var a=this;this.setTooltip(function(){return Blockly.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",a.getFieldValue("VAR"))})},isLoop:!0,getVars:function(){return[this.getFieldValue("VAR")]},getVarsTypes:function(){var a={};a[this.getFieldValue("VAR")]=["Number"];return a},renameVar:function(a,b){Blockly.Names.equals(a,this.getFieldValue("VAR"))&&this.setFieldValue(b,"VAR")},customContextMenu:function(a){if(!this.isCollapsed()){var b={enabled:!0},c=this.getFieldValue("VAR");b.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",
c);c=goog.dom.createDom("field",null,c);c.setAttribute("name","VAR");c=goog.dom.createDom("block",null,c);c.setAttribute("type","variables_get");b.callback=Blockly.ContextMenu.callbackFactory(this,c);a.push(b)}},typeblock:[{entry:Blockly.Msg.CONTROLS_FOR_TYPEBLOCK,values:{FROM:1,TO:10,BY:1}}]};
Blockly.Blocks.controls_forEach={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_FOREACH_TITLE,args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Array"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,helpUrl:Blockly.Msg.CONTROLS_FOREACH_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_FOREACH_INPUT_DO);var a=this;this.setTooltip(function(){return Blockly.Msg.CONTROLS_FOREACH_TOOLTIP.replace("%1",
a.getFieldValue("VAR"))})},isLoop:!0,getVars:function(){return[this.getFieldValue("VAR")]},getVarsTypes:function(){var a={},b={},c=this.getInputTargetBlock("LIST").getOutput();if(c)for(var d=0;d<c.length;d++){var e=c[d].split(":");b[e[1]]=1}a[this.getFieldValue("VAR")]=Object.keys(b);return a},renameVar:function(a,b){Blockly.Names.equals(a,this.getFieldValue("VAR"))&&this.setFieldValue(b,"VAR")},customContextMenu:Blockly.Blocks.controls_for.customContextMenu,typeblock:Blockly.Msg.CONTROLS_FOREACH_TYPEBLOCK};
Blockly.Blocks.controls_flow_statements={init:function(){var a=[[Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];this.setHelpUrl(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL);this.setColour(Blockly.Blocks.loops.HUE);this.appendDummyInput().appendField(new Blockly.FieldDropdown(a),"FLOW");this.setPreviousStatement(!0);var b=this;this.setTooltip(function(){var a=b.getFieldValue("FLOW");return{BREAK:Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,
CONTINUE:Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[a]})},onchange:function(){var a=!1,b=this;do{if(b.isLoop){a=!0;break}b=b.getSurroundParent()}while(b);a?this.setWarningText(null):this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING)},typeblock:[{entry:Blockly.Msg.CONTROLS_FLOW_STATEMENTS_BREAK_TYPEBLOCK,fields:{FLOW:"BREAK"}},{entry:Blockly.Msg.CONTROLS_FLOW_STATEMENTS_CONTINUE_TYPEBLOCK,fields:{FLOW:"CONTINUE"}}]};Blockly.Blocks.maps={};Blockly.Blocks.maps.HUE=345;Blockly.Blocks.maps_create_empty={init:function(){this.jsonInit({id:"maps_create_empty",message0:Blockly.Msg.MAPS_CREATE_EMPTY_TITLE,args0:[],inputsInline:!0,output:"Map",colour:Blockly.Blocks.maps.HUE,tooltip:Blockly.Msg.MAPS_CREATE_EMPTY_TOOLTIP,helpUrl:Blockly.Msg.MAPS_CREATE_EMPTY_HELPURL})},typeblock:Blockly.Msg.MAPS_CREATE_EMPTY_TYPEBLOCK};
Blockly.Blocks.maps_create_with={init:function(){this.setHelpUrl(Blockly.Msg.MAPS_CREATE_WITH_HELPURL);this.setColour(Blockly.Blocks.maps.HUE);this.workspace.options.useMutators?this.setMutator(new Blockly.Mutator(["maps_create_with_item"])):this.appendAddSubGroup(Blockly.Msg.MAPS_CREATE_WITH_INPUT_WITH,"items",null,Blockly.Msg.MAPS_CREATE_EMPTY_TITLE);this.itemCount_=1;this.updateShape_();this.setOutput(!0,"Map");this.setTooltip(Blockly.Msg.MAPS_CREATE_WITH_TOOLTIP)},getAddSubName:function(a,b){return"ADD"+
b},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("items",this.itemCount_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);this.updateShape_()},decompose:function(a){var b=Blockly.Block.obtain(a,"maps_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,d=0;d<this.itemCount_;d++){var e=Blockly.Block.obtain(a,"maps_create_with_item");e.initSvg();c.connect(e.previousConnection);c=e.nextConnection}return b},
compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)a[b]&&this.getInput("ADD"+b).connection.connect(a[b])},saveConnections:function(a){a=a.getInputTargetBlock("STACK");for(var b=0;a;){var c=this.getInput("ADD"+b);a.valueConnection_=c&&c.connection.targetConnection;b++;a=a.nextConnection&&a.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");
else for(var a=0;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(Blockly.Msg.MAPS_CREATE_EMPTY_TITLE);else for(a=0;a<this.itemCount_;a++){var b=this.appendValueInput("ADD"+a);0==a&&b.appendField(Blockly.Msg.MAPS_CREATE_WITH_INPUT_WITH)}},typeblock:[{entry:Blockly.Msg.MAPS_CREATE_WITH_TYPEBLOCK,mutatorAttributes:{items:2}}]};
Blockly.Blocks.maps_create_with_container={init:function(){this.setColour(Blockly.Blocks.maps.HUE);this.appendDummyInput().appendField(Blockly.Msg.MAPS_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip(Blockly.Msg.MAPS_CREATE_WITH_CONTAINER_TOOLTIP);this.contextMenu=!1}};
Blockly.Blocks.maps_create_with_item={init:function(){this.setColour(Blockly.Blocks.maps.HUE);this.appendDummyInput().appendField(Blockly.Msg.MAPS_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.MAPS_CREATE_WITH_ITEM_TOOLTIP);this.contextMenu=!1}};
Blockly.Blocks.maps_length={init:function(){this.jsonInit({id:"maps_length",message0:Blockly.Msg.MAPS_LENGTH_TITLE,args0:[{type:"input_value",name:"MAP",check:"Map"}],inputsInline:!1,output:"Number",colour:Blockly.Blocks.maps.HUE,tooltip:Blockly.Msg.MAPS_LENGTH_TOOLTIP,helpUrl:Blockly.Msg.MAPS_LENGTH_URL})},typeblock:Blockly.Msg.MAPS_LENGTH_TYPEBLOCK};
Blockly.Blocks.maps_isempty={init:function(){this.jsonInit({id:"maps_isempty",message0:Blockly.Msg.MAPS_ISEMPTY_TITLE,args0:[{type:"input_value",name:"MAP",check:"Map"}],inputsInline:!0,output:"Boolean",colour:Blockly.Blocks.maps.HUE,tooltip:Blockly.Msg.MAPS_ISEMPTY_TOOLTIP,helpUrl:Blockly.Msg.MAPS_ISEMPTY_HELPURL})},typeblock:Blockly.Msg.MAPS_ISEMPTY_TYPEBLOCK};
Blockly.Blocks.maps_create={init:function(){this.jsonInit({id:"maps_create",message0:Blockly.Msg.MAPS_CREATE_TITLE,args0:[{type:"input_value",name:"KEY",check:"String"},{type:"input_value",name:"VAL"}],inputsInline:!0,output:"Map",colour:Blockly.Blocks.maps.HUE,tooltip:Blockly.Msg.MAPS_CREATE_TOOLTIP,helpUrl:Blockly.Msg.MAPS_CREATE_HELPURL})},typeblock:Blockly.Msg.MAPS_CREATE_TYPEBLOCK};
Blockly.Blocks.maps_getIndex={init:function(){this.jsonInit({id:"maps_getIndex",message0:Blockly.Msg.MAPS_GET_INDEX_INPUT_IN_MAP+"%1 %2 %3",args0:[{type:"input_value",name:"MAP",check:"Map"},{type:"field_dropdown",name:"MODE",options:[[Blockly.Msg.LISTS_GET_INDEX_GET,"GET"],[Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[Blockly.Msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]]},{type:"input_value",name:"KEY",check:"String"}],inputsInline:!0,colour:Blockly.Blocks.maps.HUE,helpUrl:Blockly.Msg.MAPS_GET_INDEX_HELPURL});
this.getField("MODE").setChangeHandler(function(a){this.sourceBlock_.updateStatement_("REMOVE"==a)});this.updateStatement_(!1);var a=this;this.setTooltip(function(){return Blockly.Msg["MAPS_GET_INDEX_TOOLTIP_"+a.getFieldValue("MODE")]})},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("statement",!this.outputConnection);return a},domToMutation:function(a){a="true"==a.getAttribute("statement");this.updateStatement_(a)},updateStatement_:function(a){a!=!this.outputConnection&&
(this.unplug(!0,!0),a?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},typeblock:function(){for(var a=[],b=["GET","GET_REMOVE","REMOVE"],c=0;c<b.length;c++){var d=b[c];a.push({entry:Blockly.Msg["MAPS_GET_INDEX_"+d+"_TYPEBLOCK"],values:{MAP:'<block type="variables_get"><field name="VAR">map</field></block>'},fields:{MODE:d}})}return a}};
Blockly.Blocks.maps_setIndex={init:function(){this.jsonInit({id:"maps_setindex",message0:Blockly.Msg.MAPS_SET_INDEX_INPUT_IN_MAP+"%1"+Blockly.Msg.MAPS_SET_INDEX_SET+"%2"+Blockly.Msg.MAPS_SET_INDEX_INPUT_TO+"%3",args0:[{type:"input_value",name:"MAP",check:"Map"},{type:"input_value",name:"KEY",check:"String"},{type:"input_value",name:"VAL"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:Blockly.Blocks.maps.HUE,tooltip:Blockly.Msg.MAPS_SET_INDEX_TOOLTIP,helpUrl:Blockly.Msg.MAPS_SET_INDEX_HELPURL})},
typeblock:[{entry:Blockly.Msg.MAPS_SET_INDEX_TYPEBLOCK,values:{MAP:'<block type="variables_get"><field name="VAR">map</field></block>'}}]};Blockly.Blocks.maps_keys={init:function(){this.jsonInit({id:"maps_keys",message0:Blockly.Msg.MAPS_KEYS_TITLE,args0:[{type:"input_value",name:"MAP",check:"Map"}],inputsInline:!0,output:"Array",colour:Blockly.Blocks.maps.HUE,tooltip:Blockly.Msg.MAPS_KEYS_TOOLTIP,helpUrl:Blockly.Msg.MAPS_KEYS_HELPURL})},typeblock:Blockly.Msg.MAPS_KEYS_TYPEBLOCK};
Blockly.Blocks.controls_forEachKey={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_FOREACH_KEY_TITLE,args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Map"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.loops.HUE,helpUrl:Blockly.Msg.CONTROLS_FOREACH_KEY_HELPURL});this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_FOREACH_INPUT_DO);var a=this;this.setTooltip(function(){return Blockly.Msg.CONTROLS_FOREACH_TOOLTIP.replace("%1",
a.getFieldValue("VAR"))})},isLoop:!0,getVars:Blockly.Blocks.controls_forEach.getVars,getVarsTypes:function(){var a={};a[this.getFieldValue("VAR")]=["String"];return a},renameVar:Blockly.Blocks.controls_forEach.renameVar,customContextMenu:Blockly.Blocks.controls_forEach.customContextMenu,typeblock:Blockly.Msg.CONTROLS_FOREACH_KEY_TYPEBLOCK};Blockly.Blocks.math={};Blockly.Blocks.math.HUE=230;Blockly.Blocks.math_number={init:function(){this.setHelpUrl(Blockly.Msg.MATH_NUMBER_HELPURL);this.setColour(Blockly.Blocks.math.HUE);this.appendDummyInput().appendField(new Blockly.FieldTextInput("0",Blockly.FieldTextInput.numberValidator),"NUM");this.setOutput(!0,"Number");this.setTooltip(Blockly.Msg.MATH_NUMBER_TOOLTIP)}};
Blockly.Blocks.math_arithmetic={init:function(){var a=[[Blockly.Msg.MATH_ADDITION_SYMBOL,"ADD"],[Blockly.Msg.MATH_SUBTRACTION_SYMBOL,"MINUS"],[Blockly.Msg.MATH_MULTIPLICATION_SYMBOL,"MULTIPLY"],[Blockly.Msg.MATH_DIVISION_SYMBOL,"DIVIDE"],[Blockly.Msg.MATH_POWER_SYMBOL,"POWER"]];this.setHelpUrl(Blockly.Msg.MATH_ARITHMETIC_HELPURL);this.setColour(Blockly.Blocks.math.HUE);this.setOutput(!0,"Number");this.appendValueInput("A").setCheck("Number");this.appendValueInput("B").setCheck("Number").appendField(new Blockly.FieldDropdown(a),
"OP");this.setInputsInline(!0);var b=this;this.setTooltip(function(){var a=b.getFieldValue("OP");return{ADD:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[a]})},typeblock:[{entry:Blockly.Msg.MATH_ARITHMETIC_ADD_TYPEBLOCK,fields:{OP:"ADD"}},{entry:Blockly.Msg.MATH_ARITHMETIC_MINUS_TYPEBLOCK,fields:{OP:"MINUS"}},
{entry:Blockly.Msg.MATH_ARITHMETIC_MULTIPLY_TYPEBLOCK,fields:{OP:"MULTIPLY"}},{entry:Blockly.Msg.MATH_ARITHMETIC_DIVIDE_TYPEBLOCK,fields:{OP:"DIVIDE"}},{entry:Blockly.Msg.MATH_ARITHMETIC_POWER_TYPEBLOCK,fields:{OP:"POWER"}}]};
Blockly.Blocks.math_single={init:function(){var a=[[Blockly.Msg.MATH_SINGLE_OP_ROOT,"ROOT"],[Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE,"ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]];this.setHelpUrl(Blockly.Msg.MATH_SINGLE_HELPURL);this.setColour(Blockly.Blocks.math.HUE);this.setOutput(!0,"Number");this.appendValueInput("NUM").setCheck("Number").appendField(new Blockly.FieldDropdown(a),"OP");var b=this;this.setTooltip(function(){var a=b.getFieldValue("OP");return{ROOT:Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT,
ABS:Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS,NEG:Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG,LN:Blockly.Msg.MATH_SINGLE_TOOLTIP_LN,LOG10:Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10,EXP:Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP,POW10:Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10}[a]})},typeblock:[{entry:Blockly.Msg.MATH_SINGLE_OP_ROOT_TYPEBLOCK,fields:{OP:"ROOT"}},{entry:Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE_TYPEBLOCK,fields:{OP:"ABS"}},{entry:Blockly.Msg.MATH_SINGLE_OP_NEG_TYPEBLOCK,fields:{OP:"NEG"}},{entry:"ln",fields:{OP:"LN"}},
{entry:"log10",fields:{OP:"LOG10"}},{entry:"e^",fields:{OP:"EXP"}},{entry:"10^",fields:{OP:"POW10"}}]};
Blockly.Blocks.math_trig={init:function(){var a=[[Blockly.Msg.MATH_TRIG_SIN,"SIN"],[Blockly.Msg.MATH_TRIG_COS,"COS"],[Blockly.Msg.MATH_TRIG_TAN,"TAN"],[Blockly.Msg.MATH_TRIG_ASIN,"ASIN"],[Blockly.Msg.MATH_TRIG_ACOS,"ACOS"],[Blockly.Msg.MATH_TRIG_ATAN,"ATAN"]];this.setHelpUrl(Blockly.Msg.MATH_TRIG_HELPURL);this.setColour(Blockly.Blocks.math.HUE);this.setOutput(!0,"Number");this.appendValueInput("NUM").setCheck("Number").appendField(new Blockly.FieldDropdown(a),"OP");var b=this;this.setTooltip(function(){var a=
b.getFieldValue("OP");return{SIN:Blockly.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Blockly.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Blockly.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN}[a]})},typeblock:[{entry:Blockly.Msg.MATH_TRIG_SIN_TYPEBLOCK,fields:{OP:"SIN"}},{entry:Blockly.Msg.MATH_TRIG_COS_TYPEBLOCK,fields:{OP:"COS"}},{entry:Blockly.Msg.MATH_TRIG_TAN_TYPEBLOCK,fields:{OP:"TAN"}},{entry:Blockly.Msg.MATH_TRIG_ASIN_TYPEBLOCK,
fields:{OP:"ASIN"}},{entry:Blockly.Msg.MATH_TRIG_ACOS_TYPEBLOCK,fields:{OP:"ACOS"}},{entry:Blockly.Msg.MATH_TRIG_ATAN_TYPEBLOCK,fields:{OP:"ATAN"}}]};
Blockly.Blocks.math_constant={init:function(){this.setHelpUrl(Blockly.Msg.MATH_CONSTANT_HELPURL);this.setColour(Blockly.Blocks.math.HUE);this.setOutput(!0,"Number");this.appendDummyInput().appendField(new Blockly.FieldDropdown([["\u03c0","PI"],["e","E"],["\u03c6","GOLDEN_RATIO"],["sqrt(2)","SQRT2"],["sqrt(\u00bd)","SQRT1_2"],["\u221e","INFINITY"]]),"CONSTANT");this.setTooltip(Blockly.Msg.MATH_CONSTANT_TOOLTIP)},typeblock:[{entry:Blockly.Msg.MATH_CONSTANT_PI_TYPEBLOCK,fields:{CONSTANT:"PI"}},{entry:Blockly.Msg.MATH_CONSTANT_E_TYPEBLOCK,
fields:{CONSTANT:"E"}},{entry:Blockly.Msg.MATH_CONSTANT_GOLDEN_RATIO_TYPEBLOCK,fields:{CONSTANT:"GOLDEN_RATIO"}},{entry:Blockly.Msg.MATH_CONSTANT_SQRT2_TYPEBLOCK,fields:{CONSTANT:"SQRT2"}},{entry:Blockly.Msg.MATH_CONSTANT_SQRT1_2_TYPEBLOCK,fields:{CONSTANT:"SQRT1_2"}},{entry:Blockly.Msg.MATH_CONSTANT_INFINITY_TYPEBLOCK,fields:{CONSTANT:"INFINITY"}}]};
Blockly.Blocks.math_number_property={init:function(){var a=[[Blockly.Msg.MATH_IS_EVEN,"EVEN"],[Blockly.Msg.MATH_IS_ODD,"ODD"],[Blockly.Msg.MATH_IS_PRIME,"PRIME"],[Blockly.Msg.MATH_IS_WHOLE,"WHOLE"],[Blockly.Msg.MATH_IS_POSITIVE,"POSITIVE"],[Blockly.Msg.MATH_IS_NEGATIVE,"NEGATIVE"],[Blockly.Msg.MATH_IS_DIVISIBLE_BY,"DIVISIBLE_BY"]];this.setColour(Blockly.Blocks.math.HUE);this.appendValueInput("NUMBER_TO_CHECK").setCheck("Number");a=new Blockly.FieldDropdown(a,function(a){this.sourceBlock_.updateShape_("DIVISIBLE_BY"==
a)});this.appendDummyInput().appendField(a,"PROPERTY");this.setInputsInline(!0);this.setOutput(!0,"Boolean");this.setTooltip(Blockly.Msg.MATH_IS_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation"),b="DIVISIBLE_BY"==this.getFieldValue("PROPERTY");a.setAttribute("divisor_input",b);return a},domToMutation:function(a){a="true"==a.getAttribute("divisor_input");this.updateShape_(a)},updateShape_:function(a){var b=this.getInput("DIVISOR");a?b||this.appendValueInput("DIVISOR").setCheck("Number"):
b&&this.removeInput("DIVISOR")},typeblock:[{entry:Blockly.Msg.MATH_IS_EVEN_TYPEBLOCK,fields:{PROPERTY:"EVEN"}},{entry:Blockly.Msg.MATH_IS_ODD_TYPEBLOCK,fields:{PROPERTY:"ODD"}},{entry:Blockly.Msg.MATH_IS_PRIME_TYPEBLOCK,fields:{PROPERTY:"PRIME"}},{entry:Blockly.Msg.MATH_IS_WHOLE_TYPEBLOCK,fields:{PROPERTY:"WHOLE"}},{entry:Blockly.Msg.MATH_IS_POSITIVE_TYPEBLOCK,fields:{PROPERTY:"POSITIVE"}},{entry:Blockly.Msg.MATH_IS_NEGATIVE_TYPEBLOCK,fields:{PROPERTY:"NEGATIVE"}},{entry:Blockly.Msg.MATH_IS_DIVISIBLE_BY_TYPEBLOCK,
fields:{PROPERTY:"DIVISIBLE_BY"}}]};
Blockly.Blocks.math_change={init:function(){this.jsonInit({message0:Blockly.Msg.MATH_CHANGE_TITLE,args0:[{type:"field_variable",name:"VAR",variable:Blockly.Msg.MATH_CHANGE_TITLE_ITEM},{type:"input_value",name:"DELTA",check:"Number"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.math.HUE,helpUrl:Blockly.Msg.MATH_CHANGE_HELPURL});var a=this;this.setTooltip(function(){return Blockly.Msg.MATH_CHANGE_TOOLTIP.replace("%1",a.getFieldValue("VAR"))})},getVars:function(){return[this.getFieldValue("VAR")]},
renameVar:function(a,b){Blockly.Names.equals(a,this.getFieldValue("VAR"))&&this.setFieldValue(b,"VAR")},typeblock:[{entry:Blockly.Msg.MATH_CHANGE_TYPEBLOCK,values:{DELTA:1}}]};
Blockly.Blocks.math_round={init:function(){var a=[[Blockly.Msg.MATH_ROUND_OPERATOR_ROUND,"ROUND"],[Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP,"ROUNDUP"],[Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN,"ROUNDDOWN"]];this.setHelpUrl(Blockly.Msg.MATH_ROUND_HELPURL);this.setColour(Blockly.Blocks.math.HUE);this.setOutput(!0,"Number");this.appendValueInput("NUM").setCheck("Number").appendField(new Blockly.FieldDropdown(a),"OP");this.setTooltip(Blockly.Msg.MATH_ROUND_TOOLTIP)},typeblock:[{entry:Blockly.Msg.MATH_ROUND_ROUND_TYPEBLOCK,
fields:{OP:"ROUND"}},{entry:Blockly.Msg.MATH_ROUND_ROUNDUP_TYPEBLOCK,fields:{OP:"ROUNDUP"}},{entry:Blockly.Msg.MATH_ROUND_ROUNDDOWN_TYPEBLOCK,fields:{OP:"ROUNDDOWN"}}]};
Blockly.Blocks.math_format_as_decimal={init:function(){this.jsonInit({message0:Blockly.Msg.MATH_FORMAT_AS_DECIMAL_TITLE,args0:[{type:"input_value",name:"NUM",check:"Number"},{type:"input_value",name:"PLACES",check:"Number"}],inputsInline:!0,output:"Number",colour:Blockly.Blocks.math.HUE,tooltip:Blockly.getToolTipString("math_format_as_decimal_tooltip"),helpUrl:Blockly.getUrlString("math_format_as_decimal_url")})},typeblock:Blockly.Msg.MATH_FORMAT_AS_DECIMAL_TYPEBLOCK};
Blockly.Blocks.math_on_list={init:function(){var a=[[Blockly.Msg.MATH_ONLIST_OPERATOR_SUM,"SUM"],[Blockly.Msg.MATH_ONLIST_OPERATOR_MIN,"MIN"],[Blockly.Msg.MATH_ONLIST_OPERATOR_MAX,"MAX"],[Blockly.Msg.MATH_ONLIST_OPERATOR_AVERAGE,"AVERAGE"],[Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN,"MEDIAN"],[Blockly.Msg.MATH_ONLIST_OPERATOR_MODE,"MODE"],[Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV,"STD_DEV"],[Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM,"RANDOM"]],b=this;this.setHelpUrl(Blockly.Msg.MATH_ONLIST_HELPURL);this.setColour(Blockly.Blocks.math.HUE);
this.setOutput(!0,"Number");a=new Blockly.FieldDropdown(a,function(a){b.updateType_(a)});this.appendValueInput("LIST").setCheck("Array").appendField(a,"OP");this.setTooltip(function(){var a=b.getFieldValue("OP");return{SUM:Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM,MIN:Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN,MAX:Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX,AVERAGE:Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE,MEDIAN:Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN,MODE:Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE,STD_DEV:Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV,
RANDOM:Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM}[a]})},updateType_:function(a){"MODE"==a?this.outputConnection.setCheck("Array"):this.outputConnection.setCheck("Number")},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("op",this.getFieldValue("OP"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("op"))},typeblock:[{entry:Blockly.Msg.MATH_ONLIST_SUM_TYPEBLOCK,fields:{OP:"SUM"}},{entry:Blockly.Msg.MATH_ONLIST_MIN_TYPEBLOCK,fields:{OP:"MIN"}},{entry:Blockly.Msg.MATH_ONLIST_MAX_TYPEBLOCK,
fields:{OP:"MAX"}},{entry:Blockly.Msg.MATH_ONLIST_AVERAGE_TYPEBLOCK,fields:{OP:"AVERAGE"}},{entry:Blockly.Msg.MATH_ONLIST_MEDIAN_TYPEBLOCK,fields:{OP:"MEDIAN"}},{entry:Blockly.Msg.MATH_ONLIST_MODE_TYPEBLOCK,fields:{OP:"MODE"}},{entry:Blockly.Msg.MATH_ONLIST_STD_DEV_TYPEBLOCK,fields:{OP:"STD_DEV"}},{entry:Blockly.Msg.MATH_ONLIST_RANDOM_TYPEBLOCK,fields:{OP:"RANDOM"}}]};
Blockly.Blocks.math_modulo={init:function(){this.jsonInit({message0:Blockly.Msg.MATH_MODULO_TITLE,args0:[{type:"input_value",name:"DIVIDEND",check:"Number"},{type:"input_value",name:"DIVISOR",check:"Number"}],inputsInline:!0,output:"Number",colour:Blockly.Blocks.math.HUE,tooltip:Blockly.Msg.MATH_MODULO_TOOLTIP,helpUrl:Blockly.Msg.MATH_MODULO_HELPURL})},typeblock:Blockly.Msg.MATH_MODULO_TYPEBLOCK};
Blockly.Blocks.math_constrain={init:function(){this.jsonInit({message0:Blockly.Msg.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",colour:Blockly.Blocks.math.HUE,tooltip:Blockly.Msg.MATH_CONSTRAIN_TOOLTIP,helpUrl:Blockly.Msg.MATH_CONSTRAIN_HELPURL})},typeblock:[{entry:Blockly.Msg.MATH_CONSTRAIN_TYPEBLOCK,values:{LOW:1,HIGH:100}}]};
Blockly.Blocks.math_random_int={init:function(){this.jsonInit({message0:Blockly.Msg.MATH_RANDOM_INT_TITLE,args0:[{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,output:"Number",colour:Blockly.Blocks.math.HUE,tooltip:Blockly.Msg.MATH_RANDOM_INT_TOOLTIP,helpUrl:Blockly.Msg.MATH_RANDOM_INT_HELPURL})},typeblock:[{entry:Blockly.Msg.MATH_RANDOM_INT_TYPEBLOCK,values:{FROM:1,TO:100}}]};
Blockly.Blocks.math_random_float={init:function(){this.setHelpUrl(Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL);this.setColour(Blockly.Blocks.math.HUE);this.setOutput(!0,"Number");this.appendDummyInput().appendField(Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM);this.setTooltip(Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP)},typeblock:Blockly.Msg.MATH_RANDOM_FLOAT_TYPEBLOCK};Blockly.Blocks.procedures={};Blockly.Blocks.procedures.HUE=290;
Blockly.Blocks.procedures_defnoreturn={init:function(){var a="",b="PARAMS";this.workspace.options.useMutators?this.setMutator(new Blockly.Mutator(["procedures_mutatorarg"])):(a=new Blockly.FieldClickImage(this.addPng,17,17),a.setChangeHandler(this.doAddField),b=null);this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL);this.setColour(Blockly.Blocks.procedures.HUE);var c=new Blockly.FieldTextInput(Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE,Blockly.Procedures.rename);c.setSpellcheck(!1);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE).appendField(c,
"NAME").appendField(a,b);this.setTooltip(Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP);this.setInputsInline(!1);this.arguments_=[];this.setStatements_(!0);this.statementConnection_=null;this.hasReturnValue_=!1;this.argid=0},validate:function(){var a=Blockly.Procedures.findLegalName(this.getFieldValue("NAME"),this);this.setFieldValue(a,"NAME")},doAddField:function(a){a=this.arguments_.length;for(var b="param"+a,c=!0;c;)for(var c=!1,d=0;d<this.arguments_.length;d++)if(this.arguments_[d].name.toLowerCase()===
b){c=!0;a++;b="param"+a;break}this.arguments_.push({name:b,type:"",id:this.argid++});this.updateParams_()},doRemoveField:function(a){a=a.getPrivate().pos;this.arguments_.splice(a,1);this.updateParams_()},updateParams_:function(){for(var a=null,b={},c=0;c<this.arguments_.length;c++){var d="arg_"+this.arguments_[c].name.toLowerCase();if(b[d]){a=Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING;break}b[d]=!0}this.setWarningText(a);for(c=this.arguments_.length;null!=this.getInput("PARAM"+c);)this.removeInput("PARAM"+
c),c++;for(c=0;c<this.arguments_.length;c++){var e="PARAM"+c+"_NAME",b="PARAM"+c+"_TYPE",d="PARAM"+c+"_SUB",f={message0:Blockly.Msg.PROCEDURES_PARAM_WITH_TYPE,args0:[{type:"field_input",text:this.arguments_[c].name,spellcheck:!1,name:e},{type:"field_scopevariable",scope:"Types",name:b},{type:"field_clickimage",src:this.subPng,width:17,height:17,alt:Blockly.Msg.CLICK_REMOVE_TOOLTIP,name:d},{type:"input_dummy",align:"RIGHT",name:"PARAM"+c}],colour:Blockly.Blocks.procedures.HUE};this.workspace.options.useMutators&&
(a=f.message0,a=a.replace("%3",""),a=a.replace("%4","%3"),f.message0=a,f.args0.splice(2,1));this.getInput("PARAM"+c)?(this.setFieldValue(this.arguments_[c].name,e),this.setFieldValue(this.arguments_[c].type,b)):(this.jsonInit(f),a=this.getField(e),a.setSerializable(!1),a.argPos_=c,a.setChangeHandler(this.updateParam),a=this.getField(d),null!=a&&(a.setSerializable(!1),a.setPrivate({name:"param",pos:c}),a.setChangeHandler(this.doRemoveField)),a=this.getField(b),null!=a&&(a.setSerializable(!1),a.setChangeHandler(this.updateType),
a.setMsgStrings(null,null,Blockly.Msg.PROCEDURES_NEWTYPE,Blockly.Msg.PROCEDURES_NEWTYPETITLE),a.argPos_=c,a.setMsgEmpty("Any"),(b=this.arguments_[c].type)||(b=""),a.setValue(b)),this.moveNumberedInputBefore(this.inputList.length-1,c+1))}Blockly.Procedures.mutateCallers(this.getFieldValue("NAME"),this.workspace,this.arguments_);this.workspace.fireChangeEvent()},updateType:function(a){var b=this.argPos_,c=this.sourceBlock_;c.arguments_[b].type!==a&&(c.arguments_[b].type=a,c.updateParams_());return a},
updateParam:function(a){if(""===a)return null;var b=this.argPos_,c=this.sourceBlock_;c.arguments_[b].name!==a&&(c.arguments_[b].name=a,c.updateParams_());return a},setStatements_:function(a){this.hasStatements_!==a&&(a?(this.appendStatementInput("STACK").appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=a)},mutationToDom:function(){for(var a=document.createElement("mutation"),b=0;b<this.arguments_.length;b++){var c=
document.createElement("arg");c.setAttribute("name",this.arguments_[b].name);var d=this.arguments_[b].type;d||(d="");c.setAttribute("type",d);a.appendChild(c)}this.hasStatements_||a.setAttribute("statements","false");return a},domToMutation:function(a){this.arguments_=[];for(var b=0,c;c=a.childNodes[b];b++)"arg"==c.nodeName.toLowerCase()&&this.arguments_.push({name:c.getAttribute("name"),type:c.getAttribute("type"),id:this.argid++});this.updateParams_();this.setStatements_("false"!==a.getAttribute("statements"))},
decompose:function(a){var b=Blockly.Block.obtain(a,"procedures_mutatorcontainer");b.initSvg();this.getInput("RETURN")?b.setFieldValue(this.hasStatements_?"TRUE":"FALSE","STATEMENTS"):b.getInput("STATEMENT_INPUT").setVisible(!1);for(var c=b.getInput("STACK").connection,d=0;d<this.arguments_.length;d++){var e=Blockly.Block.obtain(a,"procedures_mutatorarg");e.initSvg();e.setFieldValue(this.arguments_[d].name,"NAME");e.oldLocation=d;c.connect(e.previousConnection);c=e.nextConnection}Blockly.Procedures.mutateCallers(this.getFieldValue("NAME"),
this.workspace,this.arguments_,null);return b},compose:function(a){this.arguments_=[];this.paramIds_=[];for(var b=a.getInputTargetBlock("STACK");b;)this.arguments_.push({name:b.getFieldValue("NAME"),type:""}),this.paramIds_.push(b.id),b=b.nextConnection&&b.nextConnection.targetBlock();this.updateParams_();Blockly.Procedures.mutateCallers(this.getFieldValue("NAME"),this.workspace,this.arguments_,this.paramIds_);a=a.getFieldValue("STATEMENTS");if(null!==a&&(a="TRUE"==a,this.hasStatements_!=a))if(a)this.setStatements_(!0),
a=this.getInput("STACK").connection,a.targetConnection||!this.statementConnection_||this.statementConnection_.targetConnection||this.statementConnection_.sourceBlock_.workspace!=this.workspace?this.statementConnection_=null:a.connect(this.statementConnection_);else{a=this.getInput("STACK").connection;if(this.statementConnection_=a.targetConnection)a=a.targetBlock(),a.setParent(null),a.bumpNeighbours_();this.setStatements_(!1)}},dispose:function(){var a=this.getFieldValue("NAME");Blockly.Procedures.disposeCallers(a,
this.workspace);this.constructor.prototype.dispose.apply(this,arguments)},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,this.hasReturnValue_]},getVars:function(){for(var a=[],b=0;b<this.arguments_.length;b++)a.push(this.arguments_[b].name);return a},getVarsTypes:function(){for(var a={},b=this.getFieldValue("NAME")+".",c=0;c<this.arguments_.length;c++)this.arguments_[c].type&&(a[b+this.arguments_[c].name]=[this.arguments_[c].type]);(c=this.getInput("RETURN"))&&c.connection&&
c.connection.targetConnection&&c.connection.targetConnection.check_&&(a[b]=c.connection.targetConnection.check_);return a},getScopeVars:function(a){var b=[];if("Types"===a)for(a=0;a<this.arguments_.length;a++)this.arguments_[a].type&&b.push(this.arguments_[a].type);return b},renameScopeVar:function(a,b,c){a=!1;if("Types"===c)for(c=0;c<this.arguments_.length;c++)Blockly.Names.equals(oldname,this.arguments_[c].type)&&(this.arguments_[c].type=b,a=!0);a&&this.updateParams_()},renameVar:function(a,b){for(var c=
!1,d=0;d<this.arguments_.length;d++)Blockly.Names.equals(a,this.arguments_[d].name)&&(this.arguments_[d].name=b,c=!0);c&&this.updateParams_()},customContextMenu:function(a){var b={enabled:!0},c=this.getFieldValue("NAME");b.text=Blockly.Msg.PROCEDURES_CREATE_DO.replace("%1",c);var d=goog.dom.createDom("mutation");d.setAttribute("name",c);for(var e=0;e<this.arguments_.length;e++)c=goog.dom.createDom("arg"),c.setAttribute("name",this.arguments_[e].name),d.appendChild(c);d=goog.dom.createDom("block",
null,d);d.setAttribute("type",this.callType_);b.callback=Blockly.ContextMenu.callbackFactory(this,d);a.push(b);if(!this.isCollapsed())for(e=0;e<this.arguments_.length;e++)b={enabled:!0},c=this.arguments_[e].name,b.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",c),d=goog.dom.createDom("field",null,c),d.setAttribute("name","VAR"),d=goog.dom.createDom("block",null,d),d.setAttribute("type","variables_get"),b.callback=Blockly.ContextMenu.callbackFactory(this,d),a.push(b)},isTopLevel:!0,callType_:"procedures_callnoreturn"};
Blockly.Blocks.procedures_defreturn={init:function(){this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL);this.setColour(Blockly.Blocks.procedures.HUE);var a=new Blockly.FieldTextInput(Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE,Blockly.Procedures.rename);a.setSpellcheck(!1);var b="",c="PARAMS";this.workspace.options.useMutators?this.setMutator(new Blockly.Mutator(["procedures_mutatorarg"])):(b=new Blockly.FieldClickImage(this.addPng,17,17),b.setChangeHandler(this.doAddField),c=null);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_DEFRETURN_TITLE).appendField(a,
"NAME").appendField(b,c);this.appendValueInput("RETURN").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);this.setTooltip(Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP);this.setInputsInline(!1);this.arguments_=[];this.argid=0;this.setStatements_(!0);this.statementConnection_=null;this.hasReturnValue_=!0},isTopLevel:!0,doAddField:Blockly.Blocks.procedures_defnoreturn.doAddField,doRemoveField:Blockly.Blocks.procedures_defnoreturn.doRemoveField,updateParam:Blockly.Blocks.procedures_defnoreturn.updateParam,
setStatements_:Blockly.Blocks.procedures_defnoreturn.setStatements_,validate:Blockly.Blocks.procedures_defnoreturn.validate,updateParams_:Blockly.Blocks.procedures_defnoreturn.updateParams_,mutationToDom:Blockly.Blocks.procedures_defnoreturn.mutationToDom,domToMutation:Blockly.Blocks.procedures_defnoreturn.domToMutation,decompose:Blockly.Blocks.procedures_defnoreturn.decompose,compose:Blockly.Blocks.procedures_defnoreturn.compose,dispose:Blockly.Blocks.procedures_defnoreturn.dispose,getProcedureDef:Blockly.Blocks.procedures_defnoreturn.getProcedureDef,
getVars:Blockly.Blocks.procedures_defnoreturn.getVars,getVarsTypes:Blockly.Blocks.procedures_defnoreturn.getVarsTypes,renameVar:Blockly.Blocks.procedures_defnoreturn.renameVar,customContextMenu:Blockly.Blocks.procedures_defnoreturn.customContextMenu,callType_:"procedures_callreturn"};
Blockly.Blocks.procedures_callnoreturn={init:function(){this.setHelpUrl(Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL);this.setColour(Blockly.Blocks.procedures.HUE);this.appendDummyInput("TOPROW").appendField(Blockly.Msg.PROCEDURES_CALLNORETURN_CALL).appendField("","NAME");this.setPreviousStatement(!0);this.setNextStatement(!0);this.arguments_=[];this.quarkConnections_={}},getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(a,b){Blockly.Names.equals(a,this.getProcedureCall())&&
(this.setFieldValue(b,"NAME"),this.setTooltip((this.outputConnection?Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP:Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",b)))},setProcedureParameters:function(a){if(!goog.array.equals(this.arguments_,a,goog.object.equals)){this.setCollapsed(!1);var b=this.rendered;this.rendered=!1;for(var c=0;c<this.arguments_.length;c++){var d=this.getInput("ARG"+c);if(d){var e=d.connection.targetConnection;c>=a.length?this.removeInput("ARG"+c):a[c].name!=this.arguments_[c].name?
(this.setFieldValue(a[c].name,"ARGn"+c),e&&e.sourceBlock_.unplug(!0,!0),d.setCheck(a[c].type)):a[c].type!=this.arguments_[c].type&&(d.setCheck(a[c].type),d.connection.targetConnection&&(e=null));e&&(this.quarkConnections_[this.arguments_[c].name]=e)}}var f=this.arguments_;this.arguments_=[];for(c=0;c<a.length;c++)this.arguments_.push({name:a[c].name,type:a[c].type,id:a[c].id});for(c=f.length;c<this.arguments_.length;c++)d=this.appendValueInput("ARG"+c).setAlign(Blockly.ALIGN_RIGHT).appendField(this.arguments_[c].name,
"ARGn"+c).setCheck(this.arguments_[c].type),d.init();if(d=this.getInput("TOPROW"))this.arguments_.length?this.getField("WITH")||(d.appendField(Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"),d.init()):this.getField("WITH")&&d.removeField("WITH");for(c=0;c<this.arguments_.length;c++){d=this.getInput("ARG"+c);a=this.arguments_[c].name;e=this.arguments_[c].id;if(null!=e)for(var g=0;g<f.length;g++)if(f[g].id===e){this.quarkConnections_[f[g].name]&&(a=f[g].name);break}a&&this.quarkConnections_[a]&&(e=
this.quarkConnections_[a],e.targetConnection||e.sourceBlock_.workspace!=this.workspace?delete this.quarkConnections_[a]:d.connection.checkType_(e)&&(d.connection.connect(e),delete this.quarkConnections_[a]))}this.rendered=b;this.bumpNeighbours_();this.rendered&&this.render()}},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("name",this.getProcedureCall());for(var b=0;b<this.arguments_.length;b++){var c=document.createElement("arg");c.setAttribute("name",this.arguments_[b].name);
a.appendChild(c)}return a},domToMutation:function(a){var b=a.getAttribute("name");this.setFieldValue(b,"NAME");this.setTooltip((this.outputConnection?Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP:Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",b));var c=Blockly.Procedures.getDefinition(b,this.workspace),b=[];if(c)b=c.arguments_;else for(var c=0,d;d=a.childNodes[c];c++)"arg"==d.nodeName.toLowerCase()&&b.push({name:d.getAttribute("name")});this.setProcedureParameters(b)},renameVar:function(a,
b){for(var c=0;c<this.arguments_.length;c++)Blockly.Names.equals(a,this.arguments_[c].name)&&(this.arguments_[c].name=b,this.getInput("ARG"+c).fieldRow[0].setText(b))},getVarsTypes:function(){for(var a={},b=this.getFieldValue("NAME")+".",c=0;c<this.arguments_.length;c++){var d=this.getInput("ARG"+c),e=this.arguments_[c].name;d&&d.connection&&d.connection.targetConnection&&d.connection.targetConnection.check_&&(a[b+e]=d.connection.targetConnection.check_)}this.outputConnection&&this.outputConnection.targetConnection&&
this.outputConnection.targetConnection.check_&&(a[b]=this.outputConnection.targetConnection.check_);return a},customContextMenu:function(a){var b={enabled:!0};b.text=Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF;var c=this.getProcedureCall(),d=this.workspace;b.callback=function(){var a=Blockly.Procedures.getDefinition(c,d);a&&a.select()};a.push(b)}};
Blockly.Blocks.procedures_mutatorcontainer={init:function(){this.setColour(Blockly.Blocks.procedures.HUE);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE);this.appendStatementInput("STACK");this.appendDummyInput("STATEMENT_INPUT").appendField(Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS).appendField(new Blockly.FieldCheckbox("TRUE"),"STATEMENTS");this.setTooltip(Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP);this.contextMenu=!1}};
Blockly.Blocks.procedures_mutatorarg={init:function(){this.setColour(Blockly.Blocks.procedures.HUE);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_MUTATORARG_TITLE).appendField(new Blockly.FieldTextInput("x",this.validator_),"NAME");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP);this.contextMenu=!1},validator_:function(a){return(a=a.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,""))||null}};
Blockly.Blocks.procedures_callreturn={init:function(){this.setHelpUrl(Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL);this.setColour(Blockly.Blocks.procedures.HUE);this.appendDummyInput("TOPROW").appendField(Blockly.Msg.PROCEDURES_CALLRETURN_CALL).appendField("","NAME");this.setOutput(!0);this.arguments_=[];this.quarkConnections_={};this.quarkArguments_=null},getProcedureCall:Blockly.Blocks.procedures_callnoreturn.getProcedureCall,renameProcedure:Blockly.Blocks.procedures_callnoreturn.renameProcedure,
getVarsTypes:Blockly.Blocks.procedures_callnoreturn.getVarsTypes,setProcedureParameters:Blockly.Blocks.procedures_callnoreturn.setProcedureParameters,mutationToDom:Blockly.Blocks.procedures_callnoreturn.mutationToDom,domToMutation:Blockly.Blocks.procedures_callnoreturn.domToMutation,renameVar:Blockly.Blocks.procedures_callnoreturn.renameVar,customContextMenu:Blockly.Blocks.procedures_callnoreturn.customContextMenu};
Blockly.Blocks.procedures_ifreturn={init:function(){this.setHelpUrl("http://c2.com/cgi/wiki?GuardClause");this.setColour(Blockly.Blocks.procedures.HUE);this.appendValueInput("CONDITION").setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_IF);this.appendValueInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP);this.hasReturnValue_=!0},mutationToDom:function(){var a=
document.createElement("mutation");a.setAttribute("value",Number(this.hasReturnValue_));return a},domToMutation:function(a){this.hasReturnValue_=1==a.getAttribute("value");this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(){var a=!1,b=this,c=!1;do{if(b.getProcedureDef){a=!0;c=b.getProcedureDef.call(b)[2];break}b=b.getSurroundParent()}while(b);a?(!c&&this.hasReturnValue_?(this.removeInput("VALUE"),
this.appendDummyInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):c&&!this.hasReturnValue_&&(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null)):this.setWarningText(Blockly.Msg.PROCEDURES_IFRETURN_WARNING)}};Blockly.Blocks.texts={};Blockly.Blocks.texts.HUE=160;
Blockly.Blocks.text={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_TEXT_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1));this.setOutput(!0,"String");this.setTooltip(Blockly.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(a){return new Blockly.FieldImage(a==this.RTL?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",
12,12,'"')}};
Blockly.Blocks.text_join={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_JOIN_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.setOutput(!0,"String");this.workspace.options.useMutators?this.setMutator(new Blockly.Mutator(["text_create_join_item"])):this.appendAddSubGroup(Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH,"items",null,"-IGNORED-");this.itemCount_=2;this.updateShape_();this.setTooltip(Blockly.Msg.TEXT_JOIN_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("items",
this.itemCount_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);this.updateShape_()},decompose:function(a){var b=Blockly.Block.obtain(a,"text_create_join_container");b.initSvg();for(var c=b.getInput("STACK").connection,d=0;d<this.itemCount_;d++){var e=Blockly.Block.obtain(a,"text_create_join_item");e.initSvg();c.connect(e.previousConnection);c=e.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),
b=b.nextConnection&&b.nextConnection.targetBlock();this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)a[b]&&this.getInput("ADD"+b).connection.connect(a[b])},saveConnections:function(a){a=a.getInputTargetBlock("STACK");for(var b=0;a;){var c=this.getInput("ADD"+b);a.valueConnection_=c&&c.connection.targetConnection;b++;a=a.nextConnection&&a.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var a=0;this.getInput("ADD"+
a);)this.removeInput("ADD"+a),a++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1));else for(a=0;a<this.itemCount_;a++){var b=this.appendValueInput("ADD"+a);0==a&&b.appendField(Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH)}},getAddSubName:function(a,b){return"ADD"+b},appendAddSubEmptyInput:function(a,b){return this.appendDummyInput(a).appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1))},newQuote_:Blockly.Blocks.text.newQuote_,
typeblock:[{entry:Blockly.Msg.TEXT_JOIN_WITH_TYPEBLOCK,mutatorAttributes:{items:2}}]};Blockly.Blocks.text_create_join_container={init:function(){this.setColour(Blockly.Blocks.texts.HUE);this.appendDummyInput().appendField(Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN);this.appendStatementInput("STACK");this.setTooltip(Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP);this.contextMenu=!1}};
Blockly.Blocks.text_create_join_item={init:function(){this.setColour(Blockly.Blocks.texts.HUE);this.appendDummyInput().appendField(Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP);this.contextMenu=!1}};
Blockly.Blocks.text_append={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_APPEND_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.appendValueInput("TEXT").appendField(Blockly.Msg.TEXT_APPEND_TO).appendField(new Blockly.FieldVariable(Blockly.Msg.TEXT_APPEND_VARIABLE),"VAR").appendField(Blockly.Msg.TEXT_APPEND_APPENDTEXT);this.setPreviousStatement(!0);this.setNextStatement(!0);var a=this;this.setTooltip(function(){return Blockly.Msg.TEXT_APPEND_TOOLTIP.replace("%1",a.getFieldValue("VAR"))})},
getVars:function(){return[this.getFieldValue("VAR")]},getVarsTypes:function(){var a={};a[this.getFieldValue("VAR")]=["String"];return a},renameVar:function(a,b){Blockly.Names.equals(a,this.getFieldValue("VAR"))&&this.setFieldValue(b,"VAR")},typeblock:Blockly.Msg.TEXT_APPEND_TYPEBLOCK};
Blockly.Blocks.text_length={init:function(){this.jsonInit({message0:Blockly.Msg.TEXT_LENGTH_TITLE,args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",colour:Blockly.Blocks.texts.HUE,tooltip:Blockly.Msg.TEXT_LENGTH_TOOLTIP,helpUrl:Blockly.Msg.TEXT_LENGTH_HELPURL})},typeblock:Blockly.Msg.TEXT_LENGTH_TYPEBLOCK};
Blockly.Blocks.text_isEmpty={init:function(){this.jsonInit({message0:Blockly.Msg.TEXT_ISEMPTY_TITLE,args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",colour:Blockly.Blocks.texts.HUE,tooltip:Blockly.Msg.TEXT_ISEMPTY_TOOLTIP,helpUrl:Blockly.Msg.TEXT_ISEMPTY_HELPURL})},typeblock:Blockly.Msg.TEXT_ISEMPTY_TYPEBLOCK};
Blockly.Blocks.text_contains={init:function(){this.jsonInit({message0:Blockly.Msg.TEXT_CONTAINS_INPUT,args0:[{type:"input_value",name:"TEXT",check:"String"},{type:"input_value",name:"PIECE",check:"String"}],output:"Boolean",colour:Blockly.Blocks.texts.HUE,tooltip:Blockly.getToolTipString("text_contains_tooltip"),helpUrl:Blockly.getUrlString("text_contains_url")})},typeblock:Blockly.Msg.TEXT_CONTAINS_TYPEBLOCK};
Blockly.Blocks.text_indexOf={init:function(){var a=[[Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST,"FIRST"],[Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.TEXT_INDEXOF_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.setOutput(!0,"Number");this.appendValueInput("VALUE").setCheck("String").appendField(Blockly.Msg.TEXT_INDEXOF_INPUT_INTEXT);this.appendValueInput("FIND").setCheck("String").appendField(new Blockly.FieldDropdown(a),"END");Blockly.Msg.TEXT_INDEXOF_TAIL&&this.appendDummyInput().appendField(Blockly.Msg.TEXT_INDEXOF_TAIL);
this.setInputsInline(!0);this.setTooltip(Blockly.Msg.TEXT_INDEXOF_TOOLTIP)},typeblock:[{entry:Blockly.Msg.TEXT_INDEXOF_FIRST_TYPEBLOCK,values:{VALUE:'<block type="variables_get"><field name="VAR">list</field></block>'},fields:{END:"FIRST"}},{entry:Blockly.Msg.TEXT_INDEXOF_LAST_TYPEBLOCK,values:{VALUE:'<block type="variables_get"><field name="VAR">list</field></block>'},fields:{END:"LAST"}}]};
Blockly.Blocks.text_charAt={init:function(){this.WHERE_OPTIONS=[[Blockly.Msg.TEXT_CHARAT_FROM_START,"FROM_START"],[Blockly.Msg.TEXT_CHARAT_FROM_END,"FROM_END"],[Blockly.Msg.TEXT_CHARAT_FIRST,"FIRST"],[Blockly.Msg.TEXT_CHARAT_LAST,"LAST"],[Blockly.Msg.TEXT_CHARAT_RANDOM,"RANDOM"]];this.setHelpUrl(Blockly.Msg.TEXT_CHARAT_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.setOutput(!0,"String");this.appendValueInput("VALUE").setCheck("String").appendField(Blockly.Msg.TEXT_CHARAT_INPUT_INTEXT);this.appendDummyInput("AT");
this.setInputsInline(!0);this.updateAt_(!0);this.setTooltip(Blockly.Msg.TEXT_CHARAT_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation"),b=this.getInput("AT").type==Blockly.INPUT_VALUE;a.setAttribute("at",b);return a},domToMutation:function(a){a="false"!=a.getAttribute("at");this.updateAt_(a)},updateAt_:function(a){this.removeInput("AT");this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):
this.appendDummyInput("AT");Blockly.Msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(Blockly.Msg.TEXT_CHARAT_TAIL));var b=new Blockly.FieldDropdown(this.WHERE_OPTIONS,function(b){var d="FROM_START"==b||"FROM_END"==b;if(d!=a){var e=this.sourceBlock_;e.updateAt_(d);e.setFieldValue(b,"WHERE");return null}});this.getInput("AT").appendField(b,"WHERE")},typeblock:[{entry:Blockly.Msg.TEXT_CHARAT_FROM_START,values:{VALUE:'<block type="variables_get"><field name="VAR">text</field></block>',
AT:1},fields:{WHERE:"FROM_START"}},{entry:Blockly.Msg.TEXT_CHARAT_FROM_END,values:{VALUE:'<block type="variables_get"><field name="VAR">text</field></block>',AT:1},fields:{WHERE:"FROM_END"}},{entry:Blockly.Msg.TEXT_CHARAT_FIRST,values:{VALUE:'<block type="variables_get"><field name="VAR">text</field></block>'},fields:{WHERE:"FIRST"}},{entry:Blockly.Msg.TEXT_CHARAT_LAST,values:{VALUE:'<block type="variables_get"><field name="VAR">text</field></block>'},fields:{WHERE:"LAST"}},{entry:Blockly.Msg.TEXT_CHARAT_RANDOM,
values:{VALUE:'<block type="variables_get"><field name="VAR">text</field></block>'},fields:{WHERE:"RANDOM"}}]};
Blockly.Blocks.text_getSubstring={init:function(){this.WHERE_OPTIONS_1=[[Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START,"FROM_START"],[Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END,"FROM_END"],[Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START,"FROM_START"],[Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END,"FROM_END"],[Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);
this.appendValueInput("STRING").setCheck("String").appendField(Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT);this.appendDummyInput("AT1");this.appendDummyInput("AT2");Blockly.Msg.TEXT_GET_SUBSTRING_TAIL&&this.appendDummyInput("TAIL").appendField(Blockly.Msg.TEXT_GET_SUBSTRING_TAIL);this.setInputsInline(!0);this.setOutput(!0,"String");this.updateAt_(1,!0);this.updateAt_(2,!0);this.setTooltip(Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP)},mutationToDom:function(){var a=document.createElement("mutation"),
b=this.getInput("AT1").type==Blockly.INPUT_VALUE;a.setAttribute("at1",b);b=this.getInput("AT2").type==Blockly.INPUT_VALUE;a.setAttribute("at2",b);return a},domToMutation:function(a){var b="true"==a.getAttribute("at1");a="true"==a.getAttribute("at2");this.updateAt_(1,b);this.updateAt_(2,a)},updateAt_:function(a,b){this.removeInput("AT"+a);this.removeInput("ORDINAL"+a,!0);b?(this.appendValueInput("AT"+a).setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+a).appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):
this.appendDummyInput("AT"+a);2==a&&Blockly.Msg.TEXT_GET_SUBSTRING_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(Blockly.Msg.TEXT_GET_SUBSTRING_TAIL));var c=new Blockly.FieldDropdown(this["WHERE_OPTIONS_"+a],function(c){var e="FROM_START"==c||"FROM_END"==c;if(e!=b){var f=this.sourceBlock_;f.updateAt_(a,e);f.setFieldValue(c,"WHERE"+a);return null}});this.getInput("AT"+a).appendField(c,"WHERE"+a);1==a&&this.moveInputBefore("AT1","AT2")},typeblock:function(){for(var a=
[],b=["FROM_START","FROM_END","FIRST"],c=["FROM_START","FROM_END","LAST"],d=0;d<b.length;d++)for(var e=b[d],f="FIRST"!==e,g=0;g<c.length;g++){var h=c[g];a.push({entry:Blockly.Msg["TEXT_GET_SUBSTRING_START_"+e+"_TYPEBLOCK"]+Blockly.Msg["TEXT_GET_SUBSTRING_END_"+h+"_TYPEBLOCK"],mutatorAttributes:{at1:f,at2:"LAST"!==h},values:{STRING:'<block type="variables_get"><field name="VAR">text</field></block>'},fields:{WHERE1:e,WHERE2:h}})}return a}};
Blockly.Blocks.text_changeCase={init:function(){var a=[[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE,"UPPERCASE"],[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE,"LOWERCASE"],[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE,"TITLECASE"]];this.setHelpUrl(Blockly.Msg.TEXT_CHANGECASE_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.appendValueInput("TEXT").setCheck("String").appendField(new Blockly.FieldDropdown(a),"CASE");this.setOutput(!0,"String");this.setTooltip(Blockly.Msg.TEXT_CHANGECASE_TOOLTIP)},
typeblock:[{entry:Blockly.Msg.TEXT_CHANGECASE_UPPERCASE_TYPBLOCK,fields:{CASE:"UPPERCASE"}},{entry:Blockly.Msg.TEXT_CHANGECASE_LOWERCASE_TYPBLOCK,fields:{CASE:"LOWERCASE"}},{entry:Blockly.Msg.TEXT_CHANGECASE_TITLECASE_TYPBLOCK,fields:{CASE:"TITLECASE"}}]};
Blockly.Blocks.text_trim={init:function(){var a=[[Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH,"BOTH"],[Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT,"LEFT"],[Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT,"RIGHT"]];this.setHelpUrl(Blockly.Msg.TEXT_TRIM_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);this.appendValueInput("TEXT").setCheck("String").appendField(new Blockly.FieldDropdown(a),"MODE");this.setOutput(!0,"String");this.setTooltip(Blockly.Msg.TEXT_TRIM_TOOLTIP)},typeblock:[{entry:Blockly.Msg.TEXT_TRIM_BOTH_TYPEBLOCK,
fields:{MODE:"BOTH"}},{entry:Blockly.Msg.TEXT_TRIM_LEFT_TYPEBLOCK,fields:{MODE:"LEFT"}},{entry:Blockly.Msg.TEXT_TRIM_RIGHT_TYPEBLOCK,fields:{MODE:"RIGHT"}}]};Blockly.Blocks.text_print={init:function(){this.jsonInit({message0:Blockly.Msg.TEXT_PRINT_TITLE,args0:[{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.texts.HUE,tooltip:Blockly.Msg.TEXT_PRINT_TOOLTIP,helpUrl:Blockly.Msg.TEXT_PRINT_HELPURL})},typeblock:Blockly.Msg.TEXT_PRINT_TYPEBLOCK};
Blockly.Blocks.text_printf={init:function(){this.jsonInit({message0:Blockly.Msg.TEXT_PRINTF_TITLE,args0:[{type:"input_value",name:"TEXT",check:"String"}],colour:Blockly.Blocks.texts.HUE,tooltip:Blockly.Msg.TEXT_PRINTF_TOOLTIP,helpUrl:Blockly.Msg.TEXT_PRINTF_HELPURL});this.itemCount_=1;this.setPreviousStatement(!0);this.setNextStatement(!0);this.appendAddSubGroup(Blockly.Msg.TEXT_PRINTF_CREATEWITH,"items",null,"-IGNORED-")},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("items",
this.itemCount_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);this.updateShape_()},decompose:function(a){var b=Blockly.Block.obtain(a,"text_printf_container");b.initSvg();for(var c=b.getInput("STACK").connection,d=0;d<this.itemCount_;d++){var e=Blockly.Block.obtain(a,"text_printf_item");e.initSvg();c.connect(e.previousConnection);c=e.nextConnection}return b},compose:function(a){a=a.getInputTargetBlock("STACK");for(var b=0;a;)a=a.nextConnection&&a.nextConnection.targetBlock(),
b++;this.itemCount_=b;this.updateShape_()},getAddSubName:function(a,b){return"ADD"+b},appendAddSubEmptyInput:function(a,b){return this.appendDummyInput(a).appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1))},newQuote_:Blockly.Blocks.text.newQuote_,typeblock:Blockly.Msg.TEXT_PRINTF_TYPEBLOCK};
Blockly.Blocks.text_sprintf={init:function(){this.jsonInit({message0:Blockly.Msg.TEXT_SPRINTF_TITLE,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",colour:Blockly.Blocks.texts.HUE,tooltip:Blockly.Msg.TEXT_SPRINTF_TOOLTIP,helpUrl:Blockly.Msg.TEXT_SPRINTF_HELPURL});this.setPreviousStatement(!1);this.setNextStatement(!1);this.appendAddSubGroup(Blockly.Msg.TEXT_SPRINTF_CREATEWITH,"items",null,"-IGNORED-");this.setOutput(!0,"String")},mutationToDom:function(){var a=document.createElement("mutation");
a.setAttribute("items",this.itemCount_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);this.updateShape_()},decompose:function(a){var b=Blockly.Block.obtain(a,"text_sprintf_container");b.initSvg();for(var c=b.getInput("STACK").connection,d=0;d<this.itemCount_;d++){var e=Blockly.Block.obtain(a,"text_sprintf_item");e.initSvg();c.connect(e.previousConnection);c=e.nextConnection}return b},compose:function(a){a=a.getInputTargetBlock("STACK");for(var b=0;a;)a=a.nextConnection&&
a.nextConnection.targetBlock(),b++;this.itemCount_=b;this.updateShape_()},getAddSubName:function(a,b){return"ADD"+b},appendAddSubEmptyInput:function(a,b){return this.appendDummyInput(a).appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1))},newQuote_:Blockly.Blocks.text.newQuote_,typeblock:Blockly.Msg.TEXT_PRINT_TYPEBLOCK};
Blockly.Blocks.text_prompt_ext={init:function(){var a=[[Blockly.Msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl(Blockly.Msg.TEXT_PROMPT_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);var b=this,a=new Blockly.FieldDropdown(a,function(a){b.updateType_(a)});this.appendValueInput("TEXT").appendField(a,"TYPE");this.setOutput(!0,"String");this.setTooltip(function(){return"TEXT"==b.getFieldValue("TYPE")?Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT:Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER})},
updateType_:function(a){"NUMBER"==a?this.outputConnection.setCheck("Number"):this.outputConnection.setCheck("String")},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("type",this.getFieldValue("TYPE"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("type"))},typeblock:[{entry:Blockly.Msg.TEXT_PROMPT_TEXT_TYPEBLOCK,fields:{TYPE:"TEXT"},values:{TEXT:'<block type="text"><field name="TEXT"></field></block>'}},{entry:Blockly.Msg.TEXT_PROMPT_NUMBER_TYPEBLOCK,
fields:{TYPE:"NUMBER"},values:{TEXT:'<block type="text"><field name="TEXT"></field></block>'}}]};
Blockly.Blocks.text_prompt={init:function(){var a=[[Blockly.Msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]],b=this;this.setHelpUrl(Blockly.Msg.TEXT_PROMPT_HELPURL);this.setColour(Blockly.Blocks.texts.HUE);a=new Blockly.FieldDropdown(a,function(a){b.updateType_(a)});this.appendDummyInput().appendField(a,"TYPE").appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1));this.setOutput(!0,"String");b=this;this.setTooltip(function(){return"TEXT"==
b.getFieldValue("TYPE")?Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT:Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER})},newQuote_:Blockly.Blocks.text.newQuote_,updateType_:Blockly.Blocks.text_prompt_ext.updateType_,mutationToDom:Blockly.Blocks.text_prompt_ext.mutationToDom,domToMutation:Blockly.Blocks.text_prompt_ext.domToMutation};
Blockly.Blocks.text_comment={init:function(){this.setColour(160);this.appendDummyInput().appendField(Blockly.Msg.TEXT_COMMENT_TEXT);this.appendDummyInput().appendField(new Blockly.FieldTextArea(""),"COMMENT");this.setPreviousStatement(!0);this.setNextStatement(!0)},typeblock:Blockly.Msg.TEXT_COMMENT_TYPEBLOCK};
Blockly.Blocks.text_code_insert={init:function(){var a=[[Blockly.Msg.TEXT_TYPE_JAVA,"Java"],[Blockly.Msg.TEXT_TYPE_PYTHON,"Python"]],b=this;this.setColour(Blockly.getBlockHue("blockhue_text"));a=new Blockly.FieldDropdown(a);this.appendDummyInput().appendField(a,"TYPE");this.appendDummyInput().appendFieldTextAreaInput("CODE",250,"");this.setTooltip(function(){var a=b.getFieldValue("TYPE");return{Java:Blockly.Msg.TEXT_TOOLTIP_TYPE_JAVA,Python:Blockly.Msg.TEXT_TOOLTIP_TYPE_PYTHON}[a]});this.setPreviousStatement(!0);
this.setNextStatement(!0)},helpUrl:Blockly.getUrlString("text_code_insert_url"),typeblock:[{entry:Blockly.Msg.TEXT_TYPE_JAVA_TYPEBLOCK,fields:{TYPE:"Java"}},{entry:Blockly.Msg.TEXT_TYPE_PYTHON_TYPEBLOCK,fields:{TYPE:"Python"}}]};Blockly.Blocks.variables={};Blockly.Blocks.variables.HUE=330;
Blockly.Blocks.variables_get={init:function(){this.setHelpUrl(Blockly.Msg.VARIABLES_GET_HELPURL);this.setColour(Blockly.Blocks.variables.HUE);this.appendDummyInput().appendField(new Blockly.FieldVariable(Blockly.Msg.VARIABLES_DEFAULT_NAME),"VAR");this.setOutput(!0);this.setTooltip(Blockly.Msg.VARIABLES_GET_TOOLTIP);this.contextMenuMsg_=Blockly.Msg.VARIABLES_GET_CREATE_SET;this.procedurePrefix_=""},getVars:function(){return[this.getFieldValue("VAR")]},getVarsTypes:function(){var a={};this.outputConnection&&
this.outputConnection.targetConnection&&this.outputConnection.targetConnection.check_&&(a[this.procedurePrefix_+this.getFieldValue("VAR")]=this.outputConnection.targetConnection.check_);return a},renameVar:function(a,b){Blockly.Names.equals(a,this.getFieldValue("VAR"))&&this.setFieldValue(b,"VAR")},onchange:function(){var a=Blockly.Variables.getLocalContext(this,this.getFieldValue("VAR")),b=Blockly.Blocks.variables.HUE;this.procedurePrefix_="";null!=a&&(b=Blockly.Blocks.procedures.HUE,this.procedurePrefix_=
a);b!=this.getColour()&&this.setColour(b)},contextMenuType_:"variables_set",customContextMenu:function(a){var b={enabled:!0},c=this.getFieldValue("VAR");b.text=this.contextMenuMsg_.replace("%1",c);c=goog.dom.createDom("field",null,c);c.setAttribute("name","VAR");c=goog.dom.createDom("block",null,c);c.setAttribute("type",this.contextMenuType_);b.callback=Blockly.ContextMenu.callbackFactory(this,c);a.push(b)},typeblock:Blockly.getMsgString("variables_get_typeblock")};
Blockly.Blocks.variables_set={init:function(){this.jsonInit({message0:Blockly.Msg.VARIABLES_SET,args0:[{type:"field_variable",name:"VAR",variable:Blockly.Msg.VARIABLES_DEFAULT_NAME},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.variables.HUE,tooltip:Blockly.Msg.VARIABLES_SET_TOOLTIP,helpUrl:Blockly.Msg.VARIABLES_SET_HELPURL});this.procedurePrefix_="";this.contextMenuMsg_=Blockly.Msg.VARIABLES_SET_CREATE_GET},onchange:Blockly.Blocks.variables_get.onchange,
getVars:Blockly.Blocks.variables_get.getVars,renameVar:Blockly.Blocks.variables_get.renameVar,contextMenuType_:"variables_get",customContextMenu:Blockly.Blocks.variables_get.customContextMenu,getVarsTypes:function(){var a={},b=this.getInput("VALUE");b&&b.connection&&b.connection.targetConnection&&b.connection.targetConnection.check_&&(a[this.procedurePrefix_+this.getFieldValue("VAR")]=b.connection.targetConnection.check_);return a},typeblock:Blockly.getMsgString("variables_set_typeblock")};
Blockly.Blocks.hash_variables_get={init:function(){this.setColour(Blockly.getBlockHue("blockhue_variables"));this.appendDummyInput().appendField(Blockly.Msg.VARIABLES_GET_TITLE).appendField(new Blockly.FieldVariable(Blockly.Msg.VARIABLES_GET_ITEM),"VAR").appendField(".").appendField(new Blockly.FieldScopeVariable("HASHKEY"),"HASHKEY").appendField(Blockly.Msg.VARIABLES_GET_TAIL);this.setOutput(!0);this.contextMenuMsg_=Blockly.Msg.VARIABLES_GET_CREATE_SET;this.procedurePrefix_="";this.contextMenuType_=
"hash_variables_set"},onchange:Blockly.Blocks.variables_get.onchange,getVars:Blockly.Blocks.variables_get.getVars,renameVar:Blockly.Blocks.variables_get.renameVar,getVarsTypes:function(){var a={};a[this.procedurePrefix_+this.getFieldValue("VAR")]=["Map","Object"];return a},getScopeVars:function(a){var b=[];"HASHKEY"===a&&b.push(this.getFieldValue("HASHKEY"));return b},renameScopeVar:function(a,b,c){"HASHKEY"===c&&Blockly.Names.equals(a,this.getFieldValue("HASHKEY"))&&this.setFieldValue(b,"HASHKEY")},
customContextMenu:function(a){var b={enabled:!0},c=this.getFieldValue("VAR"),d=this.getFieldValue("HASHKEY");b.text=this.contextMenuMsg_.replace("%1",c);c=goog.dom.createDom("field",null,c);c.setAttribute("name","VAR");c=goog.dom.createDom("field",null,d);c.setAttribute("name","HASHKEY");d=goog.dom.createDom("block",null,c);d.setAttribute("type",this.contextMenuType_);b.callback=Blockly.ContextMenu.callbackFactory(this,d);a.push(b)},helpUrl:Blockly.getUrlString("variables_hash_get_url"),tooltip:Blockly.getToolTipString("variables_hash_get_tooltip"),
typeblock:Blockly.getMsgString("variables_hash_get_typeblock")};
Blockly.Blocks.hash_parmvariables_get={init:function(){this.setColour(Blockly.getBlockHue("blockhue_variables"));this.appendValueInput("VAR").appendField(Blockly.Msg.VARIABLES_GET_TITLE);this.appendDummyInput().appendField(".").appendField(new Blockly.FieldScopeVariable("HASHKEY"),"HASHKEY").appendField(Blockly.Msg.VARIABLES_GET_TAIL);this.setOutput(!0);this.setInputsInline(!0);this.contextMenuMsg_=Blockly.Msg.VARIABLES_GET_CREATE_SET;this.contextMenuType_="hash_variables_set"},getScopeVars:Blockly.Blocks.hash_variables_get.getScopeVars,
renameScopeVar:Blockly.Blocks.hash_variables_get.renameScopeVar,helpUrl:Blockly.getUrlString("variables_hash_param_get_url"),tooltip:Blockly.getToolTipString("variables_hash_param_get_tooltip"),typeblock:Blockly.getMsgString("variables_hash_param_get_typeblock")};
Blockly.Blocks.hash_variables_set={init:function(){this.jsonInit({message0:Blockly.Msg.SCOPE_VARIABLES_SET,args0:[{type:"field_variable",name:"VAR",variable:Blockly.Msg.VARIABLES_DEFAULT_NAME},{type:"field_scopevariable",name:"HASHKEY",scope:"HASHKEY"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,colour:Blockly.Blocks.variables.HUE,tooltip:Blockly.getToolTipString("variables_hash_param_set_tooltip"),helpUrl:Blockly.getUrlString("variables_hash_param_set_url")});this.procedurePrefix_=
"";this.contextMenuMsg_=Blockly.Msg.VARIABLES_SET_CREATE_GET;this.contextMenuType_="hash_variables_get"},onchange:Blockly.Blocks.hash_variables_get.onchange,getVars:Blockly.Blocks.hash_variables_get.getVars,renameVar:Blockly.Blocks.hash_variables_get.renameVar,getScopeVars:Blockly.Blocks.hash_variables_get.getScopeVars,getVarsTypes:Blockly.Blocks.hash_variables_get.getVarsTypes,renameScopeVar:Blockly.Blocks.hash_variables_get.renameScopeVar,customContextMenu:Blockly.Blocks.hash_variables_get.customContextMenu,
typeblock:Blockly.getMsgString("variables_hash_param_set_typeblock")};
Blockly.Blocks.initialize_variable={init:function(){this.jsonInit({message0:Blockly.Msg.INITIALIZE_VARIABLE,args0:[{type:"field_variable",name:"VAR",variable:"Variable"},{type:"field_scopevariable",scope:"Types",name:"TYPE"},{type:"input_value",name:"VALUE",align:"RIGHT"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:Blockly.Blocks.variables.HUE,tooltip:"",helpUrl:"http://www.example.com/"});this.procedurePrefix_="";var a=this.getField("TYPE");a.setChangeHandler(this.changeType);
a.setMsgEmpty("Any");a.setValue("");this.contextMenuMsg_=Blockly.Msg.VARIABLES_SET_CREATE_GET},isTopLevel:!0,onchange:function(){if(0==Blockly.dragMode_){var a=Blockly.Variables.getLocalContext(this,null),b=Blockly.Msg.INITIALIZE_GLOBAL_VARIABLE,c=Blockly.Blocks.variables.HUE;this.procedurePrefix_="";null!=a&&(this.procedurePrefix_=a,c=Blockly.Blocks.procedures.HUE,b=Blockly.Msg.INITIALIZE_LOCAL_VARIABLE);this.getInput("VALUE").fieldRow[0].setText(b);c!=this.getColour()&&this.setColour(c)}},getVars:Blockly.Blocks.variables_get.getVars,
renameVar:Blockly.Blocks.variables_get.renameVar,changeType:function(a){this.sourceBlock_.getInput("VALUE").setCheck(a)},getScopeVars:function(a){var b=[];"Types"===a&&b.push(this.getFieldValue("TYPE"));return b},getVarsTypes:function(){var a={},b=this.getFieldValue("TYPE");if(b)b=[b];else{var c=this.getInputTargetBlock("VALUE");c&&(b=c.getOutput())}a[this.procedurePrefix_+this.getFieldValue("VAR")]=b;return a},renameScopeVar:function(a,b,c){"Types"===c&&Blockly.Names.equals(a,this.getFieldValue("TYPE"))&&
this.setFieldValue(b,"TYPE")},contextMenuType_:"variables_get",customContextMenu:Blockly.Blocks.variables_get.customContextMenu,typeblock:Blockly.getMsgString("variables_hash_param_set_typeblock")};