123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745 |
- // Do not edit this file; automatically generated by build.py.
- 'use strict';
- Blockly.Blocks.AIYBoard={};Blockly.Blocks.AIYBoard.HUE="#6844d1";Blockly.Blocks.AIYBoard_from={init:function(){this.setColour(Blockly.Blocks.AIYBoard.HUE);this.appendValueInput("INPUT").appendField(Blockly.Msg.AIYBOARD_FROM);this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.AIYBoard_import={init:function(){this.setColour(Blockly.Blocks.AIYBoard.HUE);this.appendDummyInput().appendField(Blockly.Msg.AIYBOARD_IMPORT).appendField(new Blockly.FieldDropdown([["Board","Board"],["Led","Led"]]),"BOARD");this.setOutput(!0)}};Blockly.Blocks.AIYBoard_Board={init:function(){this.setColour(Blockly.Blocks.AIYBoard.HUE);this.appendDummyInput().appendField(Blockly.Msg.AIYBOARD_AIY_BOARD);this.setOutput(!0)}};
- Blockly.Blocks.AIYBoard_LED_state={init:function(){this.setColour(Blockly.Blocks.AIYBoard.HUE);this.appendValueInput("INPUT").appendField(Blockly.Msg.AIYBOARD_LED_STATE);this.setInputsInline(!0);this.setOutput(!0)}};Blockly.Blocks.AIYBoard_LED_status={init:function(){this.setColour(Blockly.Blocks.AIYBoard.HUE);this.appendValueInput("INPUT").appendField(Blockly.Msg.AIYBOARD_LED_STATUS);this.setInputsInline(!0);this.setOutput(!0)}};
- Blockly.Blocks.AIYBoard_LED_setting={init:function(){this.setColour(Blockly.Blocks.AIYBoard.HUE);this.appendDummyInput().appendField("LED").appendField(new Blockly.FieldDropdown([["BEACON_DARK","BEACON_DARK"],["ON","ON"],["PULSE_QUICK","PULSE_QUICK"]]),"SETTING");this.setOutput(!0)}};Blockly.Blocks.AIYBoard_board={init:function(){this.setColour(Blockly.Blocks.AIYBoard.HUE);this.appendDummyInput().appendField("Board");this.setOutput(!0)}};
- Blockly.Blocks.AIYBoard_button={init:function(){this.setColour(Blockly.Blocks.AIYBoard.HUE);this.appendDummyInput().appendField("Button");this.setOutput(!0)}};Blockly.Blocks.AIYBoard_button_press={init:function(){this.setColour(Blockly.Blocks.AIYBoard.HUE);this.appendDummyInput().appendField("On Button Press");this.appendStatementInput("STACK");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.AIYBoard_board_led_status={init:function(){this.setColour(Blockly.Blocks.AIYBoard.HUE);this.appendValueInput("INPUT").appendField("Board led status");this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.AIYBoard_board_led_state={init:function(){this.setColour(Blockly.Blocks.AIYBoard.HUE);this.appendValueInput("INPUT").appendField("Board led state");this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.camera={};Blockly.Blocks.camera.HUE="#ff6381";Blockly.Blocks.camera_import={init:function(){this.setColour(Blockly.Blocks.camera.HUE);this.appendDummyInput().appendField(Blockly.Msg.CAMERA_IMPORT);this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.camera_use={init:function(){this.setColour(Blockly.Blocks.camera.HUE);this.appendDummyInput().appendField(Blockly.Msg.CAMERA_USE_AS).appendField(new Blockly.FieldTextInput("camera"),"CAMERA");this.appendDummyInput().appendField(Blockly.Msg.CAMERA_SENSOR_MODE).appendField(new Blockly.FieldNumber("4"),"SENSOR");this.appendDummyInput().appendField(Blockly.Msg.CAMERA_RESOLUTION).appendField(new Blockly.FieldNumber("1640"),"X").appendField(",").appendField(new Blockly.FieldNumber("1232"),
- "Y");this.appendDummyInput().appendField(Blockly.Msg.CAMERA_FRAME_RATE).appendField(new Blockly.FieldNumber("20"),"FPS").appendField(Blockly.Msg.CAMERA_FPS);this.appendStatementInput("STACK").appendField(Blockly.Msg.CAMERA_DO);this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.camera_enable={init:function(){this.setColour(Blockly.Blocks.camera.HUE);this.appendDummyInput().appendField(new Blockly.FieldDropdown([["Enable","start"],["Disable","stop"]]),"MODE").appendField(Blockly.Msg.CAMERA_CAMERA).appendField(new Blockly.FieldTextInput("camera"),"CAMERA");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.camera_set_bounding={init:function(){this.setColour(Blockly.Blocks.camera.HUE);this.appendDummyInput().appendField(Blockly.Msg.CAMERA_SET_BOUNDING).appendField(new Blockly.FieldTextInput("x"),"X").appendField(new Blockly.FieldTextInput("y"),"Y").appendField(new Blockly.FieldTextInput("width"),"WIDTH").appendField(new Blockly.FieldTextInput("height"),"HEIGHT");this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.class_creation={init:function(){this.appendDummyInput().appendField("Create class").appendField(new Blockly.FieldVariable("new class"),"CLASS");this.appendDummyInput().appendField("Inherits from").appendField(new Blockly.FieldVariable("j"),"NAME").appendField(",").appendField(new Blockly.FieldVariable("k"),"NAME");this.appendStatementInput("BODY").setCheck(null);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(230);this.setTooltip("");this.setHelpUrl("http://www.example.com/")}};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,helpUrl:Blockly.Msg.COLOUR_PICKER_HELPURL});var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.getInputsInline()&&b.tooltip||Blockly.Msg.COLOUR_PICKER_TOOLTIP})}};
- 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})}};
- 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)}};
- 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)}};Blockly.Blocks.comment_single={init:function(){this.appendDummyInput().appendField("Comment:").appendField(new Blockly.FieldTextInput("will be ignored"),"BODY");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(60);this.setTooltip("This is a comment, which will be ignored when you execute your code.");this.setHelpUrl("")}};
- Blockly.Blocks.string_multiline={init:function(){this.appendDummyInput().appendField("Multiline String:");this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextArea(""),"TEXT").appendField(this.newQuote_(!1));this.setColour(Blockly.Blocks.texts.HUE);this.setOutput(!0,"String")},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.list_comprehension={init:function(){this.appendValueInput("body").setCheck(null).appendField("[");this.appendValueInput("var").setCheck(null).appendField("for");this.appendValueInput("list").setCheck(null).appendField("in");this.appendDummyInput().appendField("]");this.setInputsInline(!0);this.setOutput(!0,null);this.setTooltip("");this.setHelpUrl("http://www.example.com/")}};Blockly.Blocks.corgis={};var WEATHER_HUE=70,QUAKES_HUE=60,STOCKS_HUE=65,CRIME_HUE=55,BOOKS_HUE=50,CITIES=[["Blacksburg, VA","Blacksburg, VA"],["Seattle, WA","Seattle, WA"],["Miami, FL","Miami, FL"],["San Jose, CA","San Jose, CA"],["New York, NY","New York, NY"]];Blockly.Blocks.weather_temperature_get={init:function(){this.setColour(WEATHER_HUE);this.appendDummyInput().appendField("get a set of temperatures");this.setInputsInline(!1);this.setOutput(!0,"Array");this.setTooltip("Returns a set of temperature (number)")}};
- Blockly.Blocks.weather_temperature={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(WEATHER_HUE);this.appendDummyInput().appendField("get temperature in").appendField(new Blockly.FieldDropdown(CITIES),"CITY");this.setInputsInline(!1);this.setOutput(!0,"Number");this.setTooltip("Returns a single temperature (number)")}};
- Blockly.Blocks.weather_forecasts={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(WEATHER_HUE);this.appendDummyInput().appendField("get forecasted temperatures in").appendField(new Blockly.FieldDropdown(CITIES),"CITY");this.setInputsInline(!1);this.setOutput(!0,"Array");this.setTooltip("Returns a list of forecasted temperatures (list of number)")}};
- Blockly.Blocks.weather_highs_lows={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(WEATHER_HUE);this.appendDummyInput().appendField("get highs and lows in").appendField(new Blockly.FieldDropdown(CITIES),"CITY");this.setInputsInline(!1);this.setOutput(!0,"dict");this.setTooltip("Returns a list of forecasted temperature highs and lows (dict of lists of numbers)")}};
- Blockly.Blocks.weather_report_forecasts={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(WEATHER_HUE);this.appendDummyInput().appendField("get forecasted weather in").appendField(new Blockly.FieldDropdown(CITIES),"CITY");this.setInputsInline(!1);this.setOutput(!0,"Array");this.setTooltip("Returns a list of forecasted weather reports (list of dicts)")}};
- Blockly.Blocks.weather_report={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(WEATHER_HUE);this.appendDummyInput().appendField("get weather in").appendField(new Blockly.FieldDropdown(CITIES),"CITY");this.setInputsInline(!1);this.setOutput(!0,"dict");this.setTooltip("Returns a weather report (dictionary)")}};
- Blockly.Blocks.weather_all_forecasts={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(WEATHER_HUE);this.appendDummyInput().appendField("get all forecasted temperatures");this.setInputsInline(!1);this.setOutput(!0,"dict");this.setTooltip("Returns a list of dictionaries of forecasts and cities")}};var COMPANIES=[["Facebook","FB"],["Apple","AAPL"],["Microsoft","MSFT"],["Google","GOOG"]];
- Blockly.Blocks.stocks_current={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(STOCKS_HUE);this.appendDummyInput().appendField("get current stock of").appendField(new Blockly.FieldDropdown(COMPANIES),"TICKER");this.setInputsInline(!1);this.setOutput(!0,"Number");this.setTooltip("Returns a single stock change value (number)")}};
- Blockly.Blocks.stocks_past={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(STOCKS_HUE);this.appendDummyInput().appendField("get past stock changes of").appendField(new Blockly.FieldDropdown(COMPANIES),"TICKER");this.setInputsInline(!1);this.setOutput(!0,"Array");this.setTooltip("Returns a list of the previous stock values")}};var EARTHQUAKES=[["magnitude","magnitude"],["depth","depth"]];
- Blockly.Blocks.earthquake_get={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(QUAKES_HUE);this.appendDummyInput().appendField("get recent earthquakes'").appendField(new Blockly.FieldDropdown(EARTHQUAKES),"PROPERTY");this.setInputsInline(!1);this.setOutput(!0,"Array");this.setTooltip("Returns a property of an earthquake")}};
- Blockly.Blocks.earthquake_both={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(QUAKES_HUE);this.appendDummyInput().appendField("get earthquakes magnitude and depth'");this.setInputsInline(!1);this.setOutput(!0,"Array");this.setTooltip("Returns magnitude and depth of multiple earthquakes")}};
- Blockly.Blocks.earthquake_all={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(QUAKES_HUE);this.appendDummyInput().appendField("get complete earthquakes report'");this.setInputsInline(!1);this.setOutput(!0,"Array");this.setTooltip("Returns all properties of multiple earthquakes")}};for(var YEARS=[],i=1960;2012>=i;i+=5)YEARS.push([""+i,""+i]);
- var STATES=[["Alaska","alaska"],["California","california"],["Delaware","delaware"],["Florida","florida"],["Maryland","maryland"],["Nevada","nevada"],["New Jersey","new jersey"],["New York","new york"],["Pennsylvania","pennsylvania"],["Texas","texas"],["Virginia","virginia"]];
- Blockly.Blocks.crime_state={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(CRIME_HUE);this.appendDummyInput().appendField("get").appendField(new Blockly.FieldDropdown([["property","property"],["violent","violent"],["both kinds","both"]]),"TYPE").appendField("crime rates in").appendField(new Blockly.FieldDropdown(STATES),"STATE");this.setInputsInline(!1);this.setOutput(!0,"Array");this.setTooltip("Returns all of the crime rates in the those states since 1960")}};
- Blockly.Blocks.crime_year={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(CRIME_HUE);this.appendDummyInput().appendField("get crime rates in").appendField(new Blockly.FieldDropdown(YEARS),"YEAR");this.setInputsInline(!1);this.setOutput(!0,"Array");this.setTooltip("Returns all of the crime rates reports for the given year by state")}};
- Blockly.Blocks.crime_all={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(CRIME_HUE);this.appendDummyInput().appendField("get all crime reports");this.setInputsInline(!1);this.setOutput(!0,"dict");this.setTooltip("Returns all of the crime rates reports")}};Blockly.Blocks.books_get={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(BOOKS_HUE);this.appendDummyInput().appendField("get books");this.setInputsInline(!1);this.setOutput(!0,"Array");this.setTooltip("Returns a list of books (list of dict)")}};Blockly.Blocks.decorator={init:function(){this.appendValueInput("BODY").setCheck(null).appendField("@");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(230);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.dicts_create_with={init:function(){console.log("init");this.setInputsInline(!1);this.setColour(Blockly.Blocks.dicts.HUE);this.itemCount_=1;this.updateShape_();this.setOutput(!0,"dict");this.setTooltip(Blockly.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(a){a=document.createElement("mutation");a.setAttribute("items",this.itemCount_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);this.updateShape_()},fixEmpty_:function(){0<this.itemCount_?
- this.getInput("START").fieldRow[0].setText("dictionary of"):this.getInput("START").fieldRow[0].setText(Blockly.Msg.DICTS_CREATE_EMPTY_TITLE)},addRow:function(a){this.getInput("VALUE"+a)||this.appendValueInput("VALUE"+a).setCheck(null).setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldTextInput(Blockly.Msg.DICTS_CREATE_WITH_ITEM_KEY),"KEY"+a).appendField(Blockly.Msg.DICTS_CREATE_WITH_ITEM_MAPPING)},updateShape_:function(){var a=this,b=new Blockly.FieldClickImage("images/plus_minus_v.png",
- 24,24,"+",function(b,e,d){b=b.fieldGroup_.getBoundingClientRect();d.clientY<b.top+b.height/2?(a.itemCount_+=1,a.addRow(a.itemCount_)):0<a.itemCount_&&(a.removeInput("VALUE"+a.itemCount_),--a.itemCount_);a.fixEmpty_()},"-2px");this.getInput("START")||this.appendDummyInput("START").appendField("dictionary of").appendField(b);this.fixEmpty_();for(b=1;b<=this.itemCount_;b++)this.addRow(b)}};Blockly.Blocks.dicts={};Blockly.Blocks.dicts.HUE=0;Blockly.Blocks.dict_get={init:function(){this.setColour(Blockly.Blocks.dicts.HUE);this.appendValueInput("ITEM");this.appendValueInput("DICT").setCheck("dict").appendField(Blockly.Msg.DICT_GET_TO);this.setInputsInline(!1);this.setOutput(!0)}};
- Blockly.Blocks.dict_get_literal={init:function(){this.setColour(Blockly.Blocks.dicts.HUE);this.appendValueInput("DICT").appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput(Blockly.Msg.DICTS_CREATE_WITH_ITEM_KEY),"ITEM").appendField(this.newQuote_(!1)).setCheck("dict").appendField(Blockly.Msg.DICT_GET_TO);this.setInputsInline(!1);this.setOutput(!0)},newQuote_:function(a){return new Blockly.FieldImage(a==this.RTL?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAYAAACALL/6AAAA0UlEQVQY023QP0oDURSF8e8MImhlUIiCjWKhrUUK3YCIVkq6bMAF2LkCa8ENWLoNS1sLEQKprMQ/GBDks3kDM+Oc8nfPfTxuANQTYBeYAvdJLL4FnAFfwF2ST9Rz27kp5YH/kwrYp50LdaXHAU4rYNYzWAdeenx7AbgF5sAhcARsAkkyVQ+ACbAKjIGqta4+l78udXxc/LiJG+qvet0pV+q7+tHE+iJzdbGz8FhmOzVcqj/qq7rcKI7Ut1Leq70C1oCrJMMk343HB8ADMEzyVOMff72l48gwfqkAAAAASUVORK5CYII=":
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAYAAACALL/6AAAAvklEQVQY022PoapCQRRF97lBVDRYhBcEQcP1BwS/QLAqr7xitZn0HzRr8Rts+htmQdCqSbQIwmMZPMIw3lVmZu0zG44UAFSBLdBVBDAFZqFo8eYKtANfBC7AE5h8ZNOHd1FrDnh4VgmDO3ADkujDHPgHfkLZ84bfaLjg/hD6RFLq9z6wBDr+rvuZB1bAEDABY76pA2mGHyWSjvqmIemc4WsCLKOp4nssIj8wD8qS/iSVJK3N7OTeJPV9n72ZbV7iDuSc2BaQBQAAAABJRU5ErkJggg==",12,12,'"')}};
- Blockly.Blocks.dict_keys={init:function(){this.setColour(Blockly.Blocks.dicts.HUE);this.appendValueInput("DICT").setCheck("dict").appendField(Blockly.Msg.DICT_KEYS);this.setInputsInline(!1);this.setOutput(!0,"Array")}};Blockly.Blocks.controls_if_better={init:function(){this.setHelpUrl(Blockly.Msg.CONTROLS_IF_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.appendValueInput("IF0").setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_IF);this.appendStatementInput("DO0").appendField(Blockly.Msg.CONTROLS_IF_MSG_THEN);this.setPreviousStatement(!0);this.setNextStatement(!0);this.updateShape_();var a=this;this.setTooltip(function(){if(a.elseifCount_||a.elseCount_){if(!a.elseifCount_&&a.elseCount_)return Blockly.Msg.CONTROLS_IF_TOOLTIP_2;
- if(a.elseifCount_&&!a.elseCount_)return Blockly.Msg.CONTROLS_IF_TOOLTIP_3;if(a.elseifCount_&&a.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)||0;this.elseCount_=parseInt(a.getAttribute("else"),10)||0;this.updateShape_()},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var a=1;this.getInput("IF"+a);)this.removeInput("IF"+a),this.removeInput("DO"+a),a++;for(a=1;a<=this.elseifCount_;a++)this.appendValueInput("IF"+a).setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+a).appendField(Blockly.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&
- this.appendStatementInput("ELSE").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSE)}};Blockly.Blocks.text_input={init:function(){this.appendDummyInput().appendField("input").appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput("with prompt"),"MESSAGE").appendField(this.newQuote_(!1));this.setOutput(!0,"String");this.setColour(230);this.setTooltip("");this.setHelpUrl("")},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.lists={};Blockly.Blocks.lists.HUE=195;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})}};
- Blockly.Blocks.lists_create_with={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_CREATE_WITH_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.itemCount_=3;this.updateShape_();this.setOutput(!0,"Array");this.setMutator(new Blockly.Mutator(["lists_create_with_item"]));this.setInputsInline(!0);this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_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=a.newBlock("lists_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("lists_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=
- this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):
- this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(Blockly.Msg.LISTS_CREATE_EMPTY_TITLE);for(var a=0;a<this.itemCount_;a++)if(!this.getInput("ADD"+a)){var b=this.appendValueInput("ADD"+a);0==a&&b.appendField(Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH)}for(3<this.itemCount_?this.setInputsInline(!1):this.setInputsInline(!0);this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};
- 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})}};
- 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})}};
- 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})}};
- 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","String"]).appendField(Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST);this.appendValueInput("FIND").appendField(new Blockly.FieldDropdown(a),"END");this.setInputsInline(!0);this.setTooltip(function(){return Blockly.Msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",
- this.workspace.options.oneBasedIndex?"0":"-1")})}};Blockly.Blocks.lists_index={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_GET_INDEX_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.appendValueInput("ITEM").setCheck("Number").appendField("get");this.appendValueInput("LIST").setCheck(["Array","String"]).appendField("th item of");this.setInputsInline(!0);this.setOutput(!0);this.setTooltip("Get's the ith item from the list")}};
- 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"),e=b.getFieldValue("WHERE"),d="";switch(a+" "+e){case "GET FROM_START":case "GET FROM_END":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case "GET FIRST":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case "GET LAST":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case "GET RANDOM":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case "GET_REMOVE FROM_START":case "GET_REMOVE FROM_END":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;
- break;case "GET_REMOVE FIRST":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case "GET_REMOVE LAST":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case "GET_REMOVE RANDOM":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case "REMOVE FROM_START":case "REMOVE FROM_END":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case "REMOVE FIRST":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case "REMOVE LAST":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;
- break;case "REMOVE RANDOM":d=Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}if("FROM_START"==e||"FROM_END"==e)d+=" "+("FROM_START"==e?Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP:Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",b.workspace.options.oneBasedIndex?"#1":"#0");return d})},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 c="FROM_START"==b||"FROM_END"==b;if(c!=a){var d=this.sourceBlock_;d.updateAt_(c);d.setFieldValue(b,"WHERE");return null}});this.getInput("AT").appendField(b,"WHERE");Blockly.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}};
- 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"),e=b.getFieldValue("WHERE"),d="";switch(a+" "+e){case "SET FROM_START":case "SET FROM_END":d=
- Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case "SET FIRST":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case "SET LAST":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case "SET RANDOM":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case "INSERT FROM_START":case "INSERT FROM_END":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case "INSERT FIRST":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case "INSERT LAST":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;
- break;case "INSERT RANDOM":d=Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}if("FROM_START"==e||"FROM_END"==e)d+=" "+Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",b.workspace.options.oneBasedIndex?"#1":"#0");return d})},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 c="FROM_START"==b||"FROM_END"==b;if(c!=a){var d=this.sourceBlock_;d.updateAt_(c);d.setFieldValue(b,"WHERE");return null}});this.moveInputBefore("AT","TO");this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL",
- "TO");this.getInput("AT").appendField(b,"WHERE")}};
- 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","String"]).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 d="FROM_START"==c||"FROM_END"==c;if(d!=b){var e=this.sourceBlock_;e.updateAt_(a,d);e.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)}};
- Blockly.Blocks.lists_sort={init:function(){this.jsonInit({message0:Blockly.Msg.LISTS_SORT_TITLE,args0:[{type:"field_dropdown",name:"TYPE",options:[[Blockly.Msg.LISTS_SORT_TYPE_NUMERIC,"NUMERIC"],[Blockly.Msg.LISTS_SORT_TYPE_TEXT,"TEXT"],[Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE,"IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[[Blockly.Msg.LISTS_SORT_ORDER_ASCENDING,"1"],[Blockly.Msg.LISTS_SORT_ORDER_DESCENDING,"-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",colour:Blockly.Blocks.lists.HUE,
- tooltip:Blockly.Msg.LISTS_SORT_TOOLTIP,helpUrl:Blockly.Msg.LISTS_SORT_HELPURL})}};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"))}};Blockly.Blocks.lists_append={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_APPEND_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.appendValueInput("LIST").setCheck("Array").appendField(Blockly.Msg.LISTS_APPEND_TO);this.appendValueInput("ITEM").appendField(Blockly.Msg.LISTS_APPEND);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.log={};Blockly.Blocks.log.HUE=45;Blockly.Blocks.log_setup={init:function(){this.setColour(Blockly.Blocks.log.HUE);this.appendDummyInput().appendField(Blockly.Msg.LOGGING_SETUP);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.log_conf={init:function(){this.setColour(Blockly.Blocks.log.HUE);this.appendDummyInput().appendField(Blockly.Msg.LOGGING_CONF);this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.log_import={init:function(){this.setColour(Blockly.Blocks.log.HUE);this.appendDummyInput().appendField(Blockly.Msg.LOGGING_IMPORT);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.log_info={init:function(){this.setColour(Blockly.Blocks.log.HUE);this.appendValueInput("LOG_INPUT").appendField(Blockly.Msg.LOGGING_INFO);this.setInputsInline(!1);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.log_config={init:function(){this.setColour(Blockly.Blocks.log.HUE);this.appendDummyInput().appendField(Blockly.Msg.LOGGING_CONFIG);this.appendDummyInput().appendField(Blockly.Msg.LOGGING_CONFIG_LEVEL).appendField(new Blockly.FieldDropdown([["INFO","logging.INFO"],["ERROR","logging.ERROR"],["WARNING","logging.WARNING"],["CRITICAL","logging.CRITICAL"],["DEBUG","logging.DEBUG"],["NOTSET","logging.NOTSET"]]),"LEVEL");this.setInputsInline(!1);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.logic={};Blockly.HSV_SATURATION=.7;Blockly.HSV_VALUE=.9;Blockly.Blocks.logic.HUE=214;
- Blockly.Blocks.controls_if={init:function(){this.setHelpUrl(Blockly.Msg.CONTROLS_IF_HELPURL);this.setColour(Blockly.Blocks.logic.HUE);this.appendValueInput("IF0").setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_IF);this.appendStatementInput("DO0").appendField(Blockly.Msg.CONTROLS_IF_MSG_THEN);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setMutator(new Blockly.Mutator(["controls_if_elseif","controls_if_else"]));var a=this;this.setTooltip(function(){if(a.elseifCount_||a.elseCount_){if(!a.elseifCount_&&
- a.elseCount_)return Blockly.Msg.CONTROLS_IF_TOOLTIP_2;if(a.elseifCount_&&!a.elseCount_)return Blockly.Msg.CONTROLS_IF_TOOLTIP_3;if(a.elseifCount_&&a.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)||0;this.elseCount_=parseInt(a.getAttribute("else"),10)||0;this.updateShape_()},decompose:function(a){var b=a.newBlock("controls_if_if");b.initSvg();for(var c=b.nextConnection,e=1;e<=this.elseifCount_;e++){var d=a.newBlock("controls_if_elseif");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}this.elseCount_&&(a=a.newBlock("controls_if_else"),a.initSvg(),c.connect(a.previousConnection));return b},
- compose:function(a){var b=a.nextConnection.targetBlock();this.elseCount_=this.elseifCount_=0;a=[null];for(var c=[null],e=null;b;){switch(b.type){case "controls_if_elseif":this.elseifCount_++;a.push(b.valueConnection_);c.push(b.statementConnection_);break;case "controls_if_else":this.elseCount_++;e=b.statementConnection_;break;default:throw"Unknown block type.";}b=b.nextConnection&&b.nextConnection.targetBlock()}this.updateShape_();for(b=1;b<=this.elseifCount_;b++)Blockly.Mutator.reconnect(a[b],this,
- "IF"+b),Blockly.Mutator.reconnect(c[b],this,"DO"+b);Blockly.Mutator.reconnect(e,this,"ELSE")},saveConnections:function(a){a=a.nextConnection.targetBlock();for(var b=1;a;){switch(a.type){case "controls_if_elseif":var c=this.getInput("IF"+b),e=this.getInput("DO"+b);a.valueConnection_=c&&c.connection.targetConnection;a.statementConnection_=e&&e.connection.targetConnection;b++;break;case "controls_if_else":e=this.getInput("ELSE");a.statementConnection_=e&&e.connection.targetConnection;break;default:throw"Unknown block type.";
- }a=a.nextConnection&&a.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var a=1;this.getInput("IF"+a);)this.removeInput("IF"+a),this.removeInput("DO"+a),a++;for(a=1;a<=this.elseifCount_;a++)this.appendValueInput("IF"+a).setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+a).appendField(Blockly.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSE)}};
- Blockly.Blocks.controls_if_if={init:function(){this.setColour(Blockly.Blocks.logic.HUE);this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_IF_IF_TITLE_IF);this.setNextStatement(!0);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=[["==","EQ"],["!=","NEQ"],[">","LT"],[">=","LTE"],["<","GT"],["<=","GTE"]],b=[["==","EQ"],["!=","NEQ"],["<","LT"],["<=","LTE"],[">","GT"],[">=","GTE"]];a=this.RTL?a:b;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 c=this;this.setTooltip(function(){var a=
- c.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(a){var b=this.getInputTargetBlock("A"),c=this.getInputTargetBlock("B");if(b&&c&&!b.outputConnection.checkType_(c.outputConnection)){Blockly.Events.setGroup(a.group);for(a=0;a<
- this.prevBlocks_.length;a++){var e=this.prevBlocks_[a];if(e===b||e===c)e.unplug(),e.bumpNeighbours_()}Blockly.Events.setGroup(!1)}this.prevBlocks_[0]=b;this.prevBlocks_[1]=c}};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]})}};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})}};
- 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})}};
- 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})}};
- 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(a){var b=
- this.getInputTargetBlock("THEN"),c=this.getInputTargetBlock("ELSE"),e=this.outputConnection.targetConnection;if((b||c)&&e)for(var d=0;2>d;d++){var f=1==d?b:c;f&&!f.outputConnection.checkType_(e)&&(Blockly.Events.setGroup(a.group),e===this.prevParentConnection_?(this.unplug(),e.getSourceBlock().bumpNeighbours_()):(f.unplug(),f.bumpNeighbours_()),Blockly.Events.setGroup(!1))}this.prevParentConnection_=e}};
- Blockly.Blocks.logic_isIn={init:function(){this.setColour(Blockly.Blocks.logic.HUE);this.setOutput(!0,"Boolean");this.appendValueInput("ITEM");this.appendValueInput("LIST").setCheck(["Array","String"]).appendField(new Blockly.FieldDropdown([["is in","IN"],["is not in","NOTIN"]]),"OP");this.setInputsInline(!0)}};Blockly.Blocks.logic_none={init:function(){this.appendDummyInput().appendField("None");this.setColour(Blockly.Blocks.logic.HUE);this.setOutput(!0)}};Blockly.Blocks.loops={};Blockly.Blocks.loops.HUE=260;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)}};
- Blockly.Blocks.controls_repeat={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"field_number",name:"TIMES",value:10,min:0,precision:1}],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)}};
- 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]})}};
- Blockly.Blocks.controls_while={init:function(){this.setHelpUrl(Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL);this.setColour(Blockly.Blocks.loops.HUE);this.appendValueInput("BOOL").setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE);this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE)}};
- 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"))})},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)}}};
- 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"))})},customContextMenu:Blockly.Blocks.controls_for.customContextMenu};Blockly.Blocks.controls_pass={init:function(){this.setHelpUrl("");this.setColour(Blockly.Blocks.loops.HUE);this.appendDummyInput().appendField("do nothing");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("This block does absolutely nothing.")}};
- 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(a){if(!this.workspace.isDragging()){a=!1;var b=this;do{if(-1!=this.LOOP_TYPES.indexOf(b.type)){a=!0;break}b=b.getSurroundParent()}while(b);a?(this.setWarningText(null),this.isInFlyout||this.setDisabled(!1)):(this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING),this.isInFlyout||this.getInheritedDisabled()||this.setDisabled(!0))}},LOOP_TYPES:"controls_repeat controls_repeat_ext controls_forEach controls_for controls_whileUntil controls_while".split(" ")};
- Blockly.Blocks.loop_forEach={init:function(){this.setColour(Blockly.Blocks.loops.HUE);this.appendValueInput("ITEM").appendField(Blockly.Msg.LOOP_FOREACH_ITEM);this.appendValueInput("LIST").appendField(Blockly.Msg.LOOP_FOREACH_LIST);this.setOutput(!0);this.setInputsInline(!0)}};Blockly.Blocks.math={};var DATA_HUE=100,LOGIC_HUE=230,VARIABLE_HUE=240;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.FieldNumber("0"),"NUM");this.setOutput(!0,"Number");var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.getInputsInline()&&b.tooltip||Blockly.Msg.MATH_NUMBER_TOOLTIP})}};
- Blockly.Blocks.math_arithmetic={init:function(){this.jsonInit({message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:["Number","String"]},{type:"field_dropdown",name:"OP",options:[[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"],["%","MODULO"]]},{type:"input_value",name:"B",check:["Number","String"]}],inputsInline:!0,
- output:"Number",colour:Blockly.Blocks.math.HUE,helpUrl:Blockly.Msg.MATH_ARITHMETIC_HELPURL});var a=this;this.setTooltip(function(){var b=a.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,MODULO:"Computes the remainder of division."}[b]})}};
- Blockly.Blocks.math_single={init:function(){this.jsonInit({message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[[Blockly.Msg.MATH_SINGLE_OP_ROOT,"ROOT"],[Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE,"ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",colour:Blockly.Blocks.math.HUE,helpUrl:Blockly.Msg.MATH_SINGLE_HELPURL});var a=this;this.setTooltip(function(){var b=a.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}[b]})}};
- Blockly.Blocks.math_trig={init:function(){this.jsonInit({message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[[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"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",colour:Blockly.Blocks.math.HUE,helpUrl:Blockly.Msg.MATH_TRIG_HELPURL});var a=this;this.setTooltip(function(){var b=
- a.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}[b]})}};
- Blockly.Blocks.math_constant={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"CONSTANT",options:[["\u03c0","PI"],["e","E"],["\u03c6","GOLDEN_RATIO"],["sqrt(2)","SQRT2"],["sqrt(\u00bd)","SQRT1_2"],["\u221e","INFINITY"]]}],output:"Number",colour:Blockly.Blocks.math.HUE,tooltip:Blockly.Msg.MATH_CONSTANT_TOOLTIP,helpUrl:Blockly.Msg.MATH_CONSTANT_HELPURL})}};
- 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")}};Blockly.Blocks.math_change={init:function(){this.jsonInit({message0:"increase %1 by %2",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:VARIABLE_HUE,helpUrl:Blockly.Msg.MATH_CHANGE_HELPURL});var a=this;this.setTooltip(function(){return Blockly.Msg.MATH_CHANGE_TOOLTIP.replace("%1",a.getFieldValue("VAR"))})}};
- Blockly.Blocks.math_round={init:function(){this.jsonInit({message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[[Blockly.Msg.MATH_ROUND_OPERATOR_ROUND,"ROUND"],[Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP,"ROUNDUP"],[Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN,"ROUNDDOWN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",colour:Blockly.Blocks.math.HUE,tooltip:Blockly.Msg.MATH_ROUND_TOOLTIP,helpUrl:Blockly.Msg.MATH_ROUND_HELPURL})}};
- 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(DATA_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"))}};
- 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})}};
- 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})}};
- 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})}};
- Blockly.Blocks.math_random_float={init:function(){this.jsonInit({message0:Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM,output:"Number",colour:Blockly.Blocks.math.HUE,tooltip:Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP,helpUrl:Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL})}};Blockly.Blocks.math_sum_values={init:function(){this.setColour(Blockly.Blocks.math.HUE);this.appendDummyInput().appendField(Blockly.Msg.MATH_SUM);this.appendValueInput("SUM1");this.appendValueInput("SUM2");this.setOutput(!0,"Number");this.setInputsInline(!0)}};
- Blockly.Blocks.math_sum_common={init:function(){this.setColour(Blockly.Blocks.math.HUE);this.appendValueInput("SUM1").appendField(Blockly.Msg.MATH_SUM);this.setOutput(!0,"Number");this.setInputsInline(!0)}};var DAYS=[["Monday","MON"],["Tuesday","TUE"],["Wednesday","WED"],["Thursday","THU"],["Friday","FRI"],["Saturday","SAT"],["Sunday","SUN"]],DAYS_MAP={mon:'parking.Day("MON")',tue:'parking.Day("TUE")',wed:'parking.Day("WED")',thu:'parking.Day("THU")',fri:'parking.Day("FRI")',sat:'parking.Day("SAT")',sun:'parking.Day("SUN")',tod:"parking.today()"};
- Blockly.Blocks.datetime_day={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"DAY",options:[["Today","TODAY"]].concat(DAYS)}],output:"DatetimeDay",colour:DATA_HUE,tooltip:"Returns a day of the week",helpUrl:""})}};var HOURS=[["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"]],MINUTES=[["00","00"],["30","30"]],MERIDIANS=[["am","AM"],["pm","PM"]];
- Blockly.Blocks.datetime_time={init:function(){this.setColour(DATA_HUE);var a=new Blockly.FieldDropdown([["Now","NOW"]].concat(HOURS),function(a){this.sourceBlock_.updateShape_("NOW"==a)});this.appendDummyInput().appendField(a,"HOUR");this.setInputsInline(!0);this.setOutput(!0,"DatetimeTime");this.setTooltip("Returns a time of day")},mutationToDom:function(){var a=document.createElement("mutation"),b="NOW"==this.getFieldValue("HOUR").toUpperCase();a.setAttribute("isnow",b);return a},domToMutation:function(a){a=
- "true"==a.getAttribute("isnow");this.updateShape_(a)},updateShape_:function(a){var b=this.getInput("EXTENDED");a?b&&this.removeInput("EXTENDED"):b||(a=new Blockly.FieldDropdown(MINUTES),b=new Blockly.FieldDropdown(MERIDIANS),this.appendDummyInput("EXTENDED").appendField(":").appendField(a,"MINUTE").appendField(b,"MERIDIAN"))}};
- var HOURS_MAP={1:"parking.one()",2:"parking.two()",3:"parking.three()",4:"parking.four()",5:"parking.five()",6:"parking.six()",7:"parking.seven()",8:"parking.eight()",9:"parking.nine()",10:"parking.ten()",11:"parking.eleven()",12:"parking.twelve()",NOW:"parking.now()"},MINUTES_MAP={"00":"parking.exactly()",30:"parking.half()"},MERIDIANS_MAP={AM:"parking.am()",PM:"parking.pm()"},convertDate=function(a){a=a.slice(0,3).toLowerCase();switch(a){case "mon":return"Monday";case "tue":return"Tuesday";case "wed":return"Wednesday";
- case "thu":return"Thursday";case "fri":return"Friday";case "sat":return"Saturday";case "sun":return"Sunday";default:return a}},convertMinute=function(a){return 10>a?"0"+a:""+a},equalityOperators=[["==","IS"],["<","BEFORE"],[">","AFTER"],["<=","BEFORE_EQUAL"],["=>","AFTER_EQUAL"],["!=","IS_NOT"]],equalityOperatorsConversions={IS:"parking.equal",BEFORE:"parking.before",AFTER:"parking.after",BEFORE_EQUAL:"parking.before_equal",AFTER_EQUAL:"parking.after_equal",IS_NOT:"parking.not_equal"};
- Blockly.Blocks.datetime_check_day={init:function(){this.setColour(Blockly.Blocks.logic.HUE);this.setOutput(!0,"Boolean");this.appendValueInput("LEFT").setCheck("DatetimeDay").appendField(new Blockly.FieldDropdown(DAYS),"VALUE").appendField(new Blockly.FieldDropdown(equalityOperators),"OP");this.setInputsInline(!1)}};
- Blockly.Blocks.datetime_check_time={init:function(){this.setColour(Blockly.Blocks.logic.HUE);this.setOutput(!0,"Boolean");this.appendValueInput("LEFT").setCheck("DatetimeTime").appendField(new Blockly.FieldDropdown(HOURS),"HOURS").appendField(":").appendField(new Blockly.FieldDropdown(MINUTES),"MINUTES").appendField(new Blockly.FieldDropdown(MERIDIANS),"MERIDIANS").appendField(new Blockly.FieldDropdown(equalityOperators),"OP")}};Blockly.Blocks.Platform={};Blockly.Blocks.Platform.HUE="#79bc53";Blockly.Blocks.Platform_import={init:function(){this.setColour(Blockly.Blocks.Platform.HUE);this.appendDummyInput().appendField(Blockly.Msg.PLATFORM_IMPORT);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.plot={};Blockly.Blocks.plot.HUE=20;Blockly.Blocks.plot_show={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(Blockly.Blocks.plot.HUE);this.appendDummyInput().appendField("show plot canvas");this.setInputsInline(!1);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setOutput(!1);this.setTooltip("Makes the canvas appear")}};
- Blockly.Blocks.plot_scatter={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(Blockly.Blocks.plot.HUE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.appendValueInput("x_values").appendField("plot scatter ").setCheck("Array");this.appendValueInput("y_values").appendField("vs. ").setCheck("Array");this.setInputsInline(!1);this.setOutput(!1);this.setTooltip("Plots onto the canvas")}};
- var OPEN_QUOTE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAYAAACALL/6AAAA0UlEQVQY023QP0oDURSF8e8MImhlUIiCjWKhrUUK3YCIVkq6bMAF2LkCa8ENWLoNS1sLEQKprMQ/GBDks3kDM+Oc8nfPfTxuANQTYBeYAvdJLL4FnAFfwF2ST9Rz27kp5YH/kwrYp50LdaXHAU4rYNYzWAdeenx7AbgF5sAhcARsAkkyVQ+ACbAKjIGqta4+l78udXxc/LiJG+qvet0pV+q7+tHE+iJzdbGz8FhmOzVcqj/qq7rcKI7Ut1Leq70C1oCrJMMk343HB8ADMEzyVOMff72l48gwfqkAAAAASUVORK5CYII=",CLOSED_QUOTE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAYAAACALL/6AAAAvklEQVQY022PoapCQRRF97lBVDRYhBcEQcP1BwS/QLAqr7xitZn0HzRr8Rts+htmQdCqSbQIwmMZPMIw3lVmZu0zG44UAFSBLdBVBDAFZqFo8eYKtANfBC7AE5h8ZNOHd1FrDnh4VgmDO3ADkujDHPgHfkLZ84bfaLjg/hD6RFLq9z6wBDr+rvuZB1bAEDABY76pA2mGHyWSjvqmIemc4WsCLKOp4nssIj8wD8qS/iSVJK3N7OTeJPV9n72ZbV7iDuSc2BaQBQAAAABJRU5ErkJggg==";
- Blockly.Blocks.plot_title={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(Blockly.Blocks.plot.HUE);this.appendDummyInput().appendField("make plot's title").appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput("title"),"TEXT").appendField(this.newQuote_(!1));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setOutput(!1);this.setTooltip("Sets the plot's title")},newQuote_:function(a){return new Blockly.FieldImage(a==this.RTL?
- OPEN_QUOTE:CLOSED_QUOTE,12,12,'"')}};
- Blockly.Blocks.plot_xlabel={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(Blockly.Blocks.plot.HUE);this.appendDummyInput().appendField("make plot's x-axis label").appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput("title"),"TEXT").appendField(this.newQuote_(!1));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setOutput(!1);this.setTooltip("Sets the plot's x-axis title (horizontal axis)")},newQuote_:function(a){return new Blockly.FieldImage(a==
- this.RTL?OPEN_QUOTE:CLOSED_QUOTE,12,12,'"')}};
- Blockly.Blocks.plot_ylabel={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(Blockly.Blocks.plot.HUE);this.appendDummyInput().appendField("make plot's y-axis label").appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput("title"),"TEXT").appendField(this.newQuote_(!1));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setOutput(!1);this.setTooltip("Sets the plot's y-axis title (vertical axis)")},newQuote_:function(a){return new Blockly.FieldImage(a==
- this.RTL?OPEN_QUOTE:CLOSED_QUOTE,12,12,'"')}};Blockly.Blocks.plot_line={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(Blockly.Blocks.plot.HUE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.appendValueInput("y_values").appendField("plot line ").setCheck("Array");this.setInputsInline(!1);this.setOutput(!1);this.setTooltip("Plots onto the canvas")}};
- Blockly.Blocks.plot_hist={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(Blockly.Blocks.plot.HUE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.appendValueInput("values").appendField("plot histogram ").setCheck("Array");this.setInputsInline(!1);this.setOutput(!1);this.setTooltip("Plots a histogram onto the canvas")}};
- Blockly.Blocks.plot_lineXY={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(Blockly.Blocks.plot.HUE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.appendValueInput("x_values").appendField("plot Xs:").setCheck("Array");this.appendValueInput("y_values").appendField("vs. Ys:").setCheck("Array");this.setInputsInline(!1);this.setOutput(!1);this.setTooltip("Plots onto the canvas")}};Blockly.Blocks.plot_legend={init:function(){this.setHelpUrl("http://www.example.com/");this.setColour(Blockly.Blocks.plot.HUE);this.appendDummyInput().appendField("make legend");this.setInputsInline(!1);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setOutput(!1);this.setTooltip("Makes the legend appear")}};Blockly.Blocks.procedures={};Blockly.Blocks.procedures.HUE=340;
- Blockly.Blocks.procedures_defnoreturn={init:function(){var a=new Blockly.FieldTextInput(Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE,Blockly.Procedures.rename);a.setSpellcheck(!1);this.setPreviousStatement(!0);this.setNextStatement(!0);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE).appendField(a,"NAME").appendField("","PARAMS");this.setMutator(new Blockly.Mutator(["procedures_mutatorarg"]));this.setColour(Blockly.Blocks.procedures.HUE);this.setTooltip(Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP);
- this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL);this.arguments_=[];this.setStatements_(!0);this.statementConnection_=null},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)},updateParams_:function(){for(var a=!1,b={},c=0;c<this.arguments_.length;c++){if(b["arg_"+this.arguments_[c].toLowerCase()]){a=
- !0;break}b["arg_"+this.arguments_[c].toLowerCase()]=!0}a?this.setWarningText(Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING):this.setWarningText(null);a="";this.arguments_.length&&(a=Blockly.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", "));Blockly.Events.disable();try{this.setFieldValue(a,"PARAMS")}finally{Blockly.Events.enable()}},mutationToDom:function(a){var b=document.createElement("mutation");a&&b.setAttribute("name",this.getFieldValue("NAME"));for(var c=0;c<this.arguments_.length;c++){var e=
- document.createElement("arg");e.setAttribute("name",this.arguments_[c]);a&&this.paramIds_&&e.setAttribute("paramId",this.paramIds_[c]);b.appendChild(e)}this.hasStatements_||b.setAttribute("statements","false");return b},domToMutation:function(a){this.arguments_=[];for(var b=0,c;c=a.childNodes[b];b++)"arg"==c.nodeName.toLowerCase()&&this.arguments_.push(c.getAttribute("name"));this.updateParams_();Blockly.Procedures.mutateCallers(this);this.setStatements_("false"!==a.getAttribute("statements"))},decompose:function(a){var b=
- a.newBlock("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,e=0;e<this.arguments_.length;e++){var d=a.newBlock("procedures_mutatorarg");d.initSvg();d.setFieldValue(this.arguments_[e],"NAME");d.oldLocation=e;c.connect(d.previousConnection);c=d.nextConnection}Blockly.Procedures.mutateCallers(this);return b},compose:function(a){this.arguments_=
- [];this.paramIds_=[];for(var b=a.getInputTargetBlock("STACK");b;)this.arguments_.push(b.getFieldValue("NAME")),this.paramIds_.push(b.id),b=b.nextConnection&&b.nextConnection.targetBlock();this.updateParams_();Blockly.Procedures.mutateCallers(this);a=a.getFieldValue("STATEMENTS");if(null!==a&&(a="TRUE"==a,this.hasStatements_!=a))if(a)this.setStatements_(!0),Blockly.Mutator.reconnect(this.statementConnection_,this,"STACK"),this.statementConnection_=null;else{a=this.getInput("STACK").connection;if(this.statementConnection_=
- a.targetConnection)a=a.targetBlock(),a.unplug(),a.bumpNeighbours_();this.setStatements_(!1)}},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},getVars:function(){return this.arguments_},renameVar:function(a,b){for(var c=!1,e=0;e<this.arguments_.length;e++)Blockly.Names.equals(a,this.arguments_[e])&&(this.arguments_[e]=b,c=!0);if(c&&(this.updateParams_(),this.mutator.isVisible())){c=this.mutator.workspace_.getAllBlocks();e=0;for(var d;d=c[e];e++)"procedures_mutatorarg"==
- d.type&&Blockly.Names.equals(a,d.getFieldValue("NAME"))&&d.setFieldValue(b,"NAME")}},customContextMenu:function(a){var b={enabled:!0},c=this.getFieldValue("NAME");b.text=Blockly.Msg.PROCEDURES_CREATE_DO.replace("%1",c);var e=goog.dom.createDom("mutation");e.setAttribute("name",c);for(var d=0;d<this.arguments_.length;d++)c=goog.dom.createDom("arg"),c.setAttribute("name",this.arguments_[d]),e.appendChild(c);e=goog.dom.createDom("block",null,e);e.setAttribute("type",this.callType_);b.callback=Blockly.ContextMenu.callbackFactory(this,
- e);a.push(b);if(!this.isCollapsed())for(d=0;d<this.arguments_.length;d++)b={enabled:!0},c=this.arguments_[d],b.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",c),e=goog.dom.createDom("field",null,c),e.setAttribute("name","VAR"),e=goog.dom.createDom("block",null,e),e.setAttribute("type","variables_get"),b.callback=Blockly.ContextMenu.callbackFactory(this,e),a.push(b)},callType_:"procedures_callnoreturn",onchange:function(){if(this.workspace){for(var a=!1,b=this.getDescendants(),c=0;c<b.length;c++)"procedures_return"==
- b[c].type&&(a=!0);b=this.getFieldValue("NAME");var e=this.workspace.getAllBlocks();for(c=0;c<e.length;c++)if("procedures_callreturn"==e[c].type||"procedures_callnoreturn"==e[c].type){var d=e[c].getFieldValue("NAME");d&&Blockly.Names.equals(b,d)&&e[c].setReturn(a)}}}};
- Blockly.Blocks.procedures_defreturn={init:function(){var a=new Blockly.FieldTextInput(Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE,Blockly.Procedures.rename);a.setSpellcheck(!1);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_DEFRETURN_TITLE).appendField(a,"NAME").appendField("","PARAMS");this.appendValueInput("RETURN").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);this.setMutator(new Blockly.Mutator(["procedures_mutatorarg"]));this.setColour(Blockly.Blocks.procedures.HUE);
- this.setTooltip(Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL);this.arguments_=[];this.setStatements_(!0);this.statementConnection_=null},setStatements_:Blockly.Blocks.procedures_defnoreturn.setStatements_,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,onchange:Blockly.Blocks.procedures_defnoreturn.onchange,getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},getVars:Blockly.Blocks.procedures_defnoreturn.getVars,renameVar:Blockly.Blocks.procedures_defnoreturn.renameVar,customContextMenu:Blockly.Blocks.procedures_defnoreturn.customContextMenu,callType_:"procedures_callreturn"};
- Blockly.Blocks.procedures_mutatorcontainer={init:function(){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.setColour(Blockly.Blocks.procedures.HUE);this.setTooltip(Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP);this.contextMenu=!1}};
- Blockly.Blocks.procedures_mutatorarg={init:function(){var a=new Blockly.FieldTextInput("x",this.validator_);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_MUTATORARG_TITLE).appendField(a,"NAME");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.procedures.HUE);this.setTooltip(Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP);this.contextMenu=!1;a.onFinishEditing_=this.createNewVar_;a.onFinishEditing_("x")},validator_:function(a){return(a=a.replace(/[\s\xa0]+/g,
- " ").replace(/^ | $/g,""))||null},createNewVar_:function(a){var b=this.sourceBlock_;b&&b.workspace&&b.workspace.options&&b.workspace.options.parentWorkspace&&b.workspace.options.parentWorkspace.createVariable(a)}};
- Blockly.Blocks.procedures_callnoreturn={init:function(){this.appendDummyInput("TOPROW").appendField(this.id,"NAME");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.procedures.HUE);this.setHelpUrl(Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL);this.arguments_=[];this.quarkConnections_={};this.quarkIds_=null},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)))},setReturn:function(a){a?(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)):(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0));this.rendered&&this.render()},setProcedureParameters_:function(a,b){var c=Blockly.Procedures.getDefinition(this.getProcedureCall(),this.workspace),e=c&&c.mutator&&c.mutator.isVisible();
- e||(this.quarkConnections_={},this.quarkIds_=null);if(b)if(goog.array.equals(this.arguments_,a))this.quarkIds_=b;else{if(b.length!=a.length)throw"Error: paramNames and paramIds must be the same length.";this.setCollapsed(!1);this.quarkIds_||(this.quarkConnections_={},a.join("\n")==this.arguments_.join("\n")?this.quarkIds_=b:this.quarkIds_=[]);c=this.rendered;this.rendered=!1;for(var d=0;d<this.arguments_.length;d++){var f=this.getInput("ARG"+d);f&&(f=f.connection.targetConnection,this.quarkConnections_[this.quarkIds_[d]]=
- f,e&&f&&-1==b.indexOf(this.quarkIds_[d])&&(f.disconnect(),f.getSourceBlock().bumpNeighbours_()))}this.arguments_=[].concat(a);this.updateShape_();if(this.quarkIds_=b)for(d=0;d<this.arguments_.length;d++)e=this.quarkIds_[d],e in this.quarkConnections_&&(f=this.quarkConnections_[e],Blockly.Mutator.reconnect(f,this,"ARG"+d)||delete this.quarkConnections_[e]);(this.rendered=c)&&this.render()}},updateShape_:function(){for(var a=0;a<this.arguments_.length;a++)if(""!=this.arguments_[a]){var b=this.getField("ARGNAME"+
- a);if(b){Blockly.Events.disable();try{b.setValue(this.arguments_[a])}finally{Blockly.Events.enable()}}else b=new Blockly.FieldLabel(this.arguments_[a]),b=this.appendValueInput("ARG"+a).setAlign(Blockly.ALIGN_RIGHT).appendField(b,"ARGNAME"+a),b.init()}else this.getInput("ARG"+a)||(b=this.appendValueInput("ARG"+a).setAlign(Blockly.ALIGN_RIGHT),b.init());for(;this.getInput("ARG"+a);)this.removeInput("ARG"+a),a++},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]);a.appendChild(c)}return a},domToMutation:function(a){var b=a.getAttribute("name");this.renameProcedure(this.getProcedureCall(),b);b=[];for(var c=[],e=0,d;d=a.childNodes[e];e++)"arg"==d.nodeName.toLowerCase()&&(b.push(d.getAttribute("name")),c.push(d.getAttribute("paramId")));this.setProcedureParameters_(b,c)},renameVar:function(a,b){for(var c=0;c<this.arguments_.length;c++)if(Blockly.Names.equals(a,
- this.arguments_[c])){this.arguments_[c]=b;var e=this.getField("ARGNAME"+c);e&&e.setValue(b)}},onchange:function(a){},customContextMenu:function(a){var b={enabled:!0};b.text=Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF;var c=this.getProcedureCall(),e=this.workspace;b.callback=function(){var a=Blockly.Procedures.getDefinition(c,e);a&&a.select()};a.push(b)},defType_:"procedures_defnoreturn"};
- Blockly.Blocks.procedures_callreturn={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME");this.setOutput(!0);this.setColour(Blockly.Blocks.procedures.HUE);this.setHelpUrl(Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL);this.arguments_=[];this.quarkConnections_={};this.quarkIds_=null},getProcedureCall:Blockly.Blocks.procedures_callnoreturn.getProcedureCall,renameProcedure:Blockly.Blocks.procedures_callnoreturn.renameProcedure,setProcedureParameters_:Blockly.Blocks.procedures_callnoreturn.setProcedureParameters_,
- updateShape_:Blockly.Blocks.procedures_callnoreturn.updateShape_,mutationToDom:Blockly.Blocks.procedures_callnoreturn.mutationToDom,domToMutation:Blockly.Blocks.procedures_callnoreturn.domToMutation,renameVar:Blockly.Blocks.procedures_callnoreturn.renameVar,onchange:Blockly.Blocks.procedures_callnoreturn.onchange,setReturn:Blockly.Blocks.procedures_callnoreturn.setReturn,customContextMenu:Blockly.Blocks.procedures_callnoreturn.customContextMenu,defType_:"procedures_defreturn"};
- Blockly.Blocks.procedures_ifreturn={init:function(){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.setColour(Blockly.Blocks.procedures.HUE);this.setTooltip(Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_IFRETURN_HELPURL);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(a){if(!this.workspace.isDragging()){a=!1;var b=this;do{if(-1!=this.FUNCTION_TYPES.indexOf(b.type)){a=!0;break}b=b.getSurroundParent()}while(b);a?
- (this.setWarningText(null),this.isInFlyout||this.setDisabled(!1)):(this.setWarningText(Blockly.Msg.PROCEDURES_IFRETURN_WARNING),this.isInFlyout||this.getInheritedDisabled()||this.setDisabled(!0))}},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn"]};
- Blockly.Blocks.procedures_return={init:function(){this.setHelpUrl("http://c2.com/cgi/wiki?GuardClause");this.setColour(Blockly.Blocks.procedures.HUE);this.appendValueInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);this.setInputsInline(!1);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP);this.hasReturnValue_=!0},onchange:function(){if(this.workspace){var a=!1,b=this;do{if("procedures_defnoreturn"==b.type||"procedures_defreturn"==
- b.type){a=!0;break}b=b.getSurroundParent()}while(b);a?this.setWarningText(null):this.setWarningText(Blockly.Msg.PROCEDURES_IFRETURN_WARNING)}}};
- Blockly.Blocks.procedures_main={init:function(){this.setColour(Blockly.Blocks.procedures.HUE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_MAINFUNCTION);this.setStatements_(!0);this.statementConnection_=null},setStatements_:function(a){this.hasStatements_!==a&&(a?this.appendStatementInput("STACK"):this.removeInput("STACK",!0),this.hasStatements_=a)}};Blockly.Blocks.requests={};Blockly.Blocks.requests.HUE="#33cc99";Blockly.Blocks.request_import={init:function(){this.setColour(Blockly.Blocks.requests.HUE);this.appendDummyInput().appendField(Blockly.Msg.REQUEST_IMPORT);this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.request_post={init:function(){this.setColour(Blockly.Blocks.requests.HUE);this.appendDummyInput().appendField(Blockly.Msg.REQUEST_POST_DATATYPE);this.appendDummyInput().appendField(Blockly.Msg.REQUEST_SET_URL).appendField(new Blockly.FieldTextInput("http://192.168.4.1/get"),"URL");this.appendValueInput("DATA").appendField(Blockly.Msg.REQUEST_DATA);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.set_create={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_CREATE_WITH_HELPURL);this.setColour(Blockly.Blocks.lists.HUE);this.itemCount_=3;this.updateShape_();this.setOutput(!0,"Set");this.setInputsInline(!0);this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_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_()},updateShape_:PLUS_MINUS_updateShape("ADD",
- "create set of")};Blockly.Blocks.System={};Blockly.Blocks.System.HUE="#6cb7b3";Blockly.Blocks.System_import={init:function(){this.setColour(Blockly.Blocks.System.HUE);this.appendDummyInput().appendField(Blockly.Msg.SYSTEM_IMPORT);this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.System_exit={init:function(){this.setColour(Blockly.Blocks.System.HUE);this.appendDummyInput().appendField(Blockly.Msg.SYSTEM_EXIT).appendField(new Blockly.FieldTextInput("1"),"TEXT_INPUT");this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.System_dot={init:function(){this.setColour(Blockly.Blocks.System.HUE);this.appendValueInput("INPUT1").appendField("");this.appendValueInput("INPUT2").appendField(".");this.setInputsInline(!0);this.setOutput(!0)}};Blockly.Blocks.texts={};Blockly.Blocks.texts.HUE=150;var UTILITY_HUE=20;
- 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");var a=this;this.setTooltip(function(){var b=a.getParent();return b&&b.getInputsInline()&&b.tooltip||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.itemCount_=2;this.updateShape_();this.setOutput(!0,"String");this.setMutator(new Blockly.Mutator(["text_create_join_item"]));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=a.newBlock("text_create_join_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("text_create_join_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;
- c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||
- this.appendDummyInput("EMPTY").appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1));for(var a=0;a<this.itemCount_;a++)if(!this.getInput("ADD"+a)){var b=this.appendValueInput("ADD"+a);0==a&&b.appendField(Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH)}for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++},newQuote_:Blockly.Blocks.text.newQuote_};
- 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"))})}};
- 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})}};
- 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})}};
- 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);var b=this;this.setTooltip(function(){return Blockly.Msg.TEXT_INDEXOF_TOOLTIP.replace("%1",b.workspace.options.oneBasedIndex?"0":"-1")})}};
- 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);var a=this;this.setTooltip(function(){var b=a.getFieldValue("WHERE"),c=Blockly.Msg.TEXT_CHARAT_TOOLTIP;if("FROM_START"==b||"FROM_END"==b)c+=" "+("FROM_START"==b?Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP:Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",a.workspace.options.oneBasedIndex?"#1":"#0");return c})},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 c="FROM_START"==b||"FROM_END"==b;if(c!=a){var d=this.sourceBlock_;d.updateAt_(c);d.setFieldValue(b,"WHERE");return null}});this.getInput("AT").appendField(b,"WHERE")}};
- 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 d="FROM_START"==c||"FROM_END"==c;if(d!=b){var e=this.sourceBlock_;e.updateAt_(a,d);e.setFieldValue(c,"WHERE"+a);return null}});this.getInput("AT"+a).appendField(c,"WHERE"+a);1==a&&this.moveInputBefore("AT1","AT2")}};
- 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)}};
- 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)}};
- 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:UTILITY_HUE,tooltip:Blockly.Msg.TEXT_PRINT_TOOLTIP,helpUrl:Blockly.Msg.TEXT_PRINT_HELPURL})}};
- 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){this.outputConnection.setCheck("NUMBER"==a?"Number":"String")},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("type",this.getFieldValue("TYPE"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("type"))}};
- 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");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_lower={init:function(){this.appendValueInput("TEXT_INPUT").appendField(Blockly.Msg.TEXT_LOWER);this.setOutput(!0,"String");this.setColour(Blockly.Blocks.texts.HUE);this.setInputsInline(!0)}};Blockly.Blocks.Thread={};Blockly.Blocks.Thread.HUE="#5cd3db";Blockly.Blocks.Thread_import={init:function(){this.setColour(Blockly.Blocks.Thread.HUE);this.appendDummyInput().appendField(Blockly.Msg.THREAD_IMPORT);this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.Thread_start_output={init:function(){this.setColour(Blockly.Blocks.Thread.HUE);this.appendValueInput("INPUT").appendField(Blockly.Msg.THREAD_THREADING);this.appendDummyInput().appendField(Blockly.Msg.THREAD_START);this.setInputsInline(!0);this.setOutput(!0)}};
- Blockly.Blocks.Thread_start_preNext={init:function(){this.setColour(Blockly.Blocks.Thread.HUE);this.appendValueInput("INPUT").appendField(Blockly.Msg.THREAD_THREADING);this.appendDummyInput().appendField(Blockly.Msg.THREAD_START);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.Thread_set_target={init:function(){this.setColour(Blockly.Blocks.Thread.HUE);this.appendValueInput("TARGET").appendField(Blockly.Msg.THREAD_SET_TARGET);this.setInputsInline(!0);this.setOutput(!0)}};Blockly.Blocks.tuple_create={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_CREATE_WITH_HELPURL);this.setColour(Blockly.Blocks.lists.HUE+10);this.itemCount_=3;this.updateShape_();this.setOutput(!0,"Tuple");this.setInputsInline(!0);this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_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_()},
- updateShape_:PLUS_MINUS_updateShape("ADD","create tuple of")};var Turtle_HUE=237;Blockly.Blocks.turtle_create={init:function(){this.appendDummyInput().appendField("create new turtle");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setOutput(!1);this.setInputsInline(!0);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.turtle_color={init:function(){this.appendValueInput("COLOR").setCheck(null).appendField("make turtle color");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setOutput(!1);this.setInputsInline(!0);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.turtle_forward={init:function(){this.appendValueInput("DISTANCE").setCheck(null).appendField("make turtle move forward by");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setInputsInline(!0);this.setOutput(!1);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.turtle_backward={init:function(){this.appendValueInput("DISTANCE").setCheck(null).appendField("make turtle move backward by");this.setPreviousStatement(!0);this.setInputsInline(!0);this.setNextStatement(!0);this.setOutput(!1);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.turtle_left={init:function(){this.appendValueInput("ANGLE").setCheck(null).appendField("make turtle turn left by");this.appendDummyInput("").appendField("degree");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setInputsInline(!0);this.setOutput(!1);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.turtle_right={init:function(){this.appendValueInput("ANGLE").setCheck(null).appendField("make turtle turn right by");this.appendDummyInput("").appendField("degree");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setInputsInline(!0);this.setOutput(!1);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.turtle_shape={init:function(){this.appendDummyInput().appendField("make turtle shape").appendField(new Blockly.FieldDropdown([["turtle","turtle"],["circle","circle"],["classic","classic"],["square","square"],["triangle","triangle"]]),"Shape");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.turtle_pen={init:function(){this.appendDummyInput().appendField("make turtle pen").appendField(new Blockly.FieldDropdown([["up","up"],["down","down"]]),"Pen");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.turtle_circle={init:function(){this.appendValueInput("RADIUS").setCheck("Number").appendField("make turtle circle with radius:");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.turtle_goto={init:function(){this.appendValueInput("X").setCheck("Number").appendField("make turtle goto location X:");this.appendValueInput("Y").setCheck("Number").appendField(",Y:");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.turtle_pos={init:function(){this.appendDummyInput().appendField("pos");this.setOutput(!0,"Turtle_Position");this.setColour(Turtle_HUE);this.setTooltip("Turtle position");this.setHelpUrl("")}};Blockly.Blocks.turtle_stamp={init:function(){this.appendDummyInput().appendField("make turtle stamp");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.turtle_begin_fill={init:function(){this.appendDummyInput().appendField("make turtle begin fill");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.turtle_end_fill={init:function(){this.appendDummyInput().appendField("make turtle end fill");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.turtle_speed={init:function(){this.appendValueInput("SPEED").setCheck("Number").appendField("make turtle speed");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Turtle_HUE);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.utility={};Blockly.Blocks.utility.HUE=160;Blockly.Blocks.raw_table={init:function(){this.setColour(Blockly.Blocks.utility.HUE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.appendDummyInput().appendField("Tabular Abstraction:");this.appendDummyInput().appendField(new Blockly.FieldTable(""),"TEXT")}};
- Blockly.Blocks.raw_block={init:function(){this.setColour(Blockly.Blocks.utility.HUE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.appendDummyInput().appendField("Code Block:");this.appendDummyInput().appendField(new Blockly.FieldTextArea(""),"TEXT")}};Blockly.Blocks.raw_expression={init:function(){this.setColour(Blockly.Blocks.utility.HUE);this.appendDummyInput().appendField("Code Expression:");this.appendDummyInput().appendField(new Blockly.FieldTextArea(""),"TEXT");this.setOutput(!0)}};
- Blockly.Blocks.raw_empty={init:function(){this.setColour(Blockly.Blocks.utility.HUE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.appendValueInput("VALUE").appendField("");this.setInputsInline(!1)}};Blockly.Blocks.text_comment={init:function(){this.setColour(Blockly.Blocks.utility.HUE);this.appendDummyInput().appendTitle("Comment:").appendTitle(new Blockly.FieldTextInput(""),"TEXT");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("This comment will be ignored by Python")}};
- Blockly.Blocks.type_check={init:function(){this.setColour(Blockly.Blocks.utility.HUE);this.appendValueInput("VALUE").appendField(Blockly.Msg.TYPE_CHECK);this.setInputsInline(!1);this.setOutput(!0,"Type")}};
- Blockly.Blocks.text_print_multiple={init:function(){this.setColour(Blockly.Blocks.utility.HUE);this.itemCount_=1;this.updateShape_();this.setPreviousStatement(!0);this.setNextStatement(!0);this.setMutator(new Blockly.Mutator(["text_print_multiple_item"]));this.setTooltip(Blockly.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(a){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_print_multiple_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=Blockly.Block.obtain(a,"text_print_multiple_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){a=a.getInputTargetBlock("STACK");for(var b=[],c=0;a;)b[c]=a.valueConnection_,a=a.nextConnection&&a.nextConnection.targetBlock(),c++;this.itemCount_=c;this.updateShape_();for(c=0;c<this.itemCount_;c++)b[c]&&
- this.getInput("PRINT"+c).connection.connect(b[c])},saveConnections:function(a){a=a.getInputTargetBlock("STACK");for(var b=0;a;){var c=this.getInput("PRINT"+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("PRINT"+a);)this.removeInput("PRINT"+a),a++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField("print");else for(a=
- 0;a<this.itemCount_;a++){var b=this.appendValueInput("PRINT"+a);0==a&&b.appendField("print")}}};Blockly.Blocks.text_print_multiple_container={init:function(){this.setColour(Blockly.Blocks.utility.HUE);this.appendDummyInput().appendField("print");this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.text_print_multiple_item={init:function(){this.setColour(Blockly.Blocks.utility.HUE);this.appendDummyInput().appendField("item");this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.function_call={init:function(){this.setColour(Blockly.Blocks.utility.HUE);this.itemCount_=1;this.hasReturn_=!1;this.appendDummyInput().appendField(new Blockly.FieldTextInput("str"),"NAME");this.updateShape_();this.setMutator(new Blockly.Mutator(["function_call_item"]));this.setTooltip("Can be used to call any function")},mutationToDom:function(a){a=document.createElement("mutation");a.setAttribute("items",this.itemCount_);a.setAttribute("hasReturn",this.hasReturn_?"TRUE":"FALSE");return a},
- domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);this.hasReturn_="TRUE"===a.getAttribute("hasReturn");this.updateShape_()},decompose:function(a){var b=Blockly.Block.obtain(a,"function_call_container");b.initSvg();b.setFieldValue(this.hasStatements_?"TRUE":"FALSE","RETURN");for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=Blockly.Block.obtain(a,"function_call_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},setReturn:function(a){this.unplug(!0,
- !0);this.setOutput(a);this.setPreviousStatement(!a);this.setNextStatement(!a);this.rendered&&this.render()},compose:function(a){for(var b=a.getInputTargetBlock("STACK"),c=[],e=0;b;)c[e]=b.valueConnection_,b=b.nextConnection&&b.nextConnection.targetBlock(),e++;this.itemCount_=e;this.hasReturn_="TRUE"===a.getFieldValue("RETURN");this.updateShape_();for(e=0;e<this.itemCount_;e++)c[e]&&this.getInput("ARGUMENT"+e).connection.connect(c[e])},saveConnections:function(a){a=a.getInputTargetBlock("STACK");for(var b=
- 0;a;){var c=this.getInput("ARGUMENT"+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("ARGUMENT"+a);)this.removeInput("ARGUMENT"+a),a++;for(a=0;a<this.itemCount_;a++)this.appendValueInput("ARGUMENT"+a);this.setReturn(this.hasReturn_)}};
- Blockly.Blocks.function_call_container={init:function(){this.setColour(Blockly.Blocks.utility.HUE);this.appendDummyInput().appendField("Arguments");this.appendStatementInput("STACK");this.appendDummyInput().setAlign(Blockly.ALIGN_RIGHT).appendField("has return").appendField(new Blockly.FieldCheckbox("TRUE"),"RETURN");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.function_call_item={init:function(){this.setColour(Blockly.Blocks.utility.HUE);this.appendDummyInput().appendField("argument");this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};Blockly.Blocks.variables={};Blockly.Blocks.variables.HUE=30;
- 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},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)}};
- 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.contextMenuMsg_=Blockly.Msg.VARIABLES_SET_CREATE_GET},contextMenuType_:"variables_get",customContextMenu:Blockly.Blocks.variables_get.customContextMenu};
- Blockly.Blocks.simple_variables_set={init:function(){this.jsonInit({message0:" ",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.contextMenuMsg_=Blockly.Msg.VARIABLES_SET_CREATE_GET},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(a,b){Blockly.Names.equals(a,
- this.getFieldValue("VAR"))&&this.setFieldValue(b,"VAR")},contextMenuType_:"variables_get",customContextMenu:Blockly.Blocks.variables_get.customContextMenu};Blockly.Blocks.variables_getself={init:function(){this.appendValueInput("VAR").appendField(Blockly.Msg.VARIABLES_GET_SELF);this.setOutput(!0);this.setColour(Blockly.Blocks.variables.HUE);this.setInputsInline(!0)}};
- Blockly.Blocks.variables_setself={init:function(){this.appendValueInput("VAR").appendField(Blockly.Msg.VARIABLES_SET_SELF);this.appendValueInput("TO").appendField(Blockly.Msg.VARIABLES_SET_SELF_TO);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.variables.HUE);this.setInputsInline(!0)}};Blockly.Blocks.visionkit={};Blockly.Blocks.visionkit.HUE="#2c4fc9";Blockly.Blocks.visionkit_setup={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField(new Blockly.FieldImage("./blockly/media/google_aiy_vision_kit_setup.png",140,60,"0"));this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_SETUP)}};
- Blockly.Blocks.visionkit_demo={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField(new Blockly.FieldImage("./blockly/media/google_aiy_vision_joy_demo.png",140,60,"0"));this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_JOY_DETECT);this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_CLOUDEVENT_API).appendField(new Blockly.FieldTextInput("yourCloudEventAPI"),"API")}};
- Blockly.Blocks.visionkit_import={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendValueInput("IMPORT").appendField(Blockly.Msg.VISIONKIT_IMPORT).appendField(new Blockly.FieldDropdown([["AIY.Vision.Inference","aiy.vision.inference"],["AIY.Vision.Models","aiy.vision.models"],["AIY.Vision.Annotator","aiy.vision.annotator"]]),"FROM");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.visionkit_import_annotator={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_IMPORT_ANNOTATOR).appendField(new Blockly.FieldDropdown([["Annotator","Annotator"]]),"IMPORT");this.setOutput(!0)}};
- Blockly.Blocks.visionkit_import_models={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_IMPORT_MODELS).appendField(new Blockly.FieldDropdown([["Face Detection","face_detection"]]),"IMPORT");this.setOutput(!0)}};
- Blockly.Blocks.visionkit_import_inference={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_IMPORT_INFERENCE).appendField(new Blockly.FieldDropdown([["Camera Inference","CameraInference"]]),"IMPORT");this.setOutput(!0)}};
- Blockly.Blocks.visionkit_cameraInference={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_AIY_VISION_INFERENCE);this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_CAMERA_INFERENCE).appendField(new Blockly.FieldTextInput("inference"),"INFERENCE");this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_USE_MODEL).appendField(new Blockly.FieldDropdown([["Face Detection","face_detection.model()"]]),"USEMODEL");this.appendStatementInput("STACK").appendField(Blockly.Msg.VISIONKIT_DO);
- this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.visionkit_runInference={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendValueInput("INPUT").appendField(Blockly.Msg.VISIONKIT_RUN_INFERENCE);this.setInputsInline(!0);this.setOutput(!0)}};
- Blockly.Blocks.visionkit_GetInference={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_GETINFERENCE).appendField(new Blockly.FieldDropdown([["Count","count"],["Rate","rate"]]),"INFERENCE");this.setOutput(!0)}};
- Blockly.Blocks.visionkit_faceDetection_operation={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendValueInput("INPUT").appendField(Blockly.Msg.VISIONKIT_IMPORT).appendField(new Blockly.FieldDropdown([["Face Detection","face_detection"]]),"MODEL").appendField(Blockly.Msg.VISISONKIT_MODEL).appendField(new Blockly.FieldDropdown([["Get Faces","get_faces"]]),"OPERATION");this.setOutput(!0)}};
- Blockly.Blocks.visionkit_model_get={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendValueInput("INPUT").appendField(Blockly.Msg.VISIONKIT_GETMODEL_MODEL).appendField(new Blockly.FieldDropdown([["Bounding Box","bounding_box"],["Joy Score","joy_score"]]),"MODEL").appendField(Blockly.Msg.VISIONKIT_GETMODEL_OF);this.setInputsInline(!0);this.setOutput(!0)}};
- Blockly.Blocks.visionkit_Use_Annotator={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_ANNOTATOR).appendField(new Blockly.FieldTextInput("camera"),"ANNOTATOR").appendField(Blockly.Msg.VISIONKIT_ANNOTATOR_SETTING).appendField(new Blockly.FieldTextInput("320"),"X-DIMEN").appendField(",").appendField(new Blockly.FieldTextInput("240"),"Y-DIMEN");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.visionkit_Use_Annotator_output={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_ANNOTATOR).appendField(new Blockly.FieldTextInput("camera"),"ANNOTATOR").appendField(Blockly.Msg.VISIONKIT_ANNOTATOR_SETTING).appendField(new Blockly.FieldTextInput("320"),"X-DIMEN").appendField(",").appendField(new Blockly.FieldTextInput("240"),"Y-DIMEN");this.setOutput(!0)}};
- Blockly.Blocks.visionkit_Annotator_operation={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_ANNOTATOR).appendField(new Blockly.FieldDropdown([["Clear","clear"],["Update","update"]]),"OPERATION");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.visionkit_Annotator_Bounding={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VISIONKIT_ANNOTATOR_BOUNDING);this.appendValueInput("INPUT").appendField(Blockly.Msg.VISIONKIT_ANNOTATOR_FILL).appendField(new Blockly.FieldNumber("1"),"FILL");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.visionkit_myAssistant={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField("MyAssistant");this.setOutput(!0)}};Blockly.Blocks.visionkit_import_aiy={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField("import AIY Vision Kit Modules");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.visionkit_avg_joy_score={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField("Define Average Joy Score Demo");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.visionkit_annotator_camera={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField("Annotator(camera,dimensions=(").appendField(new Blockly.FieldTextInput("320"),"X").appendField(",").appendField(new Blockly.FieldTextInput("240"),"Y").appendField(")");this.appendDummyInput().appendField("Scale_x").appendField(new Blockly.FieldTextInput("1640"),"SCALE_X").appendField("Scale_y").appendField(new Blockly.FieldTextInput("1232"),"SCALE_Y");this.setPreviousStatement(!0);
- this.setNextStatement(!0)}};Blockly.Blocks.visionkit_transform_boundingBox={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField("Define Bounding Box Transform");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.visionkit_CameraInference={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField("Camera Inference set ").appendField(new Blockly.FieldDropdown([["Face Detection","Face Detection"]]),"SETTING");this.appendStatementInput("STACK");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.visionkit_avg_joy_score_num={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField("avg_joy_score(").appendField(new Blockly.FieldTextInput("faces"),"FACE").appendField(")");this.setOutput(!0)}};Blockly.Blocks.visionkit_face={init:function(){this.setColour(Blockly.Blocks.visionkit.HUE);this.appendDummyInput().appendField("faces");this.setOutput(!0)}};Blockly.Blocks.voicekit={};Blockly.Blocks.voicekit.HUE="#3382f5";Blockly.Blocks.voicekit_from={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendValueInput("INPUT").appendField(Blockly.Msg.VOICEKIT_FROM).appendField(new Blockly.FieldDropdown([["aiy.voice","aiy.vocie"],["aiy.assistant","aiy.assistant"],["aiy.assistant.library","aiy.assistant.library"],["google.assistant.library.event","google.assistant.library.event"]]),"FROM");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.voicekit_import={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VOICEKIT_IMPORT_AUTH);this.setOutput(!0)}};Blockly.Blocks.voicekit_import_tts={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VOICEKIT_IMPORT_TTS);this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.voicekit_tts_say={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendValueInput("TEXT").appendField(Blockly.Msg.VOICEKIT_IMPORT_TTS_SAY);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.voicekit_set_credential={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendValueInput("INPUT").appendField(Blockly.Msg.VOICEKIT_SET_CREDENTIAL).appendField(new Blockly.FieldTextInput("assistant"),"ASSISTANT").appendField(Blockly.Msg.VOICEKIT_SET_FROM);this.appendStatementInput("STACK").appendField(Blockly.Msg.VOICEKIT_SET_DO);this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.voicekit_get_credential={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VOICEKIT_GET_CREDENTIAL);this.setOutput(!0)}};Blockly.Blocks.voicekit_import_assistant={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VOICEKIT_IMPORT_ASSISTANT);this.setOutput(!0)}};
- Blockly.Blocks.voicekit_assistant_preNext={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendValueInput("INPUT").appendField(Blockly.Msg.VOICEKIT_ASSISTANT);this.appendDummyInput().appendField(new Blockly.FieldDropdown([["stop conversation","stop_conversation()"],["start conversation","start_conversation()"]]),"OPERATION");this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.voicekit_assistant_output={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendValueInput("INPUT").appendField(Blockly.Msg.VOICEKIT_ASSISTANT);this.appendDummyInput().appendField(new Blockly.FieldDropdown([["stop conversation","stop_conversation()"],["start conversation","start_conversation()"]]),"OPERATION");this.setInputsInline(!0);this.setOutput(!0)}};
- Blockly.Blocks.voicekit_EventType_import={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VOICEKIT_EVENTTYPE_IMPORT);this.setOutput(!0)}};Blockly.Blocks.voicekit_event_of={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendValueInput("INPUT").appendField(Blockly.Msg.VOICEKIT_EVENT_TYPE_OF);this.setInputsInline(!0);this.setOutput(!0)}};
- Blockly.Blocks.voicekit_run_task={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("_run_task");this.setOutput(!0)}};Blockly.Blocks.voicekit_process_event={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("_process_event");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.voicekit_assistant_start_conversation={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("self_assistant.start_conversation()");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.voicekit_send_instructions={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("send_instructions");this.appendValueInput("TEXT").appendField("text").setAlign(Blockly.ALIGN_RIGHT);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.voicekit_on_button_pressed={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("on_button_pressed");this.setOutput(!0)}};
- Blockly.Blocks.voicekit_import_aiy={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("import AIY Voice Moudles");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.voicekit_init={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("Voicekit Kit");this.appendDummyInput().appendField("Assistant Initialization");this.itemCount_=1;this.updateShape_();this.setMutator(new Blockly.Mutator(["voicekit_init_item"]));this.setPreviousStatement(!0);this.setNextStatement(!0)},mutationToDom:function(a){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,"voicekit_init_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=Blockly.Block.obtain(a,"voicekit_init_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){a=a.getInputTargetBlock("STACK");for(var b=[],c=0;a;)b[c]=a.valueConnection_,a=a.nextConnection&&a.nextConnection.targetBlock(),c++;this.itemCount_=
- c;this.updateShape_();for(c=0;c<this.itemCount_;c++)b[c]&&this.getInput("ADD"+c).connection.connect(b[c])},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++;for(a=0;a<this.itemCount_;a++)this.appendValueInput("ADD"+
- a)}};Blockly.Blocks.voicekit_init_container={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("field");this.appendStatementInput("STACK");this.contextMenu=!1}};Blockly.Blocks.voicekit_init_item={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("item");this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.contextMenu=!1}};
- Blockly.Blocks.voicekit_task={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("Task Tread");this.setOutput(!0)}};Blockly.Blocks.voicekit_can_start={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("Converstation");this.setOutput(!0)}};Blockly.Blocks.voicekit_asssistant={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("Assistant");this.setOutput(!0)}};
- Blockly.Blocks.voicekit_start_thread={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("Start task");this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.voicekit_runTask={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("Run task");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.voicekit_logging_config={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("logging.basicConfig(level = logging.INFO)");this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.voicekit_myassistant_start={init:function(){this.setColour(230);this.appendDummyInput().appendField(new Blockly.FieldTextInput("MyAssistant"),"INPUT").appendField(".start()");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.voicekit_process_event={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("Process Event");this.appendStatementInput("STACK");this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.voicekit_process_eventType={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField("Event.type");this.setOutput(!0)}};
- Blockly.Blocks.voicekit_EventType_select={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VOICEKIT_EVENTTYPE_ASSISTANT);this.appendDummyInput().appendField(new Blockly.FieldDropdown([["ON_START_FINISHED","ON_START_FINISHED"],["ON_CONVERSATION_TURN_STARTED","ON_CONVERSATION_TURN_STARTED"],["ON_RECOGNIZING_SPEECH_FINISHED","ON_RECOGNIZING_SPEECH_FINISHED"],["ON_END_OF_UTTERANCE","ON_END_OF_UTTERANCE"],["ON_CONVERSATION_TURN_FINISHED","ON_CONVERSATION_TURN_FINISHED"],
- ["ON_ASSISTANT_ERROR","ON_ASSISTANT_ERROR"],["ON_CONVERSATION_TURN_TIMEOUT","ON_CONVERSATION_TURN_TIMEOUT"],["ON_NO_RESPONSE","ON_NO_RESPONSE"]]),"TYPE");this.setOutput(!0)}};Blockly.Blocks.voicekit_can_start_conversation_self={init:function(){this.setColour("#ff6381");this.appendDummyInput().appendField("Can start conversation");this.setOutput(!0)}};
- Blockly.Blocks.voicekit_can_start_conversation={init:function(){this.setColour("#ff6381");this.appendDummyInput().appendField("Can start conversation =").appendField(new Blockly.FieldDropdown([["True","True"],["False","False"]]),"SETTING");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.voicekit_assistant_conversation={init:function(){this.setColour("#ff6381");this.appendDummyInput().appendField("Assistant.").appendField(new Blockly.FieldDropdown([["stop_conversation","stop_conversation()"],["start_conversation","start_conversation()"]]),"SETTING");this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.voicekit_event_args={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VOICEKIT_EVENT_ARGS);this.setInputsInline(!0);this.setOutput(!0)}};
- Blockly.Blocks.voicekit_event_args_of={init:function(){this.setColour(Blockly.Blocks.voicekit.HUE);this.appendDummyInput().appendField(Blockly.Msg.VOICEKIT_EVENT_ARGS).appendField(Blockly.Msg.VOICEKIT_EVENT_OF).appendField(new Blockly.FieldTextInput("text"),"TEXT");this.setInputsInline(!0);this.setOutput(!0)}};Blockly.Blocks.basic101={};Blockly.Blocks.basic101.hue=15;Blockly.Blocks.read_button={init:function(){this.interpolate_(Blockly.Msg.BASIC_READBUTTON,[{type:"input_value",name:"PINSNUM",check:Blockly.Types.NUMBER.checkList}]);this.setInputsInline(!0);this.setOutput(!0,Blockly.Types.BOOLEAN.output);this.setColour(Blockly.Blocks.basic101.hue);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.BOOLEAN}};
- Blockly.Blocks.basic101_dropdown_button={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown([["8","8"],["9","9"],["12","12"],["13","13"]]),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.read_knob={init:function(){this.interpolate_(Blockly.Msg.BASIC_READKNOB,[{type:"input_value",name:"PINSNUM",check:Blockly.Types.NUMBER.checkList}]);this.setInputsInline(!0);this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.basic101.hue);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.basic101_dropdown_knob={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown([["A3","A3"]]),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.analog_light={init:function(){this.interpolate_(Blockly.Msg.BASIC_SETANALOGLED,[{type:"input_value",name:"PINSNUM",check:Blockly.Types.NUMBER.checkList},{type:"input_value",name:"BRIGHTNESS",check:Blockly.Types.NUMBER.checkList}]);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.basic101.hue);this.setTooltip("");this.setHelpUrl("")},onchange:function(){var a=Blockly.Python.valueToCode(this,"BRIGHTNESS",Blockly.Python.ORDER_ATOMIC);
- 255<a||0>a?this.setWarningText(Blockly.Msg.BASIC_LIGHT_WARNING,"light"):this.setWarningText(null,"light")},getBlockType:function(){return Blockly.Types.NUMBER}};Blockly.Blocks.basic101_dropdown_analog_light={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown([["3","3"],["5","5"],["6","6"]]),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.digital_light={init:function(){this.interpolate_(Blockly.Msg.BASIC_SETDIGITALLED,[{type:"input_value",name:"PINSNUM",check:Blockly.Types.NUMBER.checkList}]);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.basic101.hue);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.basic101_dropdown_digital_light={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"]]),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.nolight={init:function(){this.interpolate_(Blockly.Msg.BASIC_NOLCD,[{type:"input_value",name:"PINSNUM",check:Blockly.Types.NUMBER.checkList}]);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.basic101.hue);this.setTooltip();this.setHelpUrl("")}};
- Blockly.Blocks.basic101_dropdown_nolight={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"]]),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.tone={init:function(){this.interpolate_(Blockly.Msg.BASIC_SETTONE,[{type:"input_value",name:"PINSNUM",check:Blockly.Types.NUMBER.checkList},{type:"input_value",name:"FREQUENCY",check:Blockly.Types.NUMBER.checkList}]);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.basic101.hue);this.setTooltip(Blockly.Msg.BASIC_TONE_TIP);this.setHelpUrl("https://www.arduino.cc/en/Reference/tone")},onchange:function(){var a=Blockly.Python.valueToCode(this,
- "FREQUENCY",Blockly.Python.ORDER_ATOMIC);31>a||65535<a?this.setWarningText(Blockly.Msg.BASIC_TONE_WARNING,"io_tone"):this.setWarningText(null,"io_tone")},getBlockType:function(){return Blockly.Types.NUMBER}};Blockly.Blocks.basic101_dropdown_tone={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown([["11","11"]]),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.notone={init:function(){this.interpolate_(Blockly.Msg.BASIC_NOTONE,[{type:"input_value",name:"PINSNUM",check:Blockly.Types.NUMBER.checkList}]);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.basic101.hue);this.setTooltip(Blockly.Msg.BASIC_NOTONE_TIP);this.setHelpUrl("https://www.arduino.cc/en/Reference/noTone")}};
- Blockly.Blocks.basic101_dropdown_notone={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown([["11","11"]]),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.basic101_dropdown_digital={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.basic101_dropdown_analog={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.analogPins),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.basic101_dropdown_pwm={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.pwmPins),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.counter_button_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-sensor101-counter.png",50,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.BASIC_COUNTER_SETUP);this.appendDummyInput().appendField(Blockly.Msg.BASIC_COUNTER_SETTING).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins),"PINSNUM");this.setColour(Blockly.Blocks.basic101.hue);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.read_counter={init:function(){this.interpolate_(Blockly.Msg.BASIC_READCOUNTER,[{type:"input_value",name:"PINSNUM",check:Blockly.Types.NUMBER.checkList}]);this.setInputsInline(!0);this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.basic101.hue);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.basic101_counter_dropdown_button={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown([["8","8"],["9","9"]]),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};Blockly.Blocks.bluetooth={};Blockly.Blocks.bluetooth.HUE=230;
- Blockly.Blocks.bluetooth_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-bluetooth.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_SETUP).appendField(new Blockly.FieldDropdown([[Blockly.Msg.BLUETOOTH_SETUP_OPT1,"string"],[Blockly.Msg.BLUETOOTH_SETUP_OPT2,"number"],[Blockly.Msg.BLUETOOTH_SETUP_OPT3,"array"]]),"OPTIONS");this.appendDummyInput("VAR").appendField(Blockly.Msg.BLUETOOTH_SETUP_DATA_SET).appendField(new Blockly.FieldVariable("command"),"CMDVAR").appendField(Blockly.Msg.BLUETOOTH_SETUP_TO);
- this.appendDummyInput("BAUDSETTING").appendField(Blockly.Msg.BLUETOOTH_SETUP_SET).appendField(new Blockly.FieldDropdown([["38400","38400"],["9600","9600"]]),"BAUD");this.appendStatementInput("RECEIVED_DO").setCheck(null).appendField(Blockly.Msg.BLUETOOTH_SETUP_DO);this.getVarType();this.setColour(Blockly.Blocks.bluetooth.HUE);this.setTooltip("");this.setHelpUrl("")},getVarType:function(a){a=Blockly.Types.UNDEF;this&&"string"===this.getFieldValue("OPTIONS")?a=Blockly.Types.TEXT:this&&"number"===this.getFieldValue("OPTIONS")?
- a=Blockly.Types.NUMBER:this&&"array"===this.getFieldValue("OPTIONS")&&(a=Blockly.Types.ARRAY);return a},onchange:function(){this&&"array"===this.getFieldValue("OPTIONS")?this.getInput("VARLENGTH")||(this.appendDummyInput("VARLENGTH").appendField(Blockly.Msg.BLUETOOTH_SETUP_LIST_SETTING).appendField(new Blockly.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]]),"LENGTH"),this.moveInputBefore("VARLENGTH","BAUDSETTING")):this.getInput("VARLENGTH")&&
- this.removeInput("VARLENGTH")}};
- Blockly.Blocks.bluetooth_text_getCommand={init:function(){this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_TEXT_RECEIVED).appendField(new Blockly.FieldVariable("command"),"VAR");this.setColour(Blockly.Blocks.bluetooth.HUE);this.setOutput(!0);this.setTooltip("");this.setHelpUrl("")},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)},getBlockType:function(){return Blockly.Types.TEXT},getVarType:function(a){return Blockly.Types.TEXT}};
- Blockly.Blocks.bluetooth_number_getCommand={init:function(){this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_NUMBER_RECEIVED).appendField(new Blockly.FieldVariable("command"),"VAR");this.setColour(Blockly.Blocks.bluetooth.HUE);this.setOutput(!0);this.setTooltip("");this.setHelpUrl("")},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)},getBlockType:function(){return Blockly.Types.NUMBER},getVarType:function(a){return Blockly.Types.NUMBER}};
- Blockly.Blocks.bluetooth_list_getCommand={init:function(){this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_LIST_RECEIVED).appendField(new Blockly.FieldVariable("command"),"VAR").appendField(Blockly.Msg.BLUETOOTH_LIST_RECEIVED1).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]]),"INDEX").appendField(Blockly.Msg.BLUETOOTH_LIST_RECEIVED2);this.setColour(Blockly.Blocks.bluetooth.HUE);this.setOutput(!0);
- this.setTooltip("");this.setHelpUrl("")},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)},getBlockType:function(){return Blockly.Types.NUMBER},getVarType:function(a){return Blockly.Types.NUMBER}};
- Blockly.Blocks.bluetooth_intercomms_send={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-bluetooth_comm.png",50,40,"0"));this.appendDummyInput().appendField("New "+Blockly.Msg.BLUETOOTH_INTERCOMMS_SETUP);this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_PAIRING_SETTING_BAUDRATE).appendField(new Blockly.FieldDropdown([["9600","9600"],["38400","38400"]]),"BAUD");this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_INTERCOMMS_SENDMSG);
- this.appendValueInput("ADD0").appendField(Blockly.Msg.BLUETOOTH_INTERCOMMS_DATA).setAlign(Blockly.ALIGN_RIGHT);this.setColour(145);this.setTooltip("");this.setHelpUrl("");this.setPreviousStatement(!0);this.setNextStatement(!0);this.itemCount_=1;this.updateShape_();this.setMutator(new Blockly.Mutator(["bluetooth_intercomms_create_with_item"]))},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=a.newBlock("bluetooth_intercomms_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("bluetooth_intercomms_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();
- for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+
- a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.BLUETOOTH_INTERCOMMS_DATA+a).setAlign(Blockly.ALIGN_RIGHT);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};Blockly.Blocks.bluetooth_intercomms_create_with_container={init:function(){this.setColour(215);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.bluetooth_intercomms_create_with_item={init:function(){this.setColour(215);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.bluetooth_intercomms_receive={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-bluetooth_comm.png",50,40,"0"));this.appendDummyInput().appendField("New "+Blockly.Msg.BLUETOOTH_INTERCOMMS_SETUP);this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_PAIRING_SETTING_BAUDRATE).appendField(new Blockly.FieldDropdown([["9600","9600"],["38400","38400"]]),"BAUD");this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_PAIRING_SETTING_TIMEOUT).appendField(new Blockly.FieldTextInput("50"),
- "TIMEOUT");this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_INTERCOMMS_RECEIVEMSG);this.appendDummyInput().appendField(" "+Blockly.Msg.BLUETOOTH_INTERCOMMS_RECEIVE_LINE3).appendField(new Blockly.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"]]),"LENGTH");this.setColour(145);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")},getVarType:function(a){return Blockly.Types.ARRAY},
- getBlockType:function(){switch(this.getFieldValue("TYPE")){case "":return Blockly.Types.TEXT;case ".toFloat()":return Blockly.Types.LARGE_NUMBER}return Blockly.Types.NUMBER}};
- Blockly.Blocks.bluetooth_intercomms_receive_getData={init:function(){this.appendDummyInput().appendField(" "+Blockly.Msg.BLUETOOTH_INTERCOMMS_RECEIVE_GET_LINE2).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"INDEX").appendField(" "+Blockly.Msg.BLUETOOTH_INTERCOMMS_RECEIVE_GET_LINE3).appendField(new Blockly.FieldDropdown([["String",""],["Number",".toInt()"],["Float",".toFloat()"]]),
- "TYPE").appendField(" "+Blockly.Msg.BLUETOOTH_INTERCOMMS_RECEIVE_GET_LINE4);this.setColour(145);this.setOutput(!0);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){switch(this.getFieldValue("TYPE")){case "":return Blockly.Types.TEXT;case ".toFloat()":return Blockly.Types.LARGE_NUMBER}return Blockly.Types.NUMBER},getOutputType:function(){switch(this.getFieldValue("TYPE")){case "":return Blockly.Types.TEXT.output;case ".toFloat()":return Blockly.Types.LARGE_NUMBER.output}return Blockly.Types.NUMBER.output}};
- Blockly.Blocks.bluetooth_intercomms_send_old={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-bluetooth_comm.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_INTERCOMMS_SETUP);this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_PAIRING_SETTING_BAUDRATE).appendField(new Blockly.FieldDropdown([["38400","38400"],["9600","9600"]]),"BAUD");this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_INTERCOMMS_SENDMSG);this.appendValueInput("ADD0").appendField(Blockly.Msg.BLUETOOTH_INTERCOMMS_DATA).setAlign(Blockly.ALIGN_RIGHT);
- this.setColour(215);this.setTooltip("");this.setHelpUrl("");this.setPreviousStatement(!0);this.setNextStatement(!0);this.itemCount_=1;this.updateShape_();this.setMutator(new Blockly.Mutator(["bluetooth_intercomms_create_with_item"]))},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=a.newBlock("bluetooth_intercomms_create_with_container");
- b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("bluetooth_intercomms_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;
- this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.BLUETOOTH_INTERCOMMS_DATA+a).setAlign(Blockly.ALIGN_RIGHT);
- for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};Blockly.Blocks.bluetooth_intercomms_create_with_container={init:function(){this.setColour(215);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.bluetooth_intercomms_create_with_item={init:function(){this.setColour(215);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.bluetooth_intercomms_receive_old={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-bluetooth_comm.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_INTERCOMMS_SETUP);this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_PAIRING_SETTING_BAUDRATE).appendField(new Blockly.FieldDropdown([["38400","38400"],["9600","9600"]]),"BAUD");this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_INTERCOMMS_RECEIVEMSG);
- this.appendDummyInput().appendField(" "+Blockly.Msg.BLUETOOTH_INTERCOMMS_RECEIVE_LINE3).appendField(new Blockly.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"]]),"LENGTH");this.setColour("215");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")},getVarType:function(a){return Blockly.Types.ARRAY}};
- Blockly.Blocks.bluetooth_intercomms_receive_getData_old={init:function(){this.appendDummyInput().appendField(" "+Blockly.Msg.BLUETOOTH_INTERCOMMS_RECEIVE_GET_LINE2).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"INDEX").appendField(" "+Blockly.Msg.BLUETOOTH_INTERCOMMS_RECEIVE_GET_LINE2_2);this.setColour("215");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setTooltip("");this.setHelpUrl("")},
- getBlockType:function(){return Blockly.Types.NUMBER}};Blockly.Blocks.bluetooth_at_slave={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/at_mode.png",120,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_PAIRING_SLAVE);this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_PAIRING_SETTING_BAUDRATE).appendField(new Blockly.FieldDropdown([["38400","38400"],["9600","9600"]]),"BAUD");this.setColour("#5d67a0");this.setTooltip("")}};
- Blockly.Blocks.bluetooth_at_master={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/at_mode.png",120,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_PAIRING_MASTER);this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_PAIRING_BIND_ADDR).appendField(new Blockly.FieldTextInput("98d3:81:fd6a96"),"ADDR");this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_PAIRING_SETTING_BAUDRATE).appendField(new Blockly.FieldDropdown([["38400",
- "38400"],["9600","9600"]]),"BAUD");this.setColour("#5d67a0");this.setTooltip("")}};
- Blockly.Blocks.bluetooth_at_interaction={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/at_mode.png",120,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_INTERACTION_TITLE);this.appendDummyInput().appendField(Blockly.Msg.BLUETOOTH_INTERACTION_SET_CONTENT).appendField(new Blockly.FieldDropdown([["9600","9600"],["38400","38400"],["115200","115200"]]),"bluetooth_at_interaction_baud");this.setColour("#5d67a0");this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.blynk={};Blockly.Blocks.blynk.hue="#3a545a";
- Blockly.Blocks.blynk_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/blynk_header.png",150,60,"15"));this.appendDummyInput().appendField(Blockly.Msg.BLYNK_SETUP);this.appendDummyInput().appendField(Blockly.Msg.BLYNK_AUTH).appendField(new Blockly.FieldTextInput("YourAuthToken"),"AUTH");this.appendDummyInput().appendField(Blockly.Msg.BLYNK_WIFI);this.appendDummyInput().appendField(Blockly.Msg.BLYNK_SSID).appendField(new Blockly.FieldTextInput("CocoRobo"),"SSID");
- this.appendDummyInput().appendField(Blockly.Msg.BLYNK_PW).appendField(new Blockly.FieldTextInput("CocoRobo"),"PW");this.setColour(Blockly.Blocks.blynk.hue);this.setTooltip("");this.setHelpUrl("")},onchange:function(){var a=this.getFieldValue("PW").length;0<a?20<a?this.setWarningText(Blockly.Msg.WIFINETWORK_PW_WARN,"blynk_pw"):this.setWarningText(null,"blynk_pw"):0==a&&0==a&&this.setFieldValue("cocorobo","PW");a=this.getFieldValue("AUTH");50<a.length&&this.setFieldValue(a.substring(0,50),"AUTH");a=
- this.getFieldValue("SSID");20<a.length&&this.setFieldValue(a.substring(0,20),"SSID");a=this.getFieldValue("PW");20<a.length&&this.setFieldValue(a.substring(0,20),"PW")}};
- Blockly.Blocks.blynk_write={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/blynk_header_down.png",150,60,"15"));this.appendDummyInput().appendField(" "+Blockly.Msg.BLYNK_SELECT).appendField(new Blockly.FieldDropdown([["Button","Button"],["Slider","Slider"],["Joystick","Joystick"],["zeRGBa","zeRGBa"],["Step","Step"],["Light(sensor)","Light"],["Gravity(sensor)","Gravity"],["Accelerometer(sensor)","Accelerometer"],["GPS(sensor)","GPS"]]),"MOD");this.appendDummyInput().appendField(" "+
- Blockly.Msg.BLYNK_WRITE).appendField(new Blockly.FieldDropdown([["V0","V0"],["V1","V1"],["V2","V2"],["V3","V3"],["V4","V4"],["V5","V5"],["V6","V6"],["V7","V7"],["V8","V8"],["V9","V9"],["V10","V10"],["V11","V11"]]),"PIN").appendField(Blockly.Msg.BLYNK_WRITE1);this.appendStatementInput("STATEMENT");this.setColour(Blockly.Blocks.blynk.hue);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.blynk_write_getData={init:function(){this.appendDummyInput("SELECT").appendField(Blockly.Msg.BLYNK_GET_DATANAME).appendField(new Blockly.FieldDropdown([["Button","Button"],["Slider","Slider"],["Step","Step"],["Light(sensor)","Light"]]),"MOD").appendField(Blockly.Msg.BLYNK_GET_OF);this.setInputsInline(!0);this.setColour(Blockly.Blocks.blynk.hue);this.setOutput(!0,"Number");this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.identifyNumber("1")}};
- Blockly.Blocks.blynk_write_getData_joystick={init:function(){this.appendDummyInput("SELECT").appendField(Blockly.Msg.BLYNK_GET_DATANAME).appendField(new Blockly.FieldDropdown([["Joystick","Joystick"]]),"MOD");this.appendDummyInput("INDEX2").appendField(Blockly.Msg.BLYNK_GET_OF1).appendField(new Blockly.FieldDropdown([["X","0"],["Y","1"]]),"SELINDEX").appendField(Blockly.Msg.BLYNK_GET_OF2);this.setInputsInline(!0);this.setColour(Blockly.Blocks.blynk.hue);this.setOutput(!0,"Number");this.setTooltip("");
- this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.identifyNumber("1")}};
- Blockly.Blocks.blynk_write_getData_zeRGBa={init:function(){this.appendDummyInput("SELECT").appendField(Blockly.Msg.BLYNK_GET_DATANAME).appendField(new Blockly.FieldDropdown([["zeRGBa","zeRGBa"]]),"MOD");this.appendDummyInput("INDEX1").appendField(Blockly.Msg.BLYNK_GET_OF1).appendField(new Blockly.FieldDropdown([["R","0"],["G","1"],["B","2"]]),"SELINDEX").appendField(Blockly.Msg.BLYNK_GET_OF2);this.setInputsInline(!0);this.setColour(Blockly.Blocks.blynk.hue);this.setOutput(!0,"Number");this.setTooltip("");
- this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.identifyNumber("1")}};
- Blockly.Blocks.blynk_write_getData_GraOrAcc={init:function(){this.appendDummyInput("SELECT").appendField(Blockly.Msg.BLYNK_GET_DATANAME).appendField(new Blockly.FieldDropdown([["Gravity(sensor)","Gravity"],["Accelerometer(sensor)","Accelerometer"]]),"MOD");this.appendDummyInput("INDEX1").appendField(Blockly.Msg.BLYNK_GET_OF1).appendField(new Blockly.FieldDropdown([["X","0"],["Y","1"],["Z","2"]]),"SELINDEX").appendField(Blockly.Msg.BLYNK_GET_OF2);this.setInputsInline(!0);this.setColour(Blockly.Blocks.blynk.hue);
- this.setOutput(!0,"Number");this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.identifyNumber("1.000")}};
- Blockly.Blocks.blynk_write_getData_GPS={init:function(){this.appendDummyInput("SELECT").appendField(Blockly.Msg.BLYNK_GET_DATANAME).appendField(new Blockly.FieldDropdown([["GPS(sensor)","GPS"]]),"MOD");this.appendDummyInput("INDEX1").appendField(Blockly.Msg.BLYNK_GET_OF1).appendField(new Blockly.FieldDropdown([[Blockly.Msg.BLYNK_GPS_LATITUDE,"0"],[Blockly.Msg.BLYNK_GPS_LONGITUDE,"1"],[Blockly.Msg.BLYNK_GPS_ALTITUDE,"2"],[Blockly.Msg.BLYNK_GPS_SPEED,"3"]]),"SELINDEX").appendField(Blockly.Msg.BLYNK_GET_OF2);
- this.setInputsInline(!0);this.setColour(Blockly.Blocks.blynk.hue);this.setOutput(!0,"Number");this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.identifyNumber("1.000")}};
- Blockly.Blocks.blynk_read={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/blynk_header_up.png",150,60,"15"));this.appendDummyInput().appendField(" "+Blockly.Msg.BLYNK_SELECT).appendField(new Blockly.FieldDropdown([["Value Display","VD"],["Label Dispaly","LD"],["Gauge","GA"],["Level","LE"]]),"SELECT");this.appendDummyInput().appendField(" "+Blockly.Msg.BLYNK_READ).appendField(new Blockly.FieldDropdown([["V0","V0"],["V1","V1"],["V2","V2"],["V3","V3"],
- ["V4","V4"],["V5","V5"],["V6","V6"],["V7","V7"],["V8","V8"],["V9","V9"],["V10","V10"],["V11","V11"]]),"PIN").appendField(Blockly.Msg.BLYNK_READ1);this.appendValueInput("ADD0").appendField(Blockly.Msg.BLYNK_DATA+"01").setAlign(Blockly.ALIGN_RIGHT);this.setColour(Blockly.Blocks.blynk.hue);this.setPreviousStatement(!0);this.setNextStatement(!0);this.itemCount_=1;this.updateShape_();this.setMutator(new Blockly.Mutator(["blynk_create_with_item"]));this.setTooltip("");this.setHelpUrl("")},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=a.newBlock("blynk_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("blynk_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");
- for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.BLYNK_DATA+"0"+(a+1)).setAlign(Blockly.ALIGN_RIGHT);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};
- Blockly.Blocks.blynk_create_with_container={init:function(){this.setColour(Blockly.Blocks.blynk.hue);this.appendDummyInput().appendField(Blockly.Msg.BLYNK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.blynk_create_with_item={init:function(){this.setColour(Blockly.Blocks.blynk.hue);this.appendDummyInput().appendField(Blockly.Msg.BLYNK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.blynk_virtualWrite={init:function(){this.appendDummyInput().appendField(Blockly.Msg.BLYNK_VIRTUALWRITE).appendField(new Blockly.FieldDropdown([["V1","V1"],["V2","V2"],["V3","V3"],["V4","V4"],["V5","V5"],["V6","V6"],["V7","V7"],["V8","V8"],["V9","V9"],["V10","V10"],["V11","V11"]]),"PIN");this.appendValueInput("ADD0").appendField(Blockly.Msg.BLYNK_DATA+"01").setAlign(Blockly.ALIGN_RIGHT);this.setColour(Blockly.Blocks.blynk.hue);this.setPreviousStatement(!0);this.setNextStatement(!0);
- this.itemCount_=1;this.updateShape_();this.setMutator(new Blockly.Mutator(["blynk_create_with_item"]));this.setTooltip("");this.setHelpUrl("")},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=a.newBlock("blynk_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=
- a.newBlock("blynk_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.BLYNK_DATA+"0"+(a+1)).setAlign(Blockly.ALIGN_RIGHT);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};
- Blockly.Blocks.blynk_timer={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/blynk_time.png",150,60,"15"));this.appendDummyInput().appendField(Blockly.Msg.BLYNK_TIME_SETTING).appendField(new Blockly.FieldDropdown([["1","1000"],["2","2000"],["3","3000"],["4","4000"],["5","5000"],["6","6000"],["7","7000"],["8","8000"],["9","9000"],["10","10000"],["15","11000"],["30","30000"]]),"TIME").appendField(Blockly.Msg.BLYNK_TIME_SECOND);this.appendStatementInput("DO").appendField(Blockly.Msg.BLYNK_TIME_DO);
- this.setColour(Blockly.Blocks.blynk.hue);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.blynk_connect={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/blynk_header.png",150,60,"15"));this.appendDummyInput().appendField(Blockly.Msg.BLYNK_CONNECT);this.appendStatementInput("STATEMENT");this.setColour(Blockly.Blocks.blynk.hue);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.blynk_log={init:function(){this.appendDummyInput().appendField(Blockly.Msg.BLYNK_LOG);this.appendValueInput("CONTENT").setCheck(null);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setInputsInline(!0);this.setColour(Blockly.Blocks.blynk.hue);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.color={};Blockly.Blocks.color.HUE=330;Blockly.Blocks.color_analyzer_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-color.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.COLORANALYZER_SETUP);this.setColour(Blockly.Blocks.color.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.set_color={init:function(){this.appendDummyInput().appendField(Blockly.Msg.COLOR).appendField(new Blockly.FieldColour("#ff0000"),"COLOR");this.setOutput(!0,"String");this.setColour(Blockly.Blocks.color.HUE);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.read_r={init:function(){this.appendDummyInput().appendField(Blockly.Msg.READ_R);this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.color.HUE);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.read_g={init:function(){this.appendDummyInput().appendField(Blockly.Msg.READ_G);this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.color.HUE);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.read_b={init:function(){this.appendDummyInput().appendField(Blockly.Msg.READ_B);this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.color.HUE);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.set_colorRGB={init:function(){this.appendDummyInput().appendField(Blockly.Msg.COLOR);this.appendValueInput("RED_VAL").setCheck(null).appendField(Blockly.Msg.RED);this.appendValueInput("GREEN_VAL").setCheck(null).appendField(Blockly.Msg.GREEN);this.appendValueInput("BLUE_VAL").setCheck(null).appendField(Blockly.Msg.BLUE);this.setInputsInline(!0);this.setOutput(!0,"String");this.setColour(Blockly.Blocks.color.HUE);this.setTooltip("");this.setHelpUrl("http://help.cocorobo.cn/#/cocomod/color-analyzer?id=rgb-%E5%8F%96%E8%89%B2%E5%99%A8")}};
- Blockly.Blocks.isColorRGB={init:function(){this.appendDummyInput().appendField(Blockly.Msg.ISCOLOR).appendField(new Blockly.FieldDropdown([[Blockly.Msg.RED,"r"],[Blockly.Msg.GREEN,"g"],[Blockly.Msg.BLUE,"b"]]),"COLOR");this.setOutput(!0,"Boolean");this.setColour(Blockly.Blocks.color.HUE);this.setTooltip("");this.setHelpUrl("http://help.cocorobo.cn/#/cocomod/color-analyzer?id=rgb-%E5%8F%96%E8%89%B2%E5%99%A8")}};/*
- Licensed under the Apache License, Version 2.0 (the "License"):
- http://www.apache.org/licenses/LICENSE-2.0
- */
- Blockly.Blocks.variables.HUE=330;Blockly.Blocks.define={init:function(){this.appendValueInput("define_init").setCheck("define_var").appendField("define");this.appendDummyInput();this.appendValueInput("define_variable").setCheck(["String","Number"]).appendField("for");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(255);this.setTooltip("LE");this.setHelpUrl("")}};
- Blockly.Blocks.define_var={init:function(){this.appendDummyInput().appendField(new Blockly.FieldVariable("item"),"define_variable");this.setOutput(!0,null);this.setColour(210);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.env={};var colorENV=Blockly.Blocks.env.HUE=200;Blockly.Blocks.env_init={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-env.png",50,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.ENV_SETUP);this.setColour(Blockly.Blocks.env.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.iot_read_temp={init:function(){this.appendDummyInput().appendField(Blockly.Msg.ENV_SENSOR_READTEMP).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins),"env_sensor_temp");this.appendDummyInput().appendField(Blockly.Msg.ENV_SENSOR_TEMPUNIT).appendField(new Blockly.FieldDropdown([[Blockly.Msg.ENV_SENSOR_UNITC,"c"],[Blockly.Msg.ENV_SENSOR_UNITF,"f"]]),"temp_unit");this.setOutput(!0,"Number");this.setColour(Blockly.Blocks.env.HUE);this.setTooltip("");this.setHelpUrl("")},
- getBlockType:function(){return Blockly.Types.identifyNumber("1.1")}};
- Blockly.Blocks.iot_read_val={init:function(){this.appendDummyInput().appendField(Blockly.Msg.ENV_SENSOR_READ).appendField(new Blockly.FieldDropdown([[Blockly.Msg.ENV_SENSOR_SOUND,"mic"],[Blockly.Msg.ENV_SENSOR_LIGHT,"light"],[Blockly.Msg.ENV_SENSOR_HUMIDITY,"humid"]]),"val_type");this.setOutput(!0,"Number");this.setColour(Blockly.Blocks.env.HUE);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){var a="humid"===this.getFieldValue("val_type")?"1.1":"1";return Blockly.Types.identifyNumber(a)}};
- Blockly.Blocks.iot_read_mic={init:function(){this.appendDummyInput().appendField(Blockly.Msg.ENV_SENSOR_MIC).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.analogPins),"env_sensor_mic");this.setOutput(!0,"Number");this.setColour(Blockly.Blocks.env.HUE);this.setTooltip("");this.setHelpUrl("")},updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,"env_sensor_mic","pwmPins")},getBlockType:function(){return Blockly.Types.identifyNumber("1")}};
- Blockly.Blocks.iot_read_light={init:function(){this.appendDummyInput().appendField(Blockly.Msg.ENV_SENSOR_LIGHT).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.analogPins),"env_sensor_light");this.setOutput(!0,"Number");this.setColour(Blockly.Blocks.env.HUE);this.setTooltip("");this.setHelpUrl("")},updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,"env_sensor_light","pwmPins")},getBlockType:function(){return Blockly.Types.identifyNumber("1")}};
- Blockly.Blocks.iot_read_humid={init:function(){this.appendDummyInput().appendField(Blockly.Msg.ENV_SENSOR_HUMID).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins),"env_sensor_humid");this.setOutput(!0,"Number");this.setColour(Blockly.Blocks.env.HUE);this.setTooltip("");this.setHelpUrl("")},updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,"env_sensor_humid","pwmPins")},getBlockType:function(){return Blockly.Types.identifyNumber("1.1")}};
- Blockly.Blocks.iot_buzzer={init:function(){this.interpolate_(Blockly.Msg.BASIC_SETTONE,[{type:"field_dropdown",name:"PINSNUM",options:[["7","7"]]},{type:"input_value",name:"FREQUENCY",check:Blockly.Types.NUMBER.checkList}]);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.env.HUE);this.setTooltip(Blockly.Msg.BASIC_TONE_TIP);this.setHelpUrl("https://www.arduino.cc/en/Reference/tone")},onchange:function(){var a=Blockly.Python.valueToCode(this,
- "FREQUENCY",Blockly.Python.ORDER_ATOMIC);31>a||65535<a?this.setWarningText(Blockly.Msg.BASIC_TONE_WARNING,"io_tone"):this.setWarningText(null,"io_tone")}};Blockly.Blocks.iot_nobuzzer={init:function(){this.interpolate_(Blockly.Msg.BASIC_NOTONE,[{type:"field_dropdown",name:"PINSNUM",options:[["7","7"]]}]);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.env.HUE);this.setTooltip(Blockly.Msg.BASIC_NOTONE_TIP);this.setHelpUrl("https://www.arduino.cc/en/Reference/noTone")}};
- Blockly.Blocks.iot_set_rgb={init:function(){this.appendDummyInput().appendField(Blockly.Msg.ENV_SENSOR_SET_RGB);this.appendValueInput("RED_VAL").setCheck(null).appendField(Blockly.Msg.ENV_SETRGB_R).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins),"env_sensor_rgbPin_r");this.appendValueInput("GREEN_VAL").setCheck(null).appendField(Blockly.Msg.ENV_SETRGB_G).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins),"env_sensor_rgbPin_g");this.appendValueInput("BLUE_VAL").setCheck(null).appendField(Blockly.Msg.ENV_SETRGB_B).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins),
- "env_sensor_rgbPin_b");this.setInputsInline(!1);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.env.HUE);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.hci={};Blockly.Blocks.HID_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/computer.png",50,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.HID_SETUP);this.setColour("#33cc99");this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.HID_mouse_move={init:function(){this.appendDummyInput().appendField(Blockly.Msg.HID_MOUSE_MOVE).appendField(new Blockly.FieldDropdown([["\u2191","KEYPAD_UP"],["\u2193","KEYPAD_DOWN"],["\u2190","KEYPAD_LEFT"],["\u2192","KEYPAD_RIGHT"]]),"mouse_towards").appendField(Blockly.Msg.HID_MOUSE_MOVE_FOR).appendField(new Blockly.FieldTextInput("10"),"mouse_distance").appendField(Blockly.Msg.HID_MOUSE_MOVE_DISTANCE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour("#33cc99");
- this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.HID_mouse_click={init:function(){this.appendDummyInput().appendField(Blockly.Msg.HID_MOUSE_CLICK).appendField(new Blockly.FieldDropdown([[Blockly.Msg.HID_MOUSE_CLICK_LEFT,"MOUSE_LEFT"],[Blockly.Msg.HID_MOUSE_CLICK_RIGHT,"MOUSE_RIGHT"]]),"CLICK");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour("#33cc99");this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.HID_mouse_press={init:function(){this.appendDummyInput().appendField(Blockly.Msg.HID_MOUSE_PRESS).appendField(new Blockly.FieldDropdown([[Blockly.Msg.HID_MOUSE_CLICK_LEFT,"MOUSE_LEFT"],[Blockly.Msg.HID_MOUSE_CLICK_RIGHT,"MOUSE_RIGHT"]]),"CLICK");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour("#33cc99");this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.HID_mouse_release={init:function(){this.appendDummyInput().appendField(Blockly.Msg.HID_MOUSE_RELEASE).appendField(new Blockly.FieldDropdown([[Blockly.Msg.HID_MOUSE_CLICK_LEFT,"MOUSE_LEFT"],[Blockly.Msg.HID_MOUSE_CLICK_RIGHT,"MOUSE_RIGHT"]]),"CLICK");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour("#33cc99");this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.HID_keyboard_press={init:function(){this.appendDummyInput().appendField(Blockly.Msg.HID_KEYBOARD_PRESS).appendField(new Blockly.FieldDropdown([["Space","32"],["Enter","KEY_RETURN"],["UP","KEY_UP_ARROW"],["DOWN","KEY_DOWN_ARROW"],["LEFT","KEY_LEFT_ARROW"],["RIGHT","KEY_RIGHT_ARROW"],["DELETE","KEY_DELETE"],["0","'0'"],["1","'1'"],["2","'2'"],["3","'3'"],["4","'4'"],["5","'5'"],["6","'6'"],["7","'7'"],["8","'8'"],["9","'9'"],["A","'A'"],["B","'B'"],["C","'C'"],["D","'D'"],["E","'E'"],
- ["F","'F'"],["G","'G'"],["H","'H'"],["I","'I'"],["J","'J'"],["K","'K'"],["L","'L'"],["M","'M'"],["N","'N'"],["O","'O'"],["P","'P'"],["Q","'Q'"],["R","'R'"],["S","'S'"],["T","'T'"],["U","'U'"],["V","'V'"],["W","'W'"],["X","'X'"],["Y","'Y'"],["Z","'Z'"]]),"keyboard_press");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour("#33cc99");this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.HID_keyboard_release={init:function(){this.appendDummyInput().appendField(Blockly.Msg.HID_KEYBOARD_RELEASE).appendField(new Blockly.FieldDropdown([["Space","32"],["Enter","KEY_RETURN"],["UP","KEY_UP_ARROW"],["DOWN","KEY_DOWN_ARROW"],["LEFT","KEY_LEFT_ARROW"],["RIGHT","KEY_RIGHT_ARROW"],["DELETE","KEY_DELETE"],["0","'0'"],["1","'1'"],["2","'2'"],["3","'3'"],["4","'4'"],["5","'5'"],["6","'6'"],["7","'7'"],["8","'8'"],["9","'9'"],["A","'A'"],["B","'B'"],["C","'C'"],["D","'D'"],["E","'E'"],
- ["F","'F'"],["G","'G'"],["H","'H'"],["I","'I'"],["J","'J'"],["K","'K'"],["L","'L'"],["M","'M'"],["N","'N'"],["O","'O'"],["P","'P'"],["Q","'Q'"],["R","'R'"],["S","'S'"],["T","'T'"],["U","'U'"],["V","'V'"],["W","'W'"],["X","'X'"],["Y","'Y'"],["Z","'Z'"]]),"keyboard_press");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour("#33cc99");this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.HID_keyboard_releaseAll={init:function(){this.appendDummyInput().appendField(Blockly.Msg.HID_KEYBOARD_RELEASEALL);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour("#33cc99");this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.io={};Blockly.Blocks.io.HUE=20;
- Blockly.Blocks.io_digitalwrite={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/DigitalWrite");this.setColour(Blockly.Blocks.io.HUE);this.appendValueInput("PIN").setCheck(Blockly.Types.NUMBER.output).appendField(Blockly.Msg.ARD_DIGITALWRITE);this.appendValueInput("STATE").appendField(Blockly.Msg.ARD_WRITE_TO).setCheck(Blockly.Types.BOOLEAN.checkList);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip(Blockly.Msg.ARD_DIGITALWRITE_TIP)},
- updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,"PIN","digitalPins")}};
- Blockly.Blocks.io_digitalread={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/DigitalRead");this.setColour(Blockly.Blocks.io.HUE);this.appendValueInput("PIN").setCheck(Blockly.Types.NUMBER.output).appendField(Blockly.Msg.ARD_DIGITALREAD);this.setInputsInline(!0);this.setOutput(!0,Blockly.Types.BOOLEAN.output);this.setTooltip(Blockly.Msg.ARD_DIGITALREAD_TIP)},getBlockType:function(){return Blockly.Types.BOOLEAN},updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,
- "PIN","digitalPins")}};
- Blockly.Blocks.io_builtin_led={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/DigitalWrite");this.setColour(Blockly.Blocks.io.HUE);this.appendValueInput("STATE").appendField(Blockly.Msg.ARD_BUILTIN_LED).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.builtinLed),"BUILT_IN_LED").appendField("to").setCheck(Blockly.Types.BOOLEAN.checkList);this.setInputsInline(!1);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip(Blockly.Msg.ARD_BUILTIN_LED_TIP)},updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,
- "BUILT_IN_LED","builtinLed")},getBlockType:function(){return Blockly.Types.BOOLEAN}};
- Blockly.Blocks.io_analogwrite={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/AnalogWrite");this.setColour(Blockly.Blocks.io.HUE);this.appendValueInput("PIN").setCheck([Blockly.Types.NUMBER.output,Blockly.Types.TEXT.output]).appendField(Blockly.Msg.ARD_ANALOGWRITE);this.appendValueInput("ANALOGNUM").appendField(Blockly.Msg.ARD_WRITE_TO).setCheck(Blockly.Types.NUMBER.output);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip(Blockly.Msg.ARD_ANALOGWRITE_TIP)},
- updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,"PIN","pwmPins")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.io_analogread={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/AnalogRead");this.setColour(Blockly.Blocks.io.HUE);this.appendValueInput("PIN").setCheck(Blockly.Types.NUMBER.output).appendField(Blockly.Msg.ARD_ANALOGREAD);this.setInputsInline(!0);this.setOutput(!0,Blockly.Types.NUMBER.output);this.setTooltip(Blockly.Msg.ARD_ANALOGREAD_TIP)},getBlockType:function(){return Blockly.Types.NUMBER},updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,
- "PIN","analogPins")}};
- Blockly.Blocks.io_pwmwrite={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/AnalogWrite");this.setColour(Blockly.Blocks.io.HUE);this.appendValueInput("PIN").setCheck([Blockly.Types.NUMBER.output,Blockly.Types.TEXT.output]).appendField(Blockly.Msg.ARD_PWMWRITE);this.appendValueInput("PWMVALUE").appendField(Blockly.Msg.ARD_WRITE_TO).setCheck(Blockly.Types.NUMBER.output);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip(Blockly.Msg.ARD_ANALOGWRITE_TIP)},updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,
- "PIN","pwmPins")},getBlockType:function(){return Blockly.Types.NUMBER}};Blockly.Blocks.io_highlow={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/Constants");this.setColour(Blockly.Blocks.io.HUE);this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Blockly.Msg.ARD_HIGH,"HIGH"],[Blockly.Msg.ARD_LOW,"LOW"]]),"STATE");this.setOutput(!0,Blockly.Types.BOOLEAN.output);this.setTooltip(Blockly.Msg.ARD_HIGHLOW_TIP)},getBlockType:function(){return Blockly.Types.BOOLEAN}};
- Blockly.Blocks.io_pulsein={init:function(){this.appendDummyInput().appendField(Blockly.Msg.ARD_PULSEREAD);this.appendValueInput("PULSETYPE").setCheck(Blockly.Types.BOOLEAN.check);this.appendDummyInput().appendField(Blockly.Msg.ARD_PULSEON).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins),"PULSEPIN");this.setOutput(!0);this.setInputsInline(!0);this.setColour(Blockly.Blocks.io.HUE);this.setTooltip(Blockly.Msg.ARD_PULSE_TIP);this.setHelpUrl("https://www.arduino.cc/en/Reference/PulseIn")},
- getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.io_pulsetimeout={init:function(){this.appendDummyInput().appendField(Blockly.Msg.ARD_PULSEREAD);this.appendValueInput("PULSETYPE").setCheck(Blockly.Types.BOOLEAN.check);this.appendDummyInput().appendField(Blockly.Msg.ARD_PULSEON).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins),"PULSEPIN");this.appendDummyInput().appendField(Blockly.Msg.ARD_PULSETIMEOUT);this.appendValueInput("TIMEOUT").setCheck(Blockly.Types.NUMBER.output);this.appendDummyInput().appendField(Blockly.Msg.ARD_PULSETIMEOUT_MS);
- this.setOutput(!0);this.setInputsInline(!0);this.setColour(Blockly.Blocks.io.HUE);this.setTooltip(Blockly.Msg.ARD_PULSETIMEOUT_TIP);this.setHelpUrl("https://www.arduino.cc/en/Reference/PulseIn")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.io_dropdown_digital={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.io_dropdown_analog={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.analogPins),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.io_dropdown_pwm={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.pwmPins),"SELECTPIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.io.HUE)},getBlockType:function(){return Blockly.Types.NUMBER}};Blockly.Blocks.led={};Blockly.Blocks.led.HUE=198;
- Blockly.Blocks.led_neopixel_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-light.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.LED_SETUP);this.appendDummyInput().appendField(Blockly.Msg.LED_PIN).appendField(new Blockly.FieldNumber(6,0,13),"neopixel_initpin").appendField(Blockly.Msg.LED_BRTN).appendField(new Blockly.FieldNumber(20,0,255),"neopixel_initbright");this.appendDummyInput().appendField(Blockly.Msg.LED_PANELWIDTH).appendField(new Blockly.FieldDropdown([["1","1"],
- ["2","2"],["3","3"],["4","4"],["5","5"],["6","6"]]),"neopixel_initwidth");this.appendDummyInput().appendField(Blockly.Msg.LED_PANELHEIGHT).appendField(new Blockly.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"]]),"neopixel_initheight");this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_setrotation={init:function(){this.appendDummyInput().appendField(Blockly.Msg.LED_SET_ROTATION).appendField(new Blockly.FieldDropdown([["0","0"],["90","1"],["180","2"],["270","3"]]),"led_setrotation_option").appendField(Blockly.Msg.LED_SET_ROTATION_DEGREE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_setbright={init:function(){this.appendValueInput("BRIGHTNESS").setCheck(Blockly.Types.NUMBER.checkList).appendField(Blockly.Msg.LED_SET_BRIGHTNESS);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")},onchange:function(){var a=Blockly.Python.valueToCode(this,"BRIGHTNESS",Blockly.Python.ORDER_ATOMIC);0>a||255<a?this.setWarningText(Blockly.Msg.LED_BRIGHTNESS_WARNING,"fastled_setbright"):
- this.setWarningText(null,"fastled_setbright")},getBlockType:function(){return Blockly.Types.NUMBER}};Blockly.Blocks.led_set_width_height={init:function(){this.appendValueInput("WIDTH").setCheck("Number").appendField(Blockly.Msg.LED_WIDTH);this.appendValueInput("HEIGHT").setCheck("Number").appendField(Blockly.Msg.LED_HEIGHT);this.setOutput(!0,"String");this.setInputsInline(!0);this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_set_position={init:function(){this.appendValueInput("POSX").setCheck("Number").appendField("X:");this.appendValueInput("POSY").setCheck("Number").appendField("Y:");this.setOutput(!0,"String");this.setInputsInline(!0);this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_drawpixel={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./blockly/media/pixel.png",25,25,"15"));this.appendDummyInput().appendField(Blockly.Msg.LED_DRAW+Blockly.Msg.LED_PIXEL);this.appendValueInput("COLOR").setCheck("String").appendField(Blockly.Msg.LED_COLOR);this.appendValueInput("POS").setCheck("String").appendField(Blockly.Msg.LED_COORDINATE);this.setInputsInline(!1);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.led.HUE);
- this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_drawrect={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/rect.png",25,25,"15"));this.appendDummyInput().appendField(Blockly.Msg.LED_DRAW).appendField(new Blockly.FieldDropdown([[Blockly.Msg.OLCD_FULL,"fill"],[Blockly.Msg.OLCD_STROKED,"draw"]]),"rect_type").appendField(Blockly.Msg.LED_RECTANGLE);this.appendValueInput("COLOR").setCheck("String").appendField(Blockly.Msg.LED_COLOR);this.appendValueInput("SIZE").setCheck("String").appendField(Blockly.Msg.LED_SIZE);this.appendValueInput("POS").setCheck("String").appendField(Blockly.Msg.LED_COORDINATE);
- this.setInputsInline(!1);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_drawline={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/line.png",25,25,"15"));this.appendDummyInput().appendField(Blockly.Msg.LED_DRAW+Blockly.Msg.LED_LINE);this.appendValueInput("COLOR").setCheck("String").appendField(Blockly.Msg.LED_COLOR);this.appendValueInput("POSA").setCheck("String").appendField(Blockly.Msg.LED_LINE_START);this.appendValueInput("POSB").setCheck("String").appendField(Blockly.Msg.LED_LINE_END);this.setInputsInline(!1);
- this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.led_showall={init:function(){this.appendDummyInput().appendField(Blockly.Msg.LED_SHOW_ALL);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_clear={init:function(){this.appendDummyInput().appendField(Blockly.Msg.LED_CLEAR);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_text={init:function(){this.appendDummyInput().appendField(Blockly.Msg.LED_COORDINATE).appendField("x").appendField(new Blockly.FieldTextInput("1"),"x_val").appendField("y").appendField(new Blockly.FieldTextInput("1"),"y_val");this.appendValueInput("text_color").setCheck("String").appendField(Blockly.Msg.LED_TEXT);this.appendValueInput("back_color").setCheck("String").appendField(Blockly.Msg.LED_BACKCOLOR);this.appendDummyInput().appendField(Blockly.Msg.LED_SIZE).appendField(new Blockly.FieldNumber(1,
- 0,4,1),"text_size");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setInputsInline(!0);this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_scrolling_text={init:function(){this.appendDummyInput().appendField("Scrolling");this.appendDummyInput().appendField("speed").appendField(new Blockly.FieldTextInput("100"),"led_scrolling_speed");this.appendValueInput("led_scrolling_color").setCheck("String");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setInputsInline(!0);this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_pattern_5x5={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/pattern.png",25,25,"15")).appendField(Blockly.Msg.LED_DRAW+Blockly.Msg.LED_PATTERN);this.appendDummyInput().appendField(" ").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"0_0").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),
- "0_1").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"0_2").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"0_3").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"0_4").appendField(" ");
- this.appendDummyInput().appendField(" ").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"1_0").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"1_1").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),
- "1_2").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"1_3").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"1_4").appendField(" ");this.appendDummyInput().appendField(" ").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),
- "2_0").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"2_1").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"2_2").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"2_3").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),
- "2_4").appendField(" ");this.appendDummyInput().appendField(" ").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"3_0").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"3_1").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),
- "3_2").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"3_3").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"3_4").appendField(" ");this.appendDummyInput().appendField(" ").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),
- "4_0").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"4_1").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"4_2").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),"4_3").appendField((new Blockly.FieldColour("#3B5587")).setColours("#3B5587 #FFFFFF #FF0000 #FFA500 #FFFF00 #00FF00 #00FFFF #0000FF #FF00FF #FFC0CB".split(" ")),
- "4_4").appendField(" ");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_drawWord_5x5={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/text.png",25,25,"15"));this.appendValueInput("WORD").appendField(Blockly.Msg.LED_WORD);this.appendValueInput("COLOR").appendField(Blockly.Msg.LED_COLOR);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_text_input={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/text.png",25,25,"15"));this.appendDummyInput().appendField(Blockly.Msg.LED_SCROLL).appendField(new Blockly.FieldDropdown([[Blockly.Msg.LED_SCROLL_NO,"0"],[Blockly.Msg.LED_SCROLL_YES,"1"]]),"scroll");this.appendDummyInput().appendField(Blockly.Msg.LED_FONT).appendField(new Blockly.FieldDropdown([["5x5","1"],["5x7","2"],["10x12","3"]]),"font").appendField("px");this.appendValueInput("TEXT").appendField(Blockly.Msg.LED_TEXT);
- this.appendValueInput("COLOR").appendField(Blockly.Msg.LED_COLOR);this.appendValueInput("POS").appendField(Blockly.Msg.LED_COORDINATE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_draw_emotion={init:function(){this.appendDummyInput("image").appendField(new Blockly.FieldImage("./../blockly/media/pattern.png",25,25,"15"),"face_image");this.appendDummyInput().appendField(Blockly.Msg.LED_DRAW).appendField(new Blockly.FieldDropdown([[":) SMILE","1"],[":| NORMAL","2"],[":( SAD","3"]]),"face");this.appendValueInput("COLOR").appendField(Blockly.Msg.LED_COLOR);this.updateImage_();this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.led.HUE);
- this.setTooltip("");this.setHelpUrl("")},updateImage_:function(){var a=this.getInput("image");switch(this.getFieldValue("face")){case "1":a.removeField("face_image");a.appendField(new Blockly.FieldImage("./../blockly/media/emotion.png",40,40,"15"),"face_image");break;case "2":a.removeField("face_image");a.appendField(new Blockly.FieldImage("./../blockly/media/normal-face.png",40,40,"15"),"face_image");break;case "3":a.removeField("face_image"),a.appendField(new Blockly.FieldImage("./../blockly/media/sad-face.png",
- 40,40,"15"),"face_image")}}};
- Blockly.Blocks.led_draw_strip={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/strip_pixel.png",25,25,"15"));this.appendDummyInput().appendField(Blockly.Msg.LED_STRIP_PIXEL);this.appendValueInput("COLOR").setCheck("String").appendField(Blockly.Msg.LED_COLOR);this.appendValueInput("LOC").setCheck("Number").appendField(Blockly.Msg.LED_STRIP_LOCATION);this.setInputsInline(!1);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.led.HUE);
- this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.led_set_color={init:function(){this.appendDummyInput().appendField(Blockly.Msg.COLOR).appendField(new Blockly.FieldColour("#ff0000"),"COLOR");this.setOutput(!0,"String");this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.led_set_colorRGB={init:function(){this.appendDummyInput().appendField(Blockly.Msg.COLOR);this.appendValueInput("RED_VAL").setCheck(null).appendField(Blockly.Msg.RED);this.appendValueInput("GREEN_VAL").setCheck(null).appendField(Blockly.Msg.GREEN);this.appendValueInput("BLUE_VAL").setCheck(null).appendField(Blockly.Msg.BLUE);this.setInputsInline(!0);this.setOutput(!0,"String");this.setColour(Blockly.Blocks.led.HUE);this.setTooltip("");this.setHelpUrl("http://help.cocorobo.cn/#/cocomod/color-analyzer?id=rgb-%E5%8F%96%E8%89%B2%E5%99%A8")}};Blockly.Blocks.logo={};Blockly.Blocks.logo.HUE=180;Blockly.Blocks.ardublockly_name_top={init:function(){this.appendDummyInput().appendField("Ardublockly");this.setPreviousStatement(!0);this.setColour(Blockly.Blocks.logo.HUE)}};Blockly.Blocks.ardublockly_name_bottom={init:function(){this.appendDummyInput().appendField("Ardublockly");this.setNextStatement(!0);this.setColour(Blockly.Blocks.logo.HUE);this.setTooltip("")}};
- Blockly.Blocks.ardublockly_plus_top_large={init:function(){this.appendValueInput("NAME").appendField(" +");this.setNextStatement(!0);this.setColour(Blockly.Blocks.logo.HUE)}};Blockly.Blocks.ardublockly_plus_top_small={init:function(){this.appendValueInput("NAME").appendField(" +");this.setNextStatement(!0);this.setColour(Blockly.Blocks.logo.HUE)}};Blockly.Blocks.ardublockly_plus_bottom_large={init:function(){this.appendValueInput("NAME").appendField(" +");this.setPreviousStatement(!0);this.setColour(Blockly.Blocks.logo.HUE)}};
- Blockly.Blocks.ardublockly_plus_bottom_small={init:function(){this.appendValueInput("NAME").appendField(" +");this.setPreviousStatement(!0);this.setColour(Blockly.Blocks.logo.HUE)}};Blockly.Blocks.ardublockly_plus_both_small={init:function(){this.appendValueInput("NAME").appendField(" +");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.logo.HUE)}};
- Blockly.Blocks.ardublockly_plus_both_large={init:function(){this.appendValueInput("NAME").appendField(" +");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.logo.HUE)}};Blockly.Blocks.ardublockly_minus_large={init:function(){this.appendDummyInput().appendField("- ");this.setInputsInline(!1);this.setOutput(!0);this.setColour(Blockly.Blocks.logo.HUE)}};
- Blockly.Blocks.ardublockly_minus_small={init:function(){this.appendDummyInput().appendField("- ");this.setInputsInline(!1);this.setOutput(!0);this.setColour(Blockly.Blocks.logo.HUE)}};Blockly.Blocks.mainwifi={};Blockly.Blocks.mainwifi.HUE="#293278";Blockly.Blocks.mainwifi_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-wifi.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.MAINWIFI_SETUP);this.setColour(Blockly.Blocks.mainwifi.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.mainwifi_sendMsg={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MAINWIFI_SENDMSG).appendField(new Blockly.FieldVariable("dataOut"),"dataVar");this.setColour(Blockly.Blocks.mainwifi.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setInputsInline(!0);this.setTooltip("");this.setHelpUrl("")},getVarType:function(a){return Blockly.Types.ARRAY}};
- Blockly.Blocks.mainwifi_receiveMsg={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MAINWIFI_RECEIVEMSG).appendField(new Blockly.FieldVariable("dataIn"),"dataVar");this.setColour(Blockly.Blocks.mainwifi.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setInputsInline(!0);this.setTooltip("");this.setHelpUrl("")},getVarType:function(a){return Blockly.Types.ARRAY}};
- Blockly.Blocks.mainwifi_receiveMsg_isSuccessed={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MAINWIFI_RECEIVEMSG_ISSUCCESS);this.setColour(Blockly.Blocks.mainwifi.HUE);this.setOutput(!0,Blockly.Types.BOOLEAN.output);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.MainEasymode_transfer_send={init:function(){this.appendDummyInput().appendField(" "+Blockly.Msg.MAINEASYMODE_TRANSFER_SEND).appendField(new Blockly.FieldVariable("dataMain"),"DATAMAIN");this.appendDummyInput().appendField(" "+Blockly.Msg.MAINEASYMODE_TRANSFER_SEND_LINE2);this.setColour(Blockly.Blocks.mainwifi.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")},getVarType:function(a){return Blockly.Types.ARRAY}};
- Blockly.Blocks.MainEasymode_transfer_receive={init:function(){this.appendDummyInput().appendField(" "+Blockly.Msg.MAINEASYMODE_TRANSFER_RECEIVE);this.appendDummyInput().appendField(" "+Blockly.Msg.MAINEASYMODE_TRANSFER_RECEIVE_LINE2).appendField(new Blockly.FieldVariable("dataMain"),"DATAMAIN");this.setColour(Blockly.Blocks.mainwifi.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")},getVarType:function(a){return Blockly.Types.ARRAY}};
- Blockly.Blocks.MainEasymode_transfer2_send_old={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/transfer-1.png",50,40,"0"));this.appendDummyInput().appendField("Old "+Blockly.Msg.MAINEASYMODE_TRANSFER_SEND_LINE2);this.appendValueInput("ADD0").appendField(Blockly.Msg.MAINEASYMODE_TRANSFER_SEND_VALUE+"0");this.setColour(135);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("");this.itemCount_=1;this.updateShape_();
- this.setMutator(new Blockly.Mutator(["MainEasymode_transfer_create_with_item"]))},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=a.newBlock("MainEasymode_transfer_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("MainEasymode_transfer_create_with_item");
- d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1));for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.MAINEASYMODE_TRANSFER_SEND_VALUE+
- a);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};Blockly.Blocks.MainEasymode_transfer_create_with_container={init:function(){this.setColour(135);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.MainEasymode_transfer_create_with_item={init:function(){this.setColour(135);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.MainEasymode_transfer2_receive_old={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/transfer-1.png",50,40,"0"));this.appendDummyInput().appendField("Old "+Blockly.Msg.MAINEASYMODE_TRANSFER_RECEIVE);this.appendDummyInput().appendField(" "+Blockly.Msg.MAINEASYMODE_TRANSFER_RECEIVE_LINE3).appendField(new Blockly.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],
- ["12","12"]]),"LENGTH");this.setColour(135);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")},getVarType:function(a){return Blockly.Types.ARRAY}};
- Blockly.Blocks.MainEasymode_transfer2_receive_getValue_old={init:function(){this.appendDummyInput().appendField("Old "+Blockly.Msg.MAINEASYMODE_TRANSFER_RECEIVE_GET_LINE2).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"INDEX").appendField(" "+Blockly.Msg.MAINEASYMODE_TRANSFER_RECEIVE_GET_LINE3);this.setColour(135);this.setOutput(!0);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){switch(this.getFieldValue("TYPE")){case "":return Blockly.Types.TEXT;
- case ".toFloat()":return Blockly.Types.LARGE_NUMBER}return Blockly.Types.NUMBER},getOutputType:function(){switch(this.getFieldValue("TYPE")){case "":return Blockly.Types.TEXT.output;case ".toFloat()":return Blockly.Types.LARGE_NUMBER.output}return Blockly.Types.NUMBER.output}};
- Blockly.Blocks.MainEasymode_transfer2_send={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/transfer-1.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.MAINEASYMODE_TRANSFER_SEND_LINE2);this.appendValueInput("ADD0").appendField(Blockly.Msg.MAINEASYMODE_TRANSFER_SEND_VALUE+"0");this.setColour(Blockly.Blocks.mainwifi.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("");this.itemCount_=
- 1;this.updateShape_();this.setMutator(new Blockly.Mutator(["MainEasymode_transfer_create_with_item"]))},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=a.newBlock("MainEasymode_transfer_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("MainEasymode_transfer_create_with_item");
- d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1));for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.MAINEASYMODE_TRANSFER_SEND_VALUE+
- a);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};Blockly.Blocks.MainEasymode_transfer_create_with_container={init:function(){this.setColour(Blockly.Blocks.mainwifi.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.MainEasymode_transfer_create_with_item={init:function(){this.setColour(Blockly.Blocks.mainwifi.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.MainEasymode_transfer2_receive={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/transfer-1.png",50,40,"0"));this.appendDummyInput().appendField(" "+Blockly.Msg.MAINEASYMODE_TRANSFER_RECEIVE);this.appendDummyInput().appendField(" "+Blockly.Msg.MAINEASYMODE_TRANSFER_RECEIVE_LINE3).appendField(new Blockly.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12",
- "12"]]),"LENGTH");this.setColour(Blockly.Blocks.mainwifi.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")},getVarType:function(a){return Blockly.Types.ARRAY}};
- Blockly.Blocks.MainEasymode_transfer2_receive_getValue={init:function(){this.appendDummyInput().appendField(" "+Blockly.Msg.MAINEASYMODE_TRANSFER_RECEIVE_GET_LINE2).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"INDEX").appendField(" "+Blockly.Msg.MAINEASYMODE_TRANSFER_RECEIVE_GET_LINE3).appendField(new Blockly.FieldDropdown([["String",""],["Number",".toInt()"],["Float",".toFloat()"]]),
- "TYPE").appendField(" "+Blockly.Msg.MAINEASYMODE_TRANSFER_RECEIVE_GET_LINE4);this.setColour(Blockly.Blocks.mainwifi.HUE);this.setOutput(!0);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){switch(this.getFieldValue("TYPE")){case "":return Blockly.Types.TEXT;case ".toFloat()":return Blockly.Types.LARGE_NUMBER}return Blockly.Types.NUMBER},getOutputType:function(){switch(this.getFieldValue("TYPE")){case "":return Blockly.Types.TEXT.output;case ".toFloat()":return Blockly.Types.LARGE_NUMBER.output}return Blockly.Types.NUMBER.output}};Blockly.Blocks.map={};Blockly.Blocks.map.HUE=220;
- Blockly.Blocks.base_map={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/map");this.setColour(Blockly.Blocks.map.HUE);this.appendValueInput("NUM").appendField(Blockly.Msg.ARD_MAP).setCheck(Blockly.Types.NUMBER.checkList);this.appendValueInput("DMAX").appendField(Blockly.Msg.ARD_MAP_VAL).setCheck(Blockly.Types.NUMBER.checkList);this.appendDummyInput().appendField("]");this.setInputsInline(!0);this.setOutput(!0);this.setTooltip(Blockly.Msg.ARD_MAP_TIP)},getBlockType:function(){return Blockly.Types.NUMBER}};Blockly.Blocks.motion={};Blockly.Blocks.motion.HUE=270;Blockly.Blocks.motion_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-motion.png",50,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.MOTION_SETUP);this.setColour(Blockly.Blocks.motion.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.motion_onshake={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MOTION_ONSHAKE);this.setOutput(!0,Blockly.Types.BOOLEAN.output);this.setColour(Blockly.Blocks.motion.HUE);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.BOOLEAN}};
- Blockly.Blocks.motion_onDirection={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MOTION_ONDIRECTION).appendField(new Blockly.FieldDropdown([[Blockly.Msg.MOTION_ONDIRECTION_LEFT,"left"],[Blockly.Msg.MOTION_ONDIRECTION_RIGHT,"right"],[Blockly.Msg.MOTION_ONDIRECTION_FRONT,"front"],[Blockly.Msg.MOTION_ONDIRECTION_BACK,"back"]]),"DIRECTION").appendField(Blockly.Msg.MOTION_ONDIRECTION1);this.setOutput(!0,"Boolean");this.setColour(Blockly.Blocks.motion.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.motion_getRotation_ypr={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MOTION_GETYPR).appendField(new Blockly.FieldDropdown([["yaw","0"],["pitch","1"],["roll","2"]]),"Rotation").appendField(Blockly.Msg.MOTION_GETYPR1);this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.motion.HUE);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.motion_getAcceleration={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MOTION_GETACC).appendField(new Blockly.FieldDropdown([["x","x"],["y","y"],["z","z"]]),"Acceleration").appendField(Blockly.Msg.MOTION_GETACC1);this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.motion.HUE);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};Blockly.Blocks.motor={};Blockly.Blocks.motor.HUE=345;Blockly.Blocks.motor_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-motor.png",50,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.MOTOR_SETUP);this.setColour(Blockly.Blocks.motor.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.motor_speed={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MOTOR_SPEED).appendField(new Blockly.FieldNumber(150,0,255),"SPEED");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.motor.HUE);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.motorA_move_clockwise={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MOTOR_MOVE_MOTOR).appendField(new Blockly.FieldDropdown([["A","1"],["B","0"]]),"MOTOR");this.appendValueInput("SPEED").setCheck("Number");this.appendDummyInput().appendField(Blockly.Msg.MOTOR_MOVE_MSG).appendField(new Blockly.FieldDropdown([[Blockly.Msg.MOTOR_MOVE_DIRECTION1,"0"],[Blockly.Msg.MOTOR_MOVE_DIRECTION2,"1"]]),"DIRECTION");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,
- null);this.setColour(Blockly.Blocks.motor.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.motorA_move_anticlockwise={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MOTOR_MOVE_MOTOR).appendField(new Blockly.FieldDropdown([["A","1"],["B","0"]]),"MOTOR");this.appendValueInput("SPEED").setCheck("Number");this.appendDummyInput().appendField(Blockly.Msg.MOTOR_MOVE_MSG).appendField(new Blockly.FieldDropdown([[Blockly.Msg.MOTOR_MOVE_DIRECTION2,"1"],[Blockly.Msg.MOTOR_MOVE_DIRECTION1,"0"]]),"DIRECTION");this.setInputsInline(!0);this.setPreviousStatement(!0,null);
- this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.motor.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.motorB_move_clockwise={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MOTOR_MOVE_MOTOR).appendField(new Blockly.FieldDropdown([["B","0"],["A","1"]]),"MOTOR");this.appendValueInput("SPEED").setCheck("Number");this.appendDummyInput().appendField(Blockly.Msg.MOTOR_MOVE_MSG).appendField(new Blockly.FieldDropdown([[Blockly.Msg.MOTOR_MOVE_DIRECTION1,"0"],[Blockly.Msg.MOTOR_MOVE_DIRECTION2,"1"]]),"DIRECTION");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,
- null);this.setColour(Blockly.Blocks.motor.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.motorB_move_anticlockwise={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MOTOR_MOVE_MOTOR).appendField(new Blockly.FieldDropdown([["B","0"],["A","1"]]),"MOTOR");this.appendValueInput("SPEED").setCheck("Number");this.appendDummyInput().appendField(Blockly.Msg.MOTOR_MOVE_MSG).appendField(new Blockly.FieldDropdown([[Blockly.Msg.MOTOR_MOVE_DIRECTION2,"1"],[Blockly.Msg.MOTOR_MOVE_DIRECTION1,"0"]]),"DIRECTION");this.setInputsInline(!0);this.setPreviousStatement(!0,null);
- this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.motor.HUE);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.motor_stop={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MOTOR_STOP);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.motor.HUE);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.music={};Blockly.Blocks.music.HUE=340;
- Blockly.Blocks.MusicMidiSetup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-music.png",50,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.MUSIC_INSTRUMENT).appendField(new Blockly.FieldDropdown([[Blockly.Msg.MUSIC_INSTRUMENT_GPIANO,"1"],[Blockly.Msg.MUSIC_INSTRUMENT_EPIANO,"5"],[Blockly.Msg.MUSIC_INSTRUMENT_MUSICBOX,"11"],[Blockly.Msg.MUSIC_INSTRUMENT_XYLOPHONE,"14"],[Blockly.Msg.MUSIC_INSTRUMENT_DRAWBARORGAN,"17"],[Blockly.Msg.MUSIC_INSTRUMENT_ACCORION,
- "22"],[Blockly.Msg.MUSIC_INSTRUMENT_GUITAR,"25"],[Blockly.Msg.MUSIC_INSTRUMENT_EGUITAR,"28"],[Blockly.Msg.MUSIC_INSTRUMENT_BASS,"33"],[Blockly.Msg.MUSIC_INSTRUMENT_VIOLIN,"41"],[Blockly.Msg.MUSIC_INSTRUMENT_VIOLA,"42"],[Blockly.Msg.MUSIC_INSTRUMENT_CELLO,"43"],[Blockly.Msg.MUSIC_INSTRUMENT_TRUMPET,"57"],[Blockly.Msg.MUSIC_INSTRUMENT_SAX,"67"],[Blockly.Msg.MUSIC_INSTRUMENT_PICCOLO,"73"],[Blockly.Msg.MUSIC_INSTRUMENT_FLUTE,"74"],[Blockly.Msg.MUSIC_INSTRUMENT_WHISTLE,"79"],[Blockly.Msg.MUSIC_INSTRUMENT_SITAR,
- "105"],[Blockly.Msg.MUSIC_INSTRUMENT_WOODBLOCK,"116"],[Blockly.Msg.MUSIC_INSTRUMENT_DRUM,"117"]]),"INSTRUMENT");this.appendDummyInput().appendField(Blockly.Msg.MUSIC_VOLUME).appendField(new Blockly.FieldDropdown([[Blockly.Msg.MUSIC_VOL_MIN,"120"],["1","100"],["2","80"],["3","60"],["4","40"],["5","20"],[Blockly.Msg.MUSIC_VOL_MAX,"0"]]),"VOLUME");this.setColour(Blockly.Blocks.music.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.MusicSetVolume={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MUSIC_VOLUME).appendField(new Blockly.FieldDropdown([[Blockly.Msg.MUSIC_VOL_MIN,"120"],["1","100"],["2","80"],["3","60"],["4","40"],["5","20"],[Blockly.Msg.MUSIC_VOL_MAX,"0"]]),"VOLUME");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.music.HUE);this.setTooltip(Blockly.Msg.MUSIC_PLAY_NOTE_TOOLTIP);this.setHelpUrl("")}};
- Blockly.Blocks.MusicSetInstrument={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MUSIC_INSTRUMENT).appendField(new Blockly.FieldDropdown([[Blockly.Msg.MUSIC_INSTRUMENT_GPIANO,"1"],[Blockly.Msg.MUSIC_INSTRUMENT_EPIANO,"5"],[Blockly.Msg.MUSIC_INSTRUMENT_MUSICBOX,"11"],[Blockly.Msg.MUSIC_INSTRUMENT_XYLOPHONE,"14"],[Blockly.Msg.MUSIC_INSTRUMENT_DRAWBARORGAN,"17"],[Blockly.Msg.MUSIC_INSTRUMENT_ACCORION,"22"],[Blockly.Msg.MUSIC_INSTRUMENT_GUITAR,"25"],[Blockly.Msg.MUSIC_INSTRUMENT_EGUITAR,
- "28"],[Blockly.Msg.MUSIC_INSTRUMENT_BASS,"33"],[Blockly.Msg.MUSIC_INSTRUMENT_VIOLIN,"41"],[Blockly.Msg.MUSIC_INSTRUMENT_VIOLA,"42"],[Blockly.Msg.MUSIC_INSTRUMENT_CELLO,"43"],[Blockly.Msg.MUSIC_INSTRUMENT_TRUMPET,"57"],[Blockly.Msg.MUSIC_INSTRUMENT_SAX,"67"],[Blockly.Msg.MUSIC_INSTRUMENT_PICCOLO,"73"],[Blockly.Msg.MUSIC_INSTRUMENT_FLUTE,"74"],[Blockly.Msg.MUSIC_INSTRUMENT_WHISTLE,"79"],[Blockly.Msg.MUSIC_INSTRUMENT_SITAR,"105"],[Blockly.Msg.MUSIC_INSTRUMENT_WOODBLOCK,"116"],[Blockly.Msg.MUSIC_INSTRUMENT_DRUM,
- "117"]]),"INSTRUMENT");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.music.HUE);this.setTooltip(Blockly.Msg.MUSIC_PLAY_NOTE_TOOLTIP);this.setHelpUrl("")}};
- Blockly.Blocks.MusicNote={init:function(){this.appendDummyInput().appendField("\u266a").appendField(Blockly.Msg.MUSIC_NOTE).appendField(new Blockly.FieldNumber(60,0,100),"NOTE");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.music.HUE);this.setTooltip("");this.setHelpUrl("http://cocorobo.cn/cocoblockly/dev/reference/notes.jpg")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.MusicBeat={init:function(){this.appendDummyInput().appendField("\u266a").appendField(new Blockly.FieldDropdown([["1","1000"],["1/2","500"],["1/4","250"],["1/8","125"],["2","2000"],["4","4000"]]),"BEAT").appendField(Blockly.Msg.MUSIC_BEAT);this.setOutput(!0,"Number");this.setColour(Blockly.Blocks.music.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.MusicPlayTone={init:function(){this.appendValueInput("NOTE").appendField("\u2669 "+Blockly.Msg.MUSIC_PLAY_NOTE);this.appendValueInput("DURATION").appendField(Blockly.Msg.MUSIC_DURATION);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setInputsInline(!0);this.setColour(Blockly.Blocks.music.HUE);this.setTooltip(Blockly.Msg.MUSIC_PLAY_NOTE_TOOLTIP);this.setHelpUrl("http://cocorobo.cn/cocoblockly/dev/reference/notes.jpg")}};
- Blockly.Blocks.MusicRest={init:function(){this.appendValueInput("BEAT").appendField("\u2669 "+Blockly.Msg.MUSIC_REST);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setInputsInline(!0);this.setColour(Blockly.Blocks.music.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.Music_mp3_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-music.png",50,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.MUSIC_MP3_SETUP);this.appendDummyInput().appendField(Blockly.Msg.MUSIC_MP3_SETUP_SETVOLUME).appendField(new Blockly.FieldDropdown([[Blockly.Msg.MUSIC_MP3_SETUP_SETVOLUME_LOW,"90"],[Blockly.Msg.MUSIC_MP3_SETUP_SETVOLUME_MID,"50"],[Blockly.Msg.MUSIC_MP3_SETUP_SETVOLUME_HIGH,"10"]]),"SETVOL");this.setColour(Blockly.Blocks.music.HUE);
- this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.Music_mp3_playOneWithName={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MUSIC_MP3_PLAYONE).appendField(new Blockly.FieldTextInput("record.mp3"),"MUSIC_NAME");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.music.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.Music_mp3_playAllMusic={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MUSIC_MP3_PLAYALL);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.music.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.Music_mp3_playSetting={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MUSIC_MP3_PLAYSETTING).appendField(new Blockly.FieldDropdown([[Blockly.Msg.MUSIC_MP3_PLAYSETTING_RESUME,"0"],[Blockly.Msg.MUSIC_MP3_PLAYSETTING_PAUSE,"1"],[Blockly.Msg.MUSIC_MP3_PLAYSETTING_PRESONG,"2"],[Blockly.Msg.MUSIC_MP3_PLAYSETTING_NEXTSONG,"3"],[Blockly.Msg.MUSIC_MP3_PLAYSETTING_VOLUP,"4"],[Blockly.Msg.MUSIC_MP3_PLAYSETTING_VOLDOWN,"5"],[Blockly.Msg.MUSIC_MP3_PLAYSETTING_PLAYALL,"6"]]),"SETTING");
- this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.music.HUE);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.Music_mp3_getCurrentVolume={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MUSIC_MP3_CURRENTVOLUME);this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.music.HUE);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.Music_mp3_setCurrentVolume={init:function(){this.appendDummyInput().appendField(Blockly.Msg.MUSIC_MP3_SETVOLUME).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]]),"VOLLEVEL");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.music.HUE);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.nbiot={};Blockly.Blocks.nbiot.HUE="#6da383";Blockly.Blocks.NBIoT_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/nbiot_header.png",100,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.NBIOT_SETUP);this.setColour(Blockly.Blocks.nbiot.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.NBIoT_http={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/nbiot_header.png",100,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.NBIOT_HTTP_TITLE);this.appendDummyInput().appendField(Blockly.Msg.NBIOT_HTTP_APIKEY).appendField(new Blockly.FieldTextInput("yourCloudEventAPIKey"),"APIKEY");this.appendValueInput("ADD0").appendField(Blockly.Msg.NBIOT_HTTP_DATA).appendField(new Blockly.FieldTextInput("default"),"DATA_DEFAULT0").setAlign(Blockly.ALIGN_RIGHT);
- this.setPreviousStatement(!0);this.setNextStatement(!0);this.itemCount_=1;this.updateShape_();this.setMutator(new Blockly.Mutator(["NBIoT_create_with_item"]));this.setColour(Blockly.Blocks.nbiot.HUE);this.setTooltip("");this.setHelpUrl("")},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=a.newBlock("NBIoT_create_with_container");
- b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("NBIoT_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();
- for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.NBIOT_HTTP_DATA).appendField(new Blockly.FieldTextInput("default"),"DATA_DEFAULT"+
- a).setAlign(Blockly.ALIGN_RIGHT);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++},onchange:function(){var a=this.getFieldValue("APIKEY");50<a.length&&this.setFieldValue(a.substring(0,50),"APIKEY")}};Blockly.Blocks.NBIoT_create_with_container={init:function(){this.setColour(Blockly.Blocks.nbiot.HUE);this.appendDummyInput().appendField(Blockly.Msg.BLYNK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.NBIoT_create_with_item={init:function(){this.setColour(Blockly.Blocks.nbiot.HUE);this.appendDummyInput().appendField(Blockly.Msg.BLYNK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};Blockly.Blocks.NBIoT_enable={init:function(){this.appendDummyInput().appendField(Blockly.Msg.NBIOT_ENABLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(Blockly.Blocks.nbiot.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.NBIoT_http_thingspeak={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/nbiot_header.png",100,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.NBIOT_HTTP_THINGSPEAK_TITLE);this.appendDummyInput().appendField(Blockly.Msg.NBIOT_HTTP_THINGSPEAK_APIKEY).appendField(new Blockly.FieldTextInput("yourEventAPIKey"),"APIKEY");this.appendValueInput("ADD0").appendField(Blockly.Msg.NBIOT_HTTP_DATA).setAlign(Blockly.ALIGN_RIGHT);this.setPreviousStatement(!0);
- this.setNextStatement(!0);this.itemCount_=1;this.updateShape_();this.setMutator(new Blockly.Mutator(["NBIoT_create_with_item"]));this.setColour(Blockly.Blocks.nbiot.HUE);this.setTooltip("");this.setHelpUrl("")},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=a.newBlock("NBIoT_create_with_container");b.initSvg();
- for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("NBIoT_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=
- 0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.NBIOT_HTTP_DATA).setAlign(Blockly.ALIGN_RIGHT);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+
- a),a++},onchange:function(){var a=this.getFieldValue("APIKEY");50<a.length&&this.setFieldValue(a.substring(0,50),"APIKEY")}};
- Blockly.Blocks.NBIoT_http_IFTTT={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/nbiot_header.png",130,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.NBIOT_HTTP_IFTTT_TITLE);this.appendDummyInput().appendField(Blockly.Msg.NBIOT_HTTP_IFTTT_APIKEY).appendField(new Blockly.FieldTextInput("yourEventAPIKey"),"APIKEY");this.appendDummyInput().appendField(Blockly.Msg.NBIOT_HTTP_IFTTT_EVENT).appendField(new Blockly.FieldTextInput("yourEventName"),"EVENT");
- this.appendValueInput("ADD0").appendField(Blockly.Msg.NBIOT_HTTP_DATA+"0").setAlign(Blockly.ALIGN_RIGHT);this.setPreviousStatement(!0);this.setNextStatement(!0);this.itemCount_=1;this.updateShape_();this.setMutator(new Blockly.Mutator(["NBIoT_create_with_item"]));this.setColour(Blockly.Blocks.nbiot.HUE);this.setTooltip("");this.setHelpUrl("")},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=a.newBlock("NBIoT_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("NBIoT_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=
- this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+
- a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.NBIOT_HTTP_DATA).setAlign(Blockly.ALIGN_RIGHT);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++},onchange:function(){var a=this.getFieldValue("APIKEY");50<a.length&&this.setFieldValue(a.substring(0,50),"APIKEY")}};Blockly.Blocks.NBIoT_network_connected={init:function(){this.appendDummyInput().appendField(Blockly.Msg.NBIOT_NETWORK_CONNECTED);this.setColour(Blockly.Blocks.nbiot.HUE);this.setOutput(!0)}};
- Blockly.Blocks.NBIoT_powered_on={init:function(){this.appendDummyInput().appendField(Blockly.Msg.NBIOT_IS_POWERON);this.setColour(Blockly.Blocks.nbiot.HUE);this.setOutput(!0)}};Blockly.Blocks.NBIoT_network_IP={init:function(){this.appendDummyInput().appendField(Blockly.Msg.NBIOT_NETWORK_IP);this.setColour(Blockly.Blocks.nbiot.HUE);this.setOutput(!0,Blockly.Types.TEXT.output)},getBlockType:function(){return Blockly.Types.TEXT}};
- Blockly.Blocks.NBIoT_http_cococloud_get={init:function(){this.appendDummyInput().appendField(Blockly.Msg.NBIOT_HTTP_CLOUD_GET);this.appendDummyInput().appendField(Blockly.Msg.NBIOT_HTTP_APIKEY).appendField(new Blockly.FieldTextInput("yourCloudEventAPIKey"),"APIKEY");this.setOutput(!0)}};Blockly.Blocks.procedures.HUE=340;Blockly.Blocks.arduino_functions={init:function(){this.appendDummyInput().appendField(Blockly.Msg.ARD_FUN_RUN_SETUP);this.appendStatementInput("SETUP_FUNC");this.setInputsInline(!1);this.setColour(Blockly.Blocks.procedures.HUE);this.setTooltip(Blockly.Msg.ARD_FUN_RUN_TIP);this.setHelpUrl("https://arduino.cc/en/Reference/Loop");this.contextMenu=!1},getArduinoLoopsInstance:function(){return!0}};Blockly.Blocks.robot={};Blockly.Blocks.screen={};Blockly.Blocks.lcd_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-screen.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.OLCD_SETUP);this.setColour(245);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.lcd_set_width_height={init:function(){this.appendValueInput("WIDTH").setCheck("Number").appendField(Blockly.Msg.OLCD_WIDTH);this.appendValueInput("HEIGHT").setCheck("Number").appendField(Blockly.Msg.OLCD_HEIGHT);this.setOutput(!0,"String");this.setInputsInline(!0);this.setColour(245);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.lcd_set_position={init:function(){this.appendValueInput("POSX").setCheck("Number").appendField("X:");this.appendValueInput("POSY").setCheck("Number").appendField("Y:");this.setOutput(!0,"String");this.setInputsInline(!0);this.setColour(245);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.lcd_drawline={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/line.png",25,25,"15"));this.appendDummyInput().appendField(Blockly.Msg.OLCD_DRAW+Blockly.Msg.OLCD_LINE);this.appendValueInput("COLOR").setCheck("String").appendField(Blockly.Msg.OLCD_COLOR);this.appendValueInput("POSA").setCheck("String").appendField(Blockly.Msg.OLCD_LINE_START);this.appendValueInput("POSB").setCheck("String").appendField(Blockly.Msg.OLCD_LINE_END);this.setInputsInline(!1);
- this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(245);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.lcd_drawrect={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/rect.png",25,25,"15"));this.appendDummyInput().appendField(Blockly.Msg.OLCD_DRAW).appendField(new Blockly.FieldDropdown([[Blockly.Msg.OLCD_FULL,"fill"],[Blockly.Msg.OLCD_STROKED,"draw"]]),"rect_type").appendField(Blockly.Msg.OLCD_RECTANGLE);this.appendValueInput("COLOR").setCheck("String").appendField(Blockly.Msg.OLCD_COLOR);this.appendValueInput("SIZE").setCheck("String").appendField(Blockly.Msg.OLCD_SIZE);
- this.appendValueInput("POS").setCheck("String").appendField(Blockly.Msg.OLCD_COORDINATE);this.setInputsInline(!1);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(245);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.lcd_drawcircle={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/circle.png",25,25,"15"));this.appendDummyInput().appendField(Blockly.Msg.OLCD_DRAW).appendField(new Blockly.FieldDropdown([[Blockly.Msg.OLCD_FULL,"fill"],[Blockly.Msg.OLCD_STROKED,"draw"]]),"circle_type").appendField(Blockly.Msg.OLCD_CIRCLE);this.appendValueInput("COLOR").setCheck("String").appendField(Blockly.Msg.OLCD_COLOR);this.appendValueInput("POS").setCheck("String").appendField(Blockly.Msg.OLCD_CENTER_POS);
- this.appendValueInput("RADIUS").setCheck("Number").appendField(Blockly.Msg.OLCD_RADIUS);this.setInputsInline(!1);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(245);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.lcd_drawtriangle={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/triangle.png",25,25,"15"));this.appendDummyInput().appendField(Blockly.Msg.OLCD_DRAW).appendField(new Blockly.FieldDropdown([[Blockly.Msg.OLCD_FULL,"fill"],[Blockly.Msg.OLCD_STROKED,"draw"]]),"triangle_type").appendField(Blockly.Msg.OLCD_TRIANGLE);this.appendValueInput("COLOR").setCheck(null).appendField(Blockly.Msg.OLCD_COLOR);this.appendValueInput("POSA").setCheck("String").appendField(Blockly.Msg.OLCD_POINT+
- " A");this.appendValueInput("POSB").setCheck("String").appendField(Blockly.Msg.OLCD_POINT+" B");this.appendValueInput("POSC").setCheck("String").appendField(Blockly.Msg.OLCD_POINT+" C");this.setInputsInline(!1);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(245);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.lcd_text={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/text.png",25,25,"15"));this.appendDummyInput().appendField(Blockly.Msg.OLCD_TEXTNEWLINE).appendField(new Blockly.FieldDropdown([[Blockly.Msg.OLCD_TRUE,"println"],[Blockly.Msg.OLCD_FALSE,"print"]]),"print_type");this.appendValueInput("INPUT").setCheck(null).appendField(Blockly.Msg.OLCD_TEXT);this.appendValueInput("COLOR").setCheck("String").appendField(Blockly.Msg.OLCD_COLOR);this.appendValueInput("POS").setCheck("String").appendField(Blockly.Msg.OLCD_COORDINATE);
- this.appendValueInput("SIZE").setCheck("Number").appendField(Blockly.Msg.OLCD_SIZE);this.setInputsInline(!1);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(245);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.lcd_clear={init:function(){this.appendDummyInput().appendField(Blockly.Msg.OLCD_CLEAR);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(245);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.lcd_rotation={init:function(){this.appendDummyInput().appendField(Blockly.Msg.OLCD_SETROTATION).appendField(new Blockly.FieldDropdown([["0","0"],["90","1"],["180","2"],["270","3"]]),"DEGREE").appendField(Blockly.Msg.OLCD_SETROTATION_DEGREE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(245);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.lcd_set_color={init:function(){this.appendDummyInput().appendField(Blockly.Msg.COLOR).appendField(new Blockly.FieldColour("#ff0000"),"COLOR");this.setOutput(!0,"String");this.setColour(245);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.lcd_set_colorRGB={init:function(){this.appendDummyInput().appendField(Blockly.Msg.COLOR);this.appendValueInput("RED_VAL").setCheck(null).appendField(Blockly.Msg.RED);this.appendValueInput("GREEN_VAL").setCheck(null).appendField(Blockly.Msg.GREEN);this.appendValueInput("BLUE_VAL").setCheck(null).appendField(Blockly.Msg.BLUE);this.setInputsInline(!0);this.setOutput(!0,"String");this.setColour(245);this.setTooltip("");this.setHelpUrl("http://help.cocorobo.cn/#/cocomod/color-analyzer?id=rgb-%E5%8F%96%E8%89%B2%E5%99%A8")}};Blockly.Blocks.serial={};Blockly.Blocks.serial.HUE=80;
- Blockly.Blocks.serial_setup={init:function(){this.setHelpUrl("http://arduino.cc/en/Serial/Begin");this.setColour(Blockly.Blocks.serial.HUE);this.appendDummyInput().appendField(Blockly.Msg.ARD_SERIAL_SETUP).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.serial.concat([["serial1","Serial1"]])),"SERIAL_ID").appendField(Blockly.Msg.ARD_SERIAL_SPEED).appendField(new Blockly.FieldDropdown([["9600","9600"],["115200","115200"]]),"SPEED").appendField(Blockly.Msg.ARD_SERIAL_BPS);this.setInputsInline(!0);
- this.setTooltip(Blockly.Msg.ARD_SERIAL_SETUP_TIP)},getSerialSetupInstance:function(){return this.getFieldValue("SERIAL_ID")},updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,"SERIAL_ID","serial");Blockly.Python.Boards.refreshBlockFieldDropdown(this,"SPEED","serialSpeed")}};
- Blockly.Blocks.serial_print={init:function(){this.setHelpUrl("http://www.arduino.cc/en/Serial/Print");this.setColour(Blockly.Blocks.serial.HUE);this.appendDummyInput().appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.serial),"SERIAL_ID").appendField(Blockly.Msg.ARD_SERIAL_PRINT);this.appendValueInput("CONTENT").setCheck(null);this.appendDummyInput().appendField(new Blockly.FieldCheckbox("TRUE"),"NEW_LINE").appendField(Blockly.Msg.ARD_SERIAL_PRINT_NEWLINE);this.setInputsInline(!0);
- this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip(Blockly.Msg.ARD_SERIAL_PRINT_TIP)},updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,"SERIAL_ID","serial")}};
- Blockly.Blocks.serial1_write={init:function(){this.setHelpUrl("http://www.arduino.cc/en/Serial/Write");this.setColour(Blockly.Blocks.serial.HUE);this.appendDummyInput().appendField(new Blockly.FieldDropdown([["serial1","Serial1"]]),"SERIAL_ID").appendField(Blockly.Msg.ARD_SERIAL_WRITE);this.appendValueInput("CONTENT").setCheck(null);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip(Blockly.Msg.ARD_SERIAL_PRINT_TIP)}};
- Blockly.Blocks.serial1_read={init:function(){this.setHelpUrl("http://www.arduino.cc/en/Serial/Read");this.setColour(Blockly.Blocks.serial.HUE);this.appendDummyInput().appendField(new Blockly.FieldDropdown([["serial1","Serial1"]]),"SERIAL_ID").appendField(Blockly.Msg.ARD_SERIAL_READ);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip(Blockly.Msg.ARD_SERIAL_PRINT_TIP)}};
- Blockly.Blocks.serial1_available={init:function(){this.setColour(Blockly.Blocks.serial.HUE);this.appendDummyInput().appendField(new Blockly.FieldDropdown([["serial1","Serial1"]]),"SERIAL_ID").appendField(Blockly.Msg.ARD_SERIAL_AVAILABLE);this.setOutput(!0);this.setTooltip(Blockly.Msg.ARD_SERIAL_PRINT_TIP)}};Blockly.Blocks.servo={};Blockly.Blocks.servo.HUE=200;Blockly.Blocks.servo_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-servo.png",50,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.ARD_SERVO_SETUP);this.setColour(Blockly.Blocks.servo.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.servo_write={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/ServoWrite");this.setColour(Blockly.Blocks.servo.HUE);this.appendDummyInput().appendField(Blockly.Msg.ARD_SERVO_WRITE).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.pwmPins),"SERVO_PIN");this.setInputsInline(!1);this.appendValueInput("SERVO_ANGLE").setCheck(Blockly.Types.NUMBER.checkList).appendField(Blockly.Msg.ARD_SERVO_WRITE_TO);this.appendDummyInput().appendField(Blockly.Msg.ARD_SERVO_WRITE_DEG_180);
- this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip(Blockly.Msg.ARD_SERVO_WRITE_TIP)},updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,"SERVO_PIN","pwmPins")}};
- Blockly.Blocks.servo_read={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/ServoRead");this.setColour(Blockly.Blocks.servo.HUE);this.appendDummyInput().appendField(Blockly.Msg.ARD_SERVO_READ).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.pwmPins),"SERVO_PIN");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setTooltip(Blockly.Msg.ARD_SERVO_READ_TIP)},getBlockType:function(){return Blockly.Types.NUMBER},updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,
- "SERVO_PIN","pwmPins")}};
- Blockly.Blocks.robot_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-biped_robot.png",50,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.ROBOT_SETUP);this.appendDummyInput().appendField(Blockly.Msg.ROBOT_SETUP_SETYLPIN).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.pwmPins),"YL_PIN").appendField(Blockly.Msg.ROBOT_SETUP_SETYRPIN).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.pwmPins),"YR_PIN");
- this.appendDummyInput().appendField(Blockly.Msg.ROBOT_SETUP_SETRLPIN).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.pwmPins),"RL_PIN").appendField(Blockly.Msg.ROBOT_SETUP_SETRRPIN).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.pwmPins),"RR_PIN");this.setNextStatement(!1,null);this.setColour(Blockly.Blocks.servo.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.robot_set_movement={init:function(){this.appendValueInput("MOVEMENT").setCheck("String").appendField(Blockly.Msg.ROBOT_SETMOVE_MOVEMENT);this.appendValueInput("TEMPO").setCheck("Number").appendField(Blockly.Msg.ROBOT_SETMOVE_TEMPO);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.servo.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.robot_movement={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Blockly.Msg.ROBOT_SETMOVE_MOVEMENT_GOINGUP,"goingUp"],[Blockly.Msg.ROBOT_SETMOVE_MOVEMENT_KICKLEFT,"kickLeft"],[Blockly.Msg.ROBOT_SETMOVE_MOVEMENT_KICKRIGHT,"kickRight"],[Blockly.Msg.ROBOT_SETMOVE_MOVEMENT_RUN,"run"],[Blockly.Msg.ROBOT_SETMOVE_MOVEMENT_WALK,"walk"],[Blockly.Msg.ROBOT_SETMOVE_MOVEMENT_BACKYARD,"backyard"],[Blockly.Msg.ROBOT_SETMOVE_MOVEMENT_TURNLEFT,"turnLeft"],[Blockly.Msg.ROBOT_SETMOVE_MOVEMENT_TURNRIGHT,
- "turnRight"],[Blockly.Msg.ROBOT_SETMOVE_MOVEMENT_MOONWALKLEFT,"moonWalkLeft"],[Blockly.Msg.ROBOT_SETMOVE_MOVEMENT_MOONWALKRIGHT,"moonWalkRight"],[Blockly.Msg.ROBOT_SETMOVE_MOVEMENT_SWING,"swing"]]),"MOVEMENT");this.setOutput(!0,null);this.setColour(Blockly.Blocks.servo.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.robot_tempo={init:function(){this.appendDummyInput().appendField(new Blockly.FieldNumber(400),"TEMPO");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(Blockly.Blocks.servo.HUE);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};Blockly.Blocks.spi={};Blockly.Blocks.spi.HUE=80;
- Blockly.Blocks.spi_setup={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/SPI");this.setColour(Blockly.Blocks.spi.HUE);this.appendDummyInput().appendField(Blockly.Msg.ARD_SPI_SETUP).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.spi),"SPI_ID").appendField(Blockly.Msg.ARD_SPI_SETUP_CONF);this.appendDummyInput().appendField(Blockly.Msg.ARD_SPI_SETUP_SHIFT).appendField(new Blockly.FieldDropdown([[Blockly.Msg.ARD_SPI_SETUP_MSBFIRST,"MSBFIRST"],[Blockly.Msg.ARD_SPI_SETUP_LSBFIRST,
- "LSBFIRST"]]),"SPI_SHIFT_ORDER");this.appendDummyInput().appendField(Blockly.Msg.ARD_SPI_SETUP_DIVIDE).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.spiClockDivide),"SPI_CLOCK_DIVIDE");this.appendDummyInput().appendField(Blockly.Msg.ARD_SPI_SETUP_MODE).appendField(new Blockly.FieldDropdown([[Blockly.Msg.ARD_SPI_SETUP_MODE0,"SPI_MODE0"],[Blockly.Msg.ARD_SPI_SETUP_MODE1,"SPI_MODE1"],[Blockly.Msg.ARD_SPI_SETUP_MODE2,"SPI_MODE2"],[Blockly.Msg.ARD_SPI_SETUP_MODE3,"SPI_MODE3"]]),
- "SPI_MODE");this.setTooltip(Blockly.Msg.ARD_SPI_SETUP_TIP)},getSpiSetupInstance:function(){return this.getFieldValue("SPI_ID")},updateFields:function(){Blockly.Python.Boards.refreshBlockFieldDropdown(this,"SPI_ID","spi");Blockly.Python.Boards.refreshBlockFieldDropdown(this,"SPI_CLOCK_DIVIDE","spiClockDivide")}};
- Blockly.Blocks.spi_transfer={init:function(){var a=[[Blockly.Msg.ARD_SPI_TRANS_NONE,"none"]].concat(Blockly.Python.Boards.selected.digitalPins);this.setHelpUrl("http://arduino.cc/en/Reference/SPITransfer");this.setColour(Blockly.Blocks.spi.HUE);this.appendDummyInput().appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.spi),"SPI_ID");this.appendValueInput("SPI_DATA").setCheck(Blockly.Types.NUMBER.checkList).appendField(Blockly.Msg.ARD_SPI_TRANS_VAL);this.appendDummyInput().appendField(Blockly.Msg.ARD_SPI_TRANS_SLAVE).appendField(new Blockly.FieldDropdown(a),
- "SPI_SS");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip(Blockly.Msg.ARD_SPI_TRANS_TIP)},onchange:function(){if(this.workspace){for(var a=this.getFieldValue("SPI_ID"),b=Blockly.mainWorkspace.getTopBlocks(),c=!1,e=0,d=b.length;e<d;e++){var f=b[e].getSpiSetupInstance;f&&(f=f.call(b[e]),a==f&&(c=!0))}c?this.setWarningText(null,"spi_setup"):this.setWarningText(Blockly.Msg.ARD_SPI_TRANS_WARN1.replace("%1",a),"spi_setup")}},getBlockType:function(){return Blockly.Types.NUMBER},
- updateFields:function(){var a=this.getField("SPI_SS"),b=a.getValue();a.menuGenerator_=[[Blockly.Msg.ARD_SPI_TRANS_NONE,"none"]].concat(Blockly.Python.Boards.selected.digitalPins);for(var c=!1,e=0,d=a.menuGenerator_.length;e<d;e++)b==a.menuGenerator_[e][1]&&(c=!0);c?this.setWarningText(null,"bPin"):this.setWarningText(Blockly.Msg.ARD_SPI_TRANS_WARN2.replace("%1",b),"bPin")}};
- Blockly.Blocks.spi_transfer_return={init:function(){var a=[[Blockly.Msg.ARD_SPI_TRANS_NONE,"none"]].concat(Blockly.Python.Boards.selected.digitalPins);this.setHelpUrl("http://arduino.cc/en/Reference/SPITransfer");this.setColour(Blockly.Blocks.spi.HUE);this.appendDummyInput().appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.spi),"SPI_ID");this.appendValueInput("SPI_DATA").appendField(Blockly.Msg.ARD_SPI_TRANS_VAL);this.appendDummyInput().appendField(Blockly.Msg.ARD_SPI_TRANS_SLAVE).appendField(new Blockly.FieldDropdown(a),
- "SPI_SS");this.setInputsInline(!0);this.setOutput(!0);this.setTooltip(Blockly.Msg.ARD_SPI_TRANSRETURN_TIP)},onchange:Blockly.Blocks.spi_transfer.onchange,getBlockType:Blockly.Blocks.spi_transfer.getBlockType,updateFields:Blockly.Blocks.spi_transfer.updateFields};Blockly.Blocks.stepper={};Blockly.Blocks.stepper.HUE=80;
- Blockly.Blocks.stepper_config={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/StepperConstructor");this.setColour(Blockly.Blocks.stepper.HUE);this.appendDummyInput().appendField(Blockly.Msg.ARD_STEPPER_SETUP).appendField(new Blockly.FieldInstance("Stepper",Blockly.Msg.ARD_STEPPER_DEFAULT_NAME,!0,!0,!1),"STEPPER_NAME").appendField(Blockly.Msg.ARD_STEPPER_MOTOR);this.appendDummyInput().setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.ARD_STEPPER_PIN1).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins),"STEPPER_PIN1").appendField(Blockly.Msg.ARD_STEPPER_PIN2).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins),
- "STEPPER_PIN2");this.appendValueInput("STEPPER_STEPS").setCheck(Blockly.Types.NUMBER.checkList).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.ARD_STEPPER_REVOLVS);this.appendValueInput("STEPPER_SPEED").setCheck(Blockly.Types.NUMBER.checkList).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.ARD_STEPPER_SPEED);this.setTooltip(Blockly.Msg.ARD_STEPPER_SETUP_TIP)},updateFields:function(){Blockly.Boards.refreshBlockFieldDropdown(this,"STEPPER_PIN1","digitalPins");Blockly.Boards.refreshBlockFieldDropdown(this,
- "STEPPER_PIN2","digitalPins")}};
- Blockly.Blocks.stepper_step={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/StepperStep");this.setColour(Blockly.Blocks.stepper.HUE);this.appendDummyInput().appendField(Blockly.Msg.ARD_STEPPER_STEP).appendField(new Blockly.FieldInstance("Stepper",Blockly.Msg.ARD_STEPPER_DEFAULT_NAME,!1,!0,!1),"STEPPER_NAME");this.appendValueInput("STEPPER_STEPS").setCheck(Blockly.Types.NUMBER.checkList);this.appendDummyInput().appendField(Blockly.Msg.ARD_STEPPER_STEPS);this.setPreviousStatement(!0);
- this.setNextStatement(!0);this.setTooltip(Blockly.Msg.ARD_STEPPER_STEP_TIP)},onchange:function(){if(this.workspace){var a=this.getFieldValue("STEPPER_NAME");Blockly.Instances.isInstancePresent(a,"Stepper",this)?this.setWarningText(null):this.setWarningText(Blockly.Msg.ARD_COMPONENT_WARN1.replace("%1",Blockly.Msg.ARD_STEPPER_COMPONENT).replace("%2",a))}}};Blockly.Blocks.third_party={};
- Blockly.Blocks.sonar_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/sensors-ultrasonic.png",50,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.SONAR).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]]),"NUMBER").appendField(Blockly.Msg.SONAR_SETUP);this.appendDummyInput().appendField(Blockly.Msg.SONAR_SETUP_TRIGPIN).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins.concat(Blockly.Python.Boards.selected.analogPins)),"TRIG_PIN").appendField(Blockly.Msg.SONAR_SETUP_ECHOPIN).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.digitalPins.concat(Blockly.Python.Boards.selected.analogPins)),
- "ECHO_PIN");this.appendDummyInput().appendField(Blockly.Msg.SONAR_SETUP_MAXDIST).appendField(new Blockly.FieldNumber(50),"MAXDIST");this.setColour(300);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.sonar_read_dist={init:function(){this.appendDummyInput().appendField(Blockly.Msg.SONAR_READ_DIST).appendField(Blockly.Msg.SONAR).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]]),"NUMBER");this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(300);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.infraredRay_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/sensors-ir_receiver.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.INFRAREDRAY_SETUP);this.setColour(300);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.infraredRay_receive_val={init:function(){this.appendDummyInput().appendField(Blockly.Msg.INFRAREDRAY_RECVAL);this.setOutput(!0,Blockly.Types.TEXT.output);this.setColour(300);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.TEXT}};
- Blockly.Blocks.infraredRay_send_val={init:function(){this.appendDummyInput().appendField(new Blockly.FieldDropdown([["\u2191","KEYPAD_UP"],["\u2193","KEYPAD_DOWN"],["\u2190","KEYPAD_LEFT"],["\u2192","KEYPAD_RIGHT"],["OK","KEYPAD_OK"],["1","KEYPAD_1"],["2","KEYPAD_2"],["3","KEYPAD_3"],["4","KEYPAD_4"],["5","KEYPAD_5"],["6","KEYPAD_6"],["7","KEYPAD_7"],["8","KEYPAD_8"],["9","KEYPAD_9"],["0","KEYPAD_0"],["*","KEYPAD_STAR"],["#","KEYPAD_NUMSIGN"]]),"VALTYPE");this.setOutput(!0,Blockly.Types.TEXT.output);
- this.setColour(300);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.TEXT}};Blockly.Blocks.RTC_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/sensors-rtc.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.RTC_SETUP);this.setColour(340);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.RTC_setDateTime={init:function(){this.appendDummyInput().appendField(Blockly.Msg.RTC_SETDATETIME);this.appendDummyInput().appendField(Blockly.Msg.RTC_SETDATE).appendField(new Blockly.FieldNumber(2018,0,2050),"year").appendField("-").appendField(new Blockly.FieldNumber(1,0,12),"month").appendField("-").appendField(new Blockly.FieldNumber(1,0,31),"day");this.appendDummyInput().appendField(Blockly.Msg.RTC_SETTIME).appendField(new Blockly.FieldNumber(12,0,24),"hour").appendField(":").appendField(new Blockly.FieldNumber(30,
- 0,60),"minute").appendField(":").appendField(new Blockly.FieldNumber(10,0,60),"second");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setColour(340);this.setTooltip("");this.setHelpUrl("")},onchange:function(){2050<this.getFieldValue("year")&&this.setFieldValue("2019","year");12<this.getFieldValue("month")?this.setFieldValue("12","month"):0>this.getFieldValue("month")&&this.setFieldValue("1","month");31<this.getFieldValue("day")?this.setFieldValue("31","day"):0>this.getFieldValue("day")&&
- this.setFieldValue("1","day");24<this.getFieldValue("hour")?this.setFieldValue("24","hour"):0>this.getFieldValue("hour")&&this.setFieldValue("1","hour");60<this.getFieldValue("minute")?this.setFieldValue("60","minute"):0>this.getFieldValue("minute")&&this.setFieldValue("1","minute");60<this.getFieldValue("second")?this.setFieldValue("60","second"):0>this.getFieldValue("second")&&this.setFieldValue("1","second")}};
- Blockly.Blocks.RTC_getDate={init:function(){this.appendDummyInput().appendField(Blockly.Msg.RTC_GETDATE).appendField(new Blockly.FieldDropdown([[Blockly.Msg.RTC_YEAR,"year"],[Blockly.Msg.RTC_MONTH,"month"],[Blockly.Msg.RTC_DAY,"day"]]),"date_detail");this.setColour(340);this.setOutput(!0,Blockly.Types.TEXT.output);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.TEXT}};
- Blockly.Blocks.RTC_getTime={init:function(){this.appendDummyInput().appendField(Blockly.Msg.RTC_GETTIME).appendField(new Blockly.FieldDropdown([[Blockly.Msg.RTC_HOUR,"hour"],[Blockly.Msg.RTC_MINUTE,"minute"],[Blockly.Msg.RTC_SECOND,"second"]]),"time_detail");this.setColour(340);this.setOutput(!0,Blockly.Types.TEXT.output);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.TEXT}};
- Blockly.Blocks.RTC_getWeek={init:function(){this.appendDummyInput().appendField(Blockly.Msg.RTC_GETWEEK);this.setColour(340);this.setOutput(!0,Blockly.Types.TEXT.output);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.TEXT}};
- Blockly.Blocks.PulseSensor_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/sensors-heart_beat.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.PULSESENSOR_SETUP);this.appendDummyInput().appendField(Blockly.Msg.PULSESENSOR_SETUP_1).appendField(new Blockly.FieldDropdown(Blockly.Python.Boards.selected.analogPins),"PIN");this.setColour(360);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.PulseSensor_getBPM={init:function(){this.appendDummyInput().appendField(Blockly.Msg.PULSESENSOR_GETBPM);this.setOutput(!0,Blockly.Types.NUMBER.output);this.setColour(360);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.PulseSensor_Heart_Beats={init:function(){this.appendDummyInput().appendField(Blockly.Msg.PULSESENSOR_HEARTBEAT_WHEN);this.setOutput(!0,Blockly.Types.BOOLEAN.output);this.setColour(360);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.BOOLEAN}};
- Blockly.Blocks.PulseSensor_Heart_noBeats={init:function(){this.appendDummyInput().appendField(Blockly.Msg.PULSESENSOR_HEARTBEAT_WHENNO);this.setOutput(!0,Blockly.Types.BOOLEAN.output);this.setColour(360);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.BOOLEANs}};
- Blockly.Blocks.PulseSensor_print={init:function(){this.appendDummyInput().appendField(Blockly.Msg.PULSESENSOR_HEARTBEAT_PRINT);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(360);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.Encoder_Setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/sensors-encoder.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.ENCODER_SETUP);this.appendDummyInput().appendField(Blockly.Msg.ENCODER_SETUP_1).appendField(new Blockly.FieldDropdown([["2","2"],["3","3"]]),"PIN");this.setColour(260);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.Encoder_getRotationSpeed={init:function(){this.appendDummyInput().appendField(Blockly.Msg.ENCODER_GETROTATIONSPEED);this.setOutput(!0);this.setColour(260);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.identifyNumber("1")}};
- Blockly.Blocks.RFID_Setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/sensors-rfid.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.RFID_SETUP);this.setColour(230);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.RFID_ReadID={init:function(){this.appendDummyInput().appendField(Blockly.Msg.RFID_READID);this.setOutput(!0,Blockly.Types.TEXT.output);this.setColour(230);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.TEXT}};
- Blockly.Blocks.GPS_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/gps_header.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.GPS_SETUP);this.setColour(210);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.GPS_getLatitude={init:function(){this.appendDummyInput().appendField(Blockly.Msg.GPS_LATITUDE);this.setOutput(!0,Blockly.Types.TEXT.output);this.setColour(210);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.TEXT}};
- Blockly.Blocks.GPS_getLongitude={init:function(){this.appendDummyInput().appendField(Blockly.Msg.GPS_LONGITUDE);this.setOutput(!0,Blockly.Types.TEXT.output);this.setColour(210);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.TEXT}};
- Blockly.Blocks.water_temp_sensor_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/water-temp-sensor-setup.png",70,60,"*"));this.appendDummyInput().appendField(Blockly.Msg.WATERTEMP_SETUP_BLOCKNAME);this.appendDummyInput().appendField(Blockly.Msg.WATERTEMP_SETUP_SENSORTYPE).appendField(new Blockly.FieldDropdown([["DS18S20","water_temp_sensor_setup_"]]),"water_temp_sensor_setup_dropdown").appendField(Blockly.Msg.WATERTEMP_SETUP_SETUP);this.appendDummyInput().appendField(Blockly.Msg.WATERTEMP_SETUP_ATTACHED_PIN).appendField(new Blockly.FieldNumber(3,
- 0,13,1),"water_temp_sensor_setup_pin");this.setColour(0);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.water_temp_sensor_get_value={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WATERTEMP_GET_TEMP);this.setOutput(!0,Blockly.Types.DECIMAL.output);this.setColour(0);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.DECIMAL}};
- Blockly.Blocks.thirdparty_co2_sensor_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/third-party_co2_header.png",180,50,{alt:"*",flipRtl:"FALSE"}));this.appendDummyInput().appendField(Blockly.Msg.CO2SENSOR_SETUP);this.appendDummyInput().appendField(Blockly.Msg.CO2SENSOR_SETUP_SDA).appendField(new Blockly.FieldDropdown([["D2","D2"]]),"thirdparty_co2_sensor_setup_sdapin").appendField(Blockly.Msg.CO2SENSOR_SETUP_SCL).appendField(new Blockly.FieldDropdown([["D3",
- "D3"]]),"thirdparty_co2_sensor_setup_sclpin");this.setColour(330);this.setTooltip("");this.setHelpUrl("https://help.cocorobo.cn/")}};Blockly.Blocks.thirdparty_co2_sensor_get_co2={init:function(){this.appendDummyInput().appendField(Blockly.Msg.CO2SENSOR_GET_CO2);this.setOutput(!0,null);this.setColour(330);this.setTooltip("");this.setHelpUrl("https://help.cocorobo.cn/")}};
- Blockly.Blocks.thirdparty_co2_sensor_get_tvoc={init:function(){this.appendDummyInput().appendField(Blockly.Msg.CO2SENSOR_GET_TVOC);this.setOutput(!0,null);this.setColour(330);this.setTooltip("");this.setHelpUrl("https://help.cocorobo.cn/")}};
- Blockly.Blocks.thirdparty_nrf24l01_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/third-party_nrf-sensor.png",130,50,{alt:"*",flipRtl:"FALSE"}));this.appendDummyInput().appendField(Blockly.Msg.NRFMODULE_SETUP_TITLE);this.appendDummyInput().appendField(Blockly.Msg.NRFMODULE_SETUP_CE_TEXT).appendField(new Blockly.FieldDropdown([["D7","d7"]]),"thirdparty_nrf24l01_setup_dropdown_cepin").appendField(Blockly.Msg.NRFMODULE_SETUP_CSN_TEXT).appendField(new Blockly.FieldDropdown([["D5",
- "d5"]]),"thirdparty_nrf24l01_setup_dropdown_csnpin");this.appendDummyInput().appendField(Blockly.Msg.NRFMODULE_SETUP_SET_ADDRESS).appendField(new Blockly.FieldTextInput("00001"),"thirdparty_nrf24l01_setup_addr");this.setColour(230);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.thirdparty_nrf24l01_send_data={init:function(){this.appendDummyInput().appendField(Blockly.Msg.NRFMODULE_SEND_DATA_TITLE);this.appendDummyInput().appendField(Blockly.Msg.NRFMODULE_SEND_DATA_DATA_TEXT).appendField(new Blockly.FieldTextInput("Hello World"),"thirdparty_nrf24l01_send_data_data");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(230);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.thirdparty_nrf24l01_receive_data={init:function(){this.appendDummyInput().appendField(Blockly.Msg.NRFMODULE_RECEIVING_DATA_TEXT);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(230);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.thirdparty_nrf24l01_data_received={init:function(){this.appendDummyInput().appendField(Blockly.Msg.NRFMODULE_GET_RECEIVED_DATA);this.setOutput(!0,null);this.setColour(230);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.time={};Blockly.Blocks.time.HUE=50;Blockly.Blocks.time_delay={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/Delay");this.setColour(Blockly.Blocks.time.HUE);this.appendValueInput("DELAY_TIME_MILI").setCheck(Blockly.Types.NUMBER.checkList).appendField(Blockly.Msg.ARD_TIME_DELAY);this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MS);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip(Blockly.Msg.ARD_TIME_DELAY_TIP)}};
- Blockly.Blocks.time_delaymicros={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/DelayMicroseconds");this.setColour(Blockly.Blocks.time.HUE);this.appendValueInput("DELAY_TIME_MICRO").setCheck(Blockly.Types.NUMBER.checkList).appendField(Blockly.Msg.ARD_TIME_DELAY);this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_DELAY_MICROS);this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip(Blockly.Msg.ARD_TIME_DELAY_MICRO_TIP)}};
- Blockly.Blocks.time_millis={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/Millis");this.setColour(Blockly.Blocks.time.HUE);this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MILLIS);this.setOutput(!0,Blockly.Types.LARGE_NUMBER.output);this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP)},getBlockType:function(){return Blockly.Types.LARGE_NUMBER}};
- Blockly.Blocks.time_micros={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/Micros");this.setColour(Blockly.Blocks.time.HUE);this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MICROS);this.setOutput(!0,Blockly.Types.LARGE_NUMBER.output);this.setTooltip(Blockly.Msg.ARD_TIME_MICROS_TIP)},getBlockType:function(){return Blockly.Types.LARGE_NUMBER}};
- Blockly.Blocks.infinite_loop={init:function(){this.setHelpUrl("");this.setColour(Blockly.Blocks.time.HUE);this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_INF);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setTooltip(Blockly.Msg.ARD_TIME_INF_TIP)}};
- Blockly.Blocks.time_chrono_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/stopwatch-header.png",40,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_CHRONO_SETUP);this.setHelpUrl("");this.setColour("#eeaf3c");this.setTooltip(Blockly.Msg.ARD_TIME_INF_TIP)}};
- Blockly.Blocks.time_chrono_reset={init:function(){this.setHelpUrl("");this.setColour("#eeaf3c");this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_CHRONO_RESET);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("")}};Blockly.Blocks.time_chrono_elapsed={init:function(){this.setHelpUrl("");this.setColour("#eeaf3c");this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_CHRONO_ELAPSED);this.setOutput(!0);this.setTooltip("")}};
- Blockly.Blocks.time_chrono_timeCheck={init:function(){this.setHelpUrl("");this.setColour("#eeaf3c");this.appendValueInput("TIME").appendField(Blockly.Msg.ARD_TIME_CHRONO_CHECK);this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_CHRONO_CHECK1);this.setInputsInline(!0);this.setOutput(!0);this.setTooltip("")}};
- Blockly.Blocks.time_everySecond={init:function(){this.setColour(Blockly.Blocks.time.HUE);this.appendValueInput("TIME").appendField(Blockly.Msg.ARD_TIME_EVERY);this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_SECOND);this.appendStatementInput("STACK").appendField(Blockly.Msg.ARD_TIME_DO);this.setPreviousStatement(!0);this.setNextStatement(!0)}};
- Blockly.Blocks.time_everyMilliSecond={init:function(){this.setColour(Blockly.Blocks.time.HUE);this.appendValueInput("TIME").appendField(Blockly.Msg.ARD_TIME_EVERY_MS);this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_SECOND_MS);this.appendStatementInput("STACK").appendField(Blockly.Msg.ARD_TIME_DO_MS);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Blockly.Blocks.touch={};Blockly.Blocks.servo.HUE=225;Blockly.Blocks.touch_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-touch.png",50,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.TOUCH_SETUP);this.setColour(Blockly.Blocks.servo.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.touch_keyboardset={init:function(){this.appendDummyInput("CASE0").appendField(Blockly.Msg.TOUCH_SWITCH);this.appendDummyInput().setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.TOUCH_CASE).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"keyboard0");this.appendStatementInput("DO0").setCheck(null).appendField(Blockly.Msg.TOUCH_DO);this.setPreviousStatement(!0,null);
- this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.servo.HUE);this.setTooltip("");this.setHelpUrl("");this.setMutator(new Blockly.Mutator(["mod_touch_case"]));this.defaultCount_=this.caseCount_=0;this.updateShape_()},getTouchMatchInstance:function(){return!0},mutationToDom:function(){if(!this.caseCount_)return null;var a=document.createElement("mutation");this.caseCount_&&a.setAttribute("case",this.caseCount_);return a},domToMutation:function(a){this.caseCount_=parseInt(a.getAttribute("case"),
- 10)||0;this.updateShape_()},decompose:function(a){var b=a.newBlock("mod_touch_statement");b.initSvg();for(var c=b.nextConnection,e=1;e<=this.caseCount_;e++){var d=a.newBlock("mod_touch_case");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.nextConnection.targetBlock();this.caseCount_=0;var c=[null];for(a=[null];b;){switch(b.type){case "mod_touch_case":this.caseCount_++;c.push(b.valueConnection_);a.push(b.statementConnection_);break;default:throw"Unknown block type.";
- }b=b.nextConnection&&b.nextConnection.targetBlock()}this.updateShape_();for(b=1;b<=this.caseCount_;b++)Blockly.Mutator.reconnect(a[b],this,"DO"+b)},saveConnections:function(a){a=a.nextConnection.targetBlock();for(var b=1;a;){switch(a.type){case "mod_touch_case":this.getInput("CASE"+b);this.getFieldValue("keyboard"+b);var c=this.getInput("DO"+b);a.statementConnection_=c&&c.connection.targetConnection;b++;break;default:throw"Unknown block type.";}a=a.nextConnection&&a.nextConnection.targetBlock()}},
- updateShape_:function(){for(var a=1;a<=this.caseCount_;a++)this.getInput("CASE"+a)||(this.appendDummyInput("CASE"+a).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.TOUCH_CASE).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"keyboard"+a),this.appendStatementInput("DO"+a).appendField(Blockly.Msg.TOUCH_DO).setCheck(null));for(;this.getInput("CASE"+a);)this.removeInput("CASE"+a),
- this.removeInput("DO"+a),a++}};
- Blockly.Blocks.touch_keyboardset_loose={init:function(){this.appendDummyInput().appendField(Blockly.Msg.TOUCH_THEN_LOOSE_SWITCH);this.appendDummyInput("CASE0").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.TOUCH_CASE).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"keyboard0");this.appendStatementInput("DO0").setCheck(null).appendField(Blockly.Msg.TOUCH_DO);this.setPreviousStatement(!0,
- null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.servo.HUE);this.setTooltip("");this.setHelpUrl("");this.setMutator(new Blockly.Mutator(["mod_touch_case"]));this.defaultCount_=this.caseCount_=0;this.updateShape_()},getLooseMatchInstance:function(){return!0},mutationToDom:function(){if(!this.caseCount_)return null;var a=document.createElement("mutation");this.caseCount_&&a.setAttribute("case",this.caseCount_);return a},domToMutation:function(a){this.caseCount_=parseInt(a.getAttribute("case"),
- 10)||0;this.updateShape_()},decompose:function(a){var b=a.newBlock("mod_touch_statement");b.initSvg();for(var c=b.nextConnection,e=1;e<=this.caseCount_;e++){var d=a.newBlock("mod_touch_case");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.nextConnection.targetBlock();this.caseCount_=0;for(a=[null];b;){switch(b.type){case "mod_touch_case":this.caseCount_++;a.push(b.statementConnection_);break;default:throw"Unknown block type.";}b=b.nextConnection&&
- b.nextConnection.targetBlock()}this.updateShape_();for(b=1;b<=this.caseCount_;b++)Blockly.Mutator.reconnect(a[b],this,"DO"+b)},saveConnections:function(a){a=a.nextConnection.targetBlock();for(var b=1;a;){switch(a.type){case "mod_touch_case":this.getInput("CASE"+b);this.getFieldValue("keyboard"+b);var c=this.getInput("DO"+b);a.statementConnection_=c&&c.connection.targetConnection;b++;break;default:throw"Unknown block type.";}a=a.nextConnection&&a.nextConnection.targetBlock()}},updateShape_:function(){for(var a=
- 1;a<=this.caseCount_;a++)this.getInput("CASE"+a)||(this.appendDummyInput("CASE"+a).setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.TOUCH_CASE).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"keyboard"+a),this.appendStatementInput("DO"+a).appendField(Blockly.Msg.TOUCH_DO).setCheck(null));for(;this.getInput("CASE"+a);)this.removeInput("CASE"+a),this.removeInput("DO"+a),a++}};
- Blockly.Blocks.mod_touch_statement={init:function(){this.setColour(Blockly.Blocks.servo.HUE);this.appendDummyInput().setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.TOUCH_SWITCH);this.setNextStatement(!0);this.contextMenu=!1}};Blockly.Blocks.mod_touch_case={init:function(){this.setColour(Blockly.Blocks.servo.HUE);this.appendDummyInput().setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.TOUCH_CASE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.contextMenu=!1}};
- Blockly.Blocks.touch_setup_1={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-touch.png",50,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.TOUCH_SETUP);this.setColour(Blockly.Blocks.servo.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.touch_each={init:function(){this.appendDummyInput().appendField(Blockly.Msg.TOUCH_AT).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"keyboard");this.appendStatementInput("DO0").appendField(Blockly.Msg.TOUCH_DO);this.appendDummyInput().appendField(Blockly.Msg.TOUCH_LOOSE);this.appendStatementInput("DO1").appendField(Blockly.Msg.TOUCH_DO);this.setPreviousStatement(!0);
- this.setNextStatement(!0);this.setColour(Blockly.Blocks.servo.HUE)}};Blockly.Blocks.variables.HUE=20;
- Blockly.Blocks.variables_set_type={init:function(){this.setHelpUrl("http://arduino.cc/en/Reference/HomePage");this.appendValueInput("VARIABLE_SETTYPE_INPUT");this.appendDummyInput().appendField(Blockly.Msg.ARD_VAR_AS).appendField(new Blockly.FieldDropdown(Blockly.Types.getValidTypeArray()),"VARIABLE_SETTYPE_TYPE");this.setInputsInline(!0);this.setOutput(!0);this.setTooltip(Blockly.Msg.ARD_VAR_AS_TIP);this.setColour(30)},getBlockType:function(){var a=this.getFieldValue("VARIABLE_SETTYPE_TYPE");return Blockly.Types[a]}};Blockly.Blocks.webpage={};Blockly.Blocks.webpage.HUE="#f28821";
- Blockly.Blocks.webpage_label={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/label_header-image.png",50,50,"*"));this.appendDummyInput().appendField(Blockly.Msg.WEBPAGE_LABLE_TITLE);this.appendValueInput("ADD0").appendField(Blockly.Msg.WEBPAGE_LABLE).appendField(new Blockly.FieldTextInput("label0"),"LABLE0");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.webpage.HUE);this.setTooltip("");this.setHelpUrl("");
- this.itemCount_=1;this.setMutator(new Blockly.Mutator(["webpage_create_with_item"]))},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=a.newBlock("webpage_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("webpage_create_with_item");d.initSvg();
- c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.WEBPAGE_LABLE).appendField(new Blockly.FieldTextInput("label"+a),"LABLE"+a);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};
- Blockly.Blocks.webpage_create_with_container={init:function(){this.setColour(Blockly.Blocks.webpage.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.webpage_create_with_item={init:function(){this.setColour(Blockly.Blocks.webpage.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.webpage_button={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/button_header-image.png",50,50,"*"));this.appendDummyInput().appendField(Blockly.Msg.WEBPAGE_BUTTON_TITLE);this.appendDummyInput("ADD0").appendField(Blockly.Msg.WEBPAGE_BUTTON_NAME).appendField(new Blockly.FieldTextInput("Button0"),"BUTTON0").appendField(Blockly.Msg.WEBPAGE_BUTTON_ROUTER).appendField(new Blockly.FieldTextInput("/url0"),"URL0");this.setColour(Blockly.Blocks.webpage.HUE);
- this.itemCount_=1;this.setTooltip("");this.setHelpUrl("");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setMutator(new Blockly.Mutator(["webpage_create_with_item"]))},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=a.newBlock("webpage_create_with_container");b.initSvg();for(var c=
- b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("webpage_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.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++)Blockly.Mutator.reconnect(a[b],this,"ADD"+b)},saveConnections:function(a){a=a.getInputTargetBlock("STACK");
- for(var b=0;a;)this.getInput("ADD"+b),b++,a=a.nextConnection&&a.nextConnection.targetBlock()},updateShape_:function(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendDummyInput("ADD"+a).appendField(Blockly.Msg.WEBPAGE_BUTTON_NAME).appendField(new Blockly.FieldTextInput("Button"+a),"BUTTON"+a).appendField(Blockly.Msg.WEBPAGE_BUTTON_ROUTER).appendField(new Blockly.FieldTextInput("url"+a),"URL"+a);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};
- Blockly.Blocks.webpage_colorpicker={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/colorpicker_header-image.png",50,50,"*"));this.appendDummyInput().appendField(Blockly.Msg.WEBPAGE_COLORPICKER_TITLE);this.appendDummyInput().appendField(Blockly.Msg.WEBPAGE_COLORPICKER_PATH).appendField(new Blockly.FieldTextInput("/color"),"webpage_colorpicker_path");this.appendDummyInput().appendField(Blockly.Msg.WEBPAGE_COLORPICKER_SUBTITLE);this.setPreviousStatement(!0,
- null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.webpage.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.webpage_buttoncontroller={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/buttoncontroller_header-image.png",50,50,"*"));this.appendDummyInput().appendField(Blockly.Msg.WEBPAGE_BUTTONCTRL_TITLE);this.appendDummyInput().appendField(Blockly.Msg.WEBPAGE_BUTTONCTRL_TEXT_TOP).appendField(new Blockly.FieldTextInput("up"),"webpage_buttoncontroller_top").appendField(Blockly.Msg.WEBPAGE_BUTTONCTRL_SETPATH).appendField(new Blockly.FieldTextInput("/controller"),
- "webpage_buttoncontroller_top_path");this.appendDummyInput().appendField(Blockly.Msg.WEBPAGE_BUTTONCTRL_TEXT_LEFT).appendField(new Blockly.FieldTextInput("left"),"webpage_buttoncontroller_left").appendField(Blockly.Msg.WEBPAGE_BUTTONCTRL_SETPATH).appendField(new Blockly.FieldTextInput("/controller"),"webpage_buttoncontroller_left_path");this.appendDummyInput().appendField(Blockly.Msg.WEBPAGE_BUTTONCTRL_TEXT_CENTER).appendField(new Blockly.FieldTextInput("center"),"webpage_buttoncontroller_center").appendField(Blockly.Msg.WEBPAGE_BUTTONCTRL_SETPATH).appendField(new Blockly.FieldTextInput("/controller"),
- "webpage_buttoncontroller_center_path");this.appendDummyInput().appendField(Blockly.Msg.WEBPAGE_BUTTONCTRL_TEXT_RIGHT).appendField(new Blockly.FieldTextInput("righ"),"webpage_buttoncontroller_right").appendField(Blockly.Msg.WEBPAGE_BUTTONCTRL_SETPATH).appendField(new Blockly.FieldTextInput("/controller"),"webpage_buttoncontroller_right_path");this.appendDummyInput().appendField(Blockly.Msg.WEBPAGE_BUTTONCTRL_TEXT_BOTTOM).appendField(new Blockly.FieldTextInput("bottom"),"webpage_buttoncontroller_bottom").appendField(Blockly.Msg.WEBPAGE_BUTTONCTRL_SETPATH).appendField(new Blockly.FieldTextInput("/controller"),
- "webpage_buttoncontroller_bottom_path");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setColour(Blockly.Blocks.webpage.HUE);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.wificlient={};Blockly.Blocks.wificlient.HUE="#049d90";Blockly.Blocks.wifiClient_http_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/cocoblockly_http_block.png",140,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.WIFICLIENT_HTTP_SETUP);this.setColour(Blockly.Blocks.wificlient.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiClient_http_get={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/cocoblockly_http_block.png",140,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.WIFICLIENT_HTTP_GET_URL).appendField(new Blockly.FieldTextInput("/"),"URL");this.appendDummyInput().appendField(Blockly.Msg.WIFICLIENT_HTTP_GET_DATA).appendField(new Blockly.FieldTextInput("Data_receive"),"VAR");this.setColour(Blockly.Blocks.wificlient.HUE);this.setPreviousStatement(!0,
- null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiClient_http_get_getValue={init:function(){this.appendDummyInput().appendField(" "+Blockly.Msg.WIFICLIENT_RECEIVE_GET).appendField(new Blockly.FieldTextInput("Data_receive"),"VAR").appendField(" "+Blockly.Msg.WIFICLIENT_RECEIVE_GET_LINE2).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"INDEX").appendField(" "+Blockly.Msg.WIFICLIENT_RECEIVE_GET_LINE3).appendField(new Blockly.FieldDropdown([[Blockly.Msg.WIFISERVER_RECEIVE_GET_INT,
- "Int"],[Blockly.Msg.WIFISERVER_RECEIVE_GET_STRING,"String"]]),"TYPE");this.setColour(Blockly.Blocks.wificlient.HUE);this.setOutput(!0);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){return Blockly.Types.NUMBER}};
- Blockly.Blocks.wifiClient_http_post={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/cocoblockly_http_block.png",140,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.WIFICLIENT_HTTP_POST_URL).appendField(new Blockly.FieldTextInput("/"),"URL");this.appendDummyInput().appendField(Blockly.Msg.WIFICLIENT_HTTP_POST_VAR).appendField(new Blockly.FieldTextInput("Data_send"),"VAR");this.appendValueInput("ADD0").appendField(Blockly.Msg.WIFICLIENT_HTTP_POST_DATA+
- "0");this.itemCount_=1;this.setMutator(new Blockly.Mutator(["wifiClient_create_with_item"]));this.setColour(Blockly.Blocks.wificlient.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setInputsInline(!1);this.setTooltip("");this.setHelpUrl("")},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=
- a.newBlock("wifiClient_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("wifiClient_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.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++)Blockly.Mutator.reconnect(a[b],
- this,"ADD"+b)},saveConnections:function(a){a=a.getInputTargetBlock("STACK");for(var b=0;a;)this.getInput("ADD"+b),b++,a=a.nextConnection&&a.nextConnection.targetBlock()},updateShape_:function(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.WIFICLIENT_HTTP_POST_DATA+a);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};
- Blockly.Blocks.wifiClient_create_with_container={init:function(){this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setColour(Blockly.Blocks.wificlient.HUE);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.wifiClient_create_with_item={init:function(){this.setColour(Blockly.Blocks.wificlient.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.wifiClient_http_put={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/cocoblockly_http_block.png",140,40,"15"));this.appendValueInput("DATA").appendField(Blockly.Msg.WIFICLIENT_HTTP_PUT_DATA);this.appendValueInput("URL").appendField(Blockly.Msg.WIFICLIENT_HTTP_PUT_URL);this.appendDummyInput().appendField(Blockly.Msg.WIFICLIENT_HTTP_PUT_TYPE).appendField(new Blockly.FieldDropdown([[Blockly.Msg.REQUEST_DATA_STRING,"String"],[Blockly.Msg.REQUEST_DATA_CLOUD,
- "Cloud Data"]]),"TYPE");this.setColour(Blockly.Blocks.wificlient.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setInputsInline(!1);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.wifiClient_http_response={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFICLIENT_HTTP_RESPONSE);this.setColour(Blockly.Blocks.wificlient.HUE);this.setOutput(!0,Blockly.Types.TEXT.output);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.wificomms={};Blockly.Blocks.wificomms.HUE="#db3e37";Blockly.Blocks.wificomms_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/wifi-data_transfer.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.WIFI_SETUP);this.setColour(Blockly.Blocks.wificomms.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wificomms_sendMsg={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFI_SENDMSG).appendField(new Blockly.FieldVariable("dataOut"),"dataVar");this.setColour(Blockly.Blocks.wificomms.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setInputsInline(!0);this.setTooltip("");this.setHelpUrl("")},getVarType:function(a){return Blockly.Types.ARRAY}};
- Blockly.Blocks.wificomms_receiveMsg={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFI_RECEIVEMSG).appendField(new Blockly.FieldVariable("dataIn"),"dataVar");this.setColour(Blockly.Blocks.wificomms.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setInputsInline(!0);this.setTooltip("");this.setHelpUrl("")},getVarType:function(a){return Blockly.Types.ARRAY}};
- Blockly.Blocks.wificomms_receiveMsg_isSuccessed={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFI_RECEIVEMSG_ISSUCCESS);this.setColour(Blockly.Blocks.wificomms.HUE);this.setOutput(!0,Blockly.Types.BOOLEAN.output);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiTransfer_send_old={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/transfer-2.png",50,40,"0"));this.appendDummyInput().appendField("old "+Blockly.Msg.WIFIEASYMODE_TRANSFER_SEND_LINE2);this.appendValueInput("ADD0").appendField(Blockly.Msg.WIFIEASYMODE_TRANSFER_SEND_VALUE+"0");this.setColour(220);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("");this.itemCount_=1;this.updateShape_();
- this.setMutator(new Blockly.Mutator(["Transfer_create_with_item"]))},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=a.newBlock("Transfer_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("Transfer_create_with_item");d.initSvg();c.connect(d.previousConnection);
- c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=1;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++;for(a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.WIFIEASYMODE_TRANSFER_SEND_VALUE+a);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};
- Blockly.Blocks.Transfer_create_with_container={init:function(){this.setColour(Blockly.Blocks.wificomms.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.Transfer_create_with_item={init:function(){this.setColour(Blockly.Blocks.wificomms.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.wifiTransfer_receive_old={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/transfer-2.png",50,40,"0"));this.appendDummyInput().appendField("old "+Blockly.Msg.WIFIEASYMODE_TRANSFER_RECEIVE);this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_TRANSFER_RECEIVE_LINE3).appendField(new Blockly.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"]]),
- "LENGTH");this.setColour(220);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")},getVarType:function(a){return Blockly.Types.ARRAY}};
- Blockly.Blocks.wifiTransfer_receive_getValue_old={init:function(){this.appendDummyInput().appendField("old "+Blockly.Msg.WIFIEASYMODE_TRANSFER_RECEIVE_GET_LINE2).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"INDEX").appendField(" "+Blockly.Msg.WIFIEASYMODE_TRANSFER_RECEIVE_GET_LINE3);this.setColour(220);this.setOutput(!0);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){switch(this.getFieldValue("TYPE")){case "":return Blockly.Types.TEXT;
- case ".toFloat()":return Blockly.Types.LARGE_NUMBER}return Blockly.Types.NUMBER},getOutputType:function(){switch(this.getFieldValue("TYPE")){case "":return Blockly.Types.TEXT.output;case ".toFloat()":return Blockly.Types.LARGE_NUMBER.output}return Blockly.Types.NUMBER.output}};
- Blockly.Blocks.wifiTransfer_send={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/transfer-2.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.WIFIEASYMODE_TRANSFER_SEND_LINE2);this.appendValueInput("ADD0").appendField(Blockly.Msg.WIFIEASYMODE_TRANSFER_SEND_VALUE+"0");this.setColour(Blockly.Blocks.wificomms.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("");this.itemCount_=1;this.updateShape_();
- this.setMutator(new Blockly.Mutator(["Transfer_create_with_item"]))},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=a.newBlock("Transfer_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("Transfer_create_with_item");d.initSvg();c.connect(d.previousConnection);
- c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=1;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++;for(a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.WIFIEASYMODE_TRANSFER_SEND_VALUE+a);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};
- Blockly.Blocks.Transfer_create_with_container={init:function(){this.setColour(Blockly.Blocks.wificomms.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.Transfer_create_with_item={init:function(){this.setColour(Blockly.Blocks.wificomms.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.wifiTransfer_receive={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/transfer-2.png",50,40,"0"));this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_TRANSFER_RECEIVE);this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_TRANSFER_RECEIVE_LINE3).appendField(new Blockly.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"]]),"LENGTH");
- this.setColour(Blockly.Blocks.wificomms.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")},getVarType:function(a){return Blockly.Types.ARRAY}};
- Blockly.Blocks.wifiTransfer_receive_getValue={init:function(){this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_TRANSFER_RECEIVE_GET_LINE2).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"INDEX").appendField(" "+Blockly.Msg.WIFIEASYMODE_TRANSFER_RECEIVE_GET_LINE3).appendField(new Blockly.FieldDropdown([["String",""],["Number",".toInt()"],["Float",".toFloat()"]]),"TYPE").appendField(" "+
- Blockly.Msg.WIFIEASYMODE_TRANSFER_RECEIVE_GET_LINE4);this.setColour(Blockly.Blocks.wificomms.HUE);this.setOutput(!0);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){switch(this.getFieldValue("TYPE")){case "":return Blockly.Types.TEXT;case ".toFloat()":return Blockly.Types.LARGE_NUMBER}return Blockly.Types.NUMBER},getOutputType:function(){switch(this.getFieldValue("TYPE")){case "":return Blockly.Types.TEXT.output;case ".toFloat()":return Blockly.Types.LARGE_NUMBER.output}return Blockly.Types.NUMBER.output}};Blockly.Blocks.wifinetwork={};Blockly.Blocks.wifinetwork.HUE="#572b7a";
- Blockly.Blocks.wifiNetwork_connect_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/wifi-network.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.WIFINETWORK_CONNECT);this.appendValueInput("SSID").setCheck("Text").appendField(Blockly.Msg.WIFINETWORK_CONNECT_SSID);this.appendValueInput("PW").setCheck("Text").appendField(Blockly.Msg.WIFINETWORK_CONNECT_PW);this.setColour(Blockly.Blocks.wifinetwork.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiNetwork_getMacAddr={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFINETWORK_GETMACADDR);this.setColour(Blockly.Blocks.wifinetwork.HUE);this.setOutput(!0,Blockly.Types.TEXT.output);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiNetwork_getGatewayIp={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFINETWORK_GETGATEWAYIP);this.setColour(Blockly.Blocks.wifinetwork.HUE);this.setOutput(!0,Blockly.Types.TEXT.output);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiNetwork_AP_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/wifi-network.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.WIFINETWORK_AP_SETUP);this.appendValueInput("SSID").setCheck("Text").appendField(Blockly.Msg.WIFINETWORK_AP_SSID);this.appendValueInput("PW").setCheck("Text").appendField(Blockly.Msg.WIFINETWORK_AP_PW);this.setColour(50);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiNetwork_network={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/main-wifi.png",50,40,"0"));this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_NETWORK_TITLE);this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_NETWORK_SSID).appendField(new Blockly.FieldTextInput("CocoRobo"),"wifi_ssid");this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_NETWORK_PW).appendField(new Blockly.FieldTextInput("cocorobo"),
- "wifi_pw");this.setColour(Blockly.Blocks.wifinetwork.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiNetwork_AP={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/wifi-network.png",50,40,"0"));this.appendDummyInput().appendField(Blockly.Msg.WIFINETWORK_AP_SETUP);this.appendDummyInput().appendField(" "+Blockly.Msg.WIFINETWORK_AP_SSID).appendField(new Blockly.FieldTextInput("CocoRobo"),"SSID");this.appendDummyInput().appendField(" "+Blockly.Msg.WIFINETWORK_AP_PW).appendField(new Blockly.FieldTextInput("cocorobo"),"PW");this.setColour(Blockly.Blocks.wifinetwork.HUE);
- this.setTooltip("");this.setHelpUrl("")},onchange:function(){var a=this.getFieldValue("PW").length;0<a?8>a?this.setWarningText(Blockly.Msg.WIFINETWORK_PW_WARN,"network_pw"):this.setWarningText(null,"network_pw"):0==a&&0==a&&this.setFieldValue("cocorobo","PW")}};
- Blockly.Blocks.wifiNetwork_getLocalIp={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFINETWORK_GETLOCALIP);this.setColour(Blockly.Blocks.wifinetwork.HUE);this.setOutput(!0,Blockly.Types.TEXT.output);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiNetwork_isConnected={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFINETWORK_ISCONNECTED);this.setColour(Blockly.Blocks.wifinetwork.HUE);this.setOutput(!0,Blockly.Types.BOOLEAN.output);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.wifiNetwork_getStationNum={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFINETWORK_GETSTATIONNUM);this.setColour(Blockly.Blocks.wifinetwork.HUE);this.setOutput(!0);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.wifiserver={};Blockly.Blocks.wifiserver.HUE="#293278";Blockly.Blocks.wifiServer_setup={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/wifi_server.png",40,40,"15"));this.appendDummyInput().appendField(Blockly.Msg.WIFISERVER_SETUP);this.setColour(Blockly.Blocks.wifiserver.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiServer_setRootPage={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFISERVER_SETROUTER);this.appendDummyInput().appendField(Blockly.Msg.WIFISERVER_SETROOTPAGE);this.appendStatementInput("STATEMENT0");this.setColour(Blockly.Blocks.wifiserver.HUE);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiServer_setRouter={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFISERVER_SETROUTER);this.appendDummyInput("ADD0").appendField(Blockly.Msg.WIFISERVER_SETROUTER_SET).appendField(new Blockly.FieldTextInput("/"),"URL0");this.appendStatementInput("STATEMENT0").appendField(Blockly.Msg.WIFISERVER_SETROUTER_WITH);this.itemCount_=1;this.setMutator(new Blockly.Mutator(["ServerRouter_create_with_item"]));this.setColour(Blockly.Blocks.wifiserver.HUE);this.setPreviousStatement(!0);
- this.setNextStatement(!0);this.setTooltip("");this.setHelpUrl("")},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=a.newBlock("ServerRouter_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("ServerRouter_create_with_item");d.initSvg();
- c.connect(d.previousConnection);c=d.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++)Blockly.Mutator.reconnect(a[b],this,"ADD"+b)},saveConnections:function(a){a=a.getInputTargetBlock("STACK");for(var b=0;a;)this.getInput("ADD"+b),b++,a=a.nextConnection&&a.nextConnection.targetBlock()},updateShape_:function(){for(var a=
- 0;a<this.itemCount_;a++)this.getInput("ADD"+a)||(this.appendDummyInput("ADD"+a).appendField(Blockly.Msg.WIFISERVER_SETROUTER_SET).appendField(new Blockly.FieldTextInput("/"),"URL"+a),this.appendStatementInput("STATEMENT"+a).appendField(Blockly.Msg.WIFISERVER_SETROUTER_WITH));for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),this.removeInput("STATEMENT"+a),a++}};
- Blockly.Blocks.ServerRouter_create_with_container={init:function(){this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setColour(Blockly.Blocks.wifiserver.HUE);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.ServerRouter_create_with_item={init:function(){this.setColour(Blockly.Blocks.wifiserver.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.wifiServer_Send={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFISERVER_SEND);this.appendDummyInput().appendField(Blockly.Msg.WIFISERVER_LIST).appendField(new Blockly.FieldTextInput("Data_send"),"VAR");this.appendValueInput("ADD0").appendField("Data0");this.itemCount_=1;this.updateShape_();this.setMutator(new Blockly.Mutator(["ServerSend_create_with_item"]));this.setColour(Blockly.Blocks.wifiserver.HUE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");
- this.setHelpUrl("")},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=a.newBlock("ServerSend_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("ServerSend_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},
- compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField("Data"+a);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};
- Blockly.Blocks.ServerSend_create_with_container={init:function(){this.setColour(Blockly.Blocks.wifiserver.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.ServerSend_create_with_item={init:function(){this.setColour(Blockly.Blocks.wifiserver.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.wifiServer_Receive={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFISERVER_RECEIVE);this.appendDummyInput().appendField(Blockly.Msg.WIFISERVER_RECEIVE_TO).appendField(new Blockly.FieldTextInput("Data_receive"),"VAR");this.appendDummyInput().appendField(Blockly.Msg.WIFISERVER_RECEIVE_LENGTH).appendField(new Blockly.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"LENGTH");this.setColour(Blockly.Blocks.wifiserver.HUE);
- this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiServer_Receive_getValue={init:function(){this.appendDummyInput().appendField(" "+Blockly.Msg.WIFISERVER_RECEIVE_GET).appendField(new Blockly.FieldTextInput("Data_receive"),"VAR").appendField(" "+Blockly.Msg.WIFISERVER_RECEIVE_GET_LINE2).appendField(new Blockly.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"INDEX").appendField(" "+Blockly.Msg.WIFISERVER_RECEIVE_GET_LINE3).appendField(new Blockly.FieldDropdown([[Blockly.Msg.WIFISERVER_RECEIVE_GET_INT,
- "Int"],[Blockly.Msg.WIFISERVER_RECEIVE_GET_STRING,"String"]]),"TYPE");this.setColour(Blockly.Blocks.wifiserver.HUE);this.setOutput(!0);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){switch(this.getFieldValue("TYPE")){case "Int":return Blockly.Types.NUMBER;case "String":return Blockly.Types.TEXT}return Blockly.Types.UNDEF}};
- Blockly.Blocks.wifiServer_onNotFound={init:function(){this.appendValueInput("VAR").appendField(Blockly.Msg.WIFISERVER_SETROUTER_ONNOTFOUND);this.setColour(Blockly.Blocks.wifiserver.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiServer_serverSend={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFISERVER_SERVERSEND);this.appendValueInput("CODE").appendField(Blockly.Msg.WIFISERVER_SERVERSEND_CODE);this.appendValueInput("TYPE").appendField(Blockly.Msg.WIFISERVER_SERVERSEND_TYPE);this.appendValueInput("CONTENT").appendField(Blockly.Msg.WIFISERVER_SERVERSEND_CONTENT);this.setColour(Blockly.Blocks.wifiserver.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");
- this.setHelpUrl("")}};Blockly.Blocks.wifiServer_handleClient={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFISERVER_HANDLECLIENT);this.setColour(Blockly.Blocks.wifiserver.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiServer_waitConnection={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFISERVER_WAIT_CONNECTION);this.setColour(Blockly.Blocks.wifiserver.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")}};Blockly.Blocks.wifiwebservices={};Blockly.Blocks.wifiwebservices.HUE="#37a0ce";
- Blockly.Blocks.wifiwebservices_ifttt_simple={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFIWEBSERVICES_IFTTT);this.appendValueInput("KEY").setCheck("Text").appendField(Blockly.Msg.WIFIWEBSERVICES_IFTTT_SET_KEY);this.appendValueInput("EVENT").setCheck("Text").appendField(Blockly.Msg.WIFIWEBSERVICES_IFTTT_SET_EVENT);this.appendValueInput("VALUE1").appendField(Blockly.Msg.WIFIWEBSERVICES_IFTTT_SET_VALUE1);this.appendValueInput("VALUE2").appendField(Blockly.Msg.WIFIWEBSERVICES_IFTTT_SET_VALUE2);
- this.appendValueInput("VALUE3").appendField(Blockly.Msg.WIFIWEBSERVICES_IFTTT_SET_VALUE3);this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiwebservices_thinkspeak_simple={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFIWEBSERVICES_THINKSPEAK);this.appendValueInput("KEY").setCheck("Text").appendField(Blockly.Msg.WIFIWEBSERVICES_THINKSPEAK_SET_KEY);this.itemCount_=1;this.updateShape_();this.setMutator(new Blockly.Mutator(["thingspeak_create_with_item"]));this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")},
- 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=a.newBlock("thingspeak_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("thingspeak_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=
- a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_INPUT_WITH).appendField(new Blockly.FieldTextInput("field"+(a+1)),"FIELD"+a);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};
- Blockly.Blocks.thingspeak_create_with_container={init:function(){this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.thingspeak_create_with_item={init:function(){this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.wifiwebservices_cococloud_simple_post={init:function(){this.appendDummyInput().appendField(Blockly.Msg.COCOCLOUD_TITLE);this.appendValueInput("ADD0").appendField(Blockly.Msg.COCOCLOUD_POST).appendField(new Blockly.FieldDropdown([["event","event"]]),"event0");this.itemCount=1;this.updateShape_();this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")},updateShape_:function(){var a=this,
- b=this.getInput("ADD0"),c=document.getElementById("api-key").innerHTML||"";$.ajax({url:"//api.cocorobo.cn/iot/data/apikey/"+c+"/event/",xhrFields:{withCredentials:!0},type:"GET",success:function(c){var d=[];null!=c&&($.each(c,function(a,b){var c=[];c.push(b.name);c.push(b.url);d.push(c)}),a.eventsName=d,b.removeField("event0"),b.appendField(new Blockly.FieldDropdown(d),"event0"))},error:function(a){console.log("error")}})}};
- Blockly.Blocks.wifiwebservices_cococloud_simple_get={init:function(){this.appendDummyInput().appendField(Blockly.Msg.COCOCLOUD_TITLE);this.appendDummyInput("iuput_id0").appendField(Blockly.Msg.COCOCLOUD_GET,"text_field0").appendField(new Blockly.FieldDropdown([["event","event"]]),"event0").appendField(Blockly.Msg.COCOCLOUD_GET1,"text_field1");this.itemCount=1;this.updateShape_();this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");
- this.setHelpUrl("")},updateShape_:function(){var a=this,b=this.getInput("iuput_id0"),c=document.getElementById("api-key").innerHTML||"";$.ajax({url:"//api.cocorobo.cn/iot/data/apikey/"+c+"/event/",xhrFields:{withCredentials:!0},type:"GET",success:function(c){var d=[];null!=c&&($.each(c,function(a,b){var c=[];c.push(b.name);c.push(b.url);d.push(c)}),a.eventsName=d,b.removeField("text_field0"),b.removeField("event0"),b.removeField("text_field1"),b.appendField(Blockly.Msg.COCOCLOUD_GET,"text_field0").appendField(new Blockly.FieldDropdown(d),
- "event0").appendField(Blockly.Msg.COCOCLOUD_GET1,"text_field1"))},error:function(a){console.log("error")}})}};Blockly.Blocks.wifiwebservices_cococloud_simple_getPayLoad={init:function(){this.appendDummyInput().appendField(Blockly.Msg.COCOCLOUD_TITLE);this.appendDummyInput().appendField(Blockly.Msg.COCOCLOUD_GETPAYLOAD);this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.setOutput(!0);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiServices_IFTTT={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/blockly-easymode_ifttt.png",180,40,"0"));this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_IFTTT_KEY);this.appendDummyInput().appendField(" ").appendField(new Blockly.FieldTextInput("bAssF9YJ_7oZP1k4et_IUx"),"IFTTT_KEY");this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_IFTTT_EVENT);this.appendDummyInput().appendField(" ").appendField(new Blockly.FieldTextInput("cocorobo_webhook"),
- "IFTTT_EVENT");this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_IFTTT_TYPE).appendField(new Blockly.FieldDropdown([[Blockly.Msg.WIFIEASYMODE_IFTTT_POST,"Action"],[Blockly.Msg.WIFIEASYMODE_IFTTT_FETCH,"Trigger"]]),"TYPE");for(var a=0;3>a;a++)this.getInput("data"+a)||this.appendValueInput("data"+a).appendField(" "+Blockly.Msg.WIFIEASYMODE_IFTTT_SENDDATA+a);this.onChange();this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);
- this.setTooltip("");this.setHelpUrl("")},getType:function(){switch(this.getFieldValue("TYPE")){case "Action":return 1;case "Trigger":return 2;default:return 0}},onChange:function(){if(1==this.getType())for(var a=0;3>a;a++)this.getInput("data"+a)||this.appendValueInput("data"+a).appendField(" "+Blockly.Msg.WIFIEASYMODE_IFTTT_SENDDATA+a);else if(2==this.getType()){a=0;for(var b;this.getInput("data"+a);)(b=this.getInputTargetBlock("data"+a))&&b.dispose(!0,!0),this.removeInput("data"+a),a++}}};
- Blockly.Blocks.wifiServices_thingspeak={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/blockly-easymode_thingspeak.png",180,40,"0"));this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_THINGSPEAK_APIKEY);this.appendDummyInput().appendField(" ").appendField(new Blockly.FieldTextInput("bAssF9YJ_7oZP1k4et_IUx"),"API_KEY");this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_THINGSPEAK_SENDDATA);this.itemCount_=1;this.updateShape_();
- this.setMutator(new Blockly.Mutator(["thingspeakEM_create_with_item"]));this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")},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=a.newBlock("thingspeakEM_create_with_container");
- b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("thingspeakEM_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&c.disconnect()}this.itemCount_=a.length;this.updateShape_();
- for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(" Field "+(a+1)+":");for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++}};
- Blockly.Blocks.thingspeakEM_create_with_container={init:function(){this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.thingspeakEM_create_with_item={init:function(){this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.wifiServices_cococloud_post={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/cloud-tx.png",180,40,"0"));this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_COCOClOUD_EVENT);this.appendDummyInput().appendField(" ").appendField(new Blockly.FieldTextInput("d0f98bb70ae070cd89725780e67dfe6b"),"event0");this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_COCOCLOUD_SENDDATA);this.appendValueInput("ADD0").appendField(" ").appendField(new Blockly.FieldTextInput("EM_data0"),
- "field0");this.itemCount_=1;this.updateShape_();this.setMutator(new Blockly.Mutator(["cococloud_create_with_item"]));this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")},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=
- a.newBlock("cococloud_create_with_container");b.initSvg();for(var c=b.getInput("STACK").connection,e=0;e<this.itemCount_;e++){var d=a.newBlock("cococloud_create_with_item");d.initSvg();c.connect(d.previousConnection);c=d.nextConnection}return b},compose:function(a){var b=a.getInputTargetBlock("STACK");for(a=[];b;)a.push(b.valueConnection_),b=b.nextConnection&&b.nextConnection.targetBlock();for(b=0;b<this.itemCount_;b++){var c=this.getInput("ADD"+b).connection.targetConnection;c&&-1==a.indexOf(c)&&
- c.disconnect()}this.itemCount_=a.length;this.updateShape_();for(b=0;b<this.itemCount_;b++)Blockly.Mutator.reconnect(a[b],this,"ADD"+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(){for(var a=0;a<this.itemCount_;a++)this.getInput("ADD"+a)||this.appendValueInput("ADD"+a).appendField(" ").appendField(new Blockly.FieldTextInput("EM_data"+
- a),"field"+a);for(;this.getInput("ADD"+a);)this.removeInput("ADD"+a),a++},updateEvent_:function(){var a=this,b=this.getInput("ADD0"),c=document.getElementById("api-key").innerHTML||"";$.ajax({url:"//api.cocorobo.cn/iot/data/apikey/"+c+"/event/",xhrFields:{withCredentials:!0},type:"GET",success:function(c){var d=[];null!=c&&($.each(c,function(a,b){var c=[];c.push(b.name);c.push(b.url);d.push(c)}),a.eventsName=d,b.removeField("event0"),b.appendField(new Blockly.FieldDropdown(d),"event0"))},error:function(a){console.log("error")}})}};
- Blockly.Blocks.cococloud_create_with_container={init:function(){this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.cococloud_create_with_item={init:function(){this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.appendDummyInput().appendField(Blockly.Msg.THINGSPEAK_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip("");this.contextMenu=!1}};
- Blockly.Blocks.wifiServices_cococloud_get={init:function(){this.appendDummyInput().appendField(new Blockly.FieldImage("./../blockly/media/cloud-rx.png",180,40,"0"));this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_COCOClOUD_EVENT);this.appendDummyInput().appendField(" ").appendField(new Blockly.FieldTextInput("d0f98bb70ae070cd89725780e67dfe6b"),"event0");this.appendDummyInput().appendField(" "+Blockly.Msg.WIFIEASYMODE_COCOCLOUD_GETDATA).appendField(new Blockly.FieldDropdown([["rxCloud",
- "rxCloud"]]),"VAR");this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("");this.setHelpUrl("")}};
- Blockly.Blocks.wifiServices_cococloud_get_data={init:function(){this.appendDummyInput().appendField(Blockly.Msg.WIFIEASYMODE_COCOCLOUD_KEY).appendField(new Blockly.FieldDropdown([["rxCloud","rxCloud"]]),"VAR").appendField(Blockly.Msg.WIFIEASYMODE_COCOCLOUD_KEY1);this.appendDummyInput().appendField(Blockly.Msg.WIFIEASYMODE_COCOCLOUD_KEY2).appendField(new Blockly.FieldTextInput("EM_data"),"KEY").appendField(Blockly.Msg.WIFIEASYMODE_COCOCLOUD_TYPE).appendField(new Blockly.FieldDropdown([["Text","Text"],
- ["Number","Number"]]),"VAR_TYPE").appendField(Blockly.Msg.WIFIEASYMODE_COCOCLOUD_END);this.setColour(Blockly.Blocks.wifiwebservices.HUE);this.setOutput(!0);this.setTooltip("");this.setHelpUrl("")},getBlockType:function(){var a=Blockly.Types.TEXT;switch(this.getFieldValue("VAR_TYPE")){case "Text":a=Blockly.Types.TEXT;break;case "Number":a=Blockly.Types.NUMBER}return a}};
|