From 489b56f43d56f1be21f4861598a90f4d9106a9c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Mon, 16 Sep 2024 02:58:12 +0800 Subject: [PATCH] =?UTF-8?q?Update(boards):=20python=E6=9D=BF=E5=8D=A1?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=20`build:prod`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- boards/default/python_mixpy/index.xml | 2 +- boards/default/python_mixpy/main.bundle.js | 4 ++-- .../styles/{main.5286bd88.css => main.2c80f01e.css} | 0 boards/default/python_pyodide/index.xml | 2 +- boards/default/python_pyodide/main.bundle.js | 4 ++-- .../styles/{317.d64c0353.css => 317.2452fe28.css} | 0 .../styles/{main.d64c0353.css => main.2452fe28.css} | 0 boards/default/python_skulpt/index.xml | 2 +- boards/default/python_skulpt/main.bundle.js | 4 ++-- .../styles/{main.9b186880.css => main.2d9c79ea.css} | 0 boards/default/python_skulpt_car/index.xml | 2 +- boards/default/python_skulpt_car/main.bundle.js | 4 ++-- .../styles/{main.c448996d.css => main.7cea1fa3.css} | 0 boards/default/python_skulpt_mixtoy/index.xml | 2 +- boards/default/python_skulpt_mixtoy/main.bundle.js | 4 ++-- .../styles/{main.f4d7e012.css => main.79db2102.css} | 0 16 files changed, 15 insertions(+), 15 deletions(-) rename boards/default/python_mixpy/styles/{main.5286bd88.css => main.2c80f01e.css} (100%) rename boards/default/python_pyodide/styles/{317.d64c0353.css => 317.2452fe28.css} (100%) rename boards/default/python_pyodide/styles/{main.d64c0353.css => main.2452fe28.css} (100%) rename boards/default/python_skulpt/styles/{main.9b186880.css => main.2d9c79ea.css} (100%) rename boards/default/python_skulpt_car/styles/{main.c448996d.css => main.7cea1fa3.css} (100%) rename boards/default/python_skulpt_mixtoy/styles/{main.f4d7e012.css => main.79db2102.css} (100%) diff --git a/boards/default/python_mixpy/index.xml b/boards/default/python_mixpy/index.xml index 6a013a40..ade85d82 100644 --- a/boards/default/python_mixpy/index.xml +++ b/boards/default/python_mixpy/index.xml @@ -1 +1 @@ -promptHelloHelloHello,HelloMixly2100,1,2,3051iDIVIDE10Exception as eetestThreadtestThreadWHILETRUEHello Mixly from Thread!1090x151100a10.998124.821100101010001100501100110000x2x0,1,2,30,1,2,30,1,2,3xMixlyHelloMixly65axMixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixpyI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')dirmylist1,2,3,4,5mylist0mylist02mylist00mylist0101mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistx0,1,2,30,1,2,3mytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}s11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2xreadme.txtffilename.txtfffilename.txtfMixlyfff0fffpathpathfilename.txtsrcname.txtdstname.txtfilename.txtpathff0reponsehttps://mixio.mixly.cnreponsehttps://mixio.mixly.cnreponsemixio.mixly.cnmixio.mixly.cnA1B2C3mixio.mixly.cnusernamepasswordMyProjecttopicmsgtopicmethodtopicmethodEQmsg1content"long""lat""message"012content"key1""key2""key3"012tina20tina90tina0tina2020tina50tinatinatinatinatinatina5tinatina225tina5#ff0000#FF0000tina#ff0000#FF0000tina#ff0000#FF0000tina#ff0000#FF0000#ff0000#FF0000tina#FF0000tina#FF0000tina#FF0000tina50tina50360tinascreenkeyfuncUpkeyfunctina100tina90screenclickfuncclickfunctinax20y20screentimerfunc3000timerfunctina100tina90screenscreenturtle.epstina10tinaMixly!tinaMixly!Arial8NUMInput a number:100100Input your nameWhat's your name?d:\\1.wav3d:\\1.jpgqclientEnter Your API_KEYEnter Your SECRET_KEYclient今天天气真好clientclientclientC:/mixly.jpgC:/mixpy.jpgclientclient我爱米思齐client米思齐米思皮client米思齐团队米思齐团队由一群具有共同理想的学生和老师组成,他们始终致力于为开展更好的创客教育而努力。client米思齐团队由一群具有共同理想的学生和老师组成,他们始终致力于为开展更好的创客教育而努力。20df1data.csvdfdfarrayNonearrayNonearrayarrayarraydfvalueFalsedfdfcolumns0x1.55.50.511array1array2myMatrixmyMatrixmyMatrixarraymatrix1matrix2array1array20,1,2,3xmyArraymyArraymyDimensionsmyArraymyArraymyFeatures0imagetemplatesmyArray0myArray0myArraymylistmylist0,1,2,3mydictmydict'a','b','c','d'mydict'ABCD''a','b','c','d'ser1ser10df1tagser1ser11,2,3,45,6,7,81,2,3,45,6,7,820,20,20,20tag1,2,3,45,6,7,8tag1,2,3,45,6,7,80.5tag0.25,0.35,0.1,0.3'a','b','c','d'0.2,0,0,011,21,31,41,51,61,71,81,910,20,40,60,80,100211Titleaxis1,2,3,41,2,3,415581.pngimg1.jpgfacehaarcascade_frontalface_default.xmlfaceRectsimgface1.15faceRectsimgface1.15100100200200Mixlyimg2.jpgimg0img001001003imgMixly02004310020220221001001010.00.010021.0-10.0,10.0TRUEirisiris_Xiris_y0.3modelTRUEFALSEmodel1.0TRUEFALSE300modelmodel100model5modelmodel8300modelX_trainy_trainmodelX_testy_testmodelX_testmodelmodelmodelD:/mixly/test.pkl \ No newline at end of file +promptHelloHelloHello,HelloMixly2100,1,2,3051iDIVIDE10Exception as eetestThreadtestThreadWHILETRUEHello Mixly from Thread!1090x151100a10.998124.821100101010001100501100110000x2x0,1,2,30,1,2,30,1,2,3xMixlyHelloMixly65axMixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixpyI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')dirmylist1,2,3,4,5mylist0mylist02mylist00mylist0101mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistx0,1,2,30,1,2,3mytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}s11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2xreadme.txtffilename.txtfffilename.txtfMixlyfff0fffpathpathfilename.txtsrcname.txtdstname.txtfilename.txtpathff0reponsehttps://mixio.mixly.cnreponsehttps://mixio.mixly.cnreponsemixio.mixly.cnmixio.mixly.cnA1B2C3mixio.mixly.cnusernamepasswordMyProjecttopicmsgtopicmethodtopicmethodEQmsg1content"long""lat""message"012content"key1""key2""key3"012tina20tina90tina0tina2020tina50tinatinatinatinatinatina5tinatina225tina5#ff0000#FF0000tina#ff0000#FF0000tina#ff0000#FF0000tina#ff0000#FF0000#ff0000#FF0000tina#FF0000tina#FF0000tina#FF0000tina50tina50360tinascreenkeyfuncUpkeyfunctina100tina90screenclickfuncclickfunctinax20y20screentimerfunc3000timerfunctina100tina90screenscreenturtle.epstina10tinaMixly!tinaMixly!Arial8NUMInput a number:100100Input your nameWhat's your name?d:\\1.wav3d:\\1.jpgqclientEnter Your API_KEYEnter Your SECRET_KEYclient今天天气真好clientclientclientC:/mixly.jpgC:/mixpy.jpgclientclient我爱米思齐client米思齐米思皮client米思齐团队米思齐团队由一群具有共同理想的学生和老师组成,他们始终致力于为开展更好的创客教育而努力。client米思齐团队由一群具有共同理想的学生和老师组成,他们始终致力于为开展更好的创客教育而努力。20df1data.csvdfdfarrayNonearrayNonearrayarrayarraydfvalueFalsedfdfcolumns0x1.55.50.511array1array2myMatrixmyMatrixmyMatrixarraymatrix1matrix2array1array20,1,2,3xmyArraymyArraymyDimensionsmyArraymyArraymyFeatures0imagetemplatesmyArray0myArray0myArraymylistmylist0,1,2,3mydictmydict'a','b','c','d'mydict'ABCD''a','b','c','d'ser1ser10df1tagdf1tagdf11df1GTcolumndf1tag1df1tagmindf1columndf1tagser1ser11,2,3,45,6,7,81,2,3,45,6,7,820,20,20,20tag1,2,3,45,6,7,8tag1,2,3,45,6,7,80.5tag0.25,0.35,0.1,0.3'a','b','c','d'0.2,0,0,011,21,31,41,51,61,71,81,910,20,40,60,80,100211Titleaxis1,2,3,41,2,3,415581.pngimg1.jpgfacehaarcascade_frontalface_default.xmlfaceRectsimgface1.15faceRectsimgface1.15100100200200Mixlyimg2.jpgimg0img001001003imgMixly02004310020220221001001010.00.010021.0-10.0,10.0TRUEirisiris_Xiris_y0.3modelTRUEFALSEmodel1.0TRUEFALSE300modelmodel100model5modelmodel8300modelX_trainy_trainmodelX_testy_testmodelX_testmodelmodelmodelD:/mixly/test.pkl \ No newline at end of file diff --git a/boards/default/python_mixpy/main.bundle.js b/boards/default/python_mixpy/main.bundle.js index c70edc89..33dfb4a2 100644 --- a/boards/default/python_mixpy/main.bundle.js +++ b/boards/default/python_mixpy/main.bundle.js @@ -1,4 +1,4 @@ -(()=>{"use strict";var __webpack_modules__={131:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});const cv_read_image=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.imread("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_show_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imshow("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_write_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imwrite("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_waitkey=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.waitKey("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+")\n"},cv_destroy_all=function(e,t){t.definitions_.import_cv2="import cv2";return"cv2.destroyAllWindows()\n"},cv_line_rect=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),x2=generator.valueToCode(this,"x2",generator.ORDER_ATOMIC),y2=generator.valueToCode(this,"y2",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),direction=this.getFieldValue("DIR"),code="cv2."+direction+"("+file+",("+x1+","+y1+"),("+x2+","+y2+"),("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_text=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),data=generator.valueToCode(this,"data",generator.ORDER_ATOMIC),size=generator.valueToCode(this,"size",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),font=this.getFieldValue("font"),code="cv2.putText("+file+","+data+",("+x1+","+y1+"),cv2.FONT_HERSHEY_"+font+","+size+",("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_face_classifier=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.CascadeClassifier("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect_all=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+",minSize=("+t.valueToCode(this,"x1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y1",t.ORDER_ATOMIC)+"),maxSize=("+t.valueToCode(this,"x2",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y2",t.ORDER_ATOMIC)+"))",t.ORDER_ATOMIC]}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={},blocks_variables_namespaceObject={};__webpack_require__.r(blocks_variables_namespaceObject),__webpack_require__.d(blocks_variables_namespaceObject,{controls_type:()=>controls_type,controls_typeLists:()=>controls_typeLists,variables_change:()=>variables_change,variables_get:()=>variables_get,variables_global:()=>variables_global,variables_set:()=>variables_set});var control_namespaceObject={};__webpack_require__.r(control_namespaceObject),__webpack_require__.d(control_namespaceObject,{base_setup:()=>base_setup,controls_delay:()=>controls_delay,controls_end_program:()=>controls_end_program,controls_except:()=>controls_except,controls_finally:()=>controls_finally,controls_flow_statements:()=>controls_flow_statements,controls_for:()=>controls_for,controls_forEach:()=>controls_forEach,controls_for_range:()=>controls_for_range,controls_if:()=>controls_if,controls_if_else:()=>controls_if_else,controls_if_elseif:()=>controls_if_elseif,controls_if_if:()=>controls_if_if,controls_lambda:()=>controls_lambda,controls_main:()=>controls_main,controls_pass:()=>controls_pass,controls_range:()=>controls_range,controls_repeat_ext:()=>controls_repeat_ext,controls_thread:()=>controls_thread,controls_try:()=>controls_try,controls_try_finally:()=>controls_try_finally,controls_whileUntil:()=>controls_whileUntil,do_while:()=>do_while,garbage_collection:()=>garbage_collection,get_mem_alloc:()=>get_mem_alloc,get_mem_free:()=>get_mem_free});var math_namespaceObject={};__webpack_require__.r(math_namespaceObject),__webpack_require__.d(math_namespaceObject,{base_map:()=>base_map,math_arithmetic:()=>math_arithmetic,math_bit:()=>math_bit,math_constant:()=>math_constant,math_constant_mp:()=>math_constant_mp,math_constrain:()=>math_constrain,math_dec:()=>math_dec,math_indexer_number:()=>math_indexer_number,math_map:()=>math_map,math_max_min:()=>math_max_min,math_number:()=>math_number,math_number_base_conversion:()=>math_number_base_conversion,math_random:()=>math_random,math_random_seed:()=>math_random_seed,math_round:()=>math_round,math_selfcalcu:()=>math_selfcalcu,math_to_int:()=>math_to_int,math_trig:()=>math_trig,text_to_number:()=>text_to_number,text_to_number_skulpt:()=>text_to_number_skulpt});var text_namespaceObject={};__webpack_require__.r(text_namespaceObject),__webpack_require__.d(text_namespaceObject,{ascii_to_char:()=>ascii_to_char,char_to_ascii:()=>char_to_ascii,number_to_text:()=>number_to_text,os_system:()=>os_system,text:()=>text_text,text_capital:()=>text_capital,text_center:()=>text_center,text_char:()=>text_char,text_char_at:()=>text_char_at,text_char_at2:()=>text_char_at2,text_char_at3:()=>text_char_at3,text_compareTo:()=>text_compareTo,text_compare_to:()=>text_compare_to,text_create_with_container:()=>text_create_with_container,text_create_with_item:()=>text_create_with_item,text_encode:()=>text_encode,text_equals_starts_ends:()=>text_equals_starts_ends,text_eval:()=>text_eval,text_find:()=>text_find,text_format:()=>text_format,text_format_noreturn:()=>text_format_noreturn,text_join:()=>text_join,text_join_seq:()=>text_join_seq,text_length:()=>text_length,text_random_char:()=>text_random_char,text_replace:()=>text_replace,text_split:()=>text_split,text_strip:()=>text_strip,text_substring:()=>text_substring,text_substring2:()=>text_substring2,text_substring3:()=>text_substring3,text_textarea:()=>text_textarea});var lists_namespaceObject={};__webpack_require__.r(lists_namespaceObject),__webpack_require__.d(lists_namespaceObject,{list_many_input:()=>list_many_input,list_tolist:()=>list_tolist,list_tolist2:()=>list_tolist2,list_trig:()=>list_trig,lists_2d_get_col_row_data:()=>lists_2d_get_col_row_data,lists_2d_get_data_with_col_row:()=>lists_2d_get_data_with_col_row,lists_append_extend:()=>lists_append_extend,lists_change_to:()=>lists_change_to,lists_change_to_general:()=>lists_change_to_general,lists_clear:()=>lists_clear,lists_create_with:()=>lists_create_with,lists_create_with2:()=>lists_create_with2,lists_create_with_container:()=>lists_create_with_container,lists_create_with_item:()=>lists_create_with_item,lists_create_with_noreturn:()=>lists_create_with_noreturn,lists_create_with_text:()=>lists_create_with_text,lists_create_with_text2:()=>lists_create_with_text2,lists_del_general:()=>lists_del_general,lists_find:()=>lists_find,lists_getIndex3:()=>lists_getIndex3,lists_getSublist3:()=>lists_getSublist3,lists_get_index:()=>lists_get_index,lists_get_random_item:()=>lists_get_random_item,lists_get_random_sublist:()=>lists_get_random_sublist,lists_get_sublist:()=>lists_get_sublist,lists_insert_value:()=>lists_insert_value,lists_insert_value2:()=>lists_insert_value2,lists_pop:()=>lists_pop,lists_remove_at:()=>lists_remove_at,lists_remove_at2:()=>lists_remove_at2,lists_reverse:()=>lists_reverse,lists_setIndex3:()=>lists_setIndex3,lists_set_index:()=>lists_set_index,lists_sort:()=>lists_sort,lists_zip:()=>lists_zip,lists_zip_container:()=>lists_zip_container,lists_zip_item:()=>lists_zip_item});var dicts_namespaceObject={};__webpack_require__.r(dicts_namespaceObject),__webpack_require__.d(dicts_namespaceObject,{dicts_add_change_del:()=>dicts_add_change_del,dicts_add_or_change:()=>dicts_add_or_change,dicts_clear:()=>dicts_clear,dicts_create_with:()=>dicts_create_with,dicts_create_with_container:()=>dicts_create_with_container,dicts_create_with_item:()=>dicts_create_with_item,dicts_create_with_noreturn:()=>dicts_create_with_noreturn,dicts_deldict:()=>dicts_deldict,dicts_delete:()=>dicts_delete,dicts_get:()=>dicts_get,dicts_get_default:()=>dicts_get_default,dicts_items:()=>dicts_items,dicts_keys:()=>dicts_keys,dicts_length:()=>dicts_length,dicts_pop:()=>dicts_pop,dicts_setdefault:()=>dicts_setdefault,dicts_to_json:()=>dicts_to_json,dicts_todict:()=>dicts_todict,dicts_update:()=>dicts_update,dicts_values:()=>dicts_values,json_to_dicts:()=>json_to_dicts});var logic_namespaceObject={};__webpack_require__.r(logic_namespaceObject),__webpack_require__.d(logic_namespaceObject,{logic_boolean:()=>logic_boolean,logic_compare:()=>logic_compare,logic_compare_continous:()=>logic_compare_continous,logic_is:()=>logic_is,logic_is_in:()=>logic_is_in,logic_negate:()=>logic_negate,logic_null:()=>logic_null,logic_operation:()=>logic_operation,logic_tobool:()=>logic_tobool,logic_true_or_false:()=>logic_true_or_false});var storage_namespaceObject={};__webpack_require__.r(storage_namespaceObject),__webpack_require__.d(storage_namespaceObject,{sdcard_mount:()=>sdcard_mount,sdcard_use_spi_init:()=>sdcard_use_spi_init,storage_can_write_ornot:()=>storage_can_write_ornot,storage_change_dir:()=>storage_change_dir,storage_close_file:()=>storage_close_file,storage_delete_file:()=>storage_delete_file,storage_file_seek:()=>storage_file_seek,storage_file_tell:()=>storage_file_tell,storage_file_write:()=>storage_file_write,storage_fileopen:()=>storage_fileopen,storage_fileopen_new:()=>storage_fileopen_new,storage_fileopen_new_encoding:()=>storage_fileopen_new_encoding,storage_get_a_line:()=>storage_get_a_line,storage_get_contents:()=>storage_get_contents,storage_get_contents_without_para:()=>storage_get_contents_without_para,storage_get_current_dir:()=>storage_get_current_dir,storage_get_file_size:()=>storage_get_file_size,storage_get_filename:()=>storage_get_filename,storage_is_file:()=>storage_is_file,storage_list_all_files:()=>storage_list_all_files,storage_make_dir:()=>storage_make_dir,storage_open_file_with_os:()=>storage_open_file_with_os,storage_rename:()=>storage_rename});var blocks_procedures_namespaceObject={};__webpack_require__.r(blocks_procedures_namespaceObject),__webpack_require__.d(blocks_procedures_namespaceObject,{procedures_callnoreturn:()=>procedures_callnoreturn,procedures_callreturn:()=>procedures_callreturn,procedures_defnoreturn:()=>procedures_defnoreturn,procedures_defreturn:()=>procedures_defreturn,procedures_ifreturn:()=>procedures_ifreturn,procedures_mutatorarg:()=>procedures_mutatorarg,procedures_mutatorcontainer:()=>procedures_mutatorcontainer,procedures_return:()=>procedures_return});var tuple_namespaceObject={};__webpack_require__.r(tuple_namespaceObject),__webpack_require__.d(tuple_namespaceObject,{tuple_change_to:()=>tuple_change_to,tuple_create_with:()=>tuple_create_with,tuple_create_with_container:()=>tuple_create_with_container,tuple_create_with_item:()=>tuple_create_with_item,tuple_create_with_noreturn:()=>tuple_create_with_noreturn,tuple_create_with_text2:()=>tuple_create_with_text2,tuple_create_with_text_return:()=>tuple_create_with_text_return,tuple_del:()=>tuple_del,tuple_find:()=>tuple_find,tuple_getIndex:()=>tuple_getIndex,tuple_getSublist:()=>tuple_getSublist,tuple_get_random_item:()=>tuple_get_random_item,tuple_get_sublist:()=>tuple_get_sublist,tuple_join:()=>tuple_join,tuple_length:()=>tuple_length,tuple_max:()=>tuple_max,tuple_totuple:()=>tuple_totuple,tuple_trig:()=>tuple_trig});var set_namespaceObject={};__webpack_require__.r(set_namespaceObject),__webpack_require__.d(set_namespaceObject,{set_add_discard:()=>set_add_discard,set_clear:()=>set_clear,set_create_with:()=>set_create_with,set_create_with_container:()=>set_create_with_container,set_create_with_item:()=>set_create_with_item,set_create_with_text_return:()=>set_create_with_text_return,set_length:()=>set_length,set_operate:()=>set_operate,set_operate_update:()=>set_operate_update,set_pop:()=>set_pop,set_sub:()=>set_sub,set_toset:()=>set_toset,set_update:()=>set_update});var html_namespaceObject={};__webpack_require__.r(html_namespaceObject),__webpack_require__.d(html_namespaceObject,{html_content:()=>html_content,html_content_more:()=>html_content_more,html_document:()=>html_document,html_form:()=>html_form,html_head_body:()=>html_head_body,html_style:()=>html_style,html_style_color:()=>html_style_color,html_style_content:()=>html_style_content,html_text:()=>html_text,html_title:()=>html_title});var utility_namespaceObject={};__webpack_require__.r(utility_namespaceObject),__webpack_require__.d(utility_namespaceObject,{attribute_access:()=>attribute_access,function_call:()=>function_call,function_call_container:()=>function_call_container,function_call_item:()=>function_call_item,raw_block:()=>raw_block,raw_empty:()=>raw_empty,raw_expression:()=>raw_expression,raw_table:()=>raw_table,text_comment:()=>text_comment,text_print_multiple:()=>text_print_multiple,text_print_multiple_container:()=>text_print_multiple_container,text_print_multiple_item:()=>text_print_multiple_item,type_check:()=>type_check});var generators_variables_namespaceObject={};__webpack_require__.r(generators_variables_namespaceObject),__webpack_require__.d(generators_variables_namespaceObject,{controls_type:()=>variables_controls_type,controls_typeLists:()=>variables_controls_typeLists,variables_change:()=>variables_variables_change,variables_get:()=>variables_variables_get,variables_global:()=>variables_variables_global,variables_set:()=>variables_variables_set});var generators_control_namespaceObject={};__webpack_require__.r(generators_control_namespaceObject),__webpack_require__.d(generators_control_namespaceObject,{Panic_with_status_code:()=>Panic_with_status_code,base_setup:()=>control_base_setup,controls_delay:()=>control_controls_delay,controls_flow_statements:()=>control_controls_flow_statements,controls_for:()=>control_controls_for,controls_forEach:()=>control_controls_forEach,controls_for_range:()=>control_controls_for_range,controls_if:()=>control_controls_if,controls_interrupts:()=>controls_interrupts,controls_lambda:()=>control_controls_lambda,controls_main:()=>control_controls_main,controls_millis:()=>controls_millis,controls_nointerrupts:()=>controls_nointerrupts,controls_pass:()=>control_controls_pass,controls_range:()=>control_controls_range,controls_repeat:()=>controls_repeat,controls_repeat_ext:()=>control_controls_repeat_ext,controls_thread:()=>control_controls_thread,controls_try_finally:()=>control_controls_try_finally,controls_whileUntil:()=>control_controls_whileUntil,do_while:()=>control_do_while,garbage_collection:()=>control_garbage_collection,get_mem_alloc:()=>control_get_mem_alloc,get_mem_free:()=>control_get_mem_free,reset:()=>control_reset,time_sleep:()=>time_sleep});var generators_math_namespaceObject={};__webpack_require__.r(generators_math_namespaceObject),__webpack_require__.d(generators_math_namespaceObject,{base_map:()=>math_base_map,math_arithmetic:()=>math_math_arithmetic,math_bit:()=>math_math_bit,math_constant:()=>math_math_constant,math_constant_mp:()=>math_math_constant_mp,math_constrain:()=>math_math_constrain,math_dec:()=>math_math_dec,math_indexer_number:()=>math_math_indexer_number,math_map:()=>math_math_map,math_max_min:()=>math_math_max_min,math_number:()=>math_math_number,math_number_base_conversion:()=>math_math_number_base_conversion,math_random:()=>math_math_random,math_random_seed:()=>math_math_random_seed,math_round:()=>math_math_round,math_selfcalcu:()=>math_math_selfcalcu,math_single:()=>math_single,math_to_int:()=>math_math_to_int,math_trig:()=>math_math_trig,text_to_number:()=>math_text_to_number,text_to_number_skulpt:()=>math_text_to_number_skulpt});var generators_text_namespaceObject={};__webpack_require__.r(generators_text_namespaceObject),__webpack_require__.d(generators_text_namespaceObject,{ascii_to_char:()=>text_ascii_to_char,char_to_ascii:()=>text_char_to_ascii,number_to_text:()=>text_number_to_text,os_system:()=>text_os_system,text:()=>generators_text_text,text_capital:()=>text_text_capital,text_center:()=>text_text_center,text_char:()=>text_text_char,text_char_at:()=>text_text_char_at,text_char_at2:()=>text_text_char_at2,text_char_at3:()=>text_text_char_at3,text_compareTo:()=>text_text_compareTo,text_compare_to:()=>text_text_compare_to,text_encode:()=>text_text_encode,text_equals_starts_ends:()=>text_text_equals_starts_ends,text_eval:()=>text_text_eval,text_find:()=>text_text_find,text_format:()=>text_text_format,text_format_noreturn:()=>text_text_format_noreturn,text_join:()=>text_text_join,text_join_seq:()=>text_text_join_seq,text_length:()=>text_text_length,text_random_char:()=>text_text_random_char,text_replace:()=>text_text_replace,text_split:()=>text_text_split,text_strip:()=>text_text_strip,text_substring:()=>text_text_substring,text_substring2:()=>text_text_substring2,text_substring3:()=>text_text_substring3,text_textarea:()=>text_text_textarea});var generators_lists_namespaceObject={};__webpack_require__.r(generators_lists_namespaceObject),__webpack_require__.d(generators_lists_namespaceObject,{list_many_input:()=>lists_list_many_input,list_tolist:()=>lists_list_tolist,list_tolist2:()=>lists_list_tolist2,list_trig:()=>lists_list_trig,lists_2d_get_col_row_data:()=>lists_lists_2d_get_col_row_data,lists_2d_get_data_with_col_row:()=>lists_lists_2d_get_data_with_col_row,lists_append_extend:()=>lists_lists_append_extend,lists_change_to:()=>lists_lists_change_to,lists_change_to_general:()=>lists_lists_change_to_general,lists_clear:()=>lists_lists_clear,lists_create_with:()=>lists_lists_create_with,lists_create_with2:()=>lists_lists_create_with2,lists_create_with_noreturn:()=>lists_lists_create_with_noreturn,lists_create_with_text:()=>lists_lists_create_with_text,lists_create_with_text2:()=>lists_lists_create_with_text2,lists_del_general:()=>lists_lists_del_general,lists_find:()=>lists_lists_find,lists_getIndex3:()=>lists_lists_getIndex3,lists_getSublist3:()=>lists_lists_getSublist3,lists_get_index:()=>lists_lists_get_index,lists_get_random_item:()=>lists_lists_get_random_item,lists_get_random_sublist:()=>lists_lists_get_random_sublist,lists_get_sublist:()=>lists_lists_get_sublist,lists_insert_value:()=>lists_lists_insert_value,lists_insert_value2:()=>lists_lists_insert_value2,lists_pop:()=>lists_lists_pop,lists_remove_at:()=>lists_lists_remove_at,lists_remove_at2:()=>lists_lists_remove_at2,lists_reverse:()=>lists_lists_reverse,lists_setIndex3:()=>lists_lists_setIndex3,lists_set_index:()=>lists_lists_set_index,lists_sort:()=>lists_lists_sort,lists_zip:()=>lists_lists_zip});var generators_dicts_namespaceObject={};__webpack_require__.r(generators_dicts_namespaceObject),__webpack_require__.d(generators_dicts_namespaceObject,{dicts_add_change_del:()=>dicts_dicts_add_change_del,dicts_add_or_change:()=>dicts_dicts_add_or_change,dicts_clear:()=>dicts_dicts_clear,dicts_create_with:()=>dicts_dicts_create_with,dicts_create_with_noreturn:()=>dicts_dicts_create_with_noreturn,dicts_deldict:()=>dicts_dicts_deldict,dicts_delete:()=>dicts_dicts_delete,dicts_get:()=>dicts_dicts_get,dicts_get_default:()=>dicts_dicts_get_default,dicts_items:()=>dicts_dicts_items,dicts_keys:()=>dicts_dicts_keys,dicts_length:()=>dicts_dicts_length,dicts_pop:()=>dicts_dicts_pop,dicts_setdefault:()=>dicts_dicts_setdefault,dicts_to_json:()=>dicts_dicts_to_json,dicts_todict:()=>dicts_dicts_todict,dicts_update:()=>dicts_dicts_update,dicts_values:()=>dicts_dicts_values,json_to_dicts:()=>dicts_json_to_dicts});var generators_logic_namespaceObject={};__webpack_require__.r(generators_logic_namespaceObject),__webpack_require__.d(generators_logic_namespaceObject,{logic_boolean:()=>logic_logic_boolean,logic_compare:()=>logic_logic_compare,logic_compare_continous:()=>logic_logic_compare_continous,logic_is:()=>logic_logic_is,logic_is_in:()=>logic_logic_is_in,logic_negate:()=>logic_logic_negate,logic_null:()=>logic_logic_null,logic_operation:()=>logic_logic_operation,logic_tobool:()=>logic_logic_tobool,logic_true_or_false:()=>logic_logic_true_or_false});var generators_storage_namespaceObject={};__webpack_require__.r(generators_storage_namespaceObject),__webpack_require__.d(generators_storage_namespaceObject,{sdcard_mount:()=>storage_sdcard_mount,sdcard_use_spi_init:()=>storage_sdcard_use_spi_init,storage_can_write_ornot:()=>storage_storage_can_write_ornot,storage_change_dir:()=>storage_storage_change_dir,storage_close_file:()=>storage_storage_close_file,storage_delete_file:()=>storage_storage_delete_file,storage_file_seek:()=>storage_storage_file_seek,storage_file_tell:()=>storage_storage_file_tell,storage_file_write:()=>storage_storage_file_write,storage_fileopen:()=>storage_storage_fileopen,storage_fileopen_new:()=>storage_storage_fileopen_new,storage_fileopen_new_encoding:()=>storage_storage_fileopen_new_encoding,storage_get_a_line:()=>storage_storage_get_a_line,storage_get_contents:()=>storage_storage_get_contents,storage_get_contents_without_para:()=>storage_storage_get_contents_without_para,storage_get_current_dir:()=>storage_storage_get_current_dir,storage_get_file_size:()=>storage_storage_get_file_size,storage_get_filename:()=>storage_storage_get_filename,storage_is_file:()=>storage_storage_is_file,storage_list_all_files:()=>storage_storage_list_all_files,storage_make_dir:()=>storage_storage_make_dir,storage_open_file_with_os:()=>storage_storage_open_file_with_os,storage_rename:()=>storage_storage_rename});var generators_procedures_namespaceObject={};__webpack_require__.r(generators_procedures_namespaceObject),__webpack_require__.d(generators_procedures_namespaceObject,{procedures_callnoreturn:()=>procedures_procedures_callnoreturn,procedures_callreturn:()=>procedures_procedures_callreturn,procedures_defnoreturn:()=>procedures_procedures_defnoreturn,procedures_defreturn:()=>procedures_procedures_defreturn,procedures_ifreturn:()=>procedures_procedures_ifreturn,procedures_return:()=>procedures_procedures_return});var generators_tuple_namespaceObject={};__webpack_require__.r(generators_tuple_namespaceObject),__webpack_require__.d(generators_tuple_namespaceObject,{tuple_change_to:()=>tuple_tuple_change_to,tuple_create_with:()=>tuple_tuple_create_with,tuple_create_with_noreturn:()=>tuple_tuple_create_with_noreturn,tuple_create_with_text2:()=>tuple_tuple_create_with_text2,tuple_create_with_text_return:()=>tuple_tuple_create_with_text_return,tuple_del:()=>tuple_tuple_del,tuple_find:()=>tuple_tuple_find,tuple_getIndex:()=>tuple_tuple_getIndex,tuple_getSublist:()=>tuple_tuple_getSublist,tuple_get_random_item:()=>tuple_tuple_get_random_item,tuple_get_sublist:()=>tuple_tuple_get_sublist,tuple_join:()=>tuple_tuple_join,tuple_length:()=>tuple_tuple_length,tuple_max:()=>tuple_tuple_max,tuple_totuple:()=>tuple_tuple_totuple,tuple_trig:()=>tuple_tuple_trig});var generators_set_namespaceObject={};__webpack_require__.r(generators_set_namespaceObject),__webpack_require__.d(generators_set_namespaceObject,{set_add_discard:()=>set_set_add_discard,set_clear:()=>set_set_clear,set_create_with:()=>set_set_create_with,set_create_with_text_return:()=>set_set_create_with_text_return,set_length:()=>set_set_length,set_operate:()=>set_set_operate,set_operate_update:()=>set_set_operate_update,set_pop:()=>set_set_pop,set_sub:()=>set_set_sub,set_toset:()=>set_set_toset,set_update:()=>set_set_update});var generators_html_namespaceObject={};__webpack_require__.r(generators_html_namespaceObject),__webpack_require__.d(generators_html_namespaceObject,{html_content:()=>html_html_content,html_content_more:()=>html_html_content_more,html_document:()=>html_html_document,html_form:()=>html_html_form,html_head_body:()=>html_html_head_body,html_style:()=>html_html_style,html_style_content:()=>html_html_style_content,html_text:()=>html_html_text,html_title:()=>html_html_title});var generators_utility_namespaceObject={};__webpack_require__.r(generators_utility_namespaceObject),__webpack_require__.d(generators_utility_namespaceObject,{attribute_access:()=>utility_attribute_access,function_call:()=>utility_function_call,raw_block:()=>utility_raw_block,raw_empty:()=>utility_raw_empty,raw_expression:()=>utility_raw_expression,raw_table:()=>utility_raw_table,type_check:()=>utility_type_check});var ai_namespaceObject={};__webpack_require__.r(ai_namespaceObject),__webpack_require__.d(ai_namespaceObject,{AI_ChooseAndGet:()=>AI_ChooseAndGet,AI_Face_match:()=>AI_Face_match,AI_ImageClassify:()=>AI_ImageClassify,AI_ImageClassify_Func:()=>AI_ImageClassify_Func,AI_Nlp:()=>AI_Nlp,AI_Nlp_Func:()=>AI_Nlp_Func,AI_Nlp_Func_sim:()=>AI_Nlp_Func_sim,AI_Nlp_Sim:()=>AI_Nlp_Sim,AI_Nlp_Topic:()=>AI_Nlp_Topic,AI_Nlp_newsSummary:()=>AI_Nlp_newsSummary,AI_Ocr:()=>AI_Ocr,AI_Ocr_Func:()=>AI_Ocr_Func,AI_Speech_asr:()=>AI_Speech_asr,AI_Speech_synthesis:()=>AI_Speech_synthesis,AI_audio:()=>AI_audio,AI_client:()=>AI_client,AI_photo:()=>AI_photo,AI_result:()=>AI_result});var algorithm_namespaceObject={};__webpack_require__.r(algorithm_namespaceObject),__webpack_require__.d(algorithm_namespaceObject,{algorithm_add_path:()=>algorithm_add_path,algorithm_add_school:()=>algorithm_add_school,algorithm_all_books:()=>algorithm_all_books,algorithm_all_books_sequence:()=>algorithm_all_books_sequence,algorithm_book_scale:()=>algorithm_book_scale,algorithm_check_feet:()=>algorithm_check_feet,algorithm_chick_calculate:()=>algorithm_chick_calculate,algorithm_color_seclet:()=>algorithm_color_seclet,algorithm_current_school:()=>algorithm_current_school,algorithm_del_path:()=>algorithm_del_path,algorithm_delete_book:()=>algorithm_delete_book,algorithm_delete_books:()=>algorithm_delete_books,algorithm_delete_books2:()=>algorithm_delete_books2,algorithm_divide_books:()=>algorithm_divide_books,algorithm_find_path:()=>algorithm_find_path,algorithm_first_book:()=>algorithm_first_book,algorithm_fz_calc:()=>algorithm_fz_calc,algorithm_fz_calc_first_min:()=>algorithm_fz_calc_first_min,algorithm_fz_compare:()=>algorithm_fz_compare,algorithm_fz_move:()=>algorithm_fz_move,algorithm_fz_set_min:()=>algorithm_fz_set_min,algorithm_get_book_num:()=>algorithm_get_book_num,algorithm_get_current_location:()=>algorithm_get_current_location,algorithm_get_half_books:()=>algorithm_get_half_books,algorithm_hxdb_add:()=>algorithm_hxdb_add,algorithm_hxdb_init_soldier:()=>algorithm_hxdb_init_soldier,algorithm_hxdb_last_line:()=>algorithm_hxdb_last_line,algorithm_hxdb_result:()=>algorithm_hxdb_result,algorithm_hxdb_stand_in_line:()=>algorithm_hxdb_stand_in_line,algorithm_init_fzsf:()=>algorithm_init_fzsf,algorithm_init_hxdb:()=>algorithm_init_hxdb,algorithm_init_jttl:()=>algorithm_init_jttl,algorithm_move_recent:()=>algorithm_move_recent,algorithm_new_path:()=>algorithm_new_path,algorithm_next_book:()=>algorithm_next_book,algorithm_no_left:()=>algorithm_no_left,algorithm_no_path:()=>algorithm_no_path,algorithm_no_ring2:()=>algorithm_no_ring2,algorithm_not_home:()=>algorithm_not_home,algorithm_not_school:()=>algorithm_not_school,algorithm_number_add:()=>algorithm_number_add,algorithm_number_zero:()=>algorithm_number_zero,algorithm_prepare:()=>algorithm_prepare,algorithm_prepare2:()=>algorithm_prepare2,algorithm_prepare_2_1:()=>algorithm_prepare_2_1,algorithm_prepare_2_2:()=>algorithm_prepare_2_2,algorithm_print_book2:()=>algorithm_print_book2,algorithm_print_divide:()=>algorithm_print_divide,algorithm_print_jttl_answer:()=>algorithm_print_jttl_answer,algorithm_print_number:()=>algorithm_print_number,algorithm_print_path:()=>algorithm_print_path,algorithm_print_path2:()=>algorithm_print_path2,algorithm_print_sequence:()=>algorithm_print_sequence,algorithm_rabbit_add:()=>algorithm_rabbit_add,algorithm_rabbit_number_in_range:()=>algorithm_rabbit_number_in_range,algorithm_rabbit_zero:()=>algorithm_rabbit_zero,algorithm_return_path:()=>algorithm_return_path,algorithm_set_path:()=>algorithm_set_path,algorithm_two_left:()=>algorithm_two_left,algorithm_void_path:()=>algorithm_void_path,algorithm_yes_ring2:()=>algorithm_yes_ring2,hanoi_init:()=>hanoi_init,hanoi_init_offline:()=>hanoi_init_offline,hanoi_move:()=>hanoi_move});var communicate_namespaceObject={};__webpack_require__.r(communicate_namespaceObject),__webpack_require__.d(communicate_namespaceObject,{requests_attribute:()=>requests_attribute,requests_get:()=>requests_get,requests_get_old:()=>requests_get_old,requests_method:()=>requests_method,requests_post:()=>requests_post});var cv_namespaceObject={};__webpack_require__.r(cv_namespaceObject),__webpack_require__.d(cv_namespaceObject,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});var data_namespaceObject={};__webpack_require__.r(data_namespaceObject),__webpack_require__.d(data_namespaceObject,{array_create:()=>array_create,array_toarray:()=>array_toarray,dataframe_create:()=>dataframe_create,dataframe_create_from_index:()=>dataframe_create_from_index,dataframe_create_from_one_index:()=>dataframe_create_from_one_index,dataframe_fillna:()=>dataframe_fillna,dataframe_get:()=>dataframe_get,dataframe_info:()=>dataframe_info,dataframe_median:()=>dataframe_median,matrix_multiplication:()=>matrix_multiplication,matrix_transpose:()=>matrix_transpose,numpy_argmin_template_match:()=>numpy_argmin_template_match,numpy_astype:()=>numpy_astype,numpy_c_:()=>numpy_c_,numpy_dot:()=>numpy_dot,numpy_linalg_det:()=>numpy_linalg_det,numpy_linalg_inv:()=>numpy_linalg_inv,numpy_max:()=>numpy_max,numpy_mean:()=>numpy_mean,numpy_mean_digit:()=>numpy_mean_digit,numpy_min:()=>numpy_min,numpy_ones:()=>numpy_ones,numpy_random_random:()=>numpy_random_random,numpy_reshape:()=>numpy_reshape,numpy_shape:()=>numpy_shape,numpy_size:()=>numpy_size,numpy_square:()=>numpy_square,numpy_std:()=>numpy_std,numpy_sum:()=>numpy_sum,numpy_trig:()=>numpy_trig,pandas_drop_columns:()=>pandas_drop_columns,pandas_dropna:()=>pandas_dropna,pandas_readcsv:()=>pandas_readcsv,pl_axes:()=>pl_axes,pl_bar:()=>pl_bar,pl_hist:()=>pl_hist,pl_label:()=>pl_label,pl_legend:()=>pl_legend,pl_pie:()=>pl_pie,pl_plot:()=>pl_plot,pl_plot_bar:()=>pl_plot_bar,pl_plot_easy:()=>pl_plot_easy,pl_plot_scatter:()=>pl_plot_scatter,pl_plot_xy:()=>pl_plot_xy,pl_savefig:()=>pl_savefig,pl_show:()=>pl_show,pl_subplot:()=>pl_subplot,pl_text:()=>pl_text,pl_ticks:()=>pl_ticks,pl_title:()=>pl_title,plot_axes:()=>plot_axes,plot_bar:()=>plot_bar,plot_hist:()=>plot_hist,plot_label:()=>plot_label,plot_legend:()=>plot_legend,plot_pie:()=>plot_pie,plot_plot:()=>plot_plot,plot_plot_bar:()=>plot_plot_bar,plot_plot_easy:()=>plot_plot_easy,plot_plot_scatter:()=>plot_plot_scatter,plot_plot_xy:()=>plot_plot_xy,plot_savefig:()=>plot_savefig,plot_show:()=>plot_show,plot_subplot:()=>plot_subplot,plot_text:()=>plot_text,plot_ticks:()=>plot_ticks,plot_title:()=>plot_title,py_sum:()=>py_sum,pylab_imshow:()=>pylab_imshow,series_create:()=>series_create,series_create_from_index:()=>series_create_from_index,series_create_from_text:()=>series_create_from_text,series_get_num:()=>series_get_num,series_index_value:()=>series_index_value});var datastructure_namespaceObject={};__webpack_require__.r(datastructure_namespaceObject),__webpack_require__.d(datastructure_namespaceObject,{ds_add_node_by_attr:()=>ds_add_node_by_attr,ds_add_node_by_name:()=>ds_add_node_by_name,ds_create_linkedlist:()=>ds_create_linkedlist,ds_create_linkedlist_container:()=>ds_create_linkedlist_container,ds_create_linkedlist_item:()=>ds_create_linkedlist_item,ds_create_node:()=>ds_create_node,ds_del_node_by_attr:()=>ds_del_node_by_attr,ds_del_node_by_name:()=>ds_del_node_by_name,ds_get_node_attr:()=>ds_get_node_attr,ds_reverse_linkedlist:()=>ds_reverse_linkedlist,ds_set_node_attr:()=>ds_set_node_attr});var factory_namespaceObject={};__webpack_require__.r(factory_namespaceObject),__webpack_require__.d(factory_namespaceObject,{factory_block:()=>factory_block,factory_block_return:()=>factory_block_return,factory_block_return_with_textarea:()=>factory_block_return_with_textarea,factory_block_with_textarea:()=>factory_block_with_textarea,factory_callMethod_noreturn:()=>factory_callMethod_noreturn,factory_callMethod_return:()=>factory_callMethod_return,factory_create_with_container:()=>factory_create_with_container,factory_create_with_item:()=>factory_create_with_item,factory_declare:()=>factory_declare,factory_from_import:()=>factory_from_import,factory_function_noreturn:()=>factory_function_noreturn,factory_function_return:()=>factory_function_return,factory_import:()=>factory_import});var hardware_namespaceObject={};__webpack_require__.r(hardware_namespaceObject),__webpack_require__.d(hardware_namespaceObject,{hardware_arduino_analog_read:()=>hardware_arduino_analog_read,hardware_arduino_analog_write:()=>hardware_arduino_analog_write,hardware_arduino_digital_read:()=>hardware_arduino_digital_read,hardware_arduino_digital_write:()=>hardware_arduino_digital_write,hardware_arduino_start:()=>hardware_arduino_start,inout_highlow:()=>inout_highlow});var inout_namespaceObject={};__webpack_require__.r(inout_namespaceObject),__webpack_require__.d(inout_namespaceObject,{inout_input:()=>inout_input,inout_print:()=>inout_print,inout_print_container:()=>inout_print_container,inout_print_end:()=>inout_print_end,inout_print_inline:()=>inout_print_inline,inout_print_item:()=>inout_print_item,inout_print_many:()=>inout_print_many,inout_type_input:()=>inout_type_input,pyinout_type_input:()=>pyinout_type_input});var iot_namespaceObject={};__webpack_require__.r(iot_namespaceObject),__webpack_require__.d(iot_namespaceObject,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE,IOT_EMQX_PING:()=>IOT_EMQX_PING,IOT_FORMATTING:()=>IOT_FORMATTING,IOT_FORMAT_STRING:()=>IOT_FORMAT_STRING,IOT_MIXIO_NTP:()=>IOT_MIXIO_NTP,IOT_MIXIO_PUBLISH:()=>IOT_MIXIO_PUBLISH,IOT_MIXIO_SUBSCRIBE:()=>IOT_MIXIO_SUBSCRIBE,IOT_MIXIO_UNSUBSCRIBE:()=>IOT_MIXIO_UNSUBSCRIBE,iot_checkonenet:()=>iot_checkonenet,iot_client_onboard:()=>iot_client_onboard,iot_create_with_item:()=>iot_create_with_item,iot_http_client:()=>iot_http_client,iot_http_data:()=>iot_http_data,iot_mixio_check:()=>iot_mixio_check,iot_mixio_connect:()=>iot_mixio_connect,iot_mixio_connect_only:()=>iot_mixio_connect_only,iot_mixio_disconnect:()=>iot_mixio_disconnect,iot_mixio_format_msg:()=>iot_mixio_format_msg,iot_mixio_format_topic:()=>iot_mixio_format_topic,iot_mixly_key:()=>iot_mixly_key,iot_mixly_key_py:()=>iot_mixly_key_py,iot_mqtt_client:()=>iot_mqtt_client,iot_mqtt_data:()=>iot_mqtt_data,iot_onenet_check:()=>iot_onenet_check,iot_onenet_connect:()=>iot_onenet_connect,iot_onenet_disconnect:()=>iot_onenet_disconnect,iot_onenet_publish:()=>iot_onenet_publish,iot_onenet_publish_dict:()=>iot_onenet_publish_dict,iot_onenetconnect:()=>iot_onenetconnect,iot_onenetdisconnect:()=>iot_onenetdisconnect,iot_publish:()=>iot_publish,iot_publish_container:()=>iot_publish_container,iot_publish_item:()=>iot_publish_item});var pins_namespaceObject={};__webpack_require__.r(pins_namespaceObject),__webpack_require__.d(pins_namespaceObject,{pins_analog_read:()=>pins_analog_read,pins_analog_write:()=>pins_analog_write,pins_digital_read:()=>pins_digital_read,pins_digital_write:()=>pins_digital_write});var serial_namespaceObject={};__webpack_require__.r(serial_namespaceObject),__webpack_require__.d(serial_namespaceObject,{serial_close:()=>serial_close,serial_open:()=>serial_open,serial_read_b:()=>serial_read_b,serial_write:()=>serial_write});var sklearn_namespaceObject={};__webpack_require__.r(sklearn_namespaceObject),__webpack_require__.d(sklearn_namespaceObject,{sklearn_DecisionTreeClassifier_Regressor:()=>sklearn_DecisionTreeClassifier_Regressor,sklearn_GaussianNB:()=>sklearn_GaussianNB,sklearn_KMeans:()=>sklearn_KMeans,sklearn_KNeighborsClassifier_Regressor:()=>sklearn_KNeighborsClassifier_Regressor,sklearn_LinearRegression:()=>sklearn_LinearRegression,sklearn_RandomForestClassifier_Regressor:()=>sklearn_RandomForestClassifier_Regressor,sklearn_Ridge:()=>sklearn_Ridge,sklearn_cluster_centers_labels_inertia:()=>sklearn_cluster_centers_labels_inertia,sklearn_coef_intercept:()=>sklearn_coef_intercept,sklearn_data_target:()=>sklearn_data_target,sklearn_fit:()=>sklearn_fit,sklearn_fit_no_target:()=>sklearn_fit_no_target,sklearn_load:()=>sklearn_load,sklearn_make_blobs:()=>sklearn_make_blobs,sklearn_make_classification:()=>sklearn_make_classification,sklearn_make_regression:()=>sklearn_make_regression,sklearn_predict:()=>sklearn_predict,sklearn_save_load_model:()=>sklearn_save_load_model,sklearn_score:()=>sklearn_score,sklearn_score_no_target:()=>sklearn_score_no_target,sklearn_train_test_split:()=>sklearn_train_test_split,sklearn_train_test_split_no_target:()=>sklearn_train_test_split_no_target});var system_namespaceObject={};__webpack_require__.r(system_namespaceObject),__webpack_require__.d(system_namespaceObject,{Panic_with_status_code:()=>system_Panic_with_status_code,base_delay:()=>base_delay,controls_millis:()=>system_controls_millis,controls_mstimer2:()=>controls_mstimer2,controls_mstimer2_start:()=>controls_mstimer2_start,controls_mstimer2_stop:()=>controls_mstimer2_stop,reset:()=>system_reset,time_localtime:()=>time_localtime,time_sleep:()=>system_time_sleep});var turtle_namespaceObject={};__webpack_require__.r(turtle_namespaceObject),__webpack_require__.d(turtle_namespaceObject,{turtle_bgcolor:()=>turtle_bgcolor,turtle_bgcolor_hex:()=>turtle_bgcolor_hex,turtle_bgcolor_hex_new:()=>turtle_bgcolor_hex_new,turtle_circle:()=>turtle_circle,turtle_circle_advanced:()=>turtle_circle_advanced,turtle_clear:()=>turtle_clear,turtle_clone:()=>turtle_clone,turtle_color:()=>turtle_color,turtle_color_hex:()=>turtle_color_hex,turtle_color_seclet:()=>turtle_color_seclet,turtle_create:()=>turtle_create,turtle_done:()=>turtle_done,turtle_exitonclick:()=>turtle_exitonclick,turtle_fill:()=>turtle_fill,turtle_fillcolor:()=>turtle_fillcolor,turtle_fillcolor_hex:()=>turtle_fillcolor_hex,turtle_fillcolor_hex_new:()=>turtle_fillcolor_hex_new,turtle_getscreen:()=>turtle_getscreen,turtle_goto:()=>turtle_goto,turtle_listen:()=>turtle_listen,turtle_move:()=>turtle_move,turtle_numinput:()=>turtle_numinput,turtle_onclick:()=>turtle_onclick,turtle_onkey:()=>turtle_onkey,turtle_ontimer:()=>turtle_ontimer,turtle_pencolor:()=>turtle_pencolor,turtle_pencolor_hex:()=>turtle_pencolor_hex,turtle_pencolor_hex_new:()=>turtle_pencolor_hex_new,turtle_penup:()=>turtle_penup,turtle_pos_shape:()=>turtle_pos_shape,turtle_rotate:()=>turtle_rotate,turtle_screen_delay:()=>turtle_screen_delay,turtle_screen_savefig:()=>turtle_screen_savefig,turtle_setheading:()=>turtle_setheading,turtle_setxy:()=>turtle_setxy,turtle_shape:()=>turtle_shape,turtle_shapesize:()=>turtle_shapesize,turtle_size:()=>turtle_size,turtle_size_speed:()=>turtle_size_speed,turtle_speed:()=>turtle_speed,turtle_textinput:()=>turtle_textinput,turtle_visible:()=>turtle_visible,turtle_write:()=>turtle_write,turtle_write_format:()=>turtle_write_format,turtle_write_format_skulpt:()=>turtle_write_format_skulpt});var generators_ai_namespaceObject={};__webpack_require__.r(generators_ai_namespaceObject),__webpack_require__.d(generators_ai_namespaceObject,{AI_ChooseAndGet:()=>ai_AI_ChooseAndGet,AI_Face_match:()=>ai_AI_Face_match,AI_ImageClassify:()=>ai_AI_ImageClassify,AI_ImageClassify_Func:()=>ai_AI_ImageClassify_Func,AI_Nlp:()=>ai_AI_Nlp,AI_Nlp_Func:()=>ai_AI_Nlp_Func,AI_Nlp_Func_sim:()=>ai_AI_Nlp_Func_sim,AI_Nlp_Sim:()=>ai_AI_Nlp_Sim,AI_Nlp_Topic:()=>ai_AI_Nlp_Topic,AI_Nlp_newsSummary:()=>ai_AI_Nlp_newsSummary,AI_Ocr:()=>ai_AI_Ocr,AI_Ocr_Func:()=>ai_AI_Ocr_Func,AI_Speech_asr:()=>ai_AI_Speech_asr,AI_Speech_synthesis:()=>ai_AI_Speech_synthesis,AI_audio:()=>ai_AI_audio,AI_client:()=>ai_AI_client,AI_photo:()=>ai_AI_photo,AI_result:()=>ai_AI_result});var generators_algorithm_namespaceObject={};__webpack_require__.r(generators_algorithm_namespaceObject),__webpack_require__.d(generators_algorithm_namespaceObject,{algorithm_add_path:()=>algorithm_algorithm_add_path,algorithm_add_school:()=>algorithm_algorithm_add_school,algorithm_all_books:()=>algorithm_algorithm_all_books,algorithm_all_books_sequence:()=>algorithm_algorithm_all_books_sequence,algorithm_book_scale:()=>algorithm_algorithm_book_scale,algorithm_check_feet:()=>algorithm_algorithm_check_feet,algorithm_chick_calculate:()=>algorithm_algorithm_chick_calculate,algorithm_color_seclet:()=>algorithm_algorithm_color_seclet,algorithm_current_school:()=>algorithm_algorithm_current_school,algorithm_del_path:()=>algorithm_algorithm_del_path,algorithm_delete_book:()=>algorithm_algorithm_delete_book,algorithm_divide_books:()=>algorithm_algorithm_divide_books,algorithm_find_path:()=>algorithm_algorithm_find_path,algorithm_first_book:()=>algorithm_algorithm_first_book,algorithm_fz_calc:()=>algorithm_algorithm_fz_calc,algorithm_fz_compare:()=>algorithm_algorithm_fz_compare,algorithm_fz_move:()=>algorithm_algorithm_fz_move,algorithm_fz_set_min:()=>algorithm_algorithm_fz_set_min,algorithm_get_current_location:()=>algorithm_algorithm_get_current_location,algorithm_get_half_books:()=>algorithm_algorithm_get_half_books,algorithm_hxdb_add:()=>algorithm_algorithm_hxdb_add,algorithm_hxdb_init_soldier:()=>algorithm_algorithm_hxdb_init_soldier,algorithm_hxdb_last_line:()=>algorithm_algorithm_hxdb_last_line,algorithm_hxdb_result:()=>algorithm_algorithm_hxdb_result,algorithm_hxdb_stand_in_line:()=>algorithm_algorithm_hxdb_stand_in_line,algorithm_init_fzsf:()=>algorithm_algorithm_init_fzsf,algorithm_init_hxdb:()=>algorithm_algorithm_init_hxdb,algorithm_init_jttl:()=>algorithm_algorithm_init_jttl,algorithm_move_recent:()=>algorithm_algorithm_move_recent,algorithm_new_path:()=>algorithm_algorithm_new_path,algorithm_next_book:()=>algorithm_algorithm_next_book,algorithm_no_left:()=>algorithm_algorithm_no_left,algorithm_no_path:()=>algorithm_algorithm_no_path,algorithm_no_ring2:()=>algorithm_algorithm_no_ring2,algorithm_not_home:()=>algorithm_algorithm_not_home,algorithm_not_school:()=>algorithm_algorithm_not_school,algorithm_number_add:()=>algorithm_algorithm_number_add,algorithm_number_zero:()=>algorithm_algorithm_number_zero,algorithm_prepare:()=>algorithm_algorithm_prepare,algorithm_prepare2:()=>algorithm_algorithm_prepare2,algorithm_prepare_2_1:()=>algorithm_algorithm_prepare_2_1,algorithm_prepare_2_2:()=>algorithm_algorithm_prepare_2_2,algorithm_print_book2:()=>algorithm_algorithm_print_book2,algorithm_print_jttl_answer:()=>algorithm_algorithm_print_jttl_answer,algorithm_print_number:()=>algorithm_algorithm_print_number,algorithm_print_path:()=>algorithm_algorithm_print_path,algorithm_print_path2:()=>algorithm_algorithm_print_path2,algorithm_rabbit_add:()=>algorithm_algorithm_rabbit_add,algorithm_rabbit_number_in_range:()=>algorithm_algorithm_rabbit_number_in_range,algorithm_rabbit_zero:()=>algorithm_algorithm_rabbit_zero,algorithm_return_path:()=>algorithm_algorithm_return_path,algorithm_set_path:()=>algorithm_algorithm_set_path,algorithm_two_left:()=>algorithm_algorithm_two_left,algorithm_void_path:()=>algorithm_algorithm_void_path,algorithm_yes_ring2:()=>algorithm_algorithm_yes_ring2,hanoi_init:()=>algorithm_hanoi_init,hanoi_init_offline:()=>algorithm_hanoi_init_offline,hanoi_move:()=>algorithm_hanoi_move});var generators_communicate_namespaceObject={};__webpack_require__.r(generators_communicate_namespaceObject),__webpack_require__.d(generators_communicate_namespaceObject,{requests_attribute:()=>communicate_requests_attribute,requests_get:()=>communicate_requests_get,requests_get_old:()=>communicate_requests_get_old,requests_method:()=>communicate_requests_method,requests_post:()=>communicate_requests_post});var generators_data_namespaceObject={};__webpack_require__.r(generators_data_namespaceObject),__webpack_require__.d(generators_data_namespaceObject,{array_create:()=>data_array_create,array_toarray:()=>data_array_toarray,dataframe_create:()=>data_dataframe_create,dataframe_create_from_index:()=>data_dataframe_create_from_index,dataframe_create_from_one_index:()=>data_dataframe_create_from_one_index,dataframe_fillna:()=>data_dataframe_fillna,dataframe_get:()=>data_dataframe_get,dataframe_info:()=>data_dataframe_info,dataframe_median:()=>data_dataframe_median,matrix_multiplication:()=>data_matrix_multiplication,matrix_transpose:()=>data_matrix_transpose,numpy_argmin_template_match:()=>data_numpy_argmin_template_match,numpy_astype:()=>data_numpy_astype,numpy_c_:()=>data_numpy_c_,numpy_dot:()=>data_numpy_dot,numpy_linalg_det:()=>data_numpy_linalg_det,numpy_linalg_inv:()=>data_numpy_linalg_inv,numpy_max:()=>data_numpy_max,numpy_mean:()=>data_numpy_mean,numpy_mean_digit:()=>data_numpy_mean_digit,numpy_min:()=>data_numpy_min,numpy_ones:()=>data_numpy_ones,numpy_random_random:()=>data_numpy_random_random,numpy_reshape:()=>data_numpy_reshape,numpy_shape:()=>data_numpy_shape,numpy_size:()=>data_numpy_size,numpy_square:()=>data_numpy_square,numpy_std:()=>data_numpy_std,numpy_sum:()=>data_numpy_sum,numpy_trig:()=>data_numpy_trig,pandas_drop_columns:()=>data_pandas_drop_columns,pandas_dropna:()=>data_pandas_dropna,pandas_readcsv:()=>data_pandas_readcsv,pl_axes:()=>data_pl_axes,pl_bar:()=>data_pl_bar,pl_hist:()=>data_pl_hist,pl_label:()=>data_pl_label,pl_legend:()=>data_pl_legend,pl_pie:()=>data_pl_pie,pl_plot:()=>data_pl_plot,pl_plot_bar:()=>data_pl_plot_bar,pl_plot_easy:()=>data_pl_plot_easy,pl_plot_scatter:()=>data_pl_plot_scatter,pl_plot_xy:()=>data_pl_plot_xy,pl_savefig:()=>data_pl_savefig,pl_show:()=>data_pl_show,pl_subplot:()=>data_pl_subplot,pl_text:()=>data_pl_text,pl_ticks:()=>data_pl_ticks,pl_title:()=>data_pl_title,plot_axes:()=>data_plot_axes,plot_bar:()=>data_plot_bar,plot_hist:()=>data_plot_hist,plot_label:()=>data_plot_label,plot_legend:()=>data_plot_legend,plot_pie:()=>data_plot_pie,plot_plot:()=>data_plot_plot,plot_plot_bar:()=>data_plot_plot_bar,plot_plot_easy:()=>data_plot_plot_easy,plot_plot_scatter:()=>data_plot_plot_scatter,plot_plot_xy:()=>data_plot_plot_xy,plot_savefig:()=>data_plot_savefig,plot_show:()=>data_plot_show,plot_subplot:()=>data_plot_subplot,plot_text:()=>data_plot_text,plot_ticks:()=>data_plot_ticks,plot_title:()=>data_plot_title,py_sum:()=>data_py_sum,pylab_imshow:()=>data_pylab_imshow,series_create:()=>data_series_create,series_create_from_index:()=>data_series_create_from_index,series_create_from_text:()=>data_series_create_from_text,series_get_num:()=>data_series_get_num,series_index_value:()=>data_series_index_value});var generators_datastructure_namespaceObject={};__webpack_require__.r(generators_datastructure_namespaceObject),__webpack_require__.d(generators_datastructure_namespaceObject,{ds_add_node_by_attr:()=>datastructure_ds_add_node_by_attr,ds_add_node_by_name:()=>datastructure_ds_add_node_by_name,ds_create_linkedlist:()=>datastructure_ds_create_linkedlist,ds_create_node:()=>datastructure_ds_create_node,ds_del_node_by_attr:()=>datastructure_ds_del_node_by_attr,ds_del_node_by_name:()=>datastructure_ds_del_node_by_name,ds_get_node_attr:()=>datastructure_ds_get_node_attr,ds_reverse_linkedlist:()=>datastructure_ds_reverse_linkedlist,ds_set_node_attr:()=>datastructure_ds_set_node_attr});var generators_factory_namespaceObject={};__webpack_require__.r(generators_factory_namespaceObject),__webpack_require__.d(generators_factory_namespaceObject,{factory_block:()=>factory_factory_block,factory_block_return:()=>factory_factory_block_return,factory_block_return_with_textarea:()=>factory_factory_block_return_with_textarea,factory_block_with_textarea:()=>factory_factory_block_with_textarea,factory_callMethod_noreturn:()=>factory_factory_callMethod_noreturn,factory_callMethod_return:()=>factory_factory_callMethod_return,factory_declare:()=>factory_factory_declare,factory_from_import:()=>factory_factory_from_import,factory_function_noreturn:()=>factory_factory_function_noreturn,factory_function_return:()=>factory_factory_function_return,factory_import:()=>factory_factory_import});var generators_hardware_namespaceObject={};__webpack_require__.r(generators_hardware_namespaceObject),__webpack_require__.d(generators_hardware_namespaceObject,{hardware_arduino_analog_read:()=>hardware_hardware_arduino_analog_read,hardware_arduino_analog_write:()=>hardware_hardware_arduino_analog_write,hardware_arduino_digital_read:()=>hardware_hardware_arduino_digital_read,hardware_arduino_digital_write:()=>hardware_hardware_arduino_digital_write,hardware_arduino_start:()=>hardware_hardware_arduino_start,inout_highlow:()=>hardware_inout_highlow});var generators_inout_namespaceObject={};__webpack_require__.r(generators_inout_namespaceObject),__webpack_require__.d(generators_inout_namespaceObject,{inout_input:()=>inout_inout_input,inout_print:()=>inout_inout_print,inout_print_end:()=>inout_inout_print_end,inout_print_inline:()=>inout_inout_print_inline,inout_print_many:()=>inout_inout_print_many,inout_type_input:()=>inout_inout_type_input,pyinout_type_input:()=>inout_pyinout_type_input});var generators_iot_namespaceObject={};__webpack_require__.r(generators_iot_namespaceObject),__webpack_require__.d(generators_iot_namespaceObject,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>iot_IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>iot_IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE,IOT_EMQX_PING:()=>iot_IOT_EMQX_PING,IOT_FORMATTING:()=>iot_IOT_FORMATTING,IOT_FORMAT_STRING:()=>iot_IOT_FORMAT_STRING,IOT_MIXIO_NTP:()=>iot_IOT_MIXIO_NTP,IOT_MIXIO_PUBLISH:()=>iot_IOT_MIXIO_PUBLISH,IOT_MIXIO_SUBSCRIBE:()=>iot_IOT_MIXIO_SUBSCRIBE,IOT_MIXIO_UNSUBSCRIBE:()=>iot_IOT_MIXIO_UNSUBSCRIBE,iot_mixio_check:()=>iot_iot_mixio_check,iot_mixio_connect:()=>iot_iot_mixio_connect,iot_mixio_connect_only:()=>iot_iot_mixio_connect_only,iot_mixio_disconnect:()=>iot_iot_mixio_disconnect,iot_mixio_format_msg:()=>iot_iot_mixio_format_msg,iot_mixio_format_topic:()=>iot_iot_mixio_format_topic,iot_mixly_key:()=>iot_iot_mixly_key,iot_mixly_key_py:()=>iot_iot_mixly_key_py});var generators_pins_namespaceObject={};__webpack_require__.r(generators_pins_namespaceObject),__webpack_require__.d(generators_pins_namespaceObject,{pins_analog_read:()=>pins_pins_analog_read,pins_analog_write:()=>pins_pins_analog_write,pins_digital:()=>pins_digital,pins_digital_read:()=>pins_pins_digital_read,pins_digital_write:()=>pins_pins_digital_write});var generators_serial_namespaceObject={};__webpack_require__.r(generators_serial_namespaceObject),__webpack_require__.d(generators_serial_namespaceObject,{serial_close:()=>serial_serial_close,serial_open:()=>serial_serial_open,serial_read_b:()=>serial_serial_read_b,serial_write:()=>serial_serial_write});var generators_sklearn_namespaceObject={};__webpack_require__.r(generators_sklearn_namespaceObject),__webpack_require__.d(generators_sklearn_namespaceObject,{sklearn_DecisionTreeClassifier_Regressor:()=>sklearn_sklearn_DecisionTreeClassifier_Regressor,sklearn_GaussianNB:()=>sklearn_sklearn_GaussianNB,sklearn_KMeans:()=>sklearn_sklearn_KMeans,sklearn_KNeighborsClassifier_Regressor:()=>sklearn_sklearn_KNeighborsClassifier_Regressor,sklearn_LinearRegression:()=>sklearn_sklearn_LinearRegression,sklearn_RandomForestClassifier_Regressor:()=>sklearn_sklearn_RandomForestClassifier_Regressor,sklearn_Ridge:()=>sklearn_sklearn_Ridge,sklearn_cluster_centers_labels_inertia:()=>sklearn_sklearn_cluster_centers_labels_inertia,sklearn_coef_intercept:()=>sklearn_sklearn_coef_intercept,sklearn_data_target:()=>sklearn_sklearn_data_target,sklearn_fit:()=>sklearn_sklearn_fit,sklearn_fit_no_target:()=>sklearn_sklearn_fit_no_target,sklearn_load:()=>sklearn_sklearn_load,sklearn_make_blobs:()=>sklearn_sklearn_make_blobs,sklearn_make_classification:()=>sklearn_sklearn_make_classification,sklearn_make_regression:()=>sklearn_sklearn_make_regression,sklearn_predict:()=>sklearn_sklearn_predict,sklearn_save_load_model:()=>sklearn_sklearn_save_load_model,sklearn_score:()=>sklearn_sklearn_score,sklearn_score_no_target:()=>sklearn_sklearn_score_no_target,sklearn_train_test_split:()=>sklearn_sklearn_train_test_split,sklearn_train_test_split_no_target:()=>sklearn_sklearn_train_test_split_no_target});var generators_system_namespaceObject={};__webpack_require__.r(generators_system_namespaceObject),__webpack_require__.d(generators_system_namespaceObject,{controls_end_program:()=>system_controls_end_program,controls_millis:()=>generators_system_controls_millis,time_localtime:()=>system_time_localtime});var generators_turtle_namespaceObject={};__webpack_require__.r(generators_turtle_namespaceObject),__webpack_require__.d(generators_turtle_namespaceObject,{turtle_bgcolor:()=>turtle_turtle_bgcolor,turtle_bgcolor_hex:()=>turtle_turtle_bgcolor_hex,turtle_bgcolor_hex_new:()=>turtle_turtle_bgcolor_hex_new,turtle_circle:()=>turtle_turtle_circle,turtle_circle_advanced:()=>turtle_turtle_circle_advanced,turtle_clear:()=>turtle_turtle_clear,turtle_clone:()=>turtle_turtle_clone,turtle_color:()=>turtle_turtle_color,turtle_color_hex:()=>turtle_turtle_color_hex,turtle_color_seclet:()=>turtle_turtle_color_seclet,turtle_create:()=>turtle_turtle_create,turtle_done:()=>turtle_turtle_done,turtle_exitonclick:()=>turtle_turtle_exitonclick,turtle_fill:()=>turtle_turtle_fill,turtle_fillcolor:()=>turtle_turtle_fillcolor,turtle_fillcolor_hex:()=>turtle_turtle_fillcolor_hex,turtle_fillcolor_hex_new:()=>turtle_turtle_fillcolor_hex_new,turtle_getscreen:()=>turtle_turtle_getscreen,turtle_goto:()=>turtle_turtle_goto,turtle_listen:()=>turtle_turtle_listen,turtle_move:()=>turtle_turtle_move,turtle_numinput:()=>turtle_turtle_numinput,turtle_onclick:()=>turtle_turtle_onclick,turtle_onkey:()=>turtle_turtle_onkey,turtle_ontimer:()=>turtle_turtle_ontimer,turtle_pencolor:()=>turtle_turtle_pencolor,turtle_pencolor_hex:()=>turtle_turtle_pencolor_hex,turtle_pencolor_hex_new:()=>turtle_turtle_pencolor_hex_new,turtle_penup:()=>turtle_turtle_penup,turtle_pos_shape:()=>turtle_turtle_pos_shape,turtle_rotate:()=>turtle_turtle_rotate,turtle_screen_delay:()=>turtle_turtle_screen_delay,turtle_screen_savefig:()=>turtle_turtle_screen_savefig,turtle_setheading:()=>turtle_turtle_setheading,turtle_setxy:()=>turtle_turtle_setxy,turtle_shape:()=>turtle_turtle_shape,turtle_shapesize:()=>turtle_turtle_shapesize,turtle_size:()=>turtle_turtle_size,turtle_size_speed:()=>turtle_turtle_size_speed,turtle_speed:()=>turtle_turtle_speed,turtle_textinput:()=>turtle_turtle_textinput,turtle_visible:()=>turtle_turtle_visible,turtle_write:()=>turtle_turtle_write,turtle_write_format:()=>turtle_turtle_write_format,turtle_write_format_skulpt:()=>turtle_turtle_write_format_skulpt});const external_Blockly_namespaceObject=Blockly,external_Mixly_namespaceObject=Mixly,Variables={NAME_TYPE:"VARIABLE",allVariables:function(e){var t;if(e.getDescendants)t=e.getDescendants();else{if(!e.getAllBlocks)throw"Not Block or Workspace: "+e;t=e.getAllBlocks()}for(var n=Object.create(null),_=0;_1&&(s+=_)):n=s}else n="i";return n}},variables=Variables; +(()=>{"use strict";var __webpack_modules__={131:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});const cv_read_image=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.imread("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_show_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imshow("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_write_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imwrite("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_waitkey=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.waitKey("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+")\n"},cv_destroy_all=function(e,t){t.definitions_.import_cv2="import cv2";return"cv2.destroyAllWindows()\n"},cv_line_rect=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),x2=generator.valueToCode(this,"x2",generator.ORDER_ATOMIC),y2=generator.valueToCode(this,"y2",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),direction=this.getFieldValue("DIR"),code="cv2."+direction+"("+file+",("+x1+","+y1+"),("+x2+","+y2+"),("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_text=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),data=generator.valueToCode(this,"data",generator.ORDER_ATOMIC),size=generator.valueToCode(this,"size",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),font=this.getFieldValue("font"),code="cv2.putText("+file+","+data+",("+x1+","+y1+"),cv2.FONT_HERSHEY_"+font+","+size+",("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_face_classifier=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.CascadeClassifier("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect_all=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+",minSize=("+t.valueToCode(this,"x1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y1",t.ORDER_ATOMIC)+"),maxSize=("+t.valueToCode(this,"x2",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y2",t.ORDER_ATOMIC)+"))",t.ORDER_ATOMIC]}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={},blocks_variables_namespaceObject={};__webpack_require__.r(blocks_variables_namespaceObject),__webpack_require__.d(blocks_variables_namespaceObject,{controls_type:()=>controls_type,controls_typeLists:()=>controls_typeLists,variables_change:()=>variables_change,variables_get:()=>variables_get,variables_global:()=>variables_global,variables_set:()=>variables_set});var control_namespaceObject={};__webpack_require__.r(control_namespaceObject),__webpack_require__.d(control_namespaceObject,{base_setup:()=>base_setup,controls_delay:()=>controls_delay,controls_end_program:()=>controls_end_program,controls_except:()=>controls_except,controls_finally:()=>controls_finally,controls_flow_statements:()=>controls_flow_statements,controls_for:()=>controls_for,controls_forEach:()=>controls_forEach,controls_for_range:()=>controls_for_range,controls_if:()=>controls_if,controls_if_else:()=>controls_if_else,controls_if_elseif:()=>controls_if_elseif,controls_if_if:()=>controls_if_if,controls_lambda:()=>controls_lambda,controls_main:()=>controls_main,controls_pass:()=>controls_pass,controls_range:()=>controls_range,controls_repeat_ext:()=>controls_repeat_ext,controls_thread:()=>controls_thread,controls_try:()=>controls_try,controls_try_finally:()=>controls_try_finally,controls_whileUntil:()=>controls_whileUntil,do_while:()=>do_while,garbage_collection:()=>garbage_collection,get_mem_alloc:()=>get_mem_alloc,get_mem_free:()=>get_mem_free,get_unique_identifier:()=>get_unique_identifier});var math_namespaceObject={};__webpack_require__.r(math_namespaceObject),__webpack_require__.d(math_namespaceObject,{base_map:()=>base_map,math_arithmetic:()=>math_arithmetic,math_bit:()=>math_bit,math_constant:()=>math_constant,math_constant_mp:()=>math_constant_mp,math_constrain:()=>math_constrain,math_dec:()=>math_dec,math_indexer_number:()=>math_indexer_number,math_map:()=>math_map,math_max_min:()=>math_max_min,math_number:()=>math_number,math_number_base_conversion:()=>math_number_base_conversion,math_random:()=>math_random,math_random_seed:()=>math_random_seed,math_round:()=>math_round,math_selfcalcu:()=>math_selfcalcu,math_to_int:()=>math_to_int,math_trig:()=>math_trig,text_to_number:()=>text_to_number,text_to_number_skulpt:()=>text_to_number_skulpt});var text_namespaceObject={};__webpack_require__.r(text_namespaceObject),__webpack_require__.d(text_namespaceObject,{ascii_to_char:()=>ascii_to_char,char_to_ascii:()=>char_to_ascii,number_to_text:()=>number_to_text,os_system:()=>os_system,text:()=>text_text,text_capital:()=>text_capital,text_center:()=>text_center,text_char:()=>text_char,text_char_at:()=>text_char_at,text_char_at2:()=>text_char_at2,text_char_at3:()=>text_char_at3,text_compareTo:()=>text_compareTo,text_compare_to:()=>text_compare_to,text_create_with_container:()=>text_create_with_container,text_create_with_item:()=>text_create_with_item,text_encode:()=>text_encode,text_equals_starts_ends:()=>text_equals_starts_ends,text_eval:()=>text_eval,text_find:()=>text_find,text_format:()=>text_format,text_format_noreturn:()=>text_format_noreturn,text_join:()=>text_join,text_join_seq:()=>text_join_seq,text_length:()=>text_length,text_random_char:()=>text_random_char,text_replace:()=>text_replace,text_split:()=>text_split,text_strip:()=>text_strip,text_substring:()=>text_substring,text_substring2:()=>text_substring2,text_substring3:()=>text_substring3,text_textarea:()=>text_textarea});var lists_namespaceObject={};__webpack_require__.r(lists_namespaceObject),__webpack_require__.d(lists_namespaceObject,{list_many_input:()=>list_many_input,list_tolist:()=>list_tolist,list_tolist2:()=>list_tolist2,list_trig:()=>list_trig,lists_2d_get_col_row_data:()=>lists_2d_get_col_row_data,lists_2d_get_data_with_col_row:()=>lists_2d_get_data_with_col_row,lists_append_extend:()=>lists_append_extend,lists_change_to:()=>lists_change_to,lists_change_to_general:()=>lists_change_to_general,lists_clear:()=>lists_clear,lists_create_with:()=>lists_create_with,lists_create_with2:()=>lists_create_with2,lists_create_with_container:()=>lists_create_with_container,lists_create_with_item:()=>lists_create_with_item,lists_create_with_noreturn:()=>lists_create_with_noreturn,lists_create_with_text:()=>lists_create_with_text,lists_create_with_text2:()=>lists_create_with_text2,lists_del_general:()=>lists_del_general,lists_find:()=>lists_find,lists_getIndex3:()=>lists_getIndex3,lists_getSublist3:()=>lists_getSublist3,lists_get_index:()=>lists_get_index,lists_get_random_item:()=>lists_get_random_item,lists_get_random_sublist:()=>lists_get_random_sublist,lists_get_sublist:()=>lists_get_sublist,lists_insert_value:()=>lists_insert_value,lists_insert_value2:()=>lists_insert_value2,lists_pop:()=>lists_pop,lists_remove_at:()=>lists_remove_at,lists_remove_at2:()=>lists_remove_at2,lists_reverse:()=>lists_reverse,lists_setIndex3:()=>lists_setIndex3,lists_set_index:()=>lists_set_index,lists_sort:()=>lists_sort,lists_zip:()=>lists_zip,lists_zip_container:()=>lists_zip_container,lists_zip_item:()=>lists_zip_item});var dicts_namespaceObject={};__webpack_require__.r(dicts_namespaceObject),__webpack_require__.d(dicts_namespaceObject,{dicts_add_change_del:()=>dicts_add_change_del,dicts_add_or_change:()=>dicts_add_or_change,dicts_clear:()=>dicts_clear,dicts_create_with:()=>dicts_create_with,dicts_create_with_container:()=>dicts_create_with_container,dicts_create_with_item:()=>dicts_create_with_item,dicts_create_with_noreturn:()=>dicts_create_with_noreturn,dicts_deldict:()=>dicts_deldict,dicts_delete:()=>dicts_delete,dicts_get:()=>dicts_get,dicts_get_default:()=>dicts_get_default,dicts_items:()=>dicts_items,dicts_keys:()=>dicts_keys,dicts_length:()=>dicts_length,dicts_pop:()=>dicts_pop,dicts_setdefault:()=>dicts_setdefault,dicts_to_json:()=>dicts_to_json,dicts_todict:()=>dicts_todict,dicts_update:()=>dicts_update,dicts_values:()=>dicts_values,json_to_dicts:()=>json_to_dicts});var logic_namespaceObject={};__webpack_require__.r(logic_namespaceObject),__webpack_require__.d(logic_namespaceObject,{logic_boolean:()=>logic_boolean,logic_compare:()=>logic_compare,logic_compare_continous:()=>logic_compare_continous,logic_is:()=>logic_is,logic_is_in:()=>logic_is_in,logic_negate:()=>logic_negate,logic_null:()=>logic_null,logic_operation:()=>logic_operation,logic_tobool:()=>logic_tobool,logic_true_or_false:()=>logic_true_or_false});var storage_namespaceObject={};__webpack_require__.r(storage_namespaceObject),__webpack_require__.d(storage_namespaceObject,{sdcard_mount:()=>sdcard_mount,sdcard_use_spi_init:()=>sdcard_use_spi_init,storage_can_write_ornot:()=>storage_can_write_ornot,storage_change_dir:()=>storage_change_dir,storage_close_file:()=>storage_close_file,storage_delete_file:()=>storage_delete_file,storage_file_seek:()=>storage_file_seek,storage_file_tell:()=>storage_file_tell,storage_file_write:()=>storage_file_write,storage_fileopen:()=>storage_fileopen,storage_fileopen_new:()=>storage_fileopen_new,storage_fileopen_new_encoding:()=>storage_fileopen_new_encoding,storage_get_a_line:()=>storage_get_a_line,storage_get_contents:()=>storage_get_contents,storage_get_contents_without_para:()=>storage_get_contents_without_para,storage_get_current_dir:()=>storage_get_current_dir,storage_get_file_size:()=>storage_get_file_size,storage_get_filename:()=>storage_get_filename,storage_is_file:()=>storage_is_file,storage_list_all_files:()=>storage_list_all_files,storage_make_dir:()=>storage_make_dir,storage_open_file_with_os:()=>storage_open_file_with_os,storage_rename:()=>storage_rename});var blocks_procedures_namespaceObject={};__webpack_require__.r(blocks_procedures_namespaceObject),__webpack_require__.d(blocks_procedures_namespaceObject,{procedures_callnoreturn:()=>procedures_callnoreturn,procedures_callreturn:()=>procedures_callreturn,procedures_defnoreturn:()=>procedures_defnoreturn,procedures_defreturn:()=>procedures_defreturn,procedures_ifreturn:()=>procedures_ifreturn,procedures_mutatorarg:()=>procedures_mutatorarg,procedures_mutatorcontainer:()=>procedures_mutatorcontainer,procedures_return:()=>procedures_return});var tuple_namespaceObject={};__webpack_require__.r(tuple_namespaceObject),__webpack_require__.d(tuple_namespaceObject,{tuple_change_to:()=>tuple_change_to,tuple_create_with:()=>tuple_create_with,tuple_create_with_container:()=>tuple_create_with_container,tuple_create_with_item:()=>tuple_create_with_item,tuple_create_with_noreturn:()=>tuple_create_with_noreturn,tuple_create_with_text2:()=>tuple_create_with_text2,tuple_create_with_text_return:()=>tuple_create_with_text_return,tuple_del:()=>tuple_del,tuple_find:()=>tuple_find,tuple_getIndex:()=>tuple_getIndex,tuple_getSublist:()=>tuple_getSublist,tuple_get_random_item:()=>tuple_get_random_item,tuple_get_sublist:()=>tuple_get_sublist,tuple_join:()=>tuple_join,tuple_length:()=>tuple_length,tuple_max:()=>tuple_max,tuple_totuple:()=>tuple_totuple,tuple_trig:()=>tuple_trig});var set_namespaceObject={};__webpack_require__.r(set_namespaceObject),__webpack_require__.d(set_namespaceObject,{set_add_discard:()=>set_add_discard,set_clear:()=>set_clear,set_create_with:()=>set_create_with,set_create_with_container:()=>set_create_with_container,set_create_with_item:()=>set_create_with_item,set_create_with_text_return:()=>set_create_with_text_return,set_length:()=>set_length,set_operate:()=>set_operate,set_operate_update:()=>set_operate_update,set_pop:()=>set_pop,set_sub:()=>set_sub,set_toset:()=>set_toset,set_update:()=>set_update});var html_namespaceObject={};__webpack_require__.r(html_namespaceObject),__webpack_require__.d(html_namespaceObject,{html_content:()=>html_content,html_content_more:()=>html_content_more,html_document:()=>html_document,html_form:()=>html_form,html_head_body:()=>html_head_body,html_style:()=>html_style,html_style_color:()=>html_style_color,html_style_content:()=>html_style_content,html_text:()=>html_text,html_title:()=>html_title});var utility_namespaceObject={};__webpack_require__.r(utility_namespaceObject),__webpack_require__.d(utility_namespaceObject,{attribute_access:()=>attribute_access,function_call:()=>function_call,function_call_container:()=>function_call_container,function_call_item:()=>function_call_item,raw_block:()=>raw_block,raw_empty:()=>raw_empty,raw_expression:()=>raw_expression,raw_table:()=>raw_table,text_comment:()=>text_comment,text_print_multiple:()=>text_print_multiple,text_print_multiple_container:()=>text_print_multiple_container,text_print_multiple_item:()=>text_print_multiple_item,type_check:()=>type_check});var generators_variables_namespaceObject={};__webpack_require__.r(generators_variables_namespaceObject),__webpack_require__.d(generators_variables_namespaceObject,{controls_type:()=>variables_controls_type,controls_typeLists:()=>variables_controls_typeLists,variables_change:()=>variables_variables_change,variables_get:()=>variables_variables_get,variables_global:()=>variables_variables_global,variables_set:()=>variables_variables_set});var generators_control_namespaceObject={};__webpack_require__.r(generators_control_namespaceObject),__webpack_require__.d(generators_control_namespaceObject,{Panic_with_status_code:()=>Panic_with_status_code,base_setup:()=>control_base_setup,controls_delay:()=>control_controls_delay,controls_flow_statements:()=>control_controls_flow_statements,controls_for:()=>control_controls_for,controls_forEach:()=>control_controls_forEach,controls_for_range:()=>control_controls_for_range,controls_if:()=>control_controls_if,controls_interrupts:()=>controls_interrupts,controls_lambda:()=>control_controls_lambda,controls_main:()=>control_controls_main,controls_millis:()=>controls_millis,controls_nointerrupts:()=>controls_nointerrupts,controls_pass:()=>control_controls_pass,controls_range:()=>control_controls_range,controls_repeat:()=>controls_repeat,controls_repeat_ext:()=>control_controls_repeat_ext,controls_thread:()=>control_controls_thread,controls_try_finally:()=>control_controls_try_finally,controls_whileUntil:()=>control_controls_whileUntil,do_while:()=>control_do_while,garbage_collection:()=>control_garbage_collection,get_mem_alloc:()=>control_get_mem_alloc,get_mem_free:()=>control_get_mem_free,get_unique_identifier:()=>control_get_unique_identifier,reset:()=>control_reset,time_sleep:()=>time_sleep});var generators_math_namespaceObject={};__webpack_require__.r(generators_math_namespaceObject),__webpack_require__.d(generators_math_namespaceObject,{base_map:()=>math_base_map,math_arithmetic:()=>math_math_arithmetic,math_bit:()=>math_math_bit,math_constant:()=>math_math_constant,math_constant_mp:()=>math_math_constant_mp,math_constrain:()=>math_math_constrain,math_dec:()=>math_math_dec,math_indexer_number:()=>math_math_indexer_number,math_map:()=>math_math_map,math_max_min:()=>math_math_max_min,math_number:()=>math_math_number,math_number_base_conversion:()=>math_math_number_base_conversion,math_random:()=>math_math_random,math_random_seed:()=>math_math_random_seed,math_round:()=>math_math_round,math_selfcalcu:()=>math_math_selfcalcu,math_single:()=>math_single,math_to_int:()=>math_math_to_int,math_trig:()=>math_math_trig,text_to_number:()=>math_text_to_number,text_to_number_skulpt:()=>math_text_to_number_skulpt});var generators_text_namespaceObject={};__webpack_require__.r(generators_text_namespaceObject),__webpack_require__.d(generators_text_namespaceObject,{ascii_to_char:()=>text_ascii_to_char,char_to_ascii:()=>text_char_to_ascii,number_to_text:()=>text_number_to_text,os_system:()=>text_os_system,text:()=>generators_text_text,text_capital:()=>text_text_capital,text_center:()=>text_text_center,text_char:()=>text_text_char,text_char_at:()=>text_text_char_at,text_char_at2:()=>text_text_char_at2,text_char_at3:()=>text_text_char_at3,text_compareTo:()=>text_text_compareTo,text_compare_to:()=>text_text_compare_to,text_encode:()=>text_text_encode,text_equals_starts_ends:()=>text_text_equals_starts_ends,text_eval:()=>text_text_eval,text_find:()=>text_text_find,text_format:()=>text_text_format,text_format_noreturn:()=>text_text_format_noreturn,text_join:()=>text_text_join,text_join_seq:()=>text_text_join_seq,text_length:()=>text_text_length,text_random_char:()=>text_text_random_char,text_replace:()=>text_text_replace,text_split:()=>text_text_split,text_strip:()=>text_text_strip,text_substring:()=>text_text_substring,text_substring2:()=>text_text_substring2,text_substring3:()=>text_text_substring3,text_textarea:()=>text_text_textarea});var generators_lists_namespaceObject={};__webpack_require__.r(generators_lists_namespaceObject),__webpack_require__.d(generators_lists_namespaceObject,{list_many_input:()=>lists_list_many_input,list_tolist:()=>lists_list_tolist,list_tolist2:()=>lists_list_tolist2,list_trig:()=>lists_list_trig,lists_2d_get_col_row_data:()=>lists_lists_2d_get_col_row_data,lists_2d_get_data_with_col_row:()=>lists_lists_2d_get_data_with_col_row,lists_append_extend:()=>lists_lists_append_extend,lists_change_to:()=>lists_lists_change_to,lists_change_to_general:()=>lists_lists_change_to_general,lists_clear:()=>lists_lists_clear,lists_create_with:()=>lists_lists_create_with,lists_create_with2:()=>lists_lists_create_with2,lists_create_with_noreturn:()=>lists_lists_create_with_noreturn,lists_create_with_text:()=>lists_lists_create_with_text,lists_create_with_text2:()=>lists_lists_create_with_text2,lists_del_general:()=>lists_lists_del_general,lists_find:()=>lists_lists_find,lists_getIndex3:()=>lists_lists_getIndex3,lists_getSublist3:()=>lists_lists_getSublist3,lists_get_index:()=>lists_lists_get_index,lists_get_random_item:()=>lists_lists_get_random_item,lists_get_random_sublist:()=>lists_lists_get_random_sublist,lists_get_sublist:()=>lists_lists_get_sublist,lists_insert_value:()=>lists_lists_insert_value,lists_insert_value2:()=>lists_lists_insert_value2,lists_pop:()=>lists_lists_pop,lists_remove_at:()=>lists_lists_remove_at,lists_remove_at2:()=>lists_lists_remove_at2,lists_reverse:()=>lists_lists_reverse,lists_setIndex3:()=>lists_lists_setIndex3,lists_set_index:()=>lists_lists_set_index,lists_sort:()=>lists_lists_sort,lists_zip:()=>lists_lists_zip});var generators_dicts_namespaceObject={};__webpack_require__.r(generators_dicts_namespaceObject),__webpack_require__.d(generators_dicts_namespaceObject,{dicts_add_change_del:()=>dicts_dicts_add_change_del,dicts_add_or_change:()=>dicts_dicts_add_or_change,dicts_clear:()=>dicts_dicts_clear,dicts_create_with:()=>dicts_dicts_create_with,dicts_create_with_noreturn:()=>dicts_dicts_create_with_noreturn,dicts_deldict:()=>dicts_dicts_deldict,dicts_delete:()=>dicts_dicts_delete,dicts_get:()=>dicts_dicts_get,dicts_get_default:()=>dicts_dicts_get_default,dicts_items:()=>dicts_dicts_items,dicts_keys:()=>dicts_dicts_keys,dicts_length:()=>dicts_dicts_length,dicts_pop:()=>dicts_dicts_pop,dicts_setdefault:()=>dicts_dicts_setdefault,dicts_to_json:()=>dicts_dicts_to_json,dicts_todict:()=>dicts_dicts_todict,dicts_update:()=>dicts_dicts_update,dicts_values:()=>dicts_dicts_values,json_to_dicts:()=>dicts_json_to_dicts});var generators_logic_namespaceObject={};__webpack_require__.r(generators_logic_namespaceObject),__webpack_require__.d(generators_logic_namespaceObject,{logic_boolean:()=>logic_logic_boolean,logic_compare:()=>logic_logic_compare,logic_compare_continous:()=>logic_logic_compare_continous,logic_is:()=>logic_logic_is,logic_is_in:()=>logic_logic_is_in,logic_negate:()=>logic_logic_negate,logic_null:()=>logic_logic_null,logic_operation:()=>logic_logic_operation,logic_tobool:()=>logic_logic_tobool,logic_true_or_false:()=>logic_logic_true_or_false});var generators_storage_namespaceObject={};__webpack_require__.r(generators_storage_namespaceObject),__webpack_require__.d(generators_storage_namespaceObject,{sdcard_mount:()=>storage_sdcard_mount,sdcard_use_spi_init:()=>storage_sdcard_use_spi_init,storage_can_write_ornot:()=>storage_storage_can_write_ornot,storage_change_dir:()=>storage_storage_change_dir,storage_close_file:()=>storage_storage_close_file,storage_delete_file:()=>storage_storage_delete_file,storage_file_seek:()=>storage_storage_file_seek,storage_file_tell:()=>storage_storage_file_tell,storage_file_write:()=>storage_storage_file_write,storage_fileopen:()=>storage_storage_fileopen,storage_fileopen_new:()=>storage_storage_fileopen_new,storage_fileopen_new_encoding:()=>storage_storage_fileopen_new_encoding,storage_get_a_line:()=>storage_storage_get_a_line,storage_get_contents:()=>storage_storage_get_contents,storage_get_contents_without_para:()=>storage_storage_get_contents_without_para,storage_get_current_dir:()=>storage_storage_get_current_dir,storage_get_file_size:()=>storage_storage_get_file_size,storage_get_filename:()=>storage_storage_get_filename,storage_is_file:()=>storage_storage_is_file,storage_list_all_files:()=>storage_storage_list_all_files,storage_make_dir:()=>storage_storage_make_dir,storage_open_file_with_os:()=>storage_storage_open_file_with_os,storage_rename:()=>storage_storage_rename});var generators_procedures_namespaceObject={};__webpack_require__.r(generators_procedures_namespaceObject),__webpack_require__.d(generators_procedures_namespaceObject,{procedures_callnoreturn:()=>procedures_procedures_callnoreturn,procedures_callreturn:()=>procedures_procedures_callreturn,procedures_defnoreturn:()=>procedures_procedures_defnoreturn,procedures_defreturn:()=>procedures_procedures_defreturn,procedures_ifreturn:()=>procedures_procedures_ifreturn,procedures_return:()=>procedures_procedures_return});var generators_tuple_namespaceObject={};__webpack_require__.r(generators_tuple_namespaceObject),__webpack_require__.d(generators_tuple_namespaceObject,{tuple_change_to:()=>tuple_tuple_change_to,tuple_create_with:()=>tuple_tuple_create_with,tuple_create_with_noreturn:()=>tuple_tuple_create_with_noreturn,tuple_create_with_text2:()=>tuple_tuple_create_with_text2,tuple_create_with_text_return:()=>tuple_tuple_create_with_text_return,tuple_del:()=>tuple_tuple_del,tuple_find:()=>tuple_tuple_find,tuple_getIndex:()=>tuple_tuple_getIndex,tuple_getSublist:()=>tuple_tuple_getSublist,tuple_get_random_item:()=>tuple_tuple_get_random_item,tuple_get_sublist:()=>tuple_tuple_get_sublist,tuple_join:()=>tuple_tuple_join,tuple_length:()=>tuple_tuple_length,tuple_max:()=>tuple_tuple_max,tuple_totuple:()=>tuple_tuple_totuple,tuple_trig:()=>tuple_tuple_trig});var generators_set_namespaceObject={};__webpack_require__.r(generators_set_namespaceObject),__webpack_require__.d(generators_set_namespaceObject,{set_add_discard:()=>set_set_add_discard,set_clear:()=>set_set_clear,set_create_with:()=>set_set_create_with,set_create_with_text_return:()=>set_set_create_with_text_return,set_length:()=>set_set_length,set_operate:()=>set_set_operate,set_operate_update:()=>set_set_operate_update,set_pop:()=>set_set_pop,set_sub:()=>set_set_sub,set_toset:()=>set_set_toset,set_update:()=>set_set_update});var generators_html_namespaceObject={};__webpack_require__.r(generators_html_namespaceObject),__webpack_require__.d(generators_html_namespaceObject,{html_content:()=>html_html_content,html_content_more:()=>html_html_content_more,html_document:()=>html_html_document,html_form:()=>html_html_form,html_head_body:()=>html_html_head_body,html_style:()=>html_html_style,html_style_content:()=>html_html_style_content,html_text:()=>html_html_text,html_title:()=>html_html_title});var generators_utility_namespaceObject={};__webpack_require__.r(generators_utility_namespaceObject),__webpack_require__.d(generators_utility_namespaceObject,{attribute_access:()=>utility_attribute_access,function_call:()=>utility_function_call,raw_block:()=>utility_raw_block,raw_empty:()=>utility_raw_empty,raw_expression:()=>utility_raw_expression,raw_table:()=>utility_raw_table,type_check:()=>utility_type_check});var ai_namespaceObject={};__webpack_require__.r(ai_namespaceObject),__webpack_require__.d(ai_namespaceObject,{AI_ChooseAndGet:()=>AI_ChooseAndGet,AI_Face_match:()=>AI_Face_match,AI_ImageClassify:()=>AI_ImageClassify,AI_ImageClassify_Func:()=>AI_ImageClassify_Func,AI_Nlp:()=>AI_Nlp,AI_Nlp_Func:()=>AI_Nlp_Func,AI_Nlp_Func_sim:()=>AI_Nlp_Func_sim,AI_Nlp_Sim:()=>AI_Nlp_Sim,AI_Nlp_Topic:()=>AI_Nlp_Topic,AI_Nlp_newsSummary:()=>AI_Nlp_newsSummary,AI_Ocr:()=>AI_Ocr,AI_Ocr_Func:()=>AI_Ocr_Func,AI_Speech_asr:()=>AI_Speech_asr,AI_Speech_synthesis:()=>AI_Speech_synthesis,AI_audio:()=>AI_audio,AI_client:()=>AI_client,AI_photo:()=>AI_photo,AI_result:()=>AI_result});var algorithm_namespaceObject={};__webpack_require__.r(algorithm_namespaceObject),__webpack_require__.d(algorithm_namespaceObject,{algorithm_add_path:()=>algorithm_add_path,algorithm_add_school:()=>algorithm_add_school,algorithm_all_books:()=>algorithm_all_books,algorithm_all_books_sequence:()=>algorithm_all_books_sequence,algorithm_book_scale:()=>algorithm_book_scale,algorithm_check_feet:()=>algorithm_check_feet,algorithm_chick_calculate:()=>algorithm_chick_calculate,algorithm_color_seclet:()=>algorithm_color_seclet,algorithm_current_school:()=>algorithm_current_school,algorithm_del_path:()=>algorithm_del_path,algorithm_delete_book:()=>algorithm_delete_book,algorithm_delete_books:()=>algorithm_delete_books,algorithm_delete_books2:()=>algorithm_delete_books2,algorithm_divide_books:()=>algorithm_divide_books,algorithm_find_path:()=>algorithm_find_path,algorithm_first_book:()=>algorithm_first_book,algorithm_fz_calc:()=>algorithm_fz_calc,algorithm_fz_calc_first_min:()=>algorithm_fz_calc_first_min,algorithm_fz_compare:()=>algorithm_fz_compare,algorithm_fz_move:()=>algorithm_fz_move,algorithm_fz_set_min:()=>algorithm_fz_set_min,algorithm_get_book_num:()=>algorithm_get_book_num,algorithm_get_current_location:()=>algorithm_get_current_location,algorithm_get_half_books:()=>algorithm_get_half_books,algorithm_hxdb_add:()=>algorithm_hxdb_add,algorithm_hxdb_init_soldier:()=>algorithm_hxdb_init_soldier,algorithm_hxdb_last_line:()=>algorithm_hxdb_last_line,algorithm_hxdb_result:()=>algorithm_hxdb_result,algorithm_hxdb_stand_in_line:()=>algorithm_hxdb_stand_in_line,algorithm_init_fzsf:()=>algorithm_init_fzsf,algorithm_init_hxdb:()=>algorithm_init_hxdb,algorithm_init_jttl:()=>algorithm_init_jttl,algorithm_move_recent:()=>algorithm_move_recent,algorithm_new_path:()=>algorithm_new_path,algorithm_next_book:()=>algorithm_next_book,algorithm_no_left:()=>algorithm_no_left,algorithm_no_path:()=>algorithm_no_path,algorithm_no_ring2:()=>algorithm_no_ring2,algorithm_not_home:()=>algorithm_not_home,algorithm_not_school:()=>algorithm_not_school,algorithm_number_add:()=>algorithm_number_add,algorithm_number_zero:()=>algorithm_number_zero,algorithm_prepare:()=>algorithm_prepare,algorithm_prepare2:()=>algorithm_prepare2,algorithm_prepare_2_1:()=>algorithm_prepare_2_1,algorithm_prepare_2_2:()=>algorithm_prepare_2_2,algorithm_print_book2:()=>algorithm_print_book2,algorithm_print_divide:()=>algorithm_print_divide,algorithm_print_jttl_answer:()=>algorithm_print_jttl_answer,algorithm_print_number:()=>algorithm_print_number,algorithm_print_path:()=>algorithm_print_path,algorithm_print_path2:()=>algorithm_print_path2,algorithm_print_sequence:()=>algorithm_print_sequence,algorithm_rabbit_add:()=>algorithm_rabbit_add,algorithm_rabbit_number_in_range:()=>algorithm_rabbit_number_in_range,algorithm_rabbit_zero:()=>algorithm_rabbit_zero,algorithm_return_path:()=>algorithm_return_path,algorithm_set_path:()=>algorithm_set_path,algorithm_two_left:()=>algorithm_two_left,algorithm_void_path:()=>algorithm_void_path,algorithm_yes_ring2:()=>algorithm_yes_ring2,hanoi_init:()=>hanoi_init,hanoi_init_offline:()=>hanoi_init_offline,hanoi_move:()=>hanoi_move});var communicate_namespaceObject={};__webpack_require__.r(communicate_namespaceObject),__webpack_require__.d(communicate_namespaceObject,{requests_attribute:()=>requests_attribute,requests_get:()=>requests_get,requests_get_old:()=>requests_get_old,requests_method:()=>requests_method,requests_post:()=>requests_post});var cv_namespaceObject={};__webpack_require__.r(cv_namespaceObject),__webpack_require__.d(cv_namespaceObject,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});var data_namespaceObject={};__webpack_require__.r(data_namespaceObject),__webpack_require__.d(data_namespaceObject,{array_create:()=>array_create,array_toarray:()=>array_toarray,dataframe_aggregate_func:()=>dataframe_aggregate_func,dataframe_create:()=>dataframe_create,dataframe_create_from_index:()=>dataframe_create_from_index,dataframe_create_from_one_index:()=>dataframe_create_from_one_index,dataframe_fillna:()=>dataframe_fillna,dataframe_get:()=>dataframe_get,dataframe_groupby:()=>dataframe_groupby,dataframe_head_tail:()=>dataframe_head_tail,dataframe_info:()=>dataframe_info,dataframe_median:()=>dataframe_median,dataframe_select:()=>dataframe_select,dataframe_sort_values:()=>dataframe_sort_values,matrix_multiplication:()=>matrix_multiplication,matrix_transpose:()=>matrix_transpose,numpy_argmin_template_match:()=>numpy_argmin_template_match,numpy_astype:()=>numpy_astype,numpy_c_:()=>numpy_c_,numpy_dot:()=>numpy_dot,numpy_linalg_det:()=>numpy_linalg_det,numpy_linalg_inv:()=>numpy_linalg_inv,numpy_max:()=>numpy_max,numpy_mean:()=>numpy_mean,numpy_mean_digit:()=>numpy_mean_digit,numpy_min:()=>numpy_min,numpy_ones:()=>numpy_ones,numpy_random_random:()=>numpy_random_random,numpy_reshape:()=>numpy_reshape,numpy_shape:()=>numpy_shape,numpy_size:()=>numpy_size,numpy_square:()=>numpy_square,numpy_std:()=>numpy_std,numpy_sum:()=>numpy_sum,numpy_trig:()=>numpy_trig,pandas_drop_columns:()=>pandas_drop_columns,pandas_dropna:()=>pandas_dropna,pandas_readcsv:()=>pandas_readcsv,pl_axes:()=>pl_axes,pl_bar:()=>pl_bar,pl_hist:()=>pl_hist,pl_label:()=>pl_label,pl_legend:()=>pl_legend,pl_pie:()=>pl_pie,pl_plot:()=>pl_plot,pl_plot_bar:()=>pl_plot_bar,pl_plot_easy:()=>pl_plot_easy,pl_plot_scatter:()=>pl_plot_scatter,pl_plot_xy:()=>pl_plot_xy,pl_savefig:()=>pl_savefig,pl_show:()=>pl_show,pl_subplot:()=>pl_subplot,pl_text:()=>pl_text,pl_ticks:()=>pl_ticks,pl_title:()=>pl_title,plot_axes:()=>plot_axes,plot_bar:()=>plot_bar,plot_hist:()=>plot_hist,plot_label:()=>plot_label,plot_legend:()=>plot_legend,plot_pie:()=>plot_pie,plot_plot:()=>plot_plot,plot_plot_bar:()=>plot_plot_bar,plot_plot_easy:()=>plot_plot_easy,plot_plot_scatter:()=>plot_plot_scatter,plot_plot_xy:()=>plot_plot_xy,plot_savefig:()=>plot_savefig,plot_show:()=>plot_show,plot_subplot:()=>plot_subplot,plot_text:()=>plot_text,plot_ticks:()=>plot_ticks,plot_title:()=>plot_title,py_sum:()=>py_sum,pylab_imshow:()=>pylab_imshow,series_create:()=>series_create,series_create_from_index:()=>series_create_from_index,series_create_from_text:()=>series_create_from_text,series_get_num:()=>series_get_num,series_index_value:()=>series_index_value});var datastructure_namespaceObject={};__webpack_require__.r(datastructure_namespaceObject),__webpack_require__.d(datastructure_namespaceObject,{ds_add_node_by_attr:()=>ds_add_node_by_attr,ds_add_node_by_name:()=>ds_add_node_by_name,ds_create_linkedlist:()=>ds_create_linkedlist,ds_create_linkedlist_container:()=>ds_create_linkedlist_container,ds_create_linkedlist_item:()=>ds_create_linkedlist_item,ds_create_node:()=>ds_create_node,ds_del_node_by_attr:()=>ds_del_node_by_attr,ds_del_node_by_name:()=>ds_del_node_by_name,ds_get_node_attr:()=>ds_get_node_attr,ds_reverse_linkedlist:()=>ds_reverse_linkedlist,ds_set_node_attr:()=>ds_set_node_attr});var factory_namespaceObject={};__webpack_require__.r(factory_namespaceObject),__webpack_require__.d(factory_namespaceObject,{factory_block:()=>factory_block,factory_block_return:()=>factory_block_return,factory_block_return_with_textarea:()=>factory_block_return_with_textarea,factory_block_with_textarea:()=>factory_block_with_textarea,factory_callMethod_noreturn:()=>factory_callMethod_noreturn,factory_callMethod_return:()=>factory_callMethod_return,factory_create_with_container:()=>factory_create_with_container,factory_create_with_item:()=>factory_create_with_item,factory_declare:()=>factory_declare,factory_from_import:()=>factory_from_import,factory_function_noreturn:()=>factory_function_noreturn,factory_function_return:()=>factory_function_return,factory_import:()=>factory_import});var hardware_namespaceObject={};__webpack_require__.r(hardware_namespaceObject),__webpack_require__.d(hardware_namespaceObject,{hardware_arduino_analog_read:()=>hardware_arduino_analog_read,hardware_arduino_analog_write:()=>hardware_arduino_analog_write,hardware_arduino_digital_read:()=>hardware_arduino_digital_read,hardware_arduino_digital_write:()=>hardware_arduino_digital_write,hardware_arduino_start:()=>hardware_arduino_start,inout_highlow:()=>inout_highlow});var inout_namespaceObject={};__webpack_require__.r(inout_namespaceObject),__webpack_require__.d(inout_namespaceObject,{inout_input:()=>inout_input,inout_print:()=>inout_print,inout_print_container:()=>inout_print_container,inout_print_end:()=>inout_print_end,inout_print_inline:()=>inout_print_inline,inout_print_item:()=>inout_print_item,inout_print_many:()=>inout_print_many,inout_type_input:()=>inout_type_input,pyinout_type_input:()=>pyinout_type_input});var iot_namespaceObject={};__webpack_require__.r(iot_namespaceObject),__webpack_require__.d(iot_namespaceObject,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE,IOT_EMQX_PING:()=>IOT_EMQX_PING,IOT_FORMATTING:()=>IOT_FORMATTING,IOT_FORMAT_STRING:()=>IOT_FORMAT_STRING,IOT_MIXIO_NTP:()=>IOT_MIXIO_NTP,IOT_MIXIO_PUBLISH:()=>IOT_MIXIO_PUBLISH,IOT_MIXIO_SUBSCRIBE:()=>IOT_MIXIO_SUBSCRIBE,IOT_MIXIO_UNSUBSCRIBE:()=>IOT_MIXIO_UNSUBSCRIBE,iot_checkonenet:()=>iot_checkonenet,iot_client_onboard:()=>iot_client_onboard,iot_create_with_item:()=>iot_create_with_item,iot_http_client:()=>iot_http_client,iot_http_data:()=>iot_http_data,iot_mixio_check:()=>iot_mixio_check,iot_mixio_connect:()=>iot_mixio_connect,iot_mixio_connect_only:()=>iot_mixio_connect_only,iot_mixio_disconnect:()=>iot_mixio_disconnect,iot_mixio_format_msg:()=>iot_mixio_format_msg,iot_mixio_format_topic:()=>iot_mixio_format_topic,iot_mixly_key:()=>iot_mixly_key,iot_mixly_key_py:()=>iot_mixly_key_py,iot_mqtt_client:()=>iot_mqtt_client,iot_mqtt_data:()=>iot_mqtt_data,iot_onenet_check:()=>iot_onenet_check,iot_onenet_connect:()=>iot_onenet_connect,iot_onenet_disconnect:()=>iot_onenet_disconnect,iot_onenet_publish:()=>iot_onenet_publish,iot_onenet_publish_dict:()=>iot_onenet_publish_dict,iot_onenetconnect:()=>iot_onenetconnect,iot_onenetdisconnect:()=>iot_onenetdisconnect,iot_publish:()=>iot_publish,iot_publish_container:()=>iot_publish_container,iot_publish_item:()=>iot_publish_item});var pins_namespaceObject={};__webpack_require__.r(pins_namespaceObject),__webpack_require__.d(pins_namespaceObject,{pins_analog_read:()=>pins_analog_read,pins_analog_write:()=>pins_analog_write,pins_digital_read:()=>pins_digital_read,pins_digital_write:()=>pins_digital_write});var serial_namespaceObject={};__webpack_require__.r(serial_namespaceObject),__webpack_require__.d(serial_namespaceObject,{serial_close:()=>serial_close,serial_open:()=>serial_open,serial_read_b:()=>serial_read_b,serial_write:()=>serial_write});var sklearn_namespaceObject={};__webpack_require__.r(sklearn_namespaceObject),__webpack_require__.d(sklearn_namespaceObject,{sklearn_DecisionTreeClassifier_Regressor:()=>sklearn_DecisionTreeClassifier_Regressor,sklearn_GaussianNB:()=>sklearn_GaussianNB,sklearn_KMeans:()=>sklearn_KMeans,sklearn_KNeighborsClassifier_Regressor:()=>sklearn_KNeighborsClassifier_Regressor,sklearn_LinearRegression:()=>sklearn_LinearRegression,sklearn_RandomForestClassifier_Regressor:()=>sklearn_RandomForestClassifier_Regressor,sklearn_Ridge:()=>sklearn_Ridge,sklearn_cluster_centers_labels_inertia:()=>sklearn_cluster_centers_labels_inertia,sklearn_coef_intercept:()=>sklearn_coef_intercept,sklearn_data_target:()=>sklearn_data_target,sklearn_fit:()=>sklearn_fit,sklearn_fit_no_target:()=>sklearn_fit_no_target,sklearn_load:()=>sklearn_load,sklearn_make_blobs:()=>sklearn_make_blobs,sklearn_make_classification:()=>sklearn_make_classification,sklearn_make_regression:()=>sklearn_make_regression,sklearn_predict:()=>sklearn_predict,sklearn_save_load_model:()=>sklearn_save_load_model,sklearn_score:()=>sklearn_score,sklearn_score_no_target:()=>sklearn_score_no_target,sklearn_train_test_split:()=>sklearn_train_test_split,sklearn_train_test_split_no_target:()=>sklearn_train_test_split_no_target});var system_namespaceObject={};__webpack_require__.r(system_namespaceObject),__webpack_require__.d(system_namespaceObject,{Panic_with_status_code:()=>system_Panic_with_status_code,base_delay:()=>base_delay,controls_millis:()=>system_controls_millis,controls_mstimer2:()=>controls_mstimer2,controls_mstimer2_start:()=>controls_mstimer2_start,controls_mstimer2_stop:()=>controls_mstimer2_stop,reset:()=>system_reset,time_localtime:()=>time_localtime,time_sleep:()=>system_time_sleep});var turtle_namespaceObject={};__webpack_require__.r(turtle_namespaceObject),__webpack_require__.d(turtle_namespaceObject,{turtle_bgcolor:()=>turtle_bgcolor,turtle_bgcolor_hex:()=>turtle_bgcolor_hex,turtle_bgcolor_hex_new:()=>turtle_bgcolor_hex_new,turtle_circle:()=>turtle_circle,turtle_circle_advanced:()=>turtle_circle_advanced,turtle_clear:()=>turtle_clear,turtle_clone:()=>turtle_clone,turtle_color:()=>turtle_color,turtle_color_hex:()=>turtle_color_hex,turtle_color_seclet:()=>turtle_color_seclet,turtle_create:()=>turtle_create,turtle_done:()=>turtle_done,turtle_exitonclick:()=>turtle_exitonclick,turtle_fill:()=>turtle_fill,turtle_fillcolor:()=>turtle_fillcolor,turtle_fillcolor_hex:()=>turtle_fillcolor_hex,turtle_fillcolor_hex_new:()=>turtle_fillcolor_hex_new,turtle_getscreen:()=>turtle_getscreen,turtle_goto:()=>turtle_goto,turtle_listen:()=>turtle_listen,turtle_move:()=>turtle_move,turtle_numinput:()=>turtle_numinput,turtle_onclick:()=>turtle_onclick,turtle_onkey:()=>turtle_onkey,turtle_ontimer:()=>turtle_ontimer,turtle_pencolor:()=>turtle_pencolor,turtle_pencolor_hex:()=>turtle_pencolor_hex,turtle_pencolor_hex_new:()=>turtle_pencolor_hex_new,turtle_penup:()=>turtle_penup,turtle_pos_shape:()=>turtle_pos_shape,turtle_rotate:()=>turtle_rotate,turtle_screen_delay:()=>turtle_screen_delay,turtle_screen_savefig:()=>turtle_screen_savefig,turtle_setheading:()=>turtle_setheading,turtle_setxy:()=>turtle_setxy,turtle_shape:()=>turtle_shape,turtle_shapesize:()=>turtle_shapesize,turtle_size:()=>turtle_size,turtle_size_speed:()=>turtle_size_speed,turtle_speed:()=>turtle_speed,turtle_textinput:()=>turtle_textinput,turtle_visible:()=>turtle_visible,turtle_write:()=>turtle_write,turtle_write_format:()=>turtle_write_format,turtle_write_format_skulpt:()=>turtle_write_format_skulpt});var generators_ai_namespaceObject={};__webpack_require__.r(generators_ai_namespaceObject),__webpack_require__.d(generators_ai_namespaceObject,{AI_ChooseAndGet:()=>ai_AI_ChooseAndGet,AI_Face_match:()=>ai_AI_Face_match,AI_ImageClassify:()=>ai_AI_ImageClassify,AI_ImageClassify_Func:()=>ai_AI_ImageClassify_Func,AI_Nlp:()=>ai_AI_Nlp,AI_Nlp_Func:()=>ai_AI_Nlp_Func,AI_Nlp_Func_sim:()=>ai_AI_Nlp_Func_sim,AI_Nlp_Sim:()=>ai_AI_Nlp_Sim,AI_Nlp_Topic:()=>ai_AI_Nlp_Topic,AI_Nlp_newsSummary:()=>ai_AI_Nlp_newsSummary,AI_Ocr:()=>ai_AI_Ocr,AI_Ocr_Func:()=>ai_AI_Ocr_Func,AI_Speech_asr:()=>ai_AI_Speech_asr,AI_Speech_synthesis:()=>ai_AI_Speech_synthesis,AI_audio:()=>ai_AI_audio,AI_client:()=>ai_AI_client,AI_photo:()=>ai_AI_photo,AI_result:()=>ai_AI_result});var generators_algorithm_namespaceObject={};__webpack_require__.r(generators_algorithm_namespaceObject),__webpack_require__.d(generators_algorithm_namespaceObject,{algorithm_add_path:()=>algorithm_algorithm_add_path,algorithm_add_school:()=>algorithm_algorithm_add_school,algorithm_all_books:()=>algorithm_algorithm_all_books,algorithm_all_books_sequence:()=>algorithm_algorithm_all_books_sequence,algorithm_book_scale:()=>algorithm_algorithm_book_scale,algorithm_check_feet:()=>algorithm_algorithm_check_feet,algorithm_chick_calculate:()=>algorithm_algorithm_chick_calculate,algorithm_color_seclet:()=>algorithm_algorithm_color_seclet,algorithm_current_school:()=>algorithm_algorithm_current_school,algorithm_del_path:()=>algorithm_algorithm_del_path,algorithm_delete_book:()=>algorithm_algorithm_delete_book,algorithm_divide_books:()=>algorithm_algorithm_divide_books,algorithm_find_path:()=>algorithm_algorithm_find_path,algorithm_first_book:()=>algorithm_algorithm_first_book,algorithm_fz_calc:()=>algorithm_algorithm_fz_calc,algorithm_fz_compare:()=>algorithm_algorithm_fz_compare,algorithm_fz_move:()=>algorithm_algorithm_fz_move,algorithm_fz_set_min:()=>algorithm_algorithm_fz_set_min,algorithm_get_current_location:()=>algorithm_algorithm_get_current_location,algorithm_get_half_books:()=>algorithm_algorithm_get_half_books,algorithm_hxdb_add:()=>algorithm_algorithm_hxdb_add,algorithm_hxdb_init_soldier:()=>algorithm_algorithm_hxdb_init_soldier,algorithm_hxdb_last_line:()=>algorithm_algorithm_hxdb_last_line,algorithm_hxdb_result:()=>algorithm_algorithm_hxdb_result,algorithm_hxdb_stand_in_line:()=>algorithm_algorithm_hxdb_stand_in_line,algorithm_init_fzsf:()=>algorithm_algorithm_init_fzsf,algorithm_init_hxdb:()=>algorithm_algorithm_init_hxdb,algorithm_init_jttl:()=>algorithm_algorithm_init_jttl,algorithm_move_recent:()=>algorithm_algorithm_move_recent,algorithm_new_path:()=>algorithm_algorithm_new_path,algorithm_next_book:()=>algorithm_algorithm_next_book,algorithm_no_left:()=>algorithm_algorithm_no_left,algorithm_no_path:()=>algorithm_algorithm_no_path,algorithm_no_ring2:()=>algorithm_algorithm_no_ring2,algorithm_not_home:()=>algorithm_algorithm_not_home,algorithm_not_school:()=>algorithm_algorithm_not_school,algorithm_number_add:()=>algorithm_algorithm_number_add,algorithm_number_zero:()=>algorithm_algorithm_number_zero,algorithm_prepare:()=>algorithm_algorithm_prepare,algorithm_prepare2:()=>algorithm_algorithm_prepare2,algorithm_prepare_2_1:()=>algorithm_algorithm_prepare_2_1,algorithm_prepare_2_2:()=>algorithm_algorithm_prepare_2_2,algorithm_print_book2:()=>algorithm_algorithm_print_book2,algorithm_print_jttl_answer:()=>algorithm_algorithm_print_jttl_answer,algorithm_print_number:()=>algorithm_algorithm_print_number,algorithm_print_path:()=>algorithm_algorithm_print_path,algorithm_print_path2:()=>algorithm_algorithm_print_path2,algorithm_rabbit_add:()=>algorithm_algorithm_rabbit_add,algorithm_rabbit_number_in_range:()=>algorithm_algorithm_rabbit_number_in_range,algorithm_rabbit_zero:()=>algorithm_algorithm_rabbit_zero,algorithm_return_path:()=>algorithm_algorithm_return_path,algorithm_set_path:()=>algorithm_algorithm_set_path,algorithm_two_left:()=>algorithm_algorithm_two_left,algorithm_void_path:()=>algorithm_algorithm_void_path,algorithm_yes_ring2:()=>algorithm_algorithm_yes_ring2,hanoi_init:()=>algorithm_hanoi_init,hanoi_init_offline:()=>algorithm_hanoi_init_offline,hanoi_move:()=>algorithm_hanoi_move});var generators_communicate_namespaceObject={};__webpack_require__.r(generators_communicate_namespaceObject),__webpack_require__.d(generators_communicate_namespaceObject,{requests_attribute:()=>communicate_requests_attribute,requests_get:()=>communicate_requests_get,requests_get_old:()=>communicate_requests_get_old,requests_method:()=>communicate_requests_method,requests_post:()=>communicate_requests_post});var generators_data_namespaceObject={};__webpack_require__.r(generators_data_namespaceObject),__webpack_require__.d(generators_data_namespaceObject,{array_create:()=>data_array_create,array_toarray:()=>data_array_toarray,dataframe_aggregate_func:()=>data_dataframe_aggregate_func,dataframe_create:()=>data_dataframe_create,dataframe_create_from_index:()=>data_dataframe_create_from_index,dataframe_create_from_one_index:()=>data_dataframe_create_from_one_index,dataframe_fillna:()=>data_dataframe_fillna,dataframe_get:()=>data_dataframe_get,dataframe_groupby:()=>data_dataframe_groupby,dataframe_head_tail:()=>data_dataframe_head_tail,dataframe_info:()=>data_dataframe_info,dataframe_median:()=>data_dataframe_median,dataframe_select:()=>data_dataframe_select,dataframe_sort_values:()=>data_dataframe_sort_values,matrix_multiplication:()=>data_matrix_multiplication,matrix_transpose:()=>data_matrix_transpose,numpy_argmin_template_match:()=>data_numpy_argmin_template_match,numpy_astype:()=>data_numpy_astype,numpy_c_:()=>data_numpy_c_,numpy_dot:()=>data_numpy_dot,numpy_linalg_det:()=>data_numpy_linalg_det,numpy_linalg_inv:()=>data_numpy_linalg_inv,numpy_max:()=>data_numpy_max,numpy_mean:()=>data_numpy_mean,numpy_mean_digit:()=>data_numpy_mean_digit,numpy_min:()=>data_numpy_min,numpy_ones:()=>data_numpy_ones,numpy_random_random:()=>data_numpy_random_random,numpy_reshape:()=>data_numpy_reshape,numpy_shape:()=>data_numpy_shape,numpy_size:()=>data_numpy_size,numpy_square:()=>data_numpy_square,numpy_std:()=>data_numpy_std,numpy_sum:()=>data_numpy_sum,numpy_trig:()=>data_numpy_trig,pandas_drop_columns:()=>data_pandas_drop_columns,pandas_dropna:()=>data_pandas_dropna,pandas_readcsv:()=>data_pandas_readcsv,pl_axes:()=>data_pl_axes,pl_bar:()=>data_pl_bar,pl_hist:()=>data_pl_hist,pl_label:()=>data_pl_label,pl_legend:()=>data_pl_legend,pl_pie:()=>data_pl_pie,pl_plot:()=>data_pl_plot,pl_plot_bar:()=>data_pl_plot_bar,pl_plot_easy:()=>data_pl_plot_easy,pl_plot_scatter:()=>data_pl_plot_scatter,pl_plot_xy:()=>data_pl_plot_xy,pl_savefig:()=>data_pl_savefig,pl_show:()=>data_pl_show,pl_subplot:()=>data_pl_subplot,pl_text:()=>data_pl_text,pl_ticks:()=>data_pl_ticks,pl_title:()=>data_pl_title,plot_axes:()=>data_plot_axes,plot_bar:()=>data_plot_bar,plot_hist:()=>data_plot_hist,plot_label:()=>data_plot_label,plot_legend:()=>data_plot_legend,plot_pie:()=>data_plot_pie,plot_plot:()=>data_plot_plot,plot_plot_bar:()=>data_plot_plot_bar,plot_plot_easy:()=>data_plot_plot_easy,plot_plot_scatter:()=>data_plot_plot_scatter,plot_plot_xy:()=>data_plot_plot_xy,plot_savefig:()=>data_plot_savefig,plot_show:()=>data_plot_show,plot_subplot:()=>data_plot_subplot,plot_text:()=>data_plot_text,plot_ticks:()=>data_plot_ticks,plot_title:()=>data_plot_title,py_sum:()=>data_py_sum,pylab_imshow:()=>data_pylab_imshow,series_create:()=>data_series_create,series_create_from_index:()=>data_series_create_from_index,series_create_from_text:()=>data_series_create_from_text,series_get_num:()=>data_series_get_num,series_index_value:()=>data_series_index_value});var generators_datastructure_namespaceObject={};__webpack_require__.r(generators_datastructure_namespaceObject),__webpack_require__.d(generators_datastructure_namespaceObject,{ds_add_node_by_attr:()=>datastructure_ds_add_node_by_attr,ds_add_node_by_name:()=>datastructure_ds_add_node_by_name,ds_create_linkedlist:()=>datastructure_ds_create_linkedlist,ds_create_node:()=>datastructure_ds_create_node,ds_del_node_by_attr:()=>datastructure_ds_del_node_by_attr,ds_del_node_by_name:()=>datastructure_ds_del_node_by_name,ds_get_node_attr:()=>datastructure_ds_get_node_attr,ds_reverse_linkedlist:()=>datastructure_ds_reverse_linkedlist,ds_set_node_attr:()=>datastructure_ds_set_node_attr});var generators_factory_namespaceObject={};__webpack_require__.r(generators_factory_namespaceObject),__webpack_require__.d(generators_factory_namespaceObject,{factory_block:()=>factory_factory_block,factory_block_return:()=>factory_factory_block_return,factory_block_return_with_textarea:()=>factory_factory_block_return_with_textarea,factory_block_with_textarea:()=>factory_factory_block_with_textarea,factory_callMethod_noreturn:()=>factory_factory_callMethod_noreturn,factory_callMethod_return:()=>factory_factory_callMethod_return,factory_declare:()=>factory_factory_declare,factory_from_import:()=>factory_factory_from_import,factory_function_noreturn:()=>factory_factory_function_noreturn,factory_function_return:()=>factory_factory_function_return,factory_import:()=>factory_factory_import});var generators_hardware_namespaceObject={};__webpack_require__.r(generators_hardware_namespaceObject),__webpack_require__.d(generators_hardware_namespaceObject,{hardware_arduino_analog_read:()=>hardware_hardware_arduino_analog_read,hardware_arduino_analog_write:()=>hardware_hardware_arduino_analog_write,hardware_arduino_digital_read:()=>hardware_hardware_arduino_digital_read,hardware_arduino_digital_write:()=>hardware_hardware_arduino_digital_write,hardware_arduino_start:()=>hardware_hardware_arduino_start,inout_highlow:()=>hardware_inout_highlow});var generators_inout_namespaceObject={};__webpack_require__.r(generators_inout_namespaceObject),__webpack_require__.d(generators_inout_namespaceObject,{inout_input:()=>inout_inout_input,inout_print:()=>inout_inout_print,inout_print_end:()=>inout_inout_print_end,inout_print_inline:()=>inout_inout_print_inline,inout_print_many:()=>inout_inout_print_many,inout_type_input:()=>inout_inout_type_input,pyinout_type_input:()=>inout_pyinout_type_input});var generators_iot_namespaceObject={};__webpack_require__.r(generators_iot_namespaceObject),__webpack_require__.d(generators_iot_namespaceObject,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>iot_IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>iot_IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE,IOT_EMQX_PING:()=>iot_IOT_EMQX_PING,IOT_FORMATTING:()=>iot_IOT_FORMATTING,IOT_FORMAT_STRING:()=>iot_IOT_FORMAT_STRING,IOT_MIXIO_NTP:()=>iot_IOT_MIXIO_NTP,IOT_MIXIO_PUBLISH:()=>iot_IOT_MIXIO_PUBLISH,IOT_MIXIO_SUBSCRIBE:()=>iot_IOT_MIXIO_SUBSCRIBE,IOT_MIXIO_UNSUBSCRIBE:()=>iot_IOT_MIXIO_UNSUBSCRIBE,iot_mixio_check:()=>iot_iot_mixio_check,iot_mixio_connect:()=>iot_iot_mixio_connect,iot_mixio_connect_only:()=>iot_iot_mixio_connect_only,iot_mixio_disconnect:()=>iot_iot_mixio_disconnect,iot_mixio_format_msg:()=>iot_iot_mixio_format_msg,iot_mixio_format_topic:()=>iot_iot_mixio_format_topic,iot_mixly_key:()=>iot_iot_mixly_key,iot_mixly_key_py:()=>iot_iot_mixly_key_py});var generators_pins_namespaceObject={};__webpack_require__.r(generators_pins_namespaceObject),__webpack_require__.d(generators_pins_namespaceObject,{pins_analog_read:()=>pins_pins_analog_read,pins_analog_write:()=>pins_pins_analog_write,pins_digital:()=>pins_digital,pins_digital_read:()=>pins_pins_digital_read,pins_digital_write:()=>pins_pins_digital_write});var generators_serial_namespaceObject={};__webpack_require__.r(generators_serial_namespaceObject),__webpack_require__.d(generators_serial_namespaceObject,{serial_close:()=>serial_serial_close,serial_open:()=>serial_serial_open,serial_read_b:()=>serial_serial_read_b,serial_write:()=>serial_serial_write});var generators_sklearn_namespaceObject={};__webpack_require__.r(generators_sklearn_namespaceObject),__webpack_require__.d(generators_sklearn_namespaceObject,{sklearn_DecisionTreeClassifier_Regressor:()=>sklearn_sklearn_DecisionTreeClassifier_Regressor,sklearn_GaussianNB:()=>sklearn_sklearn_GaussianNB,sklearn_KMeans:()=>sklearn_sklearn_KMeans,sklearn_KNeighborsClassifier_Regressor:()=>sklearn_sklearn_KNeighborsClassifier_Regressor,sklearn_LinearRegression:()=>sklearn_sklearn_LinearRegression,sklearn_RandomForestClassifier_Regressor:()=>sklearn_sklearn_RandomForestClassifier_Regressor,sklearn_Ridge:()=>sklearn_sklearn_Ridge,sklearn_cluster_centers_labels_inertia:()=>sklearn_sklearn_cluster_centers_labels_inertia,sklearn_coef_intercept:()=>sklearn_sklearn_coef_intercept,sklearn_data_target:()=>sklearn_sklearn_data_target,sklearn_fit:()=>sklearn_sklearn_fit,sklearn_fit_no_target:()=>sklearn_sklearn_fit_no_target,sklearn_load:()=>sklearn_sklearn_load,sklearn_make_blobs:()=>sklearn_sklearn_make_blobs,sklearn_make_classification:()=>sklearn_sklearn_make_classification,sklearn_make_regression:()=>sklearn_sklearn_make_regression,sklearn_predict:()=>sklearn_sklearn_predict,sklearn_save_load_model:()=>sklearn_sklearn_save_load_model,sklearn_score:()=>sklearn_sklearn_score,sklearn_score_no_target:()=>sklearn_sklearn_score_no_target,sklearn_train_test_split:()=>sklearn_sklearn_train_test_split,sklearn_train_test_split_no_target:()=>sklearn_sklearn_train_test_split_no_target});var generators_system_namespaceObject={};__webpack_require__.r(generators_system_namespaceObject),__webpack_require__.d(generators_system_namespaceObject,{controls_end_program:()=>system_controls_end_program,controls_millis:()=>generators_system_controls_millis,time_localtime:()=>system_time_localtime});var generators_turtle_namespaceObject={};__webpack_require__.r(generators_turtle_namespaceObject),__webpack_require__.d(generators_turtle_namespaceObject,{turtle_bgcolor:()=>turtle_turtle_bgcolor,turtle_bgcolor_hex:()=>turtle_turtle_bgcolor_hex,turtle_bgcolor_hex_new:()=>turtle_turtle_bgcolor_hex_new,turtle_circle:()=>turtle_turtle_circle,turtle_circle_advanced:()=>turtle_turtle_circle_advanced,turtle_clear:()=>turtle_turtle_clear,turtle_clone:()=>turtle_turtle_clone,turtle_color:()=>turtle_turtle_color,turtle_color_hex:()=>turtle_turtle_color_hex,turtle_color_seclet:()=>turtle_turtle_color_seclet,turtle_create:()=>turtle_turtle_create,turtle_done:()=>turtle_turtle_done,turtle_exitonclick:()=>turtle_turtle_exitonclick,turtle_fill:()=>turtle_turtle_fill,turtle_fillcolor:()=>turtle_turtle_fillcolor,turtle_fillcolor_hex:()=>turtle_turtle_fillcolor_hex,turtle_fillcolor_hex_new:()=>turtle_turtle_fillcolor_hex_new,turtle_getscreen:()=>turtle_turtle_getscreen,turtle_goto:()=>turtle_turtle_goto,turtle_listen:()=>turtle_turtle_listen,turtle_move:()=>turtle_turtle_move,turtle_numinput:()=>turtle_turtle_numinput,turtle_onclick:()=>turtle_turtle_onclick,turtle_onkey:()=>turtle_turtle_onkey,turtle_ontimer:()=>turtle_turtle_ontimer,turtle_pencolor:()=>turtle_turtle_pencolor,turtle_pencolor_hex:()=>turtle_turtle_pencolor_hex,turtle_pencolor_hex_new:()=>turtle_turtle_pencolor_hex_new,turtle_penup:()=>turtle_turtle_penup,turtle_pos_shape:()=>turtle_turtle_pos_shape,turtle_rotate:()=>turtle_turtle_rotate,turtle_screen_delay:()=>turtle_turtle_screen_delay,turtle_screen_savefig:()=>turtle_turtle_screen_savefig,turtle_setheading:()=>turtle_turtle_setheading,turtle_setxy:()=>turtle_turtle_setxy,turtle_shape:()=>turtle_turtle_shape,turtle_shapesize:()=>turtle_turtle_shapesize,turtle_size:()=>turtle_turtle_size,turtle_size_speed:()=>turtle_turtle_size_speed,turtle_speed:()=>turtle_turtle_speed,turtle_textinput:()=>turtle_turtle_textinput,turtle_visible:()=>turtle_turtle_visible,turtle_write:()=>turtle_turtle_write,turtle_write_format:()=>turtle_turtle_write_format,turtle_write_format_skulpt:()=>turtle_turtle_write_format_skulpt});const external_Blockly_namespaceObject=Blockly,external_Mixly_namespaceObject=Mixly,Variables={NAME_TYPE:"VARIABLE",allVariables:function(e){var t;if(e.getDescendants)t=e.getDescendants();else{if(!e.getAllBlocks)throw"Not Block or Workspace: "+e;t=e.getAllBlocks()}for(var n=Object.create(null),a=0;a1&&(s+=a)):n=s}else n="i";return n}},variables=Variables; /** * @license * Visual Blocks Editor @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class Names{constructor(e,t){if(this.variablePrefix_=t||"",this.reservedDict_=Object.create(null),e)for(var n=e.split(","),_=0;_0;a--)t.getInputTargetBlock("IF"+a)&&t.getInputTargetBlock("IF"+a).previousConnection?n[a]=t.getInputTargetBlock("IF"+a).previousConnection:n[a]=null,this.removeInput("IF"+a),t.getInputTargetBlock("DO"+a)&&t.getInputTargetBlock("DO"+a).previousConnection?_[a]=t.getInputTargetBlock("DO"+a).previousConnection:_[a]=null,this.removeInput("DO"+a);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(a=1;a<=this.elseifCount_;a++)this.appendValueInput("IF"+a).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+a).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE);for(a=n.length-2;a>0;a--)n[a]&&n[a].reconnect(this,"IF"+a);for(a=_.length-2;a>0;a--)_[a]&&_[a].reconnect(this,"DO"+a)},decompose:function(e){var t=e.newBlock("controls_if_if");t.initSvg();for(var n=t.getInput("STACK").connection,_=1;_<=this.elseifCount_;_++){var a=e.newBlock("controls_if_elseif");a.initSvg(),n.connect(a.previousConnection),n=a.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_if_else");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),_=[null],a=[null],l=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,_.push(n.valueConnection_),a.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(_,a,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_if_elseif":var _=this.getInput("IF"+n),a=this.getInput("DO"+n);t.valueConnection_=_&&_.connection.targetConnection,t.statementConnection_=a&&a.connection.targetConnection,n++;break;case"controls_if_else":a=this.getInput("ELSE");t.statementConnection_=a&&a.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var _=1;this.getInput("IF"+_);){var a=this.getInput("IF"+_),l=this.getInput("DO"+_);console.log(a.connection.targetConnection),e.push(a.connection.targetConnection),t.push(l.connection.targetConnection),_++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,t,n){for(var _=1;_<=this.elseifCount_;_++)e[_]&&e[_].reconnect(this,"IF"+_),t[_]&&t[_].reconnect(this,"DO"+_);n&&n.reconnect(this,"ELSE")}},controls_range={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},controls_forEach={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("LIST").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_whileUntil={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return{WHILE:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[t]}))}},controls_try_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=document.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(e){var t=this,n=[],_=[];this.elseCount_&&this.removeInput("ELSE");for(var a=this.elseifCount_;a>0;a--)t.getInputTargetBlock("IF"+a)&&t.getInputTargetBlock("IF"+a).previousConnection?n[a]=t.getInputTargetBlock("IF"+a).previousConnection:n[a]=null,this.removeInput("IF"+a),t.getInputTargetBlock("DO"+a)&&t.getInputTargetBlock("DO"+a).previousConnection?_[a]=t.getInputTargetBlock("DO"+a).previousConnection:_[a]=null,this.removeInput("DO"+a);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(a=1;a<=this.elseifCount_;a++)this.appendValueInput("IF"+a).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+a).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY);for(a=n.length-2;a>0;a--)n[a]&&n[a].reconnect(this,"IF"+a);for(a=_.length-2;a>0;a--)_[a]&&_[a].reconnect(this,"DO"+a)},decompose:function(e){var t=e.newBlock("controls_try");t.initSvg();for(var n=t.getInput("STACK").connection,_=1;_<=this.elseifCount_;_++){var a=e.newBlock("controls_except");a.initSvg(),n.connect(a.previousConnection),n=a.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_finally");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),_=[null],a=[null],l=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,_.push(n.valueConnection_),a.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(_,a,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_except":var _=this.getInput("IF"+n),a=this.getInput("DO"+n);t.valueConnection_=_&&_.connection.targetConnection,t.statementConnection_=a&&a.connection.targetConnection,n++;break;case"controls_finally":a=this.getInput("ELSE");t.statementConnection_=a&&a.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var _=1;this.getInput("IF"+_);){var a=this.getInput("IF"+_),l=this.getInput("DO"+_);console.log(a.connection.targetConnection),e.push(a.connection.targetConnection),t.push(l.connection.targetConnection),_++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+e).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(e,t,n){for(var _=1;_<=this.elseifCount_;_++)e[_]&&e[_].reconnect(this,"IF"+_),t[_]&&t[_].reconnect(this,"DO"+_);n&&n.reconnect(this,"ELSE")}},controls_flow_statements={init:function(){this.setColour(LOOPS_HUE);var e=new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(e,"FLOW").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var t=this;this.setTooltip((function(){var e=t.getFieldValue("FLOW");return{BREAK:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[e]}))},onchange:function(){if(this.workspace){var e=!1,t=this;do{if("controls_repeat"==t.type||"controls_for"==t.type||"controls_forEach"==t.type||"controls_repeat_ext"==t.type||"controls_whileUntil"==t.type||"do_while"==t.type){e=!0;break}t=t.getSurroundParent()}while(t);e?this.setWarningText(null):this.setWarningText(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},controls_for={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_for_range={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}};controls_whileUntil.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],controls_flow_statements.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const controls_if_if={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},controls_if_elseif={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},controls_if_else={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},controls_try={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},controls_except={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},controls_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},controls_repeat_ext={init:function(){this.jsonInit({message0:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:LOOPS_HUE,tooltip:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},controls_lambda={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STAT),this.setOutput(!0)}},controls_pass={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},controls_thread={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},do_while={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(LOOPS_HUE),this.setTooltip("do-while loop"),this.setHelpUrl("")}},garbage_collection={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},get_mem_alloc={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},get_mem_free={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},MATH_HUE=230;external_Blockly_namespaceObject.FieldTextInput.math_number_validator=function(e){return String(e)},external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank=function(e){if(""===e)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(e)?String(e):null};const math_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_constant={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[t]}))}},math_constant_mp={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[t]}))}},math_arithmetic={init:function(){this.setColour(MATH_HUE),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_selfcalcu={init:function(){this.setColour(MATH_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_bit={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},math_trig={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{SIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_SIN,COS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_COS,TAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_LN}[t]}))}},math_dec={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_BIN,"bin"],[external_Blockly_namespaceObject.Msg.MATH_OCT,"oct"],[external_Blockly_namespaceObject.Msg.MATH_HEX,"hex"]];this.setColour(MATH_HUE),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{bin:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_BIN,oct:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_OCT,hex:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_HEX}[e]}))}},math_to_int={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"],[external_Blockly_namespaceObject.Msg.MATH_ABS,"fabs"],[external_Blockly_namespaceObject.Msg.MATH_SQRT,"sqrt"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{sqrt:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_SQ,round:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[e]}))}},math_max_min={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_MAX,"max"],[external_Blockly_namespaceObject.Msg.MIXLY_MIN,"min"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{max:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAX,min:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MIN}[e]}))}},math_number_base_conversion={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_TWO,"two"],[external_Blockly_namespaceObject.Msg.MATH_EIGHT,"eight"],[external_Blockly_namespaceObject.Msg.MATH_TEN,"ten"],[external_Blockly_namespaceObject.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(MATH_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_ZHW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP2").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP"),n={two:external_Blockly_namespaceObject.Msg.MATH_Before_two,eight:external_Blockly_namespaceObject.Msg.MATH_Before_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Before_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Before_sixteen},_=t.getFieldValue("OP2"),a={two:external_Blockly_namespaceObject.Msg.MATH_Behind_two,eight:external_Blockly_namespaceObject.Msg.MATH_Behind_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Behind_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Behind_sixteen};return n[e]+a[_]}))}},math_random={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_INT,"int"],[external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_RANDOM).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TYPE"),n={int:external_Blockly_namespaceObject.Msg.LANG_MATH_INT,float:external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT_RANDOM};return external_Blockly_namespaceObject.Msg.MATH_RANDOM_INT_TOOLTIP+n[e]}))}},math_constrain={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_CONSTRAIN_TOOLTIP)}},math_map={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAP)}},math_indexer_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_random_seed={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},math_round={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ROUND).appendField(external_Blockly_namespaceObject.Msg.TEXT_KEEP),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_ROUND_NEW_TOOLTIP)}},text_to_number={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_BITES,"b"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[e]}))}},text_to_number_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[e]}))}},base_map=math_map,TEXTS_HUE=160,text_text={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}},text_textarea={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}};external_Blockly_namespaceObject.FieldTextInput.char_validator=function(e){if(e.length>1&&"\\"===e.charAt(0)){var t=e.charAt(1);if("0"===t||"b"===t||"f"===t||"n"===t||"r"===t||"t"===t||"\\"===t||"'"===t)return String(e).substring(0,2);if("x"===t&&"0"===e.charAt(2)&&"B"===e.charAt(3))return String(e).substring(0,4)}return String(e).substring(0,1)};const text_char={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput("",external_Blockly_namespaceObject.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(e){if(1==e)var t="../../media/quote2.png";else t="../../media/quote3.png";return new external_Blockly_namespaceObject.FieldImage(t,7,12,'"')}},text_join={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},ascii_to_char={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},char_to_ascii={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},number_to_text={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},text_length={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},text_char_at2={init:function(){this.WHERE_OPTIONS=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM+1+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET,"MODE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=e.getFieldValue("WHERE"),_="";switch(t+" "+n){case"GET FROM_START":case"GET FROM_END":_=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":_=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":_=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":_=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(_+=" "+external_Blockly_namespaceObject.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",external_Blockly_namespaceObject.Msg.ONE_BASED_INDEXING?"#1":"#0")),_}));var t=this;this.setTooltip((function(){var e=t.getFieldValue("WHERE"),n={FROM_START:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM};return external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+n[e]+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("statement",!this.outputConnection);var t=this.getInput("AT").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){var t="true"==e.getAttribute("statement");this.updateStatement_(t),e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateStatement_:function(e){e!=!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var t=new external_Blockly_namespaceObject.FieldDropdown(this.WHERE_OPTIONS,(function(t){var n="FROM_START"==t||"FROM_END"==t;if(n!=e){var _=this.sourceBlock_;return _.updateAt_(n),_.setFieldValue(t,"WHERE"),null}}));this.getInput("AT").appendField(t,"WHERE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},text_char_at={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)}},text_random_char={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},text_substring2={init:function(){this.WHERE_OPTIONS_1=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==external_Blockly_namespaceObject.INPUT_VALUE;e.setAttribute("at1",t);var n=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",n),e},domToMutation:function(e){var t="true"==e.getAttribute("at1"),n="true"==e.getAttribute("at2");this.updateAt_(1,t),this.updateAt_(2,n)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+e).appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+e);var n=new external_Blockly_namespaceObject.FieldDropdown(this["WHERE_OPTIONS_"+e],(function(n){var _="FROM_START"==n||"FROM_END"==n;if(_!=t){var a=this.sourceBlock_;return a.updateAt_(e,_),a.setFieldValue(n,"WHERE"+e),null}}));this.getInput("AT"+e).appendField(n,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},text_substring={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},text_equals_starts_ends={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_EQUALS,"==="],[external_Blockly_namespaceObject.Msg.MIXLY_STARTSWITH,"startswith"],[external_Blockly_namespaceObject.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},text_compare_to={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO_HELP)}},text_capital={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_UPPER,"upper"],[external_Blockly_namespaceObject.Msg.TEXT_TITLE,"title"],[external_Blockly_namespaceObject.Msg.TEXT_CAPITALIZE,"capitalize"],[external_Blockly_namespaceObject.Msg.TEXT_SWAPCASE,"swapcase"],[external_Blockly_namespaceObject.Msg.TEXT_LOWER,"lower"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CAPITAL").setCheck(String),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CAPITAL");return{upper:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[e]}))}},text_center={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_LJUST,"ljust"],[external_Blockly_namespaceObject.Msg.TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_RJUST,"rjust"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(external_Blockly_namespaceObject.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},text_find={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},text_join_seq={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},text_replace={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},text_split={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},text_strip={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH,"strip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"lstrip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{strip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[e]}))}},text_format={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("text_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,_=0;_t?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_create_with_container={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},dicts_create_with_item={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},dicts_keys={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_KEYS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},dicts_get={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_TOOLTIP)}},dicts_get_default={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},dicts_add_or_change={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},dicts_delete={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP)}},dicts_update={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT2").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_clear={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_CLEAR),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_items={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_ITEMS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},dicts_values={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_VALUES),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},dicts_length={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},dicts_deldict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_DELDICT),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_add_change_del={init:function(){this.MODE=[[external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t="";switch(e.getFieldValue("WHERE")){case"INSERT":t=external_Blockly_namespaceObject.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":t=external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP}return t}))},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",t),e},domToMutation:function(e){var t="true"==e.getAttribute("at2");this.updateAt_(t)},updateAt_:function(e){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),e?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var t=new external_Blockly_namespaceObject.FieldDropdown(this.MODE,(function(t){var n="INSERT"==t;if(n!=e){var _=this.sourceBlock_;return _.updateAt_(n),_.setFieldValue(t,"WHERE"),null}}));this.getInput("AT2").appendField(t,"WHERE")}},dicts_pop={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},dicts_setdefault={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_SETDEFAULT_TOOLTIP)}},dicts_create_with_noreturn={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("dicts_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,_=0;_t?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_todict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},dicts_to_json={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},json_to_dicts={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},LOGIC_HUE=210,logic_compare={init:function(){var e=external_Blockly_namespaceObject.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{EQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[e]})),this.prevBlocks_=[null,null]}},logic_compare_continous={init:function(){var e=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],t=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP1"),this.appendValueInput("C").appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"OP2"),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},logic_operation={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_AND,"AND"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_OR,"OR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_NOR,"NOR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{AND:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[e]}))}},logic_negate={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},logic_boolean={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TOOLTIP)}},logic_null={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LOGIC_NULL),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NULL_TOOLTIP)}},logic_true_or_false={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},logic_is_in={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_APPEND_TO,"in"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.IN)}},logic_is={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},logic_tobool={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},STORAGE_HUE=0,storage_open_file_with_os={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("fn").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},storage_fileopen={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+_+a}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},storage_fileopen_new={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,s=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+_+a+s}))}},storage_fileopen_new_encoding={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,s=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+_+a+s}))}},storage_file_write={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},storage_get_contents_without_para={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},storage_get_contents={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[t]+"x"+_}))}},storage_get_a_line={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MICROBIT_PYTHON_TYPE)}},storage_can_write_ornot={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.HTML_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},storage_get_filename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},storage_close_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},storage_list_all_files={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const storage_delete_file={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},storage_get_file_size={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},storage_file_tell={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},storage_file_seek={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[t]+a+"x"+_}))}},storage_get_current_dir={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},storage_make_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("PATH").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET+{mkdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},storage_rename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},storage_change_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},storage_is_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_FILE,"isfile"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},sdcard_use_spi_init={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("SPISUB").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP+external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sdcard_mount={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Procedures={};Procedures.NAME_TYPE=external_Blockly_namespaceObject.PROCEDURE_CATEGORY_NAME,Procedures.allProcedures=function(e){for(var t=e.getAllBlocks(!1),n=[],_=[],a=0;a"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},html_form={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_FORM_CONTENT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_TEXT,"text"],[external_Blockly_namespaceObject.Msg.HTML_EMAIL,"email"],[external_Blockly_namespaceObject.Msg.HTML_NUMBER,"number"],[external_Blockly_namespaceObject.Msg.HTML_PASSWORD,"password"],[external_Blockly_namespaceObject.Msg.HTML_CHECKBOX,"checkbox"],[external_Blockly_namespaceObject.Msg.HTML_RADIOBUTTON,"radiobutton"],[external_Blockly_namespaceObject.Msg.HTML_BUTTON,"button"],[external_Blockly_namespaceObject.Msg.HTML_COLOUR,"colour"],[external_Blockly_namespaceObject.Msg.HTML_DATE,"date"],[external_Blockly_namespaceObject.Msg.HTML_LOCALTIME,"local time"],[external_Blockly_namespaceObject.Msg.HTML_FILE,"file"],[external_Blockly_namespaceObject.Msg.HTML_HIDDEN,"hidden"],[external_Blockly_namespaceObject.Msg.HTML_IMAGE,"image"],[external_Blockly_namespaceObject.Msg.HTML_MONTH,"month"],[external_Blockly_namespaceObject.Msg.HTML_RANGE,"range"],[external_Blockly_namespaceObject.Msg.HTML_RESET,"reset"],[external_Blockly_namespaceObject.Msg.HTML_SEARCH,"search"],[external_Blockly_namespaceObject.Msg.HTML_SUBMIT,"submit"],[external_Blockly_namespaceObject.Msg.HTML_TELEPHONENUMBER,"telephone number"],[external_Blockly_namespaceObject.Msg.HTML_TIME,"time"],[external_Blockly_namespaceObject.Msg.HTML_URL,"url"],[external_Blockly_namespaceObject.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_NAME).appendField(new external_Blockly_namespaceObject.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_VALUE).appendField(new external_Blockly_namespaceObject.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_content={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_color={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_text={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_TEXT).appendField(new external_Blockly_namespaceObject.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},UTILITY_HUE=160,raw_table={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTable(""),"TEXT")}},raw_block={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT")}},raw_expression={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},raw_empty={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},text_comment={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendTitle("Comment:").appendTitle(new external_Blockly_namespaceObject.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},type_check={init:function(){this.setColour(UTILITY_HUE),this.appendValueInput("VALUE").appendField(external_Blockly_namespaceObject.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},text_print_multiple={init:function(){this.setColour(UTILITY_HUE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=external_Blockly_namespaceObject.Block.obtain(e,"text_print_multiple_container");t.initSvg();for(var n=t.getInput("STACK").connection,_=0;_= stop:"," yield start"," start -= abs(step)"])};if(e=function(e,t,n){return"("+e+" <= "+t+") and "+o()+"("+e+", "+t+", "+n+") or "+p()+"("+e+", "+t+", "+n+")"},external_Blockly_namespaceObject.isNumber(_)&&external_Blockly_namespaceObject.isNumber(a)&&external_Blockly_namespaceObject.isNumber(l))_=parseFloat(_),a=parseFloat(a),l=Math.abs(parseFloat(l)),0==_%1&&0==a%1&&0==l%1?(_<=a?(a++,e=0==_&&1==l?a:_+", "+a,1!=l&&(e+=", "+l)):e=_+", "+--a+", -"+l,e="range("+e+")"):(e=_",GTE:">="};const logic_logic_operation=function(e,t){var n=this.getFieldValue("OP"),_="&&"==n?t.ORDER_LOGICAL_AND:t.ORDER_LOGICAL_OR,a=t.valueToCode(this,"A",_)||"False",l=t.valueToCode(this,"B",_)||"False";if("AND"==n)var s=a+" and "+l;else if("OR"==n)s=a+" or "+l;else if("NOR"==n)s="not("+a+"^"+l+")";else s=a+"^"+l;return[s,_]},logic_logic_negate=function(e,t){var n=t.ORDER_UNARY_PREFIX;return["not "+(t.valueToCode(this,"BOOL",n)||"False"),n]},logic_logic_boolean=function(e,t){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",t.ORDER_ATOMIC]},logic_logic_null=function(e,t){return["None",t.ORDER_ATOMIC]},logic_logic_true_or_false=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"False";return["("+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"False")+" if "+n+" else "+(t.valueToCode(this,"C",t.ORDER_ATOMIC)||"False")+")",t.ORDER_ATOMIC]},logic_logic_is_in=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",_=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+_,t.ORDER_ATOMIC]},logic_logic_is=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",_=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+_,t.ORDER_ATOMIC]},logic_logic_tobool=function(e,t){return["bool("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},storage_storage_open_file_with_os=function(e,t){return t.definitions_.import_os="import os","os.startfile("+t.valueToCode(this,"fn",t.ORDER_ATOMIC)+")\n"},storage_storage_fileopen=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+" = open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},storage_storage_fileopen_new=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",t.ORDER_ATOMIC]},storage_storage_fileopen_new_encoding=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',t.ORDER_ATOMIC]},storage_storage_file_write=function(e,t){var n=t.valueToCode(this,"data",t.ORDER_ATOMIC);return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".write("+n+")\n"},storage_storage_get_contents_without_para=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},storage_storage_get_contents=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_get_a_line=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".readline("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_can_write_ornot=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".writable()",t.ORDER_ATOMIC]},storage_storage_get_filename=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".name()",t.ORDER_ATOMIC]},storage_storage_close_file=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".close()\n"},storage_storage_list_all_files=function(e,t){t.definitions_.import_os="import os";return["os.listdir()",t.ORDER_ATOMIC]},storage_storage_delete_file=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_file_size=function(e,t){return t.definitions_.import_os="import os",["os.path.getsize("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_file_tell=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".tell()",t.ORDER_ATOMIC]},storage_storage_file_seek=function(e,t){var n=this.getFieldValue("MODE"),_=0;return _="start"==n?0:"current"==n?1:2,t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".seek("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+","+_+")\n"},storage_storage_change_dir=function(e,t){return t.definitions_.import_os="import os","os.chdir("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_current_dir=function(e,t){t.definitions_.import_os="import os";return["os.getcwd()",t.ORDER_ATOMIC]},storage_storage_make_dir=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"PATH",t.ORDER_ATOMIC)+")\n"},storage_storage_rename=function(e,t){return t.definitions_.import_os="import os","os.rename("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+","+t.valueToCode(this,"NEWFILE",t.ORDER_ATOMIC)+")\n"},storage_storage_is_file=function(e,t){t.definitions_.import_os="import os";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",t.ORDER_ATOMIC]},storage_sdcard_use_spi_init=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = sdcard.SDCard("+t.valueToCode(this,"SPISUB",t.ORDER_ATOMIC)+","+t.valueToCode(this,"PINSUB",t.ORDER_ATOMIC)+")\n"},storage_sdcard_mount=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard","os.mount("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"DIR",t.ORDER_ATOMIC)+")\n"},procedures_procedures_defreturn=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("NAME"),external_Blockly_namespaceObject.Procedures.NAME_TYPE),_=t.statementToCode(this,"STACK")||" pass\n";t.INFINITE_LOOP_TRAP&&(_=t.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+_);var a=t.valueToCode(this,"RETURN",t.ORDER_NONE)||"";a&&(a=" return "+a+"\n");for(var l=[],s=0;s\n\n\n\t\n"+t.statementToCode(this,"HEAD")+"\n\n"+t.statementToCode(this,"BODY")+"\n\n'''",t.ORDER_ATOMIC]},html_html_title=function(e,t){var n=t.statementToCode(this,"DO"),_=this.getFieldValue("LEVEL");return"\n"+n+"\n"},html_html_head_body=function(e,t){var n=t.statementToCode(this,"DO"),_=this.getFieldValue("LEVEL");if("head"==_)var a="<"+_+'>\n\t\n'+n+"\n";else a="<"+_+">\n"+n+"\n";return a},html_html_content=function(e,t){var n=t.statementToCode(this,"DO"),_=this.getFieldValue("LEVEL");return"<"+_+">\n"+n+"\n"},html_html_content_more=function(e,t){var n=t.statementToCode(this,"DO"),_=t.valueToCode(this,"style"),a=this.getFieldValue("LEVEL");return"<"+a+" "+_+" >\n"+n+"\n"},html_html_style=function(e,t){return['style="'+t.statementToCode(this,"STYLE")+'"',t.ORDER_ATOMIC]},html_html_form=function(e,t){return'"},html_html_style_content=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},html_html_text=function(){return this.getFieldValue("TEXT")+"\n"},utility_raw_block=function(e){return e.getFieldValue("TEXT")+"\n"},utility_raw_expression=function(e,t){return[e.getFieldValue("TEXT"),t.ORDER_ATOMIC]},utility_raw_empty=function(e,t){return(t.valueToCode(e,"VALUE",t.ORDER_ATOMIC)||"")+"\n"},utility_raw_table=function(){return""},utility_type_check=function(e,t){return["type("+(t.valueToCode(e,"VALUE",t.ORDER_MEMBER)||"___")+")",t.ORDER_ATOMIC]},utility_function_call=function(e,t){for(var n=e.getFieldValue("NAME"),_=e.hasReturn_,a=new Array(e.itemCount_),l=0;l0?t.join("\n")+"\n"+_.join("\n")+"\n"+a.join("")+"\n"+e+"while True:\n"+l.join("")+s.join("\n"):t.join("\n")+"\n"+_.join("\n")+"\n"+a.join("")+"\n"+e+s.join("\n")},Python.scrubNakedValue=function(e){return e+"\n"},Python.quote_=function(e){var t="'";return-1!==(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===e.indexOf('"')?t='"':e=e.replace(/'/g,"\\'")),t+e+t},Python.multiline_quote_=function(e){return"'''"+(e=e.replace(/'''/g,"\\'\\'\\'"))+"'''"},Python.scrub_=function(e,t,n){var _="";if(!e.outputConnection||!e.outputConnection.targetConnection){(l=e.getCommentText())&&(l=external_Blockly_namespaceObject.utils.string.wrap(l,Python.COMMENT_WRAP-3),_+=Python.prefixLines(l+"\n","# "));for(var a=0;a0?"int("+i+" + "+a+")":a<0?"int("+i+" - "+-a+")":"int("+i+")",_&&(i="-"+i)),i};const AI_HUE=205,AI_ChooseAndGet={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},AI_client={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech,"AipSpeech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace,"AipFace"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"AipOcr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},AI_Speech_synthesis={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Speech_asr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_File).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},AI_Face_match={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"1"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"2"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_webImage,"webImage"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_idcard,"idcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_receipt,"receipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_form,"tableRecognition"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_passport,"passport"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Sim={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"1").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"2").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_lexer,"lexer"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_depParser,"depParser"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_keyword,"keyword"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic,"topic"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Func_sim={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Topic={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_newsSummary={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_summary).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_LEN).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_audio={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},AI_photo={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},AI_result={init:function(){this.setColour(AI_HUE),this.appendValueInput("AI").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_RESULT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"Image"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr,"Speech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match,"Face"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"Ocr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},ALGORITHM_HUE="#526FC3",algorithm_prepare={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_find_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_new_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},algorithm_set_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_del_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_return_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},algorithm_print_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_current_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},algorithm_no_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_1={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_move_recent={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_not_home={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},algorithm_not_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},algorithm_print_path2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hanoi_init={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_move={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_all_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_all_books_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_first_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},algorithm_yes_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},algorithm_next_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_two_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},algorithm_divide_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_half_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_book2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_book_scale={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new external_Blockly_namespaceObject.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_number_zero={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_number_add={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_number={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_book_num={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField("n"+external_Blockly_namespaceObject.Msg.MIXLY_VALUE2).appendField(new external_Blockly_namespaceObject.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_divide={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_init_jttl={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头,"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_zero={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_number_in_range={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_chick_calculate={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_check_feet={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_print_jttl_answer={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_fzsf={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc_first_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_compare={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_set_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_move={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_hxdb={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若3人一排列队,多1人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若5人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若7人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_init_soldier={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new external_Blockly_namespaceObject.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_stand_in_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("使士兵").appendField(new external_Blockly_namespaceObject.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_last_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("剩余").appendField(new external_Blockly_namespaceObject.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_result={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_init_offline={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},algorithm_get_current_location={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_void_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},algorithm_color_seclet={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},COMMUNICATE_HUE="#3288dd",requests_get_old={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("DOMAIN").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET).appendField(new external_Blockly_namespaceObject.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},requests_get={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS).appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_post={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS+external_Blockly_namespaceObject.Msg.OLED_STRING),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_attribute={init:function(){this.appendValueInput("VAL");var e=[[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},requests_method={init:function(){this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]}))}},CV_HUE="f0a559",cv_read_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_show_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_write_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_waitkey={init:function(){this.setColour(CV_HUE),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+external_Blockly_namespaceObject.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},cv_destroy_all={init:function(){this.setColour(CV_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_line_rect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_CV_RECT,"rectangle"],[external_Blockly_namespaceObject.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_text={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new external_Blockly_namespaceObject.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_face_classifier={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect_all={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},DATA_HUE=170,series_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_one_index={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"index"],[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_text={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new external_Blockly_namespaceObject.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_index_value={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.SERIES_INDEX,"index"],[external_Blockly_namespaceObject.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.SERIES_INDEX_VALUE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"INDEX_VALUE"),this.setOutput(!0,"List");var t=this;this.setTooltip((function(){var e=t.getFieldValue("INDEX_VALUE");return{index:external_Blockly_namespaceObject.Msg.SERIES_INDEX_TOOLTIP,value:external_Blockly_namespaceObject.Msg.HTML_VALUE_TOOLTIP}[e]}))}},series_get_num={init:function(){this.setColour(DATA_HUE),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TUPLE_GET_INDEX_TOOLTIP)}},pl_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},array_create={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SPLITBYDOU).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pl_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},pl_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},pl_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},numpy_trig={init:function(){var e=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(DATA_HUE),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},pl_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pandas_readcsv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_get={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"column"],[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},pl_savefig={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},pl_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},array_toarray={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},plot_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},plot_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},plot_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},plot_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},plot_savefig={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},plot_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},numpy_shape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},numpy_reshape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},numpy_astype={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new external_Blockly_namespaceObject.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},pylab_imshow={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("展示图像"),this.appendDummyInput().appendField("颜色").appendField(new external_Blockly_namespaceObject.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},numpy_mean_digit={init:function(){this.setColour(DATA_HUE),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},numpy_argmin_template_match={init:function(){this.setColour(DATA_HUE),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},numpy_mean={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},numpy_std={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},pandas_dropna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},pandas_drop_columns={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Drops columns from dataframe.")}},numpy_ones={init:function(){this.setColour(DATA_HUE),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},numpy_c_={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("列拼接:数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},numpy_linalg_det={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},matrix_transpose={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},matrix_multiplication={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},numpy_linalg_inv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},dataframe_median={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},dataframe_fillna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new external_Blockly_namespaceObject.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},dataframe_info={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},numpy_min={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},numpy_max={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},numpy_size={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},numpy_dot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},numpy_square={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},numpy_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},numpy_random_random={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},py_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},DS_HUE=80,ds_create_linkedlist={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new external_Blockly_namespaceObject.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("ds_create_linkedlist_container");t.initSvg();for(var n=t.getInput("STACK").connection,_=0;_t?e[t]:"name"),"KEY"+t).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ds_create_linkedlist_container={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},ds_create_linkedlist_item={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},ds_create_node={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_USE).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_TOOLTIP)}},ds_get_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},ds_set_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},ds_add_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_add_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_del_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_del_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_reverse_linkedlist={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},FACTORY_HUE="#777777",factory_from_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("from ").appendField(new external_Blockly_namespaceObject.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_function_noreturn={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("items",this.itemCount_);for(var t=0;tt?e[t]:'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},iot_publish_container={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},iot_publish_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_create_with_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_mixio_connect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIFI_USERNAME).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_IOT_PASSWORD).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PROJECT).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_MIXIO_PUBLISH={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(external_Blockly_namespaceObject.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},IOT_MIXIO_SUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_MSG).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},IOT_MIXIO_UNSUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MSG.stop+external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},iot_mixio_disconnect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_connect_only={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_check={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_format_topic={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},iot_mixio_format_msg={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},IOT_FORMATTING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},IOT_FORMAT_STRING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},IOT_EMQX_PING={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},IOT_MIXIO_NTP={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+external_Blockly_namespaceObject.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixly_key_py={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}},iot_mixly_key={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},iot_client_onboard={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},iot_http_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME).appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_http_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_mqtt_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_INIT_SUBSCRIBE).appendField(external_Blockly_namespaceObject.MQTT_Topic).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mqtt_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_onenetconnect=iot_onenet_connect,iot_onenetdisconnect=iot_onenet_disconnect,iot_checkonenet=iot_onenet_check,iot_publish=iot_onenet_publish,PINS_HUE=230,pins_digital_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},pins_digital_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},pins_analog_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},pins_analog_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},SERIAL_HUE=40,serial_open={init:function(){this.setColour(SERIAL_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN)).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SERIAL_BEGIN).appendField(new external_Blockly_namespaceObject.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},serial_write={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},serial_read_b={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},serial_close={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},SKLEARN_HUE=80,sklearn_make_classification={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_regression={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_blobs={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_load={init:function(){var e=[[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.LOAD).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"type").appendField(new external_Blockly_namespaceObject.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("name"))&&this.setTitleValue(t,"name")}},sklearn_data_target={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SET),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.EIGENVALUES,"data"],[external_Blockly_namespaceObject.Msg.LABEL_VALUE,"target"],[external_Blockly_namespaceObject.Msg.FEATURE,"feature_names"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_LinearRegression={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_Ridge={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_DecisionTreeClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_RandomForestClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KNeighborsClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KNN_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_GaussianNB={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KMeans={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_predict={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_coef_intercept={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck(null).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_COEF,"coef_"],[external_Blockly_namespaceObject.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_cluster_centers_labels_inertia={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[external_Blockly_namespaceObject.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_save_load_model={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("sklearn").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_SAVE_MODEL,"dump"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},SYSTEM_HUE=120,base_delay={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY+"("+external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_controls_millis={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},time_localtime={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},system_Panic_with_status_code={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("STATUS_CODE",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_reset={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},controls_mstimer2={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("TIME").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_start={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_stop={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},system_time_sleep={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},TURTLE_HUE=180,turtle_create={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_done={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_exitonclick={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_move={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_forward,"forward"],[external_Blockly_namespaceObject.Msg.blockpy_backward,"backward"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},turtle_rotate={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_left,"left"],[external_Blockly_namespaceObject.Msg.blockpy_right,"right"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_rotate).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{left:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[e]}))}},turtle_setheading={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_delay={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_goto={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_setxy={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},turtle_pos_shape={init:function(){this.setColour(TURTLE_HUE);var e=[[external_Blockly_namespaceObject.Msg.TURTLE_POS,"pos"],[external_Blockly_namespaceObject.Msg.TURTLE_SHAPE,"shape"],[external_Blockly_namespaceObject.Msg.TURTLE_HEADING,"heading"],[external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_POS_SHAPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR");var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pos:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[e]})),this.setOutput(!0),this.setInputsInline(!0)}},turtle_clear={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_reset,"reset"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_home,"home"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{clear:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[e]}))}},turtle_penup={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_penup,"penup"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{penup:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[e]}))}},turtle_fill={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_beginfill,"begin"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_endfill,"end"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{begin:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[e]}))}},turtle_size_speed={init:function(){this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"TUR");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_size,"pensize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pensize:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[e]}))}},turtle_size={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_size),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_speed={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_speed),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_circle={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_dot,"dot"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_draw).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{circle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[e]}))}},turtle_circle_advanced={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},turtle_visible={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_hide,"hideturtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{hideturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[e]}))}},turtle_bgcolor={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_clone={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_CLONE),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},turtle_bgcolor_hex_new={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR1").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_bgcolor_hex={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_shape={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_arrow,"arrow"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_turtle,"turtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_square,"square"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_triangle,"triangle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_shape).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_SHAPE_TOOLTIP)}},turtle_shapesize={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},turtle_numinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_NUMINPUT_TOOLTIP)}},turtle_textinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},turtle_write={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_color_seclet={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},turtle_getscreen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new external_Blockly_namespaceObject.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_onkey={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},turtle_onclick={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},turtle_ontimer={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},turtle_listen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_savefig={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},ai_AI_ChooseAndGet=function(e,t){var n=this.getFieldValue("TYPE");return t.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",t.ORDER_ATOMIC]},ai_AI_client=function(e,t){var n=this.getFieldValue("CTYPE");return t.definitions_.import_aip="import aip",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = aip."+n+"("+t.valueToCode(this,"API_KEY",t.ORDER_ATOMIC)+", "+t.valueToCode(this,"SECRET_KEY",t.ORDER_ATOMIC)+")\n"},ai_AI_Speech_synthesis=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".synthesis("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Speech_asr=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".asr("+(t.valueToCode(this,"FILE",t.ORDER_ATOMIC)||'""')+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),_=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+_+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Face_match=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".match("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Ocr=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),_=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+_+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),_=t.valueToCode(this,"STR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+_+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Sim=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),_=t.valueToCode(this,"STR1",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR2",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+_+","+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Topic=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".topic("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},ai_AI_Nlp_newsSummary=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".newsSummary("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"LEN",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Ocr_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func_sim=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_audio=function(e,t){return t.definitions_.import_audio="import audio","audio.audio_record("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"TIME",t.ORDER_ATOMIC)||"0")+")\n"},ai_AI_photo=function(e,t){return t.definitions_.import_audio="import cam","cam.photo_capture("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"BUT",t.ORDER_ATOMIC)||'""')+")\n"},ai_AI_result=function(e,t){var n=t.valueToCode(this,"AI",t.ORDER_ASSIGNMENT)||"0",_=this.getFieldValue("CTYPE");if("Image"==_)var a=n+'["result"][0]["keyword"]';if("Speech"==_)a=n+'["result"][0]';if("Face"==_||"OcrSimilarity"==_)a=n+'["score"]';if("Ocr"==_)a=n+'["words_result"]';return[a,t.ORDER_ATOMIC]},algorithm_algorithm_prepare=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nfor i in house:\n i.hide()\n"},algorithm_algorithm_add_school=function(){return"path = [1]\ncar = sprite.Sprite('car', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},algorithm_algorithm_find_path=function(e,t){t.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},algorithm_algorithm_new_path=function(e,t){return["flag == 1",t.ORDER_ATOMIC]},algorithm_algorithm_set_path=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},algorithm_algorithm_add_path=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},algorithm_algorithm_del_path=function(e,t){t.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},algorithm_algorithm_return_path=function(){var e="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return e="house[f].hide()\ndrive(path[len(path) - 1])\n"+e},algorithm_algorithm_no_left=function(e,t){return["len(path) == 7",t.ORDER_ATOMIC]},algorithm_algorithm_print_path=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},algorithm_algorithm_prepare2=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nbarricade = sprite.Sprite('barricade', 570, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.hide()\n"},algorithm_algorithm_current_school=function(e,t){return["f == 1",t.ORDER_ATOMIC]},algorithm_algorithm_no_path=function(){return"print('没有符合条件的路线')\n"},algorithm_algorithm_prepare_2_1=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_prepare_2_2=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_move_recent=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]6:\n print("路线错乱!程序有误!")\n exit()\n'},algorithm_algorithm_not_home=function(e,t){return["name[now] != '小科家'",t.ORDER_ATOMIC]},algorithm_algorithm_not_school=function(e,t){return["name[now] != '学校'",t.ORDER_ATOMIC]},algorithm_algorithm_print_path2=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},algorithm_hanoi_init=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var _="print('层数过高!不得高于6层!')\nexit()\n";else _="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return _},algorithm_hanoi_move=function(e,t){var n=t.valueToCode(this,"FROM_NUM",t.ORDER_ATOMIC)||"0",_=t.valueToCode(this,"TO_NUM",t.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${_}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${_}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${_}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${_}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${_}*200+200, 400-len(_Hanoi[${_}])*27, 0.2)\n _Hanoi[${_}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},algorithm_algorithm_all_books_sequence=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},algorithm_algorithm_all_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},algorithm_algorithm_first_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},algorithm_algorithm_no_ring2=function(e,t){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",t.ORDER_ATOMIC]},algorithm_algorithm_yes_ring2=function(e,t){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",t.ORDER_ATOMIC]},algorithm_algorithm_next_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},algorithm_algorithm_two_left=function(e,t){return["len(list)>=2",t.ORDER_ATOMIC]},algorithm_algorithm_divide_books=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},algorithm_algorithm_get_half_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_delete_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_print_book2=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},algorithm_algorithm_book_scale=function(e,t){var n=this.getFieldValue("NUM");return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},algorithm_algorithm_number_zero=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},algorithm_algorithm_number_add=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},algorithm_algorithm_print_number=function(e,t){t.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},algorithm_algorithm_init_jttl=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},algorithm_algorithm_rabbit_zero=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},algorithm_algorithm_rabbit_number_in_range=function(e,t){return["_rabbit < _head",t.ORDER_ATOMIC]},algorithm_algorithm_chick_calculate=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},algorithm_algorithm_check_feet=function(e,t){return["_rabbit*4 + _chick*2 == _foot",t.ORDER_ATOMIC]},algorithm_algorithm_print_jttl_answer=function(e,t){t.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},algorithm_algorithm_rabbit_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},algorithm_algorithm_init_fzsf=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},algorithm_algorithm_fz_calc=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const _=[0,[1,3],[2,4],[5,7],[6]];var a="";return a+=`_S${n}.show()\ntime.sleep(1)\n`,a+=4!=n?`_Slen[${n}] = _Llen[${_[n][0]}] + _Llen[${_[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},algorithm_algorithm_fz_compare=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,t.ORDER_ATOMIC]},algorithm_algorithm_fz_set_min=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),_="";return _+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},algorithm_algorithm_fz_move=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},algorithm_algorithm_init_hxdb=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},algorithm_algorithm_hxdb_init_soldier=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},algorithm_algorithm_hxdb_stand_in_line=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},algorithm_algorithm_hxdb_last_line=function(e,t){return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,t.ORDER_ATOMIC]},algorithm_algorithm_hxdb_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},algorithm_algorithm_hxdb_result=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},algorithm_hanoi_init_offline=function(e,t){t.definitions_.import_turtle="import turtle",t.definitions_.import_time="import time",t.definitions_.import_math="import math";var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC),_=this.getFieldValue("NUM");return t.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",t.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",t.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+_).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_if_if");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_if_elseif");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_if_else");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_if_elseif":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_if_else":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_range={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},controls_forEach={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("LIST").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_whileUntil={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return{WHILE:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[t]}))}},controls_try_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=document.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(e){var t=this,n=[],a=[];this.elseCount_&&this.removeInput("ELSE");for(var _=this.elseifCount_;_>0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+_).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_try");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_except");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_finally");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_except":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_finally":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+e).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_flow_statements={init:function(){this.setColour(LOOPS_HUE);var e=new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(e,"FLOW").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var t=this;this.setTooltip((function(){var e=t.getFieldValue("FLOW");return{BREAK:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[e]}))},onchange:function(){if(this.workspace){var e=!1,t=this;do{if("controls_repeat"==t.type||"controls_for"==t.type||"controls_forEach"==t.type||"controls_repeat_ext"==t.type||"controls_whileUntil"==t.type||"do_while"==t.type){e=!0;break}t=t.getSurroundParent()}while(t);e?this.setWarningText(null):this.setWarningText(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},controls_for={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_for_range={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}};controls_whileUntil.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],controls_flow_statements.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const controls_if_if={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},controls_if_elseif={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},controls_if_else={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},controls_try={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},controls_except={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},controls_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},controls_repeat_ext={init:function(){this.jsonInit({message0:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:LOOPS_HUE,tooltip:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},controls_lambda={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STAT),this.setOutput(!0)}},controls_pass={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},controls_thread={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},do_while={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(LOOPS_HUE),this.setTooltip("do-while loop"),this.setHelpUrl("")}},garbage_collection={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},get_mem_alloc={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},get_mem_free={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},get_unique_identifier={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET+external_Blockly_namespaceObject.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_GET_UNIQUE_IDEN)}},MATH_HUE=230;external_Blockly_namespaceObject.FieldTextInput.math_number_validator=function(e){return String(e)},external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank=function(e){if(""===e)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(e)?String(e):null};const math_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_constant={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[t]}))}},math_constant_mp={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[t]}))}},math_arithmetic={init:function(){this.setColour(MATH_HUE),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_selfcalcu={init:function(){this.setColour(MATH_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_bit={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},math_trig={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{SIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_SIN,COS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_COS,TAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_LN}[t]}))}},math_dec={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_BIN,"bin"],[external_Blockly_namespaceObject.Msg.MATH_OCT,"oct"],[external_Blockly_namespaceObject.Msg.MATH_HEX,"hex"]];this.setColour(MATH_HUE),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{bin:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_BIN,oct:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_OCT,hex:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_HEX}[e]}))}},math_to_int={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"],[external_Blockly_namespaceObject.Msg.MATH_ABS,"fabs"],[external_Blockly_namespaceObject.Msg.MATH_SQRT,"sqrt"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{sqrt:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_SQ,round:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[e]}))}},math_max_min={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_MAX,"max"],[external_Blockly_namespaceObject.Msg.MIXLY_MIN,"min"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{max:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAX,min:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MIN}[e]}))}},math_number_base_conversion={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_TWO,"two"],[external_Blockly_namespaceObject.Msg.MATH_EIGHT,"eight"],[external_Blockly_namespaceObject.Msg.MATH_TEN,"ten"],[external_Blockly_namespaceObject.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(MATH_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_ZHW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP2").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP"),n={two:external_Blockly_namespaceObject.Msg.MATH_Before_two,eight:external_Blockly_namespaceObject.Msg.MATH_Before_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Before_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Before_sixteen},a=t.getFieldValue("OP2"),_={two:external_Blockly_namespaceObject.Msg.MATH_Behind_two,eight:external_Blockly_namespaceObject.Msg.MATH_Behind_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Behind_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Behind_sixteen};return n[e]+_[a]}))}},math_random={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_INT,"int"],[external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_RANDOM).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TYPE"),n={int:external_Blockly_namespaceObject.Msg.LANG_MATH_INT,float:external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT_RANDOM};return external_Blockly_namespaceObject.Msg.MATH_RANDOM_INT_TOOLTIP+n[e]}))}},math_constrain={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_CONSTRAIN_TOOLTIP)}},math_map={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAP)}},math_indexer_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_random_seed={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},math_round={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ROUND).appendField(external_Blockly_namespaceObject.Msg.TEXT_KEEP),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_ROUND_NEW_TOOLTIP)}},text_to_number={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_BITES,"b"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[e]}))}},text_to_number_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[e]}))}},base_map=math_map,TEXTS_HUE=160,text_text={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}},text_textarea={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}};external_Blockly_namespaceObject.FieldTextInput.char_validator=function(e){if(e.length>1&&"\\"===e.charAt(0)){var t=e.charAt(1);if("0"===t||"b"===t||"f"===t||"n"===t||"r"===t||"t"===t||"\\"===t||"'"===t)return String(e).substring(0,2);if("x"===t&&"0"===e.charAt(2)&&"B"===e.charAt(3))return String(e).substring(0,4)}return String(e).substring(0,1)};const text_char={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput("",external_Blockly_namespaceObject.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(e){if(1==e)var t="../../media/quote2.png";else t="../../media/quote3.png";return new external_Blockly_namespaceObject.FieldImage(t,7,12,'"')}},text_join={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},ascii_to_char={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},char_to_ascii={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},number_to_text={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},text_length={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},text_char_at2={init:function(){this.WHERE_OPTIONS=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM+1+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET,"MODE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=e.getFieldValue("WHERE"),a="";switch(t+" "+n){case"GET FROM_START":case"GET FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(a+=" "+external_Blockly_namespaceObject.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",external_Blockly_namespaceObject.Msg.ONE_BASED_INDEXING?"#1":"#0")),a}));var t=this;this.setTooltip((function(){var e=t.getFieldValue("WHERE"),n={FROM_START:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM};return external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+n[e]+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("statement",!this.outputConnection);var t=this.getInput("AT").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){var t="true"==e.getAttribute("statement");this.updateStatement_(t),e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateStatement_:function(e){e!=!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var t=new external_Blockly_namespaceObject.FieldDropdown(this.WHERE_OPTIONS,(function(t){var n="FROM_START"==t||"FROM_END"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT").appendField(t,"WHERE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},text_char_at={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)}},text_random_char={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},text_substring2={init:function(){this.WHERE_OPTIONS_1=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==external_Blockly_namespaceObject.INPUT_VALUE;e.setAttribute("at1",t);var n=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",n),e},domToMutation:function(e){var t="true"==e.getAttribute("at1"),n="true"==e.getAttribute("at2");this.updateAt_(1,t),this.updateAt_(2,n)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+e).appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+e);var n=new external_Blockly_namespaceObject.FieldDropdown(this["WHERE_OPTIONS_"+e],(function(n){var a="FROM_START"==n||"FROM_END"==n;if(a!=t){var _=this.sourceBlock_;return _.updateAt_(e,a),_.setFieldValue(n,"WHERE"+e),null}}));this.getInput("AT"+e).appendField(n,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},text_substring={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},text_equals_starts_ends={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_EQUALS,"==="],[external_Blockly_namespaceObject.Msg.MIXLY_STARTSWITH,"startswith"],[external_Blockly_namespaceObject.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},text_compare_to={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO_HELP)}},text_capital={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_UPPER,"upper"],[external_Blockly_namespaceObject.Msg.TEXT_TITLE,"title"],[external_Blockly_namespaceObject.Msg.TEXT_CAPITALIZE,"capitalize"],[external_Blockly_namespaceObject.Msg.TEXT_SWAPCASE,"swapcase"],[external_Blockly_namespaceObject.Msg.TEXT_LOWER,"lower"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CAPITAL").setCheck(String),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CAPITAL");return{upper:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[e]}))}},text_center={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_LJUST,"ljust"],[external_Blockly_namespaceObject.Msg.TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_RJUST,"rjust"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(external_Blockly_namespaceObject.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},text_find={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},text_join_seq={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},text_replace={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},text_split={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},text_strip={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH,"strip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"lstrip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{strip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[e]}))}},text_format={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("text_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_create_with_container={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},dicts_create_with_item={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},dicts_keys={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_KEYS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},dicts_get={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_TOOLTIP)}},dicts_get_default={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},dicts_add_or_change={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},dicts_delete={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP)}},dicts_update={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT2").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_clear={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_CLEAR),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_items={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_ITEMS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},dicts_values={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_VALUES),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},dicts_length={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},dicts_deldict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_DELDICT),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_add_change_del={init:function(){this.MODE=[[external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t="";switch(e.getFieldValue("WHERE")){case"INSERT":t=external_Blockly_namespaceObject.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":t=external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP}return t}))},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",t),e},domToMutation:function(e){var t="true"==e.getAttribute("at2");this.updateAt_(t)},updateAt_:function(e){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),e?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var t=new external_Blockly_namespaceObject.FieldDropdown(this.MODE,(function(t){var n="INSERT"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT2").appendField(t,"WHERE")}},dicts_pop={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},dicts_setdefault={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_SETDEFAULT_TOOLTIP)}},dicts_create_with_noreturn={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("dicts_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_todict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},dicts_to_json={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},json_to_dicts={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},LOGIC_HUE=210,logic_compare={init:function(){var e=external_Blockly_namespaceObject.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{EQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[e]})),this.prevBlocks_=[null,null]}},logic_compare_continous={init:function(){var e=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],t=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP1"),this.appendValueInput("C").appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"OP2"),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},logic_operation={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_AND,"AND"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_OR,"OR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_NOR,"NOR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{AND:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[e]}))}},logic_negate={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},logic_boolean={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TOOLTIP)}},logic_null={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LOGIC_NULL),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NULL_TOOLTIP)}},logic_true_or_false={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},logic_is_in={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_APPEND_TO,"in"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.IN)}},logic_is={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},logic_tobool={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},STORAGE_HUE=0,storage_open_file_with_os={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("fn").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},storage_fileopen={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},storage_fileopen_new={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,s=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+s}))}},storage_fileopen_new_encoding={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,s=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+s}))}},storage_file_write={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},storage_get_contents_without_para={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},storage_get_contents={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[t]+"x"+a}))}},storage_get_a_line={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MICROBIT_PYTHON_TYPE)}},storage_can_write_ornot={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.HTML_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},storage_get_filename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},storage_close_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},storage_list_all_files={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const storage_delete_file={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},storage_get_file_size={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},storage_file_tell={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},storage_file_seek={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[t]+_+"x"+a}))}},storage_get_current_dir={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},storage_make_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("PATH").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET+{mkdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},storage_rename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},storage_change_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},storage_is_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_FILE,"isfile"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},sdcard_use_spi_init={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("SPISUB").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP+external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sdcard_mount={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Procedures={};Procedures.NAME_TYPE=external_Blockly_namespaceObject.PROCEDURE_CATEGORY_NAME,Procedures.allProcedures=function(e){for(var t=e.getAllBlocks(!1),n=[],a=[],_=0;_"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},html_form={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_FORM_CONTENT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_TEXT,"text"],[external_Blockly_namespaceObject.Msg.HTML_EMAIL,"email"],[external_Blockly_namespaceObject.Msg.HTML_NUMBER,"number"],[external_Blockly_namespaceObject.Msg.HTML_PASSWORD,"password"],[external_Blockly_namespaceObject.Msg.HTML_CHECKBOX,"checkbox"],[external_Blockly_namespaceObject.Msg.HTML_RADIOBUTTON,"radiobutton"],[external_Blockly_namespaceObject.Msg.HTML_BUTTON,"button"],[external_Blockly_namespaceObject.Msg.HTML_COLOUR,"colour"],[external_Blockly_namespaceObject.Msg.HTML_DATE,"date"],[external_Blockly_namespaceObject.Msg.HTML_LOCALTIME,"local time"],[external_Blockly_namespaceObject.Msg.HTML_FILE,"file"],[external_Blockly_namespaceObject.Msg.HTML_HIDDEN,"hidden"],[external_Blockly_namespaceObject.Msg.HTML_IMAGE,"image"],[external_Blockly_namespaceObject.Msg.HTML_MONTH,"month"],[external_Blockly_namespaceObject.Msg.HTML_RANGE,"range"],[external_Blockly_namespaceObject.Msg.HTML_RESET,"reset"],[external_Blockly_namespaceObject.Msg.HTML_SEARCH,"search"],[external_Blockly_namespaceObject.Msg.HTML_SUBMIT,"submit"],[external_Blockly_namespaceObject.Msg.HTML_TELEPHONENUMBER,"telephone number"],[external_Blockly_namespaceObject.Msg.HTML_TIME,"time"],[external_Blockly_namespaceObject.Msg.HTML_URL,"url"],[external_Blockly_namespaceObject.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_NAME).appendField(new external_Blockly_namespaceObject.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_VALUE).appendField(new external_Blockly_namespaceObject.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_content={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_color={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_text={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_TEXT).appendField(new external_Blockly_namespaceObject.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},UTILITY_HUE=160,raw_table={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTable(""),"TEXT")}},raw_block={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT")}},raw_expression={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},raw_empty={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},text_comment={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendTitle("Comment:").appendTitle(new external_Blockly_namespaceObject.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},type_check={init:function(){this.setColour(UTILITY_HUE),this.appendValueInput("VALUE").appendField(external_Blockly_namespaceObject.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},text_print_multiple={init:function(){this.setColour(UTILITY_HUE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=external_Blockly_namespaceObject.Block.obtain(e,"text_print_multiple_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;a= stop:"," yield start"," start -= abs(step)"])};if(e=function(e,t,n){return"("+e+" <= "+t+") and "+o()+"("+e+", "+t+", "+n+") or "+p()+"("+e+", "+t+", "+n+")"},external_Blockly_namespaceObject.isNumber(a)&&external_Blockly_namespaceObject.isNumber(_)&&external_Blockly_namespaceObject.isNumber(l))a=parseFloat(a),_=parseFloat(_),l=Math.abs(parseFloat(l)),0==a%1&&0==_%1&&0==l%1?(a<=_?(_++,e=0==a&&1==l?_:a+", "+_,1!=l&&(e+=", "+l)):e=a+", "+--_+", -"+l,e="range("+e+")"):(e=a<_?o():p(),e+="("+a+", "+_+", "+l+")");else{var r=function(e,a){if(external_Blockly_namespaceObject.isNumber(e))e=parseFloat(e);else{var _=t.variableDB_.getDistinctName(n+a,external_Blockly_namespaceObject.Variables.NAME_TYPE);i+=_+" = "+e+"\n",e=_}return e};a=r(a,"_start"),_=r(_,"_end");r(l,"_inc"),e="number"==typeof a&&"number"==typeof _?a<_?o(0,_):p(0,_):e(a,_,l)}return i+="for "+n+" in "+e+":\n"+s},control_controls_for_range=function(e,t){var n=t.variableDB_.getName(e.getFieldValue("VAR"),external_Blockly_namespaceObject.Variables.NAME_TYPE),a=t.valueToCode(e,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(e,"TO",t.ORDER_NONE)||"0",l=t.valueToCode(e,"STEP",t.ORDER_NONE)||"1",s=t.statementToCode(e,"DO"),i=t.addLoopTrap(s,e.id)||t.PASS;return t.setups_.mixly_range="def mixly_range(start, stop, step):\n for i in range(start, stop + 1, step):\n yield i\n\n","for "+n+" in mixly_range("+a+", "+_+", "+l+"):\n"+i},control_controls_whileUntil=function(e,t){var n="UNTIL"==e.getFieldValue("MODE"),a=t.valueToCode(e,"BOOL",t.ORDER_NONE)||"False",_=t.statementToCode(e,"DO");return n&&(a="not "+a),"while "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_flow_statements=function(e){switch(e.getFieldValue("FLOW")){case"BREAK":return"break\n";case"CONTINUE":return"continue\n"}throw"Unknown flow statement."},control_controls_delay=function(e,t){return"sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},Panic_with_status_code=function(e,t){return"panic("+(t.valueToCode(this,"STATUS_CODE",t.ORDER_ATOMIC)||"1000")+")\n"},controls_millis=function(e,t){t.definitions_.import_time="import time";return["time.time()",t.ORDER_ATOMIC]},control_reset=function(e,t){return t.definitions_.import_microbit="from microbit import *","reset()\n"},controls_interrupts=function(){return"interrupts();\n"},controls_nointerrupts=function(){return"noInterrupts();\n"},control_controls_forEach=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"''",a=t.valueToCode(e,"LIST",t.ORDER_RELATIONAL)||"[]",_=t.statementToCode(e,"DO");return"for "+n+" in "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_range=function(e,t){return["range("+(t.valueToCode(this,"FROM",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"TO",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"STEP",t.ORDER_NONE)||"1")+")",t.ORDER_ATOMIC]},control_controls_lambda=function(e,t){var n="lambda "+(t.valueToCode(e,"BOOL",t.ORDER_NONE)||"None")+": "+(t.statementToCode(e,"DO")||"pass");return[n=n.replace("\n","").replace(" ",""),t.ORDER_ATOMIC]},time_sleep=function(e,t){return t.definitions_.import_time="import time","time.sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},control_controls_pass=function(){return"pass\n"},control_controls_thread=function(e,t){t.definitions_.import__thread="import _thread";var n=t.valueToCode(this,"VAR",t.ORDER_NONE)||"None";return"_thread.start_new_thread("+t.variableDB_.getName(t.valueToCode(this,"callback",t.ORDER_NONE)||"None",external_Blockly_namespaceObject.Procedures.NAME_TYPE)+", "+n+")\n"},control_do_while=function(e,t){var n=t.valueToCode(this,"select_data",t.ORDER_NONE)||"False",a=t.statementToCode(this,"input_data");return a="true"==this.getFieldValue("type")?a+" if ("+n+"):\n break\n":a+" if not ("+n+"):\n break\n","while True:\n"+(a=t.addLoopTrap(a,this.id)||t.PASS)},control_controls_repeat_ext=function(e,t){var n=t.valueToCode(this,"TIMES",t.ORDER_ATOMIC),a=t.statementToCode(e,"DO");return"for _my_variable in range("+n+"):\n"+(a=t.addLoopTrap(a,e.id)||t.PASS)},control_garbage_collection=function(e,t){t.definitions_.import_gc="import gc";return"gc.collect()\n"},control_get_mem_alloc=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_alloc()\n",t.ORDER_ATOMIC]},control_get_mem_free=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_free()\n",t.ORDER_ATOMIC]},control_get_unique_identifier=function(e,t){t.definitions_.import_machine="import machine";return["machine.unique_id()",t.ORDER_ATOMIC]},controls_repeat=control_controls_repeat_ext,math_math_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_constant=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_constant_mp=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_bit=function(e,t){var n=this.getFieldValue("OP"),a=t.ORDER_ATOMIC;return["("+(t.valueToCode(this,"A",a)||"0")+n+(t.valueToCode(this,"B",a)||"0")+")",a]},math_math_arithmetic=function(e,t){var n=(a={ADD:[" + ",t.ORDER_ADDITIVE],MINUS:[" - ",t.ORDER_ADDITIVE],MULTIPLY:[" * ",t.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",t.ORDER_MULTIPLICATIVE],QUYU:[" % ",t.ORDER_MULTIPLICATIVE],ZHENGCHU:[" // ",t.ORDER_MULTIPLICATIVE],POWER:[" ** ",t.ORDER_EXPONENTIATION]}[e.getFieldValue("OP")])[0],a=a[1];return[(t.valueToCode(e,"A",a)||"0")+n+(e=t.valueToCode(e,"B",a)||"0"),a]},math_math_selfcalcu=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_RELATIONAL)||"0",a=t.valueToCode(this,"B",t.ORDER_RELATIONAL)||"0";switch(this.getFieldValue("OP")){case"ADD":var _="+=";break;case"MINUS":_="-=";break;case"MULTIPLY":_="*=";break;case"DIVIDE":_="/=";break;case"QUYU":_="%=";break;case"ZHENGCHU":_="//=";break;case"POWER":_="**="}return n+" "+_+" "+a+"\n"},math_single=function(e,t){var n,a=e.getFieldValue("OP");if("NEG"==a)return["-"+(n=t.valueToCode(e,"NUM",t.ORDER_UNARY_SIGN)||"0"),t.ORDER_UNARY_SIGN];switch(t.definitions_.import_math="import math",e="SIN"==a||"COS"==a||"TAN"==a?t.valueToCode(e,"NUM",t.ORDER_MULTIPLICATIVE)||"0":t.valueToCode(e,"NUM",t.ORDER_NONE)||"0",a){case"ABS":n="math.fabs("+e+")";break;case"ROOT":n="math.sqrt("+e+")";break;case"LN":n="math.log("+e+")";break;case"LOG10":n="math.log10("+e+")";break;case"EXP":n="math.exp("+e+")";break;case"POW10":n="math.pow(10,"+e+")";break;case"ROUND":n="round("+e+")";break;case"ROUNDUP":n="math.ceil("+e+")";break;case"ROUNDDOWN":n="math.floor("+e+")";break;case"SIN":n="math.sin("+e+")";break;case"COS":n="math.cos("+e+")";break;case"TAN":n="math.tan("+e+")";break;case"++":n="++("+e+")";break;case"--":n="--("+e+")";break;case"-":n="-("+e+")"}if(n)return[n,t.ORDER_EXPONENTIATION];switch(a){case"ASIN":n="math.degrees(math.asin("+e+"))";break;case"ACOS":n="math.degrees(math.acos("+e+"))";break;case"ATAN":n="math.degrees(math.atan("+e+"))"}return[n,t.ORDER_MULTIPLICATIVE]},math_math_trig=math_single,math_math_dec=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+")",t.ORDER_ATOMIC]},math_math_to_int=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=this.getFieldValue("OP"),_="";return"round"===a?_=a+"("+n+")":(_="math."+a+"("+n+")",t.definitions_.import_math="import math"),[_,t.ORDER_ATOMIC]},math_math_max_min=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=t.valueToCode(this,"B",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+", "+a+")",t.ORDER_ATOMIC]},math_math_random=function(e,t){t.definitions_.import_random="import random";var n=this.getFieldValue("TYPE"),a=t.valueToCode(this,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(this,"TO",t.ORDER_NONE)||"0";if("int"==n)var l="random.randint("+a+", "+_+")";else if("float"==n)l="random.uniform("+a+", "+_+")";return[l,t.ORDER_UNARY_POSTFIX]},math_math_map=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE),a=t.valueToCode(this,"fromLow",t.ORDER_ATOMIC),_=t.valueToCode(this,"fromHigh",t.ORDER_ATOMIC),l=t.valueToCode(this,"toLow",t.ORDER_ATOMIC),s=t.valueToCode(this,"toHigh",t.ORDER_ATOMIC);return t.definitions_.import_mixpy_math_map="from mixpy import math_map",["math_map("+n+", "+a+", "+_+", "+l+", "+s+")",t.ORDER_NONE]},math_math_constrain=function(e,t){return["min(max("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"LOW",t.ORDER_NONE)||"0")+"), "+(t.valueToCode(this,"HIGH",t.ORDER_NONE)||"0")+")",t.ORDER_UNARY_POSTFIX]},math_math_number_base_conversion=function(e,t){var n=e.getFieldValue("OP"),a=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0",_=e.getFieldValue("OP2");t.definitions_.import_math="import math";var l="",s="10";if("two"==n?s="2":"eight"==n?s="8":"ten"==n?s="10":"sixteen"==n&&(s="16"),"two"==_?l="bin":"eight"==_?l="oct":"ten"==_?l="":"sixteen"==_&&(l="hex"),""==l)var i="int(str("+a+"), "+s+")";else i=l+"(int(str("+a+"), "+s+"))";return[i,t.ORDER_ATOMIC]},math_math_random_seed=function(e,t){return t.definitions_.import_random="import random","random.seed("+(t.valueToCode(this,"NUM",t.ORDER_NONE)||"0")+");\n"},math_math_indexer_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_round=function(e,t){return["round("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"VAR",t.ORDER_NONE)||"0")+")",t.ORDER_ATOMIC]},math_text_to_number=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_text_to_number_skulpt=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_base_map=math_math_map,generators_text_text=function(e,t){return[t.quote_(this.getFieldValue("TEXT")),t.ORDER_ATOMIC]},text_text_textarea=function(e,t){return['"""'+this.getFieldValue("VALUE")+'"""',t.ORDER_ATOMIC]},text_text_char=function(e,t){return["'"+this.getFieldValue("TEXT")+"'",t.ORDER_ATOMIC]},text_text_join=function(e,t){return[t.valueToCode(this,"A",t.ORDER_ATOMIC)+" + "+t.valueToCode(this,"B",t.ORDER_ATOMIC),t.ORDER_ADDITIVE]},text_ascii_to_char=function(e,t){return["chr("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},text_char_to_ascii=function(e,t){return["ord("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"a")+")",t.ORDER_ATOMIC]},text_number_to_text=function(e,t){return["str("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},text_text_length=function(e,t){return["len("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+")",t.ORDER_ATOMIC]},text_text_char_at2=function(e,t){var n=e.getFieldValue("WHERE")||"FROM_START",a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""';switch(n){case"FROM_START":return[a+"["+(e=t.getAdjustedInt(e,"AT"))+"]",t.ORDER_ATOMIC];case"FROM_END":return[a+"["+(e=t.getAdjustedInt(e,"AT",1,!0))+"]",t.ORDER_ATOMIC];case"RANDOM":return t.definitions_.import_random="import random",["random.choice("+a+")",t.ORDER_FUNCTION_CALL]}throw"Unhandled combination (lists_getIndex)."},text_text_char_at=function(e,t){return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+"["+(t.valueToCode(this,"AT",t.ORDER_ATOMIC)||0)+"]",t.ORDER_ATOMIC]},text_text_random_char=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""';return t.definitions_.import_random="import random",["random.choice("+n+")",t.ORDER_FUNCTION_CALL]},text_text_equals_starts_ends=function(e,t){var n=t.valueToCode(this,"STR1",t.ORDER_ATOMIC)||'""',a=t.valueToCode(this,"STR2",t.ORDER_ATOMIC)||'""',_=this.getFieldValue("DOWHAT");return"==="===_?[n+" == "+a,t.ORDER_ATOMIC]:[n+"."+_+"("+a+")",t.ORDER_ATOMIC]},text_text_compare_to=function(e,t){return["cmp("+(t.valueToCode(this,"STR1",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"STR2",t.ORDER_ATOMIC)||'""')+")",t.ORDER_ATOMIC]},text_text_substring2=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""',a=e.getFieldValue("WHERE1"),_=e.getFieldValue("WHERE2");switch(a){case"FROM_START":"0"==(l=t.getAdjustedInt(e,"AT1"))&&(l="");break;case"FROM_END":var l=t.getAdjustedInt(e,"AT1",0,!0);break;case"FIRST":l="0";break;default:throw"Unhandled option (lists_getSublist)"}switch(_){case"FROM_START":var s=t.getAdjustedInt(e,"AT2");break;case"FROM_END":s=t.getAdjustedInt(e,"AT2",0,!0);external_Blockly_namespaceObject.isNumber(String(s))?"0"==s&&(s=""):(t.definitions_.import_sys="import sys",s+=" or sys.maxsize");break;case"LAST":s="-1";break;default:throw"Unhandled option (lists_getSublist)"}return[n+"["+l+" : "+s+"]",t.ORDER_ATOMIC]},text_text_substring=function(e,t){return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+"["+t.valueToCode(this,"AT1",t.ORDER_ATOMIC)+" : "+t.valueToCode(this,"AT2",t.ORDER_ATOMIC)+"]",t.ORDER_ATOMIC]},text_text_capital=function(e,t){var n=this.getFieldValue("CAPITAL");return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},text_text_center=function(e,t){var n=this.getFieldValue("CENTER");return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"WID",t.ORDER_ATOMIC)+","+t.valueToCode(this,"Symbol",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},text_text_find=function(e,t){return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".find("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},text_text_join_seq=function(e,t){return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".join("+(t.valueToCode(this,"LIST",t.ORDER_ASSIGNMENT)||"0")+")",t.ORDER_ATOMIC]},text_text_replace=function(e,t){return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".replace("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},text_text_split=function(e,t){return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+".split("+(t.valueToCode(this,"VAL",t.ORDER_ATOMIC)||'""')+")",t.ORDER_ATOMIC]},text_text_strip=function(e,t){var n=this.getFieldValue("TOWHAT");return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},text_text_format=function(e,t){for(var n=this.getFieldValue("VAR"),a=new Array(this.itemCount_),_=0;_",GTE:">="};const logic_logic_operation=function(e,t){var n=this.getFieldValue("OP"),a="&&"==n?t.ORDER_LOGICAL_AND:t.ORDER_LOGICAL_OR,_=t.valueToCode(this,"A",a)||"False",l=t.valueToCode(this,"B",a)||"False";if("AND"==n)var s=_+" and "+l;else if("OR"==n)s=_+" or "+l;else if("NOR"==n)s="not("+_+"^"+l+")";else s=_+"^"+l;return[s,a]},logic_logic_negate=function(e,t){var n=t.ORDER_UNARY_PREFIX;return["not "+(t.valueToCode(this,"BOOL",n)||"False"),n]},logic_logic_boolean=function(e,t){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",t.ORDER_ATOMIC]},logic_logic_null=function(e,t){return["None",t.ORDER_ATOMIC]},logic_logic_true_or_false=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"False";return["("+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"False")+" if "+n+" else "+(t.valueToCode(this,"C",t.ORDER_ATOMIC)||"False")+")",t.ORDER_ATOMIC]},logic_logic_is_in=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_is=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_tobool=function(e,t){return["bool("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},storage_storage_open_file_with_os=function(e,t){return t.definitions_.import_os="import os","os.startfile("+t.valueToCode(this,"fn",t.ORDER_ATOMIC)+")\n"},storage_storage_fileopen=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+" = open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},storage_storage_fileopen_new=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",t.ORDER_ATOMIC]},storage_storage_fileopen_new_encoding=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',t.ORDER_ATOMIC]},storage_storage_file_write=function(e,t){var n=t.valueToCode(this,"data",t.ORDER_ATOMIC);return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".write("+n+")\n"},storage_storage_get_contents_without_para=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},storage_storage_get_contents=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_get_a_line=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".readline("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_can_write_ornot=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".writable()",t.ORDER_ATOMIC]},storage_storage_get_filename=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".name()",t.ORDER_ATOMIC]},storage_storage_close_file=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".close()\n"},storage_storage_list_all_files=function(e,t){t.definitions_.import_os="import os";return["os.listdir()",t.ORDER_ATOMIC]},storage_storage_delete_file=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_file_size=function(e,t){return t.definitions_.import_os="import os",["os.path.getsize("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_file_tell=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".tell()",t.ORDER_ATOMIC]},storage_storage_file_seek=function(e,t){var n=this.getFieldValue("MODE"),a=0;return a="start"==n?0:"current"==n?1:2,t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".seek("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+","+a+")\n"},storage_storage_change_dir=function(e,t){return t.definitions_.import_os="import os","os.chdir("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_current_dir=function(e,t){t.definitions_.import_os="import os";return["os.getcwd()",t.ORDER_ATOMIC]},storage_storage_make_dir=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"PATH",t.ORDER_ATOMIC)+")\n"},storage_storage_rename=function(e,t){return t.definitions_.import_os="import os","os.rename("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+","+t.valueToCode(this,"NEWFILE",t.ORDER_ATOMIC)+")\n"},storage_storage_is_file=function(e,t){t.definitions_.import_os="import os";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",t.ORDER_ATOMIC]},storage_sdcard_use_spi_init=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = sdcard.SDCard("+t.valueToCode(this,"SPISUB",t.ORDER_ATOMIC)+","+t.valueToCode(this,"PINSUB",t.ORDER_ATOMIC)+")\n"},storage_sdcard_mount=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard","os.mount("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"DIR",t.ORDER_ATOMIC)+")\n"},procedures_procedures_defreturn=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("NAME"),external_Blockly_namespaceObject.Procedures.NAME_TYPE),a=t.statementToCode(this,"STACK")||" pass\n";t.INFINITE_LOOP_TRAP&&(a=t.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+a);var _=t.valueToCode(this,"RETURN",t.ORDER_NONE)||"";_&&(_=" return "+_+"\n");for(var l=[],s=0;s\n\n\n\t\n"+t.statementToCode(this,"HEAD")+"\n\n"+t.statementToCode(this,"BODY")+"\n\n'''",t.ORDER_ATOMIC]},html_html_title=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"\n"+n+"\n"},html_html_head_body=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");if("head"==a)var _="<"+a+'>\n\t\n'+n+"\n";else _="<"+a+">\n"+n+"\n";return _},html_html_content=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"<"+a+">\n"+n+"\n"},html_html_content_more=function(e,t){var n=t.statementToCode(this,"DO"),a=t.valueToCode(this,"style"),_=this.getFieldValue("LEVEL");return"<"+_+" "+a+" >\n"+n+"\n"},html_html_style=function(e,t){return['style="'+t.statementToCode(this,"STYLE")+'"',t.ORDER_ATOMIC]},html_html_form=function(e,t){return'"},html_html_style_content=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},html_html_text=function(){return this.getFieldValue("TEXT")+"\n"},utility_raw_block=function(e){return e.getFieldValue("TEXT")+"\n"},utility_raw_expression=function(e,t){return[e.getFieldValue("TEXT"),t.ORDER_ATOMIC]},utility_raw_empty=function(e,t){return(t.valueToCode(e,"VALUE",t.ORDER_ATOMIC)||"")+"\n"},utility_raw_table=function(){return""},utility_type_check=function(e,t){return["type("+(t.valueToCode(e,"VALUE",t.ORDER_MEMBER)||"___")+")",t.ORDER_ATOMIC]},utility_function_call=function(e,t){for(var n=e.getFieldValue("NAME"),a=e.hasReturn_,_=new Array(e.itemCount_),l=0;l0?t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+"while True:\n"+l.join("")+s.join("\n"):t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+s.join("\n")},Python.scrubNakedValue=function(e){return e+"\n"},Python.quote_=function(e){var t="'";return-1!==(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===e.indexOf('"')?t='"':e=e.replace(/'/g,"\\'")),t+e+t},Python.multiline_quote_=function(e){return"'''"+(e=e.replace(/'''/g,"\\'\\'\\'"))+"'''"},Python.scrub_=function(e,t,n){var a="";if(!e.outputConnection||!e.outputConnection.targetConnection){(l=e.getCommentText())&&(l=external_Blockly_namespaceObject.utils.string.wrap(l,Python.COMMENT_WRAP-3),a+=Python.prefixLines(l+"\n","# "));for(var _=0;_0?"int("+i+" + "+_+")":_<0?"int("+i+" - "+-_+")":"int("+i+")",a&&(i="-"+i)),i};const AI_HUE=205,AI_ChooseAndGet={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},AI_client={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech,"AipSpeech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace,"AipFace"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"AipOcr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},AI_Speech_synthesis={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Speech_asr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_File).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},AI_Face_match={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"1"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"2"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_webImage,"webImage"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_idcard,"idcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_receipt,"receipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_form,"tableRecognition"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_passport,"passport"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Sim={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"1").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"2").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_lexer,"lexer"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_depParser,"depParser"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_keyword,"keyword"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic,"topic"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Func_sim={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Topic={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_newsSummary={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_summary).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_LEN).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_audio={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},AI_photo={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},AI_result={init:function(){this.setColour(AI_HUE),this.appendValueInput("AI").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_RESULT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"Image"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr,"Speech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match,"Face"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"Ocr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},ALGORITHM_HUE="#526FC3",algorithm_prepare={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_find_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_new_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},algorithm_set_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_del_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_return_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},algorithm_print_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_current_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},algorithm_no_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_1={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_move_recent={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_not_home={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},algorithm_not_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},algorithm_print_path2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hanoi_init={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_move={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_all_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_all_books_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_first_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},algorithm_yes_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},algorithm_next_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_two_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},algorithm_divide_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_half_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_book2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_book_scale={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new external_Blockly_namespaceObject.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_number_zero={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_number_add={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_number={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_book_num={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField("n"+external_Blockly_namespaceObject.Msg.MIXLY_VALUE2).appendField(new external_Blockly_namespaceObject.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_divide={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_init_jttl={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头,"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_zero={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_number_in_range={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_chick_calculate={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_check_feet={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_print_jttl_answer={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_fzsf={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc_first_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_compare={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_set_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_move={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_hxdb={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若3人一排列队,多1人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若5人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若7人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_init_soldier={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new external_Blockly_namespaceObject.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_stand_in_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("使士兵").appendField(new external_Blockly_namespaceObject.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_last_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("剩余").appendField(new external_Blockly_namespaceObject.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_result={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_init_offline={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},algorithm_get_current_location={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_void_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},algorithm_color_seclet={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},COMMUNICATE_HUE="#3288dd",requests_get_old={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("DOMAIN").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET).appendField(new external_Blockly_namespaceObject.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},requests_get={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS).appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_post={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS+external_Blockly_namespaceObject.Msg.OLED_STRING),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_attribute={init:function(){this.appendValueInput("VAL");var e=[[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},requests_method={init:function(){this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]}))}},CV_HUE="f0a559",cv_read_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_show_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_write_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_waitkey={init:function(){this.setColour(CV_HUE),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+external_Blockly_namespaceObject.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},cv_destroy_all={init:function(){this.setColour(CV_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_line_rect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_CV_RECT,"rectangle"],[external_Blockly_namespaceObject.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_text={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new external_Blockly_namespaceObject.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_face_classifier={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect_all={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},DATA_HUE=170,series_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_one_index={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"index"],[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_text={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new external_Blockly_namespaceObject.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_index_value={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.SERIES_INDEX,"index"],[external_Blockly_namespaceObject.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.SERIES_INDEX_VALUE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"INDEX_VALUE"),this.setOutput(!0,"List");var t=this;this.setTooltip((function(){var e=t.getFieldValue("INDEX_VALUE");return{index:external_Blockly_namespaceObject.Msg.SERIES_INDEX_TOOLTIP,value:external_Blockly_namespaceObject.Msg.HTML_VALUE_TOOLTIP}[e]}))}},series_get_num={init:function(){this.setColour(DATA_HUE),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TUPLE_GET_INDEX_TOOLTIP)}},pl_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},array_create={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SPLITBYDOU).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pl_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},pl_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},pl_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},numpy_trig={init:function(){var e=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(DATA_HUE),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},pl_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pandas_readcsv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_get={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"column"],[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},pl_savefig={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},pl_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},array_toarray={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},plot_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},plot_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},plot_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},plot_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},plot_savefig={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},plot_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},numpy_shape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},numpy_reshape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},numpy_astype={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new external_Blockly_namespaceObject.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},pylab_imshow={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("展示图像"),this.appendDummyInput().appendField("颜色").appendField(new external_Blockly_namespaceObject.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},numpy_mean_digit={init:function(){this.setColour(DATA_HUE),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},numpy_argmin_template_match={init:function(){this.setColour(DATA_HUE),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},numpy_mean={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},numpy_std={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},pandas_dropna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},pandas_drop_columns={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Drops columns from dataframe.")}},numpy_ones={init:function(){this.setColour(DATA_HUE),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},numpy_c_={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("列拼接:数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},numpy_linalg_det={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},matrix_transpose={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},matrix_multiplication={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},numpy_linalg_inv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},dataframe_median={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},dataframe_fillna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new external_Blockly_namespaceObject.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},dataframe_info={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},numpy_min={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},numpy_max={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},numpy_size={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},numpy_dot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},numpy_square={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},numpy_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},numpy_random_random={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},py_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},dataframe_sort_values={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("排序方式").appendField(new external_Blockly_namespaceObject.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_head_tail={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("获取").appendField(new external_Blockly_namespaceObject.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_select={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_groupby={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_aggregate_func={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},DS_HUE=80,ds_create_linkedlist={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new external_Blockly_namespaceObject.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("ds_create_linkedlist_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:"name"),"KEY"+t).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ds_create_linkedlist_container={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},ds_create_linkedlist_item={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},ds_create_node={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_USE).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_TOOLTIP)}},ds_get_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},ds_set_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},ds_add_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_add_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_del_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_del_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_reverse_linkedlist={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},FACTORY_HUE="#777777",factory_from_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("from ").appendField(new external_Blockly_namespaceObject.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_function_noreturn={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("items",this.itemCount_);for(var t=0;tt?e[t]:'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},iot_publish_container={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},iot_publish_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_create_with_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_mixio_connect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIFI_USERNAME).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_IOT_PASSWORD).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PROJECT).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_MIXIO_PUBLISH={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(external_Blockly_namespaceObject.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},IOT_MIXIO_SUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_MSG).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},IOT_MIXIO_UNSUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MSG.stop+external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},iot_mixio_disconnect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_connect_only={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_check={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_format_topic={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},iot_mixio_format_msg={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},IOT_FORMATTING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},IOT_FORMAT_STRING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},IOT_EMQX_PING={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},IOT_MIXIO_NTP={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+external_Blockly_namespaceObject.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixly_key_py={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}},iot_mixly_key={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},iot_client_onboard={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},iot_http_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME).appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_http_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_mqtt_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_INIT_SUBSCRIBE).appendField(external_Blockly_namespaceObject.MQTT_Topic).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mqtt_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_onenetconnect=iot_onenet_connect,iot_onenetdisconnect=iot_onenet_disconnect,iot_checkonenet=iot_onenet_check,iot_publish=iot_onenet_publish,PINS_HUE=230,pins_digital_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},pins_digital_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},pins_analog_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},pins_analog_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},SERIAL_HUE=40,serial_open={init:function(){this.setColour(SERIAL_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN)).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SERIAL_BEGIN).appendField(new external_Blockly_namespaceObject.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},serial_write={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},serial_read_b={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},serial_close={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},SKLEARN_HUE=80,sklearn_make_classification={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_regression={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_blobs={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_load={init:function(){var e=[[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.LOAD).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"type").appendField(new external_Blockly_namespaceObject.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("name"))&&this.setTitleValue(t,"name")}},sklearn_data_target={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SET),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.EIGENVALUES,"data"],[external_Blockly_namespaceObject.Msg.LABEL_VALUE,"target"],[external_Blockly_namespaceObject.Msg.FEATURE,"feature_names"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_LinearRegression={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_Ridge={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_DecisionTreeClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_RandomForestClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KNeighborsClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KNN_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_GaussianNB={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KMeans={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_predict={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_coef_intercept={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck(null).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_COEF,"coef_"],[external_Blockly_namespaceObject.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_cluster_centers_labels_inertia={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[external_Blockly_namespaceObject.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_save_load_model={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("sklearn").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_SAVE_MODEL,"dump"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},SYSTEM_HUE=120,base_delay={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY+"("+external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_controls_millis={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},time_localtime={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},system_Panic_with_status_code={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("STATUS_CODE",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_reset={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},controls_mstimer2={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("TIME").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_start={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_stop={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},system_time_sleep={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},TURTLE_HUE=180,turtle_create={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_done={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_exitonclick={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_move={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_forward,"forward"],[external_Blockly_namespaceObject.Msg.blockpy_backward,"backward"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},turtle_rotate={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_left,"left"],[external_Blockly_namespaceObject.Msg.blockpy_right,"right"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_rotate).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{left:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[e]}))}},turtle_setheading={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_delay={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_goto={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_setxy={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},turtle_pos_shape={init:function(){this.setColour(TURTLE_HUE);var e=[[external_Blockly_namespaceObject.Msg.TURTLE_POS,"pos"],[external_Blockly_namespaceObject.Msg.TURTLE_SHAPE,"shape"],[external_Blockly_namespaceObject.Msg.TURTLE_HEADING,"heading"],[external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_POS_SHAPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR");var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pos:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[e]})),this.setOutput(!0),this.setInputsInline(!0)}},turtle_clear={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_reset,"reset"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_home,"home"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{clear:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[e]}))}},turtle_penup={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_penup,"penup"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{penup:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[e]}))}},turtle_fill={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_beginfill,"begin"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_endfill,"end"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{begin:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[e]}))}},turtle_size_speed={init:function(){this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"TUR");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_size,"pensize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pensize:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[e]}))}},turtle_size={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_size),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_speed={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_speed),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_circle={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_dot,"dot"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_draw).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{circle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[e]}))}},turtle_circle_advanced={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},turtle_visible={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_hide,"hideturtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{hideturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[e]}))}},turtle_bgcolor={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_clone={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_CLONE),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},turtle_bgcolor_hex_new={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR1").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_bgcolor_hex={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_shape={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_arrow,"arrow"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_turtle,"turtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_square,"square"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_triangle,"triangle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_shape).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_SHAPE_TOOLTIP)}},turtle_shapesize={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},turtle_numinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_NUMINPUT_TOOLTIP)}},turtle_textinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},turtle_write={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_color_seclet={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},turtle_getscreen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new external_Blockly_namespaceObject.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_onkey={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},turtle_onclick={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},turtle_ontimer={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},turtle_listen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_savefig={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},ai_AI_ChooseAndGet=function(e,t){var n=this.getFieldValue("TYPE");return t.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",t.ORDER_ATOMIC]},ai_AI_client=function(e,t){var n=this.getFieldValue("CTYPE");return t.definitions_.import_aip="import aip",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = aip."+n+"("+t.valueToCode(this,"API_KEY",t.ORDER_ATOMIC)+", "+t.valueToCode(this,"SECRET_KEY",t.ORDER_ATOMIC)+")\n"},ai_AI_Speech_synthesis=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".synthesis("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Speech_asr=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".asr("+(t.valueToCode(this,"FILE",t.ORDER_ATOMIC)||'""')+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Face_match=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".match("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Ocr=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Sim=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR1",t.ORDER_ATOMIC),_=t.valueToCode(this,"STR2",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+","+_+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Topic=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".topic("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},ai_AI_Nlp_newsSummary=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".newsSummary("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"LEN",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Ocr_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func_sim=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_audio=function(e,t){return t.definitions_.import_audio="import audio","audio.audio_record("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"TIME",t.ORDER_ATOMIC)||"0")+")\n"},ai_AI_photo=function(e,t){return t.definitions_.import_audio="import cam","cam.photo_capture("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"BUT",t.ORDER_ATOMIC)||'""')+")\n"},ai_AI_result=function(e,t){var n=t.valueToCode(this,"AI",t.ORDER_ASSIGNMENT)||"0",a=this.getFieldValue("CTYPE");if("Image"==a)var _=n+'["result"][0]["keyword"]';if("Speech"==a)_=n+'["result"][0]';if("Face"==a||"OcrSimilarity"==a)_=n+'["score"]';if("Ocr"==a)_=n+'["words_result"]';return[_,t.ORDER_ATOMIC]},algorithm_algorithm_prepare=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nfor i in house:\n i.hide()\n"},algorithm_algorithm_add_school=function(){return"path = [1]\ncar = sprite.Sprite('car', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},algorithm_algorithm_find_path=function(e,t){t.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},algorithm_algorithm_new_path=function(e,t){return["flag == 1",t.ORDER_ATOMIC]},algorithm_algorithm_set_path=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},algorithm_algorithm_add_path=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},algorithm_algorithm_del_path=function(e,t){t.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},algorithm_algorithm_return_path=function(){var e="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return e="house[f].hide()\ndrive(path[len(path) - 1])\n"+e},algorithm_algorithm_no_left=function(e,t){return["len(path) == 7",t.ORDER_ATOMIC]},algorithm_algorithm_print_path=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},algorithm_algorithm_prepare2=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nbarricade = sprite.Sprite('barricade', 570, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.hide()\n"},algorithm_algorithm_current_school=function(e,t){return["f == 1",t.ORDER_ATOMIC]},algorithm_algorithm_no_path=function(){return"print('没有符合条件的路线')\n"},algorithm_algorithm_prepare_2_1=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_prepare_2_2=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_move_recent=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]6:\n print("路线错乱!程序有误!")\n exit()\n'},algorithm_algorithm_not_home=function(e,t){return["name[now] != '小科家'",t.ORDER_ATOMIC]},algorithm_algorithm_not_school=function(e,t){return["name[now] != '学校'",t.ORDER_ATOMIC]},algorithm_algorithm_print_path2=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},algorithm_hanoi_init=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var a="print('层数过高!不得高于6层!')\nexit()\n";else a="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return a},algorithm_hanoi_move=function(e,t){var n=t.valueToCode(this,"FROM_NUM",t.ORDER_ATOMIC)||"0",a=t.valueToCode(this,"TO_NUM",t.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${a}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${a}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${a}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${a}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${a}*200+200, 400-len(_Hanoi[${a}])*27, 0.2)\n _Hanoi[${a}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},algorithm_algorithm_all_books_sequence=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},algorithm_algorithm_all_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},algorithm_algorithm_first_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},algorithm_algorithm_no_ring2=function(e,t){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",t.ORDER_ATOMIC]},algorithm_algorithm_yes_ring2=function(e,t){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",t.ORDER_ATOMIC]},algorithm_algorithm_next_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},algorithm_algorithm_two_left=function(e,t){return["len(list)>=2",t.ORDER_ATOMIC]},algorithm_algorithm_divide_books=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},algorithm_algorithm_get_half_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_delete_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_print_book2=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},algorithm_algorithm_book_scale=function(e,t){var n=this.getFieldValue("NUM");return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},algorithm_algorithm_number_zero=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},algorithm_algorithm_number_add=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},algorithm_algorithm_print_number=function(e,t){t.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},algorithm_algorithm_init_jttl=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},algorithm_algorithm_rabbit_zero=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},algorithm_algorithm_rabbit_number_in_range=function(e,t){return["_rabbit < _head",t.ORDER_ATOMIC]},algorithm_algorithm_chick_calculate=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},algorithm_algorithm_check_feet=function(e,t){return["_rabbit*4 + _chick*2 == _foot",t.ORDER_ATOMIC]},algorithm_algorithm_print_jttl_answer=function(e,t){t.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},algorithm_algorithm_rabbit_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},algorithm_algorithm_init_fzsf=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},algorithm_algorithm_fz_calc=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const a=[0,[1,3],[2,4],[5,7],[6]];var _="";return _+=`_S${n}.show()\ntime.sleep(1)\n`,_+=4!=n?`_Slen[${n}] = _Llen[${a[n][0]}] + _Llen[${a[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},algorithm_algorithm_fz_compare=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,t.ORDER_ATOMIC]},algorithm_algorithm_fz_set_min=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),a="";return a+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},algorithm_algorithm_fz_move=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},algorithm_algorithm_init_hxdb=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},algorithm_algorithm_hxdb_init_soldier=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},algorithm_algorithm_hxdb_stand_in_line=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},algorithm_algorithm_hxdb_last_line=function(e,t){return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,t.ORDER_ATOMIC]},algorithm_algorithm_hxdb_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},algorithm_algorithm_hxdb_result=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},algorithm_hanoi_init_offline=function(e,t){t.definitions_.import_turtle="import turtle",t.definitions_.import_time="import time",t.definitions_.import_math="import math";var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC),a=this.getFieldValue("NUM");return t.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",t.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",t.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a 1"}]`,t.ORDER_ATOMIC]},data_dataframe_groupby=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.groupby(by=${t.valueToCode(e,"KEY",t.ORDER_ATOMIC)||"'tag'"})`,t.ORDER_ATOMIC]},data_dataframe_aggregate_func=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.${e.getFieldValue("TYPE")}()`,t.ORDER_ATOMIC]},datastructure_ds_create_linkedlist=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("VAR"),external_Blockly_namespaceObject.Variables.NAME_TYPE),a=t.variableDB_.getName(this.getFieldValue("TYPE"),external_Blockly_namespaceObject.Variables.NAME_TYPE),_="class "+a+":\n";_+=" def __init__(self):\n";for(var l=new Array(this.itemCount_),s=0;spromptHelloHelloHello,HelloMixly2100,1,2,3051iDIVIDE10Exception as eetestThreadtestThreadWHILETRUEHello Mixly from Thread!1090x151100a10.998124.821100101010001100501100110000x2x0,1,2,30,1,2,30,1,2,3xMixlyHelloMixly65axMixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixpyI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')dirmylist1,2,3,4,5mylist0mylist02mylist00mylist0101mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistx0,1,2,30,1,2,3mytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}s11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2xreadme.txtffilename.txtfffilename.txtfMixlyfff0fffpathpathfilename.txtsrcname.txtdstname.txtfilename.txtpathff0reponsehttps://mixio.mixly.cnreponsehttps://mixio.mixly.cnreponsemixio.mixly.cnmixio.mixly.cnA1B2C3mixio.mixly.cnusernamepasswordMyProjecttopicmsgtopicmethodtopicmethodEQmsg1content"long""lat""message"012content"key1""key2""key3"012tina20tina90tina0tina2020tina50tinatinatinatinatinatina5tinatina225tina5#ff0000#FF0000tina#ff0000#FF0000tina#ff0000#FF0000tina#ff0000#FF0000#ff0000#FF0000tina#FF0000tina#FF0000tina#FF0000tina50tina50360tinascreenkeyfuncUpkeyfunctina100tina90screenclickfuncclickfunctinax20y20screentimerfunc3000timerfunctina100tina90screenscreenturtle.epstina10tinaMixly!tinaMixly!Arial8NUMInput a number:100100Input your nameWhat's your name?d:\\1.wav3d:\\1.jpgqclientEnter Your API_KEYEnter Your SECRET_KEYclient今天天气真好clientclientclientC:/mixly.jpgC:/mixpy.jpgclientclient我爱米思齐client米思齐米思皮client米思齐团队米思齐团队由一群具有共同理想的学生和老师组成,他们始终致力于为开展更好的创客教育而努力。client米思齐团队由一群具有共同理想的学生和老师组成,他们始终致力于为开展更好的创客教育而努力。20df1data.csvx1.55.50.50,1,2,3xmylistmylist0,1,2,3mydictmydict'a','b','c','d'mydict'ABCD''a','b','c','d'ser1ser10df1tagser1ser11,2,3,45,6,7,81,2,3,45,6,7,820,20,20,20tag1,2,3,45,6,7,8tag1,2,3,45,6,7,80.5tag0.25,0.35,0.1,0.3'a','b','c','d'0.2,0,0,011,21,31,41,51,61,71,81,910,20,40,60,80,100211Titleaxis1,2,3,41,2,3,415581.pngimg1.jpgfacehaarcascade_frontalface_default.xmlfaceRectsimgface1.15faceRectsimgface1.15100100200200Mixlyimg2.jpgimg0img001001003imgMixly020043 \ No newline at end of file +promptHelloHelloHello,HelloMixly2100,1,2,3051iDIVIDE10Exception as eetestThreadtestThreadWHILETRUEHello Mixly from Thread!1090x151100a10.998124.821100101010001100501100110000x2x0,1,2,30,1,2,30,1,2,3xMixlyHelloMixly65axMixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixpyI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')dirmylist1,2,3,4,5mylist0mylist02mylist00mylist0101mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistx0,1,2,30,1,2,3mytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}s11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2xreadme.txtffilename.txtfffilename.txtfMixlyfff0fffpathpathfilename.txtsrcname.txtdstname.txtfilename.txtpathff0reponsehttps://mixio.mixly.cnreponsehttps://mixio.mixly.cnreponsemixio.mixly.cnmixio.mixly.cnA1B2C3mixio.mixly.cnusernamepasswordMyProjecttopicmsgtopicmethodtopicmethodEQmsg1content"long""lat""message"012content"key1""key2""key3"012tina20tina90tina0tina2020tina50tinatinatinatinatinatina5tinatina225tina5#ff0000#FF0000tina#ff0000#FF0000tina#ff0000#FF0000tina#ff0000#FF0000#ff0000#FF0000tina#FF0000tina#FF0000tina#FF0000tina50tina50360tinascreenkeyfuncUpkeyfunctina100tina90screenclickfuncclickfunctinax20y20screentimerfunc3000timerfunctina100tina90screenscreenturtle.epstina10tinaMixly!tinaMixly!Arial8NUMInput a number:100100Input your nameWhat's your name?d:\\1.wav3d:\\1.jpgqclientEnter Your API_KEYEnter Your SECRET_KEYclient今天天气真好clientclientclientC:/mixly.jpgC:/mixpy.jpgclientclient我爱米思齐client米思齐米思皮client米思齐团队米思齐团队由一群具有共同理想的学生和老师组成,他们始终致力于为开展更好的创客教育而努力。client米思齐团队由一群具有共同理想的学生和老师组成,他们始终致力于为开展更好的创客教育而努力。20df1data.csvx1.55.50.50,1,2,3xmylistmylist0,1,2,3mydictmydict'a','b','c','d'mydict'ABCD''a','b','c','d'ser1ser10df1tagdf1tagdf11df1GTcolumndf1tag1df1tagmindf1columndf1tagser1ser11,2,3,45,6,7,81,2,3,45,6,7,820,20,20,20tag1,2,3,45,6,7,8tag1,2,3,45,6,7,80.5tag0.25,0.35,0.1,0.3'a','b','c','d'0.2,0,0,011,21,31,41,51,61,71,81,910,20,40,60,80,100211Titleaxis1,2,3,41,2,3,415581.pngimg1.jpgfacehaarcascade_frontalface_default.xmlfaceRectsimgface1.15faceRectsimgface1.15100100200200Mixlyimg2.jpgimg0img001001003imgMixly020043 \ No newline at end of file diff --git a/boards/default/python_pyodide/main.bundle.js b/boards/default/python_pyodide/main.bundle.js index 7730c72f..066389c5 100644 --- a/boards/default/python_pyodide/main.bundle.js +++ b/boards/default/python_pyodide/main.bundle.js @@ -1,4 +1,4 @@ -(()=>{"use strict";var __webpack_modules__={936:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});const cv_read_image=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.imread("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_show_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imshow("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_write_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imwrite("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_waitkey=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.waitKey("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+")\n"},cv_destroy_all=function(e,t){t.definitions_.import_cv2="import cv2";return"cv2.destroyAllWindows()\n"},cv_line_rect=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),x2=generator.valueToCode(this,"x2",generator.ORDER_ATOMIC),y2=generator.valueToCode(this,"y2",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),direction=this.getFieldValue("DIR"),code="cv2."+direction+"("+file+",("+x1+","+y1+"),("+x2+","+y2+"),("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_text=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),data=generator.valueToCode(this,"data",generator.ORDER_ATOMIC),size=generator.valueToCode(this,"size",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),font=this.getFieldValue("font"),code="cv2.putText("+file+","+data+",("+x1+","+y1+"),cv2.FONT_HERSHEY_"+font+","+size+",("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_face_classifier=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.CascadeClassifier("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect_all=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+",minSize=("+t.valueToCode(this,"x1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y1",t.ORDER_ATOMIC)+"),maxSize=("+t.valueToCode(this,"x2",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y2",t.ORDER_ATOMIC)+"))",t.ORDER_ATOMIC]}},9610:(e,t,n)=>{n.d(t,{D:()=>a});var a=function(){function e(e){var t=this;void 0===e&&(e=!1),this.ignoreMultipleSettles=e,this.isSettled=!1,this.promise=new Promise((function(e,n){t.resolveCallback=e,t.rejectCallback=n}))}return e.prototype.markAsSettled=function(){var e=this.isSettled;if(e&&!this.ignoreMultipleSettles)throw new Error("PromiseDelegate is already settled!");return this.isSettled=!0,!e},Object.defineProperty(e.prototype,"settled",{get:function(){return this.isSettled},enumerable:!1,configurable:!0}),e.prototype.resolve=function(e){this.markAsSettled()&&this.resolveCallback(e)},e.prototype.reject=function(e){this.markAsSettled()&&this.rejectCallback(e)},e}()},6944:e=>{e.exports=path}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var a={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var _=2&t&&e;"object"==typeof _&&!~leafPrototypes.indexOf(_);_=getProto(_))Object.getOwnPropertyNames(_).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,__webpack_require__.d(n,a),n},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((t,n)=>(__webpack_require__.f[n](e,t),t)),[])),__webpack_require__.u=e=>e+".bundle.js",__webpack_require__.miniCssF=e=>"styles/"+e+"."+__webpack_require__.h().slice(0,8)+".css",__webpack_require__.h=()=>"d64c03533f658f5d6886",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),inProgress={},dataWebpackPrefix="@mixly/python-pyodide:",__webpack_require__.l=(e,t,n,a)=>{if(inProgress[e])inProgress[e].push(t);else{var _,l;if(void 0!==n)for(var s=document.getElementsByTagName("script"),i=0;i{_.onerror=_.onload=null,clearTimeout(p);var a=inProgress[e];if(delete inProgress[e],_.parentNode&&_.parentNode.removeChild(_),a&&a.forEach((e=>e(n))),t)return t(n)},p=setTimeout(r.bind(null,void 0,{type:"timeout",target:_}),12e4);_.onerror=r.bind(null,_.onerror),_.onload=r.bind(null,_.onload),l&&document.head.appendChild(_)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{if("undefined"!=typeof document){var e=e=>new Promise(((t,n)=>{var a=__webpack_require__.miniCssF(e),_=__webpack_require__.p+a;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),a=0;a{var l=document.createElement("link");l.rel="stylesheet",l.type="text/css",__webpack_require__.nc&&(l.nonce=__webpack_require__.nc),l.onerror=l.onload=n=>{if(l.onerror=l.onload=null,"load"===n.type)a();else{var s=n&&n.type,i=n&&n.target&&n.target.href||t,o=new Error("Loading CSS chunk "+e+" failed.\n("+s+": "+i+")");o.name="ChunkLoadError",o.code="CSS_CHUNK_LOAD_FAILED",o.type=s,o.request=i,l.parentNode&&l.parentNode.removeChild(l),_(o)}},l.href=t,n?n.parentNode.insertBefore(l,n.nextSibling):document.head.appendChild(l)})(e,_,null,t,n)})),t={792:0};__webpack_require__.f.miniCss=(n,a)=>{t[n]?a.push(t[n]):0!==t[n]&&{317:1}[n]&&a.push(t[n]=e(n).then((()=>{t[n]=0}),(e=>{throw delete t[n],e})))}}})(),(()=>{var e={792:0};__webpack_require__.f.j=(t,n)=>{var a=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==a)if(a)n.push(a[2]);else{var _=new Promise(((n,_)=>a=e[t]=[n,_]));n.push(a[2]=_);var l=__webpack_require__.p+__webpack_require__.u(t),s=new Error;__webpack_require__.l(l,(n=>{if(__webpack_require__.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var _=n&&("load"===n.type?"missing":n.type),l=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+_+": "+l+")",s.name="ChunkLoadError",s.type=_,s.request=l,a[1](s)}}),"chunk-"+t,t)}};var t=(t,n)=>{var a,_,[l,s,i]=n,o=0;if(l.some((t=>0!==e[t]))){for(a in s)__webpack_require__.o(s,a)&&(__webpack_require__.m[a]=s[a]);if(i)i(__webpack_require__)}for(t&&t(n);ocontrols_type,controls_typeLists:()=>controls_typeLists,variables_change:()=>variables_change,variables_get:()=>variables_get,variables_global:()=>variables_global,variables_set:()=>variables_set});var control_namespaceObject={};__webpack_require__.r(control_namespaceObject),__webpack_require__.d(control_namespaceObject,{base_setup:()=>base_setup,controls_delay:()=>controls_delay,controls_end_program:()=>controls_end_program,controls_except:()=>controls_except,controls_finally:()=>controls_finally,controls_flow_statements:()=>controls_flow_statements,controls_for:()=>controls_for,controls_forEach:()=>controls_forEach,controls_for_range:()=>controls_for_range,controls_if:()=>controls_if,controls_if_else:()=>controls_if_else,controls_if_elseif:()=>controls_if_elseif,controls_if_if:()=>controls_if_if,controls_lambda:()=>controls_lambda,controls_main:()=>controls_main,controls_pass:()=>controls_pass,controls_range:()=>controls_range,controls_repeat_ext:()=>controls_repeat_ext,controls_thread:()=>controls_thread,controls_try:()=>controls_try,controls_try_finally:()=>controls_try_finally,controls_whileUntil:()=>controls_whileUntil,do_while:()=>do_while,garbage_collection:()=>garbage_collection,get_mem_alloc:()=>get_mem_alloc,get_mem_free:()=>get_mem_free});var math_namespaceObject={};__webpack_require__.r(math_namespaceObject),__webpack_require__.d(math_namespaceObject,{base_map:()=>base_map,math_arithmetic:()=>math_arithmetic,math_bit:()=>math_bit,math_constant:()=>math_constant,math_constant_mp:()=>math_constant_mp,math_constrain:()=>math_constrain,math_dec:()=>math_dec,math_indexer_number:()=>math_indexer_number,math_map:()=>math_map,math_max_min:()=>math_max_min,math_number:()=>math_number,math_number_base_conversion:()=>math_number_base_conversion,math_random:()=>math_random,math_random_seed:()=>math_random_seed,math_round:()=>math_round,math_selfcalcu:()=>math_selfcalcu,math_to_int:()=>math_to_int,math_trig:()=>math_trig,text_to_number:()=>text_to_number,text_to_number_skulpt:()=>text_to_number_skulpt});var text_namespaceObject={};__webpack_require__.r(text_namespaceObject),__webpack_require__.d(text_namespaceObject,{ascii_to_char:()=>ascii_to_char,char_to_ascii:()=>char_to_ascii,number_to_text:()=>number_to_text,os_system:()=>os_system,text:()=>text_text,text_capital:()=>text_capital,text_center:()=>text_center,text_char:()=>text_char,text_char_at:()=>text_char_at,text_char_at2:()=>text_char_at2,text_char_at3:()=>text_char_at3,text_compareTo:()=>text_compareTo,text_compare_to:()=>text_compare_to,text_create_with_container:()=>text_create_with_container,text_create_with_item:()=>text_create_with_item,text_encode:()=>text_encode,text_equals_starts_ends:()=>text_equals_starts_ends,text_eval:()=>text_eval,text_find:()=>text_find,text_format:()=>text_format,text_format_noreturn:()=>text_format_noreturn,text_join:()=>text_join,text_join_seq:()=>text_join_seq,text_length:()=>text_length,text_random_char:()=>text_random_char,text_replace:()=>text_replace,text_split:()=>text_split,text_strip:()=>text_strip,text_substring:()=>text_substring,text_substring2:()=>text_substring2,text_substring3:()=>text_substring3,text_textarea:()=>text_textarea});var lists_namespaceObject={};__webpack_require__.r(lists_namespaceObject),__webpack_require__.d(lists_namespaceObject,{list_many_input:()=>list_many_input,list_tolist:()=>list_tolist,list_tolist2:()=>list_tolist2,list_trig:()=>list_trig,lists_2d_get_col_row_data:()=>lists_2d_get_col_row_data,lists_2d_get_data_with_col_row:()=>lists_2d_get_data_with_col_row,lists_append_extend:()=>lists_append_extend,lists_change_to:()=>lists_change_to,lists_change_to_general:()=>lists_change_to_general,lists_clear:()=>lists_clear,lists_create_with:()=>lists_create_with,lists_create_with2:()=>lists_create_with2,lists_create_with_container:()=>lists_create_with_container,lists_create_with_item:()=>lists_create_with_item,lists_create_with_noreturn:()=>lists_create_with_noreturn,lists_create_with_text:()=>lists_create_with_text,lists_create_with_text2:()=>lists_create_with_text2,lists_del_general:()=>lists_del_general,lists_find:()=>lists_find,lists_getIndex3:()=>lists_getIndex3,lists_getSublist3:()=>lists_getSublist3,lists_get_index:()=>lists_get_index,lists_get_random_item:()=>lists_get_random_item,lists_get_random_sublist:()=>lists_get_random_sublist,lists_get_sublist:()=>lists_get_sublist,lists_insert_value:()=>lists_insert_value,lists_insert_value2:()=>lists_insert_value2,lists_pop:()=>lists_pop,lists_remove_at:()=>lists_remove_at,lists_remove_at2:()=>lists_remove_at2,lists_reverse:()=>lists_reverse,lists_setIndex3:()=>lists_setIndex3,lists_set_index:()=>lists_set_index,lists_sort:()=>lists_sort,lists_zip:()=>lists_zip,lists_zip_container:()=>lists_zip_container,lists_zip_item:()=>lists_zip_item});var dicts_namespaceObject={};__webpack_require__.r(dicts_namespaceObject),__webpack_require__.d(dicts_namespaceObject,{dicts_add_change_del:()=>dicts_add_change_del,dicts_add_or_change:()=>dicts_add_or_change,dicts_clear:()=>dicts_clear,dicts_create_with:()=>dicts_create_with,dicts_create_with_container:()=>dicts_create_with_container,dicts_create_with_item:()=>dicts_create_with_item,dicts_create_with_noreturn:()=>dicts_create_with_noreturn,dicts_deldict:()=>dicts_deldict,dicts_delete:()=>dicts_delete,dicts_get:()=>dicts_get,dicts_get_default:()=>dicts_get_default,dicts_items:()=>dicts_items,dicts_keys:()=>dicts_keys,dicts_length:()=>dicts_length,dicts_pop:()=>dicts_pop,dicts_setdefault:()=>dicts_setdefault,dicts_to_json:()=>dicts_to_json,dicts_todict:()=>dicts_todict,dicts_update:()=>dicts_update,dicts_values:()=>dicts_values,json_to_dicts:()=>json_to_dicts});var logic_namespaceObject={};__webpack_require__.r(logic_namespaceObject),__webpack_require__.d(logic_namespaceObject,{logic_boolean:()=>logic_boolean,logic_compare:()=>logic_compare,logic_compare_continous:()=>logic_compare_continous,logic_is:()=>logic_is,logic_is_in:()=>logic_is_in,logic_negate:()=>logic_negate,logic_null:()=>logic_null,logic_operation:()=>logic_operation,logic_tobool:()=>logic_tobool,logic_true_or_false:()=>logic_true_or_false});var storage_namespaceObject={};__webpack_require__.r(storage_namespaceObject),__webpack_require__.d(storage_namespaceObject,{sdcard_mount:()=>sdcard_mount,sdcard_use_spi_init:()=>sdcard_use_spi_init,storage_can_write_ornot:()=>storage_can_write_ornot,storage_change_dir:()=>storage_change_dir,storage_close_file:()=>storage_close_file,storage_delete_file:()=>storage_delete_file,storage_file_seek:()=>storage_file_seek,storage_file_tell:()=>storage_file_tell,storage_file_write:()=>storage_file_write,storage_fileopen:()=>storage_fileopen,storage_fileopen_new:()=>storage_fileopen_new,storage_fileopen_new_encoding:()=>storage_fileopen_new_encoding,storage_get_a_line:()=>storage_get_a_line,storage_get_contents:()=>storage_get_contents,storage_get_contents_without_para:()=>storage_get_contents_without_para,storage_get_current_dir:()=>storage_get_current_dir,storage_get_file_size:()=>storage_get_file_size,storage_get_filename:()=>storage_get_filename,storage_is_file:()=>storage_is_file,storage_list_all_files:()=>storage_list_all_files,storage_make_dir:()=>storage_make_dir,storage_open_file_with_os:()=>storage_open_file_with_os,storage_rename:()=>storage_rename});var blocks_procedures_namespaceObject={};__webpack_require__.r(blocks_procedures_namespaceObject),__webpack_require__.d(blocks_procedures_namespaceObject,{procedures_callnoreturn:()=>procedures_callnoreturn,procedures_callreturn:()=>procedures_callreturn,procedures_defnoreturn:()=>procedures_defnoreturn,procedures_defreturn:()=>procedures_defreturn,procedures_ifreturn:()=>procedures_ifreturn,procedures_mutatorarg:()=>procedures_mutatorarg,procedures_mutatorcontainer:()=>procedures_mutatorcontainer,procedures_return:()=>procedures_return});var tuple_namespaceObject={};__webpack_require__.r(tuple_namespaceObject),__webpack_require__.d(tuple_namespaceObject,{tuple_change_to:()=>tuple_change_to,tuple_create_with:()=>tuple_create_with,tuple_create_with_container:()=>tuple_create_with_container,tuple_create_with_item:()=>tuple_create_with_item,tuple_create_with_noreturn:()=>tuple_create_with_noreturn,tuple_create_with_text2:()=>tuple_create_with_text2,tuple_create_with_text_return:()=>tuple_create_with_text_return,tuple_del:()=>tuple_del,tuple_find:()=>tuple_find,tuple_getIndex:()=>tuple_getIndex,tuple_getSublist:()=>tuple_getSublist,tuple_get_random_item:()=>tuple_get_random_item,tuple_get_sublist:()=>tuple_get_sublist,tuple_join:()=>tuple_join,tuple_length:()=>tuple_length,tuple_max:()=>tuple_max,tuple_totuple:()=>tuple_totuple,tuple_trig:()=>tuple_trig});var set_namespaceObject={};__webpack_require__.r(set_namespaceObject),__webpack_require__.d(set_namespaceObject,{set_add_discard:()=>set_add_discard,set_clear:()=>set_clear,set_create_with:()=>set_create_with,set_create_with_container:()=>set_create_with_container,set_create_with_item:()=>set_create_with_item,set_create_with_text_return:()=>set_create_with_text_return,set_length:()=>set_length,set_operate:()=>set_operate,set_operate_update:()=>set_operate_update,set_pop:()=>set_pop,set_sub:()=>set_sub,set_toset:()=>set_toset,set_update:()=>set_update});var html_namespaceObject={};__webpack_require__.r(html_namespaceObject),__webpack_require__.d(html_namespaceObject,{html_content:()=>html_content,html_content_more:()=>html_content_more,html_document:()=>html_document,html_form:()=>html_form,html_head_body:()=>html_head_body,html_style:()=>html_style,html_style_color:()=>html_style_color,html_style_content:()=>html_style_content,html_text:()=>html_text,html_title:()=>html_title});var utility_namespaceObject={};__webpack_require__.r(utility_namespaceObject),__webpack_require__.d(utility_namespaceObject,{attribute_access:()=>attribute_access,function_call:()=>function_call,function_call_container:()=>function_call_container,function_call_item:()=>function_call_item,raw_block:()=>raw_block,raw_empty:()=>raw_empty,raw_expression:()=>raw_expression,raw_table:()=>raw_table,text_comment:()=>text_comment,text_print_multiple:()=>text_print_multiple,text_print_multiple_container:()=>text_print_multiple_container,text_print_multiple_item:()=>text_print_multiple_item,type_check:()=>type_check});var generators_variables_namespaceObject={};__webpack_require__.r(generators_variables_namespaceObject),__webpack_require__.d(generators_variables_namespaceObject,{controls_type:()=>variables_controls_type,controls_typeLists:()=>variables_controls_typeLists,variables_change:()=>variables_variables_change,variables_get:()=>variables_variables_get,variables_global:()=>variables_variables_global,variables_set:()=>variables_variables_set});var generators_control_namespaceObject={};__webpack_require__.r(generators_control_namespaceObject),__webpack_require__.d(generators_control_namespaceObject,{Panic_with_status_code:()=>Panic_with_status_code,base_setup:()=>control_base_setup,controls_delay:()=>control_controls_delay,controls_flow_statements:()=>control_controls_flow_statements,controls_for:()=>control_controls_for,controls_forEach:()=>control_controls_forEach,controls_for_range:()=>control_controls_for_range,controls_if:()=>control_controls_if,controls_interrupts:()=>controls_interrupts,controls_lambda:()=>control_controls_lambda,controls_main:()=>control_controls_main,controls_millis:()=>controls_millis,controls_nointerrupts:()=>controls_nointerrupts,controls_pass:()=>control_controls_pass,controls_range:()=>control_controls_range,controls_repeat:()=>controls_repeat,controls_repeat_ext:()=>control_controls_repeat_ext,controls_thread:()=>control_controls_thread,controls_try_finally:()=>control_controls_try_finally,controls_whileUntil:()=>control_controls_whileUntil,do_while:()=>control_do_while,garbage_collection:()=>control_garbage_collection,get_mem_alloc:()=>control_get_mem_alloc,get_mem_free:()=>control_get_mem_free,reset:()=>control_reset,time_sleep:()=>time_sleep});var generators_math_namespaceObject={};__webpack_require__.r(generators_math_namespaceObject),__webpack_require__.d(generators_math_namespaceObject,{base_map:()=>math_base_map,math_arithmetic:()=>math_math_arithmetic,math_bit:()=>math_math_bit,math_constant:()=>math_math_constant,math_constant_mp:()=>math_math_constant_mp,math_constrain:()=>math_math_constrain,math_dec:()=>math_math_dec,math_indexer_number:()=>math_math_indexer_number,math_map:()=>math_math_map,math_max_min:()=>math_math_max_min,math_number:()=>math_math_number,math_number_base_conversion:()=>math_math_number_base_conversion,math_random:()=>math_math_random,math_random_seed:()=>math_math_random_seed,math_round:()=>math_math_round,math_selfcalcu:()=>math_math_selfcalcu,math_single:()=>math_single,math_to_int:()=>math_math_to_int,math_trig:()=>math_math_trig,text_to_number:()=>math_text_to_number,text_to_number_skulpt:()=>math_text_to_number_skulpt});var generators_text_namespaceObject={};__webpack_require__.r(generators_text_namespaceObject),__webpack_require__.d(generators_text_namespaceObject,{ascii_to_char:()=>text_ascii_to_char,char_to_ascii:()=>text_char_to_ascii,number_to_text:()=>text_number_to_text,os_system:()=>text_os_system,text:()=>generators_text_text,text_capital:()=>text_text_capital,text_center:()=>text_text_center,text_char:()=>text_text_char,text_char_at:()=>text_text_char_at,text_char_at2:()=>text_text_char_at2,text_char_at3:()=>text_text_char_at3,text_compareTo:()=>text_text_compareTo,text_compare_to:()=>text_text_compare_to,text_encode:()=>text_text_encode,text_equals_starts_ends:()=>text_text_equals_starts_ends,text_eval:()=>text_text_eval,text_find:()=>text_text_find,text_format:()=>text_text_format,text_format_noreturn:()=>text_text_format_noreturn,text_join:()=>text_text_join,text_join_seq:()=>text_text_join_seq,text_length:()=>text_text_length,text_random_char:()=>text_text_random_char,text_replace:()=>text_text_replace,text_split:()=>text_text_split,text_strip:()=>text_text_strip,text_substring:()=>text_text_substring,text_substring2:()=>text_text_substring2,text_substring3:()=>text_text_substring3,text_textarea:()=>text_text_textarea});var generators_lists_namespaceObject={};__webpack_require__.r(generators_lists_namespaceObject),__webpack_require__.d(generators_lists_namespaceObject,{list_many_input:()=>lists_list_many_input,list_tolist:()=>lists_list_tolist,list_tolist2:()=>lists_list_tolist2,list_trig:()=>lists_list_trig,lists_2d_get_col_row_data:()=>lists_lists_2d_get_col_row_data,lists_2d_get_data_with_col_row:()=>lists_lists_2d_get_data_with_col_row,lists_append_extend:()=>lists_lists_append_extend,lists_change_to:()=>lists_lists_change_to,lists_change_to_general:()=>lists_lists_change_to_general,lists_clear:()=>lists_lists_clear,lists_create_with:()=>lists_lists_create_with,lists_create_with2:()=>lists_lists_create_with2,lists_create_with_noreturn:()=>lists_lists_create_with_noreturn,lists_create_with_text:()=>lists_lists_create_with_text,lists_create_with_text2:()=>lists_lists_create_with_text2,lists_del_general:()=>lists_lists_del_general,lists_find:()=>lists_lists_find,lists_getIndex3:()=>lists_lists_getIndex3,lists_getSublist3:()=>lists_lists_getSublist3,lists_get_index:()=>lists_lists_get_index,lists_get_random_item:()=>lists_lists_get_random_item,lists_get_random_sublist:()=>lists_lists_get_random_sublist,lists_get_sublist:()=>lists_lists_get_sublist,lists_insert_value:()=>lists_lists_insert_value,lists_insert_value2:()=>lists_lists_insert_value2,lists_pop:()=>lists_lists_pop,lists_remove_at:()=>lists_lists_remove_at,lists_remove_at2:()=>lists_lists_remove_at2,lists_reverse:()=>lists_lists_reverse,lists_setIndex3:()=>lists_lists_setIndex3,lists_set_index:()=>lists_lists_set_index,lists_sort:()=>lists_lists_sort,lists_zip:()=>lists_lists_zip});var generators_dicts_namespaceObject={};__webpack_require__.r(generators_dicts_namespaceObject),__webpack_require__.d(generators_dicts_namespaceObject,{dicts_add_change_del:()=>dicts_dicts_add_change_del,dicts_add_or_change:()=>dicts_dicts_add_or_change,dicts_clear:()=>dicts_dicts_clear,dicts_create_with:()=>dicts_dicts_create_with,dicts_create_with_noreturn:()=>dicts_dicts_create_with_noreturn,dicts_deldict:()=>dicts_dicts_deldict,dicts_delete:()=>dicts_dicts_delete,dicts_get:()=>dicts_dicts_get,dicts_get_default:()=>dicts_dicts_get_default,dicts_items:()=>dicts_dicts_items,dicts_keys:()=>dicts_dicts_keys,dicts_length:()=>dicts_dicts_length,dicts_pop:()=>dicts_dicts_pop,dicts_setdefault:()=>dicts_dicts_setdefault,dicts_to_json:()=>dicts_dicts_to_json,dicts_todict:()=>dicts_dicts_todict,dicts_update:()=>dicts_dicts_update,dicts_values:()=>dicts_dicts_values,json_to_dicts:()=>dicts_json_to_dicts});var generators_logic_namespaceObject={};__webpack_require__.r(generators_logic_namespaceObject),__webpack_require__.d(generators_logic_namespaceObject,{logic_boolean:()=>logic_logic_boolean,logic_compare:()=>logic_logic_compare,logic_compare_continous:()=>logic_logic_compare_continous,logic_is:()=>logic_logic_is,logic_is_in:()=>logic_logic_is_in,logic_negate:()=>logic_logic_negate,logic_null:()=>logic_logic_null,logic_operation:()=>logic_logic_operation,logic_tobool:()=>logic_logic_tobool,logic_true_or_false:()=>logic_logic_true_or_false});var generators_storage_namespaceObject={};__webpack_require__.r(generators_storage_namespaceObject),__webpack_require__.d(generators_storage_namespaceObject,{sdcard_mount:()=>storage_sdcard_mount,sdcard_use_spi_init:()=>storage_sdcard_use_spi_init,storage_can_write_ornot:()=>storage_storage_can_write_ornot,storage_change_dir:()=>storage_storage_change_dir,storage_close_file:()=>storage_storage_close_file,storage_delete_file:()=>storage_storage_delete_file,storage_file_seek:()=>storage_storage_file_seek,storage_file_tell:()=>storage_storage_file_tell,storage_file_write:()=>storage_storage_file_write,storage_fileopen:()=>storage_storage_fileopen,storage_fileopen_new:()=>storage_storage_fileopen_new,storage_fileopen_new_encoding:()=>storage_storage_fileopen_new_encoding,storage_get_a_line:()=>storage_storage_get_a_line,storage_get_contents:()=>storage_storage_get_contents,storage_get_contents_without_para:()=>storage_storage_get_contents_without_para,storage_get_current_dir:()=>storage_storage_get_current_dir,storage_get_file_size:()=>storage_storage_get_file_size,storage_get_filename:()=>storage_storage_get_filename,storage_is_file:()=>storage_storage_is_file,storage_list_all_files:()=>storage_storage_list_all_files,storage_make_dir:()=>storage_storage_make_dir,storage_open_file_with_os:()=>storage_storage_open_file_with_os,storage_rename:()=>storage_storage_rename});var generators_procedures_namespaceObject={};__webpack_require__.r(generators_procedures_namespaceObject),__webpack_require__.d(generators_procedures_namespaceObject,{procedures_callnoreturn:()=>procedures_procedures_callnoreturn,procedures_callreturn:()=>procedures_procedures_callreturn,procedures_defnoreturn:()=>procedures_procedures_defnoreturn,procedures_defreturn:()=>procedures_procedures_defreturn,procedures_ifreturn:()=>procedures_procedures_ifreturn,procedures_return:()=>procedures_procedures_return});var generators_tuple_namespaceObject={};__webpack_require__.r(generators_tuple_namespaceObject),__webpack_require__.d(generators_tuple_namespaceObject,{tuple_change_to:()=>tuple_tuple_change_to,tuple_create_with:()=>tuple_tuple_create_with,tuple_create_with_noreturn:()=>tuple_tuple_create_with_noreturn,tuple_create_with_text2:()=>tuple_tuple_create_with_text2,tuple_create_with_text_return:()=>tuple_tuple_create_with_text_return,tuple_del:()=>tuple_tuple_del,tuple_find:()=>tuple_tuple_find,tuple_getIndex:()=>tuple_tuple_getIndex,tuple_getSublist:()=>tuple_tuple_getSublist,tuple_get_random_item:()=>tuple_tuple_get_random_item,tuple_get_sublist:()=>tuple_tuple_get_sublist,tuple_join:()=>tuple_tuple_join,tuple_length:()=>tuple_tuple_length,tuple_max:()=>tuple_tuple_max,tuple_totuple:()=>tuple_tuple_totuple,tuple_trig:()=>tuple_tuple_trig});var generators_set_namespaceObject={};__webpack_require__.r(generators_set_namespaceObject),__webpack_require__.d(generators_set_namespaceObject,{set_add_discard:()=>set_set_add_discard,set_clear:()=>set_set_clear,set_create_with:()=>set_set_create_with,set_create_with_text_return:()=>set_set_create_with_text_return,set_length:()=>set_set_length,set_operate:()=>set_set_operate,set_operate_update:()=>set_set_operate_update,set_pop:()=>set_set_pop,set_sub:()=>set_set_sub,set_toset:()=>set_set_toset,set_update:()=>set_set_update});var generators_html_namespaceObject={};__webpack_require__.r(generators_html_namespaceObject),__webpack_require__.d(generators_html_namespaceObject,{html_content:()=>html_html_content,html_content_more:()=>html_html_content_more,html_document:()=>html_html_document,html_form:()=>html_html_form,html_head_body:()=>html_html_head_body,html_style:()=>html_html_style,html_style_content:()=>html_html_style_content,html_text:()=>html_html_text,html_title:()=>html_html_title});var generators_utility_namespaceObject={};__webpack_require__.r(generators_utility_namespaceObject),__webpack_require__.d(generators_utility_namespaceObject,{attribute_access:()=>utility_attribute_access,function_call:()=>utility_function_call,raw_block:()=>utility_raw_block,raw_empty:()=>utility_raw_empty,raw_expression:()=>utility_raw_expression,raw_table:()=>utility_raw_table,type_check:()=>utility_type_check});var ai_namespaceObject={};__webpack_require__.r(ai_namespaceObject),__webpack_require__.d(ai_namespaceObject,{AI_ChooseAndGet:()=>AI_ChooseAndGet,AI_Face_match:()=>AI_Face_match,AI_ImageClassify:()=>AI_ImageClassify,AI_ImageClassify_Func:()=>AI_ImageClassify_Func,AI_Nlp:()=>AI_Nlp,AI_Nlp_Func:()=>AI_Nlp_Func,AI_Nlp_Func_sim:()=>AI_Nlp_Func_sim,AI_Nlp_Sim:()=>AI_Nlp_Sim,AI_Nlp_Topic:()=>AI_Nlp_Topic,AI_Nlp_newsSummary:()=>AI_Nlp_newsSummary,AI_Ocr:()=>AI_Ocr,AI_Ocr_Func:()=>AI_Ocr_Func,AI_Speech_asr:()=>AI_Speech_asr,AI_Speech_synthesis:()=>AI_Speech_synthesis,AI_audio:()=>AI_audio,AI_client:()=>AI_client,AI_photo:()=>AI_photo,AI_result:()=>AI_result});var algorithm_namespaceObject={};__webpack_require__.r(algorithm_namespaceObject),__webpack_require__.d(algorithm_namespaceObject,{algorithm_add_path:()=>algorithm_add_path,algorithm_add_school:()=>algorithm_add_school,algorithm_all_books:()=>algorithm_all_books,algorithm_all_books_sequence:()=>algorithm_all_books_sequence,algorithm_book_scale:()=>algorithm_book_scale,algorithm_check_feet:()=>algorithm_check_feet,algorithm_chick_calculate:()=>algorithm_chick_calculate,algorithm_color_seclet:()=>algorithm_color_seclet,algorithm_current_school:()=>algorithm_current_school,algorithm_del_path:()=>algorithm_del_path,algorithm_delete_book:()=>algorithm_delete_book,algorithm_delete_books:()=>algorithm_delete_books,algorithm_delete_books2:()=>algorithm_delete_books2,algorithm_divide_books:()=>algorithm_divide_books,algorithm_find_path:()=>algorithm_find_path,algorithm_first_book:()=>algorithm_first_book,algorithm_fz_calc:()=>algorithm_fz_calc,algorithm_fz_calc_first_min:()=>algorithm_fz_calc_first_min,algorithm_fz_compare:()=>algorithm_fz_compare,algorithm_fz_move:()=>algorithm_fz_move,algorithm_fz_set_min:()=>algorithm_fz_set_min,algorithm_get_book_num:()=>algorithm_get_book_num,algorithm_get_current_location:()=>algorithm_get_current_location,algorithm_get_half_books:()=>algorithm_get_half_books,algorithm_hxdb_add:()=>algorithm_hxdb_add,algorithm_hxdb_init_soldier:()=>algorithm_hxdb_init_soldier,algorithm_hxdb_last_line:()=>algorithm_hxdb_last_line,algorithm_hxdb_result:()=>algorithm_hxdb_result,algorithm_hxdb_stand_in_line:()=>algorithm_hxdb_stand_in_line,algorithm_init_fzsf:()=>algorithm_init_fzsf,algorithm_init_hxdb:()=>algorithm_init_hxdb,algorithm_init_jttl:()=>algorithm_init_jttl,algorithm_move_recent:()=>algorithm_move_recent,algorithm_new_path:()=>algorithm_new_path,algorithm_next_book:()=>algorithm_next_book,algorithm_no_left:()=>algorithm_no_left,algorithm_no_path:()=>algorithm_no_path,algorithm_no_ring2:()=>algorithm_no_ring2,algorithm_not_home:()=>algorithm_not_home,algorithm_not_school:()=>algorithm_not_school,algorithm_number_add:()=>algorithm_number_add,algorithm_number_zero:()=>algorithm_number_zero,algorithm_prepare:()=>algorithm_prepare,algorithm_prepare2:()=>algorithm_prepare2,algorithm_prepare_2_1:()=>algorithm_prepare_2_1,algorithm_prepare_2_2:()=>algorithm_prepare_2_2,algorithm_print_book2:()=>algorithm_print_book2,algorithm_print_divide:()=>algorithm_print_divide,algorithm_print_jttl_answer:()=>algorithm_print_jttl_answer,algorithm_print_number:()=>algorithm_print_number,algorithm_print_path:()=>algorithm_print_path,algorithm_print_path2:()=>algorithm_print_path2,algorithm_print_sequence:()=>algorithm_print_sequence,algorithm_rabbit_add:()=>algorithm_rabbit_add,algorithm_rabbit_number_in_range:()=>algorithm_rabbit_number_in_range,algorithm_rabbit_zero:()=>algorithm_rabbit_zero,algorithm_return_path:()=>algorithm_return_path,algorithm_set_path:()=>algorithm_set_path,algorithm_two_left:()=>algorithm_two_left,algorithm_void_path:()=>algorithm_void_path,algorithm_yes_ring2:()=>algorithm_yes_ring2,hanoi_init:()=>hanoi_init,hanoi_init_offline:()=>hanoi_init_offline,hanoi_move:()=>hanoi_move});var communicate_namespaceObject={};__webpack_require__.r(communicate_namespaceObject),__webpack_require__.d(communicate_namespaceObject,{requests_attribute:()=>requests_attribute,requests_get:()=>requests_get,requests_get_old:()=>requests_get_old,requests_method:()=>requests_method,requests_post:()=>requests_post});var cv_namespaceObject={};__webpack_require__.r(cv_namespaceObject),__webpack_require__.d(cv_namespaceObject,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});var data_namespaceObject={};__webpack_require__.r(data_namespaceObject),__webpack_require__.d(data_namespaceObject,{array_create:()=>array_create,array_toarray:()=>array_toarray,dataframe_create:()=>dataframe_create,dataframe_create_from_index:()=>dataframe_create_from_index,dataframe_create_from_one_index:()=>dataframe_create_from_one_index,dataframe_fillna:()=>dataframe_fillna,dataframe_get:()=>dataframe_get,dataframe_info:()=>dataframe_info,dataframe_median:()=>dataframe_median,matrix_multiplication:()=>matrix_multiplication,matrix_transpose:()=>matrix_transpose,numpy_argmin_template_match:()=>numpy_argmin_template_match,numpy_astype:()=>numpy_astype,numpy_c_:()=>numpy_c_,numpy_dot:()=>numpy_dot,numpy_linalg_det:()=>numpy_linalg_det,numpy_linalg_inv:()=>numpy_linalg_inv,numpy_max:()=>numpy_max,numpy_mean:()=>numpy_mean,numpy_mean_digit:()=>numpy_mean_digit,numpy_min:()=>numpy_min,numpy_ones:()=>numpy_ones,numpy_random_random:()=>numpy_random_random,numpy_reshape:()=>numpy_reshape,numpy_shape:()=>numpy_shape,numpy_size:()=>numpy_size,numpy_square:()=>numpy_square,numpy_std:()=>numpy_std,numpy_sum:()=>numpy_sum,numpy_trig:()=>numpy_trig,pandas_drop_columns:()=>pandas_drop_columns,pandas_dropna:()=>pandas_dropna,pandas_readcsv:()=>pandas_readcsv,pl_axes:()=>pl_axes,pl_bar:()=>pl_bar,pl_hist:()=>pl_hist,pl_label:()=>pl_label,pl_legend:()=>pl_legend,pl_pie:()=>pl_pie,pl_plot:()=>pl_plot,pl_plot_bar:()=>pl_plot_bar,pl_plot_easy:()=>pl_plot_easy,pl_plot_scatter:()=>pl_plot_scatter,pl_plot_xy:()=>pl_plot_xy,pl_savefig:()=>pl_savefig,pl_show:()=>pl_show,pl_subplot:()=>pl_subplot,pl_text:()=>pl_text,pl_ticks:()=>pl_ticks,pl_title:()=>pl_title,plot_axes:()=>plot_axes,plot_bar:()=>plot_bar,plot_hist:()=>plot_hist,plot_label:()=>plot_label,plot_legend:()=>plot_legend,plot_pie:()=>plot_pie,plot_plot:()=>plot_plot,plot_plot_bar:()=>plot_plot_bar,plot_plot_easy:()=>plot_plot_easy,plot_plot_scatter:()=>plot_plot_scatter,plot_plot_xy:()=>plot_plot_xy,plot_savefig:()=>plot_savefig,plot_show:()=>plot_show,plot_subplot:()=>plot_subplot,plot_text:()=>plot_text,plot_ticks:()=>plot_ticks,plot_title:()=>plot_title,py_sum:()=>py_sum,pylab_imshow:()=>pylab_imshow,series_create:()=>series_create,series_create_from_index:()=>series_create_from_index,series_create_from_text:()=>series_create_from_text,series_get_num:()=>series_get_num,series_index_value:()=>series_index_value});var datastructure_namespaceObject={};__webpack_require__.r(datastructure_namespaceObject),__webpack_require__.d(datastructure_namespaceObject,{ds_add_node_by_attr:()=>ds_add_node_by_attr,ds_add_node_by_name:()=>ds_add_node_by_name,ds_create_linkedlist:()=>ds_create_linkedlist,ds_create_linkedlist_container:()=>ds_create_linkedlist_container,ds_create_linkedlist_item:()=>ds_create_linkedlist_item,ds_create_node:()=>ds_create_node,ds_del_node_by_attr:()=>ds_del_node_by_attr,ds_del_node_by_name:()=>ds_del_node_by_name,ds_get_node_attr:()=>ds_get_node_attr,ds_reverse_linkedlist:()=>ds_reverse_linkedlist,ds_set_node_attr:()=>ds_set_node_attr});var factory_namespaceObject={};__webpack_require__.r(factory_namespaceObject),__webpack_require__.d(factory_namespaceObject,{factory_block:()=>factory_block,factory_block_return:()=>factory_block_return,factory_block_return_with_textarea:()=>factory_block_return_with_textarea,factory_block_with_textarea:()=>factory_block_with_textarea,factory_callMethod_noreturn:()=>factory_callMethod_noreturn,factory_callMethod_return:()=>factory_callMethod_return,factory_create_with_container:()=>factory_create_with_container,factory_create_with_item:()=>factory_create_with_item,factory_declare:()=>factory_declare,factory_from_import:()=>factory_from_import,factory_function_noreturn:()=>factory_function_noreturn,factory_function_return:()=>factory_function_return,factory_import:()=>factory_import});var hardware_namespaceObject={};__webpack_require__.r(hardware_namespaceObject),__webpack_require__.d(hardware_namespaceObject,{hardware_arduino_analog_read:()=>hardware_arduino_analog_read,hardware_arduino_analog_write:()=>hardware_arduino_analog_write,hardware_arduino_digital_read:()=>hardware_arduino_digital_read,hardware_arduino_digital_write:()=>hardware_arduino_digital_write,hardware_arduino_start:()=>hardware_arduino_start,inout_highlow:()=>inout_highlow});var inout_namespaceObject={};__webpack_require__.r(inout_namespaceObject),__webpack_require__.d(inout_namespaceObject,{inout_input:()=>inout_input,inout_print:()=>inout_print,inout_print_container:()=>inout_print_container,inout_print_end:()=>inout_print_end,inout_print_inline:()=>inout_print_inline,inout_print_item:()=>inout_print_item,inout_print_many:()=>inout_print_many,inout_type_input:()=>inout_type_input,pyinout_type_input:()=>pyinout_type_input});var iot_namespaceObject={};__webpack_require__.r(iot_namespaceObject),__webpack_require__.d(iot_namespaceObject,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE,IOT_EMQX_PING:()=>IOT_EMQX_PING,IOT_FORMATTING:()=>IOT_FORMATTING,IOT_FORMAT_STRING:()=>IOT_FORMAT_STRING,IOT_MIXIO_NTP:()=>IOT_MIXIO_NTP,IOT_MIXIO_PUBLISH:()=>IOT_MIXIO_PUBLISH,IOT_MIXIO_SUBSCRIBE:()=>IOT_MIXIO_SUBSCRIBE,IOT_MIXIO_UNSUBSCRIBE:()=>IOT_MIXIO_UNSUBSCRIBE,iot_checkonenet:()=>iot_checkonenet,iot_client_onboard:()=>iot_client_onboard,iot_create_with_item:()=>iot_create_with_item,iot_http_client:()=>iot_http_client,iot_http_data:()=>iot_http_data,iot_mixio_check:()=>iot_mixio_check,iot_mixio_connect:()=>iot_mixio_connect,iot_mixio_connect_only:()=>iot_mixio_connect_only,iot_mixio_disconnect:()=>iot_mixio_disconnect,iot_mixio_format_msg:()=>iot_mixio_format_msg,iot_mixio_format_topic:()=>iot_mixio_format_topic,iot_mixly_key:()=>iot_mixly_key,iot_mixly_key_py:()=>iot_mixly_key_py,iot_mqtt_client:()=>iot_mqtt_client,iot_mqtt_data:()=>iot_mqtt_data,iot_onenet_check:()=>iot_onenet_check,iot_onenet_connect:()=>iot_onenet_connect,iot_onenet_disconnect:()=>iot_onenet_disconnect,iot_onenet_publish:()=>iot_onenet_publish,iot_onenet_publish_dict:()=>iot_onenet_publish_dict,iot_onenetconnect:()=>iot_onenetconnect,iot_onenetdisconnect:()=>iot_onenetdisconnect,iot_publish:()=>iot_publish,iot_publish_container:()=>iot_publish_container,iot_publish_item:()=>iot_publish_item});var pins_namespaceObject={};__webpack_require__.r(pins_namespaceObject),__webpack_require__.d(pins_namespaceObject,{pins_analog_read:()=>pins_analog_read,pins_analog_write:()=>pins_analog_write,pins_digital_read:()=>pins_digital_read,pins_digital_write:()=>pins_digital_write});var serial_namespaceObject={};__webpack_require__.r(serial_namespaceObject),__webpack_require__.d(serial_namespaceObject,{serial_close:()=>serial_close,serial_open:()=>serial_open,serial_read_b:()=>serial_read_b,serial_write:()=>serial_write});var sklearn_namespaceObject={};__webpack_require__.r(sklearn_namespaceObject),__webpack_require__.d(sklearn_namespaceObject,{sklearn_DecisionTreeClassifier_Regressor:()=>sklearn_DecisionTreeClassifier_Regressor,sklearn_GaussianNB:()=>sklearn_GaussianNB,sklearn_KMeans:()=>sklearn_KMeans,sklearn_KNeighborsClassifier_Regressor:()=>sklearn_KNeighborsClassifier_Regressor,sklearn_LinearRegression:()=>sklearn_LinearRegression,sklearn_RandomForestClassifier_Regressor:()=>sklearn_RandomForestClassifier_Regressor,sklearn_Ridge:()=>sklearn_Ridge,sklearn_cluster_centers_labels_inertia:()=>sklearn_cluster_centers_labels_inertia,sklearn_coef_intercept:()=>sklearn_coef_intercept,sklearn_data_target:()=>sklearn_data_target,sklearn_fit:()=>sklearn_fit,sklearn_fit_no_target:()=>sklearn_fit_no_target,sklearn_load:()=>sklearn_load,sklearn_make_blobs:()=>sklearn_make_blobs,sklearn_make_classification:()=>sklearn_make_classification,sklearn_make_regression:()=>sklearn_make_regression,sklearn_predict:()=>sklearn_predict,sklearn_save_load_model:()=>sklearn_save_load_model,sklearn_score:()=>sklearn_score,sklearn_score_no_target:()=>sklearn_score_no_target,sklearn_train_test_split:()=>sklearn_train_test_split,sklearn_train_test_split_no_target:()=>sklearn_train_test_split_no_target});var system_namespaceObject={};__webpack_require__.r(system_namespaceObject),__webpack_require__.d(system_namespaceObject,{Panic_with_status_code:()=>system_Panic_with_status_code,base_delay:()=>base_delay,controls_millis:()=>system_controls_millis,controls_mstimer2:()=>controls_mstimer2,controls_mstimer2_start:()=>controls_mstimer2_start,controls_mstimer2_stop:()=>controls_mstimer2_stop,reset:()=>system_reset,time_localtime:()=>time_localtime,time_sleep:()=>system_time_sleep});var turtle_namespaceObject={};__webpack_require__.r(turtle_namespaceObject),__webpack_require__.d(turtle_namespaceObject,{turtle_bgcolor:()=>turtle_bgcolor,turtle_bgcolor_hex:()=>turtle_bgcolor_hex,turtle_bgcolor_hex_new:()=>turtle_bgcolor_hex_new,turtle_circle:()=>turtle_circle,turtle_circle_advanced:()=>turtle_circle_advanced,turtle_clear:()=>turtle_clear,turtle_clone:()=>turtle_clone,turtle_color:()=>turtle_color,turtle_color_hex:()=>turtle_color_hex,turtle_color_seclet:()=>turtle_color_seclet,turtle_create:()=>turtle_create,turtle_done:()=>turtle_done,turtle_exitonclick:()=>turtle_exitonclick,turtle_fill:()=>turtle_fill,turtle_fillcolor:()=>turtle_fillcolor,turtle_fillcolor_hex:()=>turtle_fillcolor_hex,turtle_fillcolor_hex_new:()=>turtle_fillcolor_hex_new,turtle_getscreen:()=>turtle_getscreen,turtle_goto:()=>turtle_goto,turtle_listen:()=>turtle_listen,turtle_move:()=>turtle_move,turtle_numinput:()=>turtle_numinput,turtle_onclick:()=>turtle_onclick,turtle_onkey:()=>turtle_onkey,turtle_ontimer:()=>turtle_ontimer,turtle_pencolor:()=>turtle_pencolor,turtle_pencolor_hex:()=>turtle_pencolor_hex,turtle_pencolor_hex_new:()=>turtle_pencolor_hex_new,turtle_penup:()=>turtle_penup,turtle_pos_shape:()=>turtle_pos_shape,turtle_rotate:()=>turtle_rotate,turtle_screen_delay:()=>turtle_screen_delay,turtle_screen_savefig:()=>turtle_screen_savefig,turtle_setheading:()=>turtle_setheading,turtle_setxy:()=>turtle_setxy,turtle_shape:()=>turtle_shape,turtle_shapesize:()=>turtle_shapesize,turtle_size:()=>turtle_size,turtle_size_speed:()=>turtle_size_speed,turtle_speed:()=>turtle_speed,turtle_textinput:()=>turtle_textinput,turtle_visible:()=>turtle_visible,turtle_write:()=>turtle_write,turtle_write_format:()=>turtle_write_format,turtle_write_format_skulpt:()=>turtle_write_format_skulpt});var generators_ai_namespaceObject={};__webpack_require__.r(generators_ai_namespaceObject),__webpack_require__.d(generators_ai_namespaceObject,{AI_ChooseAndGet:()=>ai_AI_ChooseAndGet,AI_Face_match:()=>ai_AI_Face_match,AI_ImageClassify:()=>ai_AI_ImageClassify,AI_ImageClassify_Func:()=>ai_AI_ImageClassify_Func,AI_Nlp:()=>ai_AI_Nlp,AI_Nlp_Func:()=>ai_AI_Nlp_Func,AI_Nlp_Func_sim:()=>ai_AI_Nlp_Func_sim,AI_Nlp_Sim:()=>ai_AI_Nlp_Sim,AI_Nlp_Topic:()=>ai_AI_Nlp_Topic,AI_Nlp_newsSummary:()=>ai_AI_Nlp_newsSummary,AI_Ocr:()=>ai_AI_Ocr,AI_Ocr_Func:()=>ai_AI_Ocr_Func,AI_Speech_asr:()=>ai_AI_Speech_asr,AI_Speech_synthesis:()=>ai_AI_Speech_synthesis,AI_audio:()=>ai_AI_audio,AI_client:()=>ai_AI_client,AI_photo:()=>ai_AI_photo,AI_result:()=>ai_AI_result});var generators_algorithm_namespaceObject={};__webpack_require__.r(generators_algorithm_namespaceObject),__webpack_require__.d(generators_algorithm_namespaceObject,{algorithm_add_path:()=>algorithm_algorithm_add_path,algorithm_add_school:()=>algorithm_algorithm_add_school,algorithm_all_books:()=>algorithm_algorithm_all_books,algorithm_all_books_sequence:()=>algorithm_algorithm_all_books_sequence,algorithm_book_scale:()=>algorithm_algorithm_book_scale,algorithm_check_feet:()=>algorithm_algorithm_check_feet,algorithm_chick_calculate:()=>algorithm_algorithm_chick_calculate,algorithm_color_seclet:()=>algorithm_algorithm_color_seclet,algorithm_current_school:()=>algorithm_algorithm_current_school,algorithm_del_path:()=>algorithm_algorithm_del_path,algorithm_delete_book:()=>algorithm_algorithm_delete_book,algorithm_divide_books:()=>algorithm_algorithm_divide_books,algorithm_find_path:()=>algorithm_algorithm_find_path,algorithm_first_book:()=>algorithm_algorithm_first_book,algorithm_fz_calc:()=>algorithm_algorithm_fz_calc,algorithm_fz_compare:()=>algorithm_algorithm_fz_compare,algorithm_fz_move:()=>algorithm_algorithm_fz_move,algorithm_fz_set_min:()=>algorithm_algorithm_fz_set_min,algorithm_get_current_location:()=>algorithm_algorithm_get_current_location,algorithm_get_half_books:()=>algorithm_algorithm_get_half_books,algorithm_hxdb_add:()=>algorithm_algorithm_hxdb_add,algorithm_hxdb_init_soldier:()=>algorithm_algorithm_hxdb_init_soldier,algorithm_hxdb_last_line:()=>algorithm_algorithm_hxdb_last_line,algorithm_hxdb_result:()=>algorithm_algorithm_hxdb_result,algorithm_hxdb_stand_in_line:()=>algorithm_algorithm_hxdb_stand_in_line,algorithm_init_fzsf:()=>algorithm_algorithm_init_fzsf,algorithm_init_hxdb:()=>algorithm_algorithm_init_hxdb,algorithm_init_jttl:()=>algorithm_algorithm_init_jttl,algorithm_move_recent:()=>algorithm_algorithm_move_recent,algorithm_new_path:()=>algorithm_algorithm_new_path,algorithm_next_book:()=>algorithm_algorithm_next_book,algorithm_no_left:()=>algorithm_algorithm_no_left,algorithm_no_path:()=>algorithm_algorithm_no_path,algorithm_no_ring2:()=>algorithm_algorithm_no_ring2,algorithm_not_home:()=>algorithm_algorithm_not_home,algorithm_not_school:()=>algorithm_algorithm_not_school,algorithm_number_add:()=>algorithm_algorithm_number_add,algorithm_number_zero:()=>algorithm_algorithm_number_zero,algorithm_prepare:()=>algorithm_algorithm_prepare,algorithm_prepare2:()=>algorithm_algorithm_prepare2,algorithm_prepare_2_1:()=>algorithm_algorithm_prepare_2_1,algorithm_prepare_2_2:()=>algorithm_algorithm_prepare_2_2,algorithm_print_book2:()=>algorithm_algorithm_print_book2,algorithm_print_jttl_answer:()=>algorithm_algorithm_print_jttl_answer,algorithm_print_number:()=>algorithm_algorithm_print_number,algorithm_print_path:()=>algorithm_algorithm_print_path,algorithm_print_path2:()=>algorithm_algorithm_print_path2,algorithm_rabbit_add:()=>algorithm_algorithm_rabbit_add,algorithm_rabbit_number_in_range:()=>algorithm_algorithm_rabbit_number_in_range,algorithm_rabbit_zero:()=>algorithm_algorithm_rabbit_zero,algorithm_return_path:()=>algorithm_algorithm_return_path,algorithm_set_path:()=>algorithm_algorithm_set_path,algorithm_two_left:()=>algorithm_algorithm_two_left,algorithm_void_path:()=>algorithm_algorithm_void_path,algorithm_yes_ring2:()=>algorithm_algorithm_yes_ring2,hanoi_init:()=>algorithm_hanoi_init,hanoi_init_offline:()=>algorithm_hanoi_init_offline,hanoi_move:()=>algorithm_hanoi_move});var generators_communicate_namespaceObject={};__webpack_require__.r(generators_communicate_namespaceObject),__webpack_require__.d(generators_communicate_namespaceObject,{requests_attribute:()=>communicate_requests_attribute,requests_get:()=>communicate_requests_get,requests_get_old:()=>communicate_requests_get_old,requests_method:()=>communicate_requests_method,requests_post:()=>communicate_requests_post});var generators_data_namespaceObject={};__webpack_require__.r(generators_data_namespaceObject),__webpack_require__.d(generators_data_namespaceObject,{array_create:()=>data_array_create,array_toarray:()=>data_array_toarray,dataframe_create:()=>data_dataframe_create,dataframe_create_from_index:()=>data_dataframe_create_from_index,dataframe_create_from_one_index:()=>data_dataframe_create_from_one_index,dataframe_fillna:()=>data_dataframe_fillna,dataframe_get:()=>data_dataframe_get,dataframe_info:()=>data_dataframe_info,dataframe_median:()=>data_dataframe_median,matrix_multiplication:()=>data_matrix_multiplication,matrix_transpose:()=>data_matrix_transpose,numpy_argmin_template_match:()=>data_numpy_argmin_template_match,numpy_astype:()=>data_numpy_astype,numpy_c_:()=>data_numpy_c_,numpy_dot:()=>data_numpy_dot,numpy_linalg_det:()=>data_numpy_linalg_det,numpy_linalg_inv:()=>data_numpy_linalg_inv,numpy_max:()=>data_numpy_max,numpy_mean:()=>data_numpy_mean,numpy_mean_digit:()=>data_numpy_mean_digit,numpy_min:()=>data_numpy_min,numpy_ones:()=>data_numpy_ones,numpy_random_random:()=>data_numpy_random_random,numpy_reshape:()=>data_numpy_reshape,numpy_shape:()=>data_numpy_shape,numpy_size:()=>data_numpy_size,numpy_square:()=>data_numpy_square,numpy_std:()=>data_numpy_std,numpy_sum:()=>data_numpy_sum,numpy_trig:()=>data_numpy_trig,pandas_drop_columns:()=>data_pandas_drop_columns,pandas_dropna:()=>data_pandas_dropna,pandas_readcsv:()=>data_pandas_readcsv,pl_axes:()=>data_pl_axes,pl_bar:()=>data_pl_bar,pl_hist:()=>data_pl_hist,pl_label:()=>data_pl_label,pl_legend:()=>data_pl_legend,pl_pie:()=>data_pl_pie,pl_plot:()=>data_pl_plot,pl_plot_bar:()=>data_pl_plot_bar,pl_plot_easy:()=>data_pl_plot_easy,pl_plot_scatter:()=>data_pl_plot_scatter,pl_plot_xy:()=>data_pl_plot_xy,pl_savefig:()=>data_pl_savefig,pl_show:()=>data_pl_show,pl_subplot:()=>data_pl_subplot,pl_text:()=>data_pl_text,pl_ticks:()=>data_pl_ticks,pl_title:()=>data_pl_title,plot_axes:()=>data_plot_axes,plot_bar:()=>data_plot_bar,plot_hist:()=>data_plot_hist,plot_label:()=>data_plot_label,plot_legend:()=>data_plot_legend,plot_pie:()=>data_plot_pie,plot_plot:()=>data_plot_plot,plot_plot_bar:()=>data_plot_plot_bar,plot_plot_easy:()=>data_plot_plot_easy,plot_plot_scatter:()=>data_plot_plot_scatter,plot_plot_xy:()=>data_plot_plot_xy,plot_savefig:()=>data_plot_savefig,plot_show:()=>data_plot_show,plot_subplot:()=>data_plot_subplot,plot_text:()=>data_plot_text,plot_ticks:()=>data_plot_ticks,plot_title:()=>data_plot_title,py_sum:()=>data_py_sum,pylab_imshow:()=>data_pylab_imshow,series_create:()=>data_series_create,series_create_from_index:()=>data_series_create_from_index,series_create_from_text:()=>data_series_create_from_text,series_get_num:()=>data_series_get_num,series_index_value:()=>data_series_index_value});var generators_datastructure_namespaceObject={};__webpack_require__.r(generators_datastructure_namespaceObject),__webpack_require__.d(generators_datastructure_namespaceObject,{ds_add_node_by_attr:()=>datastructure_ds_add_node_by_attr,ds_add_node_by_name:()=>datastructure_ds_add_node_by_name,ds_create_linkedlist:()=>datastructure_ds_create_linkedlist,ds_create_node:()=>datastructure_ds_create_node,ds_del_node_by_attr:()=>datastructure_ds_del_node_by_attr,ds_del_node_by_name:()=>datastructure_ds_del_node_by_name,ds_get_node_attr:()=>datastructure_ds_get_node_attr,ds_reverse_linkedlist:()=>datastructure_ds_reverse_linkedlist,ds_set_node_attr:()=>datastructure_ds_set_node_attr});var generators_factory_namespaceObject={};__webpack_require__.r(generators_factory_namespaceObject),__webpack_require__.d(generators_factory_namespaceObject,{factory_block:()=>factory_factory_block,factory_block_return:()=>factory_factory_block_return,factory_block_return_with_textarea:()=>factory_factory_block_return_with_textarea,factory_block_with_textarea:()=>factory_factory_block_with_textarea,factory_callMethod_noreturn:()=>factory_factory_callMethod_noreturn,factory_callMethod_return:()=>factory_factory_callMethod_return,factory_declare:()=>factory_factory_declare,factory_from_import:()=>factory_factory_from_import,factory_function_noreturn:()=>factory_factory_function_noreturn,factory_function_return:()=>factory_factory_function_return,factory_import:()=>factory_factory_import});var generators_hardware_namespaceObject={};__webpack_require__.r(generators_hardware_namespaceObject),__webpack_require__.d(generators_hardware_namespaceObject,{hardware_arduino_analog_read:()=>hardware_hardware_arduino_analog_read,hardware_arduino_analog_write:()=>hardware_hardware_arduino_analog_write,hardware_arduino_digital_read:()=>hardware_hardware_arduino_digital_read,hardware_arduino_digital_write:()=>hardware_hardware_arduino_digital_write,hardware_arduino_start:()=>hardware_hardware_arduino_start,inout_highlow:()=>hardware_inout_highlow});var generators_inout_namespaceObject={};__webpack_require__.r(generators_inout_namespaceObject),__webpack_require__.d(generators_inout_namespaceObject,{inout_input:()=>inout_inout_input,inout_print:()=>inout_inout_print,inout_print_end:()=>inout_inout_print_end,inout_print_inline:()=>inout_inout_print_inline,inout_print_many:()=>inout_inout_print_many,inout_type_input:()=>inout_inout_type_input,pyinout_type_input:()=>inout_pyinout_type_input});var generators_iot_namespaceObject={};__webpack_require__.r(generators_iot_namespaceObject),__webpack_require__.d(generators_iot_namespaceObject,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>iot_IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>iot_IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE,IOT_EMQX_PING:()=>iot_IOT_EMQX_PING,IOT_FORMATTING:()=>iot_IOT_FORMATTING,IOT_FORMAT_STRING:()=>iot_IOT_FORMAT_STRING,IOT_MIXIO_NTP:()=>iot_IOT_MIXIO_NTP,IOT_MIXIO_PUBLISH:()=>iot_IOT_MIXIO_PUBLISH,IOT_MIXIO_SUBSCRIBE:()=>iot_IOT_MIXIO_SUBSCRIBE,IOT_MIXIO_UNSUBSCRIBE:()=>iot_IOT_MIXIO_UNSUBSCRIBE,iot_mixio_check:()=>iot_iot_mixio_check,iot_mixio_connect:()=>iot_iot_mixio_connect,iot_mixio_connect_only:()=>iot_iot_mixio_connect_only,iot_mixio_disconnect:()=>iot_iot_mixio_disconnect,iot_mixio_format_msg:()=>iot_iot_mixio_format_msg,iot_mixio_format_topic:()=>iot_iot_mixio_format_topic,iot_mixly_key:()=>iot_iot_mixly_key,iot_mixly_key_py:()=>iot_iot_mixly_key_py});var generators_pins_namespaceObject={};__webpack_require__.r(generators_pins_namespaceObject),__webpack_require__.d(generators_pins_namespaceObject,{pins_analog_read:()=>pins_pins_analog_read,pins_analog_write:()=>pins_pins_analog_write,pins_digital:()=>pins_digital,pins_digital_read:()=>pins_pins_digital_read,pins_digital_write:()=>pins_pins_digital_write});var generators_serial_namespaceObject={};__webpack_require__.r(generators_serial_namespaceObject),__webpack_require__.d(generators_serial_namespaceObject,{serial_close:()=>serial_serial_close,serial_open:()=>serial_serial_open,serial_read_b:()=>serial_serial_read_b,serial_write:()=>serial_serial_write});var generators_sklearn_namespaceObject={};__webpack_require__.r(generators_sklearn_namespaceObject),__webpack_require__.d(generators_sklearn_namespaceObject,{sklearn_DecisionTreeClassifier_Regressor:()=>sklearn_sklearn_DecisionTreeClassifier_Regressor,sklearn_GaussianNB:()=>sklearn_sklearn_GaussianNB,sklearn_KMeans:()=>sklearn_sklearn_KMeans,sklearn_KNeighborsClassifier_Regressor:()=>sklearn_sklearn_KNeighborsClassifier_Regressor,sklearn_LinearRegression:()=>sklearn_sklearn_LinearRegression,sklearn_RandomForestClassifier_Regressor:()=>sklearn_sklearn_RandomForestClassifier_Regressor,sklearn_Ridge:()=>sklearn_sklearn_Ridge,sklearn_cluster_centers_labels_inertia:()=>sklearn_sklearn_cluster_centers_labels_inertia,sklearn_coef_intercept:()=>sklearn_sklearn_coef_intercept,sklearn_data_target:()=>sklearn_sklearn_data_target,sklearn_fit:()=>sklearn_sklearn_fit,sklearn_fit_no_target:()=>sklearn_sklearn_fit_no_target,sklearn_load:()=>sklearn_sklearn_load,sklearn_make_blobs:()=>sklearn_sklearn_make_blobs,sklearn_make_classification:()=>sklearn_sklearn_make_classification,sklearn_make_regression:()=>sklearn_sklearn_make_regression,sklearn_predict:()=>sklearn_sklearn_predict,sklearn_save_load_model:()=>sklearn_sklearn_save_load_model,sklearn_score:()=>sklearn_sklearn_score,sklearn_score_no_target:()=>sklearn_sklearn_score_no_target,sklearn_train_test_split:()=>sklearn_sklearn_train_test_split,sklearn_train_test_split_no_target:()=>sklearn_sklearn_train_test_split_no_target});var generators_system_namespaceObject={};__webpack_require__.r(generators_system_namespaceObject),__webpack_require__.d(generators_system_namespaceObject,{controls_end_program:()=>system_controls_end_program,controls_millis:()=>generators_system_controls_millis,time_localtime:()=>system_time_localtime});var generators_turtle_namespaceObject={};__webpack_require__.r(generators_turtle_namespaceObject),__webpack_require__.d(generators_turtle_namespaceObject,{turtle_bgcolor:()=>turtle_turtle_bgcolor,turtle_bgcolor_hex:()=>turtle_turtle_bgcolor_hex,turtle_bgcolor_hex_new:()=>turtle_turtle_bgcolor_hex_new,turtle_circle:()=>turtle_turtle_circle,turtle_circle_advanced:()=>turtle_turtle_circle_advanced,turtle_clear:()=>turtle_turtle_clear,turtle_clone:()=>turtle_turtle_clone,turtle_color:()=>turtle_turtle_color,turtle_color_hex:()=>turtle_turtle_color_hex,turtle_color_seclet:()=>turtle_turtle_color_seclet,turtle_create:()=>turtle_turtle_create,turtle_done:()=>turtle_turtle_done,turtle_exitonclick:()=>turtle_turtle_exitonclick,turtle_fill:()=>turtle_turtle_fill,turtle_fillcolor:()=>turtle_turtle_fillcolor,turtle_fillcolor_hex:()=>turtle_turtle_fillcolor_hex,turtle_fillcolor_hex_new:()=>turtle_turtle_fillcolor_hex_new,turtle_getscreen:()=>turtle_turtle_getscreen,turtle_goto:()=>turtle_turtle_goto,turtle_listen:()=>turtle_turtle_listen,turtle_move:()=>turtle_turtle_move,turtle_numinput:()=>turtle_turtle_numinput,turtle_onclick:()=>turtle_turtle_onclick,turtle_onkey:()=>turtle_turtle_onkey,turtle_ontimer:()=>turtle_turtle_ontimer,turtle_pencolor:()=>turtle_turtle_pencolor,turtle_pencolor_hex:()=>turtle_turtle_pencolor_hex,turtle_pencolor_hex_new:()=>turtle_turtle_pencolor_hex_new,turtle_penup:()=>turtle_turtle_penup,turtle_pos_shape:()=>turtle_turtle_pos_shape,turtle_rotate:()=>turtle_turtle_rotate,turtle_screen_delay:()=>turtle_turtle_screen_delay,turtle_screen_savefig:()=>turtle_turtle_screen_savefig,turtle_setheading:()=>turtle_turtle_setheading,turtle_setxy:()=>turtle_turtle_setxy,turtle_shape:()=>turtle_turtle_shape,turtle_shapesize:()=>turtle_turtle_shapesize,turtle_size:()=>turtle_turtle_size,turtle_size_speed:()=>turtle_turtle_size_speed,turtle_speed:()=>turtle_turtle_speed,turtle_textinput:()=>turtle_turtle_textinput,turtle_visible:()=>turtle_turtle_visible,turtle_write:()=>turtle_turtle_write,turtle_write_format:()=>turtle_turtle_write_format,turtle_write_format_skulpt:()=>turtle_turtle_write_format_skulpt});const external_Blockly_namespaceObject=Blockly,ZhHansMsg={PYTHON_PYODIDE_IMAGE:"图像"},ZhHansCatgories={},ZhHantMsg={PYTHON_PYODIDE_IMAGE:"影像"},ZhHantCatgories={},EnMsg={PYTHON_PYODIDE_IMAGE:"Image"},EnCatgories={};Object.assign(external_Blockly_namespaceObject.Lang.ZhHans,ZhHansMsg),Object.assign(external_Blockly_namespaceObject.Lang.ZhHant,ZhHantMsg),Object.assign(external_Blockly_namespaceObject.Lang.En,EnMsg),Object.assign(external_Blockly_namespaceObject.Lang.ZhHans.MSG,ZhHansCatgories),Object.assign(external_Blockly_namespaceObject.Lang.ZhHant.MSG,ZhHantCatgories),Object.assign(external_Blockly_namespaceObject.Lang.En.MSG,EnCatgories);const external_Mixly_namespaceObject=Mixly,Variables={NAME_TYPE:"VARIABLE",allVariables:function(e){var t;if(e.getDescendants)t=e.getDescendants();else{if(!e.getAllBlocks)throw"Not Block or Workspace: "+e;t=e.getAllBlocks()}for(var n=Object.create(null),a=0;a1&&(s+=a)):n=s}else n="i";return n}},variables=Variables; +(()=>{"use strict";var __webpack_modules__={936:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});const cv_read_image=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.imread("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_show_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imshow("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_write_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imwrite("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_waitkey=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.waitKey("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+")\n"},cv_destroy_all=function(e,t){t.definitions_.import_cv2="import cv2";return"cv2.destroyAllWindows()\n"},cv_line_rect=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),x2=generator.valueToCode(this,"x2",generator.ORDER_ATOMIC),y2=generator.valueToCode(this,"y2",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),direction=this.getFieldValue("DIR"),code="cv2."+direction+"("+file+",("+x1+","+y1+"),("+x2+","+y2+"),("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_text=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),data=generator.valueToCode(this,"data",generator.ORDER_ATOMIC),size=generator.valueToCode(this,"size",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),font=this.getFieldValue("font"),code="cv2.putText("+file+","+data+",("+x1+","+y1+"),cv2.FONT_HERSHEY_"+font+","+size+",("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_face_classifier=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.CascadeClassifier("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect_all=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+",minSize=("+t.valueToCode(this,"x1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y1",t.ORDER_ATOMIC)+"),maxSize=("+t.valueToCode(this,"x2",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y2",t.ORDER_ATOMIC)+"))",t.ORDER_ATOMIC]}},9610:(e,t,n)=>{n.d(t,{D:()=>a});var a=function(){function e(e){var t=this;void 0===e&&(e=!1),this.ignoreMultipleSettles=e,this.isSettled=!1,this.promise=new Promise((function(e,n){t.resolveCallback=e,t.rejectCallback=n}))}return e.prototype.markAsSettled=function(){var e=this.isSettled;if(e&&!this.ignoreMultipleSettles)throw new Error("PromiseDelegate is already settled!");return this.isSettled=!0,!e},Object.defineProperty(e.prototype,"settled",{get:function(){return this.isSettled},enumerable:!1,configurable:!0}),e.prototype.resolve=function(e){this.markAsSettled()&&this.resolveCallback(e)},e.prototype.reject=function(e){this.markAsSettled()&&this.rejectCallback(e)},e}()},6944:e=>{e.exports=path}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var a={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var _=2&t&&e;"object"==typeof _&&!~leafPrototypes.indexOf(_);_=getProto(_))Object.getOwnPropertyNames(_).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,__webpack_require__.d(n,a),n},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((t,n)=>(__webpack_require__.f[n](e,t),t)),[])),__webpack_require__.u=e=>e+".bundle.js",__webpack_require__.miniCssF=e=>"styles/"+e+"."+__webpack_require__.h().slice(0,8)+".css",__webpack_require__.h=()=>"2452fe28e3b3d49495dd",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),inProgress={},dataWebpackPrefix="@mixly/python-pyodide:",__webpack_require__.l=(e,t,n,a)=>{if(inProgress[e])inProgress[e].push(t);else{var _,l;if(void 0!==n)for(var s=document.getElementsByTagName("script"),i=0;i{_.onerror=_.onload=null,clearTimeout(p);var a=inProgress[e];if(delete inProgress[e],_.parentNode&&_.parentNode.removeChild(_),a&&a.forEach((e=>e(n))),t)return t(n)},p=setTimeout(r.bind(null,void 0,{type:"timeout",target:_}),12e4);_.onerror=r.bind(null,_.onerror),_.onload=r.bind(null,_.onload),l&&document.head.appendChild(_)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{if("undefined"!=typeof document){var e=e=>new Promise(((t,n)=>{var a=__webpack_require__.miniCssF(e),_=__webpack_require__.p+a;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),a=0;a{var l=document.createElement("link");l.rel="stylesheet",l.type="text/css",__webpack_require__.nc&&(l.nonce=__webpack_require__.nc),l.onerror=l.onload=n=>{if(l.onerror=l.onload=null,"load"===n.type)a();else{var s=n&&n.type,i=n&&n.target&&n.target.href||t,o=new Error("Loading CSS chunk "+e+" failed.\n("+s+": "+i+")");o.name="ChunkLoadError",o.code="CSS_CHUNK_LOAD_FAILED",o.type=s,o.request=i,l.parentNode&&l.parentNode.removeChild(l),_(o)}},l.href=t,n?n.parentNode.insertBefore(l,n.nextSibling):document.head.appendChild(l)})(e,_,null,t,n)})),t={792:0};__webpack_require__.f.miniCss=(n,a)=>{t[n]?a.push(t[n]):0!==t[n]&&{317:1}[n]&&a.push(t[n]=e(n).then((()=>{t[n]=0}),(e=>{throw delete t[n],e})))}}})(),(()=>{var e={792:0};__webpack_require__.f.j=(t,n)=>{var a=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==a)if(a)n.push(a[2]);else{var _=new Promise(((n,_)=>a=e[t]=[n,_]));n.push(a[2]=_);var l=__webpack_require__.p+__webpack_require__.u(t),s=new Error;__webpack_require__.l(l,(n=>{if(__webpack_require__.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var _=n&&("load"===n.type?"missing":n.type),l=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+_+": "+l+")",s.name="ChunkLoadError",s.type=_,s.request=l,a[1](s)}}),"chunk-"+t,t)}};var t=(t,n)=>{var a,_,[l,s,i]=n,o=0;if(l.some((t=>0!==e[t]))){for(a in s)__webpack_require__.o(s,a)&&(__webpack_require__.m[a]=s[a]);if(i)i(__webpack_require__)}for(t&&t(n);ocontrols_type,controls_typeLists:()=>controls_typeLists,variables_change:()=>variables_change,variables_get:()=>variables_get,variables_global:()=>variables_global,variables_set:()=>variables_set});var control_namespaceObject={};__webpack_require__.r(control_namespaceObject),__webpack_require__.d(control_namespaceObject,{base_setup:()=>base_setup,controls_delay:()=>controls_delay,controls_end_program:()=>controls_end_program,controls_except:()=>controls_except,controls_finally:()=>controls_finally,controls_flow_statements:()=>controls_flow_statements,controls_for:()=>controls_for,controls_forEach:()=>controls_forEach,controls_for_range:()=>controls_for_range,controls_if:()=>controls_if,controls_if_else:()=>controls_if_else,controls_if_elseif:()=>controls_if_elseif,controls_if_if:()=>controls_if_if,controls_lambda:()=>controls_lambda,controls_main:()=>controls_main,controls_pass:()=>controls_pass,controls_range:()=>controls_range,controls_repeat_ext:()=>controls_repeat_ext,controls_thread:()=>controls_thread,controls_try:()=>controls_try,controls_try_finally:()=>controls_try_finally,controls_whileUntil:()=>controls_whileUntil,do_while:()=>do_while,garbage_collection:()=>garbage_collection,get_mem_alloc:()=>get_mem_alloc,get_mem_free:()=>get_mem_free,get_unique_identifier:()=>get_unique_identifier});var math_namespaceObject={};__webpack_require__.r(math_namespaceObject),__webpack_require__.d(math_namespaceObject,{base_map:()=>base_map,math_arithmetic:()=>math_arithmetic,math_bit:()=>math_bit,math_constant:()=>math_constant,math_constant_mp:()=>math_constant_mp,math_constrain:()=>math_constrain,math_dec:()=>math_dec,math_indexer_number:()=>math_indexer_number,math_map:()=>math_map,math_max_min:()=>math_max_min,math_number:()=>math_number,math_number_base_conversion:()=>math_number_base_conversion,math_random:()=>math_random,math_random_seed:()=>math_random_seed,math_round:()=>math_round,math_selfcalcu:()=>math_selfcalcu,math_to_int:()=>math_to_int,math_trig:()=>math_trig,text_to_number:()=>text_to_number,text_to_number_skulpt:()=>text_to_number_skulpt});var text_namespaceObject={};__webpack_require__.r(text_namespaceObject),__webpack_require__.d(text_namespaceObject,{ascii_to_char:()=>ascii_to_char,char_to_ascii:()=>char_to_ascii,number_to_text:()=>number_to_text,os_system:()=>os_system,text:()=>text_text,text_capital:()=>text_capital,text_center:()=>text_center,text_char:()=>text_char,text_char_at:()=>text_char_at,text_char_at2:()=>text_char_at2,text_char_at3:()=>text_char_at3,text_compareTo:()=>text_compareTo,text_compare_to:()=>text_compare_to,text_create_with_container:()=>text_create_with_container,text_create_with_item:()=>text_create_with_item,text_encode:()=>text_encode,text_equals_starts_ends:()=>text_equals_starts_ends,text_eval:()=>text_eval,text_find:()=>text_find,text_format:()=>text_format,text_format_noreturn:()=>text_format_noreturn,text_join:()=>text_join,text_join_seq:()=>text_join_seq,text_length:()=>text_length,text_random_char:()=>text_random_char,text_replace:()=>text_replace,text_split:()=>text_split,text_strip:()=>text_strip,text_substring:()=>text_substring,text_substring2:()=>text_substring2,text_substring3:()=>text_substring3,text_textarea:()=>text_textarea});var lists_namespaceObject={};__webpack_require__.r(lists_namespaceObject),__webpack_require__.d(lists_namespaceObject,{list_many_input:()=>list_many_input,list_tolist:()=>list_tolist,list_tolist2:()=>list_tolist2,list_trig:()=>list_trig,lists_2d_get_col_row_data:()=>lists_2d_get_col_row_data,lists_2d_get_data_with_col_row:()=>lists_2d_get_data_with_col_row,lists_append_extend:()=>lists_append_extend,lists_change_to:()=>lists_change_to,lists_change_to_general:()=>lists_change_to_general,lists_clear:()=>lists_clear,lists_create_with:()=>lists_create_with,lists_create_with2:()=>lists_create_with2,lists_create_with_container:()=>lists_create_with_container,lists_create_with_item:()=>lists_create_with_item,lists_create_with_noreturn:()=>lists_create_with_noreturn,lists_create_with_text:()=>lists_create_with_text,lists_create_with_text2:()=>lists_create_with_text2,lists_del_general:()=>lists_del_general,lists_find:()=>lists_find,lists_getIndex3:()=>lists_getIndex3,lists_getSublist3:()=>lists_getSublist3,lists_get_index:()=>lists_get_index,lists_get_random_item:()=>lists_get_random_item,lists_get_random_sublist:()=>lists_get_random_sublist,lists_get_sublist:()=>lists_get_sublist,lists_insert_value:()=>lists_insert_value,lists_insert_value2:()=>lists_insert_value2,lists_pop:()=>lists_pop,lists_remove_at:()=>lists_remove_at,lists_remove_at2:()=>lists_remove_at2,lists_reverse:()=>lists_reverse,lists_setIndex3:()=>lists_setIndex3,lists_set_index:()=>lists_set_index,lists_sort:()=>lists_sort,lists_zip:()=>lists_zip,lists_zip_container:()=>lists_zip_container,lists_zip_item:()=>lists_zip_item});var dicts_namespaceObject={};__webpack_require__.r(dicts_namespaceObject),__webpack_require__.d(dicts_namespaceObject,{dicts_add_change_del:()=>dicts_add_change_del,dicts_add_or_change:()=>dicts_add_or_change,dicts_clear:()=>dicts_clear,dicts_create_with:()=>dicts_create_with,dicts_create_with_container:()=>dicts_create_with_container,dicts_create_with_item:()=>dicts_create_with_item,dicts_create_with_noreturn:()=>dicts_create_with_noreturn,dicts_deldict:()=>dicts_deldict,dicts_delete:()=>dicts_delete,dicts_get:()=>dicts_get,dicts_get_default:()=>dicts_get_default,dicts_items:()=>dicts_items,dicts_keys:()=>dicts_keys,dicts_length:()=>dicts_length,dicts_pop:()=>dicts_pop,dicts_setdefault:()=>dicts_setdefault,dicts_to_json:()=>dicts_to_json,dicts_todict:()=>dicts_todict,dicts_update:()=>dicts_update,dicts_values:()=>dicts_values,json_to_dicts:()=>json_to_dicts});var logic_namespaceObject={};__webpack_require__.r(logic_namespaceObject),__webpack_require__.d(logic_namespaceObject,{logic_boolean:()=>logic_boolean,logic_compare:()=>logic_compare,logic_compare_continous:()=>logic_compare_continous,logic_is:()=>logic_is,logic_is_in:()=>logic_is_in,logic_negate:()=>logic_negate,logic_null:()=>logic_null,logic_operation:()=>logic_operation,logic_tobool:()=>logic_tobool,logic_true_or_false:()=>logic_true_or_false});var storage_namespaceObject={};__webpack_require__.r(storage_namespaceObject),__webpack_require__.d(storage_namespaceObject,{sdcard_mount:()=>sdcard_mount,sdcard_use_spi_init:()=>sdcard_use_spi_init,storage_can_write_ornot:()=>storage_can_write_ornot,storage_change_dir:()=>storage_change_dir,storage_close_file:()=>storage_close_file,storage_delete_file:()=>storage_delete_file,storage_file_seek:()=>storage_file_seek,storage_file_tell:()=>storage_file_tell,storage_file_write:()=>storage_file_write,storage_fileopen:()=>storage_fileopen,storage_fileopen_new:()=>storage_fileopen_new,storage_fileopen_new_encoding:()=>storage_fileopen_new_encoding,storage_get_a_line:()=>storage_get_a_line,storage_get_contents:()=>storage_get_contents,storage_get_contents_without_para:()=>storage_get_contents_without_para,storage_get_current_dir:()=>storage_get_current_dir,storage_get_file_size:()=>storage_get_file_size,storage_get_filename:()=>storage_get_filename,storage_is_file:()=>storage_is_file,storage_list_all_files:()=>storage_list_all_files,storage_make_dir:()=>storage_make_dir,storage_open_file_with_os:()=>storage_open_file_with_os,storage_rename:()=>storage_rename});var blocks_procedures_namespaceObject={};__webpack_require__.r(blocks_procedures_namespaceObject),__webpack_require__.d(blocks_procedures_namespaceObject,{procedures_callnoreturn:()=>procedures_callnoreturn,procedures_callreturn:()=>procedures_callreturn,procedures_defnoreturn:()=>procedures_defnoreturn,procedures_defreturn:()=>procedures_defreturn,procedures_ifreturn:()=>procedures_ifreturn,procedures_mutatorarg:()=>procedures_mutatorarg,procedures_mutatorcontainer:()=>procedures_mutatorcontainer,procedures_return:()=>procedures_return});var tuple_namespaceObject={};__webpack_require__.r(tuple_namespaceObject),__webpack_require__.d(tuple_namespaceObject,{tuple_change_to:()=>tuple_change_to,tuple_create_with:()=>tuple_create_with,tuple_create_with_container:()=>tuple_create_with_container,tuple_create_with_item:()=>tuple_create_with_item,tuple_create_with_noreturn:()=>tuple_create_with_noreturn,tuple_create_with_text2:()=>tuple_create_with_text2,tuple_create_with_text_return:()=>tuple_create_with_text_return,tuple_del:()=>tuple_del,tuple_find:()=>tuple_find,tuple_getIndex:()=>tuple_getIndex,tuple_getSublist:()=>tuple_getSublist,tuple_get_random_item:()=>tuple_get_random_item,tuple_get_sublist:()=>tuple_get_sublist,tuple_join:()=>tuple_join,tuple_length:()=>tuple_length,tuple_max:()=>tuple_max,tuple_totuple:()=>tuple_totuple,tuple_trig:()=>tuple_trig});var set_namespaceObject={};__webpack_require__.r(set_namespaceObject),__webpack_require__.d(set_namespaceObject,{set_add_discard:()=>set_add_discard,set_clear:()=>set_clear,set_create_with:()=>set_create_with,set_create_with_container:()=>set_create_with_container,set_create_with_item:()=>set_create_with_item,set_create_with_text_return:()=>set_create_with_text_return,set_length:()=>set_length,set_operate:()=>set_operate,set_operate_update:()=>set_operate_update,set_pop:()=>set_pop,set_sub:()=>set_sub,set_toset:()=>set_toset,set_update:()=>set_update});var html_namespaceObject={};__webpack_require__.r(html_namespaceObject),__webpack_require__.d(html_namespaceObject,{html_content:()=>html_content,html_content_more:()=>html_content_more,html_document:()=>html_document,html_form:()=>html_form,html_head_body:()=>html_head_body,html_style:()=>html_style,html_style_color:()=>html_style_color,html_style_content:()=>html_style_content,html_text:()=>html_text,html_title:()=>html_title});var utility_namespaceObject={};__webpack_require__.r(utility_namespaceObject),__webpack_require__.d(utility_namespaceObject,{attribute_access:()=>attribute_access,function_call:()=>function_call,function_call_container:()=>function_call_container,function_call_item:()=>function_call_item,raw_block:()=>raw_block,raw_empty:()=>raw_empty,raw_expression:()=>raw_expression,raw_table:()=>raw_table,text_comment:()=>text_comment,text_print_multiple:()=>text_print_multiple,text_print_multiple_container:()=>text_print_multiple_container,text_print_multiple_item:()=>text_print_multiple_item,type_check:()=>type_check});var generators_variables_namespaceObject={};__webpack_require__.r(generators_variables_namespaceObject),__webpack_require__.d(generators_variables_namespaceObject,{controls_type:()=>variables_controls_type,controls_typeLists:()=>variables_controls_typeLists,variables_change:()=>variables_variables_change,variables_get:()=>variables_variables_get,variables_global:()=>variables_variables_global,variables_set:()=>variables_variables_set});var generators_control_namespaceObject={};__webpack_require__.r(generators_control_namespaceObject),__webpack_require__.d(generators_control_namespaceObject,{Panic_with_status_code:()=>Panic_with_status_code,base_setup:()=>control_base_setup,controls_delay:()=>control_controls_delay,controls_flow_statements:()=>control_controls_flow_statements,controls_for:()=>control_controls_for,controls_forEach:()=>control_controls_forEach,controls_for_range:()=>control_controls_for_range,controls_if:()=>control_controls_if,controls_interrupts:()=>controls_interrupts,controls_lambda:()=>control_controls_lambda,controls_main:()=>control_controls_main,controls_millis:()=>controls_millis,controls_nointerrupts:()=>controls_nointerrupts,controls_pass:()=>control_controls_pass,controls_range:()=>control_controls_range,controls_repeat:()=>controls_repeat,controls_repeat_ext:()=>control_controls_repeat_ext,controls_thread:()=>control_controls_thread,controls_try_finally:()=>control_controls_try_finally,controls_whileUntil:()=>control_controls_whileUntil,do_while:()=>control_do_while,garbage_collection:()=>control_garbage_collection,get_mem_alloc:()=>control_get_mem_alloc,get_mem_free:()=>control_get_mem_free,get_unique_identifier:()=>control_get_unique_identifier,reset:()=>control_reset,time_sleep:()=>time_sleep});var generators_math_namespaceObject={};__webpack_require__.r(generators_math_namespaceObject),__webpack_require__.d(generators_math_namespaceObject,{base_map:()=>math_base_map,math_arithmetic:()=>math_math_arithmetic,math_bit:()=>math_math_bit,math_constant:()=>math_math_constant,math_constant_mp:()=>math_math_constant_mp,math_constrain:()=>math_math_constrain,math_dec:()=>math_math_dec,math_indexer_number:()=>math_math_indexer_number,math_map:()=>math_math_map,math_max_min:()=>math_math_max_min,math_number:()=>math_math_number,math_number_base_conversion:()=>math_math_number_base_conversion,math_random:()=>math_math_random,math_random_seed:()=>math_math_random_seed,math_round:()=>math_math_round,math_selfcalcu:()=>math_math_selfcalcu,math_single:()=>math_single,math_to_int:()=>math_math_to_int,math_trig:()=>math_math_trig,text_to_number:()=>math_text_to_number,text_to_number_skulpt:()=>math_text_to_number_skulpt});var generators_text_namespaceObject={};__webpack_require__.r(generators_text_namespaceObject),__webpack_require__.d(generators_text_namespaceObject,{ascii_to_char:()=>text_ascii_to_char,char_to_ascii:()=>text_char_to_ascii,number_to_text:()=>text_number_to_text,os_system:()=>text_os_system,text:()=>generators_text_text,text_capital:()=>text_text_capital,text_center:()=>text_text_center,text_char:()=>text_text_char,text_char_at:()=>text_text_char_at,text_char_at2:()=>text_text_char_at2,text_char_at3:()=>text_text_char_at3,text_compareTo:()=>text_text_compareTo,text_compare_to:()=>text_text_compare_to,text_encode:()=>text_text_encode,text_equals_starts_ends:()=>text_text_equals_starts_ends,text_eval:()=>text_text_eval,text_find:()=>text_text_find,text_format:()=>text_text_format,text_format_noreturn:()=>text_text_format_noreturn,text_join:()=>text_text_join,text_join_seq:()=>text_text_join_seq,text_length:()=>text_text_length,text_random_char:()=>text_text_random_char,text_replace:()=>text_text_replace,text_split:()=>text_text_split,text_strip:()=>text_text_strip,text_substring:()=>text_text_substring,text_substring2:()=>text_text_substring2,text_substring3:()=>text_text_substring3,text_textarea:()=>text_text_textarea});var generators_lists_namespaceObject={};__webpack_require__.r(generators_lists_namespaceObject),__webpack_require__.d(generators_lists_namespaceObject,{list_many_input:()=>lists_list_many_input,list_tolist:()=>lists_list_tolist,list_tolist2:()=>lists_list_tolist2,list_trig:()=>lists_list_trig,lists_2d_get_col_row_data:()=>lists_lists_2d_get_col_row_data,lists_2d_get_data_with_col_row:()=>lists_lists_2d_get_data_with_col_row,lists_append_extend:()=>lists_lists_append_extend,lists_change_to:()=>lists_lists_change_to,lists_change_to_general:()=>lists_lists_change_to_general,lists_clear:()=>lists_lists_clear,lists_create_with:()=>lists_lists_create_with,lists_create_with2:()=>lists_lists_create_with2,lists_create_with_noreturn:()=>lists_lists_create_with_noreturn,lists_create_with_text:()=>lists_lists_create_with_text,lists_create_with_text2:()=>lists_lists_create_with_text2,lists_del_general:()=>lists_lists_del_general,lists_find:()=>lists_lists_find,lists_getIndex3:()=>lists_lists_getIndex3,lists_getSublist3:()=>lists_lists_getSublist3,lists_get_index:()=>lists_lists_get_index,lists_get_random_item:()=>lists_lists_get_random_item,lists_get_random_sublist:()=>lists_lists_get_random_sublist,lists_get_sublist:()=>lists_lists_get_sublist,lists_insert_value:()=>lists_lists_insert_value,lists_insert_value2:()=>lists_lists_insert_value2,lists_pop:()=>lists_lists_pop,lists_remove_at:()=>lists_lists_remove_at,lists_remove_at2:()=>lists_lists_remove_at2,lists_reverse:()=>lists_lists_reverse,lists_setIndex3:()=>lists_lists_setIndex3,lists_set_index:()=>lists_lists_set_index,lists_sort:()=>lists_lists_sort,lists_zip:()=>lists_lists_zip});var generators_dicts_namespaceObject={};__webpack_require__.r(generators_dicts_namespaceObject),__webpack_require__.d(generators_dicts_namespaceObject,{dicts_add_change_del:()=>dicts_dicts_add_change_del,dicts_add_or_change:()=>dicts_dicts_add_or_change,dicts_clear:()=>dicts_dicts_clear,dicts_create_with:()=>dicts_dicts_create_with,dicts_create_with_noreturn:()=>dicts_dicts_create_with_noreturn,dicts_deldict:()=>dicts_dicts_deldict,dicts_delete:()=>dicts_dicts_delete,dicts_get:()=>dicts_dicts_get,dicts_get_default:()=>dicts_dicts_get_default,dicts_items:()=>dicts_dicts_items,dicts_keys:()=>dicts_dicts_keys,dicts_length:()=>dicts_dicts_length,dicts_pop:()=>dicts_dicts_pop,dicts_setdefault:()=>dicts_dicts_setdefault,dicts_to_json:()=>dicts_dicts_to_json,dicts_todict:()=>dicts_dicts_todict,dicts_update:()=>dicts_dicts_update,dicts_values:()=>dicts_dicts_values,json_to_dicts:()=>dicts_json_to_dicts});var generators_logic_namespaceObject={};__webpack_require__.r(generators_logic_namespaceObject),__webpack_require__.d(generators_logic_namespaceObject,{logic_boolean:()=>logic_logic_boolean,logic_compare:()=>logic_logic_compare,logic_compare_continous:()=>logic_logic_compare_continous,logic_is:()=>logic_logic_is,logic_is_in:()=>logic_logic_is_in,logic_negate:()=>logic_logic_negate,logic_null:()=>logic_logic_null,logic_operation:()=>logic_logic_operation,logic_tobool:()=>logic_logic_tobool,logic_true_or_false:()=>logic_logic_true_or_false});var generators_storage_namespaceObject={};__webpack_require__.r(generators_storage_namespaceObject),__webpack_require__.d(generators_storage_namespaceObject,{sdcard_mount:()=>storage_sdcard_mount,sdcard_use_spi_init:()=>storage_sdcard_use_spi_init,storage_can_write_ornot:()=>storage_storage_can_write_ornot,storage_change_dir:()=>storage_storage_change_dir,storage_close_file:()=>storage_storage_close_file,storage_delete_file:()=>storage_storage_delete_file,storage_file_seek:()=>storage_storage_file_seek,storage_file_tell:()=>storage_storage_file_tell,storage_file_write:()=>storage_storage_file_write,storage_fileopen:()=>storage_storage_fileopen,storage_fileopen_new:()=>storage_storage_fileopen_new,storage_fileopen_new_encoding:()=>storage_storage_fileopen_new_encoding,storage_get_a_line:()=>storage_storage_get_a_line,storage_get_contents:()=>storage_storage_get_contents,storage_get_contents_without_para:()=>storage_storage_get_contents_without_para,storage_get_current_dir:()=>storage_storage_get_current_dir,storage_get_file_size:()=>storage_storage_get_file_size,storage_get_filename:()=>storage_storage_get_filename,storage_is_file:()=>storage_storage_is_file,storage_list_all_files:()=>storage_storage_list_all_files,storage_make_dir:()=>storage_storage_make_dir,storage_open_file_with_os:()=>storage_storage_open_file_with_os,storage_rename:()=>storage_storage_rename});var generators_procedures_namespaceObject={};__webpack_require__.r(generators_procedures_namespaceObject),__webpack_require__.d(generators_procedures_namespaceObject,{procedures_callnoreturn:()=>procedures_procedures_callnoreturn,procedures_callreturn:()=>procedures_procedures_callreturn,procedures_defnoreturn:()=>procedures_procedures_defnoreturn,procedures_defreturn:()=>procedures_procedures_defreturn,procedures_ifreturn:()=>procedures_procedures_ifreturn,procedures_return:()=>procedures_procedures_return});var generators_tuple_namespaceObject={};__webpack_require__.r(generators_tuple_namespaceObject),__webpack_require__.d(generators_tuple_namespaceObject,{tuple_change_to:()=>tuple_tuple_change_to,tuple_create_with:()=>tuple_tuple_create_with,tuple_create_with_noreturn:()=>tuple_tuple_create_with_noreturn,tuple_create_with_text2:()=>tuple_tuple_create_with_text2,tuple_create_with_text_return:()=>tuple_tuple_create_with_text_return,tuple_del:()=>tuple_tuple_del,tuple_find:()=>tuple_tuple_find,tuple_getIndex:()=>tuple_tuple_getIndex,tuple_getSublist:()=>tuple_tuple_getSublist,tuple_get_random_item:()=>tuple_tuple_get_random_item,tuple_get_sublist:()=>tuple_tuple_get_sublist,tuple_join:()=>tuple_tuple_join,tuple_length:()=>tuple_tuple_length,tuple_max:()=>tuple_tuple_max,tuple_totuple:()=>tuple_tuple_totuple,tuple_trig:()=>tuple_tuple_trig});var generators_set_namespaceObject={};__webpack_require__.r(generators_set_namespaceObject),__webpack_require__.d(generators_set_namespaceObject,{set_add_discard:()=>set_set_add_discard,set_clear:()=>set_set_clear,set_create_with:()=>set_set_create_with,set_create_with_text_return:()=>set_set_create_with_text_return,set_length:()=>set_set_length,set_operate:()=>set_set_operate,set_operate_update:()=>set_set_operate_update,set_pop:()=>set_set_pop,set_sub:()=>set_set_sub,set_toset:()=>set_set_toset,set_update:()=>set_set_update});var generators_html_namespaceObject={};__webpack_require__.r(generators_html_namespaceObject),__webpack_require__.d(generators_html_namespaceObject,{html_content:()=>html_html_content,html_content_more:()=>html_html_content_more,html_document:()=>html_html_document,html_form:()=>html_html_form,html_head_body:()=>html_html_head_body,html_style:()=>html_html_style,html_style_content:()=>html_html_style_content,html_text:()=>html_html_text,html_title:()=>html_html_title});var generators_utility_namespaceObject={};__webpack_require__.r(generators_utility_namespaceObject),__webpack_require__.d(generators_utility_namespaceObject,{attribute_access:()=>utility_attribute_access,function_call:()=>utility_function_call,raw_block:()=>utility_raw_block,raw_empty:()=>utility_raw_empty,raw_expression:()=>utility_raw_expression,raw_table:()=>utility_raw_table,type_check:()=>utility_type_check});var ai_namespaceObject={};__webpack_require__.r(ai_namespaceObject),__webpack_require__.d(ai_namespaceObject,{AI_ChooseAndGet:()=>AI_ChooseAndGet,AI_Face_match:()=>AI_Face_match,AI_ImageClassify:()=>AI_ImageClassify,AI_ImageClassify_Func:()=>AI_ImageClassify_Func,AI_Nlp:()=>AI_Nlp,AI_Nlp_Func:()=>AI_Nlp_Func,AI_Nlp_Func_sim:()=>AI_Nlp_Func_sim,AI_Nlp_Sim:()=>AI_Nlp_Sim,AI_Nlp_Topic:()=>AI_Nlp_Topic,AI_Nlp_newsSummary:()=>AI_Nlp_newsSummary,AI_Ocr:()=>AI_Ocr,AI_Ocr_Func:()=>AI_Ocr_Func,AI_Speech_asr:()=>AI_Speech_asr,AI_Speech_synthesis:()=>AI_Speech_synthesis,AI_audio:()=>AI_audio,AI_client:()=>AI_client,AI_photo:()=>AI_photo,AI_result:()=>AI_result});var algorithm_namespaceObject={};__webpack_require__.r(algorithm_namespaceObject),__webpack_require__.d(algorithm_namespaceObject,{algorithm_add_path:()=>algorithm_add_path,algorithm_add_school:()=>algorithm_add_school,algorithm_all_books:()=>algorithm_all_books,algorithm_all_books_sequence:()=>algorithm_all_books_sequence,algorithm_book_scale:()=>algorithm_book_scale,algorithm_check_feet:()=>algorithm_check_feet,algorithm_chick_calculate:()=>algorithm_chick_calculate,algorithm_color_seclet:()=>algorithm_color_seclet,algorithm_current_school:()=>algorithm_current_school,algorithm_del_path:()=>algorithm_del_path,algorithm_delete_book:()=>algorithm_delete_book,algorithm_delete_books:()=>algorithm_delete_books,algorithm_delete_books2:()=>algorithm_delete_books2,algorithm_divide_books:()=>algorithm_divide_books,algorithm_find_path:()=>algorithm_find_path,algorithm_first_book:()=>algorithm_first_book,algorithm_fz_calc:()=>algorithm_fz_calc,algorithm_fz_calc_first_min:()=>algorithm_fz_calc_first_min,algorithm_fz_compare:()=>algorithm_fz_compare,algorithm_fz_move:()=>algorithm_fz_move,algorithm_fz_set_min:()=>algorithm_fz_set_min,algorithm_get_book_num:()=>algorithm_get_book_num,algorithm_get_current_location:()=>algorithm_get_current_location,algorithm_get_half_books:()=>algorithm_get_half_books,algorithm_hxdb_add:()=>algorithm_hxdb_add,algorithm_hxdb_init_soldier:()=>algorithm_hxdb_init_soldier,algorithm_hxdb_last_line:()=>algorithm_hxdb_last_line,algorithm_hxdb_result:()=>algorithm_hxdb_result,algorithm_hxdb_stand_in_line:()=>algorithm_hxdb_stand_in_line,algorithm_init_fzsf:()=>algorithm_init_fzsf,algorithm_init_hxdb:()=>algorithm_init_hxdb,algorithm_init_jttl:()=>algorithm_init_jttl,algorithm_move_recent:()=>algorithm_move_recent,algorithm_new_path:()=>algorithm_new_path,algorithm_next_book:()=>algorithm_next_book,algorithm_no_left:()=>algorithm_no_left,algorithm_no_path:()=>algorithm_no_path,algorithm_no_ring2:()=>algorithm_no_ring2,algorithm_not_home:()=>algorithm_not_home,algorithm_not_school:()=>algorithm_not_school,algorithm_number_add:()=>algorithm_number_add,algorithm_number_zero:()=>algorithm_number_zero,algorithm_prepare:()=>algorithm_prepare,algorithm_prepare2:()=>algorithm_prepare2,algorithm_prepare_2_1:()=>algorithm_prepare_2_1,algorithm_prepare_2_2:()=>algorithm_prepare_2_2,algorithm_print_book2:()=>algorithm_print_book2,algorithm_print_divide:()=>algorithm_print_divide,algorithm_print_jttl_answer:()=>algorithm_print_jttl_answer,algorithm_print_number:()=>algorithm_print_number,algorithm_print_path:()=>algorithm_print_path,algorithm_print_path2:()=>algorithm_print_path2,algorithm_print_sequence:()=>algorithm_print_sequence,algorithm_rabbit_add:()=>algorithm_rabbit_add,algorithm_rabbit_number_in_range:()=>algorithm_rabbit_number_in_range,algorithm_rabbit_zero:()=>algorithm_rabbit_zero,algorithm_return_path:()=>algorithm_return_path,algorithm_set_path:()=>algorithm_set_path,algorithm_two_left:()=>algorithm_two_left,algorithm_void_path:()=>algorithm_void_path,algorithm_yes_ring2:()=>algorithm_yes_ring2,hanoi_init:()=>hanoi_init,hanoi_init_offline:()=>hanoi_init_offline,hanoi_move:()=>hanoi_move});var communicate_namespaceObject={};__webpack_require__.r(communicate_namespaceObject),__webpack_require__.d(communicate_namespaceObject,{requests_attribute:()=>requests_attribute,requests_get:()=>requests_get,requests_get_old:()=>requests_get_old,requests_method:()=>requests_method,requests_post:()=>requests_post});var cv_namespaceObject={};__webpack_require__.r(cv_namespaceObject),__webpack_require__.d(cv_namespaceObject,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});var data_namespaceObject={};__webpack_require__.r(data_namespaceObject),__webpack_require__.d(data_namespaceObject,{array_create:()=>array_create,array_toarray:()=>array_toarray,dataframe_aggregate_func:()=>dataframe_aggregate_func,dataframe_create:()=>dataframe_create,dataframe_create_from_index:()=>dataframe_create_from_index,dataframe_create_from_one_index:()=>dataframe_create_from_one_index,dataframe_fillna:()=>dataframe_fillna,dataframe_get:()=>dataframe_get,dataframe_groupby:()=>dataframe_groupby,dataframe_head_tail:()=>dataframe_head_tail,dataframe_info:()=>dataframe_info,dataframe_median:()=>dataframe_median,dataframe_select:()=>dataframe_select,dataframe_sort_values:()=>dataframe_sort_values,matrix_multiplication:()=>matrix_multiplication,matrix_transpose:()=>matrix_transpose,numpy_argmin_template_match:()=>numpy_argmin_template_match,numpy_astype:()=>numpy_astype,numpy_c_:()=>numpy_c_,numpy_dot:()=>numpy_dot,numpy_linalg_det:()=>numpy_linalg_det,numpy_linalg_inv:()=>numpy_linalg_inv,numpy_max:()=>numpy_max,numpy_mean:()=>numpy_mean,numpy_mean_digit:()=>numpy_mean_digit,numpy_min:()=>numpy_min,numpy_ones:()=>numpy_ones,numpy_random_random:()=>numpy_random_random,numpy_reshape:()=>numpy_reshape,numpy_shape:()=>numpy_shape,numpy_size:()=>numpy_size,numpy_square:()=>numpy_square,numpy_std:()=>numpy_std,numpy_sum:()=>numpy_sum,numpy_trig:()=>numpy_trig,pandas_drop_columns:()=>pandas_drop_columns,pandas_dropna:()=>pandas_dropna,pandas_readcsv:()=>pandas_readcsv,pl_axes:()=>pl_axes,pl_bar:()=>pl_bar,pl_hist:()=>pl_hist,pl_label:()=>pl_label,pl_legend:()=>pl_legend,pl_pie:()=>pl_pie,pl_plot:()=>pl_plot,pl_plot_bar:()=>pl_plot_bar,pl_plot_easy:()=>pl_plot_easy,pl_plot_scatter:()=>pl_plot_scatter,pl_plot_xy:()=>pl_plot_xy,pl_savefig:()=>pl_savefig,pl_show:()=>pl_show,pl_subplot:()=>pl_subplot,pl_text:()=>pl_text,pl_ticks:()=>pl_ticks,pl_title:()=>pl_title,plot_axes:()=>plot_axes,plot_bar:()=>plot_bar,plot_hist:()=>plot_hist,plot_label:()=>plot_label,plot_legend:()=>plot_legend,plot_pie:()=>plot_pie,plot_plot:()=>plot_plot,plot_plot_bar:()=>plot_plot_bar,plot_plot_easy:()=>plot_plot_easy,plot_plot_scatter:()=>plot_plot_scatter,plot_plot_xy:()=>plot_plot_xy,plot_savefig:()=>plot_savefig,plot_show:()=>plot_show,plot_subplot:()=>plot_subplot,plot_text:()=>plot_text,plot_ticks:()=>plot_ticks,plot_title:()=>plot_title,py_sum:()=>py_sum,pylab_imshow:()=>pylab_imshow,series_create:()=>series_create,series_create_from_index:()=>series_create_from_index,series_create_from_text:()=>series_create_from_text,series_get_num:()=>series_get_num,series_index_value:()=>series_index_value});var datastructure_namespaceObject={};__webpack_require__.r(datastructure_namespaceObject),__webpack_require__.d(datastructure_namespaceObject,{ds_add_node_by_attr:()=>ds_add_node_by_attr,ds_add_node_by_name:()=>ds_add_node_by_name,ds_create_linkedlist:()=>ds_create_linkedlist,ds_create_linkedlist_container:()=>ds_create_linkedlist_container,ds_create_linkedlist_item:()=>ds_create_linkedlist_item,ds_create_node:()=>ds_create_node,ds_del_node_by_attr:()=>ds_del_node_by_attr,ds_del_node_by_name:()=>ds_del_node_by_name,ds_get_node_attr:()=>ds_get_node_attr,ds_reverse_linkedlist:()=>ds_reverse_linkedlist,ds_set_node_attr:()=>ds_set_node_attr});var factory_namespaceObject={};__webpack_require__.r(factory_namespaceObject),__webpack_require__.d(factory_namespaceObject,{factory_block:()=>factory_block,factory_block_return:()=>factory_block_return,factory_block_return_with_textarea:()=>factory_block_return_with_textarea,factory_block_with_textarea:()=>factory_block_with_textarea,factory_callMethod_noreturn:()=>factory_callMethod_noreturn,factory_callMethod_return:()=>factory_callMethod_return,factory_create_with_container:()=>factory_create_with_container,factory_create_with_item:()=>factory_create_with_item,factory_declare:()=>factory_declare,factory_from_import:()=>factory_from_import,factory_function_noreturn:()=>factory_function_noreturn,factory_function_return:()=>factory_function_return,factory_import:()=>factory_import});var hardware_namespaceObject={};__webpack_require__.r(hardware_namespaceObject),__webpack_require__.d(hardware_namespaceObject,{hardware_arduino_analog_read:()=>hardware_arduino_analog_read,hardware_arduino_analog_write:()=>hardware_arduino_analog_write,hardware_arduino_digital_read:()=>hardware_arduino_digital_read,hardware_arduino_digital_write:()=>hardware_arduino_digital_write,hardware_arduino_start:()=>hardware_arduino_start,inout_highlow:()=>inout_highlow});var inout_namespaceObject={};__webpack_require__.r(inout_namespaceObject),__webpack_require__.d(inout_namespaceObject,{inout_input:()=>inout_input,inout_print:()=>inout_print,inout_print_container:()=>inout_print_container,inout_print_end:()=>inout_print_end,inout_print_inline:()=>inout_print_inline,inout_print_item:()=>inout_print_item,inout_print_many:()=>inout_print_many,inout_type_input:()=>inout_type_input,pyinout_type_input:()=>pyinout_type_input});var iot_namespaceObject={};__webpack_require__.r(iot_namespaceObject),__webpack_require__.d(iot_namespaceObject,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE,IOT_EMQX_PING:()=>IOT_EMQX_PING,IOT_FORMATTING:()=>IOT_FORMATTING,IOT_FORMAT_STRING:()=>IOT_FORMAT_STRING,IOT_MIXIO_NTP:()=>IOT_MIXIO_NTP,IOT_MIXIO_PUBLISH:()=>IOT_MIXIO_PUBLISH,IOT_MIXIO_SUBSCRIBE:()=>IOT_MIXIO_SUBSCRIBE,IOT_MIXIO_UNSUBSCRIBE:()=>IOT_MIXIO_UNSUBSCRIBE,iot_checkonenet:()=>iot_checkonenet,iot_client_onboard:()=>iot_client_onboard,iot_create_with_item:()=>iot_create_with_item,iot_http_client:()=>iot_http_client,iot_http_data:()=>iot_http_data,iot_mixio_check:()=>iot_mixio_check,iot_mixio_connect:()=>iot_mixio_connect,iot_mixio_connect_only:()=>iot_mixio_connect_only,iot_mixio_disconnect:()=>iot_mixio_disconnect,iot_mixio_format_msg:()=>iot_mixio_format_msg,iot_mixio_format_topic:()=>iot_mixio_format_topic,iot_mixly_key:()=>iot_mixly_key,iot_mixly_key_py:()=>iot_mixly_key_py,iot_mqtt_client:()=>iot_mqtt_client,iot_mqtt_data:()=>iot_mqtt_data,iot_onenet_check:()=>iot_onenet_check,iot_onenet_connect:()=>iot_onenet_connect,iot_onenet_disconnect:()=>iot_onenet_disconnect,iot_onenet_publish:()=>iot_onenet_publish,iot_onenet_publish_dict:()=>iot_onenet_publish_dict,iot_onenetconnect:()=>iot_onenetconnect,iot_onenetdisconnect:()=>iot_onenetdisconnect,iot_publish:()=>iot_publish,iot_publish_container:()=>iot_publish_container,iot_publish_item:()=>iot_publish_item});var pins_namespaceObject={};__webpack_require__.r(pins_namespaceObject),__webpack_require__.d(pins_namespaceObject,{pins_analog_read:()=>pins_analog_read,pins_analog_write:()=>pins_analog_write,pins_digital_read:()=>pins_digital_read,pins_digital_write:()=>pins_digital_write});var serial_namespaceObject={};__webpack_require__.r(serial_namespaceObject),__webpack_require__.d(serial_namespaceObject,{serial_close:()=>serial_close,serial_open:()=>serial_open,serial_read_b:()=>serial_read_b,serial_write:()=>serial_write});var sklearn_namespaceObject={};__webpack_require__.r(sklearn_namespaceObject),__webpack_require__.d(sklearn_namespaceObject,{sklearn_DecisionTreeClassifier_Regressor:()=>sklearn_DecisionTreeClassifier_Regressor,sklearn_GaussianNB:()=>sklearn_GaussianNB,sklearn_KMeans:()=>sklearn_KMeans,sklearn_KNeighborsClassifier_Regressor:()=>sklearn_KNeighborsClassifier_Regressor,sklearn_LinearRegression:()=>sklearn_LinearRegression,sklearn_RandomForestClassifier_Regressor:()=>sklearn_RandomForestClassifier_Regressor,sklearn_Ridge:()=>sklearn_Ridge,sklearn_cluster_centers_labels_inertia:()=>sklearn_cluster_centers_labels_inertia,sklearn_coef_intercept:()=>sklearn_coef_intercept,sklearn_data_target:()=>sklearn_data_target,sklearn_fit:()=>sklearn_fit,sklearn_fit_no_target:()=>sklearn_fit_no_target,sklearn_load:()=>sklearn_load,sklearn_make_blobs:()=>sklearn_make_blobs,sklearn_make_classification:()=>sklearn_make_classification,sklearn_make_regression:()=>sklearn_make_regression,sklearn_predict:()=>sklearn_predict,sklearn_save_load_model:()=>sklearn_save_load_model,sklearn_score:()=>sklearn_score,sklearn_score_no_target:()=>sklearn_score_no_target,sklearn_train_test_split:()=>sklearn_train_test_split,sklearn_train_test_split_no_target:()=>sklearn_train_test_split_no_target});var system_namespaceObject={};__webpack_require__.r(system_namespaceObject),__webpack_require__.d(system_namespaceObject,{Panic_with_status_code:()=>system_Panic_with_status_code,base_delay:()=>base_delay,controls_millis:()=>system_controls_millis,controls_mstimer2:()=>controls_mstimer2,controls_mstimer2_start:()=>controls_mstimer2_start,controls_mstimer2_stop:()=>controls_mstimer2_stop,reset:()=>system_reset,time_localtime:()=>time_localtime,time_sleep:()=>system_time_sleep});var turtle_namespaceObject={};__webpack_require__.r(turtle_namespaceObject),__webpack_require__.d(turtle_namespaceObject,{turtle_bgcolor:()=>turtle_bgcolor,turtle_bgcolor_hex:()=>turtle_bgcolor_hex,turtle_bgcolor_hex_new:()=>turtle_bgcolor_hex_new,turtle_circle:()=>turtle_circle,turtle_circle_advanced:()=>turtle_circle_advanced,turtle_clear:()=>turtle_clear,turtle_clone:()=>turtle_clone,turtle_color:()=>turtle_color,turtle_color_hex:()=>turtle_color_hex,turtle_color_seclet:()=>turtle_color_seclet,turtle_create:()=>turtle_create,turtle_done:()=>turtle_done,turtle_exitonclick:()=>turtle_exitonclick,turtle_fill:()=>turtle_fill,turtle_fillcolor:()=>turtle_fillcolor,turtle_fillcolor_hex:()=>turtle_fillcolor_hex,turtle_fillcolor_hex_new:()=>turtle_fillcolor_hex_new,turtle_getscreen:()=>turtle_getscreen,turtle_goto:()=>turtle_goto,turtle_listen:()=>turtle_listen,turtle_move:()=>turtle_move,turtle_numinput:()=>turtle_numinput,turtle_onclick:()=>turtle_onclick,turtle_onkey:()=>turtle_onkey,turtle_ontimer:()=>turtle_ontimer,turtle_pencolor:()=>turtle_pencolor,turtle_pencolor_hex:()=>turtle_pencolor_hex,turtle_pencolor_hex_new:()=>turtle_pencolor_hex_new,turtle_penup:()=>turtle_penup,turtle_pos_shape:()=>turtle_pos_shape,turtle_rotate:()=>turtle_rotate,turtle_screen_delay:()=>turtle_screen_delay,turtle_screen_savefig:()=>turtle_screen_savefig,turtle_setheading:()=>turtle_setheading,turtle_setxy:()=>turtle_setxy,turtle_shape:()=>turtle_shape,turtle_shapesize:()=>turtle_shapesize,turtle_size:()=>turtle_size,turtle_size_speed:()=>turtle_size_speed,turtle_speed:()=>turtle_speed,turtle_textinput:()=>turtle_textinput,turtle_visible:()=>turtle_visible,turtle_write:()=>turtle_write,turtle_write_format:()=>turtle_write_format,turtle_write_format_skulpt:()=>turtle_write_format_skulpt});var generators_ai_namespaceObject={};__webpack_require__.r(generators_ai_namespaceObject),__webpack_require__.d(generators_ai_namespaceObject,{AI_ChooseAndGet:()=>ai_AI_ChooseAndGet,AI_Face_match:()=>ai_AI_Face_match,AI_ImageClassify:()=>ai_AI_ImageClassify,AI_ImageClassify_Func:()=>ai_AI_ImageClassify_Func,AI_Nlp:()=>ai_AI_Nlp,AI_Nlp_Func:()=>ai_AI_Nlp_Func,AI_Nlp_Func_sim:()=>ai_AI_Nlp_Func_sim,AI_Nlp_Sim:()=>ai_AI_Nlp_Sim,AI_Nlp_Topic:()=>ai_AI_Nlp_Topic,AI_Nlp_newsSummary:()=>ai_AI_Nlp_newsSummary,AI_Ocr:()=>ai_AI_Ocr,AI_Ocr_Func:()=>ai_AI_Ocr_Func,AI_Speech_asr:()=>ai_AI_Speech_asr,AI_Speech_synthesis:()=>ai_AI_Speech_synthesis,AI_audio:()=>ai_AI_audio,AI_client:()=>ai_AI_client,AI_photo:()=>ai_AI_photo,AI_result:()=>ai_AI_result});var generators_algorithm_namespaceObject={};__webpack_require__.r(generators_algorithm_namespaceObject),__webpack_require__.d(generators_algorithm_namespaceObject,{algorithm_add_path:()=>algorithm_algorithm_add_path,algorithm_add_school:()=>algorithm_algorithm_add_school,algorithm_all_books:()=>algorithm_algorithm_all_books,algorithm_all_books_sequence:()=>algorithm_algorithm_all_books_sequence,algorithm_book_scale:()=>algorithm_algorithm_book_scale,algorithm_check_feet:()=>algorithm_algorithm_check_feet,algorithm_chick_calculate:()=>algorithm_algorithm_chick_calculate,algorithm_color_seclet:()=>algorithm_algorithm_color_seclet,algorithm_current_school:()=>algorithm_algorithm_current_school,algorithm_del_path:()=>algorithm_algorithm_del_path,algorithm_delete_book:()=>algorithm_algorithm_delete_book,algorithm_divide_books:()=>algorithm_algorithm_divide_books,algorithm_find_path:()=>algorithm_algorithm_find_path,algorithm_first_book:()=>algorithm_algorithm_first_book,algorithm_fz_calc:()=>algorithm_algorithm_fz_calc,algorithm_fz_compare:()=>algorithm_algorithm_fz_compare,algorithm_fz_move:()=>algorithm_algorithm_fz_move,algorithm_fz_set_min:()=>algorithm_algorithm_fz_set_min,algorithm_get_current_location:()=>algorithm_algorithm_get_current_location,algorithm_get_half_books:()=>algorithm_algorithm_get_half_books,algorithm_hxdb_add:()=>algorithm_algorithm_hxdb_add,algorithm_hxdb_init_soldier:()=>algorithm_algorithm_hxdb_init_soldier,algorithm_hxdb_last_line:()=>algorithm_algorithm_hxdb_last_line,algorithm_hxdb_result:()=>algorithm_algorithm_hxdb_result,algorithm_hxdb_stand_in_line:()=>algorithm_algorithm_hxdb_stand_in_line,algorithm_init_fzsf:()=>algorithm_algorithm_init_fzsf,algorithm_init_hxdb:()=>algorithm_algorithm_init_hxdb,algorithm_init_jttl:()=>algorithm_algorithm_init_jttl,algorithm_move_recent:()=>algorithm_algorithm_move_recent,algorithm_new_path:()=>algorithm_algorithm_new_path,algorithm_next_book:()=>algorithm_algorithm_next_book,algorithm_no_left:()=>algorithm_algorithm_no_left,algorithm_no_path:()=>algorithm_algorithm_no_path,algorithm_no_ring2:()=>algorithm_algorithm_no_ring2,algorithm_not_home:()=>algorithm_algorithm_not_home,algorithm_not_school:()=>algorithm_algorithm_not_school,algorithm_number_add:()=>algorithm_algorithm_number_add,algorithm_number_zero:()=>algorithm_algorithm_number_zero,algorithm_prepare:()=>algorithm_algorithm_prepare,algorithm_prepare2:()=>algorithm_algorithm_prepare2,algorithm_prepare_2_1:()=>algorithm_algorithm_prepare_2_1,algorithm_prepare_2_2:()=>algorithm_algorithm_prepare_2_2,algorithm_print_book2:()=>algorithm_algorithm_print_book2,algorithm_print_jttl_answer:()=>algorithm_algorithm_print_jttl_answer,algorithm_print_number:()=>algorithm_algorithm_print_number,algorithm_print_path:()=>algorithm_algorithm_print_path,algorithm_print_path2:()=>algorithm_algorithm_print_path2,algorithm_rabbit_add:()=>algorithm_algorithm_rabbit_add,algorithm_rabbit_number_in_range:()=>algorithm_algorithm_rabbit_number_in_range,algorithm_rabbit_zero:()=>algorithm_algorithm_rabbit_zero,algorithm_return_path:()=>algorithm_algorithm_return_path,algorithm_set_path:()=>algorithm_algorithm_set_path,algorithm_two_left:()=>algorithm_algorithm_two_left,algorithm_void_path:()=>algorithm_algorithm_void_path,algorithm_yes_ring2:()=>algorithm_algorithm_yes_ring2,hanoi_init:()=>algorithm_hanoi_init,hanoi_init_offline:()=>algorithm_hanoi_init_offline,hanoi_move:()=>algorithm_hanoi_move});var generators_communicate_namespaceObject={};__webpack_require__.r(generators_communicate_namespaceObject),__webpack_require__.d(generators_communicate_namespaceObject,{requests_attribute:()=>communicate_requests_attribute,requests_get:()=>communicate_requests_get,requests_get_old:()=>communicate_requests_get_old,requests_method:()=>communicate_requests_method,requests_post:()=>communicate_requests_post});var generators_data_namespaceObject={};__webpack_require__.r(generators_data_namespaceObject),__webpack_require__.d(generators_data_namespaceObject,{array_create:()=>data_array_create,array_toarray:()=>data_array_toarray,dataframe_aggregate_func:()=>data_dataframe_aggregate_func,dataframe_create:()=>data_dataframe_create,dataframe_create_from_index:()=>data_dataframe_create_from_index,dataframe_create_from_one_index:()=>data_dataframe_create_from_one_index,dataframe_fillna:()=>data_dataframe_fillna,dataframe_get:()=>data_dataframe_get,dataframe_groupby:()=>data_dataframe_groupby,dataframe_head_tail:()=>data_dataframe_head_tail,dataframe_info:()=>data_dataframe_info,dataframe_median:()=>data_dataframe_median,dataframe_select:()=>data_dataframe_select,dataframe_sort_values:()=>data_dataframe_sort_values,matrix_multiplication:()=>data_matrix_multiplication,matrix_transpose:()=>data_matrix_transpose,numpy_argmin_template_match:()=>data_numpy_argmin_template_match,numpy_astype:()=>data_numpy_astype,numpy_c_:()=>data_numpy_c_,numpy_dot:()=>data_numpy_dot,numpy_linalg_det:()=>data_numpy_linalg_det,numpy_linalg_inv:()=>data_numpy_linalg_inv,numpy_max:()=>data_numpy_max,numpy_mean:()=>data_numpy_mean,numpy_mean_digit:()=>data_numpy_mean_digit,numpy_min:()=>data_numpy_min,numpy_ones:()=>data_numpy_ones,numpy_random_random:()=>data_numpy_random_random,numpy_reshape:()=>data_numpy_reshape,numpy_shape:()=>data_numpy_shape,numpy_size:()=>data_numpy_size,numpy_square:()=>data_numpy_square,numpy_std:()=>data_numpy_std,numpy_sum:()=>data_numpy_sum,numpy_trig:()=>data_numpy_trig,pandas_drop_columns:()=>data_pandas_drop_columns,pandas_dropna:()=>data_pandas_dropna,pandas_readcsv:()=>data_pandas_readcsv,pl_axes:()=>data_pl_axes,pl_bar:()=>data_pl_bar,pl_hist:()=>data_pl_hist,pl_label:()=>data_pl_label,pl_legend:()=>data_pl_legend,pl_pie:()=>data_pl_pie,pl_plot:()=>data_pl_plot,pl_plot_bar:()=>data_pl_plot_bar,pl_plot_easy:()=>data_pl_plot_easy,pl_plot_scatter:()=>data_pl_plot_scatter,pl_plot_xy:()=>data_pl_plot_xy,pl_savefig:()=>data_pl_savefig,pl_show:()=>data_pl_show,pl_subplot:()=>data_pl_subplot,pl_text:()=>data_pl_text,pl_ticks:()=>data_pl_ticks,pl_title:()=>data_pl_title,plot_axes:()=>data_plot_axes,plot_bar:()=>data_plot_bar,plot_hist:()=>data_plot_hist,plot_label:()=>data_plot_label,plot_legend:()=>data_plot_legend,plot_pie:()=>data_plot_pie,plot_plot:()=>data_plot_plot,plot_plot_bar:()=>data_plot_plot_bar,plot_plot_easy:()=>data_plot_plot_easy,plot_plot_scatter:()=>data_plot_plot_scatter,plot_plot_xy:()=>data_plot_plot_xy,plot_savefig:()=>data_plot_savefig,plot_show:()=>data_plot_show,plot_subplot:()=>data_plot_subplot,plot_text:()=>data_plot_text,plot_ticks:()=>data_plot_ticks,plot_title:()=>data_plot_title,py_sum:()=>data_py_sum,pylab_imshow:()=>data_pylab_imshow,series_create:()=>data_series_create,series_create_from_index:()=>data_series_create_from_index,series_create_from_text:()=>data_series_create_from_text,series_get_num:()=>data_series_get_num,series_index_value:()=>data_series_index_value});var generators_datastructure_namespaceObject={};__webpack_require__.r(generators_datastructure_namespaceObject),__webpack_require__.d(generators_datastructure_namespaceObject,{ds_add_node_by_attr:()=>datastructure_ds_add_node_by_attr,ds_add_node_by_name:()=>datastructure_ds_add_node_by_name,ds_create_linkedlist:()=>datastructure_ds_create_linkedlist,ds_create_node:()=>datastructure_ds_create_node,ds_del_node_by_attr:()=>datastructure_ds_del_node_by_attr,ds_del_node_by_name:()=>datastructure_ds_del_node_by_name,ds_get_node_attr:()=>datastructure_ds_get_node_attr,ds_reverse_linkedlist:()=>datastructure_ds_reverse_linkedlist,ds_set_node_attr:()=>datastructure_ds_set_node_attr});var generators_factory_namespaceObject={};__webpack_require__.r(generators_factory_namespaceObject),__webpack_require__.d(generators_factory_namespaceObject,{factory_block:()=>factory_factory_block,factory_block_return:()=>factory_factory_block_return,factory_block_return_with_textarea:()=>factory_factory_block_return_with_textarea,factory_block_with_textarea:()=>factory_factory_block_with_textarea,factory_callMethod_noreturn:()=>factory_factory_callMethod_noreturn,factory_callMethod_return:()=>factory_factory_callMethod_return,factory_declare:()=>factory_factory_declare,factory_from_import:()=>factory_factory_from_import,factory_function_noreturn:()=>factory_factory_function_noreturn,factory_function_return:()=>factory_factory_function_return,factory_import:()=>factory_factory_import});var generators_hardware_namespaceObject={};__webpack_require__.r(generators_hardware_namespaceObject),__webpack_require__.d(generators_hardware_namespaceObject,{hardware_arduino_analog_read:()=>hardware_hardware_arduino_analog_read,hardware_arduino_analog_write:()=>hardware_hardware_arduino_analog_write,hardware_arduino_digital_read:()=>hardware_hardware_arduino_digital_read,hardware_arduino_digital_write:()=>hardware_hardware_arduino_digital_write,hardware_arduino_start:()=>hardware_hardware_arduino_start,inout_highlow:()=>hardware_inout_highlow});var generators_inout_namespaceObject={};__webpack_require__.r(generators_inout_namespaceObject),__webpack_require__.d(generators_inout_namespaceObject,{inout_input:()=>inout_inout_input,inout_print:()=>inout_inout_print,inout_print_end:()=>inout_inout_print_end,inout_print_inline:()=>inout_inout_print_inline,inout_print_many:()=>inout_inout_print_many,inout_type_input:()=>inout_inout_type_input,pyinout_type_input:()=>inout_pyinout_type_input});var generators_iot_namespaceObject={};__webpack_require__.r(generators_iot_namespaceObject),__webpack_require__.d(generators_iot_namespaceObject,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>iot_IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>iot_IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE,IOT_EMQX_PING:()=>iot_IOT_EMQX_PING,IOT_FORMATTING:()=>iot_IOT_FORMATTING,IOT_FORMAT_STRING:()=>iot_IOT_FORMAT_STRING,IOT_MIXIO_NTP:()=>iot_IOT_MIXIO_NTP,IOT_MIXIO_PUBLISH:()=>iot_IOT_MIXIO_PUBLISH,IOT_MIXIO_SUBSCRIBE:()=>iot_IOT_MIXIO_SUBSCRIBE,IOT_MIXIO_UNSUBSCRIBE:()=>iot_IOT_MIXIO_UNSUBSCRIBE,iot_mixio_check:()=>iot_iot_mixio_check,iot_mixio_connect:()=>iot_iot_mixio_connect,iot_mixio_connect_only:()=>iot_iot_mixio_connect_only,iot_mixio_disconnect:()=>iot_iot_mixio_disconnect,iot_mixio_format_msg:()=>iot_iot_mixio_format_msg,iot_mixio_format_topic:()=>iot_iot_mixio_format_topic,iot_mixly_key:()=>iot_iot_mixly_key,iot_mixly_key_py:()=>iot_iot_mixly_key_py});var generators_pins_namespaceObject={};__webpack_require__.r(generators_pins_namespaceObject),__webpack_require__.d(generators_pins_namespaceObject,{pins_analog_read:()=>pins_pins_analog_read,pins_analog_write:()=>pins_pins_analog_write,pins_digital:()=>pins_digital,pins_digital_read:()=>pins_pins_digital_read,pins_digital_write:()=>pins_pins_digital_write});var generators_serial_namespaceObject={};__webpack_require__.r(generators_serial_namespaceObject),__webpack_require__.d(generators_serial_namespaceObject,{serial_close:()=>serial_serial_close,serial_open:()=>serial_serial_open,serial_read_b:()=>serial_serial_read_b,serial_write:()=>serial_serial_write});var generators_sklearn_namespaceObject={};__webpack_require__.r(generators_sklearn_namespaceObject),__webpack_require__.d(generators_sklearn_namespaceObject,{sklearn_DecisionTreeClassifier_Regressor:()=>sklearn_sklearn_DecisionTreeClassifier_Regressor,sklearn_GaussianNB:()=>sklearn_sklearn_GaussianNB,sklearn_KMeans:()=>sklearn_sklearn_KMeans,sklearn_KNeighborsClassifier_Regressor:()=>sklearn_sklearn_KNeighborsClassifier_Regressor,sklearn_LinearRegression:()=>sklearn_sklearn_LinearRegression,sklearn_RandomForestClassifier_Regressor:()=>sklearn_sklearn_RandomForestClassifier_Regressor,sklearn_Ridge:()=>sklearn_sklearn_Ridge,sklearn_cluster_centers_labels_inertia:()=>sklearn_sklearn_cluster_centers_labels_inertia,sklearn_coef_intercept:()=>sklearn_sklearn_coef_intercept,sklearn_data_target:()=>sklearn_sklearn_data_target,sklearn_fit:()=>sklearn_sklearn_fit,sklearn_fit_no_target:()=>sklearn_sklearn_fit_no_target,sklearn_load:()=>sklearn_sklearn_load,sklearn_make_blobs:()=>sklearn_sklearn_make_blobs,sklearn_make_classification:()=>sklearn_sklearn_make_classification,sklearn_make_regression:()=>sklearn_sklearn_make_regression,sklearn_predict:()=>sklearn_sklearn_predict,sklearn_save_load_model:()=>sklearn_sklearn_save_load_model,sklearn_score:()=>sklearn_sklearn_score,sklearn_score_no_target:()=>sklearn_sklearn_score_no_target,sklearn_train_test_split:()=>sklearn_sklearn_train_test_split,sklearn_train_test_split_no_target:()=>sklearn_sklearn_train_test_split_no_target});var generators_system_namespaceObject={};__webpack_require__.r(generators_system_namespaceObject),__webpack_require__.d(generators_system_namespaceObject,{controls_end_program:()=>system_controls_end_program,controls_millis:()=>generators_system_controls_millis,time_localtime:()=>system_time_localtime});var generators_turtle_namespaceObject={};__webpack_require__.r(generators_turtle_namespaceObject),__webpack_require__.d(generators_turtle_namespaceObject,{turtle_bgcolor:()=>turtle_turtle_bgcolor,turtle_bgcolor_hex:()=>turtle_turtle_bgcolor_hex,turtle_bgcolor_hex_new:()=>turtle_turtle_bgcolor_hex_new,turtle_circle:()=>turtle_turtle_circle,turtle_circle_advanced:()=>turtle_turtle_circle_advanced,turtle_clear:()=>turtle_turtle_clear,turtle_clone:()=>turtle_turtle_clone,turtle_color:()=>turtle_turtle_color,turtle_color_hex:()=>turtle_turtle_color_hex,turtle_color_seclet:()=>turtle_turtle_color_seclet,turtle_create:()=>turtle_turtle_create,turtle_done:()=>turtle_turtle_done,turtle_exitonclick:()=>turtle_turtle_exitonclick,turtle_fill:()=>turtle_turtle_fill,turtle_fillcolor:()=>turtle_turtle_fillcolor,turtle_fillcolor_hex:()=>turtle_turtle_fillcolor_hex,turtle_fillcolor_hex_new:()=>turtle_turtle_fillcolor_hex_new,turtle_getscreen:()=>turtle_turtle_getscreen,turtle_goto:()=>turtle_turtle_goto,turtle_listen:()=>turtle_turtle_listen,turtle_move:()=>turtle_turtle_move,turtle_numinput:()=>turtle_turtle_numinput,turtle_onclick:()=>turtle_turtle_onclick,turtle_onkey:()=>turtle_turtle_onkey,turtle_ontimer:()=>turtle_turtle_ontimer,turtle_pencolor:()=>turtle_turtle_pencolor,turtle_pencolor_hex:()=>turtle_turtle_pencolor_hex,turtle_pencolor_hex_new:()=>turtle_turtle_pencolor_hex_new,turtle_penup:()=>turtle_turtle_penup,turtle_pos_shape:()=>turtle_turtle_pos_shape,turtle_rotate:()=>turtle_turtle_rotate,turtle_screen_delay:()=>turtle_turtle_screen_delay,turtle_screen_savefig:()=>turtle_turtle_screen_savefig,turtle_setheading:()=>turtle_turtle_setheading,turtle_setxy:()=>turtle_turtle_setxy,turtle_shape:()=>turtle_turtle_shape,turtle_shapesize:()=>turtle_turtle_shapesize,turtle_size:()=>turtle_turtle_size,turtle_size_speed:()=>turtle_turtle_size_speed,turtle_speed:()=>turtle_turtle_speed,turtle_textinput:()=>turtle_turtle_textinput,turtle_visible:()=>turtle_turtle_visible,turtle_write:()=>turtle_turtle_write,turtle_write_format:()=>turtle_turtle_write_format,turtle_write_format_skulpt:()=>turtle_turtle_write_format_skulpt});const external_Blockly_namespaceObject=Blockly,ZhHansMsg={PYTHON_PYODIDE_IMAGE:"图像"},ZhHansCatgories={},ZhHantMsg={PYTHON_PYODIDE_IMAGE:"影像"},ZhHantCatgories={},EnMsg={PYTHON_PYODIDE_IMAGE:"Image"},EnCatgories={};Object.assign(external_Blockly_namespaceObject.Lang.ZhHans,ZhHansMsg),Object.assign(external_Blockly_namespaceObject.Lang.ZhHant,ZhHantMsg),Object.assign(external_Blockly_namespaceObject.Lang.En,EnMsg),Object.assign(external_Blockly_namespaceObject.Lang.ZhHans.MSG,ZhHansCatgories),Object.assign(external_Blockly_namespaceObject.Lang.ZhHant.MSG,ZhHantCatgories),Object.assign(external_Blockly_namespaceObject.Lang.En.MSG,EnCatgories);const external_Mixly_namespaceObject=Mixly,Variables={NAME_TYPE:"VARIABLE",allVariables:function(e){var t;if(e.getDescendants)t=e.getDescendants();else{if(!e.getAllBlocks)throw"Not Block or Workspace: "+e;t=e.getAllBlocks()}for(var n=Object.create(null),a=0;a1&&(s+=a)):n=s}else n="i";return n}},variables=Variables; /** * @license * Visual Blocks Editor @@ -18,4 +18,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -class Names{constructor(e,t){if(this.variablePrefix_=t||"",this.reservedDict_=Object.create(null),e)for(var n=e.split(","),a=0;a0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+_).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_if_if");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_if_elseif");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_if_else");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_if_elseif":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_if_else":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_range={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},controls_forEach={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("LIST").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_whileUntil={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return{WHILE:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[t]}))}},controls_try_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=document.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(e){var t=this,n=[],a=[];this.elseCount_&&this.removeInput("ELSE");for(var _=this.elseifCount_;_>0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+_).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_try");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_except");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_finally");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_except":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_finally":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+e).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_flow_statements={init:function(){this.setColour(LOOPS_HUE);var e=new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(e,"FLOW").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var t=this;this.setTooltip((function(){var e=t.getFieldValue("FLOW");return{BREAK:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[e]}))},onchange:function(){if(this.workspace){var e=!1,t=this;do{if("controls_repeat"==t.type||"controls_for"==t.type||"controls_forEach"==t.type||"controls_repeat_ext"==t.type||"controls_whileUntil"==t.type||"do_while"==t.type){e=!0;break}t=t.getSurroundParent()}while(t);e?this.setWarningText(null):this.setWarningText(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},controls_for={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_for_range={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}};controls_whileUntil.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],controls_flow_statements.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const controls_if_if={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},controls_if_elseif={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},controls_if_else={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},controls_try={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},controls_except={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},controls_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},controls_repeat_ext={init:function(){this.jsonInit({message0:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:LOOPS_HUE,tooltip:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},controls_lambda={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STAT),this.setOutput(!0)}},controls_pass={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},controls_thread={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},do_while={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(LOOPS_HUE),this.setTooltip("do-while loop"),this.setHelpUrl("")}},garbage_collection={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},get_mem_alloc={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},get_mem_free={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},MATH_HUE=230;external_Blockly_namespaceObject.FieldTextInput.math_number_validator=function(e){return String(e)},external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank=function(e){if(""===e)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(e)?String(e):null};const math_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_constant={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[t]}))}},math_constant_mp={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[t]}))}},math_arithmetic={init:function(){this.setColour(MATH_HUE),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_selfcalcu={init:function(){this.setColour(MATH_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_bit={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},math_trig={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{SIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_SIN,COS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_COS,TAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_LN}[t]}))}},math_dec={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_BIN,"bin"],[external_Blockly_namespaceObject.Msg.MATH_OCT,"oct"],[external_Blockly_namespaceObject.Msg.MATH_HEX,"hex"]];this.setColour(MATH_HUE),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{bin:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_BIN,oct:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_OCT,hex:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_HEX}[e]}))}},math_to_int={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"],[external_Blockly_namespaceObject.Msg.MATH_ABS,"fabs"],[external_Blockly_namespaceObject.Msg.MATH_SQRT,"sqrt"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{sqrt:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_SQ,round:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[e]}))}},math_max_min={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_MAX,"max"],[external_Blockly_namespaceObject.Msg.MIXLY_MIN,"min"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{max:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAX,min:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MIN}[e]}))}},math_number_base_conversion={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_TWO,"two"],[external_Blockly_namespaceObject.Msg.MATH_EIGHT,"eight"],[external_Blockly_namespaceObject.Msg.MATH_TEN,"ten"],[external_Blockly_namespaceObject.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(MATH_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_ZHW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP2").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP"),n={two:external_Blockly_namespaceObject.Msg.MATH_Before_two,eight:external_Blockly_namespaceObject.Msg.MATH_Before_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Before_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Before_sixteen},a=t.getFieldValue("OP2"),_={two:external_Blockly_namespaceObject.Msg.MATH_Behind_two,eight:external_Blockly_namespaceObject.Msg.MATH_Behind_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Behind_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Behind_sixteen};return n[e]+_[a]}))}},math_random={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_INT,"int"],[external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_RANDOM).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TYPE"),n={int:external_Blockly_namespaceObject.Msg.LANG_MATH_INT,float:external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT_RANDOM};return external_Blockly_namespaceObject.Msg.MATH_RANDOM_INT_TOOLTIP+n[e]}))}},math_constrain={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_CONSTRAIN_TOOLTIP)}},math_map={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAP)}},math_indexer_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_random_seed={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},math_round={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ROUND).appendField(external_Blockly_namespaceObject.Msg.TEXT_KEEP),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_ROUND_NEW_TOOLTIP)}},text_to_number={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_BITES,"b"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[e]}))}},text_to_number_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[e]}))}},base_map=math_map,TEXTS_HUE=160,text_text={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}},text_textarea={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}};external_Blockly_namespaceObject.FieldTextInput.char_validator=function(e){if(e.length>1&&"\\"===e.charAt(0)){var t=e.charAt(1);if("0"===t||"b"===t||"f"===t||"n"===t||"r"===t||"t"===t||"\\"===t||"'"===t)return String(e).substring(0,2);if("x"===t&&"0"===e.charAt(2)&&"B"===e.charAt(3))return String(e).substring(0,4)}return String(e).substring(0,1)};const text_char={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput("",external_Blockly_namespaceObject.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(e){if(1==e)var t="../../media/quote2.png";else t="../../media/quote3.png";return new external_Blockly_namespaceObject.FieldImage(t,7,12,'"')}},text_join={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},ascii_to_char={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},char_to_ascii={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},number_to_text={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},text_length={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},text_char_at2={init:function(){this.WHERE_OPTIONS=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM+1+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET,"MODE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=e.getFieldValue("WHERE"),a="";switch(t+" "+n){case"GET FROM_START":case"GET FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(a+=" "+external_Blockly_namespaceObject.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",external_Blockly_namespaceObject.Msg.ONE_BASED_INDEXING?"#1":"#0")),a}));var t=this;this.setTooltip((function(){var e=t.getFieldValue("WHERE"),n={FROM_START:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM};return external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+n[e]+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("statement",!this.outputConnection);var t=this.getInput("AT").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){var t="true"==e.getAttribute("statement");this.updateStatement_(t),e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateStatement_:function(e){e!=!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var t=new external_Blockly_namespaceObject.FieldDropdown(this.WHERE_OPTIONS,(function(t){var n="FROM_START"==t||"FROM_END"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT").appendField(t,"WHERE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},text_char_at={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)}},text_random_char={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},text_substring2={init:function(){this.WHERE_OPTIONS_1=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==external_Blockly_namespaceObject.INPUT_VALUE;e.setAttribute("at1",t);var n=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",n),e},domToMutation:function(e){var t="true"==e.getAttribute("at1"),n="true"==e.getAttribute("at2");this.updateAt_(1,t),this.updateAt_(2,n)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+e).appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+e);var n=new external_Blockly_namespaceObject.FieldDropdown(this["WHERE_OPTIONS_"+e],(function(n){var a="FROM_START"==n||"FROM_END"==n;if(a!=t){var _=this.sourceBlock_;return _.updateAt_(e,a),_.setFieldValue(n,"WHERE"+e),null}}));this.getInput("AT"+e).appendField(n,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},text_substring={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},text_equals_starts_ends={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_EQUALS,"==="],[external_Blockly_namespaceObject.Msg.MIXLY_STARTSWITH,"startswith"],[external_Blockly_namespaceObject.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},text_compare_to={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO_HELP)}},text_capital={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_UPPER,"upper"],[external_Blockly_namespaceObject.Msg.TEXT_TITLE,"title"],[external_Blockly_namespaceObject.Msg.TEXT_CAPITALIZE,"capitalize"],[external_Blockly_namespaceObject.Msg.TEXT_SWAPCASE,"swapcase"],[external_Blockly_namespaceObject.Msg.TEXT_LOWER,"lower"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CAPITAL").setCheck(String),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CAPITAL");return{upper:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[e]}))}},text_center={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_LJUST,"ljust"],[external_Blockly_namespaceObject.Msg.TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_RJUST,"rjust"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(external_Blockly_namespaceObject.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},text_find={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},text_join_seq={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},text_replace={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},text_split={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},text_strip={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH,"strip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"lstrip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{strip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[e]}))}},text_format={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("text_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_create_with_container={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},dicts_create_with_item={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},dicts_keys={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_KEYS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},dicts_get={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_TOOLTIP)}},dicts_get_default={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},dicts_add_or_change={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},dicts_delete={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP)}},dicts_update={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT2").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_clear={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_CLEAR),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_items={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_ITEMS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},dicts_values={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_VALUES),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},dicts_length={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},dicts_deldict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_DELDICT),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_add_change_del={init:function(){this.MODE=[[external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t="";switch(e.getFieldValue("WHERE")){case"INSERT":t=external_Blockly_namespaceObject.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":t=external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP}return t}))},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",t),e},domToMutation:function(e){var t="true"==e.getAttribute("at2");this.updateAt_(t)},updateAt_:function(e){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),e?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var t=new external_Blockly_namespaceObject.FieldDropdown(this.MODE,(function(t){var n="INSERT"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT2").appendField(t,"WHERE")}},dicts_pop={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},dicts_setdefault={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_SETDEFAULT_TOOLTIP)}},dicts_create_with_noreturn={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("dicts_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_todict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},dicts_to_json={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},json_to_dicts={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},LOGIC_HUE=210,logic_compare={init:function(){var e=external_Blockly_namespaceObject.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{EQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[e]})),this.prevBlocks_=[null,null]}},logic_compare_continous={init:function(){var e=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],t=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP1"),this.appendValueInput("C").appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"OP2"),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},logic_operation={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_AND,"AND"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_OR,"OR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_NOR,"NOR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{AND:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[e]}))}},logic_negate={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},logic_boolean={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TOOLTIP)}},logic_null={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LOGIC_NULL),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NULL_TOOLTIP)}},logic_true_or_false={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},logic_is_in={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_APPEND_TO,"in"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.IN)}},logic_is={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},logic_tobool={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},STORAGE_HUE=0,storage_open_file_with_os={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("fn").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},storage_fileopen={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},storage_fileopen_new={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,s=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+s}))}},storage_fileopen_new_encoding={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,s=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+s}))}},storage_file_write={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},storage_get_contents_without_para={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},storage_get_contents={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[t]+"x"+a}))}},storage_get_a_line={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MICROBIT_PYTHON_TYPE)}},storage_can_write_ornot={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.HTML_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},storage_get_filename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},storage_close_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},storage_list_all_files={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const storage_delete_file={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},storage_get_file_size={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},storage_file_tell={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},storage_file_seek={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[t]+_+"x"+a}))}},storage_get_current_dir={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},storage_make_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("PATH").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET+{mkdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},storage_rename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},storage_change_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},storage_is_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_FILE,"isfile"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},sdcard_use_spi_init={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("SPISUB").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP+external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sdcard_mount={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Procedures={};Procedures.NAME_TYPE=external_Blockly_namespaceObject.PROCEDURE_CATEGORY_NAME,Procedures.allProcedures=function(e){for(var t=e.getAllBlocks(!1),n=[],a=[],_=0;_"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},html_form={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_FORM_CONTENT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_TEXT,"text"],[external_Blockly_namespaceObject.Msg.HTML_EMAIL,"email"],[external_Blockly_namespaceObject.Msg.HTML_NUMBER,"number"],[external_Blockly_namespaceObject.Msg.HTML_PASSWORD,"password"],[external_Blockly_namespaceObject.Msg.HTML_CHECKBOX,"checkbox"],[external_Blockly_namespaceObject.Msg.HTML_RADIOBUTTON,"radiobutton"],[external_Blockly_namespaceObject.Msg.HTML_BUTTON,"button"],[external_Blockly_namespaceObject.Msg.HTML_COLOUR,"colour"],[external_Blockly_namespaceObject.Msg.HTML_DATE,"date"],[external_Blockly_namespaceObject.Msg.HTML_LOCALTIME,"local time"],[external_Blockly_namespaceObject.Msg.HTML_FILE,"file"],[external_Blockly_namespaceObject.Msg.HTML_HIDDEN,"hidden"],[external_Blockly_namespaceObject.Msg.HTML_IMAGE,"image"],[external_Blockly_namespaceObject.Msg.HTML_MONTH,"month"],[external_Blockly_namespaceObject.Msg.HTML_RANGE,"range"],[external_Blockly_namespaceObject.Msg.HTML_RESET,"reset"],[external_Blockly_namespaceObject.Msg.HTML_SEARCH,"search"],[external_Blockly_namespaceObject.Msg.HTML_SUBMIT,"submit"],[external_Blockly_namespaceObject.Msg.HTML_TELEPHONENUMBER,"telephone number"],[external_Blockly_namespaceObject.Msg.HTML_TIME,"time"],[external_Blockly_namespaceObject.Msg.HTML_URL,"url"],[external_Blockly_namespaceObject.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_NAME).appendField(new external_Blockly_namespaceObject.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_VALUE).appendField(new external_Blockly_namespaceObject.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_content={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_color={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_text={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_TEXT).appendField(new external_Blockly_namespaceObject.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},UTILITY_HUE=160,raw_table={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTable(""),"TEXT")}},raw_block={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT")}},raw_expression={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},raw_empty={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},text_comment={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendTitle("Comment:").appendTitle(new external_Blockly_namespaceObject.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},type_check={init:function(){this.setColour(UTILITY_HUE),this.appendValueInput("VALUE").appendField(external_Blockly_namespaceObject.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},text_print_multiple={init:function(){this.setColour(UTILITY_HUE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=external_Blockly_namespaceObject.Block.obtain(e,"text_print_multiple_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;a= stop:"," yield start"," start -= abs(step)"])};if(e=function(e,t,n){return"("+e+" <= "+t+") and "+o()+"("+e+", "+t+", "+n+") or "+r()+"("+e+", "+t+", "+n+")"},external_Blockly_namespaceObject.isNumber(a)&&external_Blockly_namespaceObject.isNumber(_)&&external_Blockly_namespaceObject.isNumber(l))a=parseFloat(a),_=parseFloat(_),l=Math.abs(parseFloat(l)),0==a%1&&0==_%1&&0==l%1?(a<=_?(_++,e=0==a&&1==l?_:a+", "+_,1!=l&&(e+=", "+l)):e=a+", "+--_+", -"+l,e="range("+e+")"):(e=a<_?o():r(),e+="("+a+", "+_+", "+l+")");else{var p=function(e,a){if(external_Blockly_namespaceObject.isNumber(e))e=parseFloat(e);else{var _=t.variableDB_.getDistinctName(n+a,external_Blockly_namespaceObject.Variables.NAME_TYPE);i+=_+" = "+e+"\n",e=_}return e};a=p(a,"_start"),_=p(_,"_end");p(l,"_inc"),e="number"==typeof a&&"number"==typeof _?a<_?o(0,_):r(0,_):e(a,_,l)}return i+="for "+n+" in "+e+":\n"+s},control_controls_for_range=function(e,t){var n=t.variableDB_.getName(e.getFieldValue("VAR"),external_Blockly_namespaceObject.Variables.NAME_TYPE),a=t.valueToCode(e,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(e,"TO",t.ORDER_NONE)||"0",l=t.valueToCode(e,"STEP",t.ORDER_NONE)||"1",s=t.statementToCode(e,"DO"),i=t.addLoopTrap(s,e.id)||t.PASS;return t.setups_.mixly_range="def mixly_range(start, stop, step):\n for i in range(start, stop + 1, step):\n yield i\n\n","for "+n+" in mixly_range("+a+", "+_+", "+l+"):\n"+i},control_controls_whileUntil=function(e,t){var n="UNTIL"==e.getFieldValue("MODE"),a=t.valueToCode(e,"BOOL",t.ORDER_NONE)||"False",_=t.statementToCode(e,"DO");return n&&(a="not "+a),"while "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_flow_statements=function(e){switch(e.getFieldValue("FLOW")){case"BREAK":return"break\n";case"CONTINUE":return"continue\n"}throw"Unknown flow statement."},control_controls_delay=function(e,t){return"sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},Panic_with_status_code=function(e,t){return"panic("+(t.valueToCode(this,"STATUS_CODE",t.ORDER_ATOMIC)||"1000")+")\n"},controls_millis=function(e,t){t.definitions_.import_time="import time";return["time.time()",t.ORDER_ATOMIC]},control_reset=function(e,t){return t.definitions_.import_microbit="from microbit import *","reset()\n"},controls_interrupts=function(){return"interrupts();\n"},controls_nointerrupts=function(){return"noInterrupts();\n"},control_controls_forEach=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"''",a=t.valueToCode(e,"LIST",t.ORDER_RELATIONAL)||"[]",_=t.statementToCode(e,"DO");return"for "+n+" in "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_range=function(e,t){return["range("+(t.valueToCode(this,"FROM",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"TO",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"STEP",t.ORDER_NONE)||"1")+")",t.ORDER_ATOMIC]},control_controls_lambda=function(e,t){var n="lambda "+(t.valueToCode(e,"BOOL",t.ORDER_NONE)||"None")+": "+(t.statementToCode(e,"DO")||"pass");return[n=n.replace("\n","").replace(" ",""),t.ORDER_ATOMIC]},time_sleep=function(e,t){return t.definitions_.import_time="import time","time.sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},control_controls_pass=function(){return"pass\n"},control_controls_thread=function(e,t){t.definitions_.import__thread="import _thread";var n=t.valueToCode(this,"VAR",t.ORDER_NONE)||"None";return"_thread.start_new_thread("+t.variableDB_.getName(t.valueToCode(this,"callback",t.ORDER_NONE)||"None",external_Blockly_namespaceObject.Procedures.NAME_TYPE)+", "+n+")\n"},control_do_while=function(e,t){var n=t.valueToCode(this,"select_data",t.ORDER_NONE)||"False",a=t.statementToCode(this,"input_data");return a="true"==this.getFieldValue("type")?a+" if ("+n+"):\n break\n":a+" if not ("+n+"):\n break\n","while True:\n"+(a=t.addLoopTrap(a,this.id)||t.PASS)},control_controls_repeat_ext=function(e,t){var n=t.valueToCode(this,"TIMES",t.ORDER_ATOMIC),a=t.statementToCode(e,"DO");return"for _my_variable in range("+n+"):\n"+(a=t.addLoopTrap(a,e.id)||t.PASS)},control_garbage_collection=function(e,t){t.definitions_.import_gc="import gc";return"gc.collect()\n"},control_get_mem_alloc=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_alloc()\n",t.ORDER_ATOMIC]},control_get_mem_free=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_free()\n",t.ORDER_ATOMIC]},controls_repeat=control_controls_repeat_ext,math_math_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_constant=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_constant_mp=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_bit=function(e,t){var n=this.getFieldValue("OP"),a=t.ORDER_ATOMIC;return["("+(t.valueToCode(this,"A",a)||"0")+n+(t.valueToCode(this,"B",a)||"0")+")",a]},math_math_arithmetic=function(e,t){var n=(a={ADD:[" + ",t.ORDER_ADDITIVE],MINUS:[" - ",t.ORDER_ADDITIVE],MULTIPLY:[" * ",t.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",t.ORDER_MULTIPLICATIVE],QUYU:[" % ",t.ORDER_MULTIPLICATIVE],ZHENGCHU:[" // ",t.ORDER_MULTIPLICATIVE],POWER:[" ** ",t.ORDER_EXPONENTIATION]}[e.getFieldValue("OP")])[0],a=a[1];return[(t.valueToCode(e,"A",a)||"0")+n+(e=t.valueToCode(e,"B",a)||"0"),a]},math_math_selfcalcu=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_RELATIONAL)||"0",a=t.valueToCode(this,"B",t.ORDER_RELATIONAL)||"0";switch(this.getFieldValue("OP")){case"ADD":var _="+=";break;case"MINUS":_="-=";break;case"MULTIPLY":_="*=";break;case"DIVIDE":_="/=";break;case"QUYU":_="%=";break;case"ZHENGCHU":_="//=";break;case"POWER":_="**="}return n+" "+_+" "+a+"\n"},math_single=function(e,t){var n,a=e.getFieldValue("OP");if("NEG"==a)return["-"+(n=t.valueToCode(e,"NUM",t.ORDER_UNARY_SIGN)||"0"),t.ORDER_UNARY_SIGN];switch(t.definitions_.import_math="import math",e="SIN"==a||"COS"==a||"TAN"==a?t.valueToCode(e,"NUM",t.ORDER_MULTIPLICATIVE)||"0":t.valueToCode(e,"NUM",t.ORDER_NONE)||"0",a){case"ABS":n="math.fabs("+e+")";break;case"ROOT":n="math.sqrt("+e+")";break;case"LN":n="math.log("+e+")";break;case"LOG10":n="math.log10("+e+")";break;case"EXP":n="math.exp("+e+")";break;case"POW10":n="math.pow(10,"+e+")";break;case"ROUND":n="round("+e+")";break;case"ROUNDUP":n="math.ceil("+e+")";break;case"ROUNDDOWN":n="math.floor("+e+")";break;case"SIN":n="math.sin("+e+")";break;case"COS":n="math.cos("+e+")";break;case"TAN":n="math.tan("+e+")";break;case"++":n="++("+e+")";break;case"--":n="--("+e+")";break;case"-":n="-("+e+")"}if(n)return[n,t.ORDER_EXPONENTIATION];switch(a){case"ASIN":n="math.degrees(math.asin("+e+"))";break;case"ACOS":n="math.degrees(math.acos("+e+"))";break;case"ATAN":n="math.degrees(math.atan("+e+"))"}return[n,t.ORDER_MULTIPLICATIVE]},math_math_trig=math_single,math_math_dec=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+")",t.ORDER_ATOMIC]},math_math_to_int=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=this.getFieldValue("OP"),_="";return"round"===a?_=a+"("+n+")":(_="math."+a+"("+n+")",t.definitions_.import_math="import math"),[_,t.ORDER_ATOMIC]},math_math_max_min=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=t.valueToCode(this,"B",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+", "+a+")",t.ORDER_ATOMIC]},math_math_random=function(e,t){t.definitions_.import_random="import random";var n=this.getFieldValue("TYPE"),a=t.valueToCode(this,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(this,"TO",t.ORDER_NONE)||"0";if("int"==n)var l="random.randint("+a+", "+_+")";else if("float"==n)l="random.uniform("+a+", "+_+")";return[l,t.ORDER_UNARY_POSTFIX]},math_math_map=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE),a=t.valueToCode(this,"fromLow",t.ORDER_ATOMIC),_=t.valueToCode(this,"fromHigh",t.ORDER_ATOMIC),l=t.valueToCode(this,"toLow",t.ORDER_ATOMIC),s=t.valueToCode(this,"toHigh",t.ORDER_ATOMIC);return t.definitions_.import_mixpy_math_map="from mixpy import math_map",["math_map("+n+", "+a+", "+_+", "+l+", "+s+")",t.ORDER_NONE]},math_math_constrain=function(e,t){return["min(max("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"LOW",t.ORDER_NONE)||"0")+"), "+(t.valueToCode(this,"HIGH",t.ORDER_NONE)||"0")+")",t.ORDER_UNARY_POSTFIX]},math_math_number_base_conversion=function(e,t){var n=e.getFieldValue("OP"),a=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0",_=e.getFieldValue("OP2");t.definitions_.import_math="import math";var l="",s="10";if("two"==n?s="2":"eight"==n?s="8":"ten"==n?s="10":"sixteen"==n&&(s="16"),"two"==_?l="bin":"eight"==_?l="oct":"ten"==_?l="":"sixteen"==_&&(l="hex"),""==l)var i="int(str("+a+"), "+s+")";else i=l+"(int(str("+a+"), "+s+"))";return[i,t.ORDER_ATOMIC]},math_math_random_seed=function(e,t){return t.definitions_.import_random="import random","random.seed("+(t.valueToCode(this,"NUM",t.ORDER_NONE)||"0")+");\n"},math_math_indexer_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_round=function(e,t){return["round("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"VAR",t.ORDER_NONE)||"0")+")",t.ORDER_ATOMIC]},math_text_to_number=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_text_to_number_skulpt=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_base_map=math_math_map,generators_text_text=function(e,t){return[t.quote_(this.getFieldValue("TEXT")),t.ORDER_ATOMIC]},text_text_textarea=function(e,t){return['"""'+this.getFieldValue("VALUE")+'"""',t.ORDER_ATOMIC]},text_text_char=function(e,t){return["'"+this.getFieldValue("TEXT")+"'",t.ORDER_ATOMIC]},text_text_join=function(e,t){return[t.valueToCode(this,"A",t.ORDER_ATOMIC)+" + "+t.valueToCode(this,"B",t.ORDER_ATOMIC),t.ORDER_ADDITIVE]},text_ascii_to_char=function(e,t){return["chr("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},text_char_to_ascii=function(e,t){return["ord("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"a")+")",t.ORDER_ATOMIC]},text_number_to_text=function(e,t){return["str("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},text_text_length=function(e,t){return["len("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+")",t.ORDER_ATOMIC]},text_text_char_at2=function(e,t){var n=e.getFieldValue("WHERE")||"FROM_START",a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""';switch(n){case"FROM_START":return[a+"["+(e=t.getAdjustedInt(e,"AT"))+"]",t.ORDER_ATOMIC];case"FROM_END":return[a+"["+(e=t.getAdjustedInt(e,"AT",1,!0))+"]",t.ORDER_ATOMIC];case"RANDOM":return t.definitions_.import_random="import random",["random.choice("+a+")",t.ORDER_FUNCTION_CALL]}throw"Unhandled combination (lists_getIndex)."},text_text_char_at=function(e,t){return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+"["+(t.valueToCode(this,"AT",t.ORDER_ATOMIC)||0)+"]",t.ORDER_ATOMIC]},text_text_random_char=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""';return t.definitions_.import_random="import random",["random.choice("+n+")",t.ORDER_FUNCTION_CALL]},text_text_equals_starts_ends=function(e,t){var n=t.valueToCode(this,"STR1",t.ORDER_ATOMIC)||'""',a=t.valueToCode(this,"STR2",t.ORDER_ATOMIC)||'""',_=this.getFieldValue("DOWHAT");return"==="===_?[n+" == "+a,t.ORDER_ATOMIC]:[n+"."+_+"("+a+")",t.ORDER_ATOMIC]},text_text_compare_to=function(e,t){return["cmp("+(t.valueToCode(this,"STR1",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"STR2",t.ORDER_ATOMIC)||'""')+")",t.ORDER_ATOMIC]},text_text_substring2=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""',a=e.getFieldValue("WHERE1"),_=e.getFieldValue("WHERE2");switch(a){case"FROM_START":"0"==(l=t.getAdjustedInt(e,"AT1"))&&(l="");break;case"FROM_END":var l=t.getAdjustedInt(e,"AT1",0,!0);break;case"FIRST":l="0";break;default:throw"Unhandled option (lists_getSublist)"}switch(_){case"FROM_START":var s=t.getAdjustedInt(e,"AT2");break;case"FROM_END":s=t.getAdjustedInt(e,"AT2",0,!0);external_Blockly_namespaceObject.isNumber(String(s))?"0"==s&&(s=""):(t.definitions_.import_sys="import sys",s+=" or sys.maxsize");break;case"LAST":s="-1";break;default:throw"Unhandled option (lists_getSublist)"}return[n+"["+l+" : "+s+"]",t.ORDER_ATOMIC]},text_text_substring=function(e,t){return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+"["+t.valueToCode(this,"AT1",t.ORDER_ATOMIC)+" : "+t.valueToCode(this,"AT2",t.ORDER_ATOMIC)+"]",t.ORDER_ATOMIC]},text_text_capital=function(e,t){var n=this.getFieldValue("CAPITAL");return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},text_text_center=function(e,t){var n=this.getFieldValue("CENTER");return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"WID",t.ORDER_ATOMIC)+","+t.valueToCode(this,"Symbol",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},text_text_find=function(e,t){return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".find("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},text_text_join_seq=function(e,t){return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".join("+(t.valueToCode(this,"LIST",t.ORDER_ASSIGNMENT)||"0")+")",t.ORDER_ATOMIC]},text_text_replace=function(e,t){return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".replace("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},text_text_split=function(e,t){return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+".split("+(t.valueToCode(this,"VAL",t.ORDER_ATOMIC)||'""')+")",t.ORDER_ATOMIC]},text_text_strip=function(e,t){var n=this.getFieldValue("TOWHAT");return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},text_text_format=function(e,t){for(var n=this.getFieldValue("VAR"),a=new Array(this.itemCount_),_=0;_",GTE:">="};const logic_logic_operation=function(e,t){var n=this.getFieldValue("OP"),a="&&"==n?t.ORDER_LOGICAL_AND:t.ORDER_LOGICAL_OR,_=t.valueToCode(this,"A",a)||"False",l=t.valueToCode(this,"B",a)||"False";if("AND"==n)var s=_+" and "+l;else if("OR"==n)s=_+" or "+l;else if("NOR"==n)s="not("+_+"^"+l+")";else s=_+"^"+l;return[s,a]},logic_logic_negate=function(e,t){var n=t.ORDER_UNARY_PREFIX;return["not "+(t.valueToCode(this,"BOOL",n)||"False"),n]},logic_logic_boolean=function(e,t){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",t.ORDER_ATOMIC]},logic_logic_null=function(e,t){return["None",t.ORDER_ATOMIC]},logic_logic_true_or_false=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"False";return["("+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"False")+" if "+n+" else "+(t.valueToCode(this,"C",t.ORDER_ATOMIC)||"False")+")",t.ORDER_ATOMIC]},logic_logic_is_in=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_is=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_tobool=function(e,t){return["bool("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},storage_storage_open_file_with_os=function(e,t){return t.definitions_.import_os="import os","os.startfile("+t.valueToCode(this,"fn",t.ORDER_ATOMIC)+")\n"},storage_storage_fileopen=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+" = open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},storage_storage_fileopen_new=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",t.ORDER_ATOMIC]},storage_storage_fileopen_new_encoding=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',t.ORDER_ATOMIC]},storage_storage_file_write=function(e,t){var n=t.valueToCode(this,"data",t.ORDER_ATOMIC);return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".write("+n+")\n"},storage_storage_get_contents_without_para=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},storage_storage_get_contents=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_get_a_line=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".readline("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_can_write_ornot=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".writable()",t.ORDER_ATOMIC]},storage_storage_get_filename=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".name()",t.ORDER_ATOMIC]},storage_storage_close_file=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".close()\n"},storage_storage_list_all_files=function(e,t){t.definitions_.import_os="import os";return["os.listdir()",t.ORDER_ATOMIC]},storage_storage_delete_file=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_file_size=function(e,t){return t.definitions_.import_os="import os",["os.path.getsize("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_file_tell=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".tell()",t.ORDER_ATOMIC]},storage_storage_file_seek=function(e,t){var n=this.getFieldValue("MODE"),a=0;return a="start"==n?0:"current"==n?1:2,t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".seek("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+","+a+")\n"},storage_storage_change_dir=function(e,t){return t.definitions_.import_os="import os","os.chdir("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_current_dir=function(e,t){t.definitions_.import_os="import os";return["os.getcwd()",t.ORDER_ATOMIC]},storage_storage_make_dir=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"PATH",t.ORDER_ATOMIC)+")\n"},storage_storage_rename=function(e,t){return t.definitions_.import_os="import os","os.rename("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+","+t.valueToCode(this,"NEWFILE",t.ORDER_ATOMIC)+")\n"},storage_storage_is_file=function(e,t){t.definitions_.import_os="import os";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",t.ORDER_ATOMIC]},storage_sdcard_use_spi_init=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = sdcard.SDCard("+t.valueToCode(this,"SPISUB",t.ORDER_ATOMIC)+","+t.valueToCode(this,"PINSUB",t.ORDER_ATOMIC)+")\n"},storage_sdcard_mount=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard","os.mount("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"DIR",t.ORDER_ATOMIC)+")\n"},procedures_procedures_defreturn=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("NAME"),external_Blockly_namespaceObject.Procedures.NAME_TYPE),a=t.statementToCode(this,"STACK")||" pass\n";t.INFINITE_LOOP_TRAP&&(a=t.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+a);var _=t.valueToCode(this,"RETURN",t.ORDER_NONE)||"";_&&(_=" return "+_+"\n");for(var l=[],s=0;s\n\n\n\t\n"+t.statementToCode(this,"HEAD")+"\n\n"+t.statementToCode(this,"BODY")+"\n\n'''",t.ORDER_ATOMIC]},html_html_title=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"\n"+n+"\n"},html_html_head_body=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");if("head"==a)var _="<"+a+'>\n\t\n'+n+"\n";else _="<"+a+">\n"+n+"\n";return _},html_html_content=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"<"+a+">\n"+n+"\n"},html_html_content_more=function(e,t){var n=t.statementToCode(this,"DO"),a=t.valueToCode(this,"style"),_=this.getFieldValue("LEVEL");return"<"+_+" "+a+" >\n"+n+"\n"},html_html_style=function(e,t){return['style="'+t.statementToCode(this,"STYLE")+'"',t.ORDER_ATOMIC]},html_html_form=function(e,t){return'"},html_html_style_content=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},html_html_text=function(){return this.getFieldValue("TEXT")+"\n"},utility_raw_block=function(e){return e.getFieldValue("TEXT")+"\n"},utility_raw_expression=function(e,t){return[e.getFieldValue("TEXT"),t.ORDER_ATOMIC]},utility_raw_empty=function(e,t){return(t.valueToCode(e,"VALUE",t.ORDER_ATOMIC)||"")+"\n"},utility_raw_table=function(){return""},utility_type_check=function(e,t){return["type("+(t.valueToCode(e,"VALUE",t.ORDER_MEMBER)||"___")+")",t.ORDER_ATOMIC]},utility_function_call=function(e,t){for(var n=e.getFieldValue("NAME"),a=e.hasReturn_,_=new Array(e.itemCount_),l=0;l0?t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+"while True:\n"+l.join("")+s.join("\n"):t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+s.join("\n")},Python.scrubNakedValue=function(e){return e+"\n"},Python.quote_=function(e){var t="'";return-1!==(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===e.indexOf('"')?t='"':e=e.replace(/'/g,"\\'")),t+e+t},Python.multiline_quote_=function(e){return"'''"+(e=e.replace(/'''/g,"\\'\\'\\'"))+"'''"},Python.scrub_=function(e,t,n){var a="";if(!e.outputConnection||!e.outputConnection.targetConnection){(l=e.getCommentText())&&(l=external_Blockly_namespaceObject.utils.string.wrap(l,Python.COMMENT_WRAP-3),a+=Python.prefixLines(l+"\n","# "));for(var _=0;_0?"int("+i+" + "+_+")":_<0?"int("+i+" - "+-_+")":"int("+i+")",a&&(i="-"+i)),i};const AI_HUE=205,AI_ChooseAndGet={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},AI_client={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech,"AipSpeech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace,"AipFace"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"AipOcr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},AI_Speech_synthesis={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Speech_asr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_File).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},AI_Face_match={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"1"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"2"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_webImage,"webImage"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_idcard,"idcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_receipt,"receipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_form,"tableRecognition"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_passport,"passport"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Sim={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"1").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"2").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_lexer,"lexer"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_depParser,"depParser"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_keyword,"keyword"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic,"topic"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Func_sim={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Topic={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_newsSummary={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_summary).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_LEN).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_audio={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},AI_photo={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},AI_result={init:function(){this.setColour(AI_HUE),this.appendValueInput("AI").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_RESULT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"Image"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr,"Speech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match,"Face"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"Ocr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},ALGORITHM_HUE="#526FC3",algorithm_prepare={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_find_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_new_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},algorithm_set_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_del_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_return_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},algorithm_print_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_current_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},algorithm_no_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_1={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_move_recent={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_not_home={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},algorithm_not_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},algorithm_print_path2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hanoi_init={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_move={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_all_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_all_books_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_first_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},algorithm_yes_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},algorithm_next_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_two_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},algorithm_divide_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_half_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_book2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_book_scale={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new external_Blockly_namespaceObject.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_number_zero={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_number_add={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_number={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_book_num={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField("n"+external_Blockly_namespaceObject.Msg.MIXLY_VALUE2).appendField(new external_Blockly_namespaceObject.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_divide={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_init_jttl={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头,"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_zero={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_number_in_range={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_chick_calculate={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_check_feet={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_print_jttl_answer={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_fzsf={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc_first_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_compare={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_set_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_move={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_hxdb={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若3人一排列队,多1人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若5人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若7人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_init_soldier={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new external_Blockly_namespaceObject.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_stand_in_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("使士兵").appendField(new external_Blockly_namespaceObject.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_last_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("剩余").appendField(new external_Blockly_namespaceObject.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_result={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_init_offline={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},algorithm_get_current_location={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_void_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},algorithm_color_seclet={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},COMMUNICATE_HUE="#3288dd",requests_get_old={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("DOMAIN").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET).appendField(new external_Blockly_namespaceObject.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},requests_get={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS).appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_post={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS+external_Blockly_namespaceObject.Msg.OLED_STRING),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_attribute={init:function(){this.appendValueInput("VAL");var e=[[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},requests_method={init:function(){this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]}))}},CV_HUE="f0a559",cv_read_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_show_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_write_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_waitkey={init:function(){this.setColour(CV_HUE),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+external_Blockly_namespaceObject.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},cv_destroy_all={init:function(){this.setColour(CV_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_line_rect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_CV_RECT,"rectangle"],[external_Blockly_namespaceObject.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_text={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new external_Blockly_namespaceObject.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_face_classifier={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect_all={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},DATA_HUE=170,series_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_one_index={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"index"],[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_text={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new external_Blockly_namespaceObject.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_index_value={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.SERIES_INDEX,"index"],[external_Blockly_namespaceObject.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.SERIES_INDEX_VALUE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"INDEX_VALUE"),this.setOutput(!0,"List");var t=this;this.setTooltip((function(){var e=t.getFieldValue("INDEX_VALUE");return{index:external_Blockly_namespaceObject.Msg.SERIES_INDEX_TOOLTIP,value:external_Blockly_namespaceObject.Msg.HTML_VALUE_TOOLTIP}[e]}))}},series_get_num={init:function(){this.setColour(DATA_HUE),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TUPLE_GET_INDEX_TOOLTIP)}},pl_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},array_create={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SPLITBYDOU).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pl_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},pl_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},pl_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},numpy_trig={init:function(){var e=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(DATA_HUE),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},pl_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pandas_readcsv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_get={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"column"],[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},pl_savefig={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},pl_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},array_toarray={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},plot_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},plot_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},plot_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},plot_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},plot_savefig={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},plot_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},numpy_shape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},numpy_reshape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},numpy_astype={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new external_Blockly_namespaceObject.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},pylab_imshow={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("展示图像"),this.appendDummyInput().appendField("颜色").appendField(new external_Blockly_namespaceObject.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},numpy_mean_digit={init:function(){this.setColour(DATA_HUE),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},numpy_argmin_template_match={init:function(){this.setColour(DATA_HUE),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},numpy_mean={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},numpy_std={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},pandas_dropna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},pandas_drop_columns={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Drops columns from dataframe.")}},numpy_ones={init:function(){this.setColour(DATA_HUE),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},numpy_c_={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("列拼接:数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},numpy_linalg_det={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},matrix_transpose={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},matrix_multiplication={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},numpy_linalg_inv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},dataframe_median={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},dataframe_fillna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new external_Blockly_namespaceObject.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},dataframe_info={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},numpy_min={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},numpy_max={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},numpy_size={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},numpy_dot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},numpy_square={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},numpy_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},numpy_random_random={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},py_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},DS_HUE=80,ds_create_linkedlist={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new external_Blockly_namespaceObject.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("ds_create_linkedlist_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:"name"),"KEY"+t).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ds_create_linkedlist_container={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},ds_create_linkedlist_item={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},ds_create_node={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_USE).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_TOOLTIP)}},ds_get_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},ds_set_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},ds_add_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_add_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_del_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_del_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_reverse_linkedlist={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},FACTORY_HUE="#777777",factory_from_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("from ").appendField(new external_Blockly_namespaceObject.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_function_noreturn={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("items",this.itemCount_);for(var t=0;tt?e[t]:'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},iot_publish_container={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},iot_publish_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_create_with_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_mixio_connect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIFI_USERNAME).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_IOT_PASSWORD).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PROJECT).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_MIXIO_PUBLISH={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(external_Blockly_namespaceObject.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},IOT_MIXIO_SUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_MSG).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},IOT_MIXIO_UNSUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MSG.stop+external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},iot_mixio_disconnect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_connect_only={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_check={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_format_topic={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},iot_mixio_format_msg={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},IOT_FORMATTING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},IOT_FORMAT_STRING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},IOT_EMQX_PING={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},IOT_MIXIO_NTP={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+external_Blockly_namespaceObject.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixly_key_py={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}},iot_mixly_key={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},iot_client_onboard={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},iot_http_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME).appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_http_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_mqtt_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_INIT_SUBSCRIBE).appendField(external_Blockly_namespaceObject.MQTT_Topic).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mqtt_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_onenetconnect=iot_onenet_connect,iot_onenetdisconnect=iot_onenet_disconnect,iot_checkonenet=iot_onenet_check,iot_publish=iot_onenet_publish,PINS_HUE=230,pins_digital_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},pins_digital_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},pins_analog_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},pins_analog_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},SERIAL_HUE=40,serial_open={init:function(){this.setColour(SERIAL_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN)).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SERIAL_BEGIN).appendField(new external_Blockly_namespaceObject.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},serial_write={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},serial_read_b={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},serial_close={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},SKLEARN_HUE=80,sklearn_make_classification={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_regression={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_blobs={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_load={init:function(){var e=[[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.LOAD).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"type").appendField(new external_Blockly_namespaceObject.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("name"))&&this.setTitleValue(t,"name")}},sklearn_data_target={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SET),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.EIGENVALUES,"data"],[external_Blockly_namespaceObject.Msg.LABEL_VALUE,"target"],[external_Blockly_namespaceObject.Msg.FEATURE,"feature_names"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_LinearRegression={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_Ridge={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_DecisionTreeClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_RandomForestClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KNeighborsClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KNN_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_GaussianNB={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KMeans={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_predict={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_coef_intercept={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck(null).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_COEF,"coef_"],[external_Blockly_namespaceObject.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_cluster_centers_labels_inertia={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[external_Blockly_namespaceObject.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_save_load_model={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("sklearn").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_SAVE_MODEL,"dump"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},SYSTEM_HUE=120,base_delay={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY+"("+external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_controls_millis={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},time_localtime={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},system_Panic_with_status_code={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("STATUS_CODE",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_reset={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},controls_mstimer2={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("TIME").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_start={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_stop={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},system_time_sleep={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},TURTLE_HUE=180,turtle_create={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_done={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_exitonclick={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_move={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_forward,"forward"],[external_Blockly_namespaceObject.Msg.blockpy_backward,"backward"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},turtle_rotate={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_left,"left"],[external_Blockly_namespaceObject.Msg.blockpy_right,"right"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_rotate).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{left:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[e]}))}},turtle_setheading={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_delay={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_goto={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_setxy={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},turtle_pos_shape={init:function(){this.setColour(TURTLE_HUE);var e=[[external_Blockly_namespaceObject.Msg.TURTLE_POS,"pos"],[external_Blockly_namespaceObject.Msg.TURTLE_SHAPE,"shape"],[external_Blockly_namespaceObject.Msg.TURTLE_HEADING,"heading"],[external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_POS_SHAPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR");var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pos:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[e]})),this.setOutput(!0),this.setInputsInline(!0)}},turtle_clear={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_reset,"reset"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_home,"home"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{clear:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[e]}))}},turtle_penup={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_penup,"penup"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{penup:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[e]}))}},turtle_fill={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_beginfill,"begin"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_endfill,"end"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{begin:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[e]}))}},turtle_size_speed={init:function(){this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"TUR");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_size,"pensize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pensize:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[e]}))}},turtle_size={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_size),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_speed={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_speed),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_circle={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_dot,"dot"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_draw).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{circle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[e]}))}},turtle_circle_advanced={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},turtle_visible={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_hide,"hideturtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{hideturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[e]}))}},turtle_bgcolor={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_clone={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_CLONE),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},turtle_bgcolor_hex_new={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR1").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_bgcolor_hex={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_shape={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_arrow,"arrow"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_turtle,"turtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_square,"square"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_triangle,"triangle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_shape).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_SHAPE_TOOLTIP)}},turtle_shapesize={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},turtle_numinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_NUMINPUT_TOOLTIP)}},turtle_textinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},turtle_write={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_color_seclet={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},turtle_getscreen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new external_Blockly_namespaceObject.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_onkey={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},turtle_onclick={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},turtle_ontimer={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},turtle_listen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_savefig={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},ai_AI_ChooseAndGet=function(e,t){var n=this.getFieldValue("TYPE");return t.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",t.ORDER_ATOMIC]},ai_AI_client=function(e,t){var n=this.getFieldValue("CTYPE");return t.definitions_.import_aip="import aip",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = aip."+n+"("+t.valueToCode(this,"API_KEY",t.ORDER_ATOMIC)+", "+t.valueToCode(this,"SECRET_KEY",t.ORDER_ATOMIC)+")\n"},ai_AI_Speech_synthesis=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".synthesis("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Speech_asr=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".asr("+(t.valueToCode(this,"FILE",t.ORDER_ATOMIC)||'""')+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Face_match=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".match("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Ocr=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Sim=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR1",t.ORDER_ATOMIC),_=t.valueToCode(this,"STR2",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+","+_+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Topic=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".topic("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},ai_AI_Nlp_newsSummary=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".newsSummary("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"LEN",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Ocr_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func_sim=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_audio=function(e,t){return t.definitions_.import_audio="import audio","audio.audio_record("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"TIME",t.ORDER_ATOMIC)||"0")+")\n"},ai_AI_photo=function(e,t){return t.definitions_.import_audio="import cam","cam.photo_capture("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"BUT",t.ORDER_ATOMIC)||'""')+")\n"},ai_AI_result=function(e,t){var n=t.valueToCode(this,"AI",t.ORDER_ASSIGNMENT)||"0",a=this.getFieldValue("CTYPE");if("Image"==a)var _=n+'["result"][0]["keyword"]';if("Speech"==a)_=n+'["result"][0]';if("Face"==a||"OcrSimilarity"==a)_=n+'["score"]';if("Ocr"==a)_=n+'["words_result"]';return[_,t.ORDER_ATOMIC]},algorithm_algorithm_prepare=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nfor i in house:\n i.hide()\n"},algorithm_algorithm_add_school=function(){return"path = [1]\ncar = sprite.Sprite('car', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},algorithm_algorithm_find_path=function(e,t){t.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},algorithm_algorithm_new_path=function(e,t){return["flag == 1",t.ORDER_ATOMIC]},algorithm_algorithm_set_path=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},algorithm_algorithm_add_path=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},algorithm_algorithm_del_path=function(e,t){t.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},algorithm_algorithm_return_path=function(){var e="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return e="house[f].hide()\ndrive(path[len(path) - 1])\n"+e},algorithm_algorithm_no_left=function(e,t){return["len(path) == 7",t.ORDER_ATOMIC]},algorithm_algorithm_print_path=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},algorithm_algorithm_prepare2=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nbarricade = sprite.Sprite('barricade', 570, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.hide()\n"},algorithm_algorithm_current_school=function(e,t){return["f == 1",t.ORDER_ATOMIC]},algorithm_algorithm_no_path=function(){return"print('没有符合条件的路线')\n"},algorithm_algorithm_prepare_2_1=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_prepare_2_2=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_move_recent=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]6:\n print("路线错乱!程序有误!")\n exit()\n'},algorithm_algorithm_not_home=function(e,t){return["name[now] != '小科家'",t.ORDER_ATOMIC]},algorithm_algorithm_not_school=function(e,t){return["name[now] != '学校'",t.ORDER_ATOMIC]},algorithm_algorithm_print_path2=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},algorithm_hanoi_init=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var a="print('层数过高!不得高于6层!')\nexit()\n";else a="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return a},algorithm_hanoi_move=function(e,t){var n=t.valueToCode(this,"FROM_NUM",t.ORDER_ATOMIC)||"0",a=t.valueToCode(this,"TO_NUM",t.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${a}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${a}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${a}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${a}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${a}*200+200, 400-len(_Hanoi[${a}])*27, 0.2)\n _Hanoi[${a}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},algorithm_algorithm_all_books_sequence=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},algorithm_algorithm_all_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},algorithm_algorithm_first_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},algorithm_algorithm_no_ring2=function(e,t){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",t.ORDER_ATOMIC]},algorithm_algorithm_yes_ring2=function(e,t){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",t.ORDER_ATOMIC]},algorithm_algorithm_next_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},algorithm_algorithm_two_left=function(e,t){return["len(list)>=2",t.ORDER_ATOMIC]},algorithm_algorithm_divide_books=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},algorithm_algorithm_get_half_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_delete_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_print_book2=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},algorithm_algorithm_book_scale=function(e,t){var n=this.getFieldValue("NUM");return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},algorithm_algorithm_number_zero=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},algorithm_algorithm_number_add=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},algorithm_algorithm_print_number=function(e,t){t.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},algorithm_algorithm_init_jttl=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},algorithm_algorithm_rabbit_zero=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},algorithm_algorithm_rabbit_number_in_range=function(e,t){return["_rabbit < _head",t.ORDER_ATOMIC]},algorithm_algorithm_chick_calculate=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},algorithm_algorithm_check_feet=function(e,t){return["_rabbit*4 + _chick*2 == _foot",t.ORDER_ATOMIC]},algorithm_algorithm_print_jttl_answer=function(e,t){t.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},algorithm_algorithm_rabbit_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},algorithm_algorithm_init_fzsf=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},algorithm_algorithm_fz_calc=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const a=[0,[1,3],[2,4],[5,7],[6]];var _="";return _+=`_S${n}.show()\ntime.sleep(1)\n`,_+=4!=n?`_Slen[${n}] = _Llen[${a[n][0]}] + _Llen[${a[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},algorithm_algorithm_fz_compare=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,t.ORDER_ATOMIC]},algorithm_algorithm_fz_set_min=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),a="";return a+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},algorithm_algorithm_fz_move=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},algorithm_algorithm_init_hxdb=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},algorithm_algorithm_hxdb_init_soldier=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},algorithm_algorithm_hxdb_stand_in_line=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},algorithm_algorithm_hxdb_last_line=function(e,t){return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,t.ORDER_ATOMIC]},algorithm_algorithm_hxdb_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},algorithm_algorithm_hxdb_result=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},algorithm_hanoi_init_offline=function(e,t){t.definitions_.import_turtle="import turtle",t.definitions_.import_time="import time",t.definitions_.import_math="import math";var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC),a=this.getFieldValue("NUM");return t.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",t.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",t.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a{document.removeEventListener("DOMContentLoaded",e),this._pageLoad.resolve()};document.addEventListener("DOMContentLoaded",e)}else this._pageLoad.resolve();(async()=>{switch(n){case"python":case"python3":case"python3.11":const{KernelPython3:t}=await __webpack_require__.e(211).then(__webpack_require__.bind(__webpack_require__,211));this._kernel=new t(e);break;case"python3-old":case"python3.8":const{KernelPython3Old:a}=await __webpack_require__.e(195).then(__webpack_require__.bind(__webpack_require__,5195));this._kernel=new a(e);break;case"js":case"javascript":const{KernelJavaScript:_}=await __webpack_require__.e(97).then(__webpack_require__.bind(__webpack_require__,4097));this._kernel=new _(e);break;case"sql":const{KernelSQL:l}=await Promise.all([__webpack_require__.e(960),__webpack_require__.e(837)]).then(__webpack_require__.bind(__webpack_require__,592));this._kernel=new l(e);break;case"ocaml":const{KernelOCaml:s}=await __webpack_require__.e(38).then(__webpack_require__.bind(__webpack_require__,38));this._kernel=new s(e);break;default:return window.console.error(`Kernel '${n}' not supported.`),void this._kernelAvailable.reject()}window.Basthon=this._kernel,this._kernelAvailable.resolve(this._kernel)})()}async pageLoad(){await this._pageLoad.promise}async kernelAvailable(){return await this._kernelAvailable.promise}async kernelLoaded(){const e=await this.kernelAvailable();return await e.loaded(),e}get kernel(){return this._kernel}get kernelSafe(){var e;return(null===(e=this.kernel)||void 0===e?void 0:e.ready)?this.kernel:null}async showLoader(e,t=!1,n=!0){this.kernelAvailable().then((()=>{var e;return null===(e=this.kernel)||void 0===e?void 0:e.init()})),__webpack_require__.e(317).then(__webpack_require__.bind(__webpack_require__,1317));const a="basthon-loader-"+(t?"full":"foot"),_=document.createElement("div");_.id=this._loaderId,_.classList.add("darklighted"),_.classList.add("basthon-loader-root"),_.classList.add(a);const l=document.createElement("div");l.classList.add("basthon-loader-container"),l.classList.add(a),_.appendChild(l);const s=document.createElement("div");s.classList.add("basthon-loader-spinner"),s.classList.add(a),s.innerHTML="",l.appendChild(s);const i=document.createElement("div");i.classList.add("basthon-loader-break"),i.classList.add(a),l.appendChild(i);const o=document.createElement("div");o.classList.add("basthon-loader-text"),o.classList.add(a),o.innerHTML=e,l.appendChild(o),this._loaderTextElem=o;const r=document.createElement("div");r.classList.add("basthon-loader-text"),r.classList.add(a),r.style.display="none",l.appendChild(r),this._loaderTextError=r,await this.pageLoad(),document.body.appendChild(_),this._rootLoader=_;try{await this.kernelLoaded()}catch(e){const t=this.browser();this.setErrorText(`Erreur de chargement de Basthon !!!
Vérifiez que votre navigateur est à jour.
Version détectée : ${t.name} ${t.version}.`);for(const e of document.body.querySelectorAll(".basthon-loader-foot"))e.classList.remove("basthon-loader-foot"),e.classList.add("basthon-loader-full");return s.classList.remove("basthon-loader-spinner"),s.classList.add("basthon-loader-error"),void(this._doNotHideLoader=!0)}this._doNotHideLoader=!1,n&&this.hideLoader()}setLoaderText(e){null!=this._loaderTextElem&&(this._loaderTextElem.innerHTML=e)}setErrorText(e){null!=this._loaderTextElem&&(this._loaderTextElem.style.display="none"),null!=this._loaderTextError&&(this._loaderTextError.style.display="",this._loaderTextError.innerHTML=e)}hideLoader(){if(this._doNotHideLoader)return;const e=this._rootLoader;null!=e&&(e.classList.add("basthon-loader-hide"),window.setTimeout((()=>{this._rootLoader=void 0,e.remove()}),1100))}browser(){var e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""}:"Chrome"===n[1]&&null!=(e=t.match(/\bOPR|Edge\/(\d+)/))?{name:"Opera",version:e[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),{name:n[0],version:n[1]})}}const external_$_namespaceObject=$;var external_$_default=__webpack_require__.n(external_$_namespaceObject);const statusbar_image_namespaceObject='\r\n
\r\n\r\n
';class StatusBarImage extends external_Mixly_namespaceObject.PageBase{static{external_Mixly_namespaceObject.HTMLTemplate.add("html/statusbar/statusbar-image.html",new external_Mixly_namespaceObject.HTMLTemplate(statusbar_image_namespaceObject)),this.init=function(){external_Mixly_namespaceObject.StatusBarsManager.typesRegistry.register(["images"],StatusBarImage);const e=external_Mixly_namespaceObject.Workspace.getMain().getStatusBarsManager();e.add("images","images",external_Blockly_namespaceObject.Msg.PYTHON_PYODIDE_IMAGE),e.changeTo("output")}}constructor(){super();const e=external_$_default()(external_Mixly_namespaceObject.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(e)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(e){const t=this.getContent(),n=function(e){e.style.width="auto",e.style.height="auto",e.style.maxWidth="100%",e.style.maxHeight="100%"};this.clean();let a=e.content,_=null,l=null;switch(e.display_type){case"p5":a.style.width="100%",a.style.height="100%",a.style.display="flex",a.style.justifyContent="center",a.style.alignItems="center",new MutationObserver((function(e){e.forEach((e=>e.addedNodes.forEach((e=>{const t=e;null!=t.tagName&&["canvas","video"].includes(t.tagName.toLowerCase())&&n(t)}))))})).observe(a,{childList:!0}),a.querySelectorAll("canvas,video").forEach(n),t.append(a);break;case"matplotlib":_=a.querySelector("canvas"),_&&(a=_),a.style.width="",a.style.height="",a.style.maxWidth="100%",a.style.maxHeight="100%",t.append(a);break;case"ocaml-canvas":a.style.width="",a.style.height="",a.style.maxWidth="100%",a.style.maxHeight="100%",t.append(a);break;case"turtle":a.setAttribute("width","100%"),a.setAttribute("height","100%"),t.append(a.outerHTML);break;case"sympy":t.append(e.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let e=document.createElement("script");e.type="text/javascript",e.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(e)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in e.content){let a=e.content[n];"image/png"===n&&(a=''),t.append(a);break}break;case"tutor":if(t.append(external_$_default()(e.content.replace("overflow-y%3A%20hidden%3B",""))),l=this.getContent()[0].getElementsByTagName("iframe")[0],null==l)return;l.style.maxHeight=l.style.minHeight="100%",new IntersectionObserver(((e,t)=>{const n=e[0];n&&!n.isIntersecting||(l.contentWindow?.postMessage({type:"redraw"},"*"),t.disconnect())})).observe(l);break;default:console.error(`Not supported node type '${e.display_type}' in eval.display result processing.`)}}}const statusbar_image=StatusBarImage;class PythonShell{static{this.pythonShell=null,this.init=async function(){statusbar_image.init();const e=external_path_.relative(external_Mixly_namespaceObject.Env.indexDirPath,external_Mixly_namespaceObject.Env.boardDirPath),t=new KernelLoader({rootPath:external_path_.join(e,"deps"),language:"python3"}),n=await t.kernelAvailable();n&&(await n.init(),await n.loaded(),this.loader=t,this.kernel=n,this.pythonShell=new PythonShell,this.pyodide=window.pyodide,this.interruptBuffer=new Uint8Array(new ArrayBuffer(1)),this.pyodide.setInterruptBuffer(this.interruptBuffer))},this.run=function(){const e=external_Mixly_namespaceObject.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(e)},this.stop=function(){return this.pythonShell.stop()}}#e=null;#t=null;#n=null;#a={row:0,column:0};#_="";#l=null;#s=null;#i=!1;#o=!1;#r=null;#p=()=>this.#c();#u=[{name:"REPL-Enter",bindKey:"Enter",exec:e=>{if(e.getSession().selection.getCursor().row===this.#a.row){const e=this.#e.getEndPos();let t=this.#e.getValueRange(this.#a,e);t=t.replace(this.#_,""),this.#l?.(t),this.#l=null,this.#s=null,this.#e.addValue("\n"),this.#m()}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:e=>{const t=e.getSession().selection.getCursor();return t.row{this.#o=!1,this.#e.addValue(`\n==${external_Mixly_namespaceObject.Msg.Lang["shell.finish"]}==`)})),this.#r.addEventListener("eval.output",(e=>{this.#e.addValue(e.content)})),this.#r.addEventListener("eval.error",(()=>{this.#o=!1,this.#e.addValue(`\n==${external_Mixly_namespaceObject.Msg.Lang["shell.finish"]}==`)})),this.#r.addEventListener("eval.input",(e=>{const t=String(e?.content?.prompt);this.#e.addValue(t),this.#_=t,this.#l=e.resolve,this.#s=e.reject,this.#O()})),this.#r.addEventListener("eval.display",(e=>{this.#n.changeTo("images"),this.#t.display(e)}))}#c(){const e=this.#e.getEditor(),t=e.getSession().selection.getCursor();e.setReadOnly(t.row{-1!==e.indexOf("import turtle")&&(e+="\nturtle.done()\n"),this.#n.changeTo("output"),this.#n.show(),this.#e.setValue(`${external_Mixly_namespaceObject.Msg.Lang["shell.running"]}...\n`),this.#o=!0,this.#r.dispatchEvent("eval.request",{code:e,interactive:!1})})).catch(external_Mixly_namespaceObject.Debug.error)}async stop(){if(this.#i&&this.#m(),this.#o){const e=5;PythonShell.interruptBuffer[0]=2;const t=Number(new Date);for(;Number(new Date)-t<1e3*e&&this.#o;)PythonShell.interruptBuffer[0]=2,await this.sleep(100);this.#o=!1}}sleep(e){return new Promise((t=>setTimeout(t,e)))}}const python_shell=PythonShell,NavExt={init:async function(){const e=external_Mixly_namespaceObject.app.getNav();e.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:external_Blockly_namespaceObject.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{python_shell.run()},scopeType:external_Mixly_namespaceObject.Nav.Scope.LEFT,weight:4}),e.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:external_Blockly_namespaceObject.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{python_shell.stop()},scopeType:external_Mixly_namespaceObject.Nav.Scope.LEFT,weight:5}),await python_shell.init()}},nav_ext=NavExt;nav_ext.init(),Object.assign(external_Blockly_namespaceObject.Variables,variables),Object.assign(external_Blockly_namespaceObject.Procedures,procedures),external_Blockly_namespaceObject.Python=Python,external_Blockly_namespaceObject.generator=Python,external_Mixly_namespaceObject.Profile.default={},Object.assign(external_Blockly_namespaceObject.Blocks,blocks_variables_namespaceObject,control_namespaceObject,math_namespaceObject,text_namespaceObject,lists_namespaceObject,dicts_namespaceObject,logic_namespaceObject,storage_namespaceObject,blocks_procedures_namespaceObject,tuple_namespaceObject,set_namespaceObject,html_namespaceObject,utility_namespaceObject,ai_namespaceObject,algorithm_namespaceObject,communicate_namespaceObject,cv_namespaceObject,data_namespaceObject,datastructure_namespaceObject,factory_namespaceObject,hardware_namespaceObject,inout_namespaceObject,iot_namespaceObject,pins_namespaceObject,serial_namespaceObject,sklearn_namespaceObject,system_namespaceObject,turtle_namespaceObject),Object.assign(external_Blockly_namespaceObject.Python.forBlock,generators_variables_namespaceObject,generators_control_namespaceObject,generators_math_namespaceObject,generators_text_namespaceObject,generators_lists_namespaceObject,generators_dicts_namespaceObject,generators_logic_namespaceObject,generators_storage_namespaceObject,generators_procedures_namespaceObject,generators_tuple_namespaceObject,generators_set_namespaceObject,generators_html_namespaceObject,generators_utility_namespaceObject,generators_ai_namespaceObject,generators_algorithm_namespaceObject,generators_communicate_namespaceObject,cv,generators_data_namespaceObject,generators_datastructure_namespaceObject,generators_factory_namespaceObject,generators_hardware_namespaceObject,generators_inout_namespaceObject,generators_iot_namespaceObject,generators_pins_namespaceObject,generators_serial_namespaceObject,generators_sklearn_namespaceObject,generators_system_namespaceObject,generators_turtle_namespaceObject)})(); \ No newline at end of file +class Names{constructor(e,t){if(this.variablePrefix_=t||"",this.reservedDict_=Object.create(null),e)for(var n=e.split(","),a=0;a0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+_).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_if_if");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_if_elseif");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_if_else");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_if_elseif":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_if_else":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_range={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},controls_forEach={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("LIST").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_whileUntil={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return{WHILE:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:external_Blockly_namespaceObject.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[t]}))}},controls_try_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=document.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(e){var t=this,n=[],a=[];this.elseCount_&&this.removeInput("ELSE");for(var _=this.elseifCount_;_>0;_--)t.getInputTargetBlock("IF"+_)&&t.getInputTargetBlock("IF"+_).previousConnection?n[_]=t.getInputTargetBlock("IF"+_).previousConnection:n[_]=null,this.removeInput("IF"+_),t.getInputTargetBlock("DO"+_)&&t.getInputTargetBlock("DO"+_).previousConnection?a[_]=t.getInputTargetBlock("DO"+_).previousConnection:a[_]=null,this.removeInput("DO"+_);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(_=1;_<=this.elseifCount_;_++)this.appendValueInput("IF"+_).setCheck([Boolean,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+_).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY);for(_=n.length-2;_>0;_--)n[_]&&n[_].reconnect(this,"IF"+_);for(_=a.length-2;_>0;_--)a[_]&&a[_].reconnect(this,"DO"+_)},decompose:function(e){var t=e.newBlock("controls_try");t.initSvg();for(var n=t.getInput("STACK").connection,a=1;a<=this.elseifCount_;a++){var _=e.newBlock("controls_except");_.initSvg(),n.connect(_.previousConnection),n=_.nextConnection}if(this.elseCount_){var l=e.newBlock("controls_finally");l.initSvg(),n.connect(l.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),a=[null],_=[null],l=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,a.push(n.valueConnection_),_.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,l=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(a,_,l)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_except":var a=this.getInput("IF"+n),_=this.getInput("DO"+n);t.valueConnection_=a&&a.connection.targetConnection,t.statementConnection_=_&&_.connection.targetConnection,n++;break;case"controls_finally":_=this.getInput("ELSE");t.statementConnection_=_&&_.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var a=1;this.getInput("IF"+a);){var _=this.getInput("IF"+a),l=this.getInput("DO"+a);console.log(_.connection.targetConnection),e.push(_.connection.targetConnection),t.push(l.connection.targetConnection),a++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+e).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(e,t,n){for(var a=1;a<=this.elseifCount_;a++)e[a]&&e[a].reconnect(this,"IF"+a),t[a]&&t[a].reconnect(this,"DO"+a);n&&n.reconnect(this,"ELSE")}},controls_flow_statements={init:function(){this.setColour(LOOPS_HUE);var e=new external_Blockly_namespaceObject.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(e,"FLOW").appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var t=this;this.setTooltip((function(){var e=t.getFieldValue("FLOW");return{BREAK:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:external_Blockly_namespaceObject.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[e]}))},onchange:function(){if(this.workspace){var e=!1,t=this;do{if("controls_repeat"==t.type||"controls_for"==t.type||"controls_forEach"==t.type||"controls_repeat_ext"==t.type||"controls_whileUntil"==t.type||"do_while"==t.type){e=!0;break}t=t.getSurroundParent()}while(t);e?this.setWarningText(null):this.setWarningText(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},controls_for={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},controls_for_range={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new external_Blockly_namespaceObject.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){return external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",e.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}};controls_whileUntil.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],controls_flow_statements.OPERATORS=[[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const controls_if_if={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},controls_if_elseif={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},controls_if_else={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},controls_try={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},controls_except={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},controls_finally={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},controls_repeat_ext={init:function(){this.jsonInit({message0:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:LOOPS_HUE,tooltip:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},controls_lambda={init:function(){this.setColour(LOOPS_HUE),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STAT),this.setOutput(!0)}},controls_pass={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},controls_thread={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},do_while={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.CONTROLS_REPEAT_TITLE_REPEAT+external_Blockly_namespaceObject.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(external_Blockly_namespaceObject.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[external_Blockly_namespaceObject.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(LOOPS_HUE),this.setTooltip("do-while loop"),this.setHelpUrl("")}},garbage_collection={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},get_mem_alloc={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},get_mem_free={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},get_unique_identifier={init:function(){this.setColour(LOOPS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET+external_Blockly_namespaceObject.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_GET_UNIQUE_IDEN)}},MATH_HUE=230;external_Blockly_namespaceObject.FieldTextInput.math_number_validator=function(e){return String(e)},external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank=function(e){if(""===e)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(e)?String(e):null};const math_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_constant={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[t]}))}},math_constant_mp={init:function(){this.setColour(MATH_HUE);this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CONSTANT");return{pi:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[t]}))}},math_arithmetic={init:function(){this.setColour(MATH_HUE),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_selfcalcu={init:function(){this.setColour(MATH_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{ADD:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:external_Blockly_namespaceObject.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:external_Blockly_namespaceObject.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]}))}},math_bit={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},math_trig={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{SIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_SIN,COS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_COS,TAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:external_Blockly_namespaceObject.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_LN}[t]}))}},math_dec={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_BIN,"bin"],[external_Blockly_namespaceObject.Msg.MATH_OCT,"oct"],[external_Blockly_namespaceObject.Msg.MATH_HEX,"hex"]];this.setColour(MATH_HUE),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{bin:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_BIN,oct:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_OCT,hex:external_Blockly_namespaceObject.Msg.MATH_DEC_TOOLTIP_HEX}[e]}))}},math_to_int={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"],[external_Blockly_namespaceObject.Msg.MATH_ABS,"fabs"],[external_Blockly_namespaceObject.Msg.MATH_SQRT,"sqrt"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{sqrt:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_SQ,round:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:external_Blockly_namespaceObject.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[e]}))}},math_max_min={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_MAX,"max"],[external_Blockly_namespaceObject.Msg.MIXLY_MIN,"min"]];this.setColour(MATH_HUE),this.appendValueInput("A").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{max:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAX,min:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MIN}[e]}))}},math_number_base_conversion={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MATH_TWO,"two"],[external_Blockly_namespaceObject.Msg.MATH_EIGHT,"eight"],[external_Blockly_namespaceObject.Msg.MATH_TEN,"ten"],[external_Blockly_namespaceObject.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(MATH_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MATH_ZHW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP2").appendField(external_Blockly_namespaceObject.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP"),n={two:external_Blockly_namespaceObject.Msg.MATH_Before_two,eight:external_Blockly_namespaceObject.Msg.MATH_Before_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Before_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Before_sixteen},a=t.getFieldValue("OP2"),_={two:external_Blockly_namespaceObject.Msg.MATH_Behind_two,eight:external_Blockly_namespaceObject.Msg.MATH_Behind_eight,ten:external_Blockly_namespaceObject.Msg.MATH_Behind_ten,sixteen:external_Blockly_namespaceObject.Msg.MATH_Behind_sixteen};return n[e]+_[a]}))}},math_random={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LANG_MATH_INT,"int"],[external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_RANDOM).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TYPE"),n={int:external_Blockly_namespaceObject.Msg.LANG_MATH_INT,float:external_Blockly_namespaceObject.Msg.LANG_MATH_FLOAT_RANDOM};return external_Blockly_namespaceObject.Msg.MATH_RANDOM_INT_TOOLTIP+n[e]}))}},math_constrain={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_CONSTRAIN_TOOLTIP)}},math_map={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_MAP)}},math_indexer_number={init:function(){this.setColour(MATH_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("0",external_Blockly_namespaceObject.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_NUMBER_TOOLTIP)}},math_random_seed={init:function(){this.setColour(MATH_HUE),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},math_round={init:function(){this.setColour(MATH_HUE),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ROUND).appendField(external_Blockly_namespaceObject.Msg.TEXT_KEEP),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MATH_ROUND_NEW_TOOLTIP)}},text_to_number={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_BITES,"b"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[e]}))}},text_to_number_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TO_INT,"int"],[external_Blockly_namespaceObject.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(MATH_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{int:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[e]}))}},base_map=math_map,TEXTS_HUE=160,text_text={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}},text_textarea={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}};external_Blockly_namespaceObject.FieldTextInput.char_validator=function(e){if(e.length>1&&"\\"===e.charAt(0)){var t=e.charAt(1);if("0"===t||"b"===t||"f"===t||"n"===t||"r"===t||"t"===t||"\\"===t||"'"===t)return String(e).substring(0,2);if("x"===t&&"0"===e.charAt(2)&&"B"===e.charAt(3))return String(e).substring(0,4)}return String(e).substring(0,1)};const text_char={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput("",external_Blockly_namespaceObject.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(e){if(1==e)var t="../../media/quote2.png";else t="../../media/quote3.png";return new external_Blockly_namespaceObject.FieldImage(t,7,12,'"')}},text_join={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},ascii_to_char={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},char_to_ascii={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},number_to_text={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},text_length={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},text_char_at2={init:function(){this.WHERE_OPTIONS=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM+1+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET,"MODE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=e.getFieldValue("WHERE"),a="";switch(t+" "+n){case"GET FROM_START":case"GET FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":a=external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(a+=" "+external_Blockly_namespaceObject.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",external_Blockly_namespaceObject.Msg.ONE_BASED_INDEXING?"#1":"#0")),a}));var t=this;this.setTooltip((function(){var e=t.getFieldValue("WHERE"),n={FROM_START:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:external_Blockly_namespaceObject.Msg.TEXT_GET_INDEX_RANDOM};return external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+n[e]+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("statement",!this.outputConnection);var t=this.getInput("AT").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){var t="true"==e.getAttribute("statement");this.updateStatement_(t),e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateStatement_:function(e){e!=!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var t=new external_Blockly_namespaceObject.FieldDropdown(this.WHERE_OPTIONS,(function(t){var n="FROM_START"==t||"FROM_END"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT").appendField(t,"WHERE"),external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},text_char_at={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.PROCEDURES_DEFRETURN_RETURN+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START+"n"+external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)}},text_random_char={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},text_substring2={init:function(){this.WHERE_OPTIONS_1=[[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==external_Blockly_namespaceObject.INPUT_VALUE;e.setAttribute("at1",t);var n=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",n),e},domToMutation:function(e){var t="true"==e.getAttribute("at1"),n="true"==e.getAttribute("at2");this.updateAt_(1,t),this.updateAt_(2,n)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck(Number),external_Blockly_namespaceObject.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+e).appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+e);var n=new external_Blockly_namespaceObject.FieldDropdown(this["WHERE_OPTIONS_"+e],(function(n){var a="FROM_START"==n||"FROM_END"==n;if(a!=t){var _=this.sourceBlock_;return _.updateAt_(e,a),_.setFieldValue(n,"WHERE"+e),null}}));this.getInput("AT"+e).appendField(n,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},text_substring={init:function(){this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_GET+" "+external_Blockly_namespaceObject.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(external_Blockly_namespaceObject.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},text_equals_starts_ends={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_EQUALS,"==="],[external_Blockly_namespaceObject.Msg.MIXLY_STARTSWITH,"startswith"],[external_Blockly_namespaceObject.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},text_compare_to={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_COMPARETO_HELP)}},text_capital={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_UPPER,"upper"],[external_Blockly_namespaceObject.Msg.TEXT_TITLE,"title"],[external_Blockly_namespaceObject.Msg.TEXT_CAPITALIZE,"capitalize"],[external_Blockly_namespaceObject.Msg.TEXT_SWAPCASE,"swapcase"],[external_Blockly_namespaceObject.Msg.TEXT_LOWER,"lower"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CAPITAL").setCheck(String),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CAPITAL");return{upper:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[e]}))}},text_center={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_LJUST,"ljust"],[external_Blockly_namespaceObject.Msg.TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_RJUST,"rjust"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(external_Blockly_namespaceObject.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},text_find={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},text_join_seq={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},text_replace={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},text_split={init:function(){this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},text_strip={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH,"strip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"lstrip"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(TEXTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"TOWHAT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("TOWHAT");return{strip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[e]}))}},text_format={init:function(){this.setColour(TEXTS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("text_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_create_with_container={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},dicts_create_with_item={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},dicts_keys={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_KEYS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},dicts_get={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_TOOLTIP)}},dicts_get_default={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},dicts_add_or_change={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},dicts_delete={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP)}},dicts_update={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT2").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(external_Blockly_namespaceObject.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MID),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_clear={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_CLEAR),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_items={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_ITEMS),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},dicts_values={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_VALUES),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},dicts_length={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LENGTH),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},dicts_deldict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICT_DELDICT),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dicts_add_change_del={init:function(){this.MODE=[[external_Blockly_namespaceObject.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(external_Blockly_namespaceObject.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t="";switch(e.getFieldValue("WHERE")){case"INSERT":t=external_Blockly_namespaceObject.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":t=external_Blockly_namespaceObject.Msg.DICTS_DELETE_TOOLTIP}return t}))},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT2").type==external_Blockly_namespaceObject.INPUT_VALUE;return e.setAttribute("at2",t),e},domToMutation:function(e){var t="true"==e.getAttribute("at2");this.updateAt_(t)},updateAt_:function(e){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),e?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var t=new external_Blockly_namespaceObject.FieldDropdown(this.MODE,(function(t){var n="INSERT"==t;if(n!=e){var a=this.sourceBlock_;return a.updateAt_(n),a.setFieldValue(t,"WHERE"),null}}));this.getInput("AT2").appendField(t,"WHERE")}},dicts_pop={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setTooltip(external_Blockly_namespaceObject.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},dicts_setdefault={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_SETDEFAULT_TOOLTIP)}},dicts_create_with_noreturn={init:function(){this.setColour(DICTS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("dicts_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dicts_todict={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},dicts_to_json={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},json_to_dicts={init:function(){this.setColour(DICTS_HUE),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},LOGIC_HUE=210,logic_compare={init:function(){var e=external_Blockly_namespaceObject.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{EQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:external_Blockly_namespaceObject.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[e]})),this.prevBlocks_=[null,null]}},logic_compare_continous={init:function(){var e=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],t=external_Blockly_namespaceObject.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP1"),this.appendValueInput("C").appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"OP2"),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},logic_operation={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_AND,"AND"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_OR,"OR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_NOR,"NOR"],[external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{AND:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:external_Blockly_namespaceObject.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[e]}))}},logic_negate={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},logic_boolean={init:function(){var e=[[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(LOGIC_HUE),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_BOOLEAN_TOOLTIP)}},logic_null={init:function(){this.setColour(LOGIC_HUE),this.setOutput(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.LOGIC_NULL),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NULL_TOOLTIP)}},logic_true_or_false={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(external_Blockly_namespaceObject.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},logic_is_in={init:function(){var e=[[external_Blockly_namespaceObject.Msg.TEXT_APPEND_TO,"in"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.IN)}},logic_is={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(LOGIC_HUE),this.appendValueInput("A"),this.appendValueInput("B").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},logic_tobool={init:function(){this.setColour(LOGIC_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},STORAGE_HUE=0,storage_open_file_with_os={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("fn").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},storage_fileopen={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},storage_fileopen_new={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,s=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+s}))}},storage_fileopen_new_encoding={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE).appendField(new external_Blockly_namespaceObject.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_USE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,l=external_Blockly_namespaceObject.Msg.MIXLY_BELONG,s=external_Blockly_namespaceObject.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+l+a+_+s}))}},storage_file_write={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_STRING+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},storage_get_contents_without_para={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},storage_get_contents={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[t]+"x"+a}))}},storage_get_a_line={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MICROBIT_PYTHON_TYPE)}},storage_can_write_ornot={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.HTML_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},storage_get_filename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},storage_close_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},storage_list_all_files={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const storage_delete_file={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},storage_get_file_size={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},storage_file_tell={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},storage_file_seek={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck("Variable").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE"),n=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,a=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,_=external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[t]+_+"x"+a}))}},storage_get_current_dir={init:function(){this.setColour(STORAGE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},storage_make_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("PATH").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_ESP32_SET+{mkdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},storage_rename={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},storage_change_dir={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},storage_is_file={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_FILE,"isfile"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let e=this;this.setTooltip((function(){var t=e.getFieldValue("MODE");return external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]}))}},sdcard_use_spi_init={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("SPISUB").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP+external_Blockly_namespaceObject.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sdcard_mount={init:function(){this.setColour(STORAGE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Procedures={};Procedures.NAME_TYPE=external_Blockly_namespaceObject.PROCEDURE_CATEGORY_NAME,Procedures.allProcedures=function(e){for(var t=e.getAllBlocks(!1),n=[],a=[],_=0;_"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},html_form={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_FORM_CONTENT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.HTML_TEXT,"text"],[external_Blockly_namespaceObject.Msg.HTML_EMAIL,"email"],[external_Blockly_namespaceObject.Msg.HTML_NUMBER,"number"],[external_Blockly_namespaceObject.Msg.HTML_PASSWORD,"password"],[external_Blockly_namespaceObject.Msg.HTML_CHECKBOX,"checkbox"],[external_Blockly_namespaceObject.Msg.HTML_RADIOBUTTON,"radiobutton"],[external_Blockly_namespaceObject.Msg.HTML_BUTTON,"button"],[external_Blockly_namespaceObject.Msg.HTML_COLOUR,"colour"],[external_Blockly_namespaceObject.Msg.HTML_DATE,"date"],[external_Blockly_namespaceObject.Msg.HTML_LOCALTIME,"local time"],[external_Blockly_namespaceObject.Msg.HTML_FILE,"file"],[external_Blockly_namespaceObject.Msg.HTML_HIDDEN,"hidden"],[external_Blockly_namespaceObject.Msg.HTML_IMAGE,"image"],[external_Blockly_namespaceObject.Msg.HTML_MONTH,"month"],[external_Blockly_namespaceObject.Msg.HTML_RANGE,"range"],[external_Blockly_namespaceObject.Msg.HTML_RESET,"reset"],[external_Blockly_namespaceObject.Msg.HTML_SEARCH,"search"],[external_Blockly_namespaceObject.Msg.HTML_SUBMIT,"submit"],[external_Blockly_namespaceObject.Msg.HTML_TELEPHONENUMBER,"telephone number"],[external_Blockly_namespaceObject.Msg.HTML_TIME,"time"],[external_Blockly_namespaceObject.Msg.HTML_URL,"url"],[external_Blockly_namespaceObject.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_NAME).appendField(new external_Blockly_namespaceObject.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_VALUE).appendField(new external_Blockly_namespaceObject.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_content={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_style_color={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTextInput("property"),"KEY").appendField(":").appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},html_text={init:function(){this.setColour(HTML_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_TEXT).appendField(new external_Blockly_namespaceObject.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},UTILITY_HUE=160,raw_table={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldTable(""),"TEXT")}},raw_block={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT")}},raw_expression={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},raw_empty={init:function(){this.setColour(UTILITY_HUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},text_comment={init:function(){this.setColour(UTILITY_HUE),this.appendDummyInput().appendTitle("Comment:").appendTitle(new external_Blockly_namespaceObject.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},type_check={init:function(){this.setColour(UTILITY_HUE),this.appendValueInput("VALUE").appendField(external_Blockly_namespaceObject.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},text_print_multiple={init:function(){this.setColour(UTILITY_HUE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=external_Blockly_namespaceObject.Block.obtain(e,"text_print_multiple_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;a= stop:"," yield start"," start -= abs(step)"])};if(e=function(e,t,n){return"("+e+" <= "+t+") and "+o()+"("+e+", "+t+", "+n+") or "+r()+"("+e+", "+t+", "+n+")"},external_Blockly_namespaceObject.isNumber(a)&&external_Blockly_namespaceObject.isNumber(_)&&external_Blockly_namespaceObject.isNumber(l))a=parseFloat(a),_=parseFloat(_),l=Math.abs(parseFloat(l)),0==a%1&&0==_%1&&0==l%1?(a<=_?(_++,e=0==a&&1==l?_:a+", "+_,1!=l&&(e+=", "+l)):e=a+", "+--_+", -"+l,e="range("+e+")"):(e=a<_?o():r(),e+="("+a+", "+_+", "+l+")");else{var p=function(e,a){if(external_Blockly_namespaceObject.isNumber(e))e=parseFloat(e);else{var _=t.variableDB_.getDistinctName(n+a,external_Blockly_namespaceObject.Variables.NAME_TYPE);i+=_+" = "+e+"\n",e=_}return e};a=p(a,"_start"),_=p(_,"_end");p(l,"_inc"),e="number"==typeof a&&"number"==typeof _?a<_?o(0,_):r(0,_):e(a,_,l)}return i+="for "+n+" in "+e+":\n"+s},control_controls_for_range=function(e,t){var n=t.variableDB_.getName(e.getFieldValue("VAR"),external_Blockly_namespaceObject.Variables.NAME_TYPE),a=t.valueToCode(e,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(e,"TO",t.ORDER_NONE)||"0",l=t.valueToCode(e,"STEP",t.ORDER_NONE)||"1",s=t.statementToCode(e,"DO"),i=t.addLoopTrap(s,e.id)||t.PASS;return t.setups_.mixly_range="def mixly_range(start, stop, step):\n for i in range(start, stop + 1, step):\n yield i\n\n","for "+n+" in mixly_range("+a+", "+_+", "+l+"):\n"+i},control_controls_whileUntil=function(e,t){var n="UNTIL"==e.getFieldValue("MODE"),a=t.valueToCode(e,"BOOL",t.ORDER_NONE)||"False",_=t.statementToCode(e,"DO");return n&&(a="not "+a),"while "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_flow_statements=function(e){switch(e.getFieldValue("FLOW")){case"BREAK":return"break\n";case"CONTINUE":return"continue\n"}throw"Unknown flow statement."},control_controls_delay=function(e,t){return"sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},Panic_with_status_code=function(e,t){return"panic("+(t.valueToCode(this,"STATUS_CODE",t.ORDER_ATOMIC)||"1000")+")\n"},controls_millis=function(e,t){t.definitions_.import_time="import time";return["time.time()",t.ORDER_ATOMIC]},control_reset=function(e,t){return t.definitions_.import_microbit="from microbit import *","reset()\n"},controls_interrupts=function(){return"interrupts();\n"},controls_nointerrupts=function(){return"noInterrupts();\n"},control_controls_forEach=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"''",a=t.valueToCode(e,"LIST",t.ORDER_RELATIONAL)||"[]",_=t.statementToCode(e,"DO");return"for "+n+" in "+a+":\n"+(_=t.addLoopTrap(_,e.id)||t.PASS)},control_controls_range=function(e,t){return["range("+(t.valueToCode(this,"FROM",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"TO",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"STEP",t.ORDER_NONE)||"1")+")",t.ORDER_ATOMIC]},control_controls_lambda=function(e,t){var n="lambda "+(t.valueToCode(e,"BOOL",t.ORDER_NONE)||"None")+": "+(t.statementToCode(e,"DO")||"pass");return[n=n.replace("\n","").replace(" ",""),t.ORDER_ATOMIC]},time_sleep=function(e,t){return t.definitions_.import_time="import time","time.sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},control_controls_pass=function(){return"pass\n"},control_controls_thread=function(e,t){t.definitions_.import__thread="import _thread";var n=t.valueToCode(this,"VAR",t.ORDER_NONE)||"None";return"_thread.start_new_thread("+t.variableDB_.getName(t.valueToCode(this,"callback",t.ORDER_NONE)||"None",external_Blockly_namespaceObject.Procedures.NAME_TYPE)+", "+n+")\n"},control_do_while=function(e,t){var n=t.valueToCode(this,"select_data",t.ORDER_NONE)||"False",a=t.statementToCode(this,"input_data");return a="true"==this.getFieldValue("type")?a+" if ("+n+"):\n break\n":a+" if not ("+n+"):\n break\n","while True:\n"+(a=t.addLoopTrap(a,this.id)||t.PASS)},control_controls_repeat_ext=function(e,t){var n=t.valueToCode(this,"TIMES",t.ORDER_ATOMIC),a=t.statementToCode(e,"DO");return"for _my_variable in range("+n+"):\n"+(a=t.addLoopTrap(a,e.id)||t.PASS)},control_garbage_collection=function(e,t){t.definitions_.import_gc="import gc";return"gc.collect()\n"},control_get_mem_alloc=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_alloc()\n",t.ORDER_ATOMIC]},control_get_mem_free=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_free()\n",t.ORDER_ATOMIC]},control_get_unique_identifier=function(e,t){t.definitions_.import_machine="import machine";return["machine.unique_id()",t.ORDER_ATOMIC]},controls_repeat=control_controls_repeat_ext,math_math_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_constant=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_constant_mp=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},math_math_bit=function(e,t){var n=this.getFieldValue("OP"),a=t.ORDER_ATOMIC;return["("+(t.valueToCode(this,"A",a)||"0")+n+(t.valueToCode(this,"B",a)||"0")+")",a]},math_math_arithmetic=function(e,t){var n=(a={ADD:[" + ",t.ORDER_ADDITIVE],MINUS:[" - ",t.ORDER_ADDITIVE],MULTIPLY:[" * ",t.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",t.ORDER_MULTIPLICATIVE],QUYU:[" % ",t.ORDER_MULTIPLICATIVE],ZHENGCHU:[" // ",t.ORDER_MULTIPLICATIVE],POWER:[" ** ",t.ORDER_EXPONENTIATION]}[e.getFieldValue("OP")])[0],a=a[1];return[(t.valueToCode(e,"A",a)||"0")+n+(e=t.valueToCode(e,"B",a)||"0"),a]},math_math_selfcalcu=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_RELATIONAL)||"0",a=t.valueToCode(this,"B",t.ORDER_RELATIONAL)||"0";switch(this.getFieldValue("OP")){case"ADD":var _="+=";break;case"MINUS":_="-=";break;case"MULTIPLY":_="*=";break;case"DIVIDE":_="/=";break;case"QUYU":_="%=";break;case"ZHENGCHU":_="//=";break;case"POWER":_="**="}return n+" "+_+" "+a+"\n"},math_single=function(e,t){var n,a=e.getFieldValue("OP");if("NEG"==a)return["-"+(n=t.valueToCode(e,"NUM",t.ORDER_UNARY_SIGN)||"0"),t.ORDER_UNARY_SIGN];switch(t.definitions_.import_math="import math",e="SIN"==a||"COS"==a||"TAN"==a?t.valueToCode(e,"NUM",t.ORDER_MULTIPLICATIVE)||"0":t.valueToCode(e,"NUM",t.ORDER_NONE)||"0",a){case"ABS":n="math.fabs("+e+")";break;case"ROOT":n="math.sqrt("+e+")";break;case"LN":n="math.log("+e+")";break;case"LOG10":n="math.log10("+e+")";break;case"EXP":n="math.exp("+e+")";break;case"POW10":n="math.pow(10,"+e+")";break;case"ROUND":n="round("+e+")";break;case"ROUNDUP":n="math.ceil("+e+")";break;case"ROUNDDOWN":n="math.floor("+e+")";break;case"SIN":n="math.sin("+e+")";break;case"COS":n="math.cos("+e+")";break;case"TAN":n="math.tan("+e+")";break;case"++":n="++("+e+")";break;case"--":n="--("+e+")";break;case"-":n="-("+e+")"}if(n)return[n,t.ORDER_EXPONENTIATION];switch(a){case"ASIN":n="math.degrees(math.asin("+e+"))";break;case"ACOS":n="math.degrees(math.acos("+e+"))";break;case"ATAN":n="math.degrees(math.atan("+e+"))"}return[n,t.ORDER_MULTIPLICATIVE]},math_math_trig=math_single,math_math_dec=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+")",t.ORDER_ATOMIC]},math_math_to_int=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=this.getFieldValue("OP"),_="";return"round"===a?_=a+"("+n+")":(_="math."+a+"("+n+")",t.definitions_.import_math="import math"),[_,t.ORDER_ATOMIC]},math_math_max_min=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",a=t.valueToCode(this,"B",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+", "+a+")",t.ORDER_ATOMIC]},math_math_random=function(e,t){t.definitions_.import_random="import random";var n=this.getFieldValue("TYPE"),a=t.valueToCode(this,"FROM",t.ORDER_NONE)||"0",_=t.valueToCode(this,"TO",t.ORDER_NONE)||"0";if("int"==n)var l="random.randint("+a+", "+_+")";else if("float"==n)l="random.uniform("+a+", "+_+")";return[l,t.ORDER_UNARY_POSTFIX]},math_math_map=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE),a=t.valueToCode(this,"fromLow",t.ORDER_ATOMIC),_=t.valueToCode(this,"fromHigh",t.ORDER_ATOMIC),l=t.valueToCode(this,"toLow",t.ORDER_ATOMIC),s=t.valueToCode(this,"toHigh",t.ORDER_ATOMIC);return t.definitions_.import_mixpy_math_map="from mixpy import math_map",["math_map("+n+", "+a+", "+_+", "+l+", "+s+")",t.ORDER_NONE]},math_math_constrain=function(e,t){return["min(max("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"LOW",t.ORDER_NONE)||"0")+"), "+(t.valueToCode(this,"HIGH",t.ORDER_NONE)||"0")+")",t.ORDER_UNARY_POSTFIX]},math_math_number_base_conversion=function(e,t){var n=e.getFieldValue("OP"),a=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0",_=e.getFieldValue("OP2");t.definitions_.import_math="import math";var l="",s="10";if("two"==n?s="2":"eight"==n?s="8":"ten"==n?s="10":"sixteen"==n&&(s="16"),"two"==_?l="bin":"eight"==_?l="oct":"ten"==_?l="":"sixteen"==_&&(l="hex"),""==l)var i="int(str("+a+"), "+s+")";else i=l+"(int(str("+a+"), "+s+"))";return[i,t.ORDER_ATOMIC]},math_math_random_seed=function(e,t){return t.definitions_.import_random="import random","random.seed("+(t.valueToCode(this,"NUM",t.ORDER_NONE)||"0")+");\n"},math_math_indexer_number=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},math_math_round=function(e,t){return["round("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"VAR",t.ORDER_NONE)||"0")+")",t.ORDER_ATOMIC]},math_text_to_number=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_text_to_number_skulpt=function(e,t){var n=this.getFieldValue("TOWHAT"),a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[a+'.encode("utf-8")',t.ORDER_ATOMIC]:[n+"("+a+")",t.ORDER_ATOMIC]},math_base_map=math_math_map,generators_text_text=function(e,t){return[t.quote_(this.getFieldValue("TEXT")),t.ORDER_ATOMIC]},text_text_textarea=function(e,t){return['"""'+this.getFieldValue("VALUE")+'"""',t.ORDER_ATOMIC]},text_text_char=function(e,t){return["'"+this.getFieldValue("TEXT")+"'",t.ORDER_ATOMIC]},text_text_join=function(e,t){return[t.valueToCode(this,"A",t.ORDER_ATOMIC)+" + "+t.valueToCode(this,"B",t.ORDER_ATOMIC),t.ORDER_ADDITIVE]},text_ascii_to_char=function(e,t){return["chr("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},text_char_to_ascii=function(e,t){return["ord("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"a")+")",t.ORDER_ATOMIC]},text_number_to_text=function(e,t){return["str("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},text_text_length=function(e,t){return["len("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+")",t.ORDER_ATOMIC]},text_text_char_at2=function(e,t){var n=e.getFieldValue("WHERE")||"FROM_START",a=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""';switch(n){case"FROM_START":return[a+"["+(e=t.getAdjustedInt(e,"AT"))+"]",t.ORDER_ATOMIC];case"FROM_END":return[a+"["+(e=t.getAdjustedInt(e,"AT",1,!0))+"]",t.ORDER_ATOMIC];case"RANDOM":return t.definitions_.import_random="import random",["random.choice("+a+")",t.ORDER_FUNCTION_CALL]}throw"Unhandled combination (lists_getIndex)."},text_text_char_at=function(e,t){return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+"["+(t.valueToCode(this,"AT",t.ORDER_ATOMIC)||0)+"]",t.ORDER_ATOMIC]},text_text_random_char=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""';return t.definitions_.import_random="import random",["random.choice("+n+")",t.ORDER_FUNCTION_CALL]},text_text_equals_starts_ends=function(e,t){var n=t.valueToCode(this,"STR1",t.ORDER_ATOMIC)||'""',a=t.valueToCode(this,"STR2",t.ORDER_ATOMIC)||'""',_=this.getFieldValue("DOWHAT");return"==="===_?[n+" == "+a,t.ORDER_ATOMIC]:[n+"."+_+"("+a+")",t.ORDER_ATOMIC]},text_text_compare_to=function(e,t){return["cmp("+(t.valueToCode(this,"STR1",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"STR2",t.ORDER_ATOMIC)||'""')+")",t.ORDER_ATOMIC]},text_text_substring2=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""',a=e.getFieldValue("WHERE1"),_=e.getFieldValue("WHERE2");switch(a){case"FROM_START":"0"==(l=t.getAdjustedInt(e,"AT1"))&&(l="");break;case"FROM_END":var l=t.getAdjustedInt(e,"AT1",0,!0);break;case"FIRST":l="0";break;default:throw"Unhandled option (lists_getSublist)"}switch(_){case"FROM_START":var s=t.getAdjustedInt(e,"AT2");break;case"FROM_END":s=t.getAdjustedInt(e,"AT2",0,!0);external_Blockly_namespaceObject.isNumber(String(s))?"0"==s&&(s=""):(t.definitions_.import_sys="import sys",s+=" or sys.maxsize");break;case"LAST":s="-1";break;default:throw"Unhandled option (lists_getSublist)"}return[n+"["+l+" : "+s+"]",t.ORDER_ATOMIC]},text_text_substring=function(e,t){return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+"["+t.valueToCode(this,"AT1",t.ORDER_ATOMIC)+" : "+t.valueToCode(this,"AT2",t.ORDER_ATOMIC)+"]",t.ORDER_ATOMIC]},text_text_capital=function(e,t){var n=this.getFieldValue("CAPITAL");return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},text_text_center=function(e,t){var n=this.getFieldValue("CENTER");return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"WID",t.ORDER_ATOMIC)+","+t.valueToCode(this,"Symbol",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},text_text_find=function(e,t){return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".find("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},text_text_join_seq=function(e,t){return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".join("+(t.valueToCode(this,"LIST",t.ORDER_ASSIGNMENT)||"0")+")",t.ORDER_ATOMIC]},text_text_replace=function(e,t){return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".replace("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},text_text_split=function(e,t){return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+".split("+(t.valueToCode(this,"VAL",t.ORDER_ATOMIC)||'""')+")",t.ORDER_ATOMIC]},text_text_strip=function(e,t){var n=this.getFieldValue("TOWHAT");return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},text_text_format=function(e,t){for(var n=this.getFieldValue("VAR"),a=new Array(this.itemCount_),_=0;_",GTE:">="};const logic_logic_operation=function(e,t){var n=this.getFieldValue("OP"),a="&&"==n?t.ORDER_LOGICAL_AND:t.ORDER_LOGICAL_OR,_=t.valueToCode(this,"A",a)||"False",l=t.valueToCode(this,"B",a)||"False";if("AND"==n)var s=_+" and "+l;else if("OR"==n)s=_+" or "+l;else if("NOR"==n)s="not("+_+"^"+l+")";else s=_+"^"+l;return[s,a]},logic_logic_negate=function(e,t){var n=t.ORDER_UNARY_PREFIX;return["not "+(t.valueToCode(this,"BOOL",n)||"False"),n]},logic_logic_boolean=function(e,t){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",t.ORDER_ATOMIC]},logic_logic_null=function(e,t){return["None",t.ORDER_ATOMIC]},logic_logic_true_or_false=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"False";return["("+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"False")+" if "+n+" else "+(t.valueToCode(this,"C",t.ORDER_ATOMIC)||"False")+")",t.ORDER_ATOMIC]},logic_logic_is_in=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_is=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",a=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+a,t.ORDER_ATOMIC]},logic_logic_tobool=function(e,t){return["bool("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},storage_storage_open_file_with_os=function(e,t){return t.definitions_.import_os="import os","os.startfile("+t.valueToCode(this,"fn",t.ORDER_ATOMIC)+")\n"},storage_storage_fileopen=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+" = open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},storage_storage_fileopen_new=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",t.ORDER_ATOMIC]},storage_storage_fileopen_new_encoding=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',t.ORDER_ATOMIC]},storage_storage_file_write=function(e,t){var n=t.valueToCode(this,"data",t.ORDER_ATOMIC);return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".write("+n+")\n"},storage_storage_get_contents_without_para=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},storage_storage_get_contents=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_get_a_line=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".readline("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_can_write_ornot=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".writable()",t.ORDER_ATOMIC]},storage_storage_get_filename=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".name()",t.ORDER_ATOMIC]},storage_storage_close_file=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".close()\n"},storage_storage_list_all_files=function(e,t){t.definitions_.import_os="import os";return["os.listdir()",t.ORDER_ATOMIC]},storage_storage_delete_file=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_file_size=function(e,t){return t.definitions_.import_os="import os",["os.path.getsize("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},storage_storage_file_tell=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".tell()",t.ORDER_ATOMIC]},storage_storage_file_seek=function(e,t){var n=this.getFieldValue("MODE"),a=0;return a="start"==n?0:"current"==n?1:2,t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".seek("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+","+a+")\n"},storage_storage_change_dir=function(e,t){return t.definitions_.import_os="import os","os.chdir("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},storage_storage_get_current_dir=function(e,t){t.definitions_.import_os="import os";return["os.getcwd()",t.ORDER_ATOMIC]},storage_storage_make_dir=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"PATH",t.ORDER_ATOMIC)+")\n"},storage_storage_rename=function(e,t){return t.definitions_.import_os="import os","os.rename("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+","+t.valueToCode(this,"NEWFILE",t.ORDER_ATOMIC)+")\n"},storage_storage_is_file=function(e,t){t.definitions_.import_os="import os";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",t.ORDER_ATOMIC]},storage_sdcard_use_spi_init=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = sdcard.SDCard("+t.valueToCode(this,"SPISUB",t.ORDER_ATOMIC)+","+t.valueToCode(this,"PINSUB",t.ORDER_ATOMIC)+")\n"},storage_sdcard_mount=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard","os.mount("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"DIR",t.ORDER_ATOMIC)+")\n"},procedures_procedures_defreturn=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("NAME"),external_Blockly_namespaceObject.Procedures.NAME_TYPE),a=t.statementToCode(this,"STACK")||" pass\n";t.INFINITE_LOOP_TRAP&&(a=t.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+a);var _=t.valueToCode(this,"RETURN",t.ORDER_NONE)||"";_&&(_=" return "+_+"\n");for(var l=[],s=0;s\n\n\n\t\n"+t.statementToCode(this,"HEAD")+"\n\n"+t.statementToCode(this,"BODY")+"\n\n'''",t.ORDER_ATOMIC]},html_html_title=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"\n"+n+"\n"},html_html_head_body=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");if("head"==a)var _="<"+a+'>\n\t\n'+n+"\n";else _="<"+a+">\n"+n+"\n";return _},html_html_content=function(e,t){var n=t.statementToCode(this,"DO"),a=this.getFieldValue("LEVEL");return"<"+a+">\n"+n+"\n"},html_html_content_more=function(e,t){var n=t.statementToCode(this,"DO"),a=t.valueToCode(this,"style"),_=this.getFieldValue("LEVEL");return"<"+_+" "+a+" >\n"+n+"\n"},html_html_style=function(e,t){return['style="'+t.statementToCode(this,"STYLE")+'"',t.ORDER_ATOMIC]},html_html_form=function(e,t){return'"},html_html_style_content=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},html_html_text=function(){return this.getFieldValue("TEXT")+"\n"},utility_raw_block=function(e){return e.getFieldValue("TEXT")+"\n"},utility_raw_expression=function(e,t){return[e.getFieldValue("TEXT"),t.ORDER_ATOMIC]},utility_raw_empty=function(e,t){return(t.valueToCode(e,"VALUE",t.ORDER_ATOMIC)||"")+"\n"},utility_raw_table=function(){return""},utility_type_check=function(e,t){return["type("+(t.valueToCode(e,"VALUE",t.ORDER_MEMBER)||"___")+")",t.ORDER_ATOMIC]},utility_function_call=function(e,t){for(var n=e.getFieldValue("NAME"),a=e.hasReturn_,_=new Array(e.itemCount_),l=0;l0?t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+"while True:\n"+l.join("")+s.join("\n"):t.join("\n")+"\n"+a.join("\n")+"\n"+_.join("")+"\n"+e+s.join("\n")},Python.scrubNakedValue=function(e){return e+"\n"},Python.quote_=function(e){var t="'";return-1!==(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===e.indexOf('"')?t='"':e=e.replace(/'/g,"\\'")),t+e+t},Python.multiline_quote_=function(e){return"'''"+(e=e.replace(/'''/g,"\\'\\'\\'"))+"'''"},Python.scrub_=function(e,t,n){var a="";if(!e.outputConnection||!e.outputConnection.targetConnection){(l=e.getCommentText())&&(l=external_Blockly_namespaceObject.utils.string.wrap(l,Python.COMMENT_WRAP-3),a+=Python.prefixLines(l+"\n","# "));for(var _=0;_0?"int("+i+" + "+_+")":_<0?"int("+i+" - "+-_+")":"int("+i+")",a&&(i="-"+i)),i};const AI_HUE=205,AI_ChooseAndGet={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[external_Blockly_namespaceObject.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},AI_client={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETUP).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech,"AipSpeech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace,"AipFace"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"AipOcr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},AI_Speech_synthesis={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Speech_asr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_File).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_ImageClassify_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},AI_Face_match={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"1"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image+"2"+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify_Image).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Ocr_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_webImage,"webImage"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_idcard,"idcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_receipt,"receipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_form,"tableRecognition"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_passport,"passport"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Sim={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_FUNC).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"1").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.OLED_STRING+"2").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_Func={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_lexer,"lexer"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_depParser,"depParser"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_keyword,"keyword"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic,"topic"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Func_sim={init:function(){this.setColour(AI_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},AI_Nlp_Topic={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_topic).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_Nlp_newsSummary={init:function(){this.setColour(AI_HUE),this.appendValueInput("SUB").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_summary).appendField(external_Blockly_namespaceObject.Msg.MIXLY_Client).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Content).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(external_Blockly_namespaceObject.Msg.MIXLY_LIST_LEN).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},AI_audio={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},AI_photo={init:function(){this.setColour(AI_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},AI_result={init:function(){this.setColour(AI_HUE),this.appendValueInput("AI").appendField(external_Blockly_namespaceObject.Msg.MIXPY_AI_RESULT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_AipImageClassify,"Image"],[external_Blockly_namespaceObject.Msg.MIXLY_AipSpeech_asr,"Speech"],[external_Blockly_namespaceObject.Msg.MIXLY_AipFace_match,"Face"],[external_Blockly_namespaceObject.Msg.MIXLY_AipOcr,"Ocr"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.LOGIC_NEGATE_TOOLTIP)}},ALGORITHM_HUE="#526FC3",algorithm_prepare={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_find_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_new_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},algorithm_set_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_add_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_del_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_return_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},algorithm_print_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_current_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},algorithm_no_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_1={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_prepare_2_2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_move_recent={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_not_home={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},algorithm_not_school={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},algorithm_print_path2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hanoi_init={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_move={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_all_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_all_books_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_first_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_no_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},algorithm_yes_ring2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},algorithm_next_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_two_left={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},algorithm_divide_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_half_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_book={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_delete_books2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_book2={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_book_scale={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new external_Blockly_namespaceObject.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_number_zero={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_number_add={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_number={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_get_book_num={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField("n"+external_Blockly_namespaceObject.Msg.MIXLY_VALUE2).appendField(new external_Blockly_namespaceObject.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_sequence={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_print_divide={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_init_jttl={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头,"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_zero={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_number_in_range={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_chick_calculate={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_check_feet={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_print_jttl_answer={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_rabbit_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_fzsf={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("计算").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_calc_first_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_compare={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_set_min={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("设置").appendField(new external_Blockly_namespaceObject.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_fz_move={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_init_hxdb={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若3人一排列队,多1人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若5人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("若7人一排列队,多2人;"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_init_soldier={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new external_Blockly_namespaceObject.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_stand_in_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("使士兵").appendField(new external_Blockly_namespaceObject.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_last_line={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("剩余").appendField(new external_Blockly_namespaceObject.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_add={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},algorithm_hxdb_result={init:function(){this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setTooltip(""),this.setHelpUrl("")}},hanoi_init_offline={init:function(){this.appendDummyInput().appendField("准备").appendField(new external_Blockly_namespaceObject.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(ALGORITHM_HUE),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},algorithm_get_current_location={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},algorithm_void_path={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},algorithm_color_seclet={init:function(){this.setColour(ALGORITHM_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},COMMUNICATE_HUE="#3288dd",requests_get_old={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("DOMAIN").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET).appendField(new external_Blockly_namespaceObject.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},requests_get={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS).appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_post={init:function(){this.setColour(COMMUNICATE_HUE),this.appendValueInput("URL").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS+external_Blockly_namespaceObject.Msg.OLED_STRING),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},requests_attribute={init:function(){this.appendValueInput("VAL");var e=[[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[external_Blockly_namespaceObject.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[external_Blockly_namespaceObject.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},requests_method={init:function(){this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(COMMUNICATE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_CONDUCT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]}))}},CV_HUE="f0a559",cv_read_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_show_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_write_image={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_waitkey={init:function(){this.setColour(CV_HUE),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+external_Blockly_namespaceObject.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},cv_destroy_all={init:function(){this.setColour(CV_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},cv_line_rect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_CV_RECT,"rectangle"],[external_Blockly_namespaceObject.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_text={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new external_Blockly_namespaceObject.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},cv_face_classifier={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},cv_face_detect_all={init:function(){this.setColour(CV_HUE),this.appendValueInput("FILE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},DATA_HUE=170,series_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_one_index={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"index"],[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_create_from_index={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(external_Blockly_namespaceObject.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(external_Blockly_namespaceObject.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_create_from_text={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new external_Blockly_namespaceObject.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},series_index_value={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.SERIES_INDEX,"index"],[external_Blockly_namespaceObject.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.SERIES_INDEX_VALUE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"INDEX_VALUE"),this.setOutput(!0,"List");var t=this;this.setTooltip((function(){var e=t.getFieldValue("INDEX_VALUE");return{index:external_Blockly_namespaceObject.Msg.SERIES_INDEX_TOOLTIP,value:external_Blockly_namespaceObject.Msg.HTML_VALUE_TOOLTIP}[e]}))}},series_get_num={init:function(){this.setColour(DATA_HUE),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TUPLE_GET_INDEX_TOOLTIP)}},pl_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},array_create={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FROM").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SPLITBYDOU).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pl_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},pl_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},pl_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},pl_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pl_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},numpy_trig={init:function(){var e=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_ROUND,"round"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_CEIL,"ceil"],[external_Blockly_namespaceObject.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(DATA_HUE),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"OP"),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},pl_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pandas_readcsv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILENAME").appendField(external_Blockly_namespaceObject.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},dataframe_get={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.DATAFRAME_COLUMN,"column"],[external_Blockly_namespaceObject.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},pl_savefig={init:function(){this.setColour(DATA_HUE),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},pl_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},array_toarray={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},plot_plot_easy={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_show={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_axes={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_legend={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_title={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_label={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_SET_LABEL).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_DISPLAY_DRAW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{plot:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]}))}},plot_plot_scatter={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],t=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_SCATTER).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},plot_plot_xy={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[external_Blockly_namespaceObject.Msg.COLOUR_RGB_BLUE,"b"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_GREEN,"g"],[external_Blockly_namespaceObject.Msg.COLOUR_RGB_RED,"r"],[external_Blockly_namespaceObject.Msg.COLOUR_CYAN,"c"],[external_Blockly_namespaceObject.Msg.COLOUR_MAGENTA,"m"],[external_Blockly_namespaceObject.Msg.COLOUR_YELLOW,"y"],[external_Blockly_namespaceObject.Msg.COLOUR_BLACK,"k"],[external_Blockly_namespaceObject.Msg.COLOUR_WHITE,"w"]],n=[[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_bar={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.HTML_COLOUR).appendField(new external_Blockly_namespaceObject.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_pie={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE).appendField(external_Blockly_namespaceObject.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},plot_hist={init:function(){this.setColour(DATA_HUE),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_HIST).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},plot_ticks={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},plot_subplot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},plot_savefig={init:function(){this.setColour(DATA_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},plot_text={init:function(){this.setColour(DATA_HUE);var e=[[external_Blockly_namespaceObject.Msg.TEXT_TRIM_LEFT,"right"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOP,"bottom"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_CENTER,"center"],[external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_SETTING).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_HOR).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_VER).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_PL_TEXT_TOOLTIP)}},numpy_shape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},numpy_reshape={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},numpy_astype={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new external_Blockly_namespaceObject.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},pylab_imshow={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("展示图像"),this.appendDummyInput().appendField("颜色").appendField(new external_Blockly_namespaceObject.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},numpy_mean_digit={init:function(){this.setColour(DATA_HUE),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},numpy_argmin_template_match={init:function(){this.setColour(DATA_HUE),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},numpy_mean={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},numpy_std={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},pandas_dropna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},pandas_drop_columns={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Drops columns from dataframe.")}},numpy_ones={init:function(){this.setColour(DATA_HUE),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},numpy_c_={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("列拼接:数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},numpy_linalg_det={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},matrix_transpose={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},matrix_multiplication={init:function(){this.setColour(DATA_HUE),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},numpy_linalg_inv={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},dataframe_median={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},dataframe_fillna={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new external_Blockly_namespaceObject.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},dataframe_info={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},numpy_min={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},numpy_max={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new external_Blockly_namespaceObject.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},numpy_size={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},numpy_dot={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},numpy_square={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},numpy_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},numpy_random_random={init:function(){this.setColour(DATA_HUE),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},py_sum={init:function(){this.setColour(DATA_HUE),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},dataframe_sort_values={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("排序方式").appendField(new external_Blockly_namespaceObject.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_head_tail={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("获取").appendField(new external_Blockly_namespaceObject.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_select={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_groupby={init:function(){this.setColour(DATA_HUE),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},dataframe_aggregate_func={init:function(){this.setColour(DATA_HUE),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},DS_HUE=80,ds_create_linkedlist={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new external_Blockly_namespaceObject.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("ds_create_linkedlist_container");t.initSvg();for(var n=t.getInput("STACK").connection,a=0;at?e[t]:"name"),"KEY"+t).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ds_create_linkedlist_container={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},ds_create_linkedlist_item={init:function(){this.setColour(DS_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},ds_create_node={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_USE).appendField(new external_Blockly_namespaceObject.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_CREATE_NODE_TOOLTIP)}},ds_get_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},ds_set_node_attr={init:function(){this.setColour(DS_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AIP_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},ds_add_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_add_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_BEFORE,"before"],[external_Blockly_namespaceObject.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_TOOLTIP)}},ds_del_node_by_name={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_del_node_by_attr={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_ATTR).appendField(new external_Blockly_namespaceObject.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_AS),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},ds_reverse_linkedlist={init:function(){this.setColour(DS_HUE),this.appendValueInput("NODE").appendField(external_Blockly_namespaceObject.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(external_Blockly_namespaceObject.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DS_DEL_NODE_TOOLTIP)}},FACTORY_HUE="#777777",factory_from_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("from ").appendField(new external_Blockly_namespaceObject.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_import={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField("import ").appendField(new external_Blockly_namespaceObject.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},factory_function_noreturn={init:function(){this.setColour(FACTORY_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new external_Blockly_namespaceObject.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("items",this.itemCount_);for(var t=0;tt?e[t]:'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},iot_publish_container={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},iot_publish_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_create_with_item={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},iot_mixio_connect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_WIFI_USERNAME).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_IOT_PASSWORD).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PROJECT).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_MIXIO_PUBLISH={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(external_Blockly_namespaceObject.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},IOT_MIXIO_SUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE+external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_MSG).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},IOT_MIXIO_UNSUBSCRIBE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(external_Blockly_namespaceObject.Msg.MSG.stop+external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},iot_mixio_disconnect={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_connect_only={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_check={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixio_format_topic={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},iot_mixio_format_msg={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},IOT_FORMATTING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},IOT_FORMAT_STRING={init:function(){this.setColour(IOT_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},IOT_EMQX_PING={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},IOT_MIXIO_NTP={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+external_Blockly_namespaceObject.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(external_Blockly_namespaceObject.Msg.MIXLY_EMQX_SERVER).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(external_Blockly_namespaceObject.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mixly_key_py={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new external_Blockly_namespaceObject.FieldImage(t,12,12,'"')}},iot_mixly_key={init:function(){this.VISITOR_ID=external_Mixly_namespaceObject.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(IOT_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},iot_client_onboard={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MixIO").appendField(external_Blockly_namespaceObject.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},iot_http_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME).appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_http_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("HTTP"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_mqtt_client={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(external_Blockly_namespaceObject.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_INIT_SUBSCRIBE).appendField(external_Blockly_namespaceObject.MQTT_Topic).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(external_Blockly_namespaceObject.Msg.MIXLY_OPEN_DEBUG).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},iot_mqtt_data={init:function(){this.setColour(IOT_HUE),this.appendDummyInput().appendField("MQTT"+external_Blockly_namespaceObject.Msg.MIXLY_Client).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_LEN,"client_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[external_Blockly_namespaceObject.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},iot_onenetconnect=iot_onenet_connect,iot_onenetdisconnect=iot_onenet_disconnect,iot_checkonenet=iot_onenet_check,iot_publish=iot_onenet_publish,PINS_HUE=230,pins_digital_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},pins_digital_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},pins_analog_write={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},pins_analog_read={init:function(){this.setColour(PINS_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(external_Mixly_namespaceObject.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},SERIAL_HUE=40,serial_open={init:function(){this.setColour(SERIAL_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldLabel(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN)).appendField(new external_Blockly_namespaceObject.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SERIAL_BEGIN).appendField(new external_Blockly_namespaceObject.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},serial_write={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},serial_read_b={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},serial_close={init:function(){this.setColour(SERIAL_HUE),this.appendValueInput("SER"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},SKLEARN_HUE=80,sklearn_make_classification={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_regression={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_make_blobs={init:function(){this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_load={init:function(){var e=[[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.LOAD).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"type").appendField(new external_Blockly_namespaceObject.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("name"))&&this.setTitleValue(t,"name")}},sklearn_data_target={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SET),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.EIGENVALUES,"data"],[external_Blockly_namespaceObject.Msg.LABEL_VALUE,"target"],[external_Blockly_namespaceObject.Msg.FEATURE,"feature_names"],[external_Blockly_namespaceObject.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_train_test_split_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_LinearRegression={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_Ridge={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_DecisionTreeClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_RandomForestClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KNeighborsClassifier_Regressor={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KNN_INIT).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[external_Blockly_namespaceObject.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_GaussianNB={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_KMeans={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.RANDOM_SEED),this.appendValueInput("n_jobs").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_fit_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_predict={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_score_no_target={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_coef_intercept={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).setCheck(null).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_COEF,"coef_"],[external_Blockly_namespaceObject.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_cluster_centers_labels_inertia={init:function(){this.appendDummyInput().appendField("sklearn "+external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_GET).appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[external_Blockly_namespaceObject.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[external_Blockly_namespaceObject.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},sklearn_save_load_model={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("sklearn").appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.SKLEARN_SAVE_MODEL,"dump"],[external_Blockly_namespaceObject.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+external_Blockly_namespaceObject.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(SKLEARN_HUE),this.setTooltip(""),this.setHelpUrl("")}},SYSTEM_HUE=120,base_delay={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY+"("+external_Blockly_namespaceObject.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_controls_millis={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},time_localtime={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new external_Blockly_namespaceObject.FieldDropdown([[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[external_Blockly_namespaceObject.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},system_Panic_with_status_code={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("STATUS_CODE",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},system_reset={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},controls_mstimer2={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("TIME").setCheck(Number).setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_start={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},controls_mstimer2_stop={init:function(){this.setColour(SYSTEM_HUE),this.appendDummyInput().appendField("MsTimer2").appendField(external_Blockly_namespaceObject.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},system_time_sleep={init:function(){this.setColour(SYSTEM_HUE),this.appendValueInput("DELAY_TIME",Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},TURTLE_HUE=180,turtle_create={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_create).appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_done={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_exitonclick={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_move={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_forward,"forward"],[external_Blockly_namespaceObject.Msg.blockpy_backward,"backward"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},turtle_rotate={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_left,"left"],[external_Blockly_namespaceObject.Msg.blockpy_right,"right"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_rotate).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{left:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[e]}))}},turtle_setheading={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_delay={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_MILLIS),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_goto={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_setxy={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_X,"x"],[external_Blockly_namespaceObject.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},turtle_pos_shape={init:function(){this.setColour(TURTLE_HUE);var e=[[external_Blockly_namespaceObject.Msg.TURTLE_POS,"pos"],[external_Blockly_namespaceObject.Msg.TURTLE_SHAPE,"shape"],[external_Blockly_namespaceObject.Msg.TURTLE_HEADING,"heading"],[external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_POS_SHAPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR");var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pos:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[e]})),this.setOutput(!0),this.setInputsInline(!0)}},turtle_clear={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_reset,"reset"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_home,"home"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{clear:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[e]}))}},turtle_penup={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_penup,"penup"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{penup:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[e]}))}},turtle_fill={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_beginfill,"begin"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_endfill,"end"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{begin:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[e]}))}},turtle_size_speed={init:function(){this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldTextInput("tina"),"TUR");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_size,"pensize"],[external_Blockly_namespaceObject.Msg.MIXLY_SPEED,"speed"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{pensize:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[e]}))}},turtle_size={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_size),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_speed={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_set_speed),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_circle={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_dot,"dot"]];this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_draw).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{circle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[e]}))}},turtle_circle_advanced={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},turtle_visible={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_hide,"hideturtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{hideturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[e]}))}},turtle_bgcolor={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_clone={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.TURTLE_CLONE),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},turtle_bgcolor_hex_new={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex_new={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor).appendField(new external_Blockly_namespaceObject.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_color_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR1").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_bgcolor_hex={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_pencolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_fillcolor_hex={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_shape={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_arrow,"arrow"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_turtle,"turtle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_circle,"circle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_square,"square"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_triangle,"triangle"],[external_Blockly_namespaceObject.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_shape).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_SHAPE_TOOLTIP)}},turtle_shapesize={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},turtle_numinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_NUMINPUT_TOOLTIP)}},turtle_textinput={init:function(){this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(TURTLE_HUE),this.appendValueInput("TITLE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},turtle_write={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_write_format_skulpt={init:function(){var e=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(TURTLE_HUE),this.appendValueInput("VAR").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new external_Blockly_namespaceObject.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new external_Blockly_namespaceObject.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new external_Blockly_namespaceObject.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.TURTLE_WRITE_TOOLTIP)}},turtle_color_seclet={init:function(){this.setColour(TURTLE_HUE),this.appendDummyInput("").setAlign(external_Blockly_namespaceObject.inputs.Align.RIGHT).appendField(new external_Blockly_namespaceObject.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},turtle_getscreen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new external_Blockly_namespaceObject.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){external_Blockly_namespaceObject.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},turtle_onkey={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},turtle_onclick={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},turtle_ontimer={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(external_Blockly_namespaceObject.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(external_Blockly_namespaceObject.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},turtle_listen={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendDummyInput().appendField(external_Blockly_namespaceObject.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},turtle_screen_savefig={init:function(){this.setColour(TURTLE_HUE),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(external_Blockly_namespaceObject.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(external_Blockly_namespaceObject.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},ai_AI_ChooseAndGet=function(e,t){var n=this.getFieldValue("TYPE");return t.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",t.ORDER_ATOMIC]},ai_AI_client=function(e,t){var n=this.getFieldValue("CTYPE");return t.definitions_.import_aip="import aip",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = aip."+n+"("+t.valueToCode(this,"API_KEY",t.ORDER_ATOMIC)+", "+t.valueToCode(this,"SECRET_KEY",t.ORDER_ATOMIC)+")\n"},ai_AI_Speech_synthesis=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".synthesis("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Speech_asr=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".asr("+(t.valueToCode(this,"FILE",t.ORDER_ATOMIC)||'""')+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Face_match=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".match("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Ocr=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Sim=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),a=t.valueToCode(this,"STR1",t.ORDER_ATOMIC),_=t.valueToCode(this,"STR2",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+a+","+_+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_Nlp_Topic=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".topic("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},ai_AI_Nlp_newsSummary=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".newsSummary("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"LEN",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},ai_AI_ImageClassify_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Ocr_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_Nlp_Func_sim=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},ai_AI_audio=function(e,t){return t.definitions_.import_audio="import audio","audio.audio_record("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"TIME",t.ORDER_ATOMIC)||"0")+")\n"},ai_AI_photo=function(e,t){return t.definitions_.import_audio="import cam","cam.photo_capture("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"BUT",t.ORDER_ATOMIC)||'""')+")\n"},ai_AI_result=function(e,t){var n=t.valueToCode(this,"AI",t.ORDER_ASSIGNMENT)||"0",a=this.getFieldValue("CTYPE");if("Image"==a)var _=n+'["result"][0]["keyword"]';if("Speech"==a)_=n+'["result"][0]';if("Face"==a||"OcrSimilarity"==a)_=n+'["score"]';if("Ocr"==a)_=n+'["words_result"]';return[_,t.ORDER_ATOMIC]},algorithm_algorithm_prepare=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nfor i in house:\n i.hide()\n"},algorithm_algorithm_add_school=function(){return"path = [1]\ncar = sprite.Sprite('car', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},algorithm_algorithm_find_path=function(e,t){t.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},algorithm_algorithm_new_path=function(e,t){return["flag == 1",t.ORDER_ATOMIC]},algorithm_algorithm_set_path=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},algorithm_algorithm_add_path=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},algorithm_algorithm_del_path=function(e,t){t.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},algorithm_algorithm_return_path=function(){var e="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return e="house[f].hide()\ndrive(path[len(path) - 1])\n"+e},algorithm_algorithm_no_left=function(e,t){return["len(path) == 7",t.ORDER_ATOMIC]},algorithm_algorithm_print_path=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},algorithm_algorithm_prepare2=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nbarricade = sprite.Sprite('barricade', 570, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.hide()\n"},algorithm_algorithm_current_school=function(e,t){return["f == 1",t.ORDER_ATOMIC]},algorithm_algorithm_no_path=function(){return"print('没有符合条件的路线')\n"},algorithm_algorithm_prepare_2_1=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_prepare_2_2=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},algorithm_algorithm_move_recent=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]6:\n print("路线错乱!程序有误!")\n exit()\n'},algorithm_algorithm_not_home=function(e,t){return["name[now] != '小科家'",t.ORDER_ATOMIC]},algorithm_algorithm_not_school=function(e,t){return["name[now] != '学校'",t.ORDER_ATOMIC]},algorithm_algorithm_print_path2=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},algorithm_hanoi_init=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var a="print('层数过高!不得高于6层!')\nexit()\n";else a="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return a},algorithm_hanoi_move=function(e,t){var n=t.valueToCode(this,"FROM_NUM",t.ORDER_ATOMIC)||"0",a=t.valueToCode(this,"TO_NUM",t.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${a}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${a}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${a}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${a}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${a}*200+200, 400-len(_Hanoi[${a}])*27, 0.2)\n _Hanoi[${a}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},algorithm_algorithm_all_books_sequence=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},algorithm_algorithm_all_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},algorithm_algorithm_first_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},algorithm_algorithm_no_ring2=function(e,t){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",t.ORDER_ATOMIC]},algorithm_algorithm_yes_ring2=function(e,t){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",t.ORDER_ATOMIC]},algorithm_algorithm_next_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},algorithm_algorithm_two_left=function(e,t){return["len(list)>=2",t.ORDER_ATOMIC]},algorithm_algorithm_divide_books=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},algorithm_algorithm_get_half_books=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_delete_book=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},algorithm_algorithm_print_book2=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},algorithm_algorithm_book_scale=function(e,t){var n=this.getFieldValue("NUM");return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},algorithm_algorithm_number_zero=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},algorithm_algorithm_number_add=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},algorithm_algorithm_print_number=function(e,t){t.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},algorithm_algorithm_init_jttl=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},algorithm_algorithm_rabbit_zero=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},algorithm_algorithm_rabbit_number_in_range=function(e,t){return["_rabbit < _head",t.ORDER_ATOMIC]},algorithm_algorithm_chick_calculate=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},algorithm_algorithm_check_feet=function(e,t){return["_rabbit*4 + _chick*2 == _foot",t.ORDER_ATOMIC]},algorithm_algorithm_print_jttl_answer=function(e,t){t.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},algorithm_algorithm_rabbit_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},algorithm_algorithm_init_fzsf=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},algorithm_algorithm_fz_calc=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const a=[0,[1,3],[2,4],[5,7],[6]];var _="";return _+=`_S${n}.show()\ntime.sleep(1)\n`,_+=4!=n?`_Slen[${n}] = _Llen[${a[n][0]}] + _Llen[${a[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},algorithm_algorithm_fz_compare=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,t.ORDER_ATOMIC]},algorithm_algorithm_fz_set_min=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),a="";return a+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},algorithm_algorithm_fz_move=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},algorithm_algorithm_init_hxdb=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},algorithm_algorithm_hxdb_init_soldier=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},algorithm_algorithm_hxdb_stand_in_line=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},algorithm_algorithm_hxdb_last_line=function(e,t){return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,t.ORDER_ATOMIC]},algorithm_algorithm_hxdb_add=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},algorithm_algorithm_hxdb_result=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},algorithm_hanoi_init_offline=function(e,t){t.definitions_.import_turtle="import turtle",t.definitions_.import_time="import time",t.definitions_.import_math="import math";var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC),a=this.getFieldValue("NUM");return t.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",t.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",t.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a 1"}]`,t.ORDER_ATOMIC]},data_dataframe_groupby=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.groupby(by=${t.valueToCode(e,"KEY",t.ORDER_ATOMIC)||"'tag'"})`,t.ORDER_ATOMIC]},data_dataframe_aggregate_func=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.${e.getFieldValue("TYPE")}()`,t.ORDER_ATOMIC]},datastructure_ds_create_linkedlist=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("VAR"),external_Blockly_namespaceObject.Variables.NAME_TYPE),a=t.variableDB_.getName(this.getFieldValue("TYPE"),external_Blockly_namespaceObject.Variables.NAME_TYPE),_="class "+a+":\n";_+=" def __init__(self):\n";for(var l=new Array(this.itemCount_),s=0;s{document.removeEventListener("DOMContentLoaded",e),this._pageLoad.resolve()};document.addEventListener("DOMContentLoaded",e)}else this._pageLoad.resolve();(async()=>{switch(n){case"python":case"python3":case"python3.11":const{KernelPython3:t}=await __webpack_require__.e(211).then(__webpack_require__.bind(__webpack_require__,211));this._kernel=new t(e);break;case"python3-old":case"python3.8":const{KernelPython3Old:a}=await __webpack_require__.e(195).then(__webpack_require__.bind(__webpack_require__,5195));this._kernel=new a(e);break;case"js":case"javascript":const{KernelJavaScript:_}=await __webpack_require__.e(97).then(__webpack_require__.bind(__webpack_require__,4097));this._kernel=new _(e);break;case"sql":const{KernelSQL:l}=await Promise.all([__webpack_require__.e(960),__webpack_require__.e(837)]).then(__webpack_require__.bind(__webpack_require__,592));this._kernel=new l(e);break;case"ocaml":const{KernelOCaml:s}=await __webpack_require__.e(38).then(__webpack_require__.bind(__webpack_require__,38));this._kernel=new s(e);break;default:return window.console.error(`Kernel '${n}' not supported.`),void this._kernelAvailable.reject()}window.Basthon=this._kernel,this._kernelAvailable.resolve(this._kernel)})()}async pageLoad(){await this._pageLoad.promise}async kernelAvailable(){return await this._kernelAvailable.promise}async kernelLoaded(){const e=await this.kernelAvailable();return await e.loaded(),e}get kernel(){return this._kernel}get kernelSafe(){var e;return(null===(e=this.kernel)||void 0===e?void 0:e.ready)?this.kernel:null}async showLoader(e,t=!1,n=!0){this.kernelAvailable().then((()=>{var e;return null===(e=this.kernel)||void 0===e?void 0:e.init()})),__webpack_require__.e(317).then(__webpack_require__.bind(__webpack_require__,1317));const a="basthon-loader-"+(t?"full":"foot"),_=document.createElement("div");_.id=this._loaderId,_.classList.add("darklighted"),_.classList.add("basthon-loader-root"),_.classList.add(a);const l=document.createElement("div");l.classList.add("basthon-loader-container"),l.classList.add(a),_.appendChild(l);const s=document.createElement("div");s.classList.add("basthon-loader-spinner"),s.classList.add(a),s.innerHTML="",l.appendChild(s);const i=document.createElement("div");i.classList.add("basthon-loader-break"),i.classList.add(a),l.appendChild(i);const o=document.createElement("div");o.classList.add("basthon-loader-text"),o.classList.add(a),o.innerHTML=e,l.appendChild(o),this._loaderTextElem=o;const r=document.createElement("div");r.classList.add("basthon-loader-text"),r.classList.add(a),r.style.display="none",l.appendChild(r),this._loaderTextError=r,await this.pageLoad(),document.body.appendChild(_),this._rootLoader=_;try{await this.kernelLoaded()}catch(e){const t=this.browser();this.setErrorText(`Erreur de chargement de Basthon !!!
Vérifiez que votre navigateur est à jour.
Version détectée : ${t.name} ${t.version}.`);for(const e of document.body.querySelectorAll(".basthon-loader-foot"))e.classList.remove("basthon-loader-foot"),e.classList.add("basthon-loader-full");return s.classList.remove("basthon-loader-spinner"),s.classList.add("basthon-loader-error"),void(this._doNotHideLoader=!0)}this._doNotHideLoader=!1,n&&this.hideLoader()}setLoaderText(e){null!=this._loaderTextElem&&(this._loaderTextElem.innerHTML=e)}setErrorText(e){null!=this._loaderTextElem&&(this._loaderTextElem.style.display="none"),null!=this._loaderTextError&&(this._loaderTextError.style.display="",this._loaderTextError.innerHTML=e)}hideLoader(){if(this._doNotHideLoader)return;const e=this._rootLoader;null!=e&&(e.classList.add("basthon-loader-hide"),window.setTimeout((()=>{this._rootLoader=void 0,e.remove()}),1100))}browser(){var e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""}:"Chrome"===n[1]&&null!=(e=t.match(/\bOPR|Edge\/(\d+)/))?{name:"Opera",version:e[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),{name:n[0],version:n[1]})}}const external_$_namespaceObject=$;var external_$_default=__webpack_require__.n(external_$_namespaceObject);const statusbar_image_namespaceObject='\r\n
\r\n\r\n
';class StatusBarImage extends external_Mixly_namespaceObject.PageBase{static{external_Mixly_namespaceObject.HTMLTemplate.add("html/statusbar/statusbar-image.html",new external_Mixly_namespaceObject.HTMLTemplate(statusbar_image_namespaceObject)),this.init=function(){external_Mixly_namespaceObject.StatusBarsManager.typesRegistry.register(["images"],StatusBarImage);const e=external_Mixly_namespaceObject.Workspace.getMain().getStatusBarsManager();e.add("images","images",external_Blockly_namespaceObject.Msg.PYTHON_PYODIDE_IMAGE),e.changeTo("output")}}constructor(){super();const e=external_$_default()(external_Mixly_namespaceObject.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(e)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(e){const t=this.getContent(),n=function(e){e.style.width="auto",e.style.height="auto",e.style.maxWidth="100%",e.style.maxHeight="100%"};this.clean();let a=e.content,_=null,l=null;switch(e.display_type){case"p5":a.style.width="100%",a.style.height="100%",a.style.display="flex",a.style.justifyContent="center",a.style.alignItems="center",new MutationObserver((function(e){e.forEach((e=>e.addedNodes.forEach((e=>{const t=e;null!=t.tagName&&["canvas","video"].includes(t.tagName.toLowerCase())&&n(t)}))))})).observe(a,{childList:!0}),a.querySelectorAll("canvas,video").forEach(n),t.append(a);break;case"matplotlib":_=a.querySelector("canvas"),_&&(a=_),a.style.width="",a.style.height="",a.style.maxWidth="100%",a.style.maxHeight="100%",t.append(a);break;case"ocaml-canvas":a.style.width="",a.style.height="",a.style.maxWidth="100%",a.style.maxHeight="100%",t.append(a);break;case"turtle":a.setAttribute("width","100%"),a.setAttribute("height","100%"),t.append(a.outerHTML);break;case"sympy":t.append(e.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let e=document.createElement("script");e.type="text/javascript",e.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(e)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in e.content){let a=e.content[n];"image/png"===n&&(a=''),t.append(a);break}break;case"tutor":if(t.append(external_$_default()(e.content.replace("overflow-y%3A%20hidden%3B",""))),l=this.getContent()[0].getElementsByTagName("iframe")[0],null==l)return;l.style.maxHeight=l.style.minHeight="100%",new IntersectionObserver(((e,t)=>{const n=e[0];n&&!n.isIntersecting||(l.contentWindow?.postMessage({type:"redraw"},"*"),t.disconnect())})).observe(l);break;default:console.error(`Not supported node type '${e.display_type}' in eval.display result processing.`)}}}const statusbar_image=StatusBarImage;class PythonShell{static{this.pythonShell=null,this.init=async function(){statusbar_image.init();const e=external_path_.relative(external_Mixly_namespaceObject.Env.indexDirPath,external_Mixly_namespaceObject.Env.boardDirPath),t=new KernelLoader({rootPath:external_path_.join(e,"deps"),language:"python3"}),n=await t.kernelAvailable();n&&(await n.init(),await n.loaded(),this.loader=t,this.kernel=n,this.pythonShell=new PythonShell,this.pyodide=window.pyodide,this.interruptBuffer=new Uint8Array(new ArrayBuffer(1)),this.pyodide.setInterruptBuffer(this.interruptBuffer))},this.run=function(){const e=external_Mixly_namespaceObject.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(e)},this.stop=function(){return this.pythonShell.stop()}}#e=null;#t=null;#n=null;#a={row:0,column:0};#_="";#l=null;#s=null;#i=!1;#o=!1;#r=null;#p=()=>this.#c();#u=[{name:"REPL-Enter",bindKey:"Enter",exec:e=>{if(e.getSession().selection.getCursor().row===this.#a.row){const e=this.#e.getEndPos();let t=this.#e.getValueRange(this.#a,e);t=t.replace(this.#_,""),this.#l?.(t),this.#l=null,this.#s=null,this.#e.addValue("\n"),this.#m()}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:e=>{const t=e.getSession().selection.getCursor();return t.row{this.#o=!1,this.#e.addValue(`\n==${external_Mixly_namespaceObject.Msg.Lang["shell.finish"]}==`)})),this.#r.addEventListener("eval.output",(e=>{this.#e.addValue(e.content)})),this.#r.addEventListener("eval.error",(()=>{this.#o=!1,this.#e.addValue(`\n==${external_Mixly_namespaceObject.Msg.Lang["shell.finish"]}==`)})),this.#r.addEventListener("eval.input",(e=>{const t=String(e?.content?.prompt);this.#e.addValue(t),this.#_=t,this.#l=e.resolve,this.#s=e.reject,this.#O()})),this.#r.addEventListener("eval.display",(e=>{this.#n.changeTo("images"),this.#t.display(e)}))}#c(){const e=this.#e.getEditor(),t=e.getSession().selection.getCursor();e.setReadOnly(t.row{-1!==e.indexOf("import turtle")&&(e+="\nturtle.done()\n"),this.#n.changeTo("output"),this.#n.show(),this.#e.setValue(`${external_Mixly_namespaceObject.Msg.Lang["shell.running"]}...\n`),this.#o=!0,this.#r.dispatchEvent("eval.request",{code:e,interactive:!1})})).catch(external_Mixly_namespaceObject.Debug.error)}async stop(){if(this.#i&&this.#m(),this.#o){const e=5;PythonShell.interruptBuffer[0]=2;const t=Number(new Date);for(;Number(new Date)-t<1e3*e&&this.#o;)PythonShell.interruptBuffer[0]=2,await this.sleep(100);this.#o=!1}}sleep(e){return new Promise((t=>setTimeout(t,e)))}}const python_shell=PythonShell,NavExt={init:async function(){const e=external_Mixly_namespaceObject.app.getNav();e.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:external_Blockly_namespaceObject.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{python_shell.run()},scopeType:external_Mixly_namespaceObject.Nav.Scope.LEFT,weight:4}),e.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:external_Blockly_namespaceObject.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{python_shell.stop()},scopeType:external_Mixly_namespaceObject.Nav.Scope.LEFT,weight:5}),await python_shell.init()}},nav_ext=NavExt;nav_ext.init(),Object.assign(external_Blockly_namespaceObject.Variables,variables),Object.assign(external_Blockly_namespaceObject.Procedures,procedures),external_Blockly_namespaceObject.Python=Python,external_Blockly_namespaceObject.generator=Python,external_Mixly_namespaceObject.Profile.default={},Object.assign(external_Blockly_namespaceObject.Blocks,blocks_variables_namespaceObject,control_namespaceObject,math_namespaceObject,text_namespaceObject,lists_namespaceObject,dicts_namespaceObject,logic_namespaceObject,storage_namespaceObject,blocks_procedures_namespaceObject,tuple_namespaceObject,set_namespaceObject,html_namespaceObject,utility_namespaceObject,ai_namespaceObject,algorithm_namespaceObject,communicate_namespaceObject,cv_namespaceObject,data_namespaceObject,datastructure_namespaceObject,factory_namespaceObject,hardware_namespaceObject,inout_namespaceObject,iot_namespaceObject,pins_namespaceObject,serial_namespaceObject,sklearn_namespaceObject,system_namespaceObject,turtle_namespaceObject),Object.assign(external_Blockly_namespaceObject.Python.forBlock,generators_variables_namespaceObject,generators_control_namespaceObject,generators_math_namespaceObject,generators_text_namespaceObject,generators_lists_namespaceObject,generators_dicts_namespaceObject,generators_logic_namespaceObject,generators_storage_namespaceObject,generators_procedures_namespaceObject,generators_tuple_namespaceObject,generators_set_namespaceObject,generators_html_namespaceObject,generators_utility_namespaceObject,generators_ai_namespaceObject,generators_algorithm_namespaceObject,generators_communicate_namespaceObject,cv,generators_data_namespaceObject,generators_datastructure_namespaceObject,generators_factory_namespaceObject,generators_hardware_namespaceObject,generators_inout_namespaceObject,generators_iot_namespaceObject,generators_pins_namespaceObject,generators_serial_namespaceObject,generators_sklearn_namespaceObject,generators_system_namespaceObject,generators_turtle_namespaceObject)})(); \ No newline at end of file diff --git a/boards/default/python_pyodide/styles/317.d64c0353.css b/boards/default/python_pyodide/styles/317.2452fe28.css similarity index 100% rename from boards/default/python_pyodide/styles/317.d64c0353.css rename to boards/default/python_pyodide/styles/317.2452fe28.css diff --git a/boards/default/python_pyodide/styles/main.d64c0353.css b/boards/default/python_pyodide/styles/main.2452fe28.css similarity index 100% rename from boards/default/python_pyodide/styles/main.d64c0353.css rename to boards/default/python_pyodide/styles/main.2452fe28.css diff --git a/boards/default/python_skulpt/index.xml b/boards/default/python_skulpt/index.xml index 30f6051c..dd814d54 100644 --- a/boards/default/python_skulpt/index.xml +++ b/boards/default/python_skulpt/index.xml @@ -1 +1 @@ -promptHelloHelloHello,HelloMixly2100,1,2,3051iDIVIDE10Exception as ee90x151100a10.998124.821100101010001100501100110000x2x0,1,2,30,1,2,30,1,2,3xMixlyHelloMixly65axMixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixpyI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')dirmylist1,2,3,4,5mylist0mylist02mylist00mylist0101mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistx0,1,2,30,1,2,3mytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}s11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2xmixio.mixly.cnmixio.mixly.cnA1B2C3mixio.mixly.cnusernamepasswordMyProjecttopicmsgtopicmethodtopicmethodEQmsg1content"long""lat""message"012content"key1""key2""key3"012tina20tina90tina0tina2020tina50tinatinatinatina5tinatina5tina50tina50360tinatinatinaMixly!tinaMixly!Arial8tina#ff0000#FF0000tina#ff0000#FF0000tinatinascreenkeyfuncUpkeyfunctina100tina90screenclickfuncclickfunctinax20y20screentimerfunc3000timerfunctina100tina90screenx1.55.50.50,1,2,3x1,2,3,45,6,7,81,2,3,45,6,7,820,20,20,20tag1,2,3,45,6,7,8tag1,2,3,45,6,7,80.5tag11,21,31,41,51,61,71,81,910,20,40,60,80,100TitleaxisABABC \ No newline at end of file +promptHelloHelloHello,HelloMixly2100,1,2,3051iDIVIDE10Exception as ee90x151100a10.998124.821100101010001100501100110000x2x0,1,2,30,1,2,30,1,2,3xMixlyHelloMixly65axMixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixpyI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')dirmylist1,2,3,4,5mylist0mylist02mylist00mylist0101mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistx0,1,2,30,1,2,3mytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}s11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2xmixio.mixly.cnmixio.mixly.cnA1B2C3mixio.mixly.cnusernamepasswordMyProjecttopicmsgtopicmethodtopicmethodEQmsg1content"long""lat""message"012content"key1""key2""key3"012tina20tina90tina0tina2020tina50tinatinatinatina5tinatina5tina50tina50360tinatinatinaMixly!tinaMixly!Arial8tina#ff0000#FF0000tina#ff0000#FF0000tinatinascreenkeyfuncUpkeyfunctina100tina90screenclickfuncclickfunctinax20y20screentimerfunc3000timerfunctina100tina90screenx1.55.50.50,1,2,3x1,2,3,45,6,7,81,2,3,45,6,7,820,20,20,20tag1,2,3,45,6,7,8tag1,2,3,45,6,7,80.5tag11,21,31,41,51,61,71,81,910,20,40,60,80,100TitleaxisABABC \ No newline at end of file diff --git a/boards/default/python_skulpt/main.bundle.js b/boards/default/python_skulpt/main.bundle.js index c73b2831..6702cf5b 100644 --- a/boards/default/python_skulpt/main.bundle.js +++ b/boards/default/python_skulpt/main.bundle.js @@ -1,4 +1,4 @@ -(()=>{var t={23:()=>{Sk.builtinFiles={files:{"src/builtin/this.py":'s = """Gur Mra bs Clguba, ol Gvz Crgref\n\nOrnhgvshy vf orggre guna htyl.\nRkcyvpvg vf orggre guna vzcyvpvg.\nFvzcyr vf orggre guna pbzcyrk.\nPbzcyrk vf orggre guna pbzcyvpngrq.\nSyng vf orggre guna arfgrq.\nFcnefr vf orggre guna qrafr.\nErnqnovyvgl pbhagf.\nFcrpvny pnfrf nera\'g fcrpvny rabhtu gb oernx gur ehyrf.\nNygubhtu cenpgvpnyvgl orngf chevgl.\nReebef fubhyq arire cnff fvyragyl.\nHayrff rkcyvpvgyl fvyraprq.\nVa gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.\nGurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg.\nNygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh\'er Qhgpu.\nAbj vf orggre guna arire.\nNygubhtu arire vf bsgra orggre guna *evtug* abj.\nVs gur vzcyrzragngvba vf uneq gb rkcynva, vg\'f n onq vqrn.\nVs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.\nAnzrfcnprf ner bar ubaxvat terng vqrn -- yrg\'f qb zber bs gubfr!"""\n\nd = {}\nfor c in (65, 97):\n for i in range(26):\n d[chr(i+c)] = chr((i+13) % 26 + c)\n\nprint("".join([d.get(c, c) for c in s]))\n',"src/lib/abc.py":'import _sk_fail; _sk_fail._("abc")\n',"src/lib/aifc.py":'import _sk_fail; _sk_fail._("aifc")\n',"src/lib/antigravity.py":'import webbrowser\n\nwebbrowser.open("https://xkcd.com/353/")\n',"src/lib/anydbm.py":'import _sk_fail; _sk_fail._("anydbm")\n',"src/lib/ast.py":'import _sk_fail; _sk_fail._("ast")\n',"src/lib/asynchat.py":'import _sk_fail; _sk_fail._("asynchat")\n',"src/lib/asyncore.py":'import _sk_fail; _sk_fail._("asyncore")\n',"src/lib/atexit.py":'import _sk_fail; _sk_fail._("atexit")\n',"src/lib/audiodev.py":'import _sk_fail; _sk_fail._("audiodev")\n',"src/lib/base64.py":'import _sk_fail; _sk_fail._("base64")\n',"src/lib/BaseHTTPServer.py":'import _sk_fail; _sk_fail._("BaseHTTPServer")\n',"src/lib/Bastion.py":'import _sk_fail; _sk_fail._("Bastion")\n',"src/lib/bdb.py":'import _sk_fail; _sk_fail._("bdb")\n',"src/lib/binhex.py":'import _sk_fail; _sk_fail._("binhex")\n',"src/lib/bisect.py":'"""Bisection algorithms."""\n\ndef insort_right(a, x, lo=0, hi=None):\n """Insert item x in list a, and keep it sorted assuming a is sorted.\n\n If x is already in a, insert it to the right of the rightmost x.\n\n Optional args lo (default 0) and hi (default len(a)) bound the\n slice of a to be searched.\n """\n\n if lo < 0:\n raise ValueError(\'lo must be non-negative\')\n if hi is None:\n hi = len(a)\n while lo < hi:\n mid = (lo+hi)//2\n if x < a[mid]: hi = mid\n else: lo = mid+1\n a.insert(lo, x)\n\ndef bisect_right(a, x, lo=0, hi=None):\n """Return the index where to insert item x in list a, assuming a is sorted.\n\n The return value i is such that all e in a[:i] have e <= x, and all e in\n a[i:] have e > x. So if x already appears in the list, a.insert(x) will\n insert just after the rightmost x already there.\n\n Optional args lo (default 0) and hi (default len(a)) bound the\n slice of a to be searched.\n """\n\n if lo < 0:\n raise ValueError(\'lo must be non-negative\')\n if hi is None:\n hi = len(a)\n while lo < hi:\n mid = (lo+hi)//2\n if x < a[mid]: hi = mid\n else: lo = mid+1\n return lo\n\ndef insort_left(a, x, lo=0, hi=None):\n """Insert item x in list a, and keep it sorted assuming a is sorted.\n\n If x is already in a, insert it to the left of the leftmost x.\n\n Optional args lo (default 0) and hi (default len(a)) bound the\n slice of a to be searched.\n """\n\n if lo < 0:\n raise ValueError(\'lo must be non-negative\')\n if hi is None:\n hi = len(a)\n while lo < hi:\n mid = (lo+hi)//2\n if a[mid] < x: lo = mid+1\n else: hi = mid\n a.insert(lo, x)\n\n\ndef bisect_left(a, x, lo=0, hi=None):\n """Return the index where to insert item x in list a, assuming a is sorted.\n\n The return value i is such that all e in a[:i] have e < x, and all e in\n a[i:] have e >= x. So if x already appears in the list, a.insert(x) will\n insert just before the leftmost x already there.\n\n Optional args lo (default 0) and hi (default len(a)) bound the\n slice of a to be searched.\n """\n\n if lo < 0:\n raise ValueError(\'lo must be non-negative\')\n if hi is None:\n hi = len(a)\n while lo < hi:\n mid = (lo+hi)//2\n if a[mid] < x: lo = mid+1\n else: hi = mid\n return lo\n\n# Overwrite above definitions with a fast C implementation\ntry:\n from _bisect import *\nexcept ImportError:\n pass\n\n# Create aliases\nbisect = bisect_right\ninsort = insort_right\n',"src/lib/bsddb/__init__.py":'import _sk_fail; _sk_fail._("bsddb")\n',"src/lib/cgi.py":'import _sk_fail; _sk_fail._("cgi")\n',"src/lib/CGIHTTPServer.py":'import _sk_fail; _sk_fail._("CGIHTTPServer")\n',"src/lib/cgitb.py":'import _sk_fail; _sk_fail._("cgitb")\n',"src/lib/chunk.py":'import _sk_fail; _sk_fail._("chunk")\n',"src/lib/cmd.py":'import _sk_fail; _sk_fail._("cmd")\n',"src/lib/code.py":'import _sk_fail; _sk_fail._("code")\n',"src/lib/codecs.py":'import _sk_fail; _sk_fail._("codecs")\n',"src/lib/codeop.py":'import _sk_fail; _sk_fail._("codeop")\n',"src/lib/colorsys.py":'import _sk_fail; _sk_fail._("colorsys")\n',"src/lib/commands.py":'import _sk_fail; _sk_fail._("commands")\n',"src/lib/compileall.py":'import _sk_fail; _sk_fail._("compileall")\n',"src/lib/compiler/__init__.py":'import _sk_fail; _sk_fail._("compiler")\n',"src/lib/config/__init__.py":'import _sk_fail; _sk_fail._("config")\n',"src/lib/ConfigParser.py":'import _sk_fail; _sk_fail._("ConfigParser")\n',"src/lib/contextlib.py":'import _sk_fail; _sk_fail._("contextlib")\n',"src/lib/Cookie.py":'import _sk_fail; _sk_fail._("Cookie")\n',"src/lib/cookielib.py":'import _sk_fail; _sk_fail._("cookielib")\n',"src/lib/copy.py":'"""\nThis file was modified from CPython.\nCopyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,\n2011, 2012, 2013, 2014, 2015 Python Software Foundation; All Rights Reserved\n"""\nimport types\nclass Error(Exception):\n pass\nerror = Error \nclass _EmptyClass:\n pass\ntry:\n long\nexcept NameError:\n long = int\ntry:\n bytes\nexcept NameError:\n bytes = str\n\ndef check_notimplemented_state(x):\n getstate = getattr(x, "__getstate__", None)\n setstate = getattr(x, "__setstate__", None)\n initargs = getattr(x, "__getinitargs__", None)\n if getstate or setstate or initargs:\n raise NotImplementedError("Skulpt does not yet support copying with user-defined __getstate__, __setstate__ or __getinitargs__()")\n\n\ndef copy(x):\n cls = type(x)\n if callable(x):\n return x\n copier = getattr(cls, "__copy__", None)\n if copier:\n return copier(x)\n if cls in (type(None), int, float, bool, str, bytes, tuple, type, frozenset, long):\n return x\n if (cls == list) or (cls == dict) or (cls == set) or (cls == slice):\n return cls(x)\n reductor = getattr(x, "__reduce_ex__", None)\n if reductor:\n rv = reductor(4)\n else:\n reductor = getattr(x, "__reduce__", None)\n if reductor:\n rv = reductor()\n elif str(cls)[1:6] == "class":\n check_notimplemented_state(x)\n copier = _copy_inst\n return copier(x)\n else:\n raise Error("un(shallow)copyable object of type %s" % cls)\n if isinstance(rv, str):\n return x\n return _reconstruct(x, rv, 0)\n\ndef _copy_inst(x):\n if hasattr(x, \'__copy__\'):\n return x.__copy__()\n if hasattr(x, \'__getinitargs__\'):\n args = x.__getinitargs__()\n y = x.__class__(*args)\n else:\n y = _EmptyClass()\n y.__class__ = x.__class__\n if hasattr(x, \'__getstate__\'):\n state = x.__getstate__()\n else:\n state = x.__dict__\n if hasattr(y, \'__setstate__\'):\n y.__setstate__(state)\n else:\n y.__dict__.update(state)\n return y\n\nd = _deepcopy_dispatch = {}\n\ndef deepcopy(x, memo=None, _nil=[]):\n """Deep copy operation on arbitrary Python objects.\n See the module\'s __doc__ string for more info.\n """\n if memo is None:\n memo = {}\n idx = id(x)\n y = memo.get(idx, _nil)\n if y is not _nil:\n return y\n cls = type(x)\n copier = _deepcopy_dispatch.get(cls)\n if copier:\n y = copier(x, memo)\n else:\n try:\n issc = issubclass(cls, type)\n except TypeError: # cls is not a class (old Boost; see SF #502085)\n issc = 0\n if issc:\n y = _deepcopy_atomic(x, memo)\n else:\n copier = getattr(x, "__deepcopy__", None)\n if copier:\n y = copier(memo)\n else:\n reductor = getattr(x, "__reduce_ex__", None)\n if reductor:\n rv = reductor(2)\n else:\n rv = None\n reductor = getattr(x, "__reduce__", None)\n if reductor:\n rv = reductor()\n elif str(cls)[1:6] == "class":\n check_notimplemented_state(x)\n copier = _deepcopy_dispatch["InstanceType"]\n y = copier(x, memo)\n else:\n raise Error(\n "un(deep)copyable object of type %s" % cls)\n if rv is not None:\n y = _reconstruct(x, rv, 1, memo)\n memo[idx] = y\n _keep_alive(x, memo) # Make sure x lives at least as long as d\n return y\n\ndef _deepcopy_atomic(x, memo):\n return x\nd[type(None)] = _deepcopy_atomic\n# d[type(Ellipsis)] = _deepcopy_atomic\nd[type(NotImplemented)] = _deepcopy_atomic\nd[int] = _deepcopy_atomic\nd[float] = _deepcopy_atomic\nd[bool] = _deepcopy_atomic\nd[complex] = _deepcopy_atomic\nd[bytes] = _deepcopy_atomic\nd[str] = _deepcopy_atomic\n# try:\n# d[types.CodeType] = _deepcopy_atomic\n# except AttributeError:\n# pass\nd[type] = _deepcopy_atomic\n# d[types.BuiltinFunctionType] = _deepcopy_atomic\nd[types.FunctionType] = _deepcopy_atomic\n# d[weakref.ref] = _deepcopy_atomic\n\ndef _deepcopy_list(x, memo):\n y = []\n memo[id(x)] = y\n for a in x:\n y.append(deepcopy(a, memo))\n return y\nd[list] = _deepcopy_list\n\ndef _deepcopy_set(x, memo):\n result = set([]) # make empty set\n memo[id(x)] = result # register this set in the memo for loop checking\n for a in x: # go through elements of set\n result.add(deepcopy(a, memo)) # add the copied elements into the new set\n return result # return the new set\nd[set] = _deepcopy_set\n\ndef _deepcopy_frozenset(x, memo):\n result = frozenset(_deepcopy_set(x,memo)) \n memo[id(x)] = result \n return result\nd[frozenset] = _deepcopy_frozenset\n\ndef _deepcopy_tuple(x, memo):\n y = [deepcopy(a, memo) for a in x]\n # We\'re not going to put the tuple in the memo, but it\'s still important we\n # check for it, in case the tuple contains recursive mutable structures.\n try:\n return memo[id(x)]\n except KeyError:\n pass\n for k, j in zip(x, y):\n if k is not j:\n y = tuple(y)\n break\n else:\n y = x\n return y\nd[tuple] = _deepcopy_tuple\n\ndef _deepcopy_dict(x, memo):\n y = {}\n memo[id(x)] = y\n for key, value in x.items():\n y[deepcopy(key, memo)] = deepcopy(value, memo)\n return y\nd[dict] = _deepcopy_dict\n\n# def _deepcopy_method(x, memo): # Copy instance methods\n# y = type(x)(x.im_func, deepcopy(x.im_self, memo), x.im_class);\n# return y\nd[types.MethodType] = _deepcopy_atomic\n\ndef _deepcopy_inst(x, memo):\n if hasattr(x, \'__deepcopy__\'):\n return x.__deepcopy__(memo)\n if hasattr(x, \'__getinitargs__\'):\n args = x.__getinitargs__()\n args = deepcopy(args, memo)\n y = x.__class__(*args)\n else:\n y = _EmptyClass()\n y.__class__ = x.__class__\n memo[id(x)] = y\n if hasattr(x, \'__getstate__\'):\n state = x.__getstate__()\n else:\n state = x.__dict__\n state = deepcopy(state, memo)\n if hasattr(y, \'__setstate__\'):\n y.__setstate__(state)\n else:\n y.__dict__.update(state)\n return y\nd["InstanceType"] = _deepcopy_inst\n\ndef _keep_alive(x, memo):\n """Keeps a reference to the object x in the memo.\n Because we remember objects by their id, we have\n to assure that possibly temporary objects are kept\n alive by referencing them.\n We store a reference at the id of the memo, which should\n normally not be used unless someone tries to deepcopy\n the memo itself...\n """\n try:\n memo[id(memo)].append(x)\n except KeyError:\n # aha, this is the first one :-)\n memo[id(memo)]=[x]\n\ndef _reconstruct(x, info, deep, memo=None):\n if isinstance(info, str):\n return x\n assert isinstance(info, tuple)\n if memo is None:\n memo = {}\n n = len(info)\n assert n in (2, 3, 4, 5)\n callable, args = info[:2]\n if n > 2:\n state = info[2]\n else:\n state = None\n if n > 3:\n listiter = info[3]\n else:\n listiter = None\n if n > 4:\n dictiter = info[4]\n else:\n dictiter = None\n if deep:\n args = deepcopy(args, memo)\n y = callable(*args)\n memo[id(x)] = y\n\n if state is not None:\n if deep:\n state = deepcopy(state, memo)\n if hasattr(y, \'__setstate__\'):\n y.__setstate__(state)\n else:\n if isinstance(state, tuple) and len(state) == 2:\n state, slotstate = state\n else:\n slotstate = None\n if state is not None:\n y.__dict__.update(state)\n if slotstate is not None:\n for key, value in slotstate.items():\n setattr(y, key, value)\n\n if listiter is not None:\n for item in listiter:\n if deep:\n item = deepcopy(item, memo)\n y.append(item)\n if dictiter is not None:\n for key, value in dictiter:\n if deep:\n key = deepcopy(key, memo)\n value = deepcopy(value, memo)\n y[key] = value\n return y\n\ndel d\n\ndel types\n\n# Helper for instance creation without calling __init__\nclass _EmptyClass:\n pass',"src/lib/copy_reg.py":'import _sk_fail; _sk_fail._("copy_reg")\n',"src/lib/cProfile.py":'import _sk_fail; _sk_fail._("cProfile")\n',"src/lib/csv.py":'import _sk_fail; _sk_fail._("csv")\n',"src/lib/ctypes/macholib/__init__.py":'import _sk_fail; _sk_fail._("macholib")\n',"src/lib/ctypes/__init__.py":'import _sk_fail; _sk_fail._("ctypes")\n',"src/lib/curses/__init__.py":'import _sk_fail; _sk_fail._("curses")\n',"src/lib/dbhash.py":'import _sk_fail; _sk_fail._("dbhash")\n',"src/lib/decimal.py":'import _sk_fail; _sk_fail._("decimal")\n',"src/lib/difflib.py":'import _sk_fail; _sk_fail._("difflib")\n',"src/lib/dircache.py":'import _sk_fail; _sk_fail._("dircache")\n',"src/lib/dis.py":'import _sk_fail; _sk_fail._("dis")\n',"src/lib/distutils/command/__init__.py":'import _sk_fail; _sk_fail._("command")\n',"src/lib/distutils/tests/__init__.py":'import _sk_fail; _sk_fail._("tests")\n',"src/lib/distutils/__init__.py":'import _sk_fail; _sk_fail._("distutils")\n',"src/lib/doctest.py":'import _sk_fail; _sk_fail._("doctest")\n',"src/lib/DocXMLRPCServer.py":'import _sk_fail; _sk_fail._("DocXMLRPCServer")\n',"src/lib/dumbdbm.py":'import _sk_fail; _sk_fail._("dumbdbm")\n',"src/lib/dummy_thread.py":'import _sk_fail; _sk_fail._("dummy_thread")\n',"src/lib/dummy_threading.py":'import _sk_fail; _sk_fail._("dummy_threading")\n',"src/lib/email/mime/__init__.py":'import _sk_fail; _sk_fail._("mime")\n',"src/lib/email/test/data/__init__.py":'import _sk_fail; _sk_fail._("data")\n',"src/lib/email/__init__.py":'import _sk_fail; _sk_fail._("email")\n',"src/lib/encodings/__init__.py":'import _sk_fail; _sk_fail._("encodings")\n',"src/lib/filecmp.py":'import _sk_fail; _sk_fail._("filecmp")\n',"src/lib/fileinput.py":'import _sk_fail; _sk_fail._("fileinput")\n',"src/lib/fnmatch.py":'import _sk_fail; _sk_fail._("fnmatch")\n',"src/lib/formatter.py":'import _sk_fail; _sk_fail._("formatter")\n',"src/lib/fpformat.py":'import _sk_fail; _sk_fail._("fpformat")\n',"src/lib/fractions.py":'import _sk_fail; _sk_fail._("fractions")\n',"src/lib/ftplib.py":'import _sk_fail; _sk_fail._("ftplib")\n',"src/lib/genericpath.py":'import _sk_fail; _sk_fail._("genericpath")\n',"src/lib/getopt.py":'import _sk_fail; _sk_fail._("getopt")\n',"src/lib/getpass.py":'import _sk_fail; _sk_fail._("getpass")\n',"src/lib/gettext.py":'import _sk_fail; _sk_fail._("gettext")\n',"src/lib/glob.py":'import _sk_fail; _sk_fail._("glob")\n',"src/lib/gzip.py":'import _sk_fail; _sk_fail._("gzip")\n',"src/lib/hashlib.py":'import _sk_fail; _sk_fail._("hashlib")\n',"src/lib/heapq.py":'import _sk_fail; _sk_fail._("heapq")\n',"src/lib/hmac.py":'import _sk_fail; _sk_fail._("hmac")\n',"src/lib/hotshot/__init__.py":'import _sk_fail; _sk_fail._("hotshot")\n',"src/lib/htmlentitydefs.py":'import _sk_fail; _sk_fail._("htmlentitydefs")\n',"src/lib/htmllib.py":'import _sk_fail; _sk_fail._("htmllib")\n',"src/lib/HTMLParser.py":'import _sk_fail; _sk_fail._("HTMLParser")\n',"src/lib/httplib.py":'import _sk_fail; _sk_fail._("httplib")\n',"src/lib/idlelib/Icons/__init__.py":'import _sk_fail; _sk_fail._("Icons")\n',"src/lib/idlelib/__init__.py":'import _sk_fail; _sk_fail._("idlelib")\n',"src/lib/ihooks.py":'import _sk_fail; _sk_fail._("ihooks")\n',"src/lib/imaplib.py":'import _sk_fail; _sk_fail._("imaplib")\n',"src/lib/imghdr.py":'import _sk_fail; _sk_fail._("imghdr")\n',"src/lib/imputil.py":'import _sk_fail; _sk_fail._("imputil")\n',"src/lib/io.py":'import _sk_fail; _sk_fail._("io")\n',"src/lib/lib-dynload/__init__.py":'import _sk_fail; _sk_fail._("lib-dynload")\n',"src/lib/lib-tk/__init__.py":'import _sk_fail; _sk_fail._("lib-tk")\n',"src/lib/lib2to3/fixes/__init__.py":'import _sk_fail; _sk_fail._("fixes")\n',"src/lib/lib2to3/pgen2/__init__.py":'import _sk_fail; _sk_fail._("pgen2")\n',"src/lib/lib2to3/tests/__init__.py":'import _sk_fail; _sk_fail._("tests")\n',"src/lib/lib2to3/__init__.py":'import _sk_fail; _sk_fail._("lib2to3")\n',"src/lib/linecache.py":'import _sk_fail; _sk_fail._("linecache")\n',"src/lib/locale.py":'import _sk_fail; _sk_fail._("locale")\n',"src/lib/logging/__init__.py":'import _sk_fail; _sk_fail._("logging")\n',"src/lib/macpath.py":'import _sk_fail; _sk_fail._("macpath")\n',"src/lib/macurl2path.py":'import _sk_fail; _sk_fail._("macurl2path")\n',"src/lib/mailbox.py":'import _sk_fail; _sk_fail._("mailbox")\n',"src/lib/mailcap.py":'import _sk_fail; _sk_fail._("mailcap")\n',"src/lib/markupbase.py":'import _sk_fail; _sk_fail._("markupbase")\n',"src/lib/md5.py":'import _sk_fail; _sk_fail._("md5")\n',"src/lib/mhlib.py":'import _sk_fail; _sk_fail._("mhlib")\n',"src/lib/mimetools.py":'import _sk_fail; _sk_fail._("mimetools")\n',"src/lib/mimetypes.py":'import _sk_fail; _sk_fail._("mimetypes")\n',"src/lib/MimeWriter.py":'import _sk_fail; _sk_fail._("MimeWriter")\n',"src/lib/mimify.py":'import _sk_fail; _sk_fail._("mimify")\n',"src/lib/modulefinder.py":'import _sk_fail; _sk_fail._("modulefinder")\n',"src/lib/multifile.py":'import _sk_fail; _sk_fail._("multifile")\n',"src/lib/multiprocessing/dummy/__init__.py":'import _sk_fail; _sk_fail._("dummy")\n',"src/lib/multiprocessing/__init__.py":'import _sk_fail; _sk_fail._("multiprocessing")\n',"src/lib/mutex.py":'import _sk_fail; _sk_fail._("mutex")\n',"src/lib/netrc.py":'import _sk_fail; _sk_fail._("netrc")\n',"src/lib/new.py":'import _sk_fail; _sk_fail._("new")\n',"src/lib/nntplib.py":'import _sk_fail; _sk_fail._("nntplib")\n',"src/lib/ntpath.py":'import _sk_fail; _sk_fail._("ntpath")\n',"src/lib/nturl2path.py":'import _sk_fail; _sk_fail._("nturl2path")\n',"src/lib/numbers.py":"Number = (int, float, complex)\nIntegral = int\nComplex = complex\n","src/lib/opcode.py":'import _sk_fail; _sk_fail._("opcode")\n',"src/lib/optparse.py":'import _sk_fail; _sk_fail._("optparse")\n',"src/lib/os.py":'import _sk_fail; _sk_fail._("os")\n',"src/lib/os2emxpath.py":'import _sk_fail; _sk_fail._("os2emxpath")\n',"src/lib/pdb.py":'import _sk_fail; _sk_fail._("pdb")\n',"src/lib/pickle.py":'import _sk_fail; _sk_fail._("pickle")\n',"src/lib/pickletools.py":'import _sk_fail; _sk_fail._("pickletools")\n',"src/lib/pipes.py":'import _sk_fail; _sk_fail._("pipes")\n',"src/lib/pkgutil.py":'import _sk_fail; _sk_fail._("pkgutil")\n',"src/lib/platform.py":'import _sk_fail; _sk_fail._("platform")\n',"src/lib/plistlib.py":'import _sk_fail; _sk_fail._("plistlib")\n',"src/lib/popen2.py":'import _sk_fail; _sk_fail._("popen2")\n',"src/lib/poplib.py":'import _sk_fail; _sk_fail._("poplib")\n',"src/lib/posixfile.py":'import _sk_fail; _sk_fail._("posixfile")\n',"src/lib/posixpath.py":'import _sk_fail; _sk_fail._("posixpath")\n',"src/lib/pprint.py":'import _sk_fail; _sk_fail._("pprint")\n',"src/lib/profile.py":'import _sk_fail; _sk_fail._("profile")\n',"src/lib/pstats.py":'import _sk_fail; _sk_fail._("pstats")\n',"src/lib/pty.py":'import _sk_fail; _sk_fail._("pty")\n',"src/lib/pyclbr.py":'import _sk_fail; _sk_fail._("pyclbr")\n',"src/lib/pydoc.py":'import _sk_fail; _sk_fail._("pydoc")\n',"src/lib/pydoc_topics.py":'import _sk_fail; _sk_fail._("pydoc_topics")\n',"src/lib/pythonds/basic/deque.py":"# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005\n# \n#deque.py\n\n\nclass Deque:\n def __init__(self):\n self.items = []\n\n def isEmpty(self):\n return self.items == []\n\n def addFront(self, item):\n self.items.append(item)\n\n def addRear(self, item):\n self.items.insert(0,item)\n\n def removeFront(self):\n return self.items.pop()\n\n def removeRear(self):\n return self.items.pop(0)\n\n def size(self):\n return len(self.items)\n","src/lib/pythonds/basic/queue.py":"# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005\n# \n#queue.py\n\nclass Queue:\n def __init__(self):\n self.items = []\n\n def isEmpty(self):\n return self.items == []\n\n def enqueue(self, item):\n self.items.insert(0,item)\n\n def dequeue(self):\n return self.items.pop()\n\n def size(self):\n return len(self.items)\n","src/lib/pythonds/basic/stack.py":"# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005\n# \n#stack.py\n\nclass Stack:\n def __init__(self):\n self.items = []\n\n def isEmpty(self):\n return self.items == []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n return self.items.pop()\n\n def peek(self):\n return self.items[len(self.items)-1]\n\n def size(self):\n return len(self.items)\n\n","src/lib/pythonds/basic/__init__.py":'\n#__all__ = ["stack"]\n\n\n#from .stack import Stack\n#from .queue import Queue\n\n\n\n',"src/lib/pythonds/graphs/adjGraph.py":'#\n# adjGraph\n#\n# Created by Brad Miller on 2005-02-24.\n# Copyright (c) 2005 Brad Miller, David Ranum, Luther College. All rights reserved.\n#\n\nimport sys\nimport os\nimport unittest\n\nclass Graph:\n def __init__(self):\n self.vertices = {}\n self.numVertices = 0\n \n def addVertex(self,key):\n self.numVertices = self.numVertices + 1\n newVertex = Vertex(key)\n self.vertices[key] = newVertex\n return newVertex\n \n def getVertex(self,n):\n if n in self.vertices:\n return self.vertices[n]\n else:\n return None\n\n def __contains__(self,n):\n return n in self.vertices\n \n def addEdge(self,f,t,cost=0):\n if f not in self.vertices:\n nv = self.addVertex(f)\n if t not in self.vertices:\n nv = self.addVertex(t)\n self.vertices[f].addNeighbor(self.vertices[t],cost)\n \n def getVertices(self):\n return list(self.vertices.keys())\n \n def __iter__(self):\n return iter(self.vertices.values())\n \nclass Vertex:\n def __init__(self,num):\n self.id = num\n self.connectedTo = {}\n self.color = \'white\'\n self.dist = sys.maxsize\n self.pred = None\n self.disc = 0\n self.fin = 0\n\n # def __lt__(self,o):\n # return self.id < o.id\n \n def addNeighbor(self,nbr,weight=0):\n self.connectedTo[nbr] = weight\n \n def setColor(self,color):\n self.color = color\n \n def setDistance(self,d):\n self.dist = d\n\n def setPred(self,p):\n self.pred = p\n\n def setDiscovery(self,dtime):\n self.disc = dtime\n \n def setFinish(self,ftime):\n self.fin = ftime\n \n def getFinish(self):\n return self.fin\n \n def getDiscovery(self):\n return self.disc\n \n def getPred(self):\n return self.pred\n \n def getDistance(self):\n return self.dist\n \n def getColor(self):\n return self.color\n \n def getConnections(self):\n return self.connectedTo.keys()\n \n def getWeight(self,nbr):\n return self.connectedTo[nbr]\n \n def __str__(self):\n return str(self.id) + ":color " + self.color + ":disc " + str(self.disc) + ":fin " + str(self.fin) + ":dist " + str(self.dist) + ":pred \\n\\t[" + str(self.pred)+ "]\\n"\n \n def getId(self):\n return self.id\n\nclass adjGraphTests(unittest.TestCase):\n def setUp(self):\n self.tGraph = Graph()\n \n def testMakeGraph(self):\n gFile = open("test.dat")\n for line in gFile:\n fVertex, tVertex = line.split(\'|\')\n fVertex = int(fVertex)\n tVertex = int(tVertex)\n self.tGraph.addEdge(fVertex,tVertex)\n for i in self.tGraph:\n adj = i.getAdj()\n for k in adj:\n print(i, k)\n\n \nif __name__ == \'__main__\':\n unittest.main()\n \n',"src/lib/pythonds/graphs/priorityQueue.py":"# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005\n# \nimport unittest\n\n# this implementation of binary heap takes key value pairs,\n# we will assume that the keys are all comparable\n\nclass PriorityQueue:\n def __init__(self):\n self.heapArray = [(0,0)]\n self.currentSize = 0\n\n def buildHeap(self,alist):\n self.currentSize = len(alist)\n self.heapArray = [(0,0)]\n for i in alist:\n self.heapArray.append(i)\n i = len(alist) // 2 \n while (i > 0):\n self.percDown(i)\n i = i - 1\n \n def percDown(self,i):\n while (i * 2) <= self.currentSize:\n mc = self.minChild(i)\n if self.heapArray[i][0] > self.heapArray[mc][0]:\n tmp = self.heapArray[i]\n self.heapArray[i] = self.heapArray[mc]\n self.heapArray[mc] = tmp\n i = mc\n \n def minChild(self,i):\n if i*2 > self.currentSize:\n return -1\n else:\n if i*2 + 1 > self.currentSize:\n return i*2\n else:\n if self.heapArray[i*2][0] < self.heapArray[i*2+1][0]:\n return i*2\n else:\n return i*2+1\n\n def percUp(self,i):\n while i // 2 > 0:\n if self.heapArray[i][0] < self.heapArray[i//2][0]:\n tmp = self.heapArray[i//2]\n self.heapArray[i//2] = self.heapArray[i]\n self.heapArray[i] = tmp\n i = i//2\n \n def add(self,k):\n self.heapArray.append(k)\n self.currentSize = self.currentSize + 1\n self.percUp(self.currentSize)\n\n def delMin(self):\n retval = self.heapArray[1][1]\n self.heapArray[1] = self.heapArray[self.currentSize]\n self.currentSize = self.currentSize - 1\n self.heapArray.pop()\n self.percDown(1)\n return retval\n \n def isEmpty(self):\n if self.currentSize == 0:\n return True\n else:\n return False\n\n def decreaseKey(self,val,amt):\n # this is a little wierd, but we need to find the heap thing to decrease by\n # looking at its value\n done = False\n i = 1\n myKey = 0\n while not done and i <= self.currentSize:\n if self.heapArray[i][1] == val:\n done = True\n myKey = i\n else:\n i = i + 1\n if myKey > 0:\n self.heapArray[myKey] = (amt,self.heapArray[myKey][1])\n self.percUp(myKey)\n \n def __contains__(self,vtx):\n for pair in self.heapArray:\n if pair[1] == vtx:\n return True\n return False\n \nclass TestBinHeap(unittest.TestCase):\n def setUp(self):\n self.theHeap = PriorityQueue()\n self.theHeap.add((2,'x'))\n self.theHeap.add((3,'y'))\n self.theHeap.add((5,'z'))\n self.theHeap.add((6,'a'))\n self.theHeap.add((4,'d'))\n\n\n def testInsert(self):\n assert self.theHeap.currentSize == 5\n\n def testDelmin(self):\n assert self.theHeap.delMin() == 'x'\n assert self.theHeap.delMin() == 'y'\n \n def testDecKey(self):\n self.theHeap.decreaseKey('d',1)\n assert self.theHeap.delMin() == 'd'\n \nif __name__ == '__main__':\n unittest.main()\n","src/lib/pythonds/graphs/__init__.py":"\n\nfrom .adjGraph import Graph\nfrom .adjGraph import Vertex\nfrom .priorityQueue import PriorityQueue\n","src/lib/pythonds/trees/balance.py":"#!/bin/env python3.1\n# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005, 2010\n# \n\nfrom .bst import BinarySearchTree, TreeNode\n\nclass AVLTree(BinarySearchTree):\n '''\n Author: Brad Miller\n Date: 1/15/2005\n Description: Imlement a binary search tree with the following interface\n functions: \n __contains__(y) <==> y in x\n __getitem__(y) <==> x[y]\n __init__()\n __len__() <==> len(x)\n __setitem__(k,v) <==> x[k] = v\n clear()\n get(k)\n has_key(k)\n items() \n keys() \n values()\n put(k,v)\n '''\n\n\n def _put(self,key,val,currentNode):\n if key < currentNode.key:\n if currentNode.hasLeftChild():\n self._put(key,val,currentNode.leftChild)\n else:\n currentNode.leftChild = TreeNode(key,val,parent=currentNode)\n self.updateBalance(currentNode.leftChild)\n else:\n if currentNode.hasRightChild():\n self._put(key,val,currentNode.rightChild)\n else:\n currentNode.rightChild = TreeNode(key,val,parent=currentNode)\n self.updateBalance(currentNode.rightChild) \n\n def updateBalance(self,node):\n if node.balanceFactor > 1 or node.balanceFactor < -1:\n self.rebalance(node)\n return\n if node.parent != None:\n if node.isLeftChild():\n node.parent.balanceFactor += 1\n elif node.isRightChild():\n node.parent.balanceFactor -= 1\n\n if node.parent.balanceFactor != 0:\n self.updateBalance(node.parent)\n\n def rebalance(self,node):\n if node.balanceFactor < 0:\n if node.rightChild.balanceFactor > 0:\n # Do an LR Rotation\n self.rotateRight(node.rightChild)\n self.rotateLeft(node)\n else:\n # single left\n self.rotateLeft(node)\n elif node.balanceFactor > 0:\n if node.leftChild.balanceFactor < 0:\n # Do an RL Rotation\n self.rotateLeft(node.leftChild)\n self.rotateRight(node)\n else:\n # single right\n self.rotateRight(node)\n\n def rotateLeft(self,rotRoot):\n newRoot = rotRoot.rightChild\n rotRoot.rightChild = newRoot.leftChild\n if newRoot.leftChild != None:\n newRoot.leftChild.parent = rotRoot\n newRoot.parent = rotRoot.parent\n if rotRoot.isRoot():\n self.root = newRoot\n else:\n if rotRoot.isLeftChild():\n rotRoot.parent.leftChild = newRoot\n else:\n rotRoot.parent.rightChild = newRoot\n newRoot.leftChild = rotRoot\n rotRoot.parent = newRoot\n rotRoot.balanceFactor = rotRoot.balanceFactor + 1 - min(newRoot.balanceFactor, 0)\n newRoot.balanceFactor = newRoot.balanceFactor + 1 + max(rotRoot.balanceFactor, 0)\n\n\n def rotateRight(self,rotRoot):\n newRoot = rotRoot.leftChild\n rotRoot.leftChild = newRoot.rightChild\n if newRoot.rightChild != None:\n newRoot.rightChild.parent = rotRoot\n newRoot.parent = rotRoot.parent\n if rotRoot.isRoot():\n self.root = newRoot\n else:\n if rotRoot.isRightChild():\n rotRoot.parent.rightChild = newRoot\n else:\n rotRoot.parent.leftChild = newRoot\n newRoot.rightChild = rotRoot\n rotRoot.parent = newRoot\n rotRoot.balanceFactor = rotRoot.balanceFactor - 1 - max(newRoot.balanceFactor, 0)\n newRoot.balanceFactor = newRoot.balanceFactor - 1 + min(rotRoot.balanceFactor, 0)\n \n","src/lib/pythonds/trees/binaryTree.py":"# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005\n# \n\nclass BinaryTree:\n \"\"\"\n A recursive implementation of Binary Tree\n Using links and Nodes approach.\n \"\"\" \n def __init__(self,rootObj):\n self.key = rootObj\n self.leftChild = None\n self.rightChild = None\n\n def insertLeft(self,newNode):\n if self.leftChild == None:\n self.leftChild = BinaryTree(newNode)\n else:\n t = BinaryTree(newNode)\n t.left = self.leftChild\n self.leftChild = t\n \n def insertRight(self,newNode):\n if self.rightChild == None:\n self.rightChild = BinaryTree(newNode)\n else:\n t = BinaryTree(newNode)\n t.right = self.rightChild\n self.rightChild = t\n\n def isLeaf(self):\n return ((not self.leftChild) and (not self.rightChild))\n\n def getRightChild(self):\n return self.rightChild\n\n def getLeftChild(self):\n return self.leftChild\n\n def setRootVal(self,obj):\n self.key = obj\n\n def getRootVal(self,):\n return self.key\n\n def inorder(self):\n if self.leftChild:\n self.leftChild.inorder()\n print(self.key)\n if self.rightChild:\n self.rightChild.inorder()\n\n def postorder(self):\n if self.leftChild:\n self.leftChild.postorder()\n if self.rightChild:\n self.rightChild.postorder()\n print(self.key)\n\n\n def preorder(self):\n print(self.key)\n if self.leftChild:\n self.leftChild.preorder()\n if self.rightChild:\n self.rightChild.preorder()\n\n def printexp(self):\n if self.leftChild:\n print('(')\n self.leftChild.printexp()\n print(self.key)\n if self.rightChild:\n self.rightChild.printexp()\n print(')')\n\n def postordereval(self):\n opers = {'+':operator.add, '-':operator.sub, '*':operator.mul, '/':operator.truediv}\n res1 = None\n res2 = None\n if self.leftChild:\n res1 = self.leftChild.postordereval() #// \\label{peleft}\n if self.rightChild:\n res2 = self.rightChild.postordereval() #// \\label{peright}\n if res1 and res2:\n return opers[self.key](res1,res2) #// \\label{peeval}\n else:\n return self.key\n\ndef inorder(tree):\n if tree != None:\n inorder(tree.getLeftChild())\n print(tree.getRootVal())\n inorder(tree.getRightChild())\n\ndef printexp(tree):\n if tree.leftChild:\n print('(')\n printexp(tree.getLeftChild())\n print(tree.getRootVal())\n if tree.rightChild:\n printexp(tree.getRightChild())\n print(')') \n\ndef printexp(tree):\n sVal = \"\"\n if tree:\n sVal = '(' + printexp(tree.getLeftChild())\n sVal = sVal + str(tree.getRootVal())\n sVal = sVal + printexp(tree.getRightChild()) + ')'\n return sVal\n\ndef postordereval(tree):\n opers = {'+':operator.add, '-':operator.sub, '*':operator.mul, '/':operator.truediv}\n res1 = None\n res2 = None\n if tree:\n res1 = postordereval(tree.getLeftChild()) #// \\label{peleft}\n res2 = postordereval(tree.getRightChild()) #// \\label{peright}\n if res1 and res2:\n return opers[tree.getRootVal()](res1,res2) #// \\label{peeval}\n else:\n return tree.getRootVal()\n\ndef height(tree):\n if tree == None:\n return -1\n else:\n return 1 + max(height(tree.leftChild),height(tree.rightChild))\n\n# t = BinaryTree(7)\n# t.insertLeft(3)\n# t.insertRight(9)\n# inorder(t)\n# import operator\n# x = BinaryTree('*')\n# x.insertLeft('+')\n# l = x.getLeftChild()\n# l.insertLeft(4)\n# l.insertRight(5)\n# x.insertRight(7)\n# print(printexp(x))\n# print(postordereval(x))\n# print(height(x))\n","src/lib/pythonds/trees/binheap.py":"# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005\n# \n\n# this heap takes key value pairs, we will assume that the keys are integers\nclass BinHeap:\n def __init__(self):\n self.heapList = [0]\n self.currentSize = 0\n\n\n def buildHeap(self,alist):\n i = len(alist) // 2\n self.currentSize = len(alist)\n self.heapList = [0] + alist[:]\n print(len(self.heapList), i)\n while (i > 0):\n print(self.heapList, i)\n self.percDown(i)\n i = i - 1\n print(self.heapList,i)\n \n def percDown(self,i):\n while (i * 2) <= self.currentSize:\n mc = self.minChild(i)\n if self.heapList[i] > self.heapList[mc]:\n tmp = self.heapList[i]\n self.heapList[i] = self.heapList[mc]\n self.heapList[mc] = tmp\n i = mc\n \n def minChild(self,i):\n if i * 2 + 1 > self.currentSize:\n return i * 2\n else:\n if self.heapList[i * 2] < self.heapList[i * 2 + 1]:\n return i * 2\n else:\n return i * 2 + 1\n\n def percUp(self,i):\n while i // 2 > 0:\n if self.heapList[i] < self.heapList[i//2]:\n tmp = self.heapList[i // 2]\n self.heapList[i // 2] = self.heapList[i]\n self.heapList[i] = tmp\n i = i // 2\n \n def insert(self,k):\n self.heapList.append(k)\n self.currentSize = self.currentSize + 1\n self.percUp(self.currentSize)\n\n def delMin(self):\n retval = self.heapList[1]\n self.heapList[1] = self.heapList[self.currentSize]\n self.currentSize = self.currentSize - 1\n self.heapList.pop()\n self.percDown(1)\n return retval\n \n def isEmpty(self):\n if currentSize == 0:\n return True\n else:\n return False\n","src/lib/pythonds/trees/bst.py":"#!/bin/env python3.1\n# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005, 2010\n# \n\nclass BinarySearchTree:\n '''\n Author: Brad Miller\n Date: 1/15/2005\n Description: Imlement a binary search tree with the following interface\n functions: \n __contains__(y) <==> y in x\n __getitem__(y) <==> x[y]\n __init__()\n __len__() <==> len(x)\n __setitem__(k,v) <==> x[k] = v\n clear()\n get(k)\n items() \n keys() \n values()\n put(k,v)\n in\n del <==> \n '''\n\n def __init__(self):\n self.root = None\n self.size = 0\n \n def put(self,key,val):\n if self.root:\n self._put(key,val,self.root)\n else:\n self.root = TreeNode(key,val)\n self.size = self.size + 1\n\n def _put(self,key,val,currentNode):\n if key < currentNode.key:\n if currentNode.hasLeftChild():\n self._put(key,val,currentNode.leftChild)\n else:\n currentNode.leftChild = TreeNode(key,val,parent=currentNode)\n else:\n if currentNode.hasRightChild():\n self._put(key,val,currentNode.rightChild)\n else:\n currentNode.rightChild = TreeNode(key,val,parent=currentNode)\n \n def __setitem__(self,k,v):\n self.put(k,v)\n\n def get(self,key):\n if self.root:\n res = self._get(key,self.root)\n if res:\n return res.payload\n else:\n return None\n else:\n return None\n \n def _get(self,key,currentNode):\n if not currentNode:\n return None\n elif currentNode.key == key:\n return currentNode\n elif key < currentNode.key:\n return self._get(key,currentNode.leftChild)\n else:\n return self._get(key,currentNode.rightChild)\n \n \n def __getitem__(self,key):\n res = self.get(key)\n if res:\n return res\n else:\n raise KeyError('Error, key not in tree')\n \n\n def __contains__(self,key):\n if self._get(key,self.root):\n return True\n else:\n return False\n \n def length(self):\n return self.size\n\n def __len__(self):\n return self.size\n\n def __iter__(self):\n return self.root.__iter__()\n \n def delete(self,key):\n if self.size > 1:\n nodeToRemove = self._get(key,self.root)\n if nodeToRemove:\n self.remove(nodeToRemove)\n self.size = self.size-1\n else:\n raise KeyError('Error, key not in tree')\n elif self.size == 1 and self.root.key == key:\n self.root = None\n self.size = self.size - 1\n else:\n raise KeyError('Error, key not in tree')\n\n def __delitem__(self,key):\n self.delete(key)\n \n def remove(self,currentNode):\n if currentNode.isLeaf(): #leaf\n if currentNode == currentNode.parent.leftChild:\n currentNode.parent.leftChild = None\n else:\n currentNode.parent.rightChild = None\n elif currentNode.hasBothChildren(): #interior\n succ = currentNode.findSuccessor()\n succ.spliceOut()\n currentNode.key = succ.key\n currentNode.payload = succ.payload\n else: # this node has one child\n if currentNode.hasLeftChild():\n if currentNode.isLeftChild():\n currentNode.leftChild.parent = currentNode.parent\n currentNode.parent.leftChild = currentNode.leftChild\n elif currentNode.isRightChild():\n currentNode.leftChild.parent = currentNode.parent\n currentNode.parent.rightChild = currentNode.leftChild\n else:\n currentNode.replaceNodeData(currentNode.leftChild.key,\n currentNode.leftChild.payload,\n currentNode.leftChild.leftChild,\n currentNode.leftChild.rightChild)\n else:\n if currentNode.isLeftChild():\n currentNode.rightChild.parent = currentNode.parent\n currentNode.parent.leftChild = currentNode.rightChild\n elif currentNode.isRightChild():\n currentNode.rightChild.parent = currentNode.parent\n currentNode.parent.rightChild = currentNode.rightChild\n else:\n currentNode.replaceNodeData(currentNode.rightChild.key,\n currentNode.rightChild.payload,\n currentNode.rightChild.leftChild,\n currentNode.rightChild.rightChild)\n\n def inorder(self):\n self._inorder(self.root)\n\n def _inorder(self,tree):\n if tree != None:\n self._inorder(tree.leftChild)\n print(tree.key)\n self._inorder(tree.rightChild)\n\n def postorder(self):\n self._postorder(self.root)\n\n def _postorder(self, tree):\n if tree:\n self._postorder(tree.rightChild)\n self._postorder(tree.leftChild)\n print(tree.key) \n\n def preorder(self):\n self._preorder(self,self.root)\n\n def _preorder(self,tree):\n if tree:\n print(tree.key) \n self._preorder(tree.leftChild)\n self._preorder(tree.rightChild)\n\n \nclass TreeNode:\n def __init__(self,key,val,left=None,right=None,parent=None):\n self.key = key\n self.payload = val\n self.leftChild = left\n self.rightChild = right\n self.parent = parent\n self.balanceFactor = 0\n \n def hasLeftChild(self):\n return self.leftChild\n\n def hasRightChild(self):\n return self.rightChild\n \n def isLeftChild(self):\n return self.parent and self.parent.leftChild == self\n\n def isRightChild(self):\n return self.parent and self.parent.rightChild == self\n\n def isRoot(self):\n return not self.parent\n\n def isLeaf(self):\n return not (self.rightChild or self.leftChild)\n\n def hasAnyChildren(self):\n return self.rightChild or self.leftChild\n\n def hasBothChildren(self):\n return self.rightChild and self.leftChild\n \n def replaceNodeData(self,key,value,lc,rc):\n self.key = key\n self.payload = value\n self.leftChild = lc\n self.rightChild = rc\n if self.hasLeftChild():\n self.leftChild.parent = self\n if self.hasRightChild():\n self.rightChild.parent = self\n \n def findSuccessor(self):\n succ = None\n if self.hasRightChild():\n succ = self.rightChild.findMin()\n else:\n if self.parent:\n if self.isLeftChild():\n succ = self.parent\n else:\n self.parent.rightChild = None\n succ = self.parent.findSuccessor()\n self.parent.rightChild = self\n return succ\n\n\n def spliceOut(self):\n if self.isLeaf():\n if self.isLeftChild():\n self.parent.leftChild = None\n else:\n self.parent.rightChild = None\n elif self.hasAnyChildren():\n if self.hasLeftChild():\n if self.isLeftChild():\n self.parent.leftChild = self.leftChild\n else:\n self.parent.rightChild = self.leftChild\n self.leftChild.parent = self.parent\n else:\n if self.isLeftChild():\n self.parent.leftChild = self.rightChild\n else:\n self.parent.rightChild = self.rightChild\n self.rightChild.parent = self.parent\n\n def findMin(self):\n current = self\n while current.hasLeftChild():\n current = current.leftChild\n return current\n\n def __iter__(self):\n \"\"\"The standard inorder traversal of a binary tree.\"\"\"\n if self:\n if self.hasLeftChild():\n for elem in self.leftChild:\n yield elem\n yield self.key\n if self.hasRightChild():\n for elem in self.rightChild:\n yield elem\n\n \n","src/lib/pythonds/trees/__init__.py":"\n# from .binaryTree import BinaryTree\n# from .balance import AVLTree\n# from .bst import BinarySearchTree\n# from .binheap import BinHeap\n\n\n","src/lib/pythonds/__init__.py":"","src/lib/py_compile.py":'import _sk_fail; _sk_fail._("py_compile")\n',"src/lib/Queue.py":'import _sk_fail; _sk_fail._("Queue")\n',"src/lib/quopri.py":'import _sk_fail; _sk_fail._("quopri")\n',"src/lib/repr.py":'import _sk_fail; _sk_fail._("repr")\n',"src/lib/rexec.py":'import _sk_fail; _sk_fail._("rexec")\n',"src/lib/rfc822.py":'import _sk_fail; _sk_fail._("rfc822")\n',"src/lib/rlcompleter.py":'import _sk_fail; _sk_fail._("rlcompleter")\n',"src/lib/robotparser.py":'import _sk_fail; _sk_fail._("robotparser")\n',"src/lib/runpy.py":'import _sk_fail; _sk_fail._("runpy")\n',"src/lib/sched.py":'import _sk_fail; _sk_fail._("sched")\n',"src/lib/sets.py":'import _sk_fail; _sk_fail._("sets")\n',"src/lib/sgmllib.py":'import _sk_fail; _sk_fail._("sgmllib")\n',"src/lib/sha.py":'import _sk_fail; _sk_fail._("sha")\n',"src/lib/shelve.py":'import _sk_fail; _sk_fail._("shelve")\n',"src/lib/shlex.py":'import _sk_fail; _sk_fail._("shlex")\n',"src/lib/shutil.py":'import _sk_fail; _sk_fail._("shutil")\n',"src/lib/SimpleHTTPServer.py":'import _sk_fail; _sk_fail._("SimpleHTTPServer")\n',"src/lib/SimpleXMLRPCServer.py":'import _sk_fail; _sk_fail._("SimpleXMLRPCServer")\n',"src/lib/site.py":'import _sk_fail; _sk_fail._("site")\n',"src/lib/smtpd.py":'import _sk_fail; _sk_fail._("smtpd")\n',"src/lib/smtplib.py":'import _sk_fail; _sk_fail._("smtplib")\n',"src/lib/sndhdr.py":'import _sk_fail; _sk_fail._("sndhdr")\n',"src/lib/socket.py":'import _sk_fail; _sk_fail._("socket")\n',"src/lib/SocketServer.py":'import _sk_fail; _sk_fail._("SocketServer")\n',"src/lib/sqlite3/__init__.py":'import _sk_fail; _sk_fail._("sqlite3")\n',"src/lib/sre.py":'import _sk_fail; _sk_fail._("sre")\n',"src/lib/sre_compile.py":'import _sk_fail; _sk_fail._("sre_compile")\n',"src/lib/sre_constants.py":'import _sk_fail; _sk_fail._("sre_constants")\n',"src/lib/sre_parse.py":'import _sk_fail; _sk_fail._("sre_parse")\n',"src/lib/ssl.py":'import _sk_fail; _sk_fail._("ssl")\n',"src/lib/stat.py":'import _sk_fail; _sk_fail._("stat")\n',"src/lib/statvfs.py":'import _sk_fail; _sk_fail._("statvfs")\n',"src/lib/StringIO.py":'r"""File-like objects that read from or write to a string buffer.\n\nThis implements (nearly) all stdio methods.\n\nf = StringIO() # ready for writing\nf = StringIO(buf) # ready for reading\nf.close() # explicitly release resources held\nflag = f.isatty() # always false\npos = f.tell() # get current position\nf.seek(pos) # set current position\nf.seek(pos, mode) # mode 0: absolute; 1: relative; 2: relative to EOF\nbuf = f.read() # read until EOF\nbuf = f.read(n) # read up to n bytes\nbuf = f.readline() # read until end of line (\'\\n\') or EOF\nlist = f.readlines()# list of f.readline() results until EOF\nf.truncate([size]) # truncate file at to at most size (default: current pos)\nf.write(buf) # write at current position\nf.writelines(list) # for line in list: f.write(line)\nf.getvalue() # return whole file\'s contents as a string\n\nNotes:\n- Using a real file is often faster (but less convenient).\n- There\'s also a much faster implementation in C, called cStringIO, but\n it\'s not subclassable.\n- fileno() is left unimplemented so that code which uses it triggers\n an exception early.\n- Seeking far beyond EOF and then writing will insert real null\n bytes that occupy space in the buffer.\n- There\'s a simple test set (see end of this file).\n"""\n\n__all__ = ["StringIO"]\n\ndef _complain_ifclosed(closed):\n if closed:\n raise ValueError("I/O operation on closed file")\n\nclass StringIO:\n """class StringIO([buffer])\n\n When a StringIO object is created, it can be initialized to an existing\n string by passing the string to the constructor. If no string is given,\n the StringIO will start empty.\n\n The StringIO object can accept either Unicode or 8-bit strings, but\n mixing the two may take some care. If both are used, 8-bit strings that\n cannot be interpreted as 7-bit ASCII (that use the 8th bit) will cause\n a UnicodeError to be raised when getvalue() is called.\n """\n def __init__(self, buf = \'\'):\n # Force self.buf to be a string or unicode\n if not isinstance(buf, str):\n buf = str(buf)\n self.buf = buf\n self.len = len(buf)\n self.buflist = []\n self.pos = 0\n self.closed = False\n self.softspace = 0\n\n def __iter__(self):\n return self\n\n def next(self):\n """A file object is its own iterator, for example iter(f) returns f\n (unless f is closed). When a file is used as an iterator, typically\n in a for loop (for example, for line in f: print line), the next()\n method is called repeatedly. This method returns the next input line,\n or raises StopIteration when EOF is hit.\n """\n _complain_ifclosed(self.closed)\n r = self.readline()\n if not r:\n raise StopIteration\n return r\n\n def close(self):\n """Free the memory buffer.\n """\n if not self.closed:\n self.closed = True\n self.buf = None\n self.pos = None\n\n def isatty(self):\n """Returns False because StringIO objects are not connected to a\n tty-like device.\n """\n _complain_ifclosed(self.closed)\n return False\n\n def seek(self, pos, mode = 0):\n """Set the file\'s current position.\n\n The mode argument is optional and defaults to 0 (absolute file\n positioning); other values are 1 (seek relative to the current\n position) and 2 (seek relative to the file\'s end).\n\n There is no return value.\n """\n _complain_ifclosed(self.closed)\n if self.buflist:\n self.buf += \'\'.join(self.buflist)\n self.buflist = []\n if mode == 1:\n pos += self.pos\n elif mode == 2:\n pos += self.len\n self.pos = max(0, pos)\n\n def tell(self):\n """Return the file\'s current position."""\n _complain_ifclosed(self.closed)\n return self.pos\n\n def read(self, n = -1):\n """Read at most size bytes from the file\n (less if the read hits EOF before obtaining size bytes).\n\n If the size argument is negative or omitted, read all data until EOF\n is reached. The bytes are returned as a string object. An empty\n string is returned when EOF is encountered immediately.\n """\n _complain_ifclosed(self.closed)\n if self.buflist:\n self.buf += \'\'.join(self.buflist)\n self.buflist = []\n if n is None or n < 0:\n newpos = self.len\n else:\n newpos = min(self.pos+n, self.len)\n r = self.buf[self.pos:newpos]\n self.pos = newpos\n return r\n\n def readline(self, length=None):\n r"""Read one entire line from the file.\n\n A trailing newline character is kept in the string (but may be absent\n when a file ends with an incomplete line). If the size argument is\n present and non-negative, it is a maximum byte count (including the\n trailing newline) and an incomplete line may be returned.\n\n An empty string is returned only when EOF is encountered immediately.\n\n Note: Unlike stdio\'s fgets(), the returned string contains null\n characters (\'\\0\') if they occurred in the input.\n """\n _complain_ifclosed(self.closed)\n if self.buflist:\n self.buf += \'\'.join(self.buflist)\n self.buflist = []\n i = self.buf.find(\'\\n\', self.pos)\n if i < 0:\n newpos = self.len\n else:\n newpos = i+1\n if length is not None and length >= 0:\n if self.pos + length < newpos:\n newpos = self.pos + length\n r = self.buf[self.pos:newpos]\n self.pos = newpos\n return r\n\n def readlines(self, sizehint = 0):\n """Read until EOF using readline() and return a list containing the\n lines thus read.\n\n If the optional sizehint argument is present, instead of reading up\n to EOF, whole lines totalling approximately sizehint bytes (or more\n to accommodate a final whole line).\n """\n total = 0\n lines = []\n line = self.readline()\n while line:\n lines.append(line)\n total += len(line)\n if 0 < sizehint <= total:\n break\n line = self.readline()\n return lines\n\n def truncate(self, size=None):\n """Truncate the file\'s size.\n\n If the optional size argument is present, the file is truncated to\n (at most) that size. The size defaults to the current position.\n The current file position is not changed unless the position\n is beyond the new file size.\n\n If the specified size exceeds the file\'s current size, the\n file remains unchanged.\n """\n _complain_ifclosed(self.closed)\n if size is None:\n size = self.pos\n elif size < 0:\n raise IOError(22, "Negative size not allowed")\n elif size < self.pos:\n self.pos = size\n self.buf = self.getvalue()[:size]\n self.len = size\n\n def write(self, s):\n """Write a string to the file.\n\n There is no return value.\n """\n _complain_ifclosed(self.closed)\n if not s: return\n # Force s to be a string or unicode\n if not isinstance(s, str):\n s = str(s)\n spos = self.pos\n slen = self.len\n if spos == slen:\n self.buflist.append(s)\n self.len = self.pos = spos + len(s)\n return\n if spos > slen:\n self.buflist.append(\'\\0\'*(spos - slen))\n slen = spos\n newpos = spos + len(s)\n if spos < slen:\n if self.buflist:\n self.buf += \'\'.join(self.buflist)\n self.buflist = [self.buf[:spos], s, self.buf[newpos:]]\n self.buf = \'\'\n if newpos > slen:\n slen = newpos\n else:\n self.buflist.append(s)\n slen = newpos\n self.len = slen\n self.pos = newpos\n\n def writelines(self, iterable):\n """Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings. There\n is no return value.\n\n (The name is intended to match readlines(); writelines() does not add\n line separators.)\n """\n write = self.write\n for line in iterable:\n write(line)\n\n def flush(self):\n """Flush the internal buffer\n """\n _complain_ifclosed(self.closed)\n\n def getvalue(self):\n """\n Retrieve the entire contents of the "file" at any time before\n the StringIO object\'s close() method is called.\n\n The StringIO object can accept either Unicode or 8-bit strings,\n but mixing the two may take some care. If both are used, 8-bit\n strings that cannot be interpreted as 7-bit ASCII (that use the\n 8th bit) will cause a UnicodeError to be raised when getvalue()\n is called.\n """\n _complain_ifclosed(self.closed)\n if self.buflist:\n self.buf += \'\'.join(self.buflist)\n self.buflist = []\n return self.buf\n',"src/lib/stringold.py":'import _sk_fail; _sk_fail._("stringold")\n',"src/lib/stringprep.py":'import _sk_fail; _sk_fail._("stringprep")\n',"src/lib/struct.py":'import _sk_fail; _sk_fail._("struct")\n',"src/lib/subprocess.py":'import _sk_fail; _sk_fail._("subprocess")\n',"src/lib/sunau.py":'import _sk_fail; _sk_fail._("sunau")\n',"src/lib/sunaudio.py":'import _sk_fail; _sk_fail._("sunaudio")\n',"src/lib/symbol.py":'import _sk_fail; _sk_fail._("symbol")\n',"src/lib/symtable.py":'import _sk_fail; _sk_fail._("symtable")\n',"src/lib/tabnanny.py":'import _sk_fail; _sk_fail._("tabnanny")\n',"src/lib/tarfile.py":'import _sk_fail; _sk_fail._("tarfile")\n',"src/lib/telnetlib.py":'import _sk_fail; _sk_fail._("telnetlib")\n',"src/lib/tempfile.py":'import _sk_fail; _sk_fail._("tempfile")\n',"src/lib/test/ann_module.py":"\n\n\"\"\"\nThe module for testing variable annotations.\nEmpty lines above are for good reason (testing for correct line numbers)\n\"\"\"\n\n# from typing import Optional\n# from functools import wraps\n\n__annotations__[1] = 2\n\nclass C:\n\n x = 5; #y: Optional['C'] = None\n\n# from typing import Tuple\nx: int = 5; y: str = x;# f: Tuple[int, int]\n\nclass M(type):\n\n __annotations__['123'] = 123\n o: type = object\n\n(pars): bool = True\n\nclass D(C):\n j: str = 'hi'; k: str= 'bye'\n\n# from types import new_class\n# h_class = new_class('H', (C,))\n# j_class = new_class('J')\n\nclass F():\n z: int = 5\n def __init__(self, x):\n pass\n\nclass Y(F):\n def __init__(self):\n super(F, self).__init__(123)\n\nclass Meta(type):\n def __new__(meta, name, bases, namespace):\n return super().__new__(meta, name, bases, namespace)\n\nclass S(metaclass = Meta):\n x: str = 'something'\n y: str = 'something else'\n\n# def foo(x: int = 10):\n# def bar(y: List[str]):\n# x: str = 'yes'\n# bar()\n\n# def dec(func):\n# @wraps(func)\n# def wrapper(*args, **kwargs):\n# return func(*args, **kwargs)\n# return wrapper\n","src/lib/test/ann_module2.py":'"""\nSome correct syntax for variable annotation here.\nMore examples are in test_grammar and test_parser.\n"""\n\n# from typing import no_type_check, ClassVar\n\ni: int = 1\nj: int\nx: float = i/10\n\ndef f():\n # class C: ...\n class C: pass\n return C()\n\nf().new_attr: object = object()\n\nclass C:\n def __init__(self, x: int) -> None:\n self.x = x\n\nc = C(5)\nc.new_attr: int = 10\n\n__annotations__ = {}\n\n\n# @no_type_check\n# class NTC:\n# def meth(self, param: complex) -> None:\n# ...\n\n# class CV:\n# var: ClassVar[\'CV\']\n\n# CV.var = CV()\n',"src/lib/test/ann_module3.py":'"""\nCorrect syntax for variable annotation that should fail at runtime\nin a certain manner. More examples are in test_grammar and test_parser.\n"""\n\ndef f_bad_ann():\n __annotations__[1] = 2\n\nclass C_OK:\n def __init__(self, x: int) -> None:\n self.x: no_such_name = x # This one is OK as proposed by Guido\n\nclass D_bad_ann:\n def __init__(self, x: int) -> None:\n sfel.y: int = 0\n\ndef g_bad_ann():\n no_such_name.attr: int = 0\n',"src/lib/test/bad_getattr.py":'x = 1\n\n__getattr__ = "Surprise!"\n__dir__ = "Surprise again!"\n',"src/lib/test/bad_getattr2.py":'def __getattr__():\n "Bad one"\n\nx = 1\n\ndef __dir__(bad_sig):\n return []\n',"src/lib/test/bad_getattr3.py":"def __getattr__(name):\n global __getattr__\n if name != 'delgetattr':\n raise AttributeError\n del __getattr__\n raise AttributeError\n","src/lib/test/decimaltestdata/__init__.py":'import _sk_fail; _sk_fail._("decimaltestdata")\n',"src/lib/test/good_getattr.py":"x = 1\n\ndef __dir__():\n return ['a', 'b', 'c']\n\ndef __getattr__(name):\n if name == \"yolo\":\n raise AttributeError(\"Deprecated, use whatever instead\")\n return f\"There is {name}\"\n\ny = 2\n","src/lib/test/test_support.py":'"""Supporting definitions for the Python regression tests."""\n\nif __name__ != \'test.test_support\':\n raise ImportError(\'test_support must be imported from the test package\')\n\nimport unittest\n\n\n# def run_unittest(*classes):\n# """Run tests from unittest.TestCase-derived classes."""\n# valid_types = (unittest.TestSuite, unittest.TestCase)\n# suite = unittest.TestSuite()\n# for cls in classes:\n# if isinstance(cls, str):\n# if cls in sys.modules:\n# suite.addTest(unittest.findTestCases(sys.modules[cls]))\n# else:\n# raise ValueError("str arguments must be keys in sys.modules")\n# elif isinstance(cls, valid_types):\n# suite.addTest(cls)\n# else:\n# suite.addTest(unittest.makeSuite(cls))\n# _run_suite(suite)\n\ndef run_unittest(*classes):\n """Run tests from unittest.TestCase-derived classes."""\n for cls in classes:\n print cls\n if issubclass(cls, unittest.TestCase):\n cls().main()\n else:\n print "Don\'t know what to do with ", cls\n',"src/lib/test/__init__.py":"__author__ = 'bmiller'\n\ndef testEqual(actual, expected):\n if type(expected) == type(1):\n if actual == expected:\n print('Pass')\n return True\n elif type(expected) == type(1.11):\n if abs(actual-expected) < 0.00001:\n print('Pass')\n return True\n else:\n if actual == expected:\n print('Pass')\n return True\n print('Test Failed: expected ' + str(expected) + ' but got ' + str(actual))\n return False\n\ndef testNotEqual(actual, expected):\n pass\n\n","src/lib/textwrap.py":"\"\"\"Text wrapping and filling.\n\"\"\"\n\n# Copyright (C) 1999-2001 Gregory P. Ward.\n# Copyright (C) 2002, 2003 Python Software Foundation.\n# Written by Greg Ward \n\nimport re, string\n\n__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent', 'shorten']\n\n# Hardcode the recognized whitespace characters to the US-ASCII\n# whitespace characters. The main reason for doing this is that\n# some Unicode spaces (like \\u00a0) are non-breaking whitespaces.\n_whitespace = '\\t\\n\\x0b\\x0c\\r '\n\nclass TextWrapper:\n \"\"\"\n Object for wrapping/filling text. The public interface consists of\n the wrap() and fill() methods; the other methods are just there for\n subclasses to override in order to tweak the default behaviour.\n If you want to completely replace the main wrapping algorithm,\n you'll probably have to override _wrap_chunks().\n Several instance attributes control various aspects of wrapping:\n width (default: 70)\n the maximum width of wrapped lines (unless break_long_words\n is false)\n initial_indent (default: \"\")\n string that will be prepended to the first line of wrapped\n output. Counts towards the line's width.\n subsequent_indent (default: \"\")\n string that will be prepended to all lines save the first\n of wrapped output; also counts towards each line's width.\n expand_tabs (default: true)\n Expand tabs in input text to spaces before further processing.\n Each tab will become 0 .. 'tabsize' spaces, depending on its position\n in its line. If false, each tab is treated as a single character.\n tabsize (default: 8)\n Expand tabs in input text to 0 .. 'tabsize' spaces, unless\n 'expand_tabs' is false.\n replace_whitespace (default: true)\n Replace all whitespace characters in the input text by spaces\n after tab expansion. Note that if expand_tabs is false and\n replace_whitespace is true, every tab will be converted to a\n single space!\n fix_sentence_endings (default: false)\n Ensure that sentence-ending punctuation is always followed\n by two spaces. Off by default because the algorithm is\n (unavoidably) imperfect.\n break_long_words (default: true)\n Break words longer than 'width'. If false, those words will not\n be broken, and some lines might be longer than 'width'.\n break_on_hyphens (default: true)\n Allow breaking hyphenated words. If true, wrapping will occur\n preferably on whitespaces and right after hyphens part of\n compound words.\n drop_whitespace (default: true)\n Drop leading and trailing whitespace from lines.\n max_lines (default: None)\n Truncate wrapped lines.\n placeholder (default: ' [...]')\n Append to the last line of truncated text.\n \"\"\"\n\n unicode_whitespace_trans = {}\n # uspace = ord(' ')\n uspace = ' '\n for x in _whitespace:\n # unicode_whitespace_trans[ord(x)] = uspace\n unicode_whitespace_trans[x] = uspace\n\n # This funky little regex is just the trick for splitting\n # text up into word-wrappable chunks. E.g.\n # \"Hello there -- you goof-ball, use the -b option!\"\n # splits into\n # Hello/ /there/ /--/ /you/ /goof-/ball,/ /use/ /the/ /-b/ /option!\n # (after stripping out empty strings).\n wordsep_re = re.compile(\n r'(\\s+|' # any whitespace\n r'[^\\s\\w]*\\w+[^0-9\\W]-(?=\\w+[^0-9\\W]))') # hyphenated words\n em_dash = re.compile(r'(\\s+|' # any whitespace\n r'[^\\s\\w]*\\w+[^0-9\\W]-(?=\\w+[^0-9\\W])|' # hyphenated words\n r'(?!^)-{2,}(?=\\w))') # em-dash\n\n \n # This less funky little regex just split on recognized spaces. E.g.\n # \"Hello there -- you goof-ball, use the -b option!\"\n # splits into\n # Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/\n wordsep_simple_re = re.compile(r'(\\s+)')\n\n\n # XXX this is not locale- or charset-aware -- string.lowercase\n # is US-ASCII only (and therefore English-only)\n sentence_end_re = re.compile(r'[a-z]' # lowercase letter\n r'[\\.\\!\\?]' # sentence-ending punct.\n r'[\\\"\\']?' # optional end-of-quote\n r'\\Z') # end of chunk\n sentence_end_re = r'[a-z][\\.\\!\\?][\\\"\\']?'\n\n def __init__(self,\n width=70,\n initial_indent=\"\",\n subsequent_indent=\"\",\n expand_tabs=True,\n replace_whitespace=True,\n fix_sentence_endings=False,\n break_long_words=True,\n drop_whitespace=True,\n break_on_hyphens=True,\n tabsize=8,\n max_lines=None,\n placeholder=' [...]'):\n self.width = width\n self.initial_indent = initial_indent\n self.subsequent_indent = subsequent_indent\n self.expand_tabs = expand_tabs\n self.replace_whitespace = replace_whitespace\n self.fix_sentence_endings = fix_sentence_endings\n self.break_long_words = break_long_words\n self.drop_whitespace = drop_whitespace\n self.break_on_hyphens = break_on_hyphens\n self.tabsize = tabsize\n self.max_lines = max_lines\n self.placeholder = placeholder\n\n\n # -- Private methods -----------------------------------------------\n # (possibly useful for subclasses to override)\n\n def _munge_whitespace(self, text):\n \"\"\"_munge_whitespace(text : string) -> string\n Munge whitespace in text: expand tabs and convert all other\n whitespace characters to spaces. Eg. \" foo\\\\tbar\\\\n\\\\nbaz\"\n becomes \" foo bar baz\".\n \"\"\"\n if self.expand_tabs:\n text = text.expandtabs(self.tabsize)\n if self.replace_whitespace:\n for key, val in self.unicode_whitespace_trans.items():\n text = text.replace(key, val)\n return text\n\n\n def _split(self, text):\n \"\"\"_split(text : string) -> [string]\n Split the text to wrap into indivisible chunks. Chunks are\n not quite the same as words; see _wrap_chunks() for full\n details. As an example, the text\n Look, goof-ball -- use the -b option!\n breaks into the following chunks:\n 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',\n 'use', ' ', 'the', ' ', '-b', ' ', 'option!'\n if break_on_hyphens is True, or in:\n 'Look,', ' ', 'goof-ball', ' ', '--', ' ',\n 'use', ' ', 'the', ' ', '-b', ' ', option!'\n otherwise.\n \"\"\"\n if self.break_on_hyphens is True:\n chunks = self.wordsep_re.split(text)\n if \"--\" in text:\n chunks = [item \n for sublist in [self.em_dash.split(chunk) for chunk in chunks] \n for item in sublist]\n else:\n chunks = self.wordsep_simple_re.split(text)\n chunks = [c for c in chunks if c]\n return chunks\n\n def _fix_sentence_endings(self, chunks):\n \"\"\"_fix_sentence_endings(chunks : [string])\n Correct for sentence endings buried in 'chunks'. Eg. when the\n original text contains \"... foo.\\\\nBar ...\", munge_whitespace()\n and split() will convert that to [..., \"foo.\", \" \", \"Bar\", ...]\n which has one too few spaces; this method simply changes the one\n space to two.\n \"\"\"\n i = 0\n # patsearch = self.sentence_end_re.search\n while i < len(chunks)-1:\n if chunks[i+1] == \" \" and re.search(self.sentence_end_re, chunks[i]) and chunks[i][-1] in \".!?\\\"\\'\":\n chunks[i+1] = \" \"\n i += 2\n else:\n i += 1\n\n def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width):\n \"\"\"_handle_long_word(chunks : [string],\n cur_line : [string],\n cur_len : int, width : int)\n Handle a chunk of text (most likely a word, not whitespace) that\n is too long to fit in any line.\n \"\"\"\n # Figure out when indent is larger than the specified width, and make\n # sure at least one character is stripped off on every pass\n if width < 1:\n space_left = 1\n else:\n space_left = width - cur_len\n\n # If we're allowed to break long words, then do so: put as much\n # of the next chunk onto the current line as will fit.\n if self.break_long_words:\n cur_line.append(reversed_chunks[-1][:space_left])\n reversed_chunks[-1] = reversed_chunks[-1][space_left:]\n\n # Otherwise, we have to preserve the long word intact. Only add\n # it to the current line if there's nothing already there --\n # that minimizes how much we violate the width constraint.\n elif not cur_line:\n cur_line.append(reversed_chunks.pop())\n\n # If we're not allowed to break long words, and there's already\n # text on the current line, do nothing. Next time through the\n # main loop of _wrap_chunks(), we'll wind up here again, but\n # cur_len will be zero, so the next line will be entirely\n # devoted to the long word that we can't handle right now.\n\n def _wrap_chunks(self, chunks):\n \"\"\"_wrap_chunks(chunks : [string]) -> [string]\n Wrap a sequence of text chunks and return a list of lines of\n length 'self.width' or less. (If 'break_long_words' is false,\n some lines may be longer than this.) Chunks correspond roughly\n to words and the whitespace between them: each chunk is\n indivisible (modulo 'break_long_words'), but a line break can\n come between any two chunks. Chunks should not have internal\n whitespace; ie. a chunk is either all whitespace or a \"word\".\n Whitespace chunks will be removed from the beginning and end of\n lines, but apart from that whitespace is preserved.\n \"\"\"\n lines = []\n if self.width <= 0:\n raise ValueError(\"invalid width %r (must be > 0)\" % self.width)\n if self.max_lines is not None:\n if self.max_lines > 1:\n indent = self.subsequent_indent\n else:\n indent = self.initial_indent\n if len(indent) + len(self.placeholder.lstrip()) > self.width:\n raise ValueError(\"placeholder too large for max width\")\n\n # Arrange in reverse order so items can be efficiently popped\n # from a stack of chucks.\n chunks.reverse()\n\n while chunks:\n\n # Start the list of chunks that will make up the current line.\n # cur_len is just the length of all the chunks in cur_line.\n cur_line = []\n cur_len = 0\n\n # Figure out which static string will prefix this line.\n if lines:\n indent = self.subsequent_indent\n else:\n indent = self.initial_indent\n\n # Maximum width for this line.\n width = self.width - len(indent)\n\n # First chunk on line is whitespace -- drop it, unless this\n # is the very beginning of the text (ie. no lines started yet).\n if self.drop_whitespace and chunks[-1].strip() == '' and lines:\n del chunks[-1]\n\n while chunks:\n l = len(chunks[-1])\n\n # Can at least squeeze this chunk onto the current line.\n if cur_len + l <= width:\n cur_line.append(chunks.pop())\n cur_len += l\n\n # Nope, this line is full.\n else:\n break\n\n # The current line is full, and the next chunk is too big to\n # fit on *any* line (not just this one).\n if chunks and len(chunks[-1]) > width:\n self._handle_long_word(chunks, cur_line, cur_len, width)\n cur_len = sum(map(len, cur_line))\n\n # If the last chunk on this line is all whitespace, drop it.\n if self.drop_whitespace and cur_line and cur_line[-1].strip() == '':\n cur_len -= len(cur_line[-1])\n del cur_line[-1]\n\n if cur_line:\n if (self.max_lines is None or\n len(lines) + 1 < self.max_lines or\n (not chunks or\n self.drop_whitespace and\n len(chunks) == 1 and\n not chunks[0].strip()) and cur_len <= width):\n # Convert current line back to a string and store it in\n # list of all lines (return value).\n lines.append(indent + ''.join(cur_line))\n else:\n while cur_line:\n if (cur_line[-1].strip() and\n cur_len + len(self.placeholder) <= width):\n cur_line.append(self.placeholder)\n lines.append(indent + ''.join(cur_line))\n break\n cur_len -= len(cur_line[-1])\n del cur_line[-1]\n else:\n if lines:\n prev_line = lines[-1].rstrip()\n if (len(prev_line) + len(self.placeholder) <=\n self.width):\n lines[-1] = prev_line + self.placeholder\n break\n lines.append(indent + self.placeholder.lstrip())\n break\n\n return lines\n\n def _split_chunks(self, text):\n text = self._munge_whitespace(text)\n return self._split(text)\n\n # -- Public interface ----------------------------------------------\n\n def wrap(self, text):\n \"\"\"wrap(text : string) -> [string]\n Reformat the single paragraph in 'text' so it fits in lines of\n no more than 'self.width' columns, and return a list of wrapped\n lines. Tabs in 'text' are expanded with string.expandtabs(),\n and all other whitespace characters (including newline) are\n converted to space.\n \"\"\"\n chunks = self._split_chunks(text)\n if self.fix_sentence_endings:\n self._fix_sentence_endings(chunks)\n return self._wrap_chunks(chunks)\n\n def fill(self, text):\n \"\"\"fill(text : string) -> string\n Reformat the single paragraph in 'text' to fit in lines of no\n more than 'self.width' columns, and return a new string\n containing the entire wrapped paragraph.\n \"\"\"\n return \"\\n\".join(self.wrap(text))\n\n\n# -- Convenience interface ---------------------------------------------\n\ndef wrap(text, width=70, **kwargs):\n \"\"\"Wrap a single paragraph of text, returning a list of wrapped lines.\n Reformat the single paragraph in 'text' so it fits in lines of no\n more than 'width' columns, and return a list of wrapped lines. By\n default, tabs in 'text' are expanded with string.expandtabs(), and\n all other whitespace characters (including newline) are converted to\n space. See TextWrapper class for available keyword args to customize\n wrapping behaviour.\n \"\"\"\n w = TextWrapper(width=width, **kwargs)\n return w.wrap(text)\n\ndef fill(text, width=70, **kwargs):\n \"\"\"Fill a single paragraph of text, returning a new string.\n Reformat the single paragraph in 'text' to fit in lines of no more\n than 'width' columns, and return a new string containing the entire\n wrapped paragraph. As with wrap(), tabs are expanded and other\n whitespace characters converted to space. See TextWrapper class for\n available keyword args to customize wrapping behaviour.\n \"\"\"\n w = TextWrapper(width=width, **kwargs)\n return w.fill(text)\n\ndef shorten(text, width, **kwargs):\n \"\"\"Collapse and truncate the given text to fit in the given width.\n The text first has its whitespace collapsed. If it then fits in\n the *width*, it is returned as is. Otherwise, as many words\n as possible are joined and then the placeholder is appended::\n >>> textwrap.shorten(\"Hello world!\", width=12)\n 'Hello world!'\n >>> textwrap.shorten(\"Hello world!\", width=11)\n 'Hello [...]'\n \"\"\"\n w = TextWrapper(width=width, max_lines=1, **kwargs)\n return w.fill(' '.join(text.strip().split()))\n\n\n# -- Loosely related functionality -------------------------------------\n\n# _whitespace_only_re = re.compile('^[ \\t]+$', re.MULTILINE)\n# _leading_whitespace_re = re.compile('(^[ \\t]*)(?:[^ \\t\\n])', re.MULTILINE)\n\ndef dedent(text):\n \"\"\"Remove any common leading whitespace from every line in `text`.\n This can be used to make triple-quoted strings line up with the left\n edge of the display, while still presenting them in the source code\n in indented form.\n Note that tabs and spaces are both treated as whitespace, but they\n are not equal: the lines \" hello\" and \"\\\\thello\" are\n considered to have no common leading whitespace.\n Entirely blank lines are normalized to a newline character.\n \"\"\"\n # Look for the longest leading string of spaces and tabs common to\n # all lines.\n margin = None\n\n indents = re.findall(r'(^[ \\t]*)(?:[^ \\t\\n])',text, re.MULTILINE)\n for indent in indents:\n if margin is None:\n margin = indent\n\n # Current line more deeply indented than previous winner:\n # no change (previous winner is still on top).\n elif indent.startswith(margin):\n pass\n\n # Current line consistent with and no deeper than previous winner:\n # it's the new winner.\n elif margin.startswith(indent):\n margin = indent\n\n # Find the largest common whitespace between current line and previous\n # winner.\n else:\n for i, (x, y) in enumerate(zip(margin, indent)):\n if x != y:\n margin = margin[:i]\n break\n # sanity check (testing/debugging only)\n if 0 and margin:\n for line in text.split(\"\\n\"):\n assert not line or line.startswith(margin), \\\n \"line = %r, margin = %r\" % (line, margin)\n\n if margin:\n lines = [line[len(margin):] \n if line.strip()\n else line.strip() \n for line in text.split(\"\\n\")]\n text = \"\\n\".join(lines)\n return text\n\n\ndef indent(text, prefix, predicate=None):\n \"\"\"Adds 'prefix' to the beginning of selected lines in 'text'.\n If 'predicate' is provided, 'prefix' will only be added to the lines\n where 'predicate(line)' is True. If 'predicate' is not provided,\n it will default to adding 'prefix' to all non-empty lines that do not\n consist solely of whitespace characters.\n \"\"\"\n if predicate is None:\n def predicate(line):\n return line.strip()\n\n def prefixed_lines():\n for line in text.splitlines(True):\n yield (prefix + line if predicate(line) else line)\n return ''.join(prefixed_lines())\n\n\nif __name__ == \"__main__\":\n #print dedent(\"\\tfoo\\n\\tbar\")\n #print dedent(\" \\thello there\\n \\t how are you?\")\n print(dedent(\"Hello there.\\n This is indented.\"))","src/lib/this.py":'import _sk_fail; _sk_fail._("this")\n',"src/lib/threading.py":'import _sk_fail; _sk_fail._("threading")\n',"src/lib/timeit.py":'import _sk_fail; _sk_fail._("timeit")\n',"src/lib/toaiff.py":'import _sk_fail; _sk_fail._("toaiff")\n',"src/lib/trace.py":'import _sk_fail; _sk_fail._("trace")\n',"src/lib/traceback.py":'import _sk_fail; _sk_fail._("traceback")\n',"src/lib/tty.py":'import _sk_fail; _sk_fail._("tty")\n',"src/lib/types.py":'"""\nThis file was modified from CPython.\nCopyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,\n2011, 2012, 2013, 2014, 2015 Python Software Foundation; All Rights Reserved\n"""\n"""Define names for all type symbols known in the standard interpreter.\nTypes that are part of optional modules (e.g. array) are not listed.\n"""\nimport sys\n\n# Iterators in Python aren\'t a matter of type but of protocol. A large\n# and changing number of builtin types implement *some* flavor of\n# iterator. Don\'t check the type! Use hasattr to check for both\n# "__iter__" and "next" attributes instead.\nMappingProxyType = type(type.__dict__)\nWrapperDescriptorType = type(object.__init__)\nMethodWrapperType = type(object().__str__)\nMethodDescriptorType = type(str.join)\nClassMethodDescriptorType = type(dict.__dict__[\'fromkeys\'])\n\nNoneType = type(None)\nTypeType = type\nObjectType = object\nIntType = int\ntry:\n LongType = long\nexcept: pass\nFloatType = float\nBooleanType = bool\ntry:\n ComplexType = complex\nexcept NameError:\n pass\nStringType = str\n\n# StringTypes is already outdated. Instead of writing "type(x) in\n# types.StringTypes", you should use "isinstance(x, basestring)". But\n# we keep around for compatibility with Python 2.2.\ntry:\n UnicodeType = unicode\n StringTypes = (StringType, UnicodeType)\nexcept NameError:\n StringTypes = (StringType,)\n\nBufferType = buffer\n\nTupleType = tuple\nListType = list\nDictType = DictionaryType = dict\n\ndef _f(): pass\nFunctionType = type(_f)\nLambdaType = type(lambda: None) # Same as FunctionType\n#CodeType = type(_f.func_code)\n\ndef _g():\n yield 1\nGeneratorType = type(_g())\n\nclass _C:\n def _m(self): pass\nClassType = type(_C)\nUnboundMethodType = type(_C._m) # Same as MethodType\n_x = _C()\nInstanceType = type(_x)\nMethodType = type(_x._m)\nBuiltinFunctionType = type(len)\nBuiltinMethodType = type([].append) # Same as BuiltinFunctionType\n\nModuleType = type(sys)\nFileType = file\ntry:\n XRangeType = xrange\nexcept NameError:\n pass\n\n# try:\n# raise TypeError\n# except TypeError:\n# tb = sys.exc_info()[2]\n# TracebackType = type(tb)\n# FrameType = type(tb.tb_frame)\n# del tb\n\nSliceType = slice\nEllipsisType = type(Ellipsis)\n\n# DictProxyType = type(TypeType.__dict__)\nNotImplementedType = type(NotImplemented)\n\n# For Jython, the following two types are identical\n# GetSetDescriptorType = type(FunctionType.func_code)\n# MemberDescriptorType = type(FunctionType.func_globals)\n\ndel sys, _f, _g, _C, _x # Not for export\n__all__ = list(n for n in globals() if n[:1] != \'_\')\n\nGenericAlias = type(type[int])',"src/lib/unittest/gui.py":"import document\nfrom unittest import TestCase\n\nclass TestCaseGui(TestCase):\n def __init__(self):\n TestCase.__init__(self)\n self.divid = document.currentDiv()\n self.mydiv = document.getElementById(self.divid)\n res = document.getElementById(self.divid+'_unit_results')\n if res:\n self.resdiv = res\n res.innerHTML = ''\n else:\n self.resdiv = document.createElement('div')\n self.resdiv.setAttribute('id',self.divid+'_unit_results')\n self.resdiv.setAttribute('class','unittest-results')\n self.mydiv.appendChild(self.resdiv)\n\n\n def main(self):\n t = document.createElement('table')\n self.resTable = t\n self.resdiv.appendChild(self.resTable)\n\n headers = ['Result','Actual Value','Expected Value','Notes']\n row = document.createElement('tr')\n for item in headers:\n head = document.createElement('th')\n head.setAttribute('class','ac-feedback')\n head.innerHTML = item\n head.setCSS('text-align','center')\n row.appendChild(head)\n self.resTable.appendChild(row)\n\n for func in self.tlist:\n try:\n self.setUp()\n func()\n self.tearDown()\n except Exception as e:\n self.appendResult('Error', None, None, e)\n self.numFailed += 1\n self.showSummary()\n\n def appendResult(self,res,actual,expected,param):\n trimActual = False\n if len(str(actual)) > 15:\n trimActual = True\n actualType = type(actual)\n trimExpected = False\n if len(str(expected)) > 15:\n trimExpected = True\n expectedType = type(expected)\n row = document.createElement('tr')\n err = False\n if res == 'Error':\n err = True\n msg = 'Error: %s' % param\n errorData = document.createElement('td')\n errorData.setAttribute('class','ac-feedback')\n errorData.innerHTML = 'ERROR'\n errorData.setCSS('background-color','#de8e96')\n errorData.setCSS('text-align','center')\n row.appendChild(errorData)\n elif res:\n passed = document.createElement('td')\n passed.setAttribute('class','ac-feedback')\n passed.innerHTML = 'Pass'\n passed.setCSS('background-color','#83d382')\n passed.setCSS('text-align','center')\n row.appendChild(passed)\n self.numPassed += 1\n else:\n fail = document.createElement('td')\n fail.setAttribute('class','ac-feedback')\n fail.innerHTML = 'Fail'\n fail.setCSS('background-color','#de8e96')\n fail.setCSS('text-align','center')\n row.appendChild(fail)\n self.numFailed += 1\n\n\n act = document.createElement('td')\n act.setAttribute('class','ac-feedback')\n if trimActual:\n actHTML = str(actual)[:5] + \"...\" + str(actual)[-5:]\n if actualType == str:\n actHTML = repr(actHTML)\n act.innerHTML = actHTML\n else:\n act.innerHTML = repr(actual)\n act.setCSS('text-align','center')\n row.appendChild(act)\n\n expect = document.createElement('td')\n expect.setAttribute('class','ac-feedback')\n\n if trimExpected:\n expectedHTML = str(expected)[:5] + \"...\" + str(expected)[-5:]\n if expectedType == str:\n expectedHTML = repr(expectedHTML)\n expect.innerHTML = expectedHTML\n else:\n expect.innerHTML = repr(expected)\n expect.setCSS('text-align','center')\n row.appendChild(expect)\n inp = document.createElement('td')\n inp.setAttribute('class','ac-feedback')\n\n if err:\n inp.innerHTML = msg\n else:\n inp.innerHTML = param\n inp.setCSS('text-align','center')\n row.appendChild(inp)\n self.resTable.appendChild(row)\n\n\n def showSummary(self):\n pct = self.numPassed / (self.numPassed+self.numFailed) * 100\n pTag = document.createElement('p')\n pTag.innerHTML = \"You passed: \" + str(pct) + \"% of the tests\"\n self.resdiv.appendChild(pTag)\n","src/lib/unittest/__init__.py":'__author__ = \'bmiller\'\n\'\'\'\nThis is the start of something that behaves like\nthe unittest module from cpython.\n\n\'\'\'\nimport re\n\nclass _AssertRaisesContext(object):\n """A context manager used to implement TestCase.assertRaises* methods."""\n def __init__(self, expected, test_case):\n self.test_case = test_case\n self.expected = expected\n self.exception = None\n\n def _is_subtype(self, expected, basetype):\n if isinstance(expected, tuple):\n return all(self._is_subtype(e, basetype) for e in expected)\n return isinstance(expected, type) and issubclass(expected, basetype)\n\n def handle(self, args, kwargs):\n """\n If args is empty, assertRaises is being used as a\n context manager, so return self.\n If args is not empty, call a callable passing positional and keyword\n arguments.\n """\n try:\n if not self._is_subtype(self.expected, BaseException):\n raise TypeError(\'assertRaises() arg 1 must be an exception type or tuple of exception types\')\n if not args:\n return self\n\n callable_obj = args[0]\n args = args[1:]\n with self:\n callable_obj(*args, **kwargs) \n\n finally:\n # bpo-23890: manually break a reference cycle\n self = None\n\n def __enter__(self):\n return self\n\n def __exit__(self, exc_type, exc_value, tb):\n res = True\n feedback = ""\n self.exception = exc_value\n try:\n act_exc = exc_type.__name__\n except AttributeError:\n act_exc = str(exc_type)\n try:\n exp_exc = self.expected.__name__\n except AttributeError:\n exp_exc = str(self.expected)\n\n if exc_type is None:\n res = False\n feedback = "{} not raised".format(exp_exc)\n elif not issubclass(exc_type, self.expected):\n res = False\n feedback = "Expected {} but got {}".format(exp_exc, act_exc)\n\n self.test_case.appendResult(res, act_exc, exp_exc, feedback)\n return True\n\n\nclass TestCase(object):\n def __init__(self):\n self.numPassed = 0\n self.numFailed = 0\n self.assertPassed = 0\n self.assertFailed = 0\n self.verbosity = 1\n self.tlist = []\n testNames = {}\n for name in dir(self):\n if name[:4] == \'test\' and name not in testNames:\n self.tlist.append(getattr(self,name))\n testNames[name]=True\n\n def setUp(self):\n pass\n\n def tearDown(self):\n pass\n \n def cleanName(self,funcName):\n return funcName.__func__.__name__\n\n def main(self):\n\n for func in self.tlist:\n if self.verbosity > 1:\n print(\'Running %s\' % self.cleanName(func))\n try:\n self.setUp()\n self.assertPassed = 0\n self.assertFailed = 0\n func()\n self.tearDown()\n if self.assertFailed == 0:\n self.numPassed += 1\n else:\n self.numFailed += 1\n print(\'Tests failed in %s \' % self.cleanName(func))\n except Exception as e:\n self.assertFailed += 1\n self.numFailed += 1\n print(\'Test threw exception in %s (%s)\' % (self.cleanName(func), e))\n self.showSummary()\n\n def assertEqual(self, actual, expected, feedback=""):\n res = actual==expected\n if not res and feedback == "":\n feedback = "Expected %s to equal %s" % (str(actual),str(expected))\n self.appendResult(res, actual ,expected, feedback)\n\n def assertNotEqual(self, actual, expected, feedback=""):\n res = actual != expected\n if not res and feedback == "":\n feedback = "Expected %s to not equal %s" % (str(actual),str(expected))\n self.appendResult(res, actual, expected, feedback)\n\n def assertTrue(self,x, feedback=""):\n res = bool(x) is True\n if not res and feedback == "":\n feedback = "Expected %s to be True" % (str(x))\n self.appendResult(res, x, True, feedback)\n\n def assertFalse(self,x, feedback=""):\n res = not bool(x)\n if not res and feedback == "":\n feedback = "Expected %s to be False" % (str(x))\n self.appendResult(res, x, False, feedback)\n\n def assertIs(self,a,b, feedback=""):\n res = a is b\n if not res and feedback == "":\n feedback = "Expected %s to be the same object as %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertIsNot(self,a,b, feedback=""):\n res = a is not b\n if not res and feedback == "":\n feedback = "Expected %s to not be the same object as %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertIsNone(self,x, feedback=""):\n res = x is None\n if not res and feedback == "":\n feedback = "Expected %s to be None" % (str(x))\n self.appendResult(res, x, None, feedback)\n\n def assertIsNotNone(self,x, feedback=""):\n res = x is not None\n if not res and feedback == "":\n feedback = "Expected %s to not be None" % (str(x))\n self.appendResult(res, x, None, feedback)\n\n def assertIn(self, a, b, feedback=""):\n res = a in b\n if not res and feedback == "":\n feedback = "Expected %s to be in %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertNotIn(self, a, b, feedback=""):\n res = a not in b\n if not res and feedback == "":\n feedback = "Expected %s to not be in %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertIsInstance(self,a,b, feedback=""):\n res = isinstance(a,b)\n if not res and feedback == "":\n feedback = "Expected %s to be an instance of %s" % (str(a), str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertNotIsInstance(self,a,b, feedback=""):\n res = not isinstance(a,b)\n if not res and feedback == "":\n feedback = "Expected %s to not be an instance of %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertRegex(self, text, expected_regex, feedback=""):\n """Fail the test unless the text matches the regular expression."""\n if isinstance(expected_regex, (str, )): #bytes\n assert expected_regex, "expected_regex must not be empty."\n expected_regex = re.compile(expected_regex)\n if not expected_regex.search(text):\n res = False\n if feedback == "":\n feedback = "Regex didn\'t match: %r not found in %r" % (\n repr(expected_regex), text)\n else:\n res = True\n self.appendResult(res, text, expected_regex, feedback)\n\n def assertNotRegex(self, text, unexpected_regex, feedback=""):\n """Fail the test if the text matches the regular expression."""\n if isinstance(unexpected_regex, (str, )): # bytes\n unexpected_regex = re.compile(unexpected_regex)\n match = unexpected_regex.search(text)\n if match:\n feedback = \'Regex matched: %r matches %r in %r\' % (\n text[match.start() : match.end()],\n repr(unexpected_regex),\n text)\n # _formatMessage ensures the longMessage option is respected\n self.appendResult(not bool(match), text, unexpected_regex, feedback)\n\n def assertAlmostEqual(self, a, b, places=7, feedback="", delta=None):\n\n if delta is not None:\n res = abs(a-b) <= delta\n else:\n if places is None:\n places = 7\n res = round(a-b, places) == 0\n \n if not res and feedback == "":\n feedback = "Expected %s to equal %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertNotAlmostEqual(self, a, b, places=7, feedback="", delta=None):\n\n if delta is not None:\n res = not (a == b) and abs(a - b) > delta\n else:\n if places is None:\n places = 7\n\n res = round(a-b, places) != 0\n\n if not res and feedback == "":\n feedback = "Expected %s to not equal %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertGreater(self,a,b, feedback=""):\n res = a > b\n if not res and feedback == "":\n feedback = "Expected %s to be greater than %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertGreaterEqual(self,a,b, feedback=""):\n res = a >= b\n if not res and feedback == "":\n feedback = "Expected %s to be >= %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertLess(self, a, b, feedback=""):\n res = a < b\n if not res and feedback == "":\n feedback = "Expected %s to be less than %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertLessEqual(self,a,b, feedback=""):\n res = a <= b\n if not res and feedback == "":\n feedback = "Expected %s to be <= %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def appendResult(self,res,actual,expected,feedback):\n if res:\n msg = \'Pass\'\n self.assertPassed += 1\n else:\n msg = \'Fail: \' + feedback\n print(msg)\n self.assertFailed += 1\n\n def assertRaises(self, expected_exception, *args, **kwargs):\n context = _AssertRaisesContext(expected_exception, self)\n try:\n return context.handle(args, kwargs)\n finally:\n # bpo-23890: manually break a reference cycle\n context = None\n\n def fail(self, msg=None):\n if msg is None:\n msg = \'Fail\'\n else:\n msg = \'Fail: \' + msg\n print(msg)\n self.assertFailed += 1\n\n def showSummary(self):\n # don\'t divde by zero\n # pct = self.numPassed / (self.numPassed+self.numFailed) * 100\n print("Ran %d tests, passed: %d failed: %d\\n" % (self.numPassed+self.numFailed,\n self.numPassed, self.numFailed))\n\n\n\ndef main(verbosity=1):\n glob = globals() # globals() still needs work\n for name in glob:\n if type(glob[name]) == type and issubclass(glob[name], TestCase):\n try:\n tc = glob[name]()\n tc.verbosity = verbosity\n tc.main()\n except:\n print("Uncaught Error in: ", name)\n',"src/lib/urllib2.py":'import _sk_fail; _sk_fail._("urllib2")\n',"src/lib/urlparse.py":'import _sk_fail; _sk_fail._("urlparse")\n',"src/lib/user.py":'import _sk_fail; _sk_fail._("user")\n',"src/lib/UserDict.py":'import _sk_fail; _sk_fail._("UserDict")\n',"src/lib/UserList.py":'import _sk_fail; _sk_fail._("UserList")\n',"src/lib/UserString.py":'import _sk_fail; _sk_fail._("UserString")\n',"src/lib/uu.py":'import _sk_fail; _sk_fail._("uu")\n',"src/lib/warnings.py":'import _sk_fail; _sk_fail._("warnings")\n',"src/lib/wave.py":'import _sk_fail; _sk_fail._("wave")\n',"src/lib/weakref.py":'import _sk_fail; _sk_fail._("weakref")\n',"src/lib/whichdb.py":'import _sk_fail; _sk_fail._("whichdb")\n',"src/lib/wsgiref/__init__.py":'import _sk_fail; _sk_fail._("wsgiref")\n',"src/lib/xdrlib.py":'import _sk_fail; _sk_fail._("xdrlib")\n',"src/lib/xml/dom/__init__.py":'import _sk_fail; _sk_fail._("dom")\n',"src/lib/xml/etree/__init__.py":'import _sk_fail; _sk_fail._("etree")\n',"src/lib/xml/parsers/__init__.py":'import _sk_fail; _sk_fail._("parsers")\n',"src/lib/xml/sax/__init__.py":'import _sk_fail; _sk_fail._("sax")\n',"src/lib/xml/__init__.py":'import _sk_fail; _sk_fail._("xml")\n',"src/lib/xmllib.py":'import _sk_fail; _sk_fail._("xmllib")\n',"src/lib/xmlrpclib.py":'import _sk_fail; _sk_fail._("xmlrpclib")\n',"src/lib/zipfile.py":'import _sk_fail; _sk_fail._("zipfile")\n',"src/lib/_abcoll.py":'import _sk_fail; _sk_fail._("_abcoll")\n',"src/lib/_LWPCookieJar.py":'import _sk_fail; _sk_fail._("_LWPCookieJar")\n',"src/lib/_MozillaCookieJar.py":'import _sk_fail; _sk_fail._("_MozillaCookieJar")\n',"src/lib/_sk_fail.py":'class NotImplementedImportError(ImportError, NotImplementedError): pass\n\ndef _(name):\n msg = "{} is not yet implemented in Skulpt".format(name)\n raise NotImplementedImportError(msg, name=name)\n',"src/lib/_threading_local.py":'import _sk_fail; _sk_fail._("_threading_local")\n',"src/lib/__future__.py":'import _sk_fail;_sk_fail._("__future__")\n',"src/lib/__phello__.foo.py":'import _sk_fail; _sk_fail._("__phello__.foo")\n',"src/builtin/sys.js":'var $builtinmodule=function(i){var t,n={},e=[],u=Sk.getSysArgv();for(t=0;tnew Sk.builtin.str("utf-8"))),n.getExecutionLimit=new Sk.builtin.func((function(){return null===Sk.execLimit?Sk.builtin.none.none$:new Sk.builtin.int_(Sk.execLimit)})),n.setExecutionLimit=new Sk.builtin.func((function(i){if(null===Sk.execLimit)throw new Sk.builtin.NotImplementedError("Execution limiting is not enabled");void 0!==i&&(Sk.execLimit=Sk.builtin.asnum$(i))})),n.resetTimeout=new Sk.builtin.func((function(){Sk.execStart=new Date})),n.getYieldLimit=new Sk.builtin.func((function(){return null===Sk.yieldLimit?Sk.builtin.none.none$:new Sk.builtin.int_(Sk.yieldLimit)})),n.setYieldLimit=new Sk.builtin.func((function(i){if(null===Sk.yieldLimit)throw new Sk.builtin.NotImplementedError("Yielding is not enabled");void 0!==i&&(Sk.yieldLimit=Sk.builtin.asnum$(i))})),n.debug=new Sk.builtin.func((function(){return Sk.builtin.none.none$}));const o=Sk.builtin.make_structseq("sys","float_info",{max:"DBL_MAX -- maximum representable finite float",max_exp:"DBL_MAX_EXP -- maximum int e such that radix**(e-1) is representable",max_10_exp:"DBL_MAX_10_EXP -- maximum int e such that 10**e is representable",min:"DBL_MIN -- Minimum positive normalized float",min_exp:"DBL_MIN_EXP -- minimum int e such that radix**(e-1) is a normalized float",min_10_exp:"DBL_MIN_10_EXP -- minimum int e such that 10**e is a normalized",dig:"DBL_DIG -- digits",mant_dig:"DBL_MANT_DIG -- mantissa digits",epsilon:"DBL_EPSILON -- Difference between 1 and the next representable float",radix:"FLT_RADIX -- radix of exponent",rounds:"FLT_ROUNDS -- rounding mode"});n.float_info=new o([Number.MAX_VALUE,Math.floor(Math.log2(Number.MAX_VALUE)),Math.floor(Math.log10(Number.MAX_VALUE)),Number.MIN_VALUE,Math.ceil(Math.log2(Number.MIN_VALUE)),Math.ceil(Math.log10(Number.MIN_VALUE)),15,Math.log2(Number.MAX_SAFE_INTEGER),Number.EPSILON,2,1].map((i=>Sk.ffi.remapToPy(i))));const s=Sk.builtin.make_structseq("sys","int_info",{bits_per_digit:"size of a digit in bits",sizeof_digit:"size in bytes of the C type used to represent a digit"});n.int_info=new s([30,4].map((i=>Sk.ffi.remapToPy(i))));const l=Sk.builtin.make_structseq("sys","hash_info",{width:"width of the type used for hashing, in bits",modulus:"prime number giving the modulus on which the hash function is based",inf:"value to be used for hash of a positive infinity",nan:"value to be used for hash of a nan",imag:"multiplier used for the imaginary part of a complex number",algorithm:"name of the algorithm for hashing of str, bytes and memoryviews",hash_bits:"internal output size of hash algorithm",seed_bits:"seed size of hash algorithm",cutoff:"small string optimization cutoff"});return n.hash_info=new l([32,536870911,314159,0,1000003,"siphash24",32,128,0].map((i=>Sk.ffi.remapToPy(i)))),n.__stdout__=new Sk.builtin.file(new Sk.builtin.str("/dev/stdout"),new Sk.builtin.str("w")),n.__stdin__=new Sk.builtin.file(new Sk.builtin.str("/dev/stdin"),new Sk.builtin.str("r")),n.stdout=n.__stdout__,n.stdin=n.__stdin__,n};',"src/lib/array.js":'function $builtinmodule(e){var n={},t=["c","b","B","u","h","H","i","I","l","L","f","d"];return n.__name__=new Sk.builtin.str("array"),n.array=Sk.misceval.buildClass(n,(function(e,n){n.__init__=new Sk.builtin.func((function(e,n,i){if(Sk.builtin.pyCheckArgsLen("__init__",arguments.length,2,3),-1==t.indexOf(Sk.ffi.remapToJs(n)))throw new Sk.builtin.ValueError("bad typecode (must be c, b, B, u, h, H, i, I, l, L, f or d)");if(i&&!Sk.builtin.checkIterable(i))throw new Sk.builtin.TypeError("iteration over non-sequence");if(e.$d.mp$ass_subscript(new Sk.builtin.str("typecode"),n),e.$d.mp$ass_subscript(new Sk.builtin.str("__module__"),new Sk.builtin.str("array")),e.typecode=n,void 0===i)e.internalIterable=new Sk.builtin.list;else if(i instanceof Sk.builtin.list)e.internalIterable=i;else{e.internalIterable=new Sk.builtin.list;for(let n=Sk.abstr.iter(i),t=n.tp$iternext();void 0!==t;t=n.tp$iternext())Sk.misceval.callsimArray(e.internalIterable.append,[e.internalIterable,t])}})),n.__repr__=new Sk.builtin.func((function(e){var n=Sk.ffi.remapToJs(e.typecode),t="";return Sk.ffi.remapToJs(e.internalIterable).length&&(t="c"==Sk.ffi.remapToJs(e.typecode)?", \'"+Sk.ffi.remapToJs(e.internalIterable).join("")+"\'":", "+Sk.ffi.remapToJs(Sk.misceval.callsimArray(e.internalIterable.__repr__,[e.internalIterable]))),new Sk.builtin.str("array(\'"+n+"\'"+t+")")})),n.__str__=n.__repr__,n.__getattribute__=new Sk.builtin.func((function(e,n){return e.tp$getattr(n)})),n.append=new Sk.builtin.func((function(e,n){return Sk.misceval.callsimArray(e.internalIterable.append,[e.internalIterable,n]),Sk.builtin.none.none$})),n.extend=new Sk.builtin.func((function(e,n){if(Sk.builtin.pyCheckArgsLen("__init__",arguments.length,2,2),!Sk.builtin.checkIterable(n))throw new Sk.builtin.TypeError("iteration over non-sequence");for(let t=Sk.abstr.iter(n),i=t.tp$iternext();void 0!==i;i=t.tp$iternext())Sk.misceval.callsimArray(e.internalIterable.append,[e.internalIterable,i])}))}),"array",[]),n}',"src/lib/calendar.js":'function $builtinmodule(e){const t={},{misceval:{chain:n},importModule:r}=Sk,importOrSuspend=e=>r(e,!1,!0);return n(importOrSuspend("datetime"),(e=>(t.datetime=e,importOrSuspend("itertools"))),(e=>(t.iterRepeat=e.$d.repeat,t.iterChain=e.$d.chain,calendarModule(t))))}function calendarModule(e){const{abstr:{setUpModuleMethods:t,numberBinOp:n,iter:r,objectGetItem:o},builtin:{bool:s,bool:{true$:m,false$:d},func:l,int_:i,list:c,none:{none$:f},str:h,slice:w,tuple:y,range:u,max:_,min:g,property:k,print:p,enumerate:$,ValueError:b},ffi:{remapToPy:M},misceval:{isTrue:T,iterator:C,arrayFromIterable:O,buildClass:L,richCompareBool:x,asIndexOrThrow:F,objectRepr:I,callsimArray:A},global:v,global:{strftime:E}}=Sk,S=new i(0),H=new i(1),D=new i(2),N=new i(3),R=new i(6),j=new i(7),J=new i(9),P=new i(12),Y=new i(13),U=new i(24),z=new i(60),le=(e,t)=>x(e,t,"LtE"),eq=(e,t)=>x(e,t,"Eq"),mod=(e,t)=>n(e,t,"Mod"),add=(e,t)=>n(e,t,"Add"),sub=(e,t)=>n(e,t,"Sub"),mul=(e,t)=>n(e,t,"Mult"),inc=e=>add(e,H),dec=e=>sub(e,H),mod7=e=>mod(e,j),getA=(e,t)=>e.tp$getattr(new h(t)),callA=(e,t,...n)=>A(e.tp$getattr(new h(t)),n);function*iterJs(e){const t=r(e);let n;for(;n=t.tp$iternext();)yield n}function iterFn(e,t){return e=r(e),new C((()=>{const n=e.tp$iternext();return n&&t(n)}),!0)}function makePyMethod(e,t,{args:n,name:r,doc:o,defaults:s}){t.co_varnames=["self",...n||[]],t.co_docstring=o?new h(o):f,s&&(t.$defaults=s),t.co_name=new h(r),t.co_qualname=new h(e+"."+r);const m=new l(t);return m.$module=Q.__name__,m}const{datetime:B,iterRepeat:W,iterChain:q}=e;let{MINYEAR:G,MAXYEAR:X,date:V}=B.$d;const K=getA(h,"center"),pyCenter=(e,t)=>A(K,[e,t]),pyRStrip=e=>new h(e.toString().trimRight());G=G.valueOf(),X=X.valueOf();const Q={__name__:new h("calendar"),__all__:M(["IllegalMonthError","IllegalWeekdayError","setfirstweekday","firstweekday","isleap","leapdays","weekday","monthrange","monthcalendar","prmonth","month","prcal","calendar","timegm","month_name","month_abbr","day_name","day_abbr","Calendar","TextCalendar","HTMLCalendar","LocaleTextCalendar","LocaleHTMLCalendar","weekheader"])};function makeErr(e,t){return L(Q,((e,n)=>{n.__init__=new l((function __init__(e,t){e.$attr=t})),n.__str__=new l((function __str__(e){return new h(t.replace("$",I(e.$attr)))}))}),e,[b])}const Z=makeErr("IllegalMonthError","bad month $; must be 1-12"),ee=makeErr("IllegalWeekdayError","bad weekday number $; must be 0 (Monday) to 6 (Sunday)"),te=1,ae=2,ne=[0,31,28,31,30,31,30,31,31,30,31,30,31];function mkLocalizedCls(e,t){t.__init__=new l((function __init__(e,t){e.format=t})),t.__getitem__=new l((function __getitem__(t,n){const r=o(e,n);if(n instanceof w){const e=[];for(const n of r.valueOf())e.push(A(n,[t.format]));return new c(e)}return A(r,[t.format])}));const n=new i(e.valueOf().length);t.__len__=new l((function __len__(e){return n}))}const re=new h("strftime"),oe=L(Q,((e,t)=>{let n=[new l((e=>h.$empty))];for(let r=0;r<12;r++){const e=new V(2001,r+1,1);n.push(e.tp$getattr(re))}n=new c(n),t._months=n,mkLocalizedCls(n,t)}),"_localized_month"),se=L(Q,((e,t)=>{let n=[];for(let r=0;r<7;r++){const e=new V(2001,1,r+1);n.push(e.tp$getattr(re))}n=new c(n),t._days=n,mkLocalizedCls(n,t)}),"_localized_day"),me=A(se,[new h("%A")]),de=A(se,[new h("%a")]),ie=A(oe,[new h("%B")]),ce=A(oe,[new h("%b")]),[fe,he,we,ye,ue,_e,ge]=[0,1,2,3,4,5,6];function isleap(e){return(e=F(e))%4==0&&(e%100!=0||e%400==0)}function weekday(e,t,n){e=F(e),G<=e&&e<=X||(e=2e3+e%400);const r=A(V,[new i(e),t,n]);return callA(V,"weekday",r)}function monthrange(e,t){if(!le(H,t)||!le(t,P))throw A(Z,[t]);const n=weekday(e,t,H);t=F(t);const r=ne[t]+Number(t===ae&&isleap(e));return[n,new i(r)]}function iterweekdays(e){return iterFn(A(u,[e.fwd,add(e.fwd,j)]),mod7)}function itermonthdates(e,t,n){return iterFn(itermonthdays3(e,t,n),(e=>A(V,e.valueOf())))}function itermonthdays(e,t,n){const[r,o]=monthrange(t,n),s=mod7(sub(r,e.fwd)),m=A(W,[S,s]),d=A(u,[H,inc(o)]),l=mod7(sub(e.fwd,add(r,o))),i=A(W,[S,l]);return A(q,[m,d,i])}function itermonthdays2(e,t,n){return iterFn(A($,[itermonthdays(e,t,n),e.fwd]),(e=>{const[t,n]=e.valueOf();return new y([n,mod7(t)])}))}function itermonthdays3(e,t,n){const ymdIter=(e,t,n)=>iterFn(n,(n=>new y([e,t,n]))),[r,o]=monthrange(t,n),s=mod7(sub(r,e.fwd)),m=mod7(sub(e.fwd,add(r,o))),[d,l]=function _prevmonth(e,t){return eq(t,H)?[dec(e),P]:[e,dec(t)]}(t,n),c=inc(function _monthlen(e,t){return t=F(t),new i(ne[t]+Number(t===ae&&isleap(e)))}(d,l)),f=A(u,[sub(c,s),c]),h=A(u,[H,inc(o)]),[w,_]=function _nextmonth(e,t){return eq(t,P)?[inc(e),H]:[e,inc(t)]}(t,n),g=A(u,[H,inc(m)]);return A(q,[ymdIter(d,l,f),ymdIter(t,n,h),ymdIter(w,_,g)])}function itermonthdays4(e,t,n){const r=itermonthdays3(e,t,n);let o=0;return iterFn(r,(t=>new y([...t.valueOf(),mod7(add(e.fwd,new i(o++)))])))}function _monthIter(e,t,n,r){const o=O(e(t,n,r)),s=[];for(let m=0;m{const n=makePyMethod.bind(null,"Calendar"),r=["firstweekday"],o=["year","month"],s=["year","width"],m={__init__:n((function __init__(e,t){return Object.defineProperty(e,"fwd",{get(){return mod7(this._fwd)},set(e){return this._fwd=e,!0}}),e.fwd=t,f}),{name:"__init__",args:r,defaults:[S]}),getfirstweekday:n((function getfirstweekday(e){return e.fwd}),{name:"getfirstweekday"}),setfirstweekday:n((function setfirstweekday(e,t){return e.fwd=t,f}),{name:"setfirstweekday",args:r}),iterweekdays:n(iterweekdays,{name:"iterweekdays"}),itermonthdates:n(itermonthdates,{name:"itermonthdates",args:o}),itermonthdays:n(itermonthdays,{name:"itermonthdays",args:o}),itermonthdays2:n(itermonthdays2,{name:"itermonthdays2",args:o}),itermonthdays3:n(itermonthdays3,{name:"itermonthdays3",args:o}),itermonthdays4:n(itermonthdays4,{name:"itermonthdays4",args:o}),monthdatescalendar:n(monthdatescalendar,{name:"monthdatescalendar",args:o}),monthdays2calendar:n(monthdays2calendar,{name:"monthdays2calendar",args:o}),monthdayscalendar:n(monthdayscalendar,{name:"monthdayscalendar",args:o}),yeardatescalendar:n(yeardatescalendar,{name:"yeardatescalendar",args:s,defaults:[N]}),yeardays2calendar:n(yeardays2calendar,{name:"yeardays2calendar",args:s,defaults:[N]}),yeardayscalendar:n(yeardayscalendar,{name:"yeardayscalendar",args:s,defaults:[N]})};m.firstweekday=new k(m.getfirstweekday,m.setfirstweekday),Object.assign(t,m)}),"Calendar");function doTextFormatweekday(e,t,n){let r;return r=x(n,J,"GtE")?me:de,pyCenter(o(o(r,t),new w(f,n)),n)}function doTextFormatmonthname(e,t,n,r,s=!0){let m=o(ie,n);return T(s)&&(m=mod(new h("%s %r"),new y([m,t]))),pyCenter(m,r)}const pe=L(Q,((e,t)=>{const txtPrint=e=>p([e],["end",h.$empty]);const n=doTextFormatweekday;function formatweekheader(e,t){const n=[];for(const r of iterJs(iterweekdays(e)))n.push(callA(e,"formatweekday",r,t).toString());return new h(n.join(" "))}const r=doTextFormatmonthname;const o=makePyMethod.bind(null,"TextCalendar"),s={prweek:o((function prweek(e,t,n){txtPrint(callA(e,"formatweek",t,n))}),{name:"prweek",args:["theweek","width"]}),formatday:o((function formatday(e,t,n,r){let o;return o=eq(t,S)?h.$empty:mod(new h("%2i"),t),pyCenter(o,r)}),{name:"formatday",args:["day","weekday","width"]}),formatweek:o((function formatweek(e,t,n){const r=[];for(const o of iterJs(t)){const[t,s]=o.valueOf();r.push(callA(e,"formatday",t,s,n).toString())}return new h(r.join(" "))}),{name:"formatweek",args:["theweek","width"]}),formatweekday:o(n,{name:"formatweekday",args:["day","width"]}),formatweekheader:o(formatweekheader,{name:"formatweekheader",args:["width"]}),formatmonthname:o(r,{name:"formatmonthname",args:["theyear","themonth","width","withyear"],defaults:[m]}),prmonth:o((function prmonth(e,t,n,r,o){txtPrint(callA(e,"formatmonth",t,n,r,o))}),{name:"prmonth",args:["theyear","themonth","w","l"],defaults:[S,S]}),formatmonth:o((function formatmonth(e,t,n,r,o){const addNewLines=e=>new h(e+"\\n".repeat(o.valueOf()));r=_([D,r]),o=_([H,o]);let s=callA(e,"formatmonthname",t,n,dec(mul(j,inc(r))),!0);s=pyRStrip(s),s=addNewLines(s),s=add(s,pyRStrip(callA(e,"formatweekheader",r))),s=addNewLines(s);for(const m of iterJs(monthdays2calendar(e,t,n)))s=add(s,pyRStrip(callA(e,"formatweek",m,r))),s=addNewLines(s);return s}),{name:"formatmonth",args:["thyear","themonth","w","l"],defaults:[S,S]}),formatyear:o((function formatyear(e,t,n,r,o,s){n=_([D,n]),r=_([H,r]),o=_([D,o]);const m=dec(mul(inc(n),j));let d="";const a=e=>d+=e;a(pyRStrip(pyCenter(t.$r(),add(mul(m,s),mul(o,dec(s)))))),a("\\n".repeat(r));const l=formatweekheader(e,n);let f=0;for(const w of iterJs(yeardays2calendar(e,t,s))){const d=new i(f),y=inc(mul(s,d)),_=g([inc(mul(s,inc(d))),Y]),k=A(u,[y,_]);a("\\n".repeat(r));const p=iterFn(k,(n=>callA(e,"formatmonthname",t,n,m,!1)));a(pyRStrip(formatstring(p,m,o))),a("\\n".repeat(r));const $=iterFn(k,(e=>l));a(pyRStrip(formatstring($,m,o))),a("\\n".repeat(r));const b=Math.max(...w.valueOf().map((e=>e.valueOf().length)));for(let t=0;t=r.length?s.push(h.$empty):s.push(callA(e,"formatweek",r[t],n));a(pyRStrip(formatstring(new c(s),m,o))),a("\\n".repeat(r))}f++}return new h(d)}),{name:"formatyear",args:["theyear","w","l","c","m"],defaults:[D,H,R,N]}),pryear:o((function pryear(e,t,n,r,o,s){txtPrint(callA(e,"formatyear",t,n,r,o,s))}),{name:"pryear",args:["theyear","w","l","c","m"],defaults:[S,S,R,N]})};Object.assign(t,s)}),"TextCalendar",[ke]);function doHtmlFormatweekday(e,t){return new h(`${o(de,t)}`)}function doHtmlFormatmonthname(e,t,n,r=!0){let s=""+o(ie,n);return T(r)&&(s+=" "+t),new h(`${s}`)}const $e=L(Q,((e,t)=>{const n=M(["mon","tue","wed","thu","fri","sat","sun"]),r=n,s=new h("noday"),d=new h("month"),l=d,c=new h("year"),w=c,u=new h(\' \'),g=new h(\'%d\');const k=doHtmlFormatweekday;function formatweekheader(e){let t="";for(const n of iterJs(iterweekdays(e)))t+=callA(e,"formatweekday",n);return new h(`${t}`)}const p=doHtmlFormatmonthname;const $=makePyMethod.bind(null,"HTMLCalendar"),b={formatday:$((function formatday(e,t,n){return eq(t,S)?mod(u,getA(e,"cssclass_noday")):mod(g,new y([o(getA(e,"cssclasses"),n),t]))}),{name:"formatday",args:["day","weekday"]}),formatweek:$((function formatweek(e,t){let n="";for(const r of iterJs(t)){const[t,o]=r.valueOf();n+=callA(e,"formatday",t,o)}return new h(`${n}`)}),{name:"formatweek",args:["theweek"]}),formatweekday:$(k,{name:"formatweekday",args:["day"]}),formatweekheader:$(formatweekheader,{name:"formatweekheader"}),formatmonthname:$(p,{name:"formatmonthname",args:["theyear","themonth","withyear"],defaults:[m]}),formatmonth:$((function formatmonth(e,t,n,r=!0){let o="";const a=e=>o+=e+"\\n";a(``),a(callA(e,"formatmonthname",t,n,r)),a(formatweekheader(e));for(const s of iterJs(monthdays2calendar(e,t,n)))a(callA(e,"formatweek",s));return a("
"),new h(o)}),{name:"formatmonth",args:["thyear","themonth","withyear"],defaults:[m]}),formatyear:$((function formatyear(e,t,n){let r="";const a=e=>r+=e;n=_([n,H]).valueOf(),a(``),a("\\n"),a(``);for(let o=te;o");const r=Math.min(o+n,13);for(let n=o;n"),a(callA(e,"formatmonth",t,new i(n),!1)),a("");a("")}return a("
${t}
"),new h(r)}),{name:"formatyear",args:["theyear","width"],defaults:[N]}),formatyearpage:$((function formatyearpage(e,t,n=3,r="calendar.css",o=null){null!==o&&o!==f||(o=new h("utf-8"));let s="";const a=e=>s+=e;return a(`\\n`),a(\'\\n\'),a("\\n"),a("\\n"),a(`\\n`),r!==f&&a(`\\n`),a(`Calendar for ${t}\\n`),a("\\n"),a("\\n"),a(callA(e,"formatyear",t,n)),a("\\n"),a("\\n"),callA(h,"encode",new h(s),o,new h("ignore"))}),{name:"formatyearpage",args:["theyear","width","css","encoding"],defaults:[N,new h("calendar.css"),new h("utf-8")]}),cssclasses:n,cssclasses_weekday_head:r,cssclass_noday:s,cssclass_month_head:d,cssclass_month:l,cssclass_year_head:c,cssclass_year:w};Object.assign(t,b)}),"HTMLCalendar",[ke]);function withLocale(e,t){const n=E.localizeByIdentifier(e.toString());v.strftime=n;try{return t()}finally{v.strftime=E}}function localInit(e,t){T(t)||(t=new h("en_US")),e.locale=t}const be=L(Q,((e,t)=>{const n=makePyMethod.bind(null,"LocaleTextCalendar"),r={__init__:n((function __init__(e,t,n){return callA(pe,"__init__",e,t),localInit(e,n),f}),{name:"__init__",args:["firstweekday","locale"],defaults:[S,f]}),formatweekday:n((function formatweekday(e,t,n){return withLocale(e.locale,(()=>doTextFormatweekday(0,t,n)))}),{name:"formatweekday",args:["day","width"]}),formatmonthname:n((function formatmonthname(e,t,n,r,o){return withLocale(e.locale,(()=>doTextFormatmonthname(0,t,n,r,o)))}),{name:"formatmonthname",args:["theyear","themonth","width","withyear"],defaults:[m]})};Object.assign(t,r)}),"LocaleTextCalendar",[pe]),Me=L(Q,((e,t)=>{const n=makePyMethod.bind(null,"LocaleHTMLCalendar"),r={__init__:n((function __init__(e,t,n){return callA($e,"__init__",e,t),localInit(e,n),f}),{name:"__init__",args:["firstweekday","locale"],defaults:[S,f]}),formatweekday:n((function formatweekday(e,t){return withLocale(e.locale,(()=>doHtmlFormatweekday(e,t)))}),{name:"formatweekday",args:["day"]}),formatmonthname:n((function formatmonthname(e,t,n,r){return withLocale(e.locale,(()=>doHtmlFormatmonthname(e,t,n,r)))}),{name:"formatmonthname",args:["theyear","themonth","withyear"],defaults:[m]})};Object.assign(t,r)}),"LocaleHTMLCalendar",[$e]),Te=A(pe,[]);Object.assign(Q,{IllegalMonthError:Z,IllegalWeekdayError:ee,day_name:me,month_name:ie,day_abbr:de,month_abbr:ce,January:new i(te),February:new i(ae),mdays:M(ne),MONDAY:new i(fe),TUESDAY:new i(he),WEDNESDAY:new i(we),THURSDAY:new i(ye),FRIDAY:new i(ue),SATURDAY:new i(_e),SUNDAY:new i(ge),Calendar:ke,TextCalendar:pe,HTMLCalendar:$e,LocaleTextCalendar:be,LocaleHTMLCalendar:Me,c:Te,firstweekday:getA(Te,"getfirstweekday"),monthcalendar:getA(Te,"monthdayscalendar"),prweek:getA(Te,"prweek"),week:getA(Te,"formatweek"),weekheader:getA(Te,"formatweekheader"),prmonth:getA(Te,"prmonth"),month:getA(Te,"formatmonth"),calendar:getA(Te,"formatyear"),prcal:getA(Te,"pryear")});const Ce=new i(20),Oe=R;function formatstring(e,t,n){t||(t=Ce),n||(n=Oe),n=mul(n,new h(" "));const r=[];for(const o of iterJs(e))r.push(pyCenter(o,t).toString());return new h(r.join(n.toString()))}const Le=getA(V,"toordinal"),xe=A(Le,[new V(1970,1,1)]);return t("calendar",Q,{isleap:{$meth:e=>s(isleap(e)),$flags:{NamedArgs:["year"]},$doc:"Return True for leap years, False for non-leap years"},leapdays:{$meth(e,t){e=F(e)-1,t=F(t)-1;const n=Math.floor;return new i(n(t/4)-n(e/4)-(n(t/100)-n(e/100))+(n(t/400)-n(e/400)))},$flags:{MinArgs:2,MaxArgs:2}},weekday:{$meth:weekday,$flags:{NamedArgs:["year","month","day"]},$doc:"Return weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31)."},monthrange:{$meth:(e,t)=>new y(monthrange(e,t)),$flags:{NamedArgs:["year","month"]},$doc:"Return weekday (0-6 ~ Mon-Sun) and number of days (28-31) for year, month."},setfirstweekday:{$meth(e){const t=F(e);if(!(fe<=t&&t<=ge))throw A(ee,[e]);Te.fwd=e},$flags:{NamedArgs:["firstweekday"]}},format:{$meth:function format(e,t,n){return p([formatstring(e,t,n)]),f},$flags:{NamedArgs:["cols","colwidth","spacing"],Defaults:[Ce,Oe]}},formatstring:{$meth:formatstring,$flags:{NamedArgs:["cols","colwidth","spacing"],Defaults:[Ce,Oe]}},timegm:{$meth(e){const[t,n,r,o,s,m]=e.valueOf(),d=A(V,[t,n,H]),l=A(Le,[d]),i=add(sub(l,xe),dec(r)),c=add(mul(i,U),o),f=add(mul(c,z),s);return add(mul(f,z),m)},$flags:{OneArg:!0}}}),Q}',"src/lib/collections.js":'function $builtinmodule(t){const e={};return Sk.misceval.chain(Sk.importModule("keyword",!1,!0),(t=>(e._iskeyword=t.$d.iskeyword,Sk.importModule("itertools",!1,!0))),(t=>(e._chain=t.$d.chain,e._starmap=t.$d.starmap,e._repeat=t.$d.repeat,Sk.importModule("operator",!1,!0))),(t=>{e._itemgetter=t.$d.itemgetter}),(()=>collections_mod(e)))}function collections_mod(t){function counterNumberSlot(e){return function(i){if(void 0!==i&&!(i instanceof t.Counter))return Sk.builtin.NotImplemented.NotImplemented$;const s=new t.Counter;return e.call(this,s,i),s}}function counterInplaceSlot(t,e){return function(i){if(!(i instanceof Sk.builtin.dict))throw new Sk.builtin.TypeError("Counter "+t+"= "+Sk.abstr.typeName(i)+" is not supported");return e.call(this,i),this.keep$positive()}}t.__all__=new Sk.builtin.list(["deque","defaultdict","namedtuple","Counter","OrderedDict"].map((t=>new Sk.builtin.str(t)))),t.defaultdict=Sk.abstr.buildNativeClass("collections.defaultdict",{constructor:function defaultdict(t,e){this.default_factory=t,Sk.builtin.dict.call(this,e)},base:Sk.builtin.dict,methods:{copy:{$meth(){return this.$copy()},$flags:{NoArgs:!0}},__copy__:{$meth(){return this.$copy()},$flags:{NoArgs:!0}},__missing__:{$meth(t){if(Sk.builtin.checkNone(this.default_factory))throw new Sk.builtin.KeyError(Sk.misceval.objectRepr(t));{const e=Sk.misceval.callsimArray(this.default_factory,[]);return this.mp$ass_subscript(t,e),e}},$flags:{OneArg:!0}}},getsets:{default_factory:{$get(){return this.default_factory},$set(t){t=t||Sk.builtin.none.none$,this.default_factory=t}}},slots:{tp$doc:"defaultdict(default_factory[, ...]) --\\x3e dict with default factory\\n\\nThe default factory is called without arguments to produce\\na new value when a key is not present, in __getitem__ only.\\nA defaultdict compares equal to a dict with the same items.\\nAll remaining arguments are treated the same as if they were\\npassed to the dict constructor, including keyword arguments.\\n",tp$init(t,e){const i=t.shift();if(void 0===i)this.default_factory=Sk.builtin.none.none$;else{if(!Sk.builtin.checkCallable(i)&&!Sk.builtin.checkNone(i))throw new Sk.builtin.TypeError("first argument must be callable");this.default_factory=i}return Sk.builtin.dict.prototype.tp$init.call(this,t,e)},$r(){const t=Sk.misceval.objectRepr(this.default_factory),e=Sk.builtin.dict.prototype.$r.call(this).v;return new Sk.builtin.str("defaultdict("+t+", "+e+")")}},proto:{$copy(){const e=[];return Sk.misceval.iterFor(Sk.abstr.iter(this),(t=>{e.push(t),e.push(this.mp$subscript(t))})),new t.defaultdict(this.default_factory,e)}}}),t.Counter=Sk.abstr.buildNativeClass("Counter",{constructor:function Counter(){this.$d=new Sk.builtin.dict,Sk.builtin.dict.apply(this)},base:Sk.builtin.dict,methods:{elements:{$flags:{NoArgs:!0},$meth(){const e=t._chain.tp$getattr(new Sk.builtin.str("from_iterable")),i=t._starmap,s=t._repeat,n=Sk.misceval.callsimArray;return n(e,[n(i,[s,n(this.tp$getattr(this.str$items))])])}},most_common:{$flags:{NamedArgs:["n"],Defaults:[Sk.builtin.none.none$]},$meth(t){const e=this.sq$length();t=Sk.builtin.checkNone(t)||(t=Sk.misceval.asIndexOrThrow(t))>e?e:t<0?0:t;const i=this.$items().sort(((t,e)=>Sk.misceval.richCompareBool(t[1],e[1],"Lt")?1:Sk.misceval.richCompareBool(t[1],e[1],"Gt")?-1:0));return new Sk.builtin.list(i.slice(0,t).map((t=>new Sk.builtin.tuple(t))))}},update:{$flags:{FastCall:!0},$meth(t,e){return Sk.abstr.checkArgsLen("update",t,0,1),this.counter$update(t,e)}},subtract:{$flags:{FastCall:!0},$meth(t,e){Sk.abstr.checkArgsLen("subtract",t,0,1);const i=t[0];if(void 0!==i)if(i instanceof Sk.builtin.dict)for(let s=Sk.abstr.iter(i),n=s.tp$iternext();void 0!==n;n=s.tp$iternext()){const t=this.mp$subscript(n);this.mp$ass_subscript(n,Sk.abstr.numberBinOp(t,i.mp$subscript(n),"Sub"))}else for(let s=Sk.abstr.iter(i),n=s.tp$iternext();void 0!==n;n=s.tp$iternext()){const t=this.mp$subscript(n);this.mp$ass_subscript(n,Sk.abstr.numberBinOp(t,this.$one,"Sub"))}e=e||[];for(let s=0;s>> c = Counter(\'abcdeabcdabcaba\') # count elements from a string\\n\\n >>> c.most_common(3) # three most common elements\\n [(\'a\', 5), (\'b\', 4), (\'c\', 3)]\\n >>> sorted(c) # list all unique elements\\n [\'a\', \'b\', \'c\', \'d\', \'e\']\\n >>> \'\'.join(sorted(c.elements())) # list elements with repetitions\\n \'aaaaabbbbcccdde\'\\n >>> sum(c.values()) # total of all counts\\n 15\\n\\n >>> c[\'a\'] # count of letter \'a\'\\n 5\\n >>> for elem in \'shazam\': # update counts from an iterable\\n ... c[elem] += 1 # by adding 1 to each element\'s count\\n >>> c[\'a\'] # now there are seven \'a\'\\n 7\\n >>> del c[\'b\'] # remove all \'b\'\\n >>> c[\'b\'] # now there are zero \'b\'\\n 0\\n\\n >>> d = Counter(\'simsalabim\') # make another counter\\n >>> c.update(d) # add in the second counter\\n >>> c[\'a\'] # now there are nine \'a\'\\n 9\\n\\n >>> c.clear() # empty the counter\\n >>> c\\n Counter()\\n\\n Note: If a count is set to zero or reduced to zero, it will remain\\n in the counter until the entry is deleted or the counter is cleared:\\n\\n >>> c = Counter(\'aaabbc\')\\n >>> c[\'b\'] -= 2 # reduce the count of \'b\' by two\\n >>> c.most_common() # \'b\' is still in, but its count is zero\\n [(\'a\', 3), (\'c\', 1), (\'b\', 0)]\\n\\n",tp$init(t,e){return Sk.abstr.checkArgsLen(this.tpjs_name,t,0,1),this.counter$update(t,e)},$r(){const t=this.size>0?Sk.builtin.dict.prototype.$r.call(this).v:"";return new Sk.builtin.str(Sk.abstr.typeName(this)+"("+t+")")},tp$as_sequence_or_mapping:!0,mp$ass_subscript(t,e){return void 0===e?this.mp$lookup(t)&&Sk.builtin.dict.prototype.mp$ass_subscript.call(this,t,e):Sk.builtin.dict.prototype.mp$ass_subscript.call(this,t,e)},tp$as_number:!0,nb$positive:counterNumberSlot((function(t){this.$items().forEach((([e,i])=>{Sk.misceval.richCompareBool(i,this.$zero,"Gt")&&t.mp$ass_subscript(e,i)}))})),nb$negative:counterNumberSlot((function(t){this.$items().forEach((([e,i])=>{Sk.misceval.richCompareBool(i,this.$zero,"Lt")&&t.mp$ass_subscript(e,Sk.abstr.numberBinOp(this.$zero,i,"Sub"))}))})),nb$subtract:counterNumberSlot((function(t,e){this.$items().forEach((([i,s])=>{const n=Sk.abstr.numberBinOp(s,e.mp$subscript(i),"Sub");Sk.misceval.richCompareBool(n,this.$zero,"Gt")&&t.mp$ass_subscript(i,n)})),e.$items().forEach((([e,i])=>{void 0===this.mp$lookup(e)&&Sk.misceval.richCompareBool(i,this.$zero,"Lt")&&t.mp$ass_subscript(e,Sk.abstr.numberBinOp(this.$zero,i,"Sub"))}))})),nb$add:counterNumberSlot((function(t,e){this.$items().forEach((([i,s])=>{const n=Sk.abstr.numberBinOp(s,e.mp$subscript(i),"Add");Sk.misceval.richCompareBool(n,this.$zero,"Gt")&&t.mp$ass_subscript(i,n)})),e.$items().forEach((([e,i])=>{void 0===this.mp$lookup(e)&&Sk.misceval.richCompareBool(i,this.$zero,"Gt")&&t.mp$ass_subscript(e,i)}))})),nb$inplace_add:counterInplaceSlot("+",(function(t){t.$items().forEach((([t,e])=>{const i=Sk.abstr.numberInplaceBinOp(this.mp$subscript(t),e,"Add");this.mp$ass_subscript(t,i)}))})),nb$inplace_subtract:counterInplaceSlot("-",(function(t){t.$items().forEach((([t,e])=>{const i=Sk.abstr.numberInplaceBinOp(this.mp$subscript(t),e,"Sub");this.mp$ass_subscript(t,i)}))})),nb$or:counterNumberSlot((function(t,e){this.$items().forEach((([i,s])=>{const n=e.mp$subscript(i),r=Sk.misceval.richCompareBool(s,n,"Lt")?n:s;Sk.misceval.richCompareBool(r,this.$zero,"Gt")&&t.mp$ass_subscript(i,r)})),e.$items().forEach((([e,i])=>{void 0===this.mp$lookup(e)&&Sk.misceval.richCompareBool(i,this.$zero,"Gt")&&t.mp$ass_subscript(e,i)}))})),nb$and:counterNumberSlot((function(t,e){this.$items().forEach((([i,s])=>{const n=e.mp$subscript(i),r=Sk.misceval.richCompareBool(s,n,"Lt")?s:n;Sk.misceval.richCompareBool(r,this.$zero,"Gt")&&t.mp$ass_subscript(i,r)}))})),nb$inplace_and:counterInplaceSlot("&",(function(t){this.$items().forEach((([e,i])=>{const s=t.mp$subscript(e);Sk.misceval.richCompareBool(s,i,"Lt")&&this.mp$ass_subscript(e,s)}))})),nb$inplace_or:counterInplaceSlot("|",(function(t){t.$items().forEach((([t,e])=>{Sk.misceval.richCompareBool(e,this.mp$subscript(t),"Gt")&&this.mp$ass_subscript(t,e)}))})),nb$reflected_and:null,nb$reflected_or:null,nb$reflected_add:null,nb$reflected_subtract:null},proto:{keep$positive(){return this.$items().forEach((([t,e])=>{Sk.misceval.richCompareBool(e,this.$zero,"LtE")&&this.mp$ass_subscript(t)})),this},$zero:new Sk.builtin.int_(0),$one:new Sk.builtin.int_(1),str$items:new Sk.builtin.str("items"),counter$update(t,e){const i=t[0];if(void 0!==i)if(Sk.builtin.checkMapping(i))if(this.sq$length())for(let s=Sk.abstr.iter(i),n=s.tp$iternext();void 0!==n;n=s.tp$iternext()){const t=this.mp$subscript(n);this.mp$ass_subscript(n,Sk.abstr.numberBinOp(t,i.mp$subscript(n),"Add"))}else this.update$common(t,void 0,"update");else for(let s=Sk.abstr.iter(i),n=s.tp$iternext();void 0!==n;n=s.tp$iternext()){const t=this.mp$subscript(n);this.mp$ass_subscript(n,Sk.abstr.numberBinOp(t,this.$one,"Add"))}if(e&&e.length)if(this.sq$length())for(let s=0;s`(${Sk.misceval.objectRepr(t)}, ${Sk.misceval.objectRepr(e)})`));return t=0===t.length?"":"["+t.join(", ")+"]",this.in$repr=!1,new Sk.builtin.str(Sk.abstr.typeName(this)+"("+t+")")},tp$richcompare(e,i){if("Eq"!==i&&"Ne"!==i)return Sk.builtin.NotImplemented.NotImplemented$;if(!(e instanceof t.OrderedDict))return Sk.builtin.dict.prototype.tp$richcompare.call(this,e,i);const s="Eq"==i,n=this.size;if(n!==e.size)return!s;const r=e.$items(),a=this.$items();for(let t=0;t=r||l>=a)switch(i){case"Lt":return ra;case"GtE":return r>=a}return"Eq"!==i&&("NotEq"===i||Sk.misceval.richCompareBool(n[this.head+l&this.mask],e[s.head+l&s.mask],i))},tp$iter(){return new e(this)},$r(){const t=[],e=this.tail-this.head&this.mask;if(this.$entered_repr)return new Sk.builtin.str("[...]");this.$entered_repr=!0;for(let s=0;s=e||t<-e)throw new Sk.builtin.IndexError("deque index out of range");const i=(t>=0?this.head:this.tail)+t&this.mask;return this.v[i]},mp$ass_subscript(t,e){t=Sk.misceval.asIndexOrThrow(t);const i=this.tail-this.head&this.mask;if(t>=i||t<-i)throw new Sk.builtin.IndexError("deque index out of range");void 0===e?this.del$item(t):this.set$item(t,e)},nb$inplace_add(t){this.maxlen=void 0;for(let e=Sk.abstr.iter(t),i=e.tp$iternext();void 0!==i;i=e.tp$iternext())this.$push(i);return this},nb$inplace_multiply(t){(t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError,"can\'t multiply sequence by non-int of type \'{tp$name}\'"))<=0&&this.$clear();const e=this.$copy(),i=this.tail-this.head&this.mask;for(let s=1;s integer -- return number of occurrences of value"},extend:{$meth(t){return this.$extend(t),Sk.builtin.none.none$},$flags:{OneArg:!0},$textsig:null,$doc:"Extend the right side of the deque with elements from the iterable"},extendleft:{$meth(t){for(let e=Sk.abstr.iter(t),i=e.tp$iternext();void 0!==i;i=e.tp$iternext())this.$pushLeft(i);return Sk.builtin.none.none$},$flags:{OneArg:!0},$textsig:null,$doc:"Extend the left side of the deque with elements from the iterable"},index:{$meth(t,e,i){const s=this.$index(t,e,i);if(void 0!==s)return new Sk.builtin.int_(s);throw new Sk.builtin.ValueError(Sk.misceval.objectRepr(t)+" is not in deque")},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"D.index(value, [start, [stop]]) -> integer -- return first index of value.\\nRaises ValueError if the value is not present."},insert:{$meth(t,e){t=Sk.misceval.asIndexOrThrow(t,"integer argument expected, got {tp$name}");const i=this.tail-this.head&this.mask;if(void 0!==this.maxlen&&i>=this.maxlen)throw new Sk.builtin.IndexError("deque already at its maximum size");t>i&&(t=i),t<=-i&&(t=0);const s=(t>=0?this.head:this.tail)+t&this.mask;let n=this.tail;for(this.tail=this.tail+1&this.mask;n!==s;){const t=n-1&this.mask;this.v[n]=this.v[t],n=t}return this.v[s]=e,this.head===this.tail&&this.$resize(this.v.length,this.v.length<<1),Sk.builtin.none.none$},$flags:{MinArgs:2,MaxArgs:2},$textsig:null,$doc:"D.insert(index, object) -- insert object before index"},pop:{$meth(){return this.$pop()},$flags:{NoArgs:!0},$textsig:null,$doc:"Remove and return the rightmost element."},popleft:{$meth(){return this.$popLeft()},$flags:{NoArgs:!0},$textsig:null,$doc:"Remove and return the leftmost element."},remove:{$meth(t){const e=this.$index(t);if(void 0===e)throw new Sk.builtin.ValueError(Sk.misceval.objectRepr(t)+" is not in deque");let i=this.head+e&this.mask;for(;i!==this.tail;){const t=i+1&this.mask;this.v[i]=this.v[t],i=t}this.tail=this.tail-1&this.mask;var s=this.tail-this.head&this.mask;s>>1&&this.$resize(s,this.v.length>>>1)},$flags:{OneArg:!0},$textsig:null,$doc:"D.remove(value) -- remove first occurrence of value."},__reversed__:{$meth(){return new i(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"D.__reversed__() -- return a reverse iterator over the deque"},reverse:{$meth(){const t=this.head,e=this.tail,i=this.mask,s=this.tail-this.head&this.mask;for(let n=0;n<~~(s/2);n++){const s=e-n-1&i,r=t+n&i,a=this.v[s];this.v[s]=this.v[r],this.v[r]=a}return Sk.builtin.none.none$},$flags:{NoArgs:!0},$textsig:null,$doc:"D.reverse() -- reverse *IN PLACE*"},rotate:{$meth(t){t=void 0===t?1:Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError);const e=this.head,i=this.tail;if(0===t||e===i)return this;if(this.head=e-t&this.mask,this.tail=i-t&this.mask,t>0)for(let s=1;s<=t;s++){const t=e-s&this.mask,n=i-s&this.mask;this.v[t]=this.v[n],this.v[n]=void 0}else for(let s=0;s>t;s--){const t=i-s&this.mask,n=e-s&this.mask;this.v[t]=this.v[n],this.v[n]=void 0}return Sk.builtin.none.none$},$flags:{MinArgs:0,MaxArgs:1},$textsig:null,$doc:"Rotate the deque n steps to the right (default n=1). If n is negative, rotates left."}},classmethods:Sk.generic.classGetItem,getsets:{maxlen:{$get(){return void 0===this.maxlen?Sk.builtin.none.none$:new Sk.builtin.int_(this.maxlen)},$doc:"maximum size of a deque or None if unbounded"}},proto:{$clear(){this.head=0,this.tail=0,this.mask=1,this.v=new Array(2)},$copy(){return new t.deque(this.v.slice(0),this.maxlen,this.head,this.tail,this.mask)},$extend(t){for(let e=Sk.abstr.iter(t),i=e.tp$iternext();void 0!==i;i=e.tp$iternext())this.$push(i)},set$item(t,e){const i=(t>=0?this.head:this.tail)+t&this.mask;this.v[i]=e},del$item(t){let e=(t>=0?this.head:this.tail)+t&this.mask;for(;e!==this.tail;){const t=e+1&this.mask;this.v[e]=this.v[t],e=t}const i=this.tail-this.head&this.mask;this.tail=this.tail-1&this.mask,i>>1&&this.$resize(i,this.v.length>>>1)},$push(t){this.v[this.tail]=t,this.tail=this.tail+1&this.mask,this.head===this.tail&&this.$resize(this.v.length,this.v.length<<1);const e=this.tail-this.head&this.mask;return void 0!==this.maxlen&&e>this.maxlen&&this.$popLeft(),this},$pushLeft(t){this.head=this.head-1&this.mask,this.v[this.head]=t,this.head===this.tail&&this.$resize(this.v.length,this.v.length<<1);const e=this.tail-this.head&this.mask;return void 0!==this.maxlen&&e>this.maxlen&&this.$pop(),this},$pop(){if(this.head===this.tail)throw new Sk.builtin.IndexError("pop from an empty deque");this.tail=this.tail-1&this.mask;const t=this.v[this.tail];this.v[this.tail]=void 0;const e=this.tail-this.head&this.mask;return e>>1&&this.$resize(e,this.v.length>>>1),t},$popLeft(){if(this.head===this.tail)throw new Sk.builtin.IndexError("pop from an empty deque");const t=this.v[this.head];this.v[this.head]=void 0,this.head=this.head+1&this.mask;const e=this.tail-this.head&this.mask;return e>>1&&this.$resize(e,this.v.length>>>1),t},$resize(t,e){const i=this.head,s=this.mask;if(this.head=0,this.tail=t,this.mask=e-1,0===i)return void(this.v.length=e);const n=new Array(e);for(let r=0;r=0?i:i<-s?0:s+i;for(let o=e>=0?e:e<-s?0:s+e;o=this.$length)return;const t=(this.$index>=0?this.$head:this.$tail)+this.$index&this.$mask;return this.$index++,this.dq[t]},methods:{__length_hint__:{$meth:function __length_hint__(){return new Sk.builtin.int_(this.$length-this.$index)},$flags:{NoArgs:!0}}}}),i=Sk.abstr.buildIteratorClass("_collections._deque_reverse_iterator",{constructor:function _deque_reverse_iterator(t){this.$index=(t.tail-t.head&t.mask)-1,this.dq=t.v,this.$head=t.head,this.$mask=t.mask},iternext(){if(this.$index<0)return;const t=this.$head+this.$index&this.$mask;return this.$index--,this.dq[t]},methods:{__length_hint__:Sk.generic.iterReverseLengthHintMethodDef}}),s=new RegExp(/^[0-9].*/),n=new RegExp(/^[0-9_].*/),r=new RegExp(/^\\w*$/),a=/,/g,o=/\\s+/;function namedtuple(e,i,l,h,c){if(e=e.tp$str(),Sk.misceval.isTrue(Sk.misceval.callsimArray(t._iskeyword,[e])))throw new Sk.builtin.ValueError("Type names and field names cannot be a keyword: \'"+Sk.misceval.objectRepr(e)+"\'");const u=e.$jsstr();if(s.test(u)||!r.test(u)||!u)throw new Sk.builtin.ValueError("Type names and field names must be valid identifiers: \'"+u+"\'");let m,d;if(Sk.builtin.checkString(i))m=i.$jsstr().replace(a," ").split(o),1==m.length&&""===m[0]&&(m=[]),d=m.map((t=>new Sk.builtin.str(t)));else{m=[],d=[];for(let t=Sk.abstr.iter(i),e=t.tp$iternext();void 0!==e;e=t.tp$iternext())e=e.tp$str(),d.push(e),m.push(e.$jsstr())}let p=new Set;if(Sk.misceval.isTrue(l))for(let s=0;sm.length)throw new Sk.builtin.TypeError("Got more default values than field names");for(let t=0,e=d.length-b.length;e"\'"+t.$jsstr()+"\'"))+"]")}return r}_make.co_varnames=["_cls","iterable"],_asdict.co_varnames=["self"],_replace.co_kwargs=1,_replace.co_varnames=["_self"];const S={};for(let s=0;sm[e]+"="+Sk.misceval.objectRepr(t)));return new Sk.builtin.str(Sk.abstr.typeName(this)+"("+t.join(", ")+")")}},flags:{sk$klass:!0},proto:Object.assign({__module__:Sk.builtin.checkNone(c)?Sk.globals.__name__:c,__slots__:new Sk.builtin.tuple,_fields:$,_field_defaults:f,_make:new Sk.builtin.classmethod(new Sk.builtin.func(_make)),_asdict:new Sk.builtin.func(_asdict),_replace:new Sk.builtin.func(_replace)},S)})}return namedtuple.co_argcount=2,namedtuple.co_kwonlyargcount=3,namedtuple.$kwdefs=[Sk.builtin.bool.false$,Sk.builtin.none.none$,Sk.builtin.none.none$],namedtuple.co_varnames=["typename","field_names","rename","defaults","module"],t.namedtuple=new Sk.builtin.func(namedtuple),t}',"src/lib/datetime.js":'function $builtinmodule(){const{isTrue:t,richCompareBool:e,asIndexOrThrow:n,asIndexSized:i,objectRepr:s,opAllowsEquality:o,callsimArray:r,callsimOrSuspendArray:a}=Sk.misceval,{numberBinOp:$,typeName:c,buildNativeClass:h,checkArgsLen:m,objectHash:u,copyKeywordsToNamedArgs:l}=Sk.abstr,{int_:f,float_:d,str:w,bytes:_,tuple:p,bool:{true$:g},none:{none$:y},NotImplemented:{NotImplemented$:b},TypeError:z,ValueError:v,OverflowError:M,ZeroDivisionError:A,NotImplementedError:x,checkNumber:N,checkFloat:S,checkString:k,checkInt:O,asnum$:I,round:E,getattr:T}=Sk.builtin,{remapToPy:D,remapToJs:R}=Sk.ffi,intRound=t=>E(t).nb$int(),q=$,C=new w("auto"),U=new w("utcoffset"),Y=new w("tzname"),j=new w("as_integer_ratio"),F=new w("dst"),H=new w("isoformat"),J=new w("replace"),B=new w("fromtimestamp"),G=new w("fromordinal"),L=new w("utcfromtimestamp"),X=new w("strftime"),P=new w("fromutc"),W=new f(0),Z=new d(0),K=new f(7),V=new f(60),Q=new f(3600),tt=new f(1e3),et=new f(1e6),nt=new d(1e6),it=new f(86400),st=new d(86400);let ot=null;function pyDivMod(t,e){return q(t,e,"DivMod").v}function $divMod(t,e){if("number"!=typeof t||"number"!=typeof e)return t=JSBI.BigInt(t),e=JSBI.BigInt(e),[JSBI.toNumber(JSBI.divide(t,e)),JSBI.toNumber(JSBI.remainder(t,e))];if(0===e)throw new A("integer division or modulo by zero");return[Math.floor(t/e),t-Math.floor(t/e)*e]}function modf(t){const e=(t=I(t))<0?-1:1;return t=Math.abs(t),[new d(e*(t-Math.floor(t))),new d(e*Math.floor(t))]}function _d(t,e="0",n=2){return t.toString().padStart(n,e)}const rt=/^[0-9]+$/;function _as_integer(t){if(!rt.test(t))throw new Error;return parseInt(t)}function _as_int_ratio(t){let e=r(t.tp$getattr(j));if(!(e instanceof p))throw new z("unexpected return type from as_integer_ratio(): expected tuple, got \'"+c(e)+"\'");if(e=e.v,2!==e.length)throw new v("as_integer_ratio() must return a 2-tuple");return e}return Sk.misceval.chain(Sk.importModule("time",!1,!0),(a=>{const $=a.$d,E={__name__:new w("datetime"),__all__:new Sk.builtin.list(["date","datetime","time","timedelta","timezone","tzinfo","MINYEAR","MAXYEAR"].map((t=>new w(t))))};function _cmp(t,e){for(let n=0;ne[n]?1:-1;return 0}function _do_compare(t,e,n){const i=t.$cmp(e,n);switch(n){case"Lt":return i<0;case"LtE":return i<=0;case"Eq":return 0===i;case"NotEq":return 0!==i;case"Gt":return i>0;case"GtE":return i>=0}}const j=9999;E.MINYEAR=new f(1),E.MAXYEAR=new f(j);const rt=3652059,at=[-1,31,28,31,30,31,30,31,31,30,31,30,31],$t=[-1];let ct=0;function _is_leap(t){return t%4==0&&(t%100!=0||t%400==0)}function _days_before_year(t){const e=t-1;return 365*e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400)}function _days_before_month(t,e){return $t[e]+(e>2&&_is_leap(t))}function _ymd2ord(t,e,n){return _days_before_year(t)+_days_before_month(t,e)+n}at.slice(1).forEach((t=>{$t.push(ct),ct+=t}));const ht=_days_before_year(401),mt=_days_before_year(101),ut=_days_before_year(5);function _ord2ymd(t){if((t=n(t))>Number.MAX_SAFE_INTEGER)throw new M("Python int too large to convert to js number");if(t<1)throw new v("ordinal must be >= 1");let e,i,s,o;t-=1,[e,t]=$divMod(t,ht);let r=400*e+1;if([i,t]=$divMod(t,mt),[s,t]=$divMod(t,ut),[o,t]=$divMod(t,365),r+=100*i+4*s+o,4===o||4===i)return[r-1,12,31].map((t=>new f(t)));const a=3===o&&(24!==s||3===i);let $=t+50>>5,c=$t[$]+($>2&&a);return c>t&&($-=1,c-=at[$]+(2===$&&a)),[r,$,(t-=c)+1].map((t=>new f(t)))}const lt=[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ft=[null,"Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function _build_struct_time(t,e,n,i,s,o,r){const a=(_ymd2ord(t,e,n)+6)%7,c=_days_before_month(t,e)+n;return $.struct_time.tp$call([new p([t,e,n,i,s,o,a,c,r].map((t=>new f(t))))])}const dt={hours:t=>_d(t),minutes:(t,e)=>_d(t)+":"+_d(e),seconds:(t,e,n)=>_d(t)+":"+_d(e)+":"+_d(n),milliseconds:(t,e,n,i)=>_d(t)+":"+_d(e)+":"+_d(n)+"."+_d(i,"0",3),microseconds:(t,e,n,i)=>_d(t)+":"+_d(e)+":"+_d(n)+"."+_d(i,"0",6)};function _format_time(t,e,n,i,s="auto"){if("string"!=typeof s&&!k(s))throw new z("must be str, not "+c(s));"auto"===(s=s.toString())?s=i?"microseconds":"seconds":"milliseconds"===s&&(i=Math.floor(i/1e3));let o=dt[s];if(void 0===o)throw new v("Unknown timespec value");return o(t,e,n,i)}function _format_offset(t){let e,n="";if(t!==y){let i,s,o;return t.$days<0?(e="-",t=new wt(-t.$days,-t.$secs,-t.$micro)):e="+",[i,s]=pyDivMod(t,pt),[s,o]=pyDivMod(s,gt),n+=e+`${_d(i)}:${_d(s)}`,(o.$secs||o.$micro)&&(n+=":"+_d(o.$secs,"0",2),o.$micro&&(n+="."+_d(o.$micro,"0",6))),n}}function _wrap_strftime(t,e,n){let i=null,s=null,o=null,a=[],c=0;const h=e.length;for(;cnew f(t)))}function _parse_hh_mm_ss_ff(t){const e=t.length,n=[0,0,0,0];let i=0;for(let s=0;s<3;s++){if(e-i<2)throw new v("Incomplete time component");n[s]=_as_integer(t.slice(i,i+2)),i+=2;const o=t.substr(i,1);if(!o||s>=2)break;if(":"!==o)throw new v("Invalid time separator: "+o);i+=1}if(i0?t.slice(0,e-1):t),s=y;if(e>0){if(n=t.slice(e),![5,8,15].includes(n.length))throw new v("Malformed time zone string");const i=_parse_hh_mm_ss_ff(n);if(i.every((t=>0===t)))s=St.prototype.utc;else{const n="-"===t[e-1]?-1:1,o=new wt(0,n*(3600*i[0]+60*i[1]+i[2]),n*i[3]);s=new St(o)}}return i=i.map((t=>new f(t))),i.push(s),i}function _check_tzname(t){if(t!==y&&!k(t))throw new z("tzinfo.tzname() must return None or string, not \'"+c(t)+"\'")}function _check_utc_offset(t,n){if(n!==y){if(!(n instanceof wt))throw new z(`tzinfo.${t}() must return None or timedelta, not \'${c(n)}\'`);if(!e(zt,n,"Lt")||!e(n,_t,"Lt"))throw new v(`${t}()=${n.toString()}, must be strictly between -timedelta(hours=24) and timedelta(hours=24)`)}}function _check_date_fields(t,e=null,i=null){if(null===e||null===i){throw new z(`function missing required argument \'${null===i?"day":"month"}\' (pos ${null===i?"3":"2"})`)}if(t=n(t),e=n(e),i=n(i),!(1<=t&&t<=j))throw new v("year must be in 1.."+j,new f(t));if(!(1<=e&&e<=12))throw new v("month must be in 1..12",new f(e));const s=function _days_in_month(t,e){return 2===e&&_is_leap(t)?29:at[e]}(t,e);if(!(1<=i&&i<=s))throw new v("day must be in 1.."+s,new f(i));return[t,e,i]}function _check_time_fields(t,e,i,s,o){if(t=n(t),e=n(e),i=n(i),s=n(s),o=n(o),!(0<=t&&t<=23))throw new v("hour must be in 0..23",new f(t));if(!(0<=e&&e<=59))throw new v("minute must be in 0..59",new f(e));if(!(0<=i&&i<=59))throw new v("second must be in 0..59",new f(i));if(!(0<=s&&s<=999999))throw new v("microsecond must be in 0..999999",new f(s));if(0!==o&&1!==o)throw new v("fold must be either 0 or 1",new f(o));return[t,e,i,s,o]}function _check_tzinfo_arg(t){if(t!==y&&!(t instanceof Mt))throw new z("tzinfo argument must be None or of a tzinfo subclass")}function _divide_and_round(t,e){let[n,i]=$divMod(t,e);return i*=2,((e>0?i>e:i999999999)throw new M(`days=${t}; must have magnitude <= 999999999`)},slots:{tp$new(t,e){let i,s,o,r,a,$,c,[h,m,u,d,w,_,p]=l("timedelta",["days","seconds","microseconds","milliseconds","minutes","hours","weeks"],t,e,new Array(7).fill(W));i=s=o=W,h=q(h,q(p,K,"Mult"),"Add"),m=q(m,q(q(w,V,"Mult"),q(_,Q,"Mult"),"Add"),"Add"),u=q(u,q(d,tt,"Mult"),"Add"),S(h)?([r,h]=modf(h),[a,$]=modf(q(r,st,"Mult")),s=new f($),i=new f(h)):(a=Z,i=h),S(m)?([c,m]=modf(m),m=new f(m),c=q(c,a,"Add")):c=a,[h,m]=pyDivMod(m,it),i=q(i,h,"Add"),s=q(s,new f(m),"Add");const g=q(c,nt,"Mult");if(S(u)?(u=intRound(q(u,g,"Add")),[m,u]=pyDivMod(u,et),[h,m]=pyDivMod(m,it),i=q(i,h,"Add"),s=q(s,m,"Add")):(u=new f(u),[m,u]=pyDivMod(u,et),[h,m]=pyDivMod(m,it),i=q(i,h,"Add"),s=q(s,m,"Add"),u=intRound(q(u,g,"Add"))),[m,o]=pyDivMod(u,et),s=q(s,m,"Add"),[h,s]=pyDivMod(s,it),i=q(i,h,"Add"),i=n(i),s=n(s),o=n(o),Math.abs(i)>999999999)throw new M("timedelta # of days is too large: "+h.toString());if(this===wt.prototype)return new wt(i,s,o);{const t=new this.constructor;return wt.call(t,i,s,o),t}},$r(){const t=[];return this.$days&&t.push(`days=${this.$days}`),this.$secs&&t.push(`seconds=${this.$secs}`),this.$micro&&t.push(`microseconds=${this.$micro}`),t.length||t.push("0"),new w(`${this.tp$name}(${t.join(", ")})`)},tp$str(){const t=this.$secs%60;let e=Math.floor(this.$secs/60);const n=Math.floor(e/60);e%=60;let i=`${n}:${_d(e)}:${_d(t)}`;if(this.$days){i=`${this.$days} day${function plural(t){return 1!==Math.abs(t)?"s":""}(this.$days)}, `+i}return this.$micro&&(i+=`.${_d(this.$micro,"0",6)}`),new w(i)},tp$as_number:!0,nb$add(t){return t instanceof wt?new wt(this.$days+t.$days,this.$secs+t.$secs,this.$micro+t.$micro):b},nb$subtract(t){return t instanceof wt?new wt(this.$days-t.$days,this.$secs-t.$secs,this.$micro-t.$micro):b},nb$positive(){return this},nb$negative(){return new wt(-this.$days,-this.$secs,-this.$micro)},nb$abs(){return this.$days<0?this.nb$negative():this},nb$multiply(t){if(O(t))return t=i(t,M),new wt(this.$days*t,this.$secs*t,this.$micro*t);if(S(t)){const e=this.$toMicrosecs();let[s,o]=_as_int_ratio(t);return s=i(s,M),o=n(o),new wt(0,0,_divide_and_round(e*s,o))}return b},nb$floor_divide(t){const e=this.$toMicrosecs();if(t instanceof wt){const n=t.$toMicrosecs();if(0===n)throw new A("integer division or modulo by zero");return new f(Math.floor(e/n))}if(O(t)){if(0===(t=i(t,M)))throw new A("integer division or modulo by zero");return new wt(0,0,Math.floor(e/t))}return b},nb$divide(t){const e=this.$toMicrosecs();if(t instanceof wt){if(0===t.$toMicrosecs())throw new A("integer division or modulo by zero");return new d(e/t.$toMicrosecs())}if(O(t))return t=n(t),new wt(0,0,_divide_and_round(e,t));if(S(t)){let[s,o]=_as_int_ratio(t);return s=n(s),o=i(o,M),new wt(0,0,_divide_and_round(o*e,s))}return b},nb$remainder(t){if(!(t instanceof wt))return b;const e=this.$toMicrosecs(),n=t.$toMicrosecs();if(0===n)throw new A("integer division or modulo by zero");const i=e-Math.floor(e/n)*n;return new wt(0,0,i)},nb$divmod(t){if(!(t instanceof wt))return b;const e=this.$toMicrosecs(),n=t.$toMicrosecs(),[i,s]=$divMod(e,n);return new p([new f(i),new wt(0,0,s)])},tp$richcompare(t,e){return t instanceof wt?_do_compare(this,t,e):b},tp$hash(){return-1===this.$hashcode&&(this.$hashcode=u(new p(this.$getState().map((t=>new f(t)))))),this.$hashcode},nb$bool(){return 0!==this.$days||0!==this.$secs||0!==this.$micro}},methods:{total_seconds:{$meth(){return new d(((86400*this.$days+this.$secs)*10**6+this.$micro)/10**6)},$flags:{NoArgs:!0},$doc:"Total seconds in the duration."},__reduce__:{$meth(){return new p([this.ob$type,new p(this.$getState().map((t=>D(t))))])},$flags:{NoArgs:!0},$textsig:null,$doc:"__reduce__() -> (cls, state)"}},getsets:{days:{$get(){return new f(this.$days)},$doc:"Number of days."},seconds:{$get(){return new f(this.$secs)},$doc:"Number of seconds (>= 0 and less than 1 day)."},microseconds:{$get(){return new f(this.$micro)},$doc:"Number of microseconds (>= 0 and less than 1 second)."}},proto:{$toMicrosecs(){return 1e6*(86400*this.$days+this.$secs)+this.$micro},$cmp(t){return _cmp(this.$getState(),t.$getState())},$getState(){return[this.$days,this.$secs,this.$micro]}}});wt.prototype.min=new wt(-999999999),wt.prototype.max=new wt(999999999,86399,999999),wt.prototype.resolution=new wt(0,0,1);const _t=new wt(1),pt=new wt(0,3600),gt=new wt(0,60),yt=new wt(0,1),bt=new wt(0),zt=new wt(-1),vt=E.date=h("datetime.date",{constructor:function date(t,e,n){this.$year=t,this.$month=e,this.$day=n,this.$hashcode=-1},slots:{tp$new(t,e){let n,[i,s,o]=l("date",["year","month","day"],t,e,[null,null]);if(null===s&&i instanceof _&&4===(n=i.valueOf()).length&&1<=n[2]&&n[2]<=12){const t=new this.constructor;return t.$setState(n),t}if([i,s,o]=_check_date_fields(i,s,o),this===vt.prototype)return new vt(i,s,o);{const t=new this.constructor;return vt.call(t,i,s,o),t}},$r(){return new w(`${this.tp$name}(${this.$year}, ${this.$month}, ${this.$day})`)},tp$str(){return this.tp$getattr(H).tp$call([])},tp$richcompare(t,e){return t instanceof vt?_do_compare(this,t,e):b},tp$hash(){return-1===this.$hashcode&&(this.$hashcode=u(this.$getState())),this.$hashcode},tp$as_number:!0,nb$add(t){if(t instanceof wt){const e=this.$toOrdinal()+t.$days;if(0 local date from a POSIX timestamp (like time.time())."},fromordinal:{$meth:function fromordinal(t){return this.tp$call(_ord2ymd(t))},$flags:{OneArg:!0},$textsig:null,$doc:"int -> date corresponding to a proleptic Gregorian ordinal."},fromisocalendar:{$meth:function fromisocalendar(t,e,i){if(t=n(t),e=n(e),i=n(i),!(1<=t&&t<=j))throw new v(`Year is out of range: ${t}`);let s,o;if(!(0 date corresponding to a proleptic Gregorian ordinal."},fromisoformat:{$meth:function fromisoformat(t){if(!k(t))throw new z("fromisoformat: argument must be str");t=t.toString();try{if(10!==t.length)throw new Error;return this.tp$call(_parse_isoformat_date(t))}catch(e){throw new v("Invalid isoformat string: \'"+t+"\'")}},$flags:{OneArg:!0},$textsig:null,$doc:"str -> Construct a date from the output of date.isoformat()"},today:{$meth:function today(){const t=$.time.tp$call([]);return this.tp$getattr(B).tp$call([t])},$flags:{NoArgs:!0},$textsig:null,$doc:"Current date or datetime: same as self.__class__.fromtimestamp(time.time())."}},methods:{ctime:{$meth:function ctime(){const t=this.$toOrdinal()%7||7,e=ft[t],n=lt[this.$month];return new w(`${e} ${n} ${_d(this.$day," ",2)} 00:00:00 ${_d(this.$year,"0",4)}`)},$flags:{NoArgs:!0},$textsig:null,$doc:"Return ctime() style string."},strftime:{$meth:function strftime(t){if(!k(t))throw new z("must be str, not "+c(t));return _wrap_strftime(this,t=t.toString(),this.$timetuple())},$flags:{OneArg:!0},$textsig:null,$doc:"format -> strftime() style string."},__format__:{$meth:function __format__(t){if(!k(t))throw new z("must be str, not "+c(t));return t!==w.$empty?this.tp$getattr(X).tp$call([t]):this.tp$str()},$flags:{OneArg:!0},$textsig:null,$doc:"Formats self with strftime."},timetuple:{$meth:function timetuple(){return this.$timetuple()},$flags:{NoArgs:!0},$textsig:null,$doc:"Return time tuple, compatible with time.localtime()."},isocalendar:{$meth:function isocalendar(){let t=this.$year,e=_isoweek1monday(t);const n=_ymd2ord(this.$year,this.$month,this.$day);let[i,s]=$divMod(n-e,7);return i<0?(t-=1,e=_isoweek1monday(t),[i,s]=$divMod(n-e,7)):i>=52&&n>=_isoweek1monday(t+1)&&(t+=1,i=0),new At(new f(t),new f(i+1),new f(s+1))},$flags:{NoArgs:!0},$textsig:null,$doc:"Return a 3-tuple containing ISO year, week number, and weekday."},isoformat:{$meth:function isoformat(){return this.$isoformat()},$flags:{NoArgs:!0},$textsig:null,$doc:"Return string in ISO 8601 format, YYYY-MM-DD."},isoweekday:{$meth:function isoweekday(){return new f(this.$toOrdinal()%7||7)},$flags:{NoArgs:!0},$textsig:null,$doc:"Return the day of the week represented by the date.\\nMonday == 1 ... Sunday == 7"},toordinal:{$meth:function toordinal(){return new f(this.$toOrdinal())},$flags:{NoArgs:!0},$textsig:null,$doc:"Return proleptic Gregorian ordinal. January 1 of year 1 is day 1."},weekday:{$meth:function weekday(){return new f((this.$toOrdinal()+6)%7)},$flags:{NoArgs:!0},$textsig:null,$doc:"Return the day of the week represented by the date.\\nMonday == 0 ... Sunday == 6"},replace:{$meth:function replace(t,e,n){return t===y&&(t=new f(this.$year)),e===y&&(e=new f(this.$month)),n===y&&(n=new f(this.$day)),this.ob$type.tp$call([t,e,n])},$flags:{NamedArgs:["year","month","day"],Defaults:[y,y,y]},$textsig:null,$doc:"Return date with new specified fields."},__reduce__:{$meth(){return new p([this.ob$type,new p([this.$getState()])])},$flags:{NoArgs:!0},$textsig:null,$doc:"__reduce__() -> (cls, state)"}},getsets:{year:{$get(){return new f(this.$year)},$doc:"year (1-9999)"},month:{$get(){return new f(this.$month)},$doc:"month (1-12)"},day:{$get(){return new f(this.$day)},$doc:"day (1-31)"}},proto:{$cmp(t){return _cmp([this.$year,this.$month,this.$day],[t.$year,t.$month,t.$day])},$getState(){const[t,e]=$divMod(this.$year,256);return new _([t,e,this.$month,this.$day])},$setState(t){const[e,n,i,s]=t,o=256*e+n;this.$year=o,this.$month=i,this.$day=s},$toOrdinal(){return _ymd2ord(this.$year,this.$month,this.$day)},$isoformat(){return new w(`${_d(this.$year,"0",4)}-${_d(this.$month,"0",2)}-${_d(this.$day,"0",2)}`)},$timetuple(){return _build_struct_time(this.$year,this.$month,this.$day,this.$hour||0,this.$min||0,this.$sec||0,-1)},$strftime(t=""){return _wrap_strftime(this,t.toString(),this.$timetuple())}}});vt.prototype.min=new vt(1,1,1),vt.prototype.max=new vt(9999,12,31),vt.prototype.resolution=new wt(1);const Mt=E.tzinfo=h("datetime.tzinfo",{constructor:function tzinfo(){},methods:{tzname:{$meth:function tzname(t){throw new x("tzinfo subclass must override tzname()")},$flags:{OneArg:!0},$textsig:null,$doc:"datetime -> string name of time zone."},utcoffset:{$meth:function utcoffset(t){throw new x("tzinfo subclass must override utcoffset()")},$flags:{OneArg:!0},$textsig:null,$doc:"datetime -> timedelta showing offset from UTC, negative values indicating West of UTC"},dst:{$meth:function dst(t){throw new x("tzinfo subclass must override dst()")},$flags:{OneArg:!0},$textsig:null,$doc:"datetime -> DST offset as timedelta positive east of UTC."},fromutc:{$meth:function fromutc(e){if(!(e instanceof Nt))throw new z("fromutc() requires a datetime argument");if(e.$tzinfo!==this)throw new v("dt.tzinfo is not self");const n=r(e.tp$getattr(U));if(n===y)throw new v("fromutc() requires a non-None utcoffset() result");let i=r(e.tp$getattr(F));if(i===y)throw new v("fromutc() requires a non-None dst() result");const s=q(n,i,"Sub");if(t(s)&&(e=q(e,s,"Add"),i=r(e.tp$getattr(F)),i===y))throw new v("fromutc(): dt.dst gave inconsistent results; cannot convert");return q(e,i,"Add")},$flags:{OneArg:!0},$textsig:null,$doc:"datetime in UTC -> datetime in local time."},__reduce__:{$meth(){let e,n;const i=T(this,new w("__getinitargs__"),y);e=i!==y?r(i,[]):new p;const s=T(this,new w("__getstate__"),y);return s!==y?n=r(s,[]):(n=T(this,new w("__dict__"),y),n=t(n)?n:y),new p(n===y?[this.ob$type,e]:[this.ob$type,e,n])},$flags:{NoArgs:!0},$textsig:null,$doc:"-> (cls, state)"}}}),At=h("datetime.IsoCalendarDate",{base:p,constructor:function IsoCalendarDate(t,e,n){this.y=t,this.w=e,this.wd=n,p.call(this,[t,e,n])},slots:{tp$new(t,e){const[n,i,s]=l("IsoCalendarDate",["year","week","weekday"],t,e);return new this.constructor(n,i,s)},$r(){return new w(`${this.tp$name}(year=${this.y}, week=${this.w}, weekday=${this.wd})`)}},getsets:{year:{$get(){return this.y}},week:{$get(){return this.w}},weekday:{$get(){return this.wd}}}}),xt=E.time=h("datetime.time",{constructor:function time(t=0,e=0,n=0,i=0,s=null,o=0){this.$hour=t,this.$min=e,this.$sec=n,this.$micro=i,this.$tzinfo=s||y,this.$fold=o,this.$hashcode=-1},slots:{tp$new(t,e){m("time",t,0,5);let n,[i,s,o,r,a,$]=l("time",["hour","minute","second","microsecond","tzinfo","fold"],t,e,[W,W,W,W,y,W]);if(i instanceof _&&6===(n=i.valueOf()).length&&(127&n[0])<24){const t=new this.constructor;return t.$setState(n,s===W?y:s),t}if([i,s,o,r,$]=_check_time_fields(i,s,o,r,$),_check_tzinfo_arg(a),this===xt.prototype)return new xt(i,s,o,r,a,$);{const t=new this.constructor;return xt.call(t,i,s,o,r,a,$),t}},tp$richcompare(t,e){return t instanceof xt?_do_compare(this,t,e):b},tp$hash(){if(-1===this.$hashcode){const e=this.$fold?r(this.tp$getattr(J),[],["fold",W]):this,n=r(e.tp$getattr(U));if(t(n)){let[t,e]=pyDivMod(new wt(0,3600*this.$hour+60*this.$min).nb$subtract(n),pt);e=e.nb$floor_divide(gt),0<=t&&t<=24?(t=I(t),e=I(e),this.$hashcode=u(new xt(t,e,this.$sec,this.$micro))):this.$hashcode=u(new p([t,e,new f(this.$sec),new f(this.$micro)]))}else this.$hashcode=u(e.$getState()[0])}return this.$hashcode},$r(){let t;return t=0!==this.$micro?`, ${this.$sec}, ${this.$micro}`:0!==this.$sec?`, ${this.$sec}`:"",t=`${this.tp$name}(${this.$hour}, ${this.$min}${t})`,this.$tzinfo!==y&&(t=t.slice(0,-1)+", tzinfo="+s(this.$tzinfo)+")"),this.$fold&&(t=t.slice(0,-1)+", fold=1)"),new w(t)},tp$str(){return this.tp$getattr(H).tp$call([])}},methods:{isoformat:{$meth:function isoformat(t){let e=_format_time(this.$hour,this.$min,this.$sec,this.$micro,t);const n=this.$tzstr();return n&&(e+=n),new w(e)},$flags:{NamedArgs:["timespec"],Defaults:[C]},$textsig:null,$doc:"Return string in ISO 8601 format, [HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].\\n\\ntimespec specifies what components of the time to include.\\n"},strftime:{$meth:function strftime(t){if(!k(t))throw new z("must be str, not "+c(t));return _wrap_strftime(this,t=t.toString(),new p([1900,1,1,this.$hour,this.$min,this.$sec,0,1,-1].map((t=>new f(t)))))},$flags:{OneArg:!0},$textsig:null,$doc:"format -> strftime() style string."},__format__:{$meth:function __format__(t){if(!k(t))throw new z("must be str, not "+c(t));return t!==w.$empty?this.tp$getattr(X).tp$call([t]):this.tp$str()},$flags:{OneArg:!0},$textsig:null,$doc:"Formats self with strftime."},utcoffset:{$meth:function utcoffset(){if(this.$tzinfo===y)return y;const t=this.$tzinfo.tp$getattr(U),e=r(t,[y]);return _check_utc_offset("utcoffset",e),e},$flags:{NoArgs:!0},$textsig:null,$doc:"Return self.tzinfo.utcoffset(self)."},tzname:{$meth:function tzname(){if(this.$tzinfo===y)return y;const t=this.$tzinfo.tp$getattr(Y),e=r(t,[y]);return _check_tzname(e),e},$flags:{NoArgs:!0},$textsig:null,$doc:"Return self.tzinfo.tzname(self)."},dst:{$meth:function dst(){if(this.$tzinfo===y)return y;const t=this.$tzinfo.tp$getattr(F),e=r(t,[y]);return _check_utc_offset("dst",e),e},$flags:{NoArgs:!0},$textsig:null,$doc:"Return self.tzinfo.dst(self)."},replace:{$meth:function replace(t,e){m("replace",t,0,5);let[n,i,s,o,r,a]=l("replace",["hour","minute","second","microsecond","tzinfo","fold"],t,e,[y,y,y,y,g,y]);return n===y&&(n=new f(this.$hour)),i===y&&(i=new f(this.$min)),s===y&&(s=new f(this.$sec)),o===y&&(o=new f(this.$micro)),r===g&&(r=this.$tzinfo),a===y&&(a=new f(this.$fold)),this.ob$type.tp$call([n,i,s,o,r],["fold",a])},$flags:{FastCall:!0},$textsig:null,$doc:"Return time with new specified fields."},__reduce_ex__:{$meth(t){return new p([this.ob$type,new p(this.$getState(R(t)))])},$flags:{OneArg:!0},$textsig:null,$doc:"__reduce_ex__(proto) -> (cls, state)"},__reduce__:{$meth(){return this.tp$getattr(new w("__reduce_ex__")).tp$call([new f(2)])},$flags:{NoArgs:!0},$textsig:null,$doc:"__reduce__() -> (cls, state)"}},classmethods:{fromisoformat:{$meth:function fromisoformat(t){if(!k(t))throw new z("fromisoformat: argument must be str");t=t.toString();try{return this.tp$call(_parse_isoformat_time(t))}catch{throw new v("Invalid isofrmat string: \'"+t+"\'")}},$flags:{OneArg:!0},$textsig:null,$doc:"string -> time from time.isoformat() output"}},getsets:{hour:{$get(){return new f(this.$hour)}},minute:{$get(){return new f(this.$min)}},second:{$get(){return new f(this.$sec)}},microsecond:{$get(){return new f(this.$micro)}},tzinfo:{$get(){return this.$tzinfo}},fold:{$get(){return new f(this.$fold)}}},proto:{$cmp(t,n){const s=this.$tzinfo,o=t.$tzinfo;let a,$,c;if(a=$=y,s===o?c=!0:(a=r(this.tp$getattr(U)),$=r(t.tp$getattr(U)),c=e(a,$,"Eq")),c)return _cmp([this.$hour,this.$min,this.$sec,this.$micro],[t.$hour,t.$min,t.$sec,t.$micro]);if(a===y||$===y){if("Eq"===n||"NotEq"===n)return 2;throw new z("cannot compare naive and aware times")}const h=60*this.$hour+this.$min-i(a.nb$floor_divide(gt)),m=60*t.$hour+t.$min-i($.nb$floor_divide(gt));return _cmp([h,this.$sec,this.$micro],[m,t.$sec,t.$micro])},$tzstr(){return _format_offset(r(this.tp$getattr(U)))},$getState(t=3){let[e,n]=$divMod(this.$micro,256),[i,s]=$divMod(e,256),o=this.$hour;this.$fold&&t>3&&(o+=128);const r=new _([o,this.$min,this.$sec,i,s,n]);return this.$tzinfo===y?[r]:[r,this.$tzinfo]},$setState(t,e){const[n,i,s,o,r,a]=t;n>127?(this.$fold=1,this.$hour=n-128):(this.$fold=0,this.$hour=n),this.$min=i,this.$sec=s,this.$micro=(o<<8|r)<<8|a,this.$tzinfo=e}}});xt.prototype.min=new xt(0,0,0),xt.prototype.max=new xt(23,59,59,999999),xt.prototype.resolution=new wt;const Nt=E.datetime=h("datetime.datetime",{base:vt,constructor:function datetime(t,e,n,i=0,s=0,o=0,r=0,a=null,$=0){this.$year=t,this.$month=e,this.$day=n,this.$hour=i,this.$min=s,this.$sec=o,this.$micro=r,this.$tzinfo=a||y,this.$fold=$,this.$hashcode=-1},slots:{tp$new(t,e){m("datetime",t,0,9);let n,[i,s,o,r,a,$,c,h,u]=l("time",["year","month","day","hour","minute","second","microsecond","tzinfo","fold"],t,e,[null,null,W,W,W,W,y,W]);if(i instanceof _&&10===(n=i.valueOf()).length&&(127&n[2])<=12){const t=new this.constructor;return t.$setState(n,null===s?y:s),t}if([i,s,o]=_check_date_fields(i,s,o),[r,a,$,c,u]=_check_time_fields(r,a,$,c,u),_check_tzinfo_arg(h),this===Nt.prototype)return new Nt(i,s,o,r,a,$,c,h,u);{const t=new this.constructor;return Nt.call(t,i,s,o,r,a,$,c,h,u),t}},$r(){const t=[this.$year,this.$month,this.$day,this.$hour,this.$min,this.$sec,this.$micro];0===t[t.length-1]&&t.pop(),0===t[t.length-1]&&t.pop();let e=`${this.tp$name}(${t.join(", ")})`;return this.$tzinfo!==y&&(e=e.slice(0,-1)+", tzinfo="+s(this.$tzinfo)+")"),this.$fold&&(e=e.slice(0,-1)+", fold=1)"),new w(e)},tp$str(){return this.tp$getattr(H).tp$call([],["sep",new w(" ")])},tp$richcompare(t,e){if(t instanceof Nt)return _do_compare(this,t,e);if(!(t instanceof vt))return b;if("Eq"===e||"NotEq"===e)return"NotEq"===e;throw new z(`can\'t compare \'${c(this)}\' to \'${c(t)}\'`)},tp$as_number:!0,nb$add(t){if(!(t instanceof wt))return b;let e=new wt(this.$toOrdinal(),3600*this.$hour+60*this.$min+this.$sec,this.$micro);e=q(e,t,"Add");let[n,i]=$divMod(e.$secs,3600),[s,o]=$divMod(i,60);if(0 string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].\\nsep is used to separate the year from the time, and defaults to \'T\'.\\ntimespec specifies what components of the time to include (allowed values are \'auto\', \'hours\', \'minutes\', \'seconds\', \'milliseconds\', and \'microseconds\').\\n"},utcoffset:{$meth:function utcoffset(){if(this.$tzinfo===y)return y;const t=this.$tzinfo.tp$getattr(U),e=r(t,[this]);return _check_utc_offset("utcoffset",e),e},$flags:{NoArgs:!0},$textsig:null,$doc:"Return self.tzinfo.utcoffset(self)."},tzname:{$meth:function tzname(){if(this.$tzinfo===y)return y;const t=this.$tzinfo.tp$getattr(Y),e=r(t,[this]);return _check_tzname(e),e},$flags:{NoArgs:!0},$textsig:null,$doc:"Return self.tzinfo.tzname(self)."},dst:{$meth:function dst(){if(this.$tzinfo===y)return y;const t=this.$tzinfo.tp$getattr(F),e=r(t,[this]);return _check_utc_offset("dst",e),e},$flags:{NoArgs:!0},$textsig:null,$doc:"Return self.tzinfo.dst(self)."},replace:{$meth:function replace(t,e){m("replace",t,0,8);let[n,i,s,o,r,a,$,c,h]=l("replace",["year","month","day","hour","minute","second","microsecond","tzinfo","fold"],t,e,[y,y,y,y,y,y,y,g,y]);return n===y&&(n=new f(this.$year)),i===y&&(i=new f(this.$month)),s===y&&(s=new f(this.$day)),o===y&&(o=new f(this.$hour)),r===y&&(r=new f(this.$min)),a===y&&(a=new f(this.$sec)),$===y&&($=new f(this.$micro)),c===g&&(c=this.$tzinfo),h===y&&(h=new f(this.$fold)),this.ob$type.tp$call([n,i,s,o,r,a,$,c],["fold",h])},$flags:{FastCall:!0},$textsig:null,$doc:"Return datetime with new specified fields."},astimezone:{$meth:function astimezone(t){if(t===y)t=this.$localTimezone();else if(!(t instanceof Mt))throw new z("tz argument must be an instance of tzinfo");let e,n=this.$tzinfo;if(n===y?(n=this.$localTimezone(),e=r(n.tp$getattr(U),[this])):(e=r(n.tp$getattr(U),[this]),e===y&&(n=r(this.tp$getattr(J),[],["tzinfo",y]).$localTimezone(),e=r(n.tp$getattr(U),[this]))),t===n)return this;const i=r(this.nb$subtract(e).tp$getattr(J),[],["tzinfo",t]);return t.tp$getattr(P).tp$call([i])},$flags:{NamedArgs:["tz"],Defaults:[y]},$textsig:null,$doc:"tz -> convert to local time in new timezone tz\\n"},__reduce_ex__:{$meth(t){return new p([this.ob$type,new p(this.$getState(R(t)))])},$flags:{OneArg:!0},$textsig:null,$doc:"__reduce_ex__(proto) -> (cls, state)"},__reduce__:{$meth(){return this.tp$getattr(new w("__reduce_ex__")).tp$call([new f(2)])},$flags:{NoArgs:!0},$textsig:null,$doc:"__reduce__() -> (cls, state)"}},classmethods:{now:{$meth:function now(t){const e=$.time.tp$call([]);return this.tp$getattr(B).tp$call([e,t])},$flags:{NamedArgs:["tz"],Defaults:[y]},$textsig:"($type, /, tz=None)",$doc:"Returns new datetime object representing current time local to tz.\\n\\n tz\\n Timezone object.\\n\\nIf no tz is specified, uses local timezone."},utcnow:{$meth:function utcnow(){const t=$.time.tp$call([]);return this.tp$getattr(L).tp$call([t])},$flags:{NoArgs:!0},$textsig:null,$doc:"Return a new datetime representing UTC day and time."},fromtimestamp:{$meth:function fromtimestamp(t,e){return _check_tzinfo_arg(e),this.prototype.$fromtimestamp.call(this,t,e!==y,e)},$flags:{NamedArgs:["timestamp","tz"],Defaults:[y]},$textsig:null,$doc:"timestamp[, tz] -> tz\'s local time from POSIX timestamp."},utcfromtimestamp:{$meth:function utcfromtimestamp(t){return this.prototype.$fromtimestamp.call(this,t,!0,y)},$flags:{OneArg:!0},$textsig:null,$doc:"Construct a naive UTC datetime from a POSIX timestamp."},strptime:{$meth:function strptime(t,e){return null===ot?Sk.misceval.chain(Sk.importModule("_strptime",!1,!0),(n=>(ot=n.tp$getattr(new w("_strptime_datetime")),ot.tp$call([this,t,e])))):ot.tp$call([this,t,e])},$flags:{MinArgs:2,MaxArgs:2},$textsig:null,$doc:"string, format -> new datetime parsed from a string (like time.strptime())."},combine:{$meth:function combine(t,e,n){if(!(t instanceof vt))throw new z("date argument must be a date instance");if(!(e instanceof xt))throw new z("time argument must be a time instance");n===g&&(n=e.$tzinfo);const i=[t.$year,t.$month,t.$day,e.$hour,e.$min,e.$sec,e.$micro].map((t=>new f(t)));return i.push(n),this.tp$call(i,["fold",new f(e.$fold)])},$flags:{NamedArgs:["date","time","tzinfo"],Defaults:[g]},$textsig:null,$doc:"date, time -> datetime with same date and time fields"},fromisoformat:{$meth:function fromisoformat(t){if(!k(t))throw new z("fromisoformat: argument must be str");const e=(t=t.toString()).slice(0,10),n=t.slice(11);let i,s;try{i=_parse_isoformat_date(e)}catch(o){throw new v("Invalid isoformat string: \'"+t+"\'")}if(n)try{s=_parse_isoformat_time(n)}catch(o){throw new v("Invalid isoformat string: \'"+t+"\'")}else s=[W,W,W,W,y];return this.tp$call(i.concat(s))},$flags:{OneArg:!0},$textsig:null,$doc:"string -> datetime from datetime.isoformat() output"}},getsets:{hour:{$get(){return new f(this.$hour)}},minute:{$get(){return new f(this.$min)}},second:{$get(){return new f(this.$sec)}},microsecond:{$get(){return new f(this.$micro)}},tzinfo:{$get(){return this.$tzinfo}},fold:{$get(){return new f(this.$fold)}}},proto:{$cmp(n,i){const s=this.$tzinfo,o=n.$tzinfo;let a,$,c;if(a=$=y,s===o)c=!0;else{if(a=r(this.tp$getattr(U)),$=r(n.tp$getattr(U)),"Eq"===i||"NotEq"===i){const t=r(this.tp$getattr(J),[],["fold",new f(Number(!this.$fold))]);if(e(a,r(t.tp$getattr(U)),"NotEq"))return 2;const i=r(n.tp$getattr(J),[],["fold",new f(Number(!n.$fold))]);if(e($,r(i.tp$getattr(U)),"NotEq"))return 2}c=e(a,$,"Eq")}if(c)return _cmp([this.$year,this.$month,this.$day,this.$hour,this.$min,this.$sec,this.$micro],[n.$year,n.$month,n.$day,n.$hour,n.$min,n.$sec,n.$micro]);if(a===y||$===y){if("Eq"===i||"NotEq"===i)return 2;throw new z("cannot compare naive and aware datetimes")}const h=this.nb$subtract(n);return h.$days<0?-1:t(h)?1:0},$mkTime(){const t=new Nt(1970,1,1),e=this.nb$subtract(t).nb$floor_divide(yt);function local(e){const[n,i,s,o,r,a]=$.localtime.tp$call([e]).v;return Nt.tp$call([n,i,s,o,r,a]).nb$subtract(t).nb$floor_divide(yt)}let n,i,s=local(e).nb$subtract(e),o=e.nb$subtract(s),r=local(o);if(r.ob$eq(e)){if(n=o.nb$add([new f(-86400),new f(86400)][this.$fold]),i=local(n).nb$subtract(n),s.ob$eq(i))return o}else i=r.nb$subtract(o);n=e.nb$subtract(i);if(local(n).ob$eq(e))return n;if(r.ob$eq(e))return o;const a=o.ob$ge(n)?o:n;return[a,o===a?n:o][this.$fold]},$fromtimestamp(t,n,s){let o;if(!N(t))throw new z("a number is required, (got \'"+c(t)+"\'");[o,t]=modf(t);let a=intRound(q(o,nt,"Mult"));a=a.v,t=t.v,a>=1e6?(t+=1,a-=1e6):a<0&&(t-=1,a+=1e6),t=new f(t),Number.isInteger(a)||(a=Math.trunc(a)),a=new f(a);const h=n?$.gmtime:$.localtime;function converter(t){return h.tp$call([t]).v}let[m,u,l,d,_,p]=converter(t);p=new f(Math.min(i(p),59));let g=r(this,[m,u,l,d,_,p,a,s]);if(s===y){const n=86400;[m,u,l,d,_,p]=converter(q(t,new f(n),"Sub"));const i=r(this,[m,u,l,d,_,p,a,s]),o=q(q(g,i,"Sub"),new wt(0,n),"Sub");if(o.$days<0){[m,u,l,d,_,p]=converter(q(t,q(o,yt,"FloorDiv"),"Add"));const n=r(this,[m,u,l,d,_,p,a,s]);e(n,g,"Eq")&&(g.$fold=1)}}else g=r(s.tp$getattr(new w("fromutc")),[g]);return g},$localTimezone(){let t;t=this.$tzinfo===y?this.$mkTime():this.nb$subtract(kt).nb$floor_divide(yt);const e=$.localtime.tp$call([t]),n=(Nt.tp$call(e.v.slice(0,6)),e.tp$getattr(new w("tm_gmtoff"))),i=e.tp$getattr(new w("tm_zone"));return new St(wt.tp$call([W,n]),i)},$getState(t=3){let[e,n]=$divMod(this.$year,256),[i,s]=$divMod(this.$micro,256),[o,r]=$divMod(i,256),a=this.$month;this.$fold&&t>3&&(a+=128);const $=new _([e,n,a,this.$day,this.$hour,this.$min,this.$sec,o,r,s]);return this.$tzinfo===y?[$]:[$,this.$tzinfo]},$setState(t,e){const[n,i,s,o,r,a,$,c,h,m]=t;s>127?(this.$fold=1,this.$month=s-128):(this.$fold=0,this.$month=s),this.$year=256*n+i,this.$day=o,this.$hour=r,this.$min=a,this.$sec=$,this.$micro=(c<<8|h)<<8|m,this.$tzinfo=e}}});function _isoweek1monday(t){const e=_ymd2ord(t,1,1),n=(e+6)%7;let i=e-n;return n>3&&(i+=7),i}Nt.prototype.min=new Nt(1,1,1),Nt.prototype.max=new Nt(9999,12,31,23,59,59,999999),Nt.prototype.resolution=new wt(0,0,1);const St=E.timezone=h("datetime.timezone",{base:Mt,constructor:function timezone(t,n){if(this.$offset=t,this.$name=n||y,!e(this.$minoffset,t,"LtE")||!e(this.$maxoffset,t,"GtE"))throw new v("offset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).")},slots:{tp$new(e,n){let[i,s]=l("timezone",["offset","name"],e,n,[null]);if(!(i instanceof wt))throw new z("offset must be a timedelta");if(null===s){if(!t(i))return this.utc;s=y}else if(!k(s))throw new z("name must be a string");if(this===St.prototype)return new St(i,s);{const t=new this.constructor;return St.call(t,i,s),t}},tp$richcompare(t,n){if(!(t instanceof St))return b;const i=e(this.$offset,t.$offset,"Eq");return"NotEq"===n?!i:"Eq"===n||i&&o(n)?i:b},$r(){return this===this.utc?new w("datetime.timezone.utc"):this.$name===y?new w(`${this.tp$name}(${s(this.$offset)})`):new w(`${this.tp$name}(${s(this.$offset)}, ${s(this.$name)})`)},tp$str(){return this.tp$getattr(Y).tp$call([y])},tp$hash(){return u(this.$offset)}},methods:{tzname:{$meth:function tzname(t){if(t instanceof Nt||t===y)return this.$name===y?this.$nameFromOff(this.$offset):this.$name;throw new z("tzname() argument must be a datetime instance or None")},$flags:{OneArg:!0},$textsig:null,$doc:"If name is specified when timezone is created, returns the name. Otherwise returns offset as \'UTC(+|-)HH:MM\'."},utcoffset:{$meth:function utcoffset(t){if(t instanceof Nt||t===y)return this.$offset;throw new z("utcoffset() argument must be a datetime instance or None")},$flags:{OneArg:!0},$textsig:null,$doc:"Return fixed offset."},dst:{$meth:function dst(t){if(t instanceof Nt||t===y)return y;throw new z("dst() argument must be a datetime instance or None")},$flags:{OneArg:!0},$textsig:null,$doc:"Return None."},fromutc:{$meth:function fromutc(t){if(t instanceof Nt){if(t.$tzinfo!==this)throw new v("fromutc: dt.tzinfo is not self");return q(t,this.$offset,"Add")}throw new z("fromutc() argument must be a datetime instance or None")},$flags:{OneArg:!0},$textsig:null,$doc:"datetime in UTC -> datetime in local time."},__getinitargs__:{$meth(){return this.$name===y?new p([this.$offset]):new p([this.$offset,this.$name])},$flags:{NoArgs:!0}}},proto:{$maxoffset:new wt(0,86399,999999),$minoffset:new wt(-1,0,1),$nameFromOff(n){if(!t(n))return new w("UTC");let i,s,o,r,a,$;return e(n,bt,"Lt")?(i="-",n=n.nb$negative()):i="+",[s,o]=pyDivMod(n,pt),[r,o]=pyDivMod(o,gt),a=o.$secs,$=o.$micro,new w($?`UTC${i}${_d(s)}:${_d(r)}:${_d(a)}.${_d($,"0",6)}`:a?`UTC${i}${_d(s)}:${_d(r)}:${_d(a)}`:`UTC${i}${_d(s)}:${_d(r)}`)}}});St.prototype.utc=new St(new wt(0)),St.prototype.min=new St(new wt(0,-86340,0)),St.prototype.max=new St(new wt(0,86340,0));const kt=new Nt(1970,1,1,0,0,0,0,St.prototype.utc);return E}))}',"src/lib/document.js":'function $builtinmodule(){const{builtin:{str:t},misceval:{callsimArray:e},ffi:{toPy:r},abstr:{gattr:a}}=Sk,n={__name__:new t("document")},_=r(Sk.global.document);return Sk.abstr.setUpModuleMethods("document",n,{__getattr__:{$meth:t=>a(_,t,!0),$flags:{OneArg:!0}},__dir__:{$meth:()=>e(_.tp$getattr(t.$dir)),$flags:{NoArgs:!0}}}),n}',"src/lib/fractions.js":'function $builtinmodule(t){const e={};return Sk.misceval.chain(Sk.importModule("math",!1,!0),(t=>(e.math=t,Sk.importModule("sys",!1,!0))),(t=>(e.sys=t,fractionsMod(e))))}function fractionsMod({math:t,sys:e}){const{builtin:{int_:n,bool:{true$:i,false$:r},none:{none$:s},NotImplemented:{NotImplemented$:o},tuple:a,float_:$,complex:u,str:h,isinstance:l,TypeError:m,ZeroDivisionError:d,ValueError:f,NotImplementedError:c,abs:_,round:b,pow:p},ffi:{remapToPy:g},abstr:{buildNativeClass:w,copyKeywordsToNamedArgs:v,numberBinOp:y,typeName:k,lookupSpecial:E,checkArgsLen:N},misceval:{isTrue:F,richCompareBool:A,callsimArray:S,objectRepr:M}}=Sk,O={__name__:new h("fractions"),__all__:g(["Fraction"])},D=/^\\s*(?[-+]?)(?=\\d|\\.\\d)(?\\d*)(?:(?:\\/(?\\d+))?|(?:\\.(?\\d*))?(?:E(?[-+]?\\d+))?)\\s*$/i,q=new n(0),x=new n(1),z=new n(2),I=new n(10),T=new h("numerator"),R=new h("denominator"),B=new h("as_integer_ratio"),C=new h("from_float"),getNumer=t=>t.tp$getattr(T),getDenom=t=>t.tp$getattr(R),mul=(t,e)=>y(t,e,"Mult"),div=(t,e)=>y(t,e,"Div"),pow=(t,e)=>y(t,e,"Pow"),add=(t,e)=>y(t,e,"Add"),sub=(t,e)=>y(t,e,"Sub"),floorDiv=(t,e)=>y(t,e,"FloorDiv"),divmod=(t,e)=>y(t,e,"DivMod"),mod=(t,e)=>y(t,e,"Mod"),K=t.tp$getattr(new h("gcd")),eq=(t,e)=>A(t,e,"Eq"),lt=(t,e)=>A(t,e,"Lt"),ge=(t,e)=>A(t,e,"GtE"),L={NoArgs:!0},P={OneArg:!0},j=e.tp$getattr(new h("hash_info")),G=j.tp$getattr(new h("modulus")),V=j.tp$getattr(new h("inf"));function _operator_fallbacks(t,e){return[function(n){return isRational(n)?t(this,n):n instanceof $?e(this.nb$float(),n):n instanceof u?e(S(u,[this]),n):o},function(n){return isRational(n)?t(n,this):n instanceof $?e(n,this.nb$float()):n instanceof u?e(n,S(u,[this])):o}]}const[Z,H]=_operator_fallbacks(((t,e)=>{const n=getDenom(t),i=getDenom(e);return S(ot,[add(mul(getNumer(t),i),mul(getNumer(e),n)),mul(n,i)])}),add),[J,Q]=_operator_fallbacks(((t,e)=>{const n=getDenom(t),i=getDenom(e);return S(ot,[sub(mul(getNumer(t),i),mul(getNumer(e),n)),mul(n,i)])}),sub),[U,W]=_operator_fallbacks(((t,e)=>S(ot,[mul(getNumer(t),getNumer(e)),mul(getDenom(t),getDenom(e))])),mul),[X,Y]=_operator_fallbacks(((t,e)=>S(ot,[mul(getNumer(t),getDenom(e)),mul(getDenom(t),getNumer(e))])),div),[tt,et]=_operator_fallbacks(((t,e)=>floorDiv(mul(getNumer(t),getDenom(e)),mul(getDenom(t),getNumer(e)))),floorDiv),[nt,it]=_operator_fallbacks(((t,e)=>{const n=getDenom(t),i=getDenom(e),[r,s]=divmod(mul(getNumer(t),i),mul(n,getNumer(e))).valueOf();return new a([r,S(ot,[s,mul(n,i)])])}),divmod),[rt,st]=_operator_fallbacks(((t,e)=>{const n=getDenom(t),i=getDenom(e),r=mod(mul(getNumer(t),i),mul(getNumer(e),n));return S(ot,[r,mul(n,i)])}),mod),ot=O.Fraction=w("fractions.Fraction",{constructor:function(t,e){this.$num=t||q,this.$den=e||x},slots:{tp$new(t,e){N("Fraction",t,0,2);let[r,o,a]=v("Fraction",["numerator","denominator","_normalize"],t,e,[q,s,i]);const u=new this.constructor;if(o===s){if(r.ob$type===n)return u.$num=r,u.$den=x,u;if(isRational(r))return u.$num=getNumer(r),u.$den=getDenom(r),u;if(r instanceof $)return[u.$num,u.$den]=S(r.tp$getattr(B)).valueOf(),u;if(!(r instanceof h))throw new m("argument should be a string or a Rational instance");{const t=r.toString().match(D);if(null===t)throw new f("Invalid literal for Fraction: "+M(r));r=new n(t.groups.num||"0");const e=t.groups.denom;if(e)o=new n(e);else{o=x;const e=t.groups.decimal;if(e){const t=new n(""+10**e.length);r=add(mul(r,t),new n(e)),o=mul(o,t)}let i=t.groups.exp;i&&(i=new n(i),lt(i,q)?o=mul(o,pow(I,i.nb$negative())):r=mul(r,pow(I,i)))}"-"==t.groups.sign&&(r=r.nb$negative())}}else if(r.ob$type===n&&o.ob$type===n);else{if(!isRational(r)||!isRational(o))throw new m("both arguments should be Rational instances");[r,o]=[mul(getNumer(r),getDenom(o)),mul(getNumer(o),getDenom(r))]}if(eq(o,q))throw new d(`Fraction(${r}, 0)`);if(F(a)){let t=S(K,[r,o]);lt(o,q)&&(t=t.nb$negative()),r=floorDiv(r,t),o=floorDiv(o,t)}return u.$num=r,u.$den=o,u},$r(){const t=E(this.ob$type,h.$name);return new h(`${t}(${this.$num}, ${this.$den})`)},tp$str(){return eq(this.$den,x)?new h(this.$num):new h(`${this.$num}/${this.$den}`)},tp$hash(){const t=p(this.$den,sub(G,z),G);let e;e=F(t)?mod(mul(_(this.$num),t),G):V;let n=ge(this,q)?e:e.nb$negative();return n=n.tp$hash(),-1===n?-2:n},tp$richcompare(t,e){const op=(t,n)=>A(t,n,e);if("Eq"===e||"NotEq"==e){if(t.ob$type===n){const n=eq(this.$num,t)&&eq(this.$den,x);return"Eq"===e?n:!n}if(t instanceof ot||t instanceof n){const n=eq(this.$num,getNumer(t))&&eq(this.$den,getDenom(t));return"Eq"===e?n:!n}t instanceof u&&eq(t.tp$getattr(new h("imag")),q)&&(t=t.tp$getattr(new h("real")))}return isRational(t)?op(mul(getNumer(this),getDenom(t)),mul(getDenom(this),getNumer(t))):t instanceof $?Number.isFinite(t.valueOf())?op(this,S(this.tp$getattr(C),[t])):op(new $(0),t):o},tp$as_number:!0,nb$add:Z,nb$reflected_add:H,nb$subtract:J,nb$reflected_subtract:Q,nb$multiply:U,nb$reflected_multiply:W,nb$divide:X,nb$reflected_divide:Y,nb$floor_divide:tt,nb$reflected_floor_divide:et,nb$divmod:nt,nb$reflected_divmod:it,nb$remainder:rt,nb$reflected_remainder:st,nb$power(t){if(isRational(t)){if(eq(getDenom(t),x)){let e=getNumer(t);return ge(e,q)?S(ot,[pow(this.$num,e),pow(this.$den,e)],["_normalize",r]):ge(this.$num,q)?(e=e.nb$negative(),S(ot,[pow(this.$den,e),pow(this.$num,e)],["_normalize",r])):(e=e.nb$negative(),S(ot,[pow(this.$den.nb$negative(),e),pow(this.$num.nb$negative(),e)],["_normalize",r]))}return pow(this.nb$float(),S($,[t]))}return pow(this.nb$float(),t)},nb$reflected_power(t){return eq(this.$den,x)&&ge(this.$num,q)?pow(t,this.$num):isRational(t)?pow(new ot(getNumer(t),getDenom(t)),this):eq(this.$den,x)?pow(t,this.$num):pow(t,this.nb$float())},nb$positive(){return new ot(this.$num,this.$den)},nb$negative(){return new ot(this.$num.nb$negative(),this.$den)},nb$abs(){return new ot(this.$num.nb$abs(),this.$den)},nb$bool(){return this.$num.nb$bool()},nb$float(){return div(this.$num,this.$den)}},methods:{as_integer_ratio:{$meth(){return new a([this.$num,this.$den])},$flags:L},limit_denominator:{$meth(t){if(lt(t,x))throw new f("max_denominator should be at least 1");if(ge(t,this.$den))return S(ot,[this]);let[e,n,i,r]=[q,x,x,q],s=this.$num,o=this.$den;for(;;){const a=floorDiv(s,o),$=add(n,mul(a,r));if(lt(t,$))break;[e,n,i,r]=[i,r,add(e,mul(a,i)),$],[s,o]=[o,sub(s,mul(a,o))]}const a=floorDiv(sub(t,n),r),$=S(ot,[add(e,mul(a,i)),add(n,mul(a,r))]),u=S(ot,[i,r]);return ge(_(sub($,this)),_(sub(u,this)))?u:$},$flags:{NamedArgs:["max_denominator"],Defaults:[new n(1e6)]}},__trunc__:{$meth(){return lt(this.$num,q)?floorDiv(this.$num.nb$negative(),this.$den).nb$negative():floorDiv(this.$num,this.$den)},$flags:L},__floor__:{$meth(){return floorDiv(this.$num,this.$den)},$flags:L},__ceil__:{$meth(){return floorDiv(this.$num.nb$negative(),this.$den).nb$negative()},$flags:L},__round__:{$meth(t){if(t===s){const[t,e]=divmod(this.$num,this.$den).valueOf(),n=mul(e,z);return lt(n,this.$den)?t:lt(this.$den,n)?add(t,x):eq(mod(t,z),q)?t:add(t,x)}const e=pow(I,_(t));return lt(q,t)?S(ot,[b(mul(this,e)),e]):S(ot,[mul(b(div(this,e)),e)])},$flags:{NamedArgs:["ndigits"],Defaults:[s]}},__reduce__:{$meth(){return new a([this.ob$type,new a([new h(this)])])},$flags:L},__copy__:{$meth(){return this.ob$type===ot?this:S(this.ob$type,[this.$num,this.$den])},$flags:L},__deepcopy__:{$meth(t){return this.ob$type===ot?this:S(this.ob$type,[this.$num,this.$den])},$flags:P}},classmethods:{from_float:{$meth(t){if(t instanceof n)return S(this,[t]);if(t instanceof $){const[e,n]=S(t.tp$getattr(B)).valueOf();return S(this,[e,n])}throw new m(`${k(this)}.from_float() only takes floats, not ${M(t)}, (${k(t)})`)},$flags:P},from_decimal:{$meth(){throw c("from_decimal not yet implemented in SKulpt")},$flags:P}},getsets:{numerator:{$get(){return this.$num}},denominator:{$get(){return this.$den}},_numerator:{$get(){return this.$num},$set(t){this.$num=t}},_denominator:{$get(){return this.$den},$set(t){this.$den=t}}}}),at=new a([n,ot]),isRational=t=>F(l(t,at));return O}',"src/lib/functools.js":'function $builtinmodule(){const t={};return Sk.misceval.chain(Sk.importModule("collections",!1,!0),(e=>(t._namedtuple=e.$d.namedtuple,functools_mod(t))))}function functools_mod(t){const{object:e,int_:n,str:r,list:s,tuple:a,dict:i,none:{none$:o},bool:{false$:c},NotImplemented:{NotImplemented$:_},bool:l,func:p,method:u,TypeError:h,RuntimeError:d,ValueError:f,NotImplementedError:m,AttributeErrror:w,OverflowError:g,checkNone:$,checkBool:y,checkCallable:k,checkClass:b}=Sk.builtin,{callsimArray:x,callsimOrSuspendArray:A,iterFor:S,chain:E,isIndex:v,asIndexSized:N,isTrue:P,richCompareBool:j,objectRepr:R}=Sk.misceval,{remapToPy:z}=Sk.ffi,{buildNativeClass:q,setUpModuleMethods:T,keywordArrayFromPyDict:I,keywordArrayToPyDict:D,objectHash:C,lookupSpecial:M,copyKeywordsToNamedArgs:W,typeName:F,iter:U,gattr:O}=Sk.abstr,{getSetDict:G,getAttr:B,setAttr:K}=Sk.generic;function proxyFail(t){return new p((()=>{throw new m(t+" is not yet implemented in skulpt")}))}Object.assign(t,{__name__:new r("functools"),__doc__:new r("Tools for working with functions and callable objects"),__all__:new s(["update_wrapper","wraps","WRAPPER_ASSIGNMENTS","WRAPPER_UPDATES","total_ordering","cmp_to_key","cache","lru_cache","reduce","partial","partialmethod","singledispatch","singledispatchmethod","cached_property"].map((t=>new r(t)))),WRAPPER_ASSIGNMENTS:new a(["__module__","__name__","__qualname__","__doc__","__annotations__"].map((t=>new r(t)))),WRAPPER_UPDATES:new a([new r("__dict__")]),singledispatch:proxyFail("singledispatch"),singledispatchmethod:proxyFail("singledispatchmethod"),cached_property:proxyFail("cached_property")});const L=new r("cache_parameters");function _lru_cache(e,n){if(n||(n=c),v(e))(e=N(e,g))<0&&(e=0);else{if(k(e)&&y(n)){const r=e,s=new V(r,e=128,n);return s.tp$setattr(L,new p((()=>z({maxsize:e,typed:n})))),A(t.update_wrapper,[s,r])}if(!$(e))throw new h("Expected first argument to be an integer, a callable, or None")}return new p((r=>{const s=new V(r,e,n);return s.tp$setattr(L,new p((()=>z({maxsize:e,typed:n})))),A(t.update_wrapper,[s,r])}))}const H=t._CacheInfo=x(t._namedtuple,["CacheInfo",["hits","misses","maxsize","currsize"]].map((t=>z(t))),["module",new r("functools")]),V=q("functools._lru_cache_wrapper",{constructor:function _lru_cache_wrapper(t,e,n,r){if(!k(t))throw new h("the first argument must be callable");let s;if($(e))s=infinite_lru_cache_wrapper,e=-1;else{if(!v(e))throw new h("maxsize should be integer or None");(e=N(e,g))<0&&(e=0),s=0===e?uncached_lru_cache_wrapper:bounded_lru_cache_wrapper}this.root={},this.root.prev=this.root.next=this.root,this.wrapper=s,this.maxsize=e,this.typed=n,this.cache=new i([]),this.func=t,this.misses=this.hits=0,this.$d=new i([])},slots:{tp$new(t,e){const[n,r,s,a]=W("_lru_cache_wrapper",["user_function","maxsize","typed","cache_info_type"],t,e);return new V(n,r,s,a)},tp$call(t,e){return this.wrapper(t,e)},tp$descr_get(t,e){return null===t?this:new u(this,t)},tp$doc:"Create a cached callable that wraps another function.\\n\\nuser_function: the function being cached\\n\\nmaxsize: 0 for no caching\\n None for unlimited cache size\\n n for a bounded cache\\n\\ntyped: False cache f(3) and f(3.0) as identical calls\\n True cache f(3) and f(3.0) as distinct calls\\n\\ncache_info_type: namedtuple class with the fields:\\n hits misses currsize maxsize\\n"},methods:{cache_info:{$meth(){return A(H,[this.hits,this.misses,-1===this.maxsize?o:this.maxsize,this.cache.get$size()].map((t=>z(t))))},$flags:{NoArgs:!0},$doc:"Report cache statistics"},cache_clear:{$meth(){return this.hits=this.misses=0,this.root={},this.root.next=this.root.prev=this.root,A(this.cache.tp$getattr(new r("clear"),!0))},$flags:{NoArgs:!0},$doc:"Clear the cache and cache statistics"},__deepcopy__:{$meth(t){return this},$flags:{OneArg:!0}},__copy__:{$meth(){return this},$flags:{NoArgs:!0}}},getsets:{__dict__:G}});function infinite_lru_cache_wrapper(t,e){const n=_make_key(t,e,this.typed),r=this.cache.mp$lookup(n);return void 0!==r?(this.hits++,r):(this.misses++,E(A(this.func,t,e),(t=>(this.cache.mp$ass_subscript(n,t),t))))}function uncached_lru_cache_wrapper(t,e){return this.misses++,A(this.func,t,e)}function bounded_lru_cache_wrapper(t,e){const n=_make_key(t,e,this.typed),r=this.cache.mp$lookup(n);if(void 0!==r){const{result:t}=r;return lru_cache_extract_link(r),lru_cache_append_link(this,r),this.hits++,t}return this.misses++,E(A(this.func,t,e),(t=>{if(void 0!==this.cache.mp$lookup(n))return t;if(this.cache.get$size()t.ob$type)),...i.map((t=>t.ob$type)));else if(1===s.length&&X.has(s[0].ob$type))return s[0];return new J(s)}function partial_adjust_args_kwargs(t,e){if(t=this.arg_arr.concat(t),e){e=D(e);const t=this.kwdict.dict$copy();t.dict$merge(e),e=I(t)}else e=I(this.kwdict);return{args:t,kwargs:e}}function partial_new(t,e){if(t.length<1)throw new h("type \'partial\' takes at least 1 argument");let n,r,s=t.shift();if(s instanceof this.sk$builtinBase){const t=s;s=t.fn,n=t.arg_arr,r=t.kwdict}this.check$func(s),n&&(t=n.concat(t));let a=D(e=e||[]);if(r){const t=r.dict$copy();t.dict$merge(a),a=t}if(this.sk$builtinBase===this.constructor)return new this.constructor(s,t,a);{const e=new this.constructor;return this.sk$builtinBase.call(e,s,t,a),e}}function partial_repr(){if(this.in$repr)return new r("...");this.in$repr=!0;const t=[R(this.fn)];return this.arg_arr.forEach((e=>{t.push(R(e))})),this.kwdict.$items().forEach((([e,n])=>{t.push(e.toString()+"="+R(n))})),this.in$repr=!1,new r(this.tp$name+"("+t.join(", ")+")")}t.partial=q("functools.partial",{constructor:function partial(t,e,n){this.fn=t,this.arg_arr=e,this.arg_tup=new a(e),this.kwdict=n,this.in$repr=!1,this.$d=new i([])},slots:{tp$new:partial_new,tp$call(t,e){return({args:t,kwargs:e}=this.adj$args_kws(t,e)),this.fn.tp$call(t,e)},tp$doc:"partial(func, *args, **keywords) - new function with partial application\\n of the given arguments and keywords.\\n",$r:partial_repr,tp$getattr:B,tp$setattr:K},getsets:{func:{$get(){return this.fn},$doc:"function object to use in future partial calls"},args:{$get(){return this.arg_tup},$doc:"tuple of arguments to future partial calls"},keywords:{$get(){return this.kwdict},$doc:"dictionary of keyword arguments to future partial calls"},__dict__:G},methods:{},classmethods:Sk.generic.classGetItem,proto:{adj$args_kws:partial_adjust_args_kwargs,check$func(t){if(!k(t))throw new h("the first argument must be callable")}}}),t.partialmethod=q("functools.partialmethod",{constructor:function partialmethod(t,e,n){this.fn=t,this.arg_arr=e,this.arg_tup=new a(e),this.kwdict=n},slots:{tp$new:partial_new,tp$doc:"Method descriptor with partial application of the given arguments\\n and keywords.\\n\\n Supports wrapping existing descriptors and handles non-descriptor\\n callables as instance methods.\\n ",$r:partial_repr,tp$descr_get(e,n){let r;if(this.fn.tp$descr_get){const s=this.fn.tp$descr_get(e,n);if(s!==this.fn){if(!k(s))throw new h("type \'partial\' requires a callable");r=new t.partial(s,this.arg_arr.slice(0),this.kwdict.dict$copy());const e=M(s,this.str$self);void 0!==e&&r.tp$setattr(this.str$self,e)}}return void 0===r&&(r=this.make$unbound().tp$descr_get(e,n)),r}},methods:{_make_unbound_method:{$meth(){return this.make$unbound()},$flags:{NoArgs:!0}}},classmethods:Sk.generic.classGetItem,getsets:{func:{$get(){return this.fn},$doc:"function object to use in future partial calls"},args:{$get(){return this.arg_tup},$doc:"tuple of arguments to future partial calls"},keywords:{$get(){return this.kwdict},$doc:"dictionary of keyword arguments to future partial calls"},__dict__:G},proto:{str$self:new r("__self__"),make$unbound(){const t=this;function _method(e,n){const r=e.shift();return({args:e,kwargs:n}=t.adj$args_kws(e,n)),e.unshift(r),A(t.fn,e,n)}return _method.co_fastcall=!0,new p(_method)},adj$args_kws:partial_adjust_args_kwargs,check$func(t){if(!k(t)&&void 0===t.tp$descr_get)throw new h(R(t)+" is not callable or a descriptor")}}});const Y={__lt__:r.$lt,__le__:r.$le,__gt__:r.$gt,__ge__:r.$ge};function from_slot(t,e){const n=Y[t];function compare_slot(t,r){let s=x(t.tp$getattr(n),[r]);return s===_?s:(s=P(s),new l(e(s,t,r)))}return compare_slot.co_name=n,compare_slot}const Z=from_slot("__lt__",((t,e,n)=>!t&&j(e,n,"NotEq"))),tt=from_slot("__lt__",((t,e,n)=>t||j(e,n,"Eq"))),et=from_slot("__lt__",(t=>!t)),nt=from_slot("__le__",((t,e,n)=>!t||j(e,n,"Eq"))),rt=from_slot("__le__",((t,e,n)=>t&&j(e,n,"NotEq"))),st=from_slot("__le__",(t=>!t)),at=from_slot("__gt__",((t,e,n)=>!t&&j(e,n,"NotEq"))),it=from_slot("__gt__",((t,e,n)=>t||j(e,n,"Eq"))),ot=from_slot("__gt__",(t=>!t)),ct=from_slot("__ge__",((t,e,n)=>!t||j(e,n,"Eq"))),_t=from_slot("__ge__",((t,e,n)=>t&&j(e,n,"NotEq"))),lt=from_slot("__ge__",(t=>!t)),pt={__lt__:{__gt__:new p(Z),__le__:new p(tt),__ge__:new p(et)},__le__:{__ge__:new p(nt),__lt__:new p(rt),__gt__:new p(st)},__gt__:{__lt__:new p(at),__ge__:new p(it),__le__:new p(ot)},__ge__:{__le__:new p(ct),__gt__:new p(_t),__lt__:new p(lt)}},ut={__lt__:"ob$lt",__le__:"ob$le",__gt__:"ob$gt",__ge__:"ob$ge"};const ht=new n(0),dt=q("functools.KeyWrapper",{constructor:function(t,e){this.cmp=t,this.obj=e},slots:{tp$call(t,e){const[n]=W("K",["obj"],t,e,[]);return new dt(this.cmp,n)},tp$richcompare(t,e){if(!(t instanceof dt))throw new h("other argument must be K instance");const n=this.obj,r=t.obj;if(!n||!r)throw new w("object");const s=A(this.cmp,[n,r]);return E(s,(t=>j(t,ht,e)))},tp$getattr:B,tp$hash:o},getsets:{obj:{$get(){return this.obj||o},$set(t){this.obj=t},$doc:"Value wrapped by a key function."}}}),ft=new r("update"),mt=new r("__wrapped__");return T("functools",t,{cache:{$meth:function cache(t){return A(_lru_cache(o),[t])},$flags:{OneArg:!0},$doc:\'Simple lightweight unbounded cache. Sometimes called "memoize".\',$textsig:"($module, user_function, /)"},lru_cache:{$meth:_lru_cache,$flags:{NamedArgs:["maxsize","typed"],Defaults:[new n(128),c]},$doc:"Least-recently-used cache decorator.\\n\\nIf *maxsize* is set to None, the LRU features are disabled and the cache\\ncan grow without bound.\\n\\nIf *typed* is True, arguments of different types will be cached separately.\\nFor example, f(3.0) and f(3) will be treated as distinct calls with\\ndistinct results.\\n\\nArguments to the cached function must be hashable.\\n\\nView the cache statistics named tuple (hits, misses, maxsize, currsize)\\nwith f.cache_info(). Clear the cache and statistics with f.cache_clear().\\nAccess the underlying function with f.__wrapped__.\\n\\nSee: http://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)"},cmp_to_key:{$meth:function cmp_to_key(t){return new dt(t)},$flags:{NamedArgs:["mycmp"],Defaults:[]},$doc:"Convert a cmp= function into a key= function.",$textsig:"($module, cmp, /)"},reduce:{$meth:function reduce(t,e,n){const r=U(e);let s;return n=n||r.tp$iternext(!0),E(n,(e=>{if(void 0===e)throw new h("reduce() of empty sequence with no initial value");return s=e,S(r,(e=>E(A(t,[s,e]),(t=>{s=t}))))}),(()=>s))},$flags:{MinArgs:2,MaxArgs:3},$doc:"reduce(function, sequence[, initial]) -> value\\n\\nApply a function of two arguments cumulatively to the items of a sequence,\\nfrom left to right, so as to reduce the sequence to a single value.\\nFor example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates\\n((((1+2)+3)+4)+5). If initial is present, it is placed before the items\\nof the sequence in the calculation, and serves as a default when the\\nsequence is empty.",$textsig:"($module, function, sequence[, initial], /)"},total_ordering:{$meth:function total_ordering(t){const n=[];if(!b(t))throw new h("total ordering only supported for type objects not \'"+F(t)+"\'");if(Object.keys(pt).forEach((r=>{const s=ut[r];t.prototype[s]!==e.prototype[s]&&n.push(r)})),!n.length)throw new f("must define atleast one ordering operation: <, >, <=, >=");const r=n[0];return Object.entries(pt[r]).forEach((([e,r])=>{n.includes(e)||t.tp$setattr(Y[e],r)})),t},$flags:{OneArg:!0},$doc:"Class decorator that fills in missing ordering methods"},update_wrapper:{$meth:function update_wrapper(t,e,n,r){let s,a=U(n);for(let i=a.tp$iternext();void 0!==i;i=a.tp$iternext())void 0!==(s=e.tp$getattr(i))&&t.tp$setattr(i,s);a=U(r);for(let o=a.tp$iternext();void 0!==o;o=a.tp$iternext()){s=e.tp$getattr(o)||new i([]);const n=O(t,o),r=O(n,ft);x(r,[s])}return t.tp$setattr(mt,e),t},$flags:{NamedArgs:["wrapper","wrapped","assigned","updated"],Defaults:[t.WRAPPER_ASSIGNMENTS,t.WRAPPER_UPDATES]},$doc:"Update a wrapper function to look like the wrapped function\\n\\n wrapper is the function to be updated\\n wrapped is the original function\\n assigned is a tuple naming the attributes assigned directly\\n from the wrapped function to the wrapper function (defaults to\\n functools.WRAPPER_ASSIGNMENTS)\\n updated is a tuple naming the attributes of the wrapper that\\n are updated with the corresponding attribute from the wrapped\\n function (defaults to functools.WRAPPER_UPDATES)\\n ",$textsig:"($module, /, wrapper, wrapped, assigned=(\'__module__\', \'__name__\', \'__qualname__\', \'__doc__\', \'__annotations__\'), updated=(\'__dict__\',))"},wraps:{$meth:function wraps(e,n,r){const s=["wrapped",e,"assigned",n,"updated",r];return A(t.partial,[t.update_wrapper],s)},$flags:{NamedArgs:["wrapped","assigned","updated"],Defaults:[t.WRAPPER_ASSIGNMENTS,t.WRAPPER_UPDATES]},$doc:"Decorator factory to apply update_wrapper() to a wrapper function\\n\\n Returns a decorator that invokes update_wrapper() with the decorated\\n function as the wrapper argument and the arguments to wraps() as the\\n remaining arguments. Default arguments are as for update_wrapper().\\n This is a convenience function to simplify applying partial() to\\n update_wrapper().\\n ",$textsig:"($module, /, wrapped, assigned=(\'__module__\', \'__name__\', \'__qualname__\', \'__doc__\', \'__annotations__\'), updated=(\'__dict__\',))"}}),t}',"src/lib/image.js":'var ImageMod,$builtinmodule;ImageMod||((ImageMod={}).canvasLib=[]),$builtinmodule=function(e){var n,t,i,a,u,l,r,s={__name__:new Sk.builtin.str("image")};return s.Image=Sk.misceval.buildClass(s,(function(e,n){u=function(e){e.width=e.image.width,e.height=e.image.height,e.delay=0,e.updateCount=0,e.updateInterval=1,e.lastx=0,e.lasty=0,e.canvas=document.createElement("canvas"),e.canvas.height=e.height,e.canvas.width=e.width,e.ctx=e.canvas.getContext("2d"),e.ctx.drawImage(e.image,0,0),e.imagedata=e.ctx.getImageData(0,0,e.width,e.height)},n.__init__=new Sk.builtin.func((function(e,n){var t;Sk.builtin.pyCheckArgsLen("__init__",arguments.length,2,2);try{e.image=document.getElementById(Sk.ffi.remapToJs(n)),u(e)}catch(i){e.image=null}if(null==e.image)return(t=new Sk.misceval.Suspension).resume=function(){if(t.data.error)throw new Sk.builtin.IOError(t.data.error.message)},t.data={type:"Sk.promise",promise:new Promise((function(t,i){var a=new Image;a.crossOrigin="",a.onerror=function(){i(Error("Failed to load URL: "+a.src))},a.onload=function(){e.image=this,u(e),t()},a.src=r(n)}))},t})),r=function(e){var n,t,i="function"==typeof Sk.imageProxy?Sk.imageProxy:function(e){return(n=document.createElement("a")).href=t,window.location.host!==n.host?Sk.imageProxy+"/"+e:e};return t=i(t=Sk.ffi.remapToJs(e))},l=function(e,n,t){if(n<0||t<0||n>=e.width||t>=e.height)throw new Sk.builtin.ValueError("Pixel index out of range.")};var setdelay=function(e,n,t){var i;Sk.builtin.pyCheckArgsLen("setdelay",arguments.length,2,3),e.delay=Sk.ffi.remapToJs(n),i=Sk.builtin.asnum$(t),e.updateInterval=i||1};n.set_delay=new Sk.builtin.func(setdelay),n.setDelay=new Sk.builtin.func(setdelay);var getpixels=function(e){var n,t=[];for(Sk.builtin.pyCheckArgsLen("getpixels",arguments.length,1,1),n=0;n=e.width?e.lastCtx.putImageData(e.imagedata,e.lastUlx,e.lastUly,0,e.lasty,e.width,2):e.lasty+e.updateInterval>=e.height?e.lastCtx.putImageData(e.imagedata,e.lastUlx,e.lastUly,e.lastx,0,2,e.height):e.lastCtx.putImageData(e.imagedata,e.lastUlx,e.lastUly,Math.min(n,e.lastx),Math.min(t,e.lasty),Math.max(Math.abs(n-e.lastx),1),Math.max(Math.abs(t-e.lasty),1)),e.lastx=n,e.lasty=t,e.delay>0?window.setTimeout(i,e.delay):i()):i()}))},i};var setpixel=function(e,n,t,i){var u;return Sk.builtin.pyCheckArgsLen("setpixel",arguments.length,4,4),n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t),l(e,n,t),u=4*t*e.width+4*n,e.imagedata.data[u]=Sk.builtin.asnum$(Sk.misceval.callsimArray(i.getRed,[i])),e.imagedata.data[u+1]=Sk.builtin.asnum$(Sk.misceval.callsimArray(i.getGreen,[i])),e.imagedata.data[u+2]=Sk.builtin.asnum$(Sk.misceval.callsimArray(i.getBlue,[i])),e.imagedata.data[u+3]=255,a(e,n,t)};n.set_pixel=new Sk.builtin.func(setpixel),n.setPixel=new Sk.builtin.func(setpixel);var setpixelat=function(e,n,t){var i,u,r;return Sk.builtin.pyCheckArgsLen("setpixelat",arguments.length,3,3),i=(n=Sk.builtin.asnum$(n))%e.image.width,u=Math.floor(n/e.image.width),l(e,i,u),r=4*u*e.width+4*i,e.imagedata.data[r]=Sk.builtin.asnum$(Sk.misceval.callsimArray(t.getRed,[t])),e.imagedata.data[r+1]=Sk.builtin.asnum$(Sk.misceval.callsimArray(t.getGreen,[t])),e.imagedata.data[r+2]=Sk.builtin.asnum$(Sk.misceval.callsimArray(t.getBlue,[t])),e.imagedata.data[r+3]=255,a(e,i,u)};n.set_pixel_at=new Sk.builtin.func(setpixelat),n.setPixelAt=new Sk.builtin.func(setpixelat);var updatepixel=function(e,n){var t,i,u;return Sk.builtin.pyCheckArgsLen("updatepixel",arguments.length,2,2),t=Sk.builtin.asnum$(Sk.misceval.callsimArray(n.getX,[n])),i=Sk.builtin.asnum$(Sk.misceval.callsimArray(n.getY,[n])),l(e,t,i),u=4*i*e.width+4*t,e.imagedata.data[u]=Sk.builtin.asnum$(Sk.misceval.callsimArray(n.getRed,[n])),e.imagedata.data[u+1]=Sk.builtin.asnum$(Sk.misceval.callsimArray(n.getGreen,[n])),e.imagedata.data[u+2]=Sk.builtin.asnum$(Sk.misceval.callsimArray(n.getBlue,[n])),e.imagedata.data[u+3]=255,a(e,t,i)};n.update_pixel=new Sk.builtin.func(updatepixel),n.updatePixel=new Sk.builtin.func(updatepixel);var getheight=function(e){return Sk.builtin.pyCheckArgsLen("getheight",arguments.length,1,1),new Sk.builtin.int_(e.height)};n.get_height=new Sk.builtin.func(getheight),n.getHeight=new Sk.builtin.func(getheight);var getwidth=function(e,n){return Sk.builtin.pyCheckArgsLen("getwidth",arguments.length,1,1),new Sk.builtin.int_(e.width)};n.get_width=new Sk.builtin.func(getwidth),n.getWidth=new Sk.builtin.func(getwidth),n.__getattr__=new Sk.builtin.func((function(e,n){return"height"===(n=Sk.ffi.remapToJs(n))?Sk.builtin.assk$(e.height):"width"===n?Sk.builtin.assk$(e.width):void 0})),n.__setattr__=new Sk.builtin.func((function(e,n,t){throw"height"===(n=Sk.ffi.remapToJs(n))||"width"===n?new Sk.builtin.Exception("Cannot change height or width they can only be set on creation"):new Sk.builtin.Exception("Unknown attribute: "+n)})),n.draw=new Sk.builtin.func((function(e,n,t,i){var a;return Sk.builtin.pyCheckArgsLen("draw",arguments.length,2,4),(a=new Sk.misceval.Suspension).resume=function(){return Sk.builtin.none.none$},a.data={type:"Sk.promise",promise:new Promise((function(a,u){var l;n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t),i=Sk.builtin.asnum$(i),l=Sk.misceval.callsimArray(n.getWin,[n]).getContext("2d"),void 0===t&&(t=0,i=0),e.lastUlx=t,e.lastUly=i,e.lastCtx=l,l.putImageData(e.imagedata,t,i),e.delay>0?window.setTimeout(a,e.delay):window.setTimeout(a,200)}))},a}))}),"Image",[]),i=function(e,n){n.__init__=new Sk.builtin.func((function(e,n,t){Sk.builtin.pyCheckArgsLen("__init__",arguments.length,3,3),e.width=Sk.builtin.asnum$(n),e.height=Sk.builtin.asnum$(t),e.canvas=document.createElement("canvas"),e.ctx=e.canvas.getContext("2d"),e.canvas.height=e.height,e.canvas.width=e.width,e.imagedata=e.ctx.getImageData(0,0,e.width,e.height)}))},s.EmptyImage=Sk.misceval.buildClass(s,i,"EmptyImage",[s.Image]),t=function(e,n){n.__init__=new Sk.builtin.func((function(e,n,t,i,a,u){Sk.builtin.pyCheckArgsLen("__init__",arguments.length,4,6),e.red=Sk.builtin.asnum$(n),e.green=Sk.builtin.asnum$(t),e.blue=Sk.builtin.asnum$(i),e.x=Sk.builtin.asnum$(a),e.y=Sk.builtin.asnum$(u)}));var getred=function(e){return Sk.builtin.pyCheckArgsLen("getred",arguments.length,1,1),Sk.builtin.assk$(e.red)};n.get_red=new Sk.builtin.func(getred),n.getRed=new Sk.builtin.func(getred);var getgreen=function(e){return Sk.builtin.pyCheckArgsLen("getgreen",arguments.length,1,1),Sk.builtin.assk$(e.green)};n.get_green=new Sk.builtin.func(getgreen),n.getGreen=new Sk.builtin.func(getgreen);var getblue=function(e){return Sk.builtin.pyCheckArgsLen("getblue",arguments.length,1,1),Sk.builtin.assk$(e.blue)};n.get_blue=new Sk.builtin.func(getblue),n.getBlue=new Sk.builtin.func(getblue);var getx=function(e){return Sk.builtin.pyCheckArgsLen("getx",arguments.length,1,1),Sk.builtin.assk$(e.x)};n.get_x=new Sk.builtin.func(getx),n.getX=new Sk.builtin.func(getx);var gety=function(e){return Sk.builtin.pyCheckArgsLen("gety",arguments.length,1,1),Sk.builtin.assk$(e.y)};n.get_y=new Sk.builtin.func(gety),n.getY=new Sk.builtin.func(gety);var setred=function(e,n){Sk.builtin.pyCheckArgsLen("setred",arguments.length,2,2),e.red=Sk.builtin.asnum$(n)};n.set_red=new Sk.builtin.func(setred),n.setRed=new Sk.builtin.func(setred);var setgreen=function(e,n){Sk.builtin.pyCheckArgsLen("setgreen",arguments.length,2,2),e.green=Sk.builtin.asnum$(n)};n.set_green=new Sk.builtin.func(setgreen),n.setGreen=new Sk.builtin.func(setgreen);var setblue=function(e,n){Sk.builtin.pyCheckArgsLen("setblue",arguments.length,2,2),e.blue=Sk.builtin.asnum$(n)};n.set_blue=new Sk.builtin.func(setblue),n.setBlue=new Sk.builtin.func(setblue),n.__getattr__=new Sk.builtin.func((function(e,n){return"red"===(n=Sk.ffi.remapToJs(n))?Sk.builtin.assk$(e.red):"green"===n?Sk.builtin.assk$(e.green):"blue"===n?Sk.builtin.assk$(e.blue):void 0})),n.__setattr__=new Sk.builtin.func((function(e,n,t){"red"!==(n=Sk.ffi.remapToJs(n))&&"green"!==n&&"blue"!==n||(e[n]=Sk.builtin.asnum$(t))}));var setx=function(e,n){Sk.builtin.pyCheckArgsLen("setx",arguments.length,2,2),e.x=Sk.builtin.asnum$(n)};n.set_x=new Sk.builtin.func(setx),n.setX=new Sk.builtin.func(setx);var sety=function(e,n){Sk.builtin.pyCheckArgsLen("sety",arguments.length,2,2),e.y=Sk.builtin.asnum$(n)};n.set_y=new Sk.builtin.func(sety),n.setY=new Sk.builtin.func(sety),n.__getitem__=new Sk.builtin.func((function(e,n){return 0===(n=Sk.builtin.asnum$(n))?e.red:1==n?e.green:2==n?e.blue:void 0})),n.__str__=new Sk.builtin.func((function(e){return Sk.ffi.remapToPy("["+e.red+","+e.green+","+e.blue+"]")})),n.getColorTuple=new Sk.builtin.func((function(e,n,t){})),n.setRange=new Sk.builtin.func((function(e,n){e.max=Sk.builtin.asnum$(n)}))},s.Pixel=Sk.misceval.buildClass(s,t,"Pixel",[]),n=function(e,n){n.__init__=new Sk.builtin.func((function(e,n,t){var i,a,u;Sk.builtin.pyCheckArgsLen("__init__",arguments.length,1,3),void 0===(i=ImageMod.canvasLib[Sk.canvas])?(a=document.createElement("canvas"),u=document.getElementById(Sk.canvas),e.theScreen=a,u.appendChild(a),ImageMod.canvasLib[Sk.canvas]=a,ImageMod.canvasLib[Sk.canvas]=e.theScreen):(e.theScreen=i,e.theScreen.height=e.theScreen.height),void 0!==n?(e.theScreen.height=t.v,e.theScreen.width=n.v):(Sk.availableHeight&&(e.theScreen.height=Sk.availableHeight),Sk.availableWidth&&(e.theScreen.width=Sk.availableWidth)),e.theScreen.style.display="block"})),n.getWin=new Sk.builtin.func((function(e){return e.theScreen})),n.exitonclick=new Sk.builtin.func((function(e){var n=e.theScreen.id;e.theScreen.onclick=function(){document.getElementById(n).style.display="none",document.getElementById(n).onclick=null,delete ImageMod.canvasLib[n]}}))},s.ImageWin=Sk.misceval.buildClass(s,n,"ImageWin",[]),s};',"src/lib/itertools.js":'var $builtinmodule=function(t){var e={};function combinationsNew(t,e,i){let r,s;[r,s]=Sk.abstr.copyKeywordsToNamedArgs(t.tp$name,["iterable","r"],e,i,[]);const n=Sk.misceval.arrayFromIterable(r);if(s=Sk.misceval.asIndexSized(s,Sk.builtin.OverFlowError),s<0)throw new Sk.builtin.ValueError("r must be non-negative");if(this===t)return new t.constructor(n,s);{const e=new this.constructor;return t.constructor.call(e,n,s),e}}return e.accumulate=Sk.abstr.buildIteratorClass("itertools.accumulate",{constructor:function accumulate(t,e,i){this.iter=t,this.func=e,this.total=i,this.tp$iternext=()=>(this.total=Sk.builtin.checkNone(this.total)?this.iter.tp$iternext():this.total,this.tp$iternext=this.constructor.prototype.tp$iternext,this.total)},iternext(t){let e=this.iter.tp$iternext();if(void 0!==e)return this.total=Sk.misceval.callsimArray(this.func,[this.total,e]),this.total},slots:{tp$doc:"accumulate(iterable[, func, initial]) --\\x3e accumulate object\\n\\nReturn series of accumulated sums (or other binary function results).",tp$new(t,i){Sk.abstr.checkArgsLen("accumulate",t,0,2);let[r,s,n]=Sk.abstr.copyKeywordsToNamedArgs("accumulate",["iterable","func","initial"],t,i,[Sk.builtin.none.none$,Sk.builtin.none.none$]);if(r=Sk.abstr.iter(r),s=Sk.builtin.checkNone(s)?new Sk.builtin.func(((t,e)=>Sk.abstr.numberBinOp(t,e,"Add"))):s,this===e.accumulate.prototype)return new e.accumulate(r,s,n);{const t=new this.constructor;return e.accumulate.call(t,r,s,n),t}}}}),e.chain=Sk.abstr.buildIteratorClass("itertools.chain",{constructor:function chain(t){this.iterables=t,this.current_it=null,this.tp$iternext=()=>{if(this.tp$iternext=this.constructor.prototype.tp$iternext,this.current_it=this.iterables.tp$iternext(),void 0!==this.current_it)return this.current_it=Sk.abstr.iter(this.current_it),this.tp$iternext();this.tp$iternext=()=>{}}},iternext(t){let e;for(;void 0===e;){if(e=this.current_it.tp$iternext(),void 0!==e)return e;if(this.current_it=this.iterables.tp$iternext(),void 0===this.current_it)return void(this.tp$iternext=()=>{});this.current_it=Sk.abstr.iter(this.current_it)}},slots:{tp$doc:"chain(*iterables) --\\x3e chain object\\n\\nReturn a chain object whose .__next__() method returns elements from the\\nfirst iterable until it is exhausted, then elements from the next\\niterable, until all of the iterables are exhausted.",tp$new(t,i){if(Sk.abstr.checkNoKwargs("chain",i),t=new Sk.builtin.tuple(t.slice(0)).tp$iter(),this===e.chain.prototype)return new e.chain(t);{const i=new this.constructor;return e.chain.call(i,t),i}}},classmethods:Object.assign({from_iterable:{$meth(t){const i=Sk.abstr.iter(t);return new e.chain(i)},$flags:{OneArg:!0},$doc:"chain.from_iterable(iterable) --\\x3e chain object\\n\\nAlternate chain() constructor taking a single iterable argument\\nthat evaluates lazily.",$textsig:null}},Sk.generic.classGetItem)}),e.combinations=Sk.abstr.buildIteratorClass("itertools.combinations",{constructor:function combinations(t,e){this.pool=t,this.r=e,this.indices=new Array(e).fill().map(((t,e)=>e)),this.n=t.length,this.tp$iternext=()=>{if(!(this.r>this.n))return this.tp$iternext=this.constructor.prototype.tp$iternext,new Sk.builtin.tuple(this.pool.slice(0,this.r))}},iternext(t){let e,i=!1;for(e=this.r-1;e>=0;e--)if(this.indices[e]!=e+this.n-this.r){i=!0;break}if(!i)return void(this.r=0);this.indices[e]++;for(let s=e+1;sthis.pool[t]));return new Sk.builtin.tuple(r)},slots:{tp$doc:"combinations(iterable, r) --\\x3e combinations object\\n\\nReturn successive r-length combinations of elements in the iterable.\\n\\ncombinations(range(4), 3) --\\x3e (0,1,2), (0,1,3), (0,2,3), (1,2,3)",tp$new(t,i){return combinationsNew.call(this,e.combinations.prototype,t,i)}}}),e.combinations_with_replacement=Sk.abstr.buildIteratorClass("itertools.combinations_with_replacement",{constructor:function combinations_with_replacement(t,e){this.pool=t,this.r=e,this.indices=new Array(e).fill(0),this.n=t.length,this.tp$iternext=()=>{if(this.r&&!this.n)return;this.tp$iternext=this.constructor.prototype.tp$iternext;const t=this.indices.map((t=>this.pool[t]));return new Sk.builtin.tuple(t)}},iternext(t){let e,i=!1;for(e=this.r-1;e>=0;e--)if(this.indices[e]!=this.n-1){i=!0;break}if(!i)return void(this.r=0);const r=this.indices[e]+1;for(let n=e;nthis.pool[t]));return new Sk.builtin.tuple(s)},slots:{tp$doc:"combinations_with_replacement(iterable, r) --\\x3e combinations_with_replacement object\\n\\nReturn successive r-length combinations of elements in the iterable\\nallowing individual elements to have successive repeats.\\ncombinations_with_replacement(\'ABC\', 2) --\\x3e AA AB AC BB BC CC",tp$new(t,i){return combinationsNew.call(this,e.combinations_with_replacement.prototype,t,i)}}}),e.compress=Sk.abstr.buildIteratorClass("itertools.compress",{constructor:function compress(t,e){this.data=t,this.selectors=e},iternext(){let t=this.data.tp$iternext(),e=this.selectors.tp$iternext();for(;void 0!==t&&void 0!==e;){if(Sk.misceval.isTrue(e))return t;t=this.data.tp$iternext(),e=this.selectors.tp$iternext()}},slots:{tp$doc:"compress(data, selectors) --\\x3e iterator over selected data\\n\\nReturn data elements corresponding to true selector elements.\\nForms a shorter iterator from selected data elements using the\\nselectors to choose the data elements.",tp$new(t,i){let r,s;if([r,s]=Sk.abstr.copyKeywordsToNamedArgs("compress",["data","selectors"],t,i,[]),r=Sk.abstr.iter(r),s=Sk.abstr.iter(s),this===e.count.prototype)return new e.compress(r,s);{const t=new this.constructor;return e.compress.call(t,r,s),t}}}}),e.count=Sk.abstr.buildIteratorClass("itertools.count",{constructor:function count(t,e){this.start=t,this.step=e},iternext(){const t=this.start;return this.start=Sk.abstr.numberBinOp(this.start,this.step,"Add"),t},slots:{tp$doc:"count(start=0, step=1) --\\x3e count object\\n\\nReturn a count object whose .__next__() method returns consecutive values.\\nEquivalent to:\\n\\n def count(firstval=0, step=1):\\n x = firstval\\n while 1:\\n yield x\\n x += step\\n",tp$new(t,i){const[r,s]=Sk.abstr.copyKeywordsToNamedArgs("count",["start","step"],t,i,[new Sk.builtin.int_(0),new Sk.builtin.int_(1)]);if(!Sk.builtin.checkNumber(r)&&!Sk.builtin.checkComplex(r))throw new Sk.builtin.TypeError("a number is required");if(!Sk.builtin.checkNumber(s)&&!Sk.builtin.checkComplex(s))throw new Sk.builtin.TypeError("a number is required");if(this===e.count.prototype)return new e.count(r,s);{const t=new this.constructor;return e.count.call(t,r,s),t}},$r(){const t=Sk.misceval.objectRepr(this.start);let e=Sk.misceval.objectRepr(this.step);return e="1"===e?"":", "+e,new Sk.builtin.str(Sk.abstr.typeName(this)+"("+t+e+")")}}}),e.cycle=Sk.abstr.buildIteratorClass("itertools.cycle",{constructor:function cycle(t){this.iter=t,this.saved=[],this.consumed=!1,this.i=0,this.length},iternext(){let t;if(!this.consumed){if(t=this.iter.tp$iternext(),void 0!==t)return this.saved.push(t),t;if(this.consumed=!0,this.length=this.saved.length,!this.length)return}return t=this.saved[this.i],this.i=(this.i+1)%this.length,t},slots:{tp$doc:"cycle(iterable) --\\x3e cycle object\\n\\nReturn elements from the iterable until it is exhausted.\\nThen repeat the sequence indefinitely.",tp$new(t,i){Sk.abstr.checkOneArg("cycle",t,i);const r=Sk.abstr.iter(t[0]);if(this===e.cycle.prototype)return new e.cycle(r);{const t=new this.constructor;return e.cycle.call(t,r),t}}}}),e.dropwhile=Sk.abstr.buildIteratorClass("itertools.dropwhile",{constructor:function dropwhile(t,e){this.predicate=t,this.iter=e,this.passed},iternext(){let t=this.iter.tp$iternext();for(;void 0===this.passed&&void 0!==t;){const e=Sk.misceval.callsimArray(this.predicate,[t]);if(!Sk.misceval.isTrue(e))return this.passed=!0,t;t=this.iter.tp$iternext()}return t},slots:{tp$doc:"dropwhile(predicate, iterable) --\\x3e dropwhile object\\n\\nDrop items from the iterable while predicate(item) is true.\\nAfterwards, return every element until the iterable is exhausted.",tp$new(t,i){Sk.abstr.checkNoKwargs("dropwhile",i),Sk.abstr.checkArgsLen("dropwhile",t,2,2);const r=t[0],s=Sk.abstr.iter(t[1]);if(this===e.dropwhile.prototype)return new e.dropwhile(r,s);{const t=new this.constructor;return e.dropwhile.call(t,r,s),t}}}}),e.filterfalse=Sk.abstr.buildIteratorClass("itertools.filterfalse",{constructor:function filterfalse(t,e){this.predicate=t,this.iter=e},iternext(t){let e=this.iter.tp$iternext();if(void 0===e)return;let i=Sk.misceval.callsimArray(this.predicate,[e]);for(;Sk.misceval.isTrue(i);){if(e=this.iter.tp$iternext(),void 0===e)return;i=Sk.misceval.callsimArray(this.predicate,[e])}return e},slots:{tp$doc:"filterfalse(function or None, sequence) --\\x3e filterfalse object\\n\\nReturn those items of sequence for which function(item) is false.\\nIf function is None, return the items that are false.",tp$new(t,i){Sk.abstr.checkNoKwargs("filterfalse",i),Sk.abstr.checkArgsLen("filterfalse",t,2,2);const r=Sk.builtin.checkNone(t[0])?Sk.builtin.bool:t[0],s=Sk.abstr.iter(t[1]);if(this===e.filterfalse.prototype)return new e.filterfalse(r,s);{const t=new this.constructor;return e.filterfalse.call(t,r,s),t}}}}),e._grouper=Sk.abstr.buildIteratorClass("itertools._grouper",{constructor:function _grouper(t,e){this.groupby=t,this.tgtkey=t.tgtkey,this.id=t.id},iternext(t){const e=Sk.misceval.richCompareBool(this.groupby.currkey,this.tgtkey,"Eq");if(this.groupby.id===this.id&&e){let t=this.groupby.currval;return this.groupby.currval=this.groupby.iter.tp$iternext(),void 0!==this.groupby.currval&&(this.groupby.currkey=Sk.misceval.callsimArray(this.groupby.keyf,[this.groupby.currval])),t}}}),e.groupby=Sk.abstr.buildIteratorClass("itertools.groupby",{constructor:function groupby(t,e){this.iter=t,this.keyf=e,this.currval,this.currkey=this.tgtkey=new Sk.builtin.object,this.id},iternext(t){this.id=new Object;let i=Sk.misceval.richCompareBool(this.currkey,this.tgtkey,"Eq");for(;i;){if(this.currval=this.iter.tp$iternext(),void 0===this.currval)return;this.currkey=Sk.misceval.callsimArray(this.keyf,[this.currval]),i=Sk.misceval.richCompareBool(this.currkey,this.tgtkey,"Eq")}this.tgtkey=this.currkey;const r=new e._grouper(this);return new Sk.builtin.tuple([this.currkey,r])},slots:{tp$doc:"groupby(iterable, key=None) -> make an iterator that returns consecutive\\nkeys and groups from the iterable. If the key function is not specified or\\nis None, the element itself is used for grouping.\\n",tp$new(t,i){let r,s;if([r,s]=Sk.abstr.copyKeywordsToNamedArgs("groupby",["iterable","key"],t,i,[Sk.builtin.none.none$]),r=Sk.abstr.iter(r),s=Sk.builtin.checkNone(s)?new Sk.builtin.func((t=>t)):s,this===e.groupby.prototype)return new e.groupby(r,s);{const t=new this.constructor;return e.groupby.call(t,r,s),t}}}}),e.islice=Sk.abstr.buildIteratorClass("itertools.islice",{constructor:function islice(t,e,i,r){this.iter=t,this.previt=e,this.stop=i,this.step=r,this.tp$iternext=()=>{if(this.tp$iternext=this.constructor.prototype.tp$iternext,!(this.previt>=this.stop)){for(let t=0;t=this.stop)){for(let t=this.previt+1;tNumber.MAX_SAFE_INTEGER)throw new Sk.builtin.ValueError("Stop for islice() must be None or an integer: 0 <= x <= sys.maxsize.");if(!Sk.builtin.checkNone(s)&&!Sk.misceval.isIndex(s))throw new Sk.builtin.ValueError("Indices for islice() must be None or an integer: 0 <= x <= sys.maxsize.");if(s=Sk.builtin.checkNone(s)?0:Sk.misceval.asIndexSized(s),s<0||s>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.ValueError("Indices for islice() must be None or an integer: 0 <= x <= sys.maxsize.");if(!Sk.builtin.checkNone(o)&&!Sk.misceval.isIndex(o))throw new Sk.builtin.ValueError("Step for islice() must be a positive integer or None");if(o=Sk.builtin.checkNone(o)?1:Sk.misceval.asIndexSized(o),o<=0||o>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.ValueError("Step for islice() must be a positive integer or None.");if(this===e.islice.prototype)return new e.islice(r,s,n,o);{const t=new this.constructor;return e.islice.call(t,r,s,n,o),t}}}}),e.permutations=Sk.abstr.buildIteratorClass("itertools.permutations",{constructor:function permutations(t,e){this.pool=t,this.r=e;const i=t.length;this.indices=new Array(i).fill().map(((t,e)=>e)),this.cycles=new Array(e).fill().map(((t,e)=>i-e)),this.n=i,this.tp$iternext=()=>{if(!(this.r>this.n))return this.tp$iternext=this.constructor.prototype.tp$iternext,new Sk.builtin.tuple(this.pool.slice(0,this.r))}},iternext(t){for(let e=this.r-1;e>=0;e--){if(this.cycles[e]--,0!=this.cycles[e]){const t=this.cycles[e];[this.indices[e],this.indices[this.n-t]]=[this.indices[this.n-t],this.indices[e]];const i=this.indices.map((t=>this.pool[t])).slice(0,this.r);return new Sk.builtin.tuple(i)}this.indices.push(this.indices.splice(e,1)[0]),this.cycles[e]=this.n-e}this.r=0},slots:{tp$doc:"permutations(iterable[, r]) --\\x3e permutations object\\n\\nReturn successive r-length permutations of elements in the iterable.\\n\\npermutations(range(3), 2) --\\x3e (0,1), (0,2), (1,0), (1,2), (2,0), (2,1)",tp$new(t,i){let r,s;[r,s]=Sk.abstr.copyKeywordsToNamedArgs("permutations",["iterable","r"],t,i,[Sk.builtin.none.none$]);const n=Sk.misceval.arrayFromIterable(r);if(s=Sk.builtin.checkNone(s)?n.length:Sk.misceval.asIndexSized(s,Sk.builtin.OverFlowError),s<0)throw new Sk.builtin.ValueError("r must be non-negative");if(this===e.permutations.prototype)return new e.permutations(n,s);{const t=new this.constructor;return e.permutations.call(t,n,s),t}}}}),e.product=Sk.abstr.buildIteratorClass("itertools.product",{constructor:function product(t){this.pools=t,this.n=t.length,this.indices=Array(t.length).fill(0),this.pool_sizes=t.map((t=>t.length)),this.tp$iternext=()=>{this.tp$iternext=this.constructor.prototype.tp$iternext;const t=this.indices.map(((t,e)=>this.pools[e][this.indices[e]]));if(!t.some((t=>void 0===t)))return new Sk.builtin.tuple(t);this.n=0}},iternext(t){let e=this.n-1;for(;e>=0&&e=this.pool_sizes[e]?(this.indices[e]=-1,e--):e++;if(this.n&&!this.indices.every((t=>-1===t))){const t=this.indices.map(((t,e)=>this.pools[e][this.indices[e]]));return new Sk.builtin.tuple(t)}this.n=0},slots:{tp$doc:"product(*iterables, repeat=1) --\\x3e product object\\n\\nCartesian product of input iterables. Equivalent to nested for-loops.\\n\\nFor example, product(A, B) returns the same as: ((x,y) for x in A for y in B).\\nThe leftmost iterators are in the outermost for-loop, so the output tuples\\ncycle in a manner similar to an odometer (with the rightmost element changing\\non every iteration).\\n\\nTo compute the product of an iterable with itself, specify the number\\nof repetitions with the optional repeat keyword argument. For example,\\nproduct(A, repeat=4) means the same as product(A, A, A, A).\\n\\nproduct(\'ab\', range(3)) --\\x3e (\'a\',0) (\'a\',1) (\'a\',2) (\'b\',0) (\'b\',1) (\'b\',2)\\nproduct((0,1), (0,1), (0,1)) --\\x3e (0,0,0) (0,0,1) (0,1,0) (0,1,1) (1,0,0) ...",tp$new(t,i){let[r]=Sk.abstr.copyKeywordsToNamedArgs("product",["repeat"],[],i,[new Sk.builtin.int_(1)]);if(r=Sk.misceval.asIndexSized(r,Sk.builtin.OverFlowError),r<0)throw new Sk.builtin.ValueError("repeat argument cannot be negative");const s=[];for(let e=0;ethis.object)},iternext(t){return this.times-- >0?this.object:void 0},slots:{tp$doc:"repeat(object [,times]) -> create an iterator which returns the object\\nfor the specified number of times. If not specified, returns the object\\nendlessly.",tp$new(t,i){let r,s;if([r,s]=Sk.abstr.copyKeywordsToNamedArgs("repeat",["object","times"],t,i,[null]),s=null!==s?Sk.misceval.asIndexSized(s,Sk.builtin.OverFlowError):void 0,this===e.repeat.prototype)return new e.repeat(r,s);{const t=new this.constructor;return e.repeat.call(t,r,s),t}},$r(){const t=Sk.misceval.objectRepr(this.object),e=void 0===this.times?"":", "+(this.times>=0?this.times:0);return new Sk.builtin.str(Sk.abstr.typeName(this)+"("+t+e+")")}},methods:{__lenght_hint__:{$meth(){if(void 0===this.times)throw new Sk.builtin.TypeError("len() of unsized object");return new Sk.builtin.int_(this.times)},$flags:{NoArgs:!0},$textsig:null}}}),e.starmap=Sk.abstr.buildIteratorClass("itertools.starmap",{constructor:function starmap(t,e){this.func=t,this.iter=e},iternext(t){const e=this.iter.tp$iternext();if(void 0===e)return;const i=Sk.misceval.arrayFromIterable(e);return Sk.misceval.callsimArray(this.func,i)},slots:{tp$new(t,i){let r,s;if([r,s]=Sk.abstr.copyKeywordsToNamedArgs("starmap",["func","iterable"],t,i,[]),s=Sk.abstr.iter(s),r=Sk.builtin.checkNone(r)?Sk.builtin.bool:r,this===e.starmap.prototype)return new e.starmap(r,s);{const t=new this.constructor;return e.starmap.call(t,r,s),t}}}}),e.takewhile=Sk.abstr.buildIteratorClass("itertools.takewhile",{constructor:function takewhile(t,e){this.predicate=t,this.iter=e},iternext(){const t=this.iter.tp$iternext();if(void 0!==t){const e=Sk.misceval.callsimArray(this.predicate,[t]);if(Sk.misceval.isTrue(e))return t;this.tp$iternext=()=>{}}},slots:{tp$doc:"takewhile(predicate, iterable) --\\x3e takewhile object\\n\\nReturn successive entries from an iterable as long as the \\npredicate evaluates to true for each entry.",tp$new(t,i){Sk.abstr.checkNoKwargs("takewhile",i),Sk.abstr.checkArgsLen("takewhile",t,2,2);const r=t[0],s=Sk.abstr.iter(t[1]);if(this===e.takewhile.prototype)return new e.takewhile(r,s);{const t=new this.constructor;return e.takewhile.call(t,r,s),t}}}}),e.tee=new Sk.builtin.func((function(){throw new Sk.builtin.NotImplementedError("tee is not yet implemented in Skulpt")})),e.zip_longest=Sk.abstr.buildIteratorClass("itertools.zip_longest",{constructor:function zip_longest(t,e){this.iters=t,this.fillvalue=e,this.active=this.iters.length},iternext(t){if(!this.active)return;let i;const r=[];for(let s=0;s{throw new a(e+" is not yet implemented in skulpt")}))}const j=E.JSONDecodeError=N("json.JSONDecodeError",{base:l,constructor:function JSONDecodeError(e,t,n){const r=t.slice(0,n),o=r.split("\\n").length,s=n-r.lastIndexOf("\\n"),i=`${e}: line ${o} column ${s} (char ${n})`;l.call(this,i),this.$msg=e,this.$doc=t,this.$pos=n,this.$lineno=o,this.$colno=s},getsets:Object.fromEntries(["msg","doc","pos","lineno","colno"].map((e=>[e,{$get(){return g(this["$"+e])}}])))});class JSONEncoder{constructor(e,t,n,r,o,s,i,l){this.skipkeys=e,this.ensure_ascii=t,this.check_circular=n,this.allow_nan=r,this.indent=o,this.separators=s,this.sort_keys=l,this.item_separator=", ",this.key_separator=": ",null!==this.separators?[this.item_separator,this.key_separator]=this.separators:null!==this.indent&&(this.item_separator=","),null!==i&&(this.default=i),this.encoder=this.make_encoder()}default(e){throw new i(`Object of type ${y(e)} is not JSON serializable`)}encode(t){return new e(this.encoder(t))}make_encoder(){let e,t;e=this.check_circular?new Set:null,t=(this.ensure_ascii,JSON.stringify);return function _make_iterencode(e,t,n,r,s,a,u,h,d){null!==r&&"string"!=typeof r&&(r=" ".repeat(r));let f,p,g,w;null!==e?(f=t=>{if(e.has(t))throw new l("Circular reference detected");e.add(t)},p=t=>e.delete(t)):(f=e=>{},p=e=>{});null!==r?(g=(e,t)=>{t+=1;const n="\\n"+r.repeat(t);return[e+=n,t,u+n]},w=(e,t,n)=>(n-=1,e+="\\n"+r.repeat(n)+t)):(g=(e,t)=>[e,t,u],w=(e,t,n)=>e+t);const _unhandled=(e,n)=>{f(e);const r=_iterencode(t(e),n);return p(e),r},_iterencode_list=(e,t)=>{if(!e.length)return"[]";let n,r;f(e),[n,t,r]=g("[",t);let o=!0;for(let s of e)o?o=!1:n+=r,n+=_iterencode(s,t);return p(e),w(n,"]",t)},_iterencode_dict=(e,t)=>{if(!e.sq$length())return"{}";let r,l;f(e),[r,t,l]=g("{",t);let u=!0;if(h){const t=$(e.tp$getattr(v)),n=c(t);e=$(o,[n])}for(let[o,c]of e.$items()){const e=o.valueOf(),h=typeof e;if("string"===h)o=e;else if("number"===h)o=s(o);else if("boolean"===h||null===e)o=String(e);else{if(!JSBI.__isBigInt(e)){if(d)continue;throw new i("keys must be str, int, float, bool or None, not "+y(o))}o=e.toString()}u?u=!1:r+=l,r+=n(o),r+=a,r+=_iterencode(c,t)}return p(e),w(r,"}",t)},_iterencode=(e,t=0)=>String(m(e,{stringHook:e=>n(e),numberHook:(e,t)=>s(t),bigintHook:e=>e.toString(),dictHook:e=>_iterencode_dict(e,t),arrayHook:e=>_iterencode_list(e,t),setHook:e=>_unhandled(e,t),funcHook:(e,n)=>_unhandled(n,t),objecthook:(e,n)=>_unhandled(n,t),unhandledHook:e=>_unhandled(e,t)}));return _iterencode}(e,this.default,t,this.indent,((e,t=this.allow_nan)=>{const n=e.valueOf();let r;if(Number.isFinite(n))return J(e);if(r=n.toString(),!t)throw new l("Out of range float values are not JSON compliant: "+J(e));return r}),this.key_separator,this.item_separator,this.sort_keys,this.skipkeys)}}const v=new e("items");const x=[!1,!0,!0,!0,null,null,null,!1],D=new JSONEncoder(...x),F=/(-?(?:0|[1-9]\\d*))(\\.\\d+)?([eE][-+]?\\d+)?/;const I=/"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"/m;function scanstring(t,n){const r=t.substring(n-1).match(I);if(null===r)throw new j("Unterminated string starting at",t,n-1);try{return[new e(JSON.parse(r[0])),n+r[0].length-1]}catch(o){let e=o.message.match(/(?:column|position) (\\d+)/);e=e&&Number(e[1]);n=n+(e||0)-(void 0===o.columnNumber?1:2);const r=o.message.replace("JSON.parse: ","").replace(/ at line \\d+ column \\d+ of the JSON data/,"").replace(/ in JSON at position \\d+$/,"");throw new j(r,t,n)}}const A=/[ \\t\\n\\r]*/;function JSONArray(e,t,r){const o=[];let s=e[t];const adjust_white_space=()=>{if(" "===s||"\\t"===s||"\\n"===s||"\\r"===s){const n=e.substring(t).match(A);t+=n[0].length,s=e[t]}};if(adjust_white_space(),"]"===s)return[new n([]),t+1];for(;;){let n;if([n,t]=r(e,t),void 0===n)throw new j("Expecting value",e,t);if(o.push(n),s=e[t],adjust_white_space(),t++,"]"===s)break;if(","!==s)throw new j("Expecting \',\' delimiter",e,t-1);s=e[t],adjust_white_space()}return[new n(o),t]}function JSONObject(e,t,s,i,l){let a=[],c=e[t];const adjust_white_space=()=>{if(" "===c||"\\t"===c||"\\n"===c||"\\r"===c){const n=e.substring(t).match(A);t+=n[0].length,c=e[t]}};if(\'"\'!==c){if(adjust_white_space(),"}"===c){if(null!==l){return[l(new n([])),t+1]}return a=new o([]),null!==i&&(a=i(a)),[a,t+1]}if(\'"\'!==c)throw new j("Expecting property name enclosed in double quotes",e,t)}let u,h;for(t+=1;;){if([u,t]=scanstring(e,t),":"!==(c=e[t])&&(adjust_white_space(),":"!==e[t]))throw new j("Expecting \':\' delimiter",e,t);if(c=e[++t],adjust_white_space(),[h,t]=s(e,t),void 0===h)throw new j("Expecting value",e,t);if(c=e[t],a.push([u,h]),adjust_white_space(),t++,"}"===c)break;if(","!==c)throw new j("Expecting \',\' delimiter",e,t-1);if(c=e[t],adjust_white_space(),t++,\'"\'!==c)throw new j("Expecting property name enclosed in double quotes",e,t-1)}if(null!==l){return[l(new n(a.map((e=>new r(e))))),t]}return a=new o(a.flat()),null!==i&&(a=i(a)),[a,t]}const H={NaN:new t(NaN),Infinity:new t(1/0),"-Infinity":new t(-1/0)};class JSONDecoder{constructor(e,t,n,r,o){this.object_hook=e,this.parse_float=t||w,this.parse_int=n||_,this.parse_constant=r||(e=>H[e]),this.object_pairs_hook=o,this.parse_object=JSONObject,this.parse_array=JSONArray,this.parse_string=scanstring,this.scan_once=function make_scanner(e){const{parse_object:t,parse_array:n,parse_string:r,parse_float:o,parse_int:s,parse_constant:i,object_hook:l,object_pairs_hook:a}=e,scan_once=(e,c)=>{const f=e[c];if(void 0===f)return[f,c];if(\'"\'===f)return r(e,c+1);if("{"===f)return t(e,c+1,scan_once,l,a);if("["===f)return n(e,c+1,scan_once);if("n"===f&&"null"===e.substring(c,c+4))return[u,c+4];if("t"===f&&"true"===e.substring(c,c+4))return[h,c+4];if("f"===f&&"false"===e.substring(c,c+5))return[d,c+5];const p=e.substring(c).match(F);if(null!==p){let e;const[t,n,r,i]=p;return e=r||i?o(n+(r||"")+(i||"")):s(n),[e,c+t.length]}return"N"===f&&"NaN"===e.substring(c,c+3)?[i("NaN"),c+3]:"I"==f&&"Infinity"===e.substring(c,c+8)?[i("Infinity"),c+8]:"-"==f&&"-Infinity"===e.substring(c,c+9)?[i("-Infinity"),c+9]:[void 0,c]};return scan_once}(this)}white(e,t){const n=(0===t?e:e.substring(t)).match(A);return null!==n&&(t+=n[0].length),t}decode(e){e=e.toString();let[t,n]=this.scan_once(e,this.white(e,0));if(void 0===t)throw new j("Expecting value",e,n);if(n=this.white(e,n),n!==e.length)throw new j("Extra data",e,n);return t}}const T=Array(5).fill(null),C=new JSONDecoder(...T);function convertToNullOrFunc(e){return null===e||e===u?null:t=>$(e,[g(t)])}return k("json",E,{loads:{$meth(e,t){O("dumps",e);let n=e[0];if(f(n));else{if(!p(n))throw new i(`the JSON object must be str or bytes, not ${y(n)}`);n=(new TextDecoder).decode(n.valueOf())}const r=S("dumps",["object_hook","parse_float","parse_int","parse_constant","object_pairs_hook"],[],t,T).map(convertToNullOrFunc);return r.every((e=>null===e))?C.decode(n):new JSONDecoder(...r).decode(n)},$doc:"Deserialize ``s`` (a ``str`` or ``bytes`` instance containing a JSON document) to a Python object.",$flags:{FastCall:!0}},dumps:{$meth(e,t){O("dumps",e);const n=e[0];let[r,o,s,l,a,c,u,h]=S("loads",["skipkeys","ensure_ascii","check_circular","allow_nan","indent","separators","default","sort_keys"],[],t,x);if(r=b(r),o=b(o),s=b(s),l=b(l),a=m(a),c=m(c),u=convertToNullOrFunc(u),h=b(h),!r&&o&&s&&l&&null===a&&null===c&&null===u&&!h)return D.encode(n);if(null===c);else if(!Array.isArray(c)||2!==c.length||"string"!=typeof c[0]||"string"!=typeof c[1])throw new i("separators shuld be a list or tuple of strings of length 2");return new JSONEncoder(r,o,s,l,a,c,u,h).encode(n)},$doc:"Serialize ``obj`` to a JSON formatted ``str``",$flags:{FastCall:!0}}}),E}',"src/lib/keyword.js":'function $builtinmodule(){const{ffi:{remapToPy:t},builtin:{frozenset:e,str:s}}=Sk,i=new s("keyword"),n=t(["iskeyword","issoftkeyword","kwlist","softkwlist"]),o=t(["False","None","True","and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"]),a=t(["_","case","match"]);return{__name__:i,__all__:n,kwlist:o,softkwlist:a,iskeyword:new e(o).tp$getattr(s.$contains),issoftkeyword:new e(a).tp$getattr(s.$contains)}}',"src/lib/math.js":'const $builtinmodule=function(e){const{builtin:{str:t,int_:n,float_:i,TypeError:r,pyCheckType:u,checkNumber:l},abstr:{lookupSpecial:o},misceval:{callsimOrSuspendArray:a}}=Sk,s={pi:new Sk.builtin.float_(Math.PI),e:new Sk.builtin.float_(Math.E),tau:new Sk.builtin.float_(2*Math.PI),nan:new Sk.builtin.float_(NaN),inf:new Sk.builtin.float_(1/0)},b=new t("__ceil__");const get_sign=function(e){return e=e?e<0?-1:1:1/e<0?-1:1};const c=18;function factorial(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));let t=Sk.builtin.asnum$(e);if((e=Math.floor(t))!=t)throw new Sk.builtin.ValueError("factorial() only accepts integral values");if(e<0)throw new Sk.builtin.ValueError("factorial() not defined for negative numbers");let n=1;for(let i=2;i<=e&&i<=c;i++)n*=i;if(e<=c)return new Sk.builtin.int_(n);n=JSBI.BigInt(n);for(let i=c+1;i<=e;i++)n=JSBI.multiply(n,JSBI.BigInt(i));return new Sk.builtin.int_(n)}const m=new t("__floor__");function _gcd_internal(e,t){let n;return"number"==typeof e&&"number"==typeof t?(n=function _gcd(e,t){return 0==t?e:_gcd(t,e%t)}(e=Math.abs(e),t=Math.abs(t)),n=n<0?-n:n):(n=function _biggcd(e,t){return JSBI.equal(t,JSBI.__ZERO)?e:_biggcd(t,JSBI.remainder(e,t))}(e=JSBI.BigInt(e),t=JSBI.BigInt(t)),JSBI.lessThan(n,JSBI.__ZERO)&&(n=JSBI.multiply(n,JSBI.BigInt(-1)))),n}return Sk.abstr.setUpModuleMethods("math",s,{acos:{$meth:function acos(e){return Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e)),new Sk.builtin.float_(Math.acos(Sk.builtin.asnum$(e)))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the arc cosine (measured in radians) of x."},acosh:{$meth:function acosh(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=(e=Sk.builtin.asnum$(e))+Math.sqrt(e*e-1);return new Sk.builtin.float_(Math.log(t))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the inverse hyperbolic cosine of x."},asin:{$meth:function asin(e){return Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e)),new Sk.builtin.float_(Math.asin(Sk.builtin.asnum$(e)))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the arc sine (measured in radians) of x."},asinh:{$meth:function asinh(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=(e=Sk.builtin.asnum$(e))+Math.sqrt(e*e+1);return new Sk.builtin.float_(Math.log(t))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the inverse hyperbolic sine of x."},atan:{$meth:function atan(e){return Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e)),new Sk.builtin.float_(Math.atan(Sk.builtin.asnum$(e)))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the arc tangent (measured in radians) of x."},atan2:{$meth:function atan2(e,t){return Sk.builtin.pyCheckType("y","number",Sk.builtin.checkNumber(e)),Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(t)),new Sk.builtin.float_(Math.atan2(Sk.builtin.asnum$(e),Sk.builtin.asnum$(t)))},$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, y, x, /)",$doc:"Return the arc tangent (measured in radians) of y/x.\\n\\nUnlike atan(y/x), the signs of both x and y are considered."},atanh:{$meth:function atanh(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=(1+(e=Sk.builtin.asnum$(e)))/(1-e);return new Sk.builtin.float_(Math.log(t)/2)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the inverse hyperbolic tangent of x."},ceil:{$meth:function ceil(e){let t;if(e.ob$type!==i){const n=o(e,b);if(void 0!==n)return a(n);u("","real number",l(e)),t=Sk.builtin.asnum$(e)}else t=e.v;return new n(Math.ceil(t))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the ceiling of x as an Integral.\\n\\nThis is the smallest integer >= x."},comb:{$meth:function comb(e,t){let n=Sk.misceval.asIndexOrThrow(e),i=Sk.misceval.asIndexOrThrow(t);if(n<0)throw new Sk.builtin.ValueError("n must be an non-negative integer");if(i<0)throw new Sk.builtin.ValueError("k must be a non-negative integer");if(i>e)return new Sk.builtin.int_(0);e=new Sk.builtin.int_(n),t=new Sk.builtin.int_(i);let r=Sk.ffi.remapToJs(e.nb$subtract(t));if(rNumber.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError("min(n - k, k) must not exceed "+Number.MAX_SAFE_INTEGER);const u=new Sk.builtin.int_(1);let l=e;for(let o=1;o n.\\n\\nIf k is not specified or is None, then k defaults to n\\nand the function returns n!.\\n\\nRaises TypeError if either of the arguments are not integers.\\nRaises ValueError if either of the arguments are negative."},copysign:{$meth:function copysign(e,t){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),Sk.builtin.pyCheckType("y","number",Sk.builtin.checkNumber(t));const n=Sk.builtin.asnum$(t),i=Sk.builtin.asnum$(e),r=get_sign(i)*get_sign(n);return new Sk.builtin.float_(i*r)},$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, x, y, /)",$doc:"Return a float with the magnitude (absolute value) of x but the sign of y.\\n\\nOn platforms that support signed zeros, copysign(1.0, -0.0)\\nreturns -1.0.\\n"},cos:{$meth:function cos(e){return Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e)),new Sk.builtin.float_(Math.cos(Sk.builtin.asnum$(e)))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the cosine of x (measured in radians)."},cosh:{$meth:function cosh(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),e=Sk.builtin.asnum$(e);const t=Math.E,n=Math.pow(t,e),i=(n+1/n)/2;return new Sk.builtin.float_(i)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the hyperbolic cosine of x."},degrees:{$meth:function degrees(e){Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e));const t=180/Math.PI*Sk.builtin.asnum$(e);return new Sk.builtin.float_(t)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Convert angle x from radians to degrees."},erf:{$meth:function erf(e){throw new Sk.builtin.NotImplementedError("math.erf() is not yet implemented in Skulpt")},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Error function at x."},erfc:{$meth:function erfc(e){throw new Sk.builtin.NotImplementedError("math.erfc() is not yet implemented in Skulpt")},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Complementary error function at x."},exp:{$meth:function exp(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));let t=e.v;if("number"!=typeof t&&(t=e.nb$float().v),t==1/0||t==-1/0||isNaN(t))return new Sk.builtin.float_(Math.exp(t));const n=Math.exp(t);if(!isFinite(n))throw new Sk.builtin.OverflowError("math range error");return new Sk.builtin.float_(n)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return e raised to the power of x."},expm1:{$meth:function expm1(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=Sk.builtin.asnum$(e);if(Math.abs(t)<.7){const e=Math.exp(t);if(1==e)return new Sk.builtin.float_(t);{const n=(e-1)*t/Math.log(e);return new Sk.builtin.float_(n)}}{const e=Math.exp(t)-1;return new Sk.builtin.float_(e)}},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return exp(x)-1.\\n\\nThis function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x."},fabs:{$meth:function fabs(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));let t=e.v;return JSBI.__isBigInt(t)&&(t=e.nb$float().v),t=Math.abs(t),new Sk.builtin.float_(t)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the absolute value of the float x."},factorial:{$meth:factorial,$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Find x!.\\n\\nRaise a ValueError if x is negative or non-integral."},floor:{$meth:function floor(e){let t;if(e.ob$type===i)t=e.v;else{const n=o(e,m);if(void 0!==n)return a(n);u("x","number",l(e)),t=Sk.builtin.asnum$(e)}return new n(Math.floor(t))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the floor of x as an Integral.\\n\\nThis is the largest integer <= x."},fmod:{$meth:function fmod(e,t){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),Sk.builtin.pyCheckType("y","number",Sk.builtin.checkNumber(t));let n=e.v,i=t.v;if("number"!=typeof n&&(n=e.nb$float().v),"number"!=typeof i&&(i=t.nb$float().v),(i==1/0||i==-1/0)&&isFinite(n))return new Sk.builtin.float_(n);const r=n%i;if(isNaN(r)&&!isNaN(n)&&!isNaN(i))throw new Sk.builtin.ValueError("math domain error");return new Sk.builtin.float_(r)},$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, x, y, /)",$doc:"Return fmod(x, y), according to platform C.\\n\\nx % y may differ."},frexp:{$meth:function frexp(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=Sk.builtin.asnum$(e),n=[t,0];if(0!==t&&Number.isFinite(t)){const e=Math.abs(t);let i=Math.max(-1023,Math.floor(Math.log2(e))+1),r=e*Math.pow(2,-i);for(;r<.5;)r*=2,i--;for(;r>=1;)r*=.5,i++;t<0&&(r=-r),n[0]=r,n[1]=i}return n[0]=new Sk.builtin.float_(n[0]),n[1]=new Sk.builtin.int_(n[1]),new Sk.builtin.tuple(n)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the mantissa and exponent of x, as pair (m, e).\\n\\nm is a float and e is an int, such that x = m * 2.**e.\\nIf x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0."},fsum:{$meth:function fsum(e){if(!Sk.builtin.checkIterable(e))throw new Sk.builtin.TypeError("\'"+Sk.abstr.typeName(e)+"\' object is not iterable");let t,n,i,r=[];for(let l=(e=Sk.abstr.iter(e)).tp$iternext();void 0!==l;l=e.tp$iternext()){Sk.builtin.pyCheckType("","real number",Sk.builtin.checkNumber(l)),t=0;let e=l.v;"number"!=typeof e&&(e=l.nb$float().v),l=e;for(let u=0,o=r.length;u0;){n--;let t=a;a=JSBI.signedRightShift(u,JSBI.BigInt(n));const r=JSBI.subtract(JSBI.subtract(a,t),i),s=JSBI.leftShift(o,r),b=JSBI.add(JSBI.subtract(JSBI.subtract(l,t),a),i),c=JSBI.signedRightShift(e,b);o=JSBI.add(s,JSBI.divide(c,o))}let s=o;return JSBI.greaterThan(JSBI.multiply(s,s),e)&&(s=JSBI.subtract(s,i)),JSBI.lessThanOrEqual(s,JSBI.BigInt(Number.MAX_SAFE_INTEGER))&&(s=Number(s)),new Sk.builtin.int_(s)}(t)},$flags:{OneArg:!0},$textsig:"($module, n, /)",$doc:"Return the integer part of the square root of the input."},lcm:{$meth:function lcm(...e){function abs(e){return"number"==typeof e?new Sk.builtin.int_(Math.abs(e)):JSBI.lessThan(e,JSBI.__ZERO)?new Sk.builtin.int_(JSBI.unaryMinus(e)):new Sk.builtin.int_(e)}const t=e.length;if(0===t)return new Sk.builtin.int_(1);let n;for(n=0;nNumber.MAX_SAFE_INTEGER?JSBI.BigInt(r):e}else r=JSBI.BigInt(r);"number"!=typeof r&&(i=JSBI.BigInt(i),r=JSBI.multiply(JSBI.divide(r,_gcd_internal(r,i)),i))}return abs(r)},$flags:{MinArgs:0},$textsig:"($module, *integers, /)",$doc:"Return the least common multiple of the specified integer arguments. If all arguments are nonzero, then the returned value is the smallest positive integer that is a multiple of all arguments. If any of the arguments is zero, then the returned value is 0. lcm() without arguments returns 1."},ldexp:{$meth:function ldexp(e,t){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),Sk.builtin.pyCheckType("i","integer",Sk.builtin.checkInt(t));let n=e.v;"number"!=typeof n&&(n=e.nb$float().v);const i=Sk.builtin.asnum$(t);if(n==1/0||n==-1/0||0==n||isNaN(n))return new Sk.builtin.float_(n);const r=n*Math.pow(2,i);if(!isFinite(r))throw new Sk.builtin.OverflowError("math range error");return new Sk.builtin.float_(r)},$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, x, i, /)",$doc:"Return x * (2**i).\\n\\nThis is essentially the inverse of frexp()."},lgamma:{$meth:function lgamma(e){throw new Sk.builtin.NotImplementedError("math.lgamma() is not yet implemented in Skulpt")},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Natural logarithm of absolute value of Gamma function at x."},log:{$meth:function log(e,t){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));let n,i,r=Sk.builtin.asnum$(e);if(r<=0)throw new Sk.builtin.ValueError("math domain error");if(void 0===t?n=Math.E:(Sk.builtin.pyCheckType("base","number",Sk.builtin.checkNumber(t)),n=Sk.builtin.asnum$(t)),n<=0)throw new Sk.builtin.ValueError("math domain error");if(Sk.builtin.checkFloat(e)||re)return new Sk.builtin.int_(0);if(0===t)return new Sk.builtin.int_(1);if(t>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError("k must not exceed "+Number.MAX_SAFE_INTEGER);const n=new Sk.builtin.int_(1);let i=e=new Sk.builtin.int_(e);for(let r=1;r n.\\n\\nIf k is not specified or is None, then k defaults to n\\nand the function returns n!.\\n\\nRaises TypeError if either of the arguments are not integers.\\nRaises ValueError if either of the arguments are negative.\'"},prod:{$meth:function prod(e,t){Sk.abstr.checkArgsLen("prod",e,1,1),e=Sk.abstr.copyKeywordsToNamedArgs("prod",[null,"start"],e,t,[new Sk.builtin.int_(1)]);const n=Sk.abstr.iter(e[0]);let i,r=e[1];return i=r.constructor===Sk.builtin.int_?function fastProdInt(){return Sk.misceval.iterFor(n,(e=>{if(e.constructor!==Sk.builtin.int_)return e.constructor===Sk.builtin.float_?(r=r.nb$float().nb$multiply(e),new Sk.misceval.Break("float")):(r=Sk.abstr.numberBinOp(r,e,"Mult"),new Sk.misceval.Break("slow"));r=r.nb$multiply(e)}))}():r.constructor===Sk.builtin.float_?"float":"slow",Sk.misceval.chain(i,(e=>"float"===e?function fastProdFloat(){return Sk.misceval.iterFor(n,(e=>{if(e.constructor!==Sk.builtin.float_&&e.constructor!==Sk.builtin.int_)return r=Sk.abstr.numberBinOp(r,e,"Mult"),new Sk.misceval.Break("slow");r=r.nb$multiply(e)}))}():e),(e=>{if("slow"===e)return function slowProd(){return Sk.misceval.iterFor(n,(e=>{r=Sk.abstr.numberBinOp(r,e,"Mult")}))}()}),(()=>r))},$flags:{FastCall:!0},$textsig:"($module, iterable, /, *, start=1)",$doc:"Calculate the product of all the elements in the input iterable. The default start value for the product is 1.\\n\\nWhen the iterable is empty, return the start value. This function is intended specifically for use with numeric values and may reject non-numeric types."},pow:{$meth:function pow(e,t){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),Sk.builtin.pyCheckType("y","number",Sk.builtin.checkNumber(t));let n=e.v,i=t.v;if("number"!=typeof n&&(n=e.nb$float().v),"number"!=typeof i&&(i=t.nb$float().v),0==n&&i<0)throw new Sk.builtin.ValueError("math domain error");if(1==n)return new Sk.builtin.float_(1);if(Number.isFinite(n)&&Number.isFinite(i)&&n<0&&!Number.isInteger(i))throw new Sk.builtin.ValueError("math domain error");if(-1==n&&(i==-1/0||i==1/0))return new Sk.builtin.float_(1);const r=Math.pow(n,i);if(!Number.isFinite(n)||!Number.isFinite(i))return new Sk.builtin.float_(r);if(r==1/0||r==-1/0)throw new Sk.builtin.OverflowError("math range error");return new Sk.builtin.float_(r)},$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, x, y, /)",$doc:"Return x**y (x to the power of y)."},radians:{$meth:function radians(e){Sk.builtin.pyCheckType("deg","number",Sk.builtin.checkNumber(e));const t=Math.PI/180*Sk.builtin.asnum$(e);return new Sk.builtin.float_(t)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Convert angle x from degrees to radians."},remainder:{$meth:function remainder(e,t){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),Sk.builtin.pyCheckType("y","number",Sk.builtin.checkNumber(t));let n=e.v,i=t.v;if("number"!=typeof n&&(n=e.nb$float().v),"number"!=typeof i&&(i=t.nb$float().v),isFinite(n)&&isFinite(i)){let e,t,r,u,l;if(0==i)throw new Sk.builtin.ValueError("math domain error");if(e=Math.abs(n),t=Math.abs(i),u=e%t,r=t-u,ur)l=-r;else{if(u!=r)throw new Sk.builtin.AssertionError;l=u-.5*(e-u)%t*2}return new Sk.builtin.float_(get_sign(n)*l)}if(isNaN(n))return e;if(isNaN(i))return t;if(n==1/0||n==-1/0)throw new Sk.builtin.ValueError("math domain error");if(i!=1/0&&i!=-1/0)throw new Sk.builtin.AssertionError;return new Sk.builtin.float_(n)},$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, x, y, /)",$doc:"Difference between x and the closest integer multiple of y.\\n\\nReturn x - n*y where n*y is the closest integer multiple of y.\\nIn the case where x is exactly halfway between two multiples of\\ny, the nearest even value of n is used. The result is always exact."},sin:{$meth:function sin(e){return Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e)),new Sk.builtin.float_(Math.sin(Sk.builtin.asnum$(e)))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the sine of x (measured in radians)."},sinh:{$meth:function sinh(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),e=Sk.builtin.asnum$(e);const t=Math.E,n=Math.pow(t,e),i=(n-1/n)/2;return new Sk.builtin.float_(i)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the hyperbolic sine of x."},sqrt:{$meth:function sqrt(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=Sk.builtin.asnum$(e);if(t<0)throw new Sk.builtin.ValueError("math domain error");return new Sk.builtin.float_(Math.sqrt(t))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the square root of x."},tan:{$meth:function tan(e){return Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e)),new Sk.builtin.float_(Math.tan(Sk.builtin.asnum$(e)))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the tangent of x (measured in radians)."},tanh:{$meth:function tanh(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=Sk.builtin.asnum$(e);if(0===t)return new Sk.builtin.float_(t);const n=Math.E,i=Math.pow(n,t),r=1/i,u=(i-r)/2/((i+r)/2);return new Sk.builtin.float_(u)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the hyperbolic tangent of x."},trunc:{$meth:function trunc(e){if(e.ob$type===i)return e.nb$int();const n=o(e,t.$trunc);if(void 0===n)throw new r(`type ${e.tp$name} doesn\'t define __trunc__ method`);return a(n)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Truncates the Real x to the nearest Integral toward 0.\\n\\nUses the __trunc__ magic method."}}),s};',"src/lib/mixiot/__init__.js":'var $builtinmodule=function(i){var n={__name__:new Sk.builtin.str("mixiot")};n.MixIO=Sk.misceval.buildClass(n,(function(i,n){n.__init__=new Sk.builtin.func((function(i,n,e,o,t,c,f){n=Sk.ffi.remapToJs(n),e=Sk.ffi.remapToJs(e),o=Sk.ffi.remapToJs(o),t=Sk.ffi.remapToJs(t),c=Sk.ffi.remapToJs(c),f=Sk.ffi.remapToJs(f),mixio_client=new MixIO(n,e,o,t,c,f)})),n.publish=new Sk.builtin.func((function(i,n,e){var o=Sk.ffi.remapToJs(n),t=Sk.ffi.remapToJs(e);mixio_client.publish(o,t)})),n.subscribe=new Sk.builtin.func((function(i,n,e){var o=Sk.ffi.remapToJs(n);if(!(e instanceof Sk.builtin.func))throw new Sk.builtin.TypeError("Callback given is not a function");var t=function pythonToJavascriptFunction(i,n){return function(){var e=Array.prototype.slice.call(arguments).map((function(i){return Sk.ffi.remapToPy(i)}));return"undefined"!=typeof n&&e.unshift(n),Sk.misceval.applyAsync(void 0,i,void 0,void 0,void 0,e).catch(Sk.uncaughtException)}}(e);mixio_client.subscribeAndSetCallback(o,t)})),n.unsubscribe=new Sk.builtin.func((function(i,n){var e=Sk.ffi.remapToJs(n);mixio_client.unsubscribe(e)})),n.disconnect=new Sk.builtin.func((function(i){mixio_client.disconnect()}))}),"MixIO",[]);n.MixIO_init_by_mixly_key=Sk.misceval.buildClass(n,(function(i,n){n.__init__=new Sk.builtin.func((function(i,n,e,o,t){n=Sk.ffi.remapToJs(n),e=Sk.ffi.remapToJs(e),mixiomixlyKey=Sk.ffi.remapToJs(o),t=Sk.ffi.remapToJs(t),mixio_client=MixIO.fromMixlyKey(n,e,o,t)})),n.publish=new Sk.builtin.func((function(i,n,e){var o=Sk.ffi.remapToJs(n),t=Sk.ffi.remapToJs(e);mixio_client.publish(o,t)})),n.subscribe=new Sk.builtin.func((function(i,n,e){var o=Sk.ffi.remapToJs(n);if(!(e instanceof Sk.builtin.func))throw new Sk.builtin.TypeError("Callback given is not a function");var t=function pythonToJavascriptFunction(i,n){return function(){var e=Array.prototype.slice.call(arguments).map((function(i){return Sk.ffi.remapToPy(i)}));return"undefined"!=typeof n&&e.unshift(n),Sk.misceval.applyAsync(void 0,i,void 0,void 0,void 0,e).catch(Sk.uncaughtException)}}(e);mixio_client.subscribeAndSetCallback(o,t)})),n.unsubscribe=new Sk.builtin.func((function(i,n){var e=Sk.ffi.remapToJs(n);mixio_client.unsubscribe(e)})),n.disconnect=new Sk.builtin.func((function(i){mixio_client.disconnect()}))}),"MixIO_init_by_mixly_key",[]);return n.MixIO_init_by_share_key=Sk.misceval.buildClass(n,(function(i,n){n.__init__=new Sk.builtin.func((function(i,n,e,o,t){n=Sk.ffi.remapToJs(n),e=Sk.ffi.remapToJs(e),mixiomixlyKey=Sk.ffi.remapToJs(o),t=Sk.ffi.remapToJs(t),mixio_client=MixIO.fromShareKey(n,e,o,t).then((i=>{console.log(i),mixio_client_sharekey=i})).catch((i=>{console.error("Failed to create MixIO from share key: ",i),sleep(1)}))})),n.publish=new Sk.builtin.func((function(i,n,e){var o=Sk.ffi.remapToJs(n),t=Sk.ffi.remapToJs(e);mixio_client_sharekey.publish(o,t)})),n.subscribe=new Sk.builtin.func((function(i,n,e){var o=Sk.ffi.remapToJs(n);if(!(e instanceof Sk.builtin.func))throw new Sk.builtin.TypeError("Callback given is not a function");var t=function pythonToJavascriptFunction(i,n){return function(){var e=Array.prototype.slice.call(arguments).map((function(i){return Sk.ffi.remapToPy(i)}));return"undefined"!=typeof n&&e.unshift(n),Sk.misceval.applyAsync(void 0,i,void 0,void 0,void 0,e).catch(Sk.uncaughtException)}}(e);mixio_client_sharekey.subscribeAndSetCallback(o,t)})),n.unsubscribe=new Sk.builtin.func((function(i,n){var e=Sk.ffi.remapToJs(n);mixio_client_sharekey.unsubscribe(e)})),n.disconnect=new Sk.builtin.func((function(i){mixio_client_sharekey.disconnect()}))}),"MixIO_init_by_share_key",[]),n};',"src/lib/operator.js":'function $builtinmodule(e){const{builtin:{str:t,tuple:a,list:r,int_:o,bool:n,TypeError:s,ValueError:i,none:{none$:m},NotImplemented:{NotImplemented$:d},abs:l,len:h,checkString:u,checkInt:c},abstr:{buildNativeClass:M,checkNoKwargs:b,checkArgsLen:g,checkOneArg:f,numberUnaryOp:p,numberBinOp:A,numberInplaceBinOp:k,objectGetItem:$,objectDelItem:_,objectSetItem:w,sequenceConcat:v,sequenceContains:x,sequenceGetCountOf:j,sequenceGetIndexOf:O,sequenceInPlaceConcat:I,typeName:S,lookupSpecial:y,gattr:q,setUpModuleMethods:R},misceval:{richCompareBool:B,asIndexOrThrow:N,chain:E,callsimArray:T,callsimOrSuspendArray:C,objectRepr:D},generic:{getAttr:G}}=Sk,L=["abs","add","and_","concat","contains","delitem","eq","floordiv","ge","getitem","gt","iadd","iand","iconcat","ifloordiv","ilshift","imatmul","imod","imul","index","inv","invert","ior","ipow","irshift","isub","itruediv","ixor","le","lshift","lt","matmul","mod","mul","ne","neg","not_","or_","pos","pow","rshift","setitem","sub","truediv","xor"],F=["attrgetter","countOf","indexOf","is_","is_not","itemgetter","length_hint","methodcaller","truth",...L].sort(),P={__name__:new t("operator"),__doc__:new t("Operator interface.\\n\\nThis module exports a set of functions implemented in javascript corresponding\\nto the intrinsic operators of Python. For example, operator.add(x, y)\\nis equivalent to the expression x+y. The function names are those\\nused for special methods; variants without leading and trailing\\n\'__\' are also provided for convenience."),__all__:new r(F.map((e=>new t(e))))};P.itemgetter=M("operator.itemgetter",{constructor:function itemgetter(e){this.items=e,this.oneitem=1===e.length,this.item=e[0],this.in$repr=!1},slots:{tp$getattr:G,tp$new:(e,t)=>(b("itemgetter",t),g("itemgetter",e,1),new P.itemgetter(e)),tp$call(e,t){f("itemgetter",e,t);const r=e[0];return this.oneitem?$(r,this.item,!0):new a(this.items.map((e=>$(r,e))))},tp$doc:"Return a callable object that fetches the given item(s) from its operand.\\n After f = itemgetter(2), the call f(r) returns r[2].\\n After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3])",$r(){if(this.in$repr)return new t(this.tp$name+"(...)");this.in$repr=!0;const e=this.tp$name+"("+this.items.map((e=>D(e))).join(", ")+")";return this.in$repr=!1,e}}}),P.attrgetter=M("operator.attrgetter",{constructor:function attrgetter(e){this.attrs=e,this.oneattr=1===e.length,this.attr=e[0],this.in$repr=!1},slots:{tp$getattr:G,tp$new(e,a){b("attrgetter",a),g("attrgetter",e,1);const r=[];for(let o=0;onew t(e)))):r.push([a])}return new P.attrgetter(r)},tp$call(e,t){f("attrgetter",e,t);const r=e[0];if(this.oneattr)return this.attr.reduce(((e,t)=>q(e,t)),r);const o=this.attrs.map((e=>e.reduce(((e,t)=>q(e,t)),r)));return new a(o)},tp$doc:"attrgetter(attr, ...) --\\x3e attrgetter object\\n\\nReturn a callable object that fetches the given attribute(s) from its operand.\\nAfter f = attrgetter(\'name\'), the call f(r) returns r.name.\\nAfter g = attrgetter(\'name\', \'date\'), the call g(r) returns (r.name, r.date).\\nAfter h = attrgetter(\'name.first\', \'name.last\'), the call h(r) returns\\n(r.name.first, r.name.last).",$r(){if(this.in$repr)return new t(this.tp$name+"(...)");this.in$repr=!0;const e=this.tp$name+"("+this.items.map((e=>D(e))).join(", ")+")";return this.in$repr=!1,e}}}),P.methodcaller=M("operator.methodcaller",{constructor:function methodcaller(e,t,a){this.$name=e,this.args=t,this.kwargs=a||[],this.in$repr=!1},slots:{tp$getattr:G,tp$new(e,t){g("methodcaller",e,1);const a=e[0];if(!u(a))throw new s("method name must be a string");return new P.methodcaller(a,e.slice(1),t)},tp$call(e,t){f("methodcaller",e,t);const a=e[0];return E(q(a,this.$name,!0),(e=>C(e,this.args,this.kwargs)))},tp$doc:"methodcaller(name, ...) --\\x3e methodcaller object\\n\\nReturn a callable object that calls the given method on its operand.\\nAfter f = methodcaller(\'name\'), the call f(r) returns r.name().\\nAfter g = methodcaller(\'name\', \'date\', foo=1), the call g(r) returns\\nr.name(\'date\', foo=1).",$r(){if(this.in$repr)return new t(this.tp$name+"(...)");this.in$repr=!0;let e=[D(this.$name)];e.push(...this.args.map((e=>D(e))));for(let t=0;tn(B(e,t,"Lt"))),sameAs("a < b")),le:makeModuleMethod(((e,t)=>n(B(e,t,"LtE"))),sameAs("a <= b")),eq:makeModuleMethod(((e,t)=>n(B(e,t,"Eq"))),sameAs("a == b")),ne:makeModuleMethod(((e,t)=>n(B(e,t,"NotEq"))),sameAs("a != b")),ge:makeModuleMethod(((e,t)=>n(B(e,t,"GtE"))),sameAs("a >= b")),gt:makeModuleMethod(((e,t)=>n(B(e,t,"Gt"))),sameAs("a > b")),not_:makeModuleMethod((e=>p(e,"Not")),sameAs("not a")),truth:makeModuleMethod((e=>n(e)),"Return True if a is true, False otherwise."),is_:makeModuleMethod(((e,t)=>n(B(e,t,"Is"))),sameAs("a is b")),is_not:makeModuleMethod(((e,t)=>n(B(e,t,"IsNot"))),sameAs("a is not b")),abs:makeModuleMethod((e=>l(e)),sameAs("abs(a)")),add:makeModuleMethod(((e,t)=>A(e,t,"Add")),sameAs("a + b")),and_:makeModuleMethod(((e,t)=>A(e,t,"BitAnd")),sameAs("a & b")),floordiv:makeModuleMethod(((e,t)=>A(e,t,"FloorDiv")),sameAs("a // b")),index:makeModuleMethod((e=>new o(N(e))),sameAs("a.__index__()")),inv:makeModuleMethod((e=>p(e,"Invert")),sameAs("~a")),invert:makeModuleMethod((e=>p(e,"Invert")),sameAs("~a")),lshift:makeModuleMethod(((e,t)=>A(e,t,"LShift")),sameAs("a << b")),mod:makeModuleMethod(((e,t)=>A(e,t,"Mod")),sameAs("a % b")),mul:makeModuleMethod(((e,t)=>A(e,t,"Mult")),sameAs("a * b")),matmul:makeModuleMethod(((e,t)=>A(e,t,"MatMult")),sameAs("a @ b")),neg:makeModuleMethod((e=>p(e,"USub")),sameAs("-a")),or_:makeModuleMethod(((e,t)=>A(e,t,"BitOr")),sameAs("a | b")),pos:makeModuleMethod((e=>p(e,"UAdd")),sameAs("+a")),pow:makeModuleMethod(((e,t)=>A(e,t,"Pow")),sameAs("a ** b")),rshift:makeModuleMethod(((e,t)=>A(e,t,"RShift")),sameAs("a >> b")),sub:makeModuleMethod(((e,t)=>A(e,t,"Sub")),sameAs("a - b")),truediv:makeModuleMethod(((e,t)=>A(e,t,"Div")),sameAs("a / b")),xor:makeModuleMethod(((e,t)=>A(e,t,"BitXor")),sameAs("a ^ b")),concat:makeModuleMethod(((e,t)=>v(e,t)),sameAs("a + b, for a and b sequences")),contains:makeModuleMethod(((e,t)=>E(x(e,t),n)),sameAs("b in a (note reversed operands)")),countOf:makeModuleMethod(((e,t)=>j(e,t)),"Return thenumber of times b occurs in a."),delitem:makeModuleMethod(((e,t)=>E(_(e,t,!0),(()=>m))),sameAs("del a[b]")),getitem:makeModuleMethod(((e,t)=>$(e,t,!0)),sameAs("a[b]")),indexOf:makeModuleMethod(((e,t)=>O(e,t)),"Return the first index of b in a"),setitem:makeModuleMethod(((e,t,a)=>E(w(e,t,a,!0),(()=>m))),sameAs("a[b] = c")),length_hint:{$meth:function length_hint(e,a){if(void 0===a)a=new o(0);else if(!c(a))throw new s("\'"+S(a)+"\' object cannot be interpreted as an integer");try{return h(e)}catch(m){if(!(m instanceof s))throw m}const r=y(e,t.$length_hint);if(void 0===r)return a;let n;try{n=T(r,[])}catch(m){if(!(m instanceof s))throw m;return a}if(n===d)return a;if(!c(n))throw new s("__length_hint__ must be an integer, not "+S(n));if(n.nb$isnegative())throw new i("__length_hint__() should return >= 0");return n},$flags:{MinArgs:1,MaxArgs:2},$textsig:"($module, obj, default=0, /)",$doc:"Return an estimate of the number of items in obj.\\n\\nThis is useful for presizing containers when building from an iterable.\\n\\nIf the object supports len(), the result will be exact.\\nOtherwise, it may over- or under-estimate by an arbitrary amount.\\nThe result will be an integer >= 0."},iadd:makeModuleMethod(((e,t)=>k(e,t,"Add")),sameAs("a += b")),iand:makeModuleMethod(((e,t)=>k(e,t,"BitAnd")),sameAs("a &= b")),iconcat:makeModuleMethod(((e,t)=>I(e,t)),sameAs("a += b, for a and b sequences")),ifloordiv:makeModuleMethod(((e,t)=>k(e,t,"FloorDiv")),sameAs("a //= b")),ilshift:makeModuleMethod(((e,t)=>k(e,t,"LShift")),sameAs("a <<= b")),imod:makeModuleMethod(((e,t)=>k(e,t,"Mod")),sameAs("a %= b")),imul:makeModuleMethod(((e,t)=>k(e,t,"Mult")),sameAs("a *= b")),imatmul:makeModuleMethod(((e,t)=>k(e,t,"MatMult")),sameAs("a @= b")),ior:makeModuleMethod(((e,t)=>k(e,t,"BitOr")),sameAs("a |= b")),ipow:makeModuleMethod(((e,t)=>k(e,t,"Pow")),sameAs("a **= b")),irshift:makeModuleMethod(((e,t)=>k(e,t,"RShift")),sameAs("a >>= b")),isub:makeModuleMethod(((e,t)=>k(e,t,"Sub")),sameAs("a -= b")),itruediv:makeModuleMethod(((e,t)=>k(e,t,"Div")),sameAs("a /= b")),ixor:makeModuleMethod(((e,t)=>k(e,t,"BitXor")),sameAs("a ^= b"))}),L.forEach((e=>{P[`__${e.replace("_","")}__`]=P[e]})),P.div=P.truediv,P.__div__=P.div,P}',"src/lib/platform.js":'var $builtinmodule=function(n){var e={},i="undefined"!=typeof window&&"undefined"!=typeof window.navigator;return e.python_implementation=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("python_implementation",arguments.length,0,0),new Sk.builtin.str("Skulpt")})),e.node=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("node",arguments.length,0,0),new Sk.builtin.str("")})),e.version=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("version",arguments.length,0,0),new Sk.builtin.str("")})),e.python_version=new Sk.builtin.func((function(){var n;return Sk.builtin.pyCheckArgsLen("python_version",arguments.length,0,0),n=Sk.__future__.python_version?"3.2.0":"2.7.0",new Sk.builtin.str(n)})),e.system=new Sk.builtin.func((function(){var n;return Sk.builtin.pyCheckArgsLen("system",arguments.length,0,0),n=i?window.navigator.appCodeName:"",new Sk.builtin.str(n)})),e.machine=new Sk.builtin.func((function(){var n;return Sk.builtin.pyCheckArgsLen("machine",arguments.length,0,0),n=i?window.navigator.platform:"",new Sk.builtin.str(n)})),e.release=new Sk.builtin.func((function(){var n;return Sk.builtin.pyCheckArgsLen("release",arguments.length,0,0),n=i?window.navigator.appVersion:"",new Sk.builtin.str(n)})),e.architecture=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("architecture",arguments.length,0,0),new Sk.builtin.tuple([new Sk.builtin.str("64bit"),new Sk.builtin.str("")])})),e.processor=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("processor",arguments.length,0,0),new Sk.builtin.str("")})),e};',"src/lib/processing.js":'var $builtinmodule=function(n){var i,e,t,u,o,s,l,c={__name__:new Sk.builtin.str("processing")},r=[],v=!0,f=null;c.processing=null,c.p=null,c.X=new Sk.builtin.int_(0),c.Y=new Sk.builtin.int_(1),c.Z=new Sk.builtin.int_(2),c.R=new Sk.builtin.int_(3),c.G=new Sk.builtin.int_(4),c.B=new Sk.builtin.int_(5),c.A=new Sk.builtin.int_(6),c.U=new Sk.builtin.int_(7),c.V=new Sk.builtin.int_(8),c.NX=new Sk.builtin.int_(9),c.NY=new Sk.builtin.int_(10),c.NZ=new Sk.builtin.int_(11),c.EDGE=new Sk.builtin.int_(12),c.SR=new Sk.builtin.int_(13),c.SG=new Sk.builtin.int_(14),c.SB=new Sk.builtin.int_(15),c.SA=new Sk.builtin.int_(16),c.SW=new Sk.builtin.int_(17),c.TX=new Sk.builtin.int_(18),c.TY=new Sk.builtin.int_(19),c.TZ=new Sk.builtin.int_(20),c.VX=new Sk.builtin.int_(21),c.VY=new Sk.builtin.int_(22),c.VZ=new Sk.builtin.int_(23),c.VW=new Sk.builtin.int_(24),c.AR=new Sk.builtin.int_(25),c.AG=new Sk.builtin.int_(26),c.AB=new Sk.builtin.int_(27),c.DR=new Sk.builtin.int_(3),c.DG=new Sk.builtin.int_(4),c.DB=new Sk.builtin.int_(5),c.DA=new Sk.builtin.int_(6),c.SPR=new Sk.builtin.int_(28),c.SPG=new Sk.builtin.int_(29),c.SPB=new Sk.builtin.int_(30),c.SHINE=new Sk.builtin.int_(31),c.ER=new Sk.builtin.int_(32),c.EG=new Sk.builtin.int_(33),c.EB=new Sk.builtin.int_(34),c.BEEN_LIT=new Sk.builtin.int_(35),c.VERTEX_FIELD_COUNT=new Sk.builtin.int_(36),c.CENTER=new Sk.builtin.int_(3),c.RADIUS=new Sk.builtin.int_(2),c.CORNERS=new Sk.builtin.int_(1),c.CORNER=new Sk.builtin.int_(0),c.DIAMETER=new Sk.builtin.int_(3),c.BASELINE=new Sk.builtin.int_(0),c.TOP=new Sk.builtin.int_(101),c.BOTTOM=new Sk.builtin.int_(102),c.NORMAL=new Sk.builtin.int_(1),c.NORMALIZED=new Sk.builtin.int_(1),c.IMAGE=new Sk.builtin.int_(2),c.MODEL=new Sk.builtin.int_(4),c.SHAPE=new Sk.builtin.int_(5),c.AMBIENT=new Sk.builtin.int_(0),c.DIRECTIONAL=new Sk.builtin.int_(1),c.SPOT=new Sk.builtin.int_(3),c.RGB=new Sk.builtin.int_(1),c.ARGB=new Sk.builtin.int_(2),c.HSB=new Sk.builtin.int_(3),c.ALPHA=new Sk.builtin.int_(4),c.CMYK=new Sk.builtin.int_(5),c.TIFF=new Sk.builtin.int_(0),c.TARGA=new Sk.builtin.int_(1),c.JPEG=new Sk.builtin.int_(2),c.GIF=new Sk.builtin.int_(3),c.MITER=new Sk.builtin.str("miter"),c.BEVEL=new Sk.builtin.str("bevel"),c.ROUND=new Sk.builtin.str("round"),c.SQUARE=new Sk.builtin.str("butt"),c.PROJECT=new Sk.builtin.str("square"),c.P2D=new Sk.builtin.int_(1),c.JAVA2D=new Sk.builtin.int_(1),c.WEBGL=new Sk.builtin.int_(2),c.P3D=new Sk.builtin.int_(2),c.OPENGL=new Sk.builtin.int_(2),c.PDF=new Sk.builtin.int_(0),c.DXF=new Sk.builtin.int_(0),c.OTHER=new Sk.builtin.int_(0),c.WINDOWS=new Sk.builtin.int_(1),c.MAXOSX=new Sk.builtin.int_(2),c.LINUX=new Sk.builtin.int_(3),c.EPSILON=new Sk.builtin.float_(1e-4),c.MAX_FLOAT=new Sk.builtin.float_(34028235e31),c.MIN_FLOAT=new Sk.builtin.float_(-34028235e31),c.MAX_INT=new Sk.builtin.int_(2147483647),c.MIN_INT=new Sk.builtin.int_(-2147483648),c.HALF_PI=new Sk.builtin.float_(Math.PI/2),c.THIRD_PI=new Sk.builtin.float_(Math.PI/3),c.PI=new Sk.builtin.float_(Math.PI),c.TWO_PI=new Sk.builtin.float_(2*Math.PI),c.TAU=new Sk.builtin.float_(2*Math.PI),c.QUARTER_PI=new Sk.builtin.float_(Math.PI/4),c.DEG_TO_RAD=new Sk.builtin.float_(Math.PI/180),c.RAD_TO_DEG=new Sk.builtin.float_(180/Math.PI),c.WHITESPACE=new Sk.builtin.str(" \\t\\n\\r\\f "),c.POINT=new Sk.builtin.int_(2),c.POINTS=new Sk.builtin.int_(2),c.LINE=new Sk.builtin.int_(4),c.LINES=new Sk.builtin.int_(4),c.TRIANGLE=new Sk.builtin.int_(8),c.TRIANGLES=new Sk.builtin.int_(9),c.TRIANGLE_FAN=new Sk.builtin.int_(11),c.TRIANGLE_STRIP=new Sk.builtin.int_(10),c.QUAD=new Sk.builtin.int_(16),c.QUADS=new Sk.builtin.int_(16),c.QUAD_STRIP=new Sk.builtin.int_(17),c.POLYGON=new Sk.builtin.int_(20),c.PATH=new Sk.builtin.int_(21),c.RECT=new Sk.builtin.int_(30),c.ELLIPSE=new Sk.builtin.int_(31),c.ARC=new Sk.builtin.int_(32),c.SPHERE=new Sk.builtin.int_(40),c.BOX=new Sk.builtin.int_(41),c.GROUP=new Sk.builtin.int_(0),c.PRIMITIVE=new Sk.builtin.int_(1),c.GEOMETRY=new Sk.builtin.int_(3),c.VERTEX=new Sk.builtin.int_(0),c.BEZIER_VERTEX=new Sk.builtin.int_(1),c.CURVE_VERTEX=new Sk.builtin.int_(2),c.BREAK=new Sk.builtin.int_(3),c.CLOSESHAPE=new Sk.builtin.int_(4),c.REPLACE=new Sk.builtin.int_(0),c.BLEND=new Sk.builtin.int_(1),c.ADD=new Sk.builtin.int_(2),c.SUBTRACT=new Sk.builtin.int_(4),c.LIGHTEST=new Sk.builtin.int_(8),c.DARKEST=new Sk.builtin.int_(16),c.DIFFERENCE=new Sk.builtin.int_(32),c.EXCLUSION=new Sk.builtin.int_(64),c.MULTIPLY=new Sk.builtin.int_(128),c.SCREEN=new Sk.builtin.int_(256),c.OVERLAY=new Sk.builtin.int_(512),c.HARD_LIGHT=new Sk.builtin.int_(1024),c.SOFT_LIGHT=new Sk.builtin.int_(2048),c.DODGE=new Sk.builtin.int_(4096),c.BURN=new Sk.builtin.int_(8192),c.ALPHA_MASK=new Sk.builtin.int_(4278190080),c.RED_MASK=new Sk.builtin.int_(16711680),c.GREEN_MASK=new Sk.builtin.int_(65280),c.BLUE_MASK=new Sk.builtin.int_(255),c.CUSTOM=new Sk.builtin.int_(0),c.ORTHOGRAPHIC=new Sk.builtin.int_(2),c.PERSPECTIVE=new Sk.builtin.int_(3),c.ARROW=new Sk.builtin.str("default"),c.CROSS=new Sk.builtin.str("crosshair"),c.HAND=new Sk.builtin.str("pointer"),c.MOVE=new Sk.builtin.str("move"),c.TEXT=new Sk.builtin.str("text"),c.WAIT=new Sk.builtin.str("wait"),c.NOCURSOR=Sk.builtin.assk$("url(\'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\'), auto"),c.DISABLE_OPENGL_2X_SMOOTH=new Sk.builtin.int_(1),c.ENABLE_OPENGL_2X_SMOOTH=new Sk.builtin.int_(-1),c.ENABLE_OPENGL_4X_SMOOTH=new Sk.builtin.int_(2),c.ENABLE_NATIVE_FONTS=new Sk.builtin.int_(3),c.DISABLE_DEPTH_TEST=new Sk.builtin.int_(4),c.ENABLE_DEPTH_TEST=new Sk.builtin.int_(-4),c.ENABLE_DEPTH_SORT=new Sk.builtin.int_(5),c.DISABLE_DEPTH_SORT=new Sk.builtin.int_(-5),c.DISABLE_OPENGL_ERROR_REPORT=new Sk.builtin.int_(6),c.ENABLE_OPENGL_ERROR_REPORT=new Sk.builtin.int_(-6),c.ENABLE_ACCURATE_TEXTURES=new Sk.builtin.int_(7),c.DISABLE_ACCURATE_TEXTURES=new Sk.builtin.int_(-7),c.HINT_COUNT=new Sk.builtin.int_(10),c.OPEN=new Sk.builtin.int_(1),c.CLOSE=new Sk.builtin.int_(2),c.BLUR=new Sk.builtin.int_(11),c.GRAY=new Sk.builtin.int_(12),c.INVERT=new Sk.builtin.int_(13),c.OPAQUE=new Sk.builtin.int_(14),c.POSTERIZE=new Sk.builtin.int_(15),c.THRESHOLD=new Sk.builtin.int_(16),c.ERODE=new Sk.builtin.int_(17),c.DILATE=new Sk.builtin.int_(18),c.BACKSPACE=new Sk.builtin.int_(8),c.TAB=new Sk.builtin.int_(9),c.ENTER=new Sk.builtin.int_(10),c.RETURN=new Sk.builtin.int_(13),c.ESC=new Sk.builtin.int_(27),c.DELETE=new Sk.builtin.int_(127),c.CODED=new Sk.builtin.int_(65535),c.SHIFT=new Sk.builtin.int_(16),c.CONTROL=new Sk.builtin.int_(17),c.ALT=new Sk.builtin.int_(18),c.CAPSLK=new Sk.builtin.int_(20),c.PGUP=new Sk.builtin.int_(33),c.PGDN=new Sk.builtin.int_(34),c.END=new Sk.builtin.int_(35),c.HOME=new Sk.builtin.int_(36),c.LEFT=new Sk.builtin.int_(37),c.UP=new Sk.builtin.int_(38),c.RIGHT=new Sk.builtin.int_(39),c.DOWN=new Sk.builtin.int_(40),c.F1=new Sk.builtin.int_(112),c.F2=new Sk.builtin.int_(113),c.F3=new Sk.builtin.int_(114),c.F4=new Sk.builtin.int_(115),c.F5=new Sk.builtin.int_(116),c.F6=new Sk.builtin.int_(117),c.F7=new Sk.builtin.int_(118),c.F8=new Sk.builtin.int_(119),c.F9=new Sk.builtin.int_(120),c.F10=new Sk.builtin.int_(121),c.F11=new Sk.builtin.int_(122),c.F12=new Sk.builtin.int_(123),c.NUMLK=new Sk.builtin.int_(144),c.META=new Sk.builtin.int_(157),c.INSERT=new Sk.builtin.int_(155),c.SINCOS_LENGTH=new Sk.builtin.int_(720),c.PRECISIONB=new Sk.builtin.int_(15),c.PRECISIONF=new Sk.builtin.int_(32768),c.PREC_MAXVAL=new Sk.builtin.int_(32767),c.PREC_ALPHA_SHIFT=new Sk.builtin.int_(9),c.PREC_RED_SHIFT=new Sk.builtin.int_(1),c.NORMAL_MODE_AUTO=new Sk.builtin.int_(0),c.NORMAL_MODE_SHAPE=new Sk.builtin.int_(1),c.NORMAL_MODE_VERTEX=new Sk.builtin.int_(2),c.MAX_LIGHTS=new Sk.builtin.int_(8),c.line=new Sk.builtin.func((function(n,i,e,t){c.processing.line(n.v,i.v,e.v,t.v)})),c.ellipse=new Sk.builtin.func((function(n,i,e,t){c.processing.ellipse(n.v,i.v,e.v,t.v)})),c.circle=new Sk.builtin.func((function(n,i,e){c.processing.ellipse(n.v,i.v,e.v,e.v)})),c.text=new Sk.builtin.func((function(n,i,e){c.processing.text(n.v,i.v,e.v)})),c.point=new Sk.builtin.func((function(n,i){c.processing.point(n.v,i.v)})),c.arc=new Sk.builtin.func((function(n,i,e,t,u,o){c.processing.arc(n.v,i.v,e.v,t.v,u.v,o.v)})),c.quad=new Sk.builtin.func((function(n,i,e,t,u,o,s,l){c.processing.quad(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v)})),c.rect=new Sk.builtin.func((function(n,i,e,t,u){"undefined"==typeof u?c.processing.rect(n.v,i.v,e.v,t.v):c.processing.rect(n.v,i.v,e.v,t.v,u.v)})),c.triangle=new Sk.builtin.func((function(n,i,e,t,u,o){c.processing.triangle(n.v,i.v,e.v,t.v,u.v,o.v)})),c.bezier=new Sk.builtin.func((function(n,i,e,t,u,o,s,l,r,v,f,S){"undefined"==typeof r?c.processing.bezier(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v):c.processing.bezier(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v,v.v,f.v,S.v)})),c.alpha=new Sk.builtin.func((function(n,i,e){return"undefined"==typeof i?new Sk.builtin.float_(c.processing.alpha(n.v)):"undefined"==typeof e?new Sk.builtin.float_(c.processing.alpha(n.v,i.v)):new Sk.builtin.float_(c.processing.alpha(n.v,i.v,e.v))})),c.ambient=new Sk.builtin.func((function(n,i,e){"undefined"==typeof i?c.processing.ambient(n.v):"undefined"==typeof e?c.processing.ambient(n.v,i.v):c.processing.ambient(n.v,i.v,e.v)})),c.ambientLight=new Sk.builtin.func((function(n,i,e,t,u,o){"undefined"==typeof t?c.processing.ambientLight(n.v,i.v,e.v):"undefined"==typeof u?c.processing.ambientLight(n.v,i.v,e.v,t.v):"undefined"==typeof o?c.processing.ambientLight(n.v,i.v,e.v,t.v,u.v):c.processing.ambientLight(n.v,i.v,e.v,t.v,u.v,o.v)})),c.beginCamera=new Sk.builtin.func((function(){c.processing.beginCamera()})),c.beginShape=new Sk.builtin.func((function(n){"undefined"==typeof n&&(n=c.POLYGON),c.processing.beginShape(n.v)})),c.bezierDetail=new Sk.builtin.func((function(n){n="undefined"!=typeof n?n.v:20,c.processing.bezierDetail(n)})),c.bezierPoint=new Sk.builtin.func((function(n,i,e,t,u){c.processing.bezierPoint(n.v,i.v,e.v,t.v,u.v)})),c.bezierTangent=new Sk.builtin.func((function(n,i,e,t,u){c.processing.bezierTangent(n.v,i.v,e.v,t.v,u.v)})),c.bezierVertex=new Sk.builtin.func((function(n,i,e,t,u,o,s,l,r){"undefined"==typeof s?c.processing.bezierVertex(n.v,i.v,e.v,t.v,u.v,o.v):"undefined"==typeof l?c.processing.bezierVertex(n.v,i.v,e.v,t.v,u.v,o.v,s.v):"undefined"==typeof r?c.processing.bezierVertex(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v):c.processing.bezierVertex(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v)})),c.blend=new Sk.builtin.func((function(n,i,e,t,u,o,s,l,r,v){n instanceof Sk.builtin.int_||n instanceof Sk.builtin.float_?c.processing.blend(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v):c.processing.blend(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v,v.v)})),c.blendColor=new Sk.builtin.func((function(n,i,e){var t=Sk.misceval.callsimArray(c.color,[new Sk.builtin.int_(0),new Sk.builtin.int_(0),new Sk.builtin.int_(0)]);return t.v=c.processing.blendColor(n.v,i.v,e.v),t})),c.brightness=new Sk.builtin.func((function(n,i,e){return"undefined"==typeof i?new Sk.builtin.float_(c.processing.brightness(n.v)):"undefined"==typeof e?new Sk.builtin.float_(c.processing.brightness(n.v,i.v)):new Sk.builtin.float_(c.processing.brightness(n.v,i.v,e.v))})),c.camera=new Sk.builtin.func((function(n,i,e,t,u,o,s,l,r){"undefined"==typeof n?c.processing.camera():c.processing.camera(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v)})),c.constrain=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.constrain(n.v,i.v,e.v))})),c.copy=new Sk.builtin.func((function(n,i,e,t,u,o,s,l,r){n instanceof Sk.builtin.int_||n instanceof Sk.builtin.float_?c.processing.copy(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v):c.processing.copy(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v)})),c.createFont=new Sk.builtin.func((function(n,i,e,t){var u=Sk.misceval.callsimArray(c.PFont);return u.v="undefined"==typeof e?c.processing.createFont(n.v,i.v):"undefined"==typeof t?c.processing.createFont(n.v,i.v,e.v):c.processing.createFont(n.v,i.v,e.v,t.v),u})),c.createGraphics=new Sk.builtin.func((function(n,i,e,t){var u=Sk.misceval.callsimArray(c.PGraphics);return u.v="undefined"==typeof t?c.processing.createGraphics(n.v,i.v,e.v):c.processing.createGraphics(n.v,i.v,e.v,t.v),u})),c.createImage=new Sk.builtin.func((function(n,i,e){var t=Sk.misceval.callsimArray(c.PImage);return t.v=c.processing.createImage(n.v,i.v,e.v),t})),c.cursor=new Sk.builtin.func((function(n,i,e){"undefined"==typeof n?c.processing.cursor():"undefined"==typeof i?c.processing.cursor(n.v):"undefined"==typeof e?c.processing.cursor(n.v,i.v):c.processing.cursor(n.v,i.v,e.v)})),c.curve=new Sk.builtin.func((function(n,i,e,t,u,o,s,l,r,v,f,S){"undefined"==typeof r?c.processing.curve(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v):"undefined"==typeof v?c.processing.curve(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v):"undefined"==typeof f?c.processing.curve(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v,v.v):"undefined"==typeof S?c.processing.curve(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v,v.v,f.v):c.processing.curve(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v,v.v,f.v,S.v)})),c.curveDetail=new Sk.builtin.func((function(n){c.processing.curveDetail(n.v)})),c.curvePoint=new Sk.builtin.func((function(n,i,e,t,u){c.processing.curvePoint(n.v,i.v,e.v,t.v,u.v)})),c.curveTangent=new Sk.builtin.func((function(n,i,e,t,u){c.processing.curveTangent(n.v,i.v,e.v,t.v,u.v)})),c.curveTightness=new Sk.builtin.func((function(n){c.processing.curveTightness(n.v)})),c.curveVertex=new Sk.builtin.func((function(n,i,e){"undefined"==typeof e?c.processing.curveVertex(n.v,i.v):c.processing.curveVertex(n.v,i.v,e.v)})),c.day=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.day())})),c.degrees=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.degrees(n.v))})),c.directionalLight=new Sk.builtin.func((function(n,i,e,t,u,o){c.processing.directionalLight(n.v,i.v,e.v,t.v,u.v,o.v)})),c.dist=new Sk.builtin.func((function(n,i,e,t,u,o){return"undefined"==typeof u?new Sk.builtin.float_(c.processing.dist(n.v,i.v,e.v,t.v)):"undefined"==typeof o?new Sk.builtin.float_(c.processing.dist(n.v,i.v,e.v,t.v,u.v)):new Sk.builtin.float_(c.processing.dist(n.v,i.v,e.v,t.v,u.v,o.v))})),c.emissive=new Sk.builtin.func((function(n,i,e){"undefined"==typeof i?c.processing.emissive(n.v):"undefined"==typeof e?c.processing.emissive(n.v,i.v):c.processing.emissive(n.v,i.v,e.v)})),c.endCamera=new Sk.builtin.func((function(){c.processing.endCamera()})),c.endShape=new Sk.builtin.func((function(n){"undefined"==typeof n?c.processing.endShape():c.processing.endShape(n.v)})),c.filter=new Sk.builtin.func((function(n,i){"undefined"==typeof i?c.processing.filter(n.v):c.processing.filter(n.v,i.v)})),c.frustum=new Sk.builtin.func((function(n,i,e,t,u,o){c.processing.frustum(n,i,e,t,u,o)})),c.hint=new Sk.builtin.func((function(n){c.processing.hint(n)})),c.hour=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.hour())})),c.hue=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.hue(n.v))})),c.imageMode=new Sk.builtin.func((function(n){c.processing.imageMode(n.v)})),c.lerp=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.lerp(n.v,i.v,e.v))})),c.lerpColor=new Sk.builtin.func((function(n,i,e){var t=Sk.misceval.callsimArray(c.color,[new Sk.builtin.int_(0),new Sk.builtin.int_(0),new Sk.builtin.int_(0)]);return t.v=c.processing.lerpColor(n.v,i.v,e.v),t})),c.lightFalloff=new Sk.builtin.func((function(n,i,e){c.processing.lightFalloff(n.v,i.v,e.v)})),c.lights=new Sk.builtin.func((function(){c.processing.lights()})),c.lightSpecular=new Sk.builtin.func((function(n,i,e){c.processing.lightSpecular(n.v,i.v,e.v)})),c.loadBytes=new Sk.builtin.func((function(n){return new Sk.builtin.list(c.processing.loadBytes(n.v))})),c.loadFont=new Sk.builtin.func((function(n){var i=Sk.misceval.callsimArray(c.PFont);return i.v=c.processing.loadFont(n.v),i})),c.loadShape=new Sk.builtin.func((function(n){return Sk.misceval.callsimArray(c.PShapeSVG,[new Sk.builtin.str("string"),n])})),c.loadStrings=new Sk.builtin.func((function(n){return new Sk.builtin.list(c.processing.loadStrings(n.v))})),c.mag=new Sk.builtin.func((function(n,i,e){return"undefined"==typeof e?new Sk.builtin.float_(c.processing.mag(n.v,i.v)):new Sk.builtin.float_(c.processing.mag(n.v,i.v,e.v))})),c.map=new Sk.builtin.func((function(n,i,e,t,u){return new Sk.builtin.float_(c.processing.map(n.v,i.v,e.v,t.v,u.v))})),c.millis=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.millis())})),c.minute=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.minute())})),c.modelX=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.modelX(n.v,i.v,e.v))})),c.modelY=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.modelY(n.v,i.v,e.v))})),c.modelZ=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.modelZ(n.v,i.v,e.v))})),c.month=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.month())})),c.noCursor=new Sk.builtin.func((function(){c.processing.noCursor()})),c.noise=new Sk.builtin.func((function(n,i,e){return"undefined"==typeof i?new Sk.builtin.float_(c.processing.noise(n.v)):"undefined"==typeof e?new Sk.builtin.float_(c.processing.noise(n.v,i.v)):new Sk.builtin.float_(c.processing.noise(n.v,i.v,e.v))})),c.noiseDetail=new Sk.builtin.func((function(n,i){c.processing.noiseDetail(n.v,i.v)})),c.noiseSeed=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.noiseSeed(n.v))})),c.noLights=new Sk.builtin.func((function(){c.processing.noLights()})),c.norm=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.norm(n.v,i.v,e.v))})),c.normal=new Sk.builtin.func((function(n,i,e){c.processing.normal(n.v,i.v,e.v)})),c.noTint=new Sk.builtin.func((function(){c.processing.noTint()})),c.ortho=new Sk.builtin.func((function(n,i,e,t,u,o){c.processing.ortho(n.v,i.v,e.v,t.v,u.v,o.v)})),c.perspective=new Sk.builtin.func((function(n,i,e,t){"undefined"==typeof n?c.processing.perspective():"undefined"==typeof i?c.processing.perspective(n.v):"undefined"==typeof e?c.processing.perspective(n.v,i.v):"undefined"==typeof t?c.processing.perspective(n.v,i.v,e.v):c.processing.perspective(n.v,i.v,e.v,t.v)})),c.pointLight=new Sk.builtin.func((function(n,i,e,t,u,o){c.processing.pointLight(n.v,i.v,e.v,t.v,u.v,o.v)})),c.printCamera=new Sk.builtin.func((function(){c.processing.printCamera()})),c.println=new Sk.builtin.func((function(n){c.processing.println(n.v)})),c.printProjection=new Sk.builtin.func((function(){c.processing.printProjection()})),c.radians=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.radians(n.v))})),c.randomSeed=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.randomSeed(n.v))})),c.random=new Sk.builtin.func((function(n,i){return"undefined"==typeof n?new Sk.builtin.float_(c.processing.random()):"undefined"==typeof i?new Sk.builtin.float_(c.processing.random(n.v)):new Sk.builtin.float_(c.processing.random(n.v,i.v))})),c.requestImage=new Sk.builtin.func((function(n,i){var e=Sk.misceval.callsimArray(c.PImage);return e.v="undefined"==typeof i?c.processing.requestImage(n.v):c.processing.requestImage(n.v,i.v),e})),c.saturation=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.saturation(n.v))})),c.save=new Sk.builtin.func((function(n){c.processing.save(n.v)})),c.saveFrame=new Sk.builtin.func((function(n){"undefined"==typeof n?c.processing.saveFrame():c.processing.saveFrame(n.v)})),c.saveStrings=new Sk.builtin.func((function(n,i){c.processing.saveStrings(n.v,i.v)})),c.screenX=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.screenX(n.v,i.v,e.v))})),c.screenY=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.screenY(n.v,i.v,e.v))})),c.screenZ=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.screenZ(n.v,i.v,e.v))})),c.second=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.second())})),c.shape=new Sk.builtin.func((function(n,i,e,t,u){"undefined"==typeof i?c.processing.shape(n.v):"undefined"==typeof e?c.processing.shape(n.v,i.v):"undefined"==typeof t?c.processing.shape(n.v,i.v,e.v):"undefined"==typeof u?c.processing.shape(n.v,i.v,e.v,t.v):c.processing.shape(n.v,i.v,e.v,t.v,u.v)})),c.shapeMode=new Sk.builtin.func((function(n){c.processing.shapeMode(n.v)})),c.shininess=new Sk.builtin.func((function(n){c.processing.shininess(n.v)})),c.specular=new Sk.builtin.func((function(n,i,e){"undefined"==typeof i?c.processing.specular(n.v):"undefined"==typeof e?c.processing.specular(n.v,i.v):c.processing.specular(n.v,i.v,e.v)})),c.spotLight=new Sk.builtin.func((function(n,i,e,t,u,o,s,l){c.processing.spotLight(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v)})),c.sq=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.sq(n))})),c.status=new Sk.builtin.func((function(n){c.processing.status(n.v)})),c.textAlign=new Sk.builtin.func((function(n,i){"undefined"==typeof i?c.processing.textAlign(n.v):c.processing.textAlign(n.v,i.v)})),c.textAscent=new Sk.builtin.func((function(){return new Sk.builtin.float_(c.processing.textAscent())})),c.textDescent=new Sk.builtin.func((function(){return new Sk.builtin.float_(c.processing.textDescent())})),c.textFont=new Sk.builtin.func((function(n,i){"undefined"==typeof i?c.processing.textFont(n.v):c.processing.textFont(n.v,i.v)})),c.textLeading=new Sk.builtin.func((function(n){c.processing.textLeading(n.v)})),c.textMode=new Sk.builtin.func((function(n){c.processing.textMode(n.v)})),c.textSize=new Sk.builtin.func((function(n){c.processing.textSize(n.v)})),c.texture=new Sk.builtin.func((function(n){c.processing.texture(n.v)})),c.textureMode=new Sk.builtin.func((function(n){c.processing.textureMode(n.v)})),c.textWidth=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.textWidth(n.v))})),c.tint=new Sk.builtin.func((function(n,i,e,t){"undefined"==typeof i?c.processing.tint(n.v):"undefined"==typeof e?c.processing.tint(n.v,i.v):"undefined"==typeof t?c.processing.tint(n.v,i.v,e.v):c.processing.tint(n.v,i.v,e.v,t.v)})),c.updatePixels=new Sk.builtin.func((function(){c.processing.updatePixels()})),c.vertex=new Sk.builtin.func((function(n,i,e,t,u){"undefined"==typeof e?c.processing.vertex(n.v,i.v):"undefined"==typeof t?c.processing.vertex(n.v,i.v,e.v):"undefined"==typeof u?c.processing.vertex(n.v,i.v,e.v,t.v):c.processing.vertex(n.v,i.v,e.v,t.v,u.v)})),c.year=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.year())})),c.box=new Sk.builtin.func((function(n){c.processing.box(n.v)})),c.sphere=new Sk.builtin.func((function(n){c.processing.sphere(n.v)})),c.sphereDetail=new Sk.builtin.func((function(n,i){"undefined"==typeof i?c.processing.sphereDetail(n.v):c.processing.sphereDetail(n.v,i.v)})),c.background=new Sk.builtin.func((function(n,i,e){"undefined"!=typeof i&&(i=i.v),"undefined"!=typeof e&&(e=e.v),c.processing.background(n.v,i,e)})),c.fill=new Sk.builtin.func((function(n,i,e,t){"undefined"!=typeof i&&(i=i.v),"undefined"!=typeof e&&(e=e.v),"undefined"!=typeof t&&(t=t.v),c.processing.fill(n.v,i,e,t)})),c.stroke=new Sk.builtin.func((function(n,i,e,t){"undefined"!=typeof i&&(i=i.v),"undefined"!=typeof e&&(e=e.v),"undefined"!=typeof t&&(t=t.v),c.processing.stroke(n.v,i,e,t)})),c.noStroke=new Sk.builtin.func((function(){c.processing.noStroke()})),c.colorMode=new Sk.builtin.func((function(n,i,e,t,u){i="undefined"==typeof i?255:i.v,"undefined"!=typeof e&&(e=e.v),"undefined"!=typeof t&&(t=t.v),"undefined"!=typeof u&&(u=u.v),c.processing.colorMode(n.v,i,e,t,u)})),c.noFill=new Sk.builtin.func((function(){c.processing.noFill()})),c.loop=new Sk.builtin.func((function(){if(null===c.processing)throw new Sk.builtin.Exception("loop() should be called after run()");v=!0,c.processing.loop()})),c.noLoop=new Sk.builtin.func((function(){if(null===c.processing)throw new Sk.builtin.Exception("noLoop() should be called after run()");v=!1,c.processing.noLoop()})),c.frameRate=new Sk.builtin.func((function(n){c.processing.frameRate(n.v)})),c.width=new Sk.builtin.int_(0),c.height=new Sk.builtin.int_(0),c.renderMode=c.P2D,c.size=new Sk.builtin.func((function(n,i,e){"undefined"==typeof e&&(e=c.P2D),c.processing.size(n.v,i.v,e.v),c.width=new Sk.builtin.int_(c.processing.width),c.height=new Sk.builtin.int_(c.processing.height),c.renderMode=e})),c.exitp=new Sk.builtin.func((function(){c.processing.exit()})),c.mouseX=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.mouseX)})),c.mouseY=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.mouseY)})),c.pmouseX=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.pmouseX)})),c.pmouseY=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.pmouseY)})),c.rectMode=new Sk.builtin.func((function(n){c.processing.rectMode(n.v)})),c.strokeWeight=new Sk.builtin.func((function(n){c.processing.strokeWeight(n.v)})),c.smooth=new Sk.builtin.func((function(){c.processing.smooth()})),c.noSmooth=new Sk.builtin.func((function(){c.processing.noSmooth()})),c.ellipseMode=new Sk.builtin.func((function(n){c.processing.ellipseMode(n.v)})),c.strokeCap=new Sk.builtin.func((function(n){c.processing.strokeCap(n.v)})),c.strokeJoin=new Sk.builtin.func((function(n){c.processing.strokeJoin(n.v)})),c.rotate=new Sk.builtin.func((function(n){c.processing.rotate(n.v)})),c.rotateX=new Sk.builtin.func((function(n){c.processing.rotateX(n.v)})),c.rotateY=new Sk.builtin.func((function(n){c.processing.rotateY(n.v)})),c.rotateZ=new Sk.builtin.func((function(n){c.processing.rotateZ(n.v)})),c.scale=new Sk.builtin.func((function(n,i,e){i="undefined"==typeof i?1:i.v,e="undefined"==typeof e?1:e.v,c.processing.scale(n.v,i,e)})),c.translate=new Sk.builtin.func((function(n,i,e){i="undefined"==typeof i?1:i.v,e="undefined"==typeof e?1:e.v,c.processing.translate(n.v,i,e)})),c.popMatrix=new Sk.builtin.func((function(){c.processing.popMatrix()})),c.pushMatrix=new Sk.builtin.func((function(){c.processing.pushMatrix()})),c.applyMatrix=new Sk.builtin.func((function(){var n,i=Array.prototype.slice.call(arguments,0,16);for(n=0;n>>0,this.mti=1;this.mti>>30,this.mt[this.mti]=(1812433253*((4294901760&n)>>>16)<<16)+1812433253*(65535&n)+this.mti,this.mt[this.mti]>>>=0},MersenneTwister.prototype.init_by_array=function(n,t){var i,e,r;for(this.init_genrand(19650218),i=1,e=0,r=this.N>t?this.N:t;r;r--){var u=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(1664525*((4294901760&u)>>>16)<<16)+1664525*(65535&u))+n[e]+e,this.mt[i]>>>=0,e++,++i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1),e>=t&&(e=0)}for(r=this.N-1;r;r--){u=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(1566083941*((4294901760&u)>>>16)<<16)+1566083941*(65535&u))-i,this.mt[i]>>>=0,++i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1)}this.mt[0]=2147483648},MersenneTwister.prototype.genrand_int32=function(){var n,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti==this.N+1&&this.init_genrand(5489),i=0;i>>1^t[1&n];for(;i>>1^t[1&n];n=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^n>>>1^t[1&n],this.mti=0}return n=this.mt[this.mti++],n^=n>>>11,n^=n<<7&2636928640,n^=n<<15&4022730752,(n^=n>>>18)>>>0},MersenneTwister.prototype.genrand_int31=function(){return this.genrand_int32()>>>1},MersenneTwister.prototype.genrand_real1=function(){return this.genrand_int32()*(1/4294967295)},MersenneTwister.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},MersenneTwister.prototype.genrand_real3=function(){return(this.genrand_int32()+.5)*(1/4294967296)},MersenneTwister.prototype.genrand_res53=function(){return(67108864*(this.genrand_int32()>>>5)+(this.genrand_int32()>>>6))*(1/9007199254740992)};var $builtinmodule=function(n){var t={},i=new MersenneTwister,e=void 0;t.seed=new Sk.builtin.func((function(n){return Sk.builtin.pyCheckArgsLen("seed",arguments.length,0,1),n=Sk.builtin.asnum$(n),i=arguments.length>0?new MersenneTwister(n):new MersenneTwister,Sk.builtin.none.none$})),t.random=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("random",arguments.length,0,0),new Sk.builtin.float_(i.genrand_res53())}));var toInt=function(n){return 0|n},randrange=function(n,t,e){var r,u,s;if(!Sk.builtin.checkInt(n))throw new Sk.builtin.ValueError("non-integer first argument for randrange()");if(void 0===t)return s=toInt(i.genrand_res53()*n),new Sk.builtin.int_(s);if(!Sk.builtin.checkInt(t))throw new Sk.builtin.ValueError("non-integer stop for randrange()");if(void 0===e&&(e=1),r=t-n,1==e&&r>0)return s=n+toInt(i.genrand_res53()*r),new Sk.builtin.int_(s);if(1==e)throw new Sk.builtin.ValueError("empty range for randrange() ("+n+", "+t+", "+r+")");if(!Sk.builtin.checkInt(e))throw new Sk.builtin.ValueError("non-integer step for randrange()");if(e>0)u=toInt((r+e-1)/e);else{if(!(e<0))throw new Sk.builtin.ValueError("zero step for randrange()");u=toInt((r+e+1)/e)}if(u<=0)throw new Sk.builtin.ValueError("empty range for randrange()");return s=n+e*toInt(i.genrand_res53()*u),new Sk.builtin.int_(s)};t.randint=new Sk.builtin.func((function(n,t){return Sk.builtin.pyCheckArgsLen("randint",arguments.length,2,2),n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t),randrange(n,t+1)})),t.randrange=new Sk.builtin.func((function(n,t,i){return Sk.builtin.pyCheckArgsLen("randrange",arguments.length,1,3),n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t),i=Sk.builtin.asnum$(i),randrange(n,t,i)})),t.uniform=new Sk.builtin.func((function(n,t){Sk.builtin.pyCheckArgsLen("uniform",arguments.length,2,2),n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t);const e=n+i.genrand_res53()*(t-n);return new Sk.builtin.float_(e)})),t.triangular=new Sk.builtin.func((function(n,t,e){var r,u,s;return Sk.builtin.pyCheckArgsLen("triangular",arguments.length,2,3),Sk.builtin.pyCheckType("low","number",Sk.builtin.checkNumber(n)),Sk.builtin.pyCheckType("high","number",Sk.builtin.checkNumber(t)),(n=Sk.builtin.asnum$(n))>(t=Sk.builtin.asnum$(t))&&(s=n,n=t,t=s),void 0===e||e===Sk.builtin.none.none$?e=(t-n)/2:(Sk.builtin.pyCheckType("mode","number",Sk.builtin.checkNumber(e)),e=Sk.builtin.asnum$(e)),u=(r=i.genrand_res53())<(e-n)/(t-n)?n+Math.sqrt(r*(t-n)*(e-n)):t-Math.sqrt((1-r)*(t-n)*(t-e)),new Sk.builtin.float_(u)}));var normalSample=function(n,t){var r,u,s,h,l;return void 0!==e?(l=e,e=void 0):(r=i.genrand_res53(),u=i.genrand_res53(),s=Math.sqrt(-2*Math.log(r)),h=2*Math.PI*u,l=s*Math.cos(h),e=s*Math.sin(h)),n+t*l};return t.gauss=new Sk.builtin.func((function(n,t){return Sk.builtin.pyCheckArgsLen("gauss",arguments.length,2,2),Sk.builtin.pyCheckType("mu","number",Sk.builtin.checkNumber(n)),Sk.builtin.pyCheckType("sigma","number",Sk.builtin.checkNumber(t)),n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t),new Sk.builtin.float_(normalSample(n,t))})),t.normalvariate=t.gauss,t.lognormvariate=new Sk.builtin.func((function(n,t){return Sk.builtin.pyCheckArgsLen("lognormvariate",arguments.length,2,2),Sk.builtin.pyCheckType("mu","number",Sk.builtin.checkNumber(n)),Sk.builtin.pyCheckType("sigma","number",Sk.builtin.checkNumber(t)),n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t),new Sk.builtin.float_(Math.exp(normalSample(n,t)))})),t.expovariate=new Sk.builtin.func((function(n){Sk.builtin.pyCheckArgsLen("expovariate",arguments.length,1,1),Sk.builtin.pyCheckType("lambd","number",Sk.builtin.checkNumber(n)),n=Sk.builtin.asnum$(n);var t=i.genrand_res53();return new Sk.builtin.float_(-Math.log(t)/n)})),t.choice=new Sk.builtin.func((function(n){if(Sk.builtin.pyCheckArgsLen("choice",arguments.length,1,1),Sk.builtin.pyCheckType("seq","sequence",Sk.builtin.checkSequence(n)),void 0!==n.sq$length){var t=new Sk.builtin.int_(toInt(i.genrand_res53()*n.sq$length()));return n.mp$subscript(t)}throw new Sk.builtin.TypeError("object has no length")})),t.shuffle=new Sk.builtin.func((function(n){if(Sk.builtin.pyCheckArgsLen("shuffle",arguments.length,1,1),Sk.builtin.pyCheckType("x","sequence",Sk.builtin.checkSequence(n)),n.constructor===Sk.builtin.list){const u=n.v;for(var t=u.length-1;t>0;t-=1){var e=u[r=toInt(i.genrand_res53()*(t+1))];u[r]=u[t],u[t]=e}}else{if(void 0===n.sq$length)throw new Sk.builtin.TypeError("object has no length");if(void 0===n.mp$ass_subscript)throw new Sk.builtin.TypeError("object is immutable");for(t=n.sq$length()-1;t>0;t-=1){var r=new Sk.builtin.int_(toInt(i.genrand_res53()*(t+1)));t=new Sk.builtin.int_(t);e=n.mp$subscript(r);n.mp$ass_subscript(r,n.mp$subscript(t)),n.mp$ass_subscript(t,e)}}return Sk.builtin.none.none$})),t.sample=new Sk.builtin.func((function(n,t){var e,r,u,s,h;for(Sk.builtin.pyCheckArgsLen("sample",arguments.length,2,2),Sk.builtin.pyCheckType("population","iterable",Sk.builtin.checkIterable(n)),Sk.builtin.pyCheckType("k","integer",Sk.builtin.checkInt(t)),t=Sk.builtin.asnum$(t),h=[],e=0,s=(u=Sk.abstr.iter(n)).tp$iternext();void 0!==s;e++,s=u.tp$iternext())r=Math.floor(i.genrand_res53()*(e+1)),enew pyStr(e))))},_value2member={},RegexFlagMeta=buildNativeClass("RegexFlagMeta",{constructor:function RegexFlagMeta(){},base:pyType,slots:{tp$iter(){const e=Object.values(_members)[Symbol.iterator]();return new pyIterator((()=>e.next().value))},sq$contains(e){if(!(e instanceof this))throw new TypeError("unsupported operand type(s) for \'in\': \'"+typeName(e)+"\' and \'"+typeName(this)+"\'");return Object.values(_members).includes(e)}}});re.RegexFlag=buildNativeClass("RegexFlag",{meta:RegexFlagMeta,base:pyInt,constructor:function RegexFlag(e){const t=_value2member[e];if(t)return t;this.v=e,_value2member[e]=this},slots:{tp$new(e,t){checkOneArg("RegexFlag",e,t);const r=e[0].valueOf();if(!checkInt(r))throw new ValueError(objectRepr(r)+" is not a valid RegexFlag");return new re.RegexFlag(r)},$r(){let e=this.valueOf();const t=e<0;e=t?~e:e;const r=[];Object.entries(_members).forEach((([t,n])=>{const s=n.valueOf();e&s&&(e&=~s,r.push("re."+t))})),e&&r.push(hex(e).toString());let n=r.join("|");return t&&(n=r.length>1?"~("+n+")":"~"+n),new pyStr(n)},sq$contains(e){if(!(e instanceof re.RegexFlag))throw new TypeError("\'in\' requires a RegexFlag not "+typeName(e));return this.nb$and(e)===e},nb$and:flagBitSlot(((e,t)=>e&t),JSBI.bitwiseAnd),nb$or:flagBitSlot(((e,t)=>e|t),JSBI.bitwiseOr),nb$xor:flagBitSlot(((e,t)=>e^t),JSBI.bitwiseXor),nb$invert:function(){const e=this.v;return"number"==typeof e?new re.RegexFlag(~e):new re.RegexFlag(JSBI.bitwiseNot(e))}},proto:{valueOf(){return this.v}},flags:{sk$acceptable_as_base_class:!1}}),re.TEMPLATE=re.T=new re.RegexFlag(1),re.IGNORECASE=re.I=new re.RegexFlag(2),re.LOCALE=re.L=new re.RegexFlag(4),re.MULTILINE=re.M=new re.RegexFlag(8),re.DOTALL=re.S=new re.RegexFlag(16),re.UNICODE=re.U=new re.RegexFlag(32),re.VERBOSE=re.X=new re.RegexFlag(64),re.DEBUG=new re.RegexFlag(128),re.ASCII=re.A=new re.RegexFlag(256);const _members={ASCII:re.A,IGNORECASE:re.I,LOCALE:re.L,UNICODE:re.U,MULTILINE:re.M,DOTALL:re.S,VERBOSE:re.X,TEMPLATE:re.T,DEBUG:re.DEBUG};function flagBitSlot(e,t){return function(r){if(r instanceof re.RegexFlag||r instanceof pyInt){let n=this.v,s=r.v;if("number"==typeof n&&"number"==typeof s){let t=e(n,s);return t<0&&(t+=4294967296),new re.RegexFlag(t)}return n=JSBI.BigUp(n),s=JSBI.BigUp(s),new re.RegexFlag(JSBI.numberIfSafe(t(n,s)))}return pyNotImplemented}}const jsFlags={i:re.I,m:re.M,s:re.S,u:re.U},jsInlineFlags={i:re.I,a:re.A,s:re.S,L:re.L,m:re.M,u:re.U,x:re.X};RegExp.prototype.hasOwnProperty("sticky")||delete jsFlags.s,RegExp.prototype.hasOwnProperty("unicode")||delete jsFlags.u;const flagFails=Object.entries({"cannot use LOCALE flag with a str pattern":re.L,"ASCII and UNICODE flags are incompatible":new re.RegexFlag(re.A.valueOf()|re.U.valueOf())}),inline_regex=/\\(\\?([isamux]+)\\)/g;function adjustFlags(e,t){let r=e.toString(),n="g",s=0;return r=r.replace(inline_regex,((e,t)=>{for(let r of t){const e=jsInlineFlags[r];s|=e.valueOf()}return""})),flagFails.forEach((([e,t])=>{if((t.valueOf()&s)===t.valueOf())throw new re.error("bad bad inline flags: "+e)})),t=numberBinOp(new re.RegexFlag(s),t,"BitOr"),flagFails.forEach((([e,r])=>{if(numberBinOp(r,t,"BitAnd")===r)throw new ValueError(e)})),numberBinOp(re.A,t,"BitAnd")!==re.A&&(t=numberBinOp(re.U,t,"BitOr")),Object.entries(jsFlags).forEach((([e,r])=>{numberBinOp(r,t,"BitAnd")===r&&(n+=e)})),t=new re.RegexFlag(t.valueOf()),[r,n,t]}let neg_lookbehind_A="(?)(?!(?:\\]|[^\\[]*[^\\\\]\\]))/g,py_to_js_unicode_escape=/\\\\[\\t\\r\\n \\v\\f#&~"\'!:,;`<>]|\\\\-(?!(?:\\]|[^\\[]*[^\\\\]\\]))/g,quantifierErrors=/Incomplete quantifier|Lone quantifier/g,_compiled_patterns=Object.create(null);function compile_pattern(e,t){let r,n;[r,n,t]=adjustFlags(e,t);const s=_compiled_patterns[e.toString()];if(s&&s.$flags===t)return s;const i={};let o,a;r="_"+r,r=r.replace(initialUnescapedBracket,"$1$2\\\\]$3"),r=r.replace(py_to_js_regex,((t,r,n,s,o,a)=>{switch(n){case"\\\\A":return r+neg_lookbehind_A+"^";case"\\\\Z":return r+"$(?!\\\\n)";case"{,":return r+"{0,";case"$":return r+"(?:(?=\\\\n$)|$)";default:if(n.endsWith(">"))return i[o]=!0,r+"(?<"+o+">";if(!i[s])throw new re.error("unknown group name "+s+" at position "+a+1,e,new pyInt(a+1));return r+"\\\\k<"+s+">"}})),r=r.slice(1);let l=r;n.includes("u")&&(l=r.replace(py_to_js_unicode_escape,(e=>{switch(e){case"\\\\ ":return" ";case"\\\\\\t":return"\\\\t";case"\\\\\\n":return"\\\\n";case"\\\\\\v":return"\\\\v";case"\\\\\\f":return"\\\\f";case"\\\\r":return"\\\\r";default:return e.slice(1)}})));try{o=new RegExp(l,n)}catch(g){if(!quantifierErrors.test(g.message))throw a=g.message.substring(g.message.lastIndexOf(":")+2)+" in pattern: "+e.toString(),new re.error(a,e);try{o=new RegExp(r,n.replace("u",""))}catch(g){throw a=g.message.substring(g.message.lastIndexOf(":")+2)+" in pattern: "+e.toString(),new re.error(a,e)}}const p=new re.Pattern(o,e,t);return _compiled_patterns[e.toString()]=p,p}function _compile(e,t){if(e instanceof re.Pattern){if(t!==zero||t.valueOf())throw new ValueError("cannot process flags argument with compiled pattern");return e}if(!checkString(e))throw new TypeError("first argument must be string or compiled pattern");return compile_pattern(e,t)}re.error=buildNativeClass("re.error",{base:Exception,constructor:function error(e,t,r){this.$pattern=t,this.$msg=e,this.$pos=r||pyNone,Exception.call(this,e)},slots:{tp$doc:"Exception raised for invalid regular expressions.\\n\\n Attributes:\\n\\n msg: The unformatted error message\\n pattern: The regular expression pattern\\n",tp$init(e,t){const[r,n,s]=copyKeywordToNamedArgs("re.error",["msg","pattern","pos"],e,t,[pyNone,pyNone]);this.$pattern=n,this.$pos=s,this.$msg=r}},getsets:{msg:{$get(){return this.$msg}},pattern:{$get(){return this.$pattern}},pos:{$get(){return this.$pos}}}});const zero=new pyInt(0),maxsize=Number.MAX_SAFE_INTEGER;re.Pattern=buildNativeClass("re.Pattern",{constructor:function(e,t,r){this.v=e,this.str=t,this.$flags=r,this.$groups=null,this.$groupindex=null},slots:{$r(){const e=objectRepr(this.str).slice(0,200),t=objectRepr(this.$flags.nb$and(re.U.nb$invert()));return new pyStr("re.compile("+e+(t?", "+t:"")+")")},tp$richcompare(e,t){if("Eq"!==t&&"NotEq"!==t||!(e instanceof re.Pattern))return pyNotImplemented;const r=this.str===e.str&&this.$flags===e.$flags;return"Eq"===t?r:!r},tp$hash(){},tp$doc:"Compiled regular expression object."},methods:{match:{$meth:function match(e,t,r){return this.$match(e,t,r)},$flags:{NamedArgs:["string","pos","endpos"],Defaults:[zero,maxsize]},$textsig:"($self, /, string, pos=0, endpos=sys.maxsize)",$doc:"Matches zero or more characters at the beginning of the string."},fullmatch:{$meth:function fullmatch(e,t,r){return this.full$match(e,t,r)},$flags:{NamedArgs:["string","pos","endpos"],Defaults:[zero,maxsize]},$textsig:"($self, /, string, pos=0, endpos=sys.maxsize)",$doc:"Matches against all of the string."},search:{$meth:function search(e,t,r){return this.$search(e,t,r)},$flags:{NamedArgs:["string","pos","endpos"],Defaults:[zero,maxsize]},$textsig:"($self, /, string, pos=0, endpos=sys.maxsize)",$doc:"Scan through string looking for a match, and return a corresponding match object instance.\\n\\nReturn None if no position in the string matches."},sub:{$meth:function sub(e,t,r){return this.$sub(e,t,r)},$flags:{NamedArgs:["repl","string","count"],Defaults:[zero]},$textsig:"($self, /, repl, string, count=0)",$doc:"Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl."},subn:{$meth:function(e,t,r){return this.$subn(e,t,r)},$flags:{NamedArgs:["repl","string","count"],Defaults:[zero]},$textsig:"($self, /, repl, string, count=0)",$doc:"Return the tuple (new_string, number_of_subs_made) found by replacing the leftmost non-overlapping occurrences of pattern with the replacement repl."},findall:{$meth:function findall(e,t,r){return this.find$all(e,t,r)},$flags:{NamedArgs:["string","pos","endpos"],Defaults:[zero,maxsize]},$textsig:"($self, /, string, pos=0, endpos=sys.maxsize)",$doc:"Return a list of all non-overlapping matches of pattern in string."},split:{$meth:function split(e,t){return this.$split(e,t)},$flags:{NamedArgs:["string","maxsplit"],Defaults:[zero]},$textsig:"($self, /, string, maxsplit=0)",$doc:"Split string by the occurrences of pattern."},finditer:{$meth:function finditer(e,t,r){return this.find$iter(e,t,r)},$flags:{NamedArgs:["string","pos","endpos"],Defaults:[zero,maxsize]},$textsig:"($self, /, string, pos=0, endpos=sys.maxsize)",$doc:"Return an iterator over all non-overlapping matches for the RE pattern in string.\\n\\nFor each match, the iterator returns a match object."},scanner:{$meth:function scanner(e,t,r){return this.$scanner(e,t,r)},$flags:{NamedArgs:["string","pos","endpos"],Defaults:[zero,maxsize]},$textsig:"($self, /, string, pos=0, endpos=sys.maxsize)",$doc:null},__copy__:{$meth:function copy(){return this},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:null},__deepcopy__:{$meth:function(){return this},$flags:{OneArg:!0},$textsig:"($self, memo, /)",$doc:null}},getsets:{pattern:{$get(){return this.str},$doc:"The pattern string from which the RE object was compiled."},flags:{$get(){return this.$flags},$doc:"The regex matching flags."},groups:{$get(){if(null===this.$groups){const e=(this.str.v.match(this.group$regex)||[]).length;this.$groups=new pyInt(e)}return this.$groups},$doc:"The number of capturing groups in the pattern."},groupindex:{$get(){if(null===this.$groupindex){const e=this.str.v.matchAll(this.group$regex),t=[];let r=1;for(const n of e)n[1]&&(t.push(new pyStr(n[1])),t.push(new pyInt(r))),r++;this.$groupindex=new pyMappingProxy(new pyDict(t))}return this.$groupindex},$doc:"A dictionary mapping group names to group numbers."}},proto:{group$regex:/\\((?!\\?(?!P<).*)(?:\\?P<([^\\d\\W]\\w*)>)?(?![^\\[]*\\])/g,get$count:e=>(e=asIndexSized(e,OverflowError))||Number.POSITIVE_INFINITY,get$jsstr(e,t,r){if(!checkString(e))throw new TypeError("expected string or bytes-like object");if(t===zero&&r===maxsize||void 0===t&&void 0===r)return{jsstr:e.toString(),pos:zero.valueOf(),endpos:e.sq$length()};const{start:n,end:s}=pySlice.startEnd$wrt(e,t,r);return{jsstr:e.toString().slice(n,s),pos:n,endpos:s}},find$all(e,t,r){let{jsstr:n}=this.get$jsstr(e,t,r);const s=this.v,i=n.matchAll(s),o=[];for(let a of i)o.push(1===a.length?new pyStr(a[0]):2===a.length?new pyStr(a[1]):new pyTuple(a.slice(1).map((e=>new pyStr(e)))));return new pyList(o)},$split(e,t){t=(t=asIndexSized(t))||Number.POSITIVE_INFINITY;let{jsstr:r}=this.get$jsstr(e);const n=this.v,s=[];let i,o=0,a=0;for(;null!==(i=n.exec(r))&&o1&&s.push(...i.slice(1).map((e=>void 0===e?pyNone:new pyStr(e)))),o++,a=n.lastIndex,i.index===n.lastIndex){if(!r)break;r=r.slice(i.index),a=0,n.lastIndex=1}return n.lastIndex=0,s.push(new pyStr(r.slice(a))),new pyList(s)},match$from_repl(e,t,r,n){let s;const i=e[e.length-1];return"object"==typeof i?(s=e.slice(0,e.length-3),Object.assign(s,{groups:i}),s.index=e[e.length-3]):(s=e.slice(0,e.length-2),s.groups=void 0,s.index=e[e.length-2]),new re.Match(s,this.str,t,r,n)},do$sub(e,t,r){const{jsstr:n,pos:s,endpos:i}=this.get$jsstr(t);let o;checkCallable(e)?o=t=>{const r=pyCall(e,[t]);if(!checkString(r))throw new TypeError("expected str instance, "+typeName(r)+" found");return r.toString()}:(e=this.get$jsstr(e).jsstr,o=t=>t.template$repl(e)),r=this.get$count(r);let a=0;const l=n.replace(this.v,((...e)=>{if(a>=r)return e[0];a++;const n=this.match$from_repl(e,t,s,i);return o(n)}));return[new pyStr(l),new pyInt(a)]},$sub(e,t,r){const[n]=this.do$sub(e,t,r);return n},$subn(e,t,r){return new pyTuple(this.do$sub(e,t,r))},do$match(e,t,r,n){let s;({jsstr:s,pos:r,endpos:n}=this.get$jsstr(t,r,n));const i=s.match(e);return null===i?pyNone:new re.Match(i,this,t,r,n)},$search(e,t,r){var n=new RegExp(this.v.source,this.v.flags.replace("g",""));return this.do$match(n,e,t,r)},$match(e,t,r){let n=this.v.source,s=this.v.flags.replace("g","").replace("m","");n="^"+n;var i=new RegExp(n,s);return this.do$match(i,e,t,r)},full$match(e,t,r){let n=this.v.source,s=this.v.flags.replace("g","").replace("m","");n="^(?:"+n+")$";var i=new RegExp(n,s);return this.do$match(i,e,t,r)},find$iter(e,t,r){let n;({jsstr:n,pos:t,endpos:r}=this.get$jsstr(e,t,r));const s=n.matchAll(this.v);return new pyIterator((()=>{const n=s.next().value;if(void 0!==n)return new re.Match(n,this,e,t,r)}))}},flags:{sk$acceptable_as_base_class:!1}}),re.Match=buildNativeClass("re.Match",{constructor:function(e,t,r,n,s){this.v=e,this.$match=new pyStr(this.v[0]),this.str=r,this.$re=t,this.$pos=n,this.$endpos=s,this.$groupdict=null,this.$groups=null,this.$lastindex=null,this.$lastgroup=null,this.$regs=null},slots:{tp$doc:"The result of re.match() and re.search().\\nMatch objects always have a boolean value of True.",$r(){let e="",new pyStr(e)},tp$as_squence_or_mapping:!0,mp$subscript(e){const t=this.get$group(e);return void 0===t?pyNone:new pyStr(t)}},methods:{group:{$meth:function group(...e){let t;return e.length<=1?(t=this.get$group(e[0]),void 0===t?pyNone:new pyStr(t)):(t=[],e.forEach((e=>{e=this.get$group(e),t.push(void 0===e?pyNone:new pyStr(e))})),new pyTuple(t))},$flags:{MinArgs:0},$textsig:null,$doc:"group([group1, ...]) -> str or tuple.\\n Return subgroup(s) of the match by indices or names.\\n For 0 returns the entire match."},start:{$meth:function start(e){const t=this.get$group(e);return new pyInt(void 0===t?-1:this.str.v.indexOf(t,this.v.index+this.$pos))},$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, group=0, /)",$doc:"Return index of the start of the substring matched by group."},end:{$meth:function end(e){const t=this.get$group(e);return new pyInt(void 0===t?-1:this.str.v.indexOf(t,this.v.index+this.$pos)+[...t].length)},$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, group=0, /)",$doc:"Return index of the end of the substring matched by group."},span:{$meth:function span(e){return this.$span(e)},$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, group=0, /)",$doc:"For match object m, return the 2-tuple (m.start(group), m.end(group))."},groups:{$meth:function groups(e){return null!==this.$groups||(this.$groups=Array.from(this.v.slice(1),(t=>void 0===t?e:new pyStr(t))),this.$groups=new pyTuple(this.$groups)),this.$groups},$flags:{NamedArgs:["default"],Defaults:[pyNone]},$textsig:"($self, /, default=None)",$doc:"Return a tuple containing all the subgroups of the match, from 1.\\n\\n default\\n Is used for groups that did not participate in the match."},groupdict:{$meth:function groupdict(e){if(null!==this.$groupdict)return this.$groupdict;if(void 0===this.v.groups)this.$groupdict=new pyDict;else{const t=[];Object.entries(this.v.groups).forEach((([r,n])=>{t.push(new pyStr(r)),t.push(void 0===n?e:new pyStr(n))})),this.$groupdict=new pyDict(t)}return this.$groupdict},$flags:{NamedArgs:["default"],Defaults:[pyNone]},$textsig:"($self, /, default=None)",$doc:"Return a dictionary containing all the named subgroups of the match, keyed by the subgroup name.\\n\\n default\\n Is used for groups that did not participate in the match."},expand:{$meth:function expand(e){if(!checkString(e))throw new TypeError("expected str instance got "+typeName(e));return e=e.toString(),e=this.template$repl(e),new pyStr(e)},$flags:{OneArg:!0},$textsig:"($self, /, template)",$doc:"Return the string obtained by doing backslash substitution on the string template, as done by the sub() method."},__copy__:{$meth:function __copy__(){return this},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:null},__deepcopy__:{$meth:function __deepcopy__(){return this},$flags:{OneArg:!0},$textsig:"($self, memo, /)",$doc:null}},getsets:{lastindex:{$get(){if(null!==this.$lastindex)return this.$lastindex;let e,t=0;return this.v.forEach(((r,n)=>{n&&void 0!==r&&e!==r&&(t=n,e=r)})),this.$lastindex=t?new pyInt(t):pyNone,this.$lastindex},$doc:"The integer index of the last matched capturing group."},lastgroup:{$get(){if(null!==this.$lastgroup)return this.$lastgroup;if(void 0===this.v.groups)this.$lastgroup=pyNone;else{let e;Object.entries(this.v.groups).forEach((([t,r])=>{void 0!==r&&(e=t)})),this.$lastgroup=void 0===e?pyNone:new pyStr(e)}return this.$lastgroup},$doc:"The name of the last matched capturing group."},regs:{$get(){if(null!==this.$regs)return this.$regs;const e=[];return this.v.forEach(((t,r)=>{e.push(this.$span(r))})),this.$regs=new pyTuple(e),this.$regs}},string:{$get(){return this.str},$doc:"The string passed to match() or search()."},re:{$get(){return this.$re},$doc:"The regular expression object."},pos:{$get(){return new pyInt(this.$pos)},$doc:"The index into the string at which the RE engine started looking for a match."},endpos:{$get(){return new pyInt(this.$endpos)},$doc:"The index into the string beyond which the RE engine will not go."}},proto:{get$group(e){if(void 0===e)return this.v[0];if(checkString(e)){if(e=e.toString(),this.v.groups&&Object.prototype.hasOwnProperty.call(this.v.groups,e))return this.v.groups[e]}else if(isIndex(e)&&(e=asIndexSized(e))>=0&&e|\\\\g<([^\\d\\W]\\w*)>|\\\\g?/g,template$repl(e){return e.replace(this.template$regex,((e,t,r,n,s,i)=>{let o;if(void 0!==(t=t||r)?o=t{delete _compiled_patterns[e]})),pyNone},$flags:{NoArgs:!0},$textsig:"($module, / )",$doc:"Clear the regular expression caches"},template:{$meth:function template(e,t){return _compile(e,numberBinOp(re.T,t,"BitOr"))},$flags:{NamedArgs:["pattern","flags"],Defaults:[zero]},$textsig:"($module, / , pattern, flags=0)",$doc:"Compile a template pattern, returning a Pattern object"},escape:{$meth:function(e){if(!checkString(e))throw new TypeError("expected a str instances, got "+typeName(e));return e=(e=e.toString()).replace(escape_chrs,"\\\\$&"),new pyStr(e)},$flags:{NamedArgs:["pattern"],Defaults:[]},$textsig:"($module, / , pattern)",$doc:"\\n Escape special characters in a string.\\n "}});const escape_chrs=/[\\&\\~\\#.*+\\-?^${}()|[\\]\\\\\\t\\r\\v\\f\\n ]/g;return re}',"src/lib/requests/__init__.js":'var $builtinmodule=function(e){var n={__name__:new Sk.builtin.str("requests")};n.Response=Sk.misceval.buildClass(n,(function(e,n){n.__init__=new Sk.builtin.func((function(e,n){e.data$=n,e.lineList=e.data$.split("\\n"),e.lineList=e.lineList.slice(0,-1);for(var t=0;t")})),n.__repr__=n.__str__,n.__iter__=new Sk.builtin.func((function(e){var n=e.lineList;return Sk.builtin.makeGenerator((function(){if(!(this.$index>=this.$lines.length))return new Sk.builtin.str(this.$lines[this.$index++])}),{$obj:e,$index:0,$lines:n})})),n.read=new Sk.builtin.func((function(e,n){if(e.closed)throw new Sk.builtin.ValueError("I/O operation on closed file");var t=e.data$.length;void 0===n&&(n=t);var i=new Sk.builtin.str(e.data$.substr(e.pos$,n));return e.pos$+=n,e.pos$>=t&&(e.pos$=t),i})),n.readline=new Sk.builtin.func((function(e,n){var t="";return e.currentLine{var t="";if(e instanceof String||e instanceof Number||e instanceof Boolean)try{var i=n.toString().replaceAll("=","@");i=i.replaceAll("&","$");var r=e.toString().replaceAll("=","@");r=r.replaceAll("&","$"),t+="&"+i+"="+encodeURIComponent(r)}catch(s){t+="&"+n+"="+encodeURIComponent(e)}else $.each(e,(function(i){t+="&"+jsonToUrl(this,null==n?i:n+(e instanceof Array?"["+i+"]":"."+i))}));return t.substr(1)},requestFunc=function(e,t){e=Sk.ffi.remapToJs(e),t=Sk.ffi.remapToJs(t);const i=["method","url","params","data","headers","cookies","files","auth","timeout","allow_redirects","proxies","hooks","stream","verify","cert","json"];let r={method:"GET",url:"",params:null,data:"",headers:{"Content-type":"application/x-www-form-urlencoded"},cookies:null,files:null,auth:null,timeout:1e3,allow_redirects:null,proxies:null,hooks:null,stream:null,verify:null,cert:null,json:null};for(let n in e)r[i[n]]=e[n];for(let n=0;n=n){r=t.decoder.decode(new Uint8Array(e));break}}else{switch(224&o){case 252:n=6;break;case 248:n=5;break;case 240:n=4;break;case 224:n=3;break;default:n=2}e.push(o)}}return r},t.startReadLine=function(){t.readLineTimer=window.setTimeout((()=>{if(!t.keepReading)return void window.clearTimeout(t.readLineTimer);let e=!1;do{const n=t.readLine();e=n.endWithLF;const{text:r}=n;if(r&&t.output.push((t.output.length?t.output.pop():"")+r),e){t.output.length&&console.log(t.output),t.output.push("")}}while(e);for(;t.output.length>500;)t.output.shift();t.keepReading&&t.startReadLine()}),100)},t.addReadEvent=async function(){for(t.output=[],t.inputBuffer=[],t.outputBuffer=[],t.refreshInputBuffer=!1,t.refreshOutputBuffer=!0,t.startReadLine();t.obj.readable&&t.keepReading;){t.reader=t.obj.readable.getReader();try{for(;;){const{value:e,done:n}=await t.reader.read();if(t.refreshOutputBuffer&&e&&(t.outputBuffer=[...t.outputBuffer,...e]),t.refreshInputBuffer&&e&&(t.inputBuffer=[...t.inputBuffer,...e]),n)break}}catch(e){console.log(e)}finally{t.reader.releaseLock()}}},t.writeString=async function(e){const n=t.encoder.encode(e);await t.writeByteArr(n)},t.writeByteArr=async function(e){const n=t.obj.writable.getWriter();await n.write(new Int8Array(e).buffer),n.releaseLock(),await t.sleep(200)},t.setBaudRate=async function(e){t.keepReading=!1;const n=t.obj;await t.close(),await n.open({baudRate:e-0}),t.obj=n,t.keepReading=!0,t.addReadEvent()},t.setDTR=async function(e){t.dtr=e,await t.obj.setSignals({dataTerminalReady:e})},t.setRTS=async function(e){t.rts=e,await t.obj.setSignals({requestToSend:e})},t.setSignals=async function(e,n){t.dtr=e,t.rts=n,await t.obj.setSignals({dataTerminalReady:e,requestToSend:n})};let n={__name__:new Sk.builtin.str("serial")},r={baudrate:115200,bytesize:8,parity:"N",stopbits:1,timeout:1e3,xonxoff:!1,rtscts:!1,dsrdtr:!1};const serialInitFunc=function(e,n){e=Sk.ffi.remapToJs(e),n=Sk.ffi.remapToJs(n);const o=["baudrate","bytesize","parity","stopbits","timeout","xonxoff","rtscts","dsrdtr"];for(let t in e)e[t]&&(r[o[t]]=e[t]);const i=new Promise(((e,n)=>{t.isConnected()?e(t.obj):navigator.serial.requestPort().then((function(t){e(t)})).catch((function(e){t.obj=null,n(e)}))}));let u,a=new Sk.misceval.Suspension;return a.resume=function(){if(a.data.error)throw a.data.error;return Sk.builtin.none.none$},a.data={type:"Sk.promise",promise:i.then((function(e){return t.obj=e,Sk.builtin.none.none$}),(function(e){return console.log("err3",e),u="",Promise.reject(e)}))},a};serialInitFunc.co_fastcall=1;const serialOpenFunc=function(e,n){const o=new Promise(((e,n)=>{t.isConnected()?t.isOpend()?e():t.obj.open({baudRate:r.baudrate}).then((async function(){t.keepReading=!0,t.addReadEvent(),e()})).catch((function(e){t.obj=null,n(e)})):n("No serial found")}));let i=new Sk.misceval.Suspension;return i.resume=function(){if(i.data.error)throw i.data.error;return Sk.builtin.none.none$},i.data={type:"Sk.promise",promise:o.then((function(e){return Sk.builtin.none.none$}),(function(e){return console.log("err3",e),Promise.reject(e)}))},i},serialReadlineFunc=function(e,n){if(!t.isConnected())return new Sk.builtin.str("");if(console.log("length:",t.output.length),!t.isOpend()||t.output.length<2)return new Sk.builtin.str("");let r=t.output.shift();return console.log(r),new Sk.builtin.str(r)};return n.Serial=Sk.misceval.buildClass(n,(function(e,t){t.__init__=new Sk.builtin.func(serialInitFunc),t.__str__=new Sk.builtin.func((function(e){return Sk.ffi.remapToPy("")})),t.open=new Sk.builtin.func(serialOpenFunc),t.readline=new Sk.builtin.func(serialReadlineFunc)}),"Serial",[]),n};',"src/lib/signal.js":'var $builtinmodule=function(n){var i={};return i.SIG_DFL=new Sk.builtin.int_(0),i.SIG_IGN=new Sk.builtin.int_(1),i.CTRL_C_EVENT=new Sk.builtin.int_(0),i.CTRL_BREAK_EVENT=new Sk.builtin.int_(0),i.NSIG=new Sk.builtin.int_(23),i.SIGHUP=new Sk.builtin.int_(1),i.SIGNINT=new Sk.builtin.int_(2),i.SIGILL=new Sk.builtin.int_(4),i.SIGFPE=new Sk.builtin.int_(8),i.SIGKILL=new Sk.builtin.int_(9),i.SIGSEGV=new Sk.builtin.int_(11),i.SIGTERM=new Sk.builtin.int_(15),i.SIGBREAK=new Sk.builtin.int_(21),i.SIGABRT=new Sk.builtin.int_(22),i.pause=new Sk.builtin.func((function(){Sk.builtin.pyCheckArgsLen("pause",arguments.length,0,0);var n=new Sk.misceval.Suspension;return n.resume=function(){return Sk.builtin.none.none$},n.data={type:"Sk.promise",promise:new Promise((function(n,i){if(null!=Sk.signals&&Sk.signals.addEventListener){Sk.signals.addEventListener((function handleSignal(i){Sk.signals.removeEventListener(handleSignal),n()}))}else console.warn("signal.pause() not supported"),Sk.misceval.print_("signal.pause() not supported"),n()}))},n})),i.signal=new Sk.builtin.func((function(){throw new Sk.builtin.NotImplementedError("signal.signal is not supported.")})),i};',"src/lib/string.js":'var $builtinmodule=function(i){var t={};return t.ascii_lowercase=new Sk.builtin.str("abcdefghijklmnopqrstuvwxyz"),t.ascii_uppercase=new Sk.builtin.str("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.ascii_letters=new Sk.builtin.str(t.ascii_lowercase.v+t.ascii_uppercase.v),t.lowercase=new Sk.builtin.str("abcdefghijklmnopqrstuvwxyz"),t.uppercase=new Sk.builtin.str("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.letters=new Sk.builtin.str(t.lowercase.v+t.uppercase.v),t.digits=new Sk.builtin.str("0123456789"),t.hexdigits=new Sk.builtin.str("0123456789abcdefABCDEF"),t.octdigits=new Sk.builtin.str("01234567"),t.punctuation=new Sk.builtin.str("!\\"#$%&\'()*+,-./:;<=>?@[\\\\]^_`{|}~"),t.whitespace=new Sk.builtin.str("\\t\\n\\v\\f\\r "),t.printable=new Sk.builtin.str(t.digits.v+t.letters.v+t.punctuation.v+" \\t\\n\\r\\v\\f"),t.split=new Sk.builtin.func((function(...i){return Sk.misceval.callsimArray(Sk.builtin.str.prototype.split,i)})),t.capitalize=new Sk.builtin.func((function(i){return Sk.misceval.callsimArray(Sk.builtin.str.prototype.capitalize,[i])})),t.join=new Sk.builtin.func((function(i,t){return void 0===t&&(t=new Sk.builtin.str(" ")),Sk.misceval.callsimArray(Sk.builtin.str.prototype.join,[t,i])})),t.capwords=new Sk.builtin.func((function(i,n){if(Sk.builtin.pyCheckArgsLen("capwords",arguments.length,1,2),!Sk.builtin.checkString(i))throw new Sk.builtin.TypeError("s must be a string");if(void 0===n&&(n=new Sk.builtin.str(" ")),!Sk.builtin.checkString(n))throw new Sk.builtin.TypeError("sep must be a string");for(var e=Sk.misceval.callsimArray(t.split,[i,n]).v,r=[],l=0;l1&&function isLeapYear(t){return 0==(3&t)&&(t%100!=0||t%400==0)}(e?t.getUTCFullYear():t.getFullYear())&&u++,u}function stdTimezoneOffset(){var t=new Date(2002,0,1),e=new Date(2002,6,1);return Math.max(t.getTimezoneOffset(),e.getTimezoneOffset())}function dst(t){return t.getTimezoneOffset()1)return n[1];if(void 0===e)return null;try{return(n=t.toLocaleString(e,{timeZoneName:"short"}).split(" "))[n.length-1]}catch(i){return null}}function from_seconds(t,e){var i=new Date;if(t){Sk.builtin.pyCheckType("secs","number",Sk.builtin.checkNumber(t));var u=Sk.builtin.asnum$(t);i.setTime(1e3*u)}return function date_to_struct_time(t,e){let i;if(e=e||!1)i=[new Sk.builtin.str("UTC"),new Sk.builtin.int_(0)];else{var u=-t.getTimezoneOffset()/60,r=(u<0?"-":"+")+(""+Math.abs(u)).padStart(2,"0");i=[new Sk.builtin.str(r),new Sk.builtin.int_(3600*u)]}return new n([Sk.builtin.assk$(e?t.getUTCFullYear():t.getFullYear()),Sk.builtin.assk$((e?t.getUTCMonth():t.getMonth())+1),Sk.builtin.assk$(e?t.getUTCDate():t.getDate()),Sk.builtin.assk$(e?t.getUTCHours():t.getHours()),Sk.builtin.assk$(e?t.getUTCMinutes():t.getMinutes()),Sk.builtin.assk$(e?t.getUTCSeconds():t.getSeconds()),Sk.builtin.assk$(((e?t.getUTCDay():t.getDay())+6)%7),Sk.builtin.assk$(getDayOfYear(t,e)),Sk.builtin.assk$(e?0:dst(t)?1:0)],i)}(i,e)}e.struct_time=n,e.time=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("time",arguments.length,0,0),new Sk.builtin.float_(Date.now()/1e3)})),e.sleep=new Sk.builtin.func((function(t){return Sk.builtin.pyCheckArgsLen("sleep",arguments.length,1,1),Sk.builtin.pyCheckType("delay","float",Sk.builtin.checkNumber(t)),new Sk.misceval.promiseToSuspension(new Promise((function(e){Sk.setTimeout((function(){e(Sk.builtin.none.none$)}),1e3*Sk.ffi.remapToJs(t))})))})),e.localtime=new Sk.builtin.func((function(t){return Sk.builtin.pyCheckArgsLen("localtime",arguments.length,0,1),from_seconds(t,!1)})),e.gmtime=new Sk.builtin.func((function(t){return Sk.builtin.pyCheckArgsLen("gmtime",arguments.length,0,1),from_seconds(t,!0)}));var i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],u=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function asctime_f(t){if(Sk.builtin.pyCheckArgsLen("asctime",arguments.length,0,1),!t||Sk.builtin.checkNone(t)?t=from_seconds():t instanceof n||(t=new n(t)),t instanceof Sk.builtin.tuple&&9==t.v.length){var e=[];return e.push(u[Sk.builtin.asnum$(t.v[6])]),e.push(i[Sk.builtin.asnum$(t.v[1])-1]),e.push(padLeft(Sk.builtin.asnum$(t.v[2]).toString(),2,"0")),e.push(padLeft(Sk.builtin.asnum$(t.v[3]).toString(),2,"0")+":"+padLeft(Sk.builtin.asnum$(t.v[4]).toString(),2,"0")+":"+padLeft(Sk.builtin.asnum$(t.v[5]).toString(),2,"0")),e.push(padLeft(Sk.builtin.asnum$(t.v[0]).toString(),4,"0")),new Sk.builtin.str(e.join(" "))}}function mktime_f(t){if(Sk.builtin.pyCheckArgsLen("mktime",arguments.length,1,1),t instanceof Sk.builtin.tuple&&9==t.v.length){var e=new Date(Sk.builtin.asnum$(t.v[0]),Sk.builtin.asnum$(t.v[1])-1,Sk.builtin.asnum$(t.v[2]),Sk.builtin.asnum$(t.v[3]),Sk.builtin.asnum$(t.v[4]),Sk.builtin.asnum$(t.v[5]));return Sk.builtin.assk$(e.getTime()/1e3,void 0)}throw new Sk.builtin.TypeError("mktime() requires a struct_time or 9-tuple")}e.asctime=new Sk.builtin.func(asctime_f),e.ctime=new Sk.builtin.func((function(t){return Sk.builtin.pyCheckArgsLen("ctime",arguments.length,0,1),asctime_f(from_seconds(t))})),e.mktime=new Sk.builtin.func(mktime_f),e.timezone=new Sk.builtin.int_(60*stdTimezoneOffset()),e.altzone=new Sk.builtin.int_(60*function altTimezoneOffset(){var t=new Date(2002,0,1),e=new Date(2002,6,1);return Math.min(t.getTimezoneOffset(),e.getTimezoneOffset())}()),e.daylight=new Sk.builtin.int_(function daylight_check(){const t=new Date(2002,0,1),e=new Date(2002,6,1);return t.getTimezoneOffset()!=e.getTimezoneOffset()}()?1:0),e.tzname=new Sk.builtin.tuple(function timeZoneNames(){var t=new Date(2002,0,1),e=new Date(2002,6,1);return dst(t)?[new Sk.builtin.str(timeZoneName(e)),new Sk.builtin.str(timeZoneName(t))]:[new Sk.builtin.str(timeZoneName(t)),new Sk.builtin.str(timeZoneName(e))]}()),e.accept2dyear=Sk.builtin.assk$(1),e.clock=new Sk.builtin.func((function(){var t=0;return t=Sk.global.performance&&Sk.global.performance.now?performance.now()/1e3:(new Date).getTime()/1e3,new Sk.builtin.float_(t)})),e.strftime=new Sk.builtin.func((function strftime_f(t,e){var i;if(Sk.builtin.pyCheckArgsLen("strftime",arguments.length,1,2),!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("format must be a string");return e?e instanceof n||(e=new n(e)):e=from_seconds(),function check_struct_time(t){if(!(t instanceof n))throw new Sk.builtin.TypeError("Required argument \'struct_time\' must be of type: \'struct_time\'");var e,i=t.v.length,u=t.v;for(e=0;e(r=e.tp$getattr(new Sk.builtin.str("_strptime_time")),r.tp$call(t)))):r.tp$call(t)})),e};',"src/lib/token.js":'var $builtinmodule=function(n){var e={};e.__file__=new Sk.builtin.str("/src/lib/token.py");const t=[];for(let i in Sk.token.tok_name){const n=Sk.token.tok_name[i].slice(2),k=parseInt(i,10);t.push(Sk.ffi.remapToPy(k)),t.push(Sk.ffi.remapToPy(n)),e[n]=Sk.ffi.remapToPy(k)}return e.tok_name=new Sk.builtin.dict(t),e.ISTERMINAL=new Sk.builtin.func((function(n){return Sk.builtin.pyCheckArgsLen("ISTERMINAL",arguments.length,1,1),Sk.token.ISTERMINAL(Sk.ffi.remapToJs(n))})),e.ISNONTERMINAL=new Sk.builtin.func((function(n){return Sk.builtin.pyCheckArgsLen("ISNONTERMINAL",arguments.length,1,1),Sk.token.ISNONTERMINAL(Sk.ffi.remapToJs(n))})),e.ISEOF=new Sk.builtin.func((function(n){return Sk.builtin.pyCheckArgsLen("ISEOF",arguments.length,1,1),Sk.token.ISEOF(Sk.ffi.remapToJs(n))})),e};',"src/lib/tokenize.js":'var $builtinmodule=function(e){var i={};return i.tokenize=new Sk.builtin.func((function(e){Sk.builtin.pyCheckArgsLen("tokenize",1,1),Sk.builtin.checkFunction(e);const i=[];return Sk._tokenize("",(function jsReadline(){const i=Sk.misceval.callsimArray(e);return Sk.ffi.remapToJs(i)}),"UTF-8",(function receiveToken(e){i.push(new Sk.builtin.tuple([Sk.ffi.remapToPy(e.type),Sk.ffi.remapToPy(e.string),new Sk.builtin.tuple([Sk.ffi.remapToPy(e.start[0]),Sk.ffi.remapToPy(e.start[1])]),new Sk.builtin.tuple([Sk.ffi.remapToPy(e.end[0]),Sk.ffi.remapToPy(e.end[1])]),Sk.ffi.remapToPy(e.line)]))})),new Sk.builtin.list(i)})),i};',"src/lib/turtle.js":'var $builtinmodule=function(e){"use strict";var t=function getConfiguredTarget(){var e,t;for(t="string"==typeof(e=Sk.TurtleGraphics&&Sk.TurtleGraphics.target||"turtle")?document.getElementById(e):e;t.firstChild;)t.removeChild(t.firstChild);return t}();return t.turtleInstance?t.turtleInstance.reset():t.turtleInstance=function generateTurtleModule(e){var t,n,r,i,s,a,o,l,u={__name__:new Sk.builtin.str("turtle")},c=!0,h=1e3/30,d={},f={},_={target:"turtle",width:400,height:400,worldWidth:0,worldHeight:0,animate:!0,bufferSize:0,allowUndo:!0,assets:{}};function getAsset(e){var t=i.assets,n="function"==typeof t?t(e):t[e];return"string"==typeof n?new Promise((function(t,r){var s=new Image;s.onload=function(){i.assets[e]=this,t(s)},s.onerror=function(){r(new Error("Missing asset: "+n))},s.src=n})):new InstantPromise(void 0,n)}function InstantPromise(e,t){this.lastResult=t,this.lastError=e}function FrameManager(){this.reset()}function getFrameManager(){return o||(o=new FrameManager),o}function MouseHandler(){var e=this;for(var t in this._target=getTarget(),this._managers={},this._handlers={mousedown:function(t){e.onEvent("mousedown",t)},mouseup:function(t){e.onEvent("mouseup",t)},mousemove:function(t){e.onEvent("mousemove",t)}},this._handlers)this._target.addEventListener(t,this._handlers[t])}function EventManager(e,t){this._type=e,this._target=t,this._handlers=void 0,function getMouseHandler(){return a||(a=new MouseHandler),a}().addManager(e,this)}function Turtle(e){if(getFrameManager().addTurtle(this),this._screen=getScreen(),this._managers={},this._shape=e.v,!d.hasOwnProperty(this._shape))throw new Sk.builtin.ValueError("Shape:\'"+this._shape+"\' not in default shape, please check shape again!");this.reset()}function Screen(){var e,t;this._frames=1,this._delay=void 0,this._bgcolor="none",this._mode="standard",this._managers={},this._keyLogger={},e=(i.worldWidth||i.width||getWidth())/2,t=(i.worldHeight||i.height||getHeight())/2,this.setUpWorld(-e,-t,e,t)}function ensureAnonymous(){return s||(s=Sk.misceval.callsimArray(u.Turtle)),s.instance}function getTarget(){return e}function getScreen(){return r||(r=new Screen),r}function getWidth(){return 0|(r&&r._width||i.width||getTarget().clientWidth||_.width)}function getHeight(){return 0|(r&&r._height||i.height||getTarget().clientHeight||_.height)}function createLayer(e,t){var n,r=document.createElement("canvas"),i=getWidth(),s=getHeight(),a=getTarget().firstChild?-s+"px":"0";return r.width=i,r.height=s,r.style.position="relative",r.style.display="block",r.style.setProperty("margin-top",a),r.style.setProperty("z-index",e),t&&(r.style.display="none"),getTarget().appendChild(r),(n=r.getContext("2d")).lineCap="round",n.lineJoin="round",applyWorld(getScreen(),n),n}function cancelAnimationFrame(){t&&((window.cancelAnimationFrame||window.mozCancelAnimationFrame)(t),t=void 0),n&&(window.clearTimeout(n),n=void 0)}function applyWorld(e,t){var n=e.llx,r=(e.lly,e.urx,e.ury),i=e.xScale,s=e.yScale;t&&(clearLayer(t),t.restore(),t.save(),t.scale(1/i,1/s),t.translate(-n,-r))}function pushUndo(e){var t,n,r;if(i.allowUndo&&e._bufferSize){for(e._undoBuffer||(e._undoBuffer=[]);e._undoBuffer.length>e._bufferSize;)e._undoBuffer.shift();for(n={},t="x y angle radians color fill down filling shown shape size".split(" "),r=0;r=0;)this._turtles[e].reset();this._turtles=[],this._frames=[],this._frameCount=0,this._buffer=1,this._rate=0,this._animationFrame=animationFrame()},e.addFrame=function(e,t){return t&&(this._frameCount+=1),this.frames().push(e),!i.animate||this._buffer&&this._frameCount===this.frameBuffer()?this.update():new InstantPromise},e.frames=function(){return this._frames},e.frameBuffer=function(e){return"number"==typeof e&&(this._buffer=0|e,e&&e<=this._frameCount)?this.update():this._buffer},e.refreshInterval=function(e){return"number"==typeof e&&(this._rate=0|e,this._animationFrame=animationFrame(e)),this._rate},e.update=function(){return this._frames&&this._frames.length?this.requestAnimationFrame():new InstantPromise},e.requestAnimationFrame=function(){var e,t,n=this._frames,r=this._animationFrame,i=this._turtles,s=getScreen().spriteLayer();return this._frames=[],this._frameCount=0,new Promise((function(a){r((function paint(){for(t=0;t=0;)l[a].test(n,r,i,s)&&l[a].canMove("mousedown"===e);if(o&&o.length)for(computeCoordinates(),a=o.length;--a>=0;)("mousemove"===e&&o[a].canMove()&&o[a].test(n,r,i,s)||"mousedown"===e&&o[a].test(n,r,i,s))&&o[a].trigger([i,s])},l.reset=function(){this._managers={}},l.addManager=function(e,t){this._managers[e]||(this._managers[e]=[]),this._managers[e].push(t)},function(e){e.reset=function(){this._handlers=void 0},e.canMove=function(e){return!(!this._target||!this._target.hitTest)&&(void 0!==e&&(this._target.hitTest.hit=e),this._target.hitTest.hit)},e.test=function(e,t,n,r){return this._target&&this._target.hitTest?this._target.hitTest(e,t,n,r):!!this._target},e.trigger=function(e){var t,n=this._handlers;if(n&&n.length)for(t=0;t.5&&e<10.5?Sk.builtin.asnum$(Sk.builtin.round(Sk.builtin.assk$(e))):0,this._speed=e,this._computed_speed=2*e,this.addUpdate(void 0,!1,{speed:this._computed_speed})},e.$speed.minArgs=0,e.$speed.co_varnames=["speed"],e.$pencolor=function(e,t,n,r){return void 0!==e?(this._color=createColor(this._colorMode,e,t,n,r),this.addUpdate(void 0,this._shown,{color:this._color})):hexToRGB(this._color)},e.$pencolor.co_varnames=["r","g","b","a"],e.$pencolor.minArgs=0,e.$pencolor.returnType=f.COLOR,e.$fillcolor=function(e,t,n,r){return void 0!==e?(this._fill=createColor(this._colorMode,e,t,n,r),this.addUpdate(void 0,this._shown,{fill:this._fill})):hexToRGB(this._fill)},e.$fillcolor.co_varnames=["r","g","b","a"],e.$fillcolor.minArgs=0,e.$fillcolor.returnType=f.COLOR,e.$color=function(e,t,n,r){return void 0!==e?(void 0===t||void 0!==n?(this._color=createColor(this._colorMode,e,t,n,r),this._fill=this._color):(this._color=createColor(this._colorMode,e),this._fill=createColor(this._colorMode,t)),this.addUpdate(void 0,this._shown,{color:this._color,fill:this._fill})):[this.$pencolor(),this.$fillcolor()]},e.$color.minArgs=0,e.$color.co_varnames=["color","fill","b","a"],e.$color.returnType=function(e){return new Sk.builtin.tuple([f.COLOR(e[0]),f.COLOR(e[1])])},e.$fill=function(e){if(void 0!==e){if((e=!!e)===this._filling)return;return this._filling=e,e?(pushUndo(this),this.addUpdate(void 0,!1,{filling:!0,fillBuffer:[{x:this._x,y:this._y}]})):(pushUndo(this),this.addUpdate((function(){this.fillBuffer.push(this),drawFill.call(this)}),!0,{filling:!1,fillBuffer:void 0}))}return this._filling},e.$fill.co_varnames=["flag"],e.$fill.minArgs=0,e.$begin_fill=function(){return this.$fill(!0)},e.$end_fill=function(){return this.$fill(!1)},e.$stamp=function(){return pushUndo(this),this.addUpdate((function(){drawTurtle(this,this.context())}),!0)},e.$dot=function(e,t,n,r,i){return pushUndo(this),e="number"==typeof(e=Sk.builtin.asnum$(e))?Math.max(1,0|Math.abs(e)):Math.max(this._size+4,2*this._size),t=void 0!==t?createColor(this._colorMode,t,n,r,i):this._color,this.addUpdate(drawDot,!0,void 0,e,t)},e.$dot.co_varnames=["size","color","g","b","a"],e.$write=function(e,t,n,r){var i,s,a,o,l,u=this;return pushUndo(this),e=String(e),r&&r.constructor===Array&&(s="string"==typeof r[0]?r[0]:"Arial",a=String(r[1]||"12pt"),o="string"==typeof r[2]?r[2]:"normal",/^\\d+$/.test(a)&&(a+="pt"),r=[o,a,s].join(" ")),n||(n="left"),i=this.addUpdate(drawText,!0,void 0,e,n,r),!t||"left"!==n&&"center"!==n||(l=function measureText(e,t){return t&&(p.font=t),p.measureText(e).width}(e,r),"center"===n&&(l/=2),i=i.then((function(){var e=u.getState();return u.translate(e.x,e.y,l,0,!0)}))),i},e.$write.co_varnames=["message","move","align","font"],e.$write.minArgs=1,e.$pensize=e.$width=function(e){return void 0!==e?(this._size=e,this.addUpdate(void 0,this._shown,{size:e})):this._size},e.$pensize.minArgs=e.$width.minArgs=0,e.$pensize.co_varnames=e.$width.co_varnames=["width"],e.$showturtle=e.$st=function(){return this._shown=!0,this.addUpdate(void 0,!0,{shown:!0})},e.$hideturtle=e.$ht=function(){return this._shown=!1,this.addUpdate(void 0,!0,{shown:!1})},e.$isvisible=function(){return this._shown},e.$shape=function(e){return e&&d[e]?(this._shape=e,this.addUpdate(void 0,this._shown,{shape:e})):this._shape},e.$shape.minArgs=0,e.$shape.co_varnames=["name"],e.$window_width=function(){return this._screen.$window_width()},e.$window_height=function(){return this._screen.$window_height()},e.$tracer=function(e,t){return this._screen.$tracer(e,t)},e.$tracer.minArgs=0,e.$tracer.co_varnames=["n","delay"],e.$update=function(){return this._screen.$update()},e.$delay=function(e){return this._screen.$delay(e)},e.$delay.minArgs=0,e.$delay.co_varnames=["delay"],e.$reset=function(){return this.reset(),this.$clear()},e.$mainloop=e.$done=function(){return this._screen.$mainloop()},e.$clear=function(){return this.addUpdate((function(){clearLayer(this.context())}),!0)},e.$dot.minArgs=0,e.$onclick=function(e,t,n){this.getManager("mousedown").addHandler(e,n)},e.$onclick.minArgs=1,e.$onclick.co_varnames=["method","btn","add"],e.$onrelease=function(e,t,n){this.getManager("mouseup").addHandler(e,n)},e.$onrelease.minArgs=1,e.$onrelease.co_varnames=["method","btn","add"],e.$ondrag=function(e,t,n){this.getManager("mousemove").addHandler(e,n)},e.$ondrag.minArgs=1,e.$ondrag.co_varnames=["method","btn","add"],e.$getscreen=function(){return Sk.misceval.callsimArray(u.Screen)},e.$getscreen.isSk=!0,e.$clone=function(){var e=Sk.misceval.callsimOrSuspendArray(u.Turtle);return e.instance._x=this._x,e.instance._y=this._y,e.instance._angle=this._angle,e.instance._radians=this._radians,e.instance._shape=this._shape,e.instance._color=this._color,e.instance._fill=this._fill,e.instance._filling=this._filling,e.instance._size=this._size,e.instance._computed_speed=this._computed_speed,e.instance._down=this._down,e.instance._shown=this._shown,e.instance._colorMode=this._colorMode,e.instance._isRadians=this._isRadians,e.instance._fullCircle=this._fullCircle,e.instance._bufferSize=this._bufferSize,e.instance._undoBuffer=this._undoBuffer,e._clonedFrom=this,e},e.$clone.returnType=function(e){return e},e.$getturtle=e.$getpen=function(){return this.skInstance},e.$getturtle.isSk=!0}(Turtle.prototype),function(e){e.spriteLayer=function(){return this._sprites||(this._sprites=createLayer(3))},e.bgLayer=function(){return this._background||(this._background=createLayer(1))},e.hitTestLayer=function(){return this._hitTest||(this._hitTest=createLayer(0,!0))},e.getManager=function(e){return this._managers[e]||(this._managers[e]=new EventManager(e,this)),this._managers[e]},e.reset=function(){var e;for(e in this._keyListeners=void 0,this._keyLogger)window.clearInterval(this._keyLogger[e]),window.clearTimeout(this._keyLogger[e]),delete this._keyLogger[e];for(e in this._keyDownListener&&(getTarget().removeEventListener("keydown",this._keyDownListener),this._keyDownListener=void 0),this._keyUpListener&&(getTarget().removeEventListener("keyup",this._keyUpListener),this._keyUpListener=void 0),this._timer&&(window.clearTimeout(this._timer),this._timer=void 0),this._managers)this._managers[e].reset();this._mode="standard",removeLayer(this._sprites),this._sprites=void 0,removeLayer(this._background),this._background=void 0},e.setUpWorld=function(e,t,n,r){var i=this;i.llx=e,i.lly=t,i.urx=n,i.ury=r,i.xScale=(n-e)/getWidth(),i.yScale=-1*(r-t)/getHeight(),i.lineScale=Math.min(Math.abs(i.xScale),Math.abs(i.yScale))},e.$setup=function(e,t,n,r){return isNaN(parseFloat(e))&&(e=getWidth()),isNaN(parseFloat(t))&&(t=getHeight()),e<=1&&(e=getWidth()*e),t<=1&&(t=getHeight()*t),this._width=e,this._height=t,this._xOffset=void 0===n||isNaN(parseInt(n))?0:parseInt(n),this._yOffset=void 0===r||isNaN(parseInt(r))?0:parseInt(r),"world"===this._mode?this._setworldcoordinates(this.llx,this.lly,this.urx,this.ury):this._setworldcoordinates(-e/2,-t/2,e/2,t/2)},e.$setup.minArgs=0,e.$setup.co_varnames=["width","height","startx","starty"],e.$register_shape=e.$addshape=function(e,t){if(!t)return getAsset(e).then((function(t){d[e]=t}));d[e]=t},e.$register_shape.minArgs=1,e.$register_shape.co_varnames=["name","shape"],e.$getshapes=function(){return Object.keys(d)},e.$tracer=function(e,t){return void 0!==e||void 0!==t?("number"==typeof t&&(this._delay=t,getFrameManager().refreshInterval(t)),"number"==typeof e?(this._frames=e,getFrameManager().frameBuffer(e)):void 0):this._frames},e.$tracer.co_varnames=["frames","delay"],e.$tracer.minArgs=0,e.$delay=function(e){return void 0!==e?this.$tracer(void 0,e):void 0===this._delay?h:this._delay},e.$delay.co_varnames=["delay"],e._setworldcoordinates=function(e,t,n,r){return getFrameManager().turtles(),this.setUpWorld(e,t,n,r),this._sprites&&applyWorld(this,this._sprites),this._background&&applyWorld(this,this._background),this.$clear()},e.$setworldcoordinates=function(e,t,n,r){return this._mode="world",this._setworldcoordinates(e,t,n,r)},e.$setworldcoordinates.co_varnames=["llx","lly","urx","ury"],e.minArgs=4,e.$clear=e.$clearscreen=function(){return this.reset(),this.$reset()},e.$update=function(){return getFrameManager().update()},e.$reset=e.$resetscreen=function(){var e=this,t=getFrameManager().turtles();return getFrameManager().addFrame((function(){applyWorld(e,e._sprites),applyWorld(e,e._background);for(var n=0;n1&&t[s]&&t[s].test(r),r===a||i){e._keyListeners[r](),e._createKeyRepeater(r,s),n.preventDefault();break}}},getTarget().addEventListener("keydown",this._keyDownListener))},e._createKeyUpListener=function(){var e=this;this._keyUpListener||(this._keyUpListener=function(t){var n=e._keyLogger[t.charCode||t.keyCode];void 0!==n&&(t.preventDefault(),window.clearInterval(n),window.clearTimeout(n),delete e._keyLogger[t.charCode||t.keyCode])},getTarget().addEventListener("keyup",this._keyUpListener))},e.$title=function(e){document.title=e},e.$title.minArgs=1,e.$title.co_varnames=["title"],e.$listen=function(){this._createKeyUpListener(),this._createKeyDownListener()},e.$onkey=function(e,t){if("function"==typeof t){var n=e;e=t,t=n}t=String(t).toLowerCase(),e&&"function"==typeof e?(this._keyListeners||(this._keyListeners={}),this._keyListeners[t]=e):delete this._keyListeners[t]},e.$onkey.minArgs=2,e.$onkey.co_varnames=["method","keyValue"],e.$onscreenclick=function(e,t,n){this.getManager("mousedown").addHandler(e,n)},e.$onscreenclick.minArgs=1,e.$onscreenclick.co_varnames=["method","btn","add"],e.$ontimer=function(e,t){this._timer&&(window.clearTimeout(this._timer),this._timer=void 0),e&&"number"==typeof t&&(this._timer=window.setTimeout(e,Math.max(0,0|t)))},e.$ontimer.minArgs=0,e.$ontimer.co_varnames=["method","interval"]}(Screen.prototype);var g=new Image;function removeLayer(e){e&&e.canvas&&e.canvas.parentNode&&e.canvas.parentNode.removeChild(e.canvas)}function clearLayer(e,t,n){e&&(e.save(),e.setTransform(1,0,0,1,0,0),t?(e.fillStyle=t,e.fillRect(0,0,e.canvas.width,e.canvas.height)):e.clearRect(0,0,e.canvas.width,e.canvas.height),n&&e.drawImage(n,0,0),e.restore())}function drawTurtle(e,t){var n,r,i,s=d[e.shape],a=getScreen(),o=(getWidth(),getHeight(),a.xScale),l=a.yScale;if(t){if(n=Math.cos(e.radians)/o,r=Math.sin(e.radians)/l,i=Math.atan2(r,n)-Math.PI/2,t.save(),t.translate(e.x,e.y),t.scale(o,l),s.nodeName){var u=s.naturalWidth,c=s.naturalHeight;t.drawImage(s,0,0,u,c,-u/2,-c/2,u,c)}else{t.rotate(i),t.beginPath(),t.lineWidth=1,t.strokeStyle=e.color,t.fillStyle=e.fill,t.moveTo(-s[0][0],s[0][1]);for(var h=1;ho)throw u=l===o?"exactly "+o:"between "+l+" and "+o,new Sk.builtin.TypeError(a+"() takes "+u+" positional argument(s) ("+d.length+" given)");for(e=d.length;--e>=0;)void 0!==d[e]&&(d[e]instanceof Sk.builtin.func?d[e]=pythonToJavascriptFunction(d[e]):d[e]instanceof Sk.builtin.method?d[e]=pythonToJavascriptFunction(d[e].im_func,d[e].im_self):d[e]&&d[e].$d instanceof Sk.builtin.dict&&d[e].instance?d[e]=d[e].instance:d[e]=Sk.ffi.remapToJs(d[e]));var _=d.slice(0);for(d=[],e=_.length;e>=0;--e)null!==_[e]&&(d[e]=_[e]);try{t=f[n].apply(f,d)}catch(g){throw window&&window.console&&(window.console.log("wrapped method failed"),window.console.log(g.stack)),g}return t instanceof InstantPromise&&(t=t.lastResult),t instanceof Promise?(t=t.catch((function(e){throw window&&window.console&&(window.console.log("promise failed"),window.console.log(e.stack)),e})),(i=new Sk.misceval.Suspension).resume=function(){return void 0===s?Sk.builtin.none.none$:Sk.ffi.remapToPy(s)},i.data={type:"Sk.promise",promise:t.then((function(e){return s=e,e}))},i):void 0===t?Sk.builtin.none.none$:h?t:"function"==typeof c?c(t):Sk.ffi.remapToPy(t)},i.co_name=new Sk.builtin.str(a),i.co_varnames=u.slice(),i.$defaults=[];for(var d=l;d")})),e.__iter__=new Sk.builtin.func((function(n){var e=n.lineList;return Sk.builtin.makeGenerator((function(){if(!(this.$index>=this.$lines.length))return new Sk.builtin.str(this.$lines[this.$index++])}),{$obj:n,$index:0,$lines:e})})),e.read=new Sk.builtin.func((function(n,e){if(n.closed)throw new Sk.builtin.ValueError("I/O operation on closed file");var i=n.data$.length;void 0===e&&(e=i);var t=new Sk.builtin.str(n.data$.substr(n.pos$,e));return n.pos$+=e,n.pos$>=i&&(n.pos$=i),t})),e.readline=new Sk.builtin.func((function(n,e){var i="";return n.currentLinee===o)).length)throw new i("one of the hex, bytes, bytes_le, fields, or int arguments must be given");if(u!==o){u=u.toString().replace("urn:","").replace("uuid:","");let e=0,i=u.length-1;for(;"{}".indexOf(u[e])>=0;)e++;for(;"{}".indexOf(u[i])>=0;)i--;if(u=u.slice(e,i+1),u=u.replace(S,""),32!==u.length)throw new s("badly formed hexadecimal UUID string");f=d(n,[new t(u),U])}if(c!==o){if(!(c instanceof e))throw new i("bytes_le should be a bytes instance");if(c=c.valueOf(),16!==c.length)throw new s("bytes_le is not a 16-char string");h=switchBytesBytesLe(c),h=new e(h)}if(h!==o){if(!(h instanceof e))throw new i("bytes_le should be a bytes instance");if(16!==h.valueOf().length)throw new s("bytes is not a 16-char string");f=d(w,[h],["byteorder",v])}if(p!==o)throw new r("fields argument is not yet supported");if(f!==o&&(g(f,_,"Lt")||((e,t)=>g(e,t,"GtE"))(f,y)))throw new s("int is out of range (need a 128-bit value)");this.$int=f,this.$isSafe=I},tp$str(){const e=E.nb$remainder(this.$int).toString();return new t(`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20)}`)},$r(){const e=u(this.ob$type,t.$name),n=c(this.tp$str());return new t(`${e}(${n})`)},tp$hash(){return this.$int.tp$hash()},tp$richcompare(e,t){return e instanceof R?this.$int.tp$richcompare(e.$int,t):l},tp$as_number:!0,nb$int(){return this.$int}},getsets:{int:{$get(){return this.$int}},is_safe:{$get(){return this.$isSafe}},bytes:{$get(){return d(b,[this.$int,U,v])}},bytes_le:{$get(){const n=this.tp$getattr(new t("bytes")).valueOf();return new e(switchBytesBytesLe(n))}},fields:{$get:()=>notImplemented()},time_low:{$get:()=>notImplemented()},time_mid:{$get:()=>notImplemented()},time_hi_version:{$get:()=>notImplemented()},clock_seq_hi_variant:{$get:()=>notImplemented()},clock_seq_low:{$get:()=>notImplemented()},time:{$get:()=>notImplemented()},clock_seq:{$get:()=>notImplemented()},node:{$get:()=>notImplemented()},hex:{$get(){return E.nb$remainder(this.$int)}},urn:{$get(){return new t(`urn:uuid:${this}`)}},variant:{$get:()=>notImplemented()},version:{$get:()=>notImplemented()}}});return h("uuid",p,{uuid1:{$meth(){notImplemented()},$flags:{FastCall:!0}},uuid2:{$meth(){notImplemented()},$flags:{FastCall:!0}},uuid3:{$meth(){notImplemented()},$flags:{FastCall:!0}},uuid4:{$meth(){const t=new e(f.getRandomValues(new Uint8Array(16)));return d(R,[],["bytes",t,"version",I])},$flags:{NoArgs:!0}},uuid5:{$meth(){notImplemented()},$flags:{FastCall:!0}}}),p}',"src/lib/webbrowser.js":'var $builtinmodule=function(n){var e={},t="undefined"!=typeof window&&"undefined"!=typeof window.navigator;function open_tab(n){return Sk.builtin.pyCheckType("url","string",Sk.builtin.checkString(n)),t?(n=n.$jsstr(),window.open(n,"_blank"),Sk.builtin.bool.true$):Sk.builtin.bool.false$}return e.__name__=new Sk.builtin.str("webbrowser"),e.open=new Sk.builtin.func((function open(n){return Sk.builtin.pyCheckArgsLen("open",arguments.length+1,1,3),open_tab(n)})),e.open_new=new Sk.builtin.func((function open_new(n){return Sk.builtin.pyCheckArgsLen("open_new",arguments.length,1,1),open_tab(n)})),e.open_new_tab=new Sk.builtin.func((function open_new_tab(n){return Sk.builtin.pyCheckArgsLen("open_new_tab",arguments.length,1,1),open_tab(n)})),e.DefaultBrowser=Sk.misceval.buildClass(e,(function dflbrowser(n,e){e.__init__=new Sk.builtin.func((function __init__(n){return Sk.builtin.none.none$})),e.open=new Sk.builtin.func((function open(n,e){return Sk.builtin.pyCheckArgsLen("open",arguments.length,2,4),open_tab(e)})),e.open_new=new Sk.builtin.func((function open_new(n,e){return Sk.builtin.pyCheckArgsLen("open_new",arguments.length,2,2),open_tab(e)})),e.open_new_tab=new Sk.builtin.func((function open_new_tab(n,e){return Sk.builtin.pyCheckArgsLen("open_new_tab",arguments.length,2,2),open_tab(e)}))}),"DefaultBrowser",[]),e.get=new Sk.builtin.func((function get(){return Sk.builtin.pyCheckArgsLen("get",arguments.length,0,1),Sk.misceval.callsimArray(e.DefaultBrowser,[])})),e};',"src/lib/webgl/math.js":'var $builtinmodule=function(e){var n={};return n.Mat44=Sk.misceval.buildClass(n,(function(e,t){t.__init__=new Sk.builtin.func((function(e){Sk.misceval.callsimArray(t.loadIdentity,[e]),e.stack=[]})),t.push=new Sk.builtin.func((function(e){e.stack.push(e.elements.slice(0))})),t.pop=new Sk.builtin.func((function(e){e.elements=e.stack.pop()})),t.loadIdentity=new Sk.builtin.func((function(e){e.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]})),t.transform3=new Sk.builtin.func((function(e,t){var l=e.elements;return Sk.misceval.callsimArray(n.Vec3,[l[0]*t.x+l[4]*t.y+l[8]*t.z,l[1]*t.x+l[5]*t.y+l[9]*t.z,l[2]*t.x+l[6]*t.y+l[10]*t.z])})),t.scale=new Sk.builtin.func((function(e,n,t,l){return e.elements[0]*=n,e.elements[1]*=n,e.elements[2]*=n,e.elements[3]*=n,e.elements[4]*=t,e.elements[5]*=t,e.elements[6]*=t,e.elements[7]*=t,e.elements[8]*=l,e.elements[9]*=l,e.elements[10]*=l,e.elements[11]*=l,e})),t.translate=new Sk.builtin.func((function(e,n,t,l){return e.elements[12]+=e.elements[0]*n+e.elements[4]*t+e.elements[8]*l,e.elements[13]+=e.elements[1]*n+e.elements[5]*t+e.elements[9]*l,e.elements[14]+=e.elements[2]*n+e.elements[6]*t+e.elements[10]*l,e.elements[15]+=e.elements[3]*n+e.elements[7]*t+e.elements[11]*l,e})),t.rotate=new Sk.builtin.func((function(e,t,l,s,m){var i,a,c,u,r,f,o,k,S,y,b,v=Math.sqrt(l*l+s*s+m*m),_=Math.sin(t*Math.PI/180),w=Math.cos(t*Math.PI/180);v>0&&(i=(l/=v)*l,a=(s/=v)*s,c=(m/=v)*m,u=l*s,r=s*m,f=m*l,o=l*_,k=s*_,S=m*_,y=1-w,(b=Sk.misceval.callsimArray(n.Mat44)).elements[0]=y*i+w,b.elements[1]=y*u-S,b.elements[2]=y*f+k,b.elements[3]=0,b.elements[4]=y*u+S,b.elements[5]=y*a+w,b.elements[6]=y*r-o,b.elements[7]=0,b.elements[8]=y*f-k,b.elements[9]=y*r+o,b.elements[10]=y*c+w,b.elements[11]=0,b.elements[12]=0,b.elements[13]=0,b.elements[14]=0,b.elements[15]=1,b=b.multiply(e),e.elements=b.elements);return e})),t.multiply=new Sk.builtin.func((function(e,t){for(var l=Sk.misceval.callsimArray(n.Mat44),s=0;s<4;s++)l.elements[4*s+0]=e.elements[4*s+0]*t.elements[0]+e.elements[4*s+1]*t.elements[4]+e.elements[4*s+2]*t.elements[8]+e.elements[4*s+3]*t.elements[12],l.elements[4*s+1]=e.elements[4*s+0]*t.elements[1]+e.elements[4*s+1]*t.elements[5]+e.elements[4*s+2]*t.elements[9]+e.elements[4*s+3]*t.elements[13],l.elements[4*s+2]=e.elements[4*s+0]*t.elements[2]+e.elements[4*s+1]*t.elements[6]+e.elements[4*s+2]*t.elements[10]+e.elements[4*s+3]*t.elements[14],l.elements[4*s+3]=e.elements[4*s+0]*t.elements[3]+e.elements[4*s+1]*t.elements[7]+e.elements[4*s+2]*t.elements[11]+e.elements[4*s+3]*t.elements[15];return e.elements=l.elements,e})),t.lookAt=new Sk.builtin.func((function(e,t,l,s,m,i,a,c,u,r){var f=[t-m,l-i,s-a],o=Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]);o&&(f[0]/=o,f[1]/=o,f[2]/=o);var k=[c,u,r],S=[];S[0]=k[1]*f[2]-k[2]*f[1],S[1]=-k[0]*f[2]+k[2]*f[0],S[2]=k[0]*f[1]-k[1]*f[0],k[0]=f[1]*S[2]-f[2]*S[1],k[1]=-f[0]*S[2]+f[2]*S[0],k[2]=f[0]*S[1]-f[1]*S[0],(o=Math.sqrt(S[0]*S[0]+S[1]*S[1]+S[2]*S[2]))&&(S[0]/=o,S[1]/=o,S[2]/=o),(o=Math.sqrt(k[0]*k[0]+k[1]*k[1]+k[2]*k[2]))&&(k[0]/=o,k[1]/=o,k[2]/=o);var y=Sk.misceval.callsimArray(n.Mat44);return y.elements[0]=S[0],y.elements[4]=S[1],y.elements[8]=S[2],y.elements[12]=0,y.elements[1]=k[0],y.elements[5]=k[1],y.elements[9]=k[2],y.elements[13]=0,y.elements[2]=f[0],y.elements[6]=f[1],y.elements[10]=f[2],y.elements[14]=0,y.elements[3]=0,y.elements[7]=0,y.elements[11]=0,y.elements[15]=1,y=y.multiply(e),e.elements=y.elements,e.translate(-t,-l,-s),e}))}),"Mat44",[]),n.Mat33=Sk.misceval.buildClass(n,(function(e,n){n.__init__=new Sk.builtin.func((function(e){Sk.misceval.callsimArray(n.loadIdentity,[e])})),n.loadIdentity=new Sk.builtin.func((function(e){e.elements=[1,0,0,0,1,0,0,0,1]}))}),"Mat33",[]),n.Vec3=Sk.misceval.buildClass(n,(function(e,t){t.__init__=new Sk.builtin.func((function(e,n,t,l){e.x=n,e.y=t,e.z=l})),t.__sub__=new Sk.builtin.func((function(e,t){return Sk.misceval.callsimArray(n.Vec3,[e.x-t.x,e.y-t.y,e.z-t.z])}))}),"Vec3",[]),n.cross=new Sk.builtin.func((function(e,t){return Sk.asserts.assert(e instanceof n.Vec3&&t instanceof n.Vec3),Sk.misceval.callsimArray(n.Vec3,[e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z,e.x*t.y-e.y*t.x])})),n};',"src/lib/webgl/matrix4.js":"var $builtinmodule=function(n){var r={},t=new Float32Array(3),a=new Float32Array(3),u=new Float32Array(3),e=(new Float32Array(4),new Float32Array(4),new Float32Array(4),new Float32Array(16),new Float32Array(16),new Float32Array(16),function(n,r){for(var t=0,a=r.length,u=0;u1e-5)for(u=0;u{const n=e.$d;var r={},Buffer=function(t,e){var r=e||n.ARRAY_BUFFER,i=n.createBuffer();if(this.target=r,this.buf=i,this.set(t),this.numComponents_=t.numComponents,this.numElements_=t.numElements,this.totalComponents_=this.numComponents_*this.numElements_,t.buffer instanceof Float32Array)this.type_=n.FLOAT;else if(t.buffer instanceof Uint8Array)this.type_=n.UNSIGNED_BYTE;else if(t.buffer instanceof Int8Array)this.type_=n._BYTE;else if(t.buffer instanceof Uint16Array)this.type_=n.UNSIGNED_SHORT;else{if(!(t.buffer instanceof Int16Array))throw"unhandled type:"+typeof t.buffer;this.type_=n.SHORT}};return Buffer.prototype.set=function(t){n.bindBuffer(this.target,this.buf),n.bufferData(this.target,t.buffer,n.STATIC_DRAW)},Buffer.prototype.type=function(){return this.type_},Buffer.prototype.numComponents=function(){return this.numComponents_},Buffer.prototype.numElements=function(){return this.numElements_},Buffer.prototype.totalComponents=function(){return this.totalComponents_},Buffer.prototype.buffer=function(){return this.buf},Buffer.prototype.stride=function(){return 0},Buffer.prototype.offset=function(){return 0},r.Model=Sk.misceval.buildClass(r,(function(e,r){r.__init__=new Sk.builtin.func((function(e,r,i,f){e.buffers={};var setBuffer=function(t,r){var i="indices"==t?n.ELEMENT_ARRAY_BUFFER:n.ARRAY_BUFFER;let f=e.buffers[t];f?f.set(r):f=new Buffer(r,i),e.buffers[t]=f};for(t in i)setBuffer(t,i[t]);var o={},s=0;for(var u in f)o[u]=s++;e.mode=n.TRIANGLES,e.textures=f.v,e.textureUnits=o,e.shader=r})),r.drawPrep=new Sk.builtin.func((function(t,e){var r=t.shader,i=t.buffers,f=t.textures;for(var o in e=Sk.ffi.remapToJs(e),Sk.misceval.callsimArray(r.use,[r]),i){var s=i[o];if("indices"==o)n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,s.buffer());else{var u=r.attrib[o];u&&u(s)}}for(var a in f){var m=t.textureUnits[a];r.setUniform$impl(r,f,m),f[a].bindToUnit(m)}for(var p in e)r.setUniform$impl(r,p,e[p])})),r.draw=new Sk.builtin.func((function(t,e,r){var i=t.shader;e=Sk.ffi.remapToJs(e);for(let n in e)i.setUniform$impl(i,n,e[n]);if(r)for(var f in r){var o=t.textureUnits[f];i.setUniform$impl(i,f,o),r[f].bindToUnit(o)}var s=t.buffers;n.drawElements(t.mode,s.indices.totalComponents(),n.UNSIGNED_SHORT,0)}))}),"Model",[]),r}))};',"src/lib/webgl/primitives.js":'var $builtinmodule=function(t){var n={},AttribBuffer=function(t,n,e){e=e||"Float32Array";var r=window[e];n.length?(this.buffer=new r(n),n=this.buffer.length/t,this.cursor=n):(this.buffer=new r(t*n),this.cursor=0),this.numComponents=t,this.numElements=n,this.type=e};return AttribBuffer.prototype.stride=function(){return 0},AttribBuffer.prototype.offset=function(){return 0},AttribBuffer.prototype.getElement=function(t){for(var n=t*this.numComponents,e=[],r=0;r
\'+n+"
"},e=\'This page requires a browser that supports WebGL.
Click here to upgrade your browser.\';return t.Context=Sk.misceval.buildClass(t,(function(n,t){t.__init__=new Sk.builtin.func((function(n,t){var i=document.getElementById(t.v),r=function(n,t){var i=document.getElementById(n);if(t||(t=i.getElementsByTagName("canvas")[0]),t){var r=function(n){for(var t=["webgl","experimental-webgl","webkit-3d","moz-webgl"],e=null,i=0;i7||7==a.Chrome[0]&&a.Chrome[1]>0||7==a.Chrome[0]&&0==a.Chrome[1]&&a.Chrome[2]>=521)?i.innerHTML=makeFailHTML(\'It doesn\\\'t appear your computer can support WebGL.
Click here for more information.\'):i.innerHTML=makeFailHTML(e)}return r}i.innerHTML=makeFailHTML(e)}(t.v,i);if(!r)throw new Error("Your browser does not appear to support WebGL.");for(var u in n.gl=r,r.__proto__)if("number"==typeof r.__proto__[u])Sk.abstr.objectSetItem(n.$d,new Sk.builtin.str(u),r.__proto__[u]);else if("function"==typeof r.__proto__[u])switch(u){case"bufferData":case"clearColor":case"drawArrays":case"getAttribLocation":case"getUniformLocation":case"shaderSource":case"uniformMatrix4fv":case"vertexAttribPointer":case"viewport":break;default:!function(t){Sk.abstr.objectSetItem(n.$d,new Sk.builtin.str(u),new Sk.builtin.func((function(){return r.__proto__[t].apply(r,arguments)})))}(u)}r.clearColor(100/255,149/255,237/255,1),r.clear(r.COLOR_BUFFER_BIT)})),t.tp$getattr=Sk.generic.getAttr,t.bufferData=new Sk.builtin.func((function(n,t,e,i){n.gl.bufferData(t,e.v,i)})),t.clearColor=new Sk.builtin.func((function(n,t,e,i,r){n.gl.clearColor(Sk.builtin.asnum$(t),Sk.builtin.asnum$(e),Sk.builtin.asnum$(i),Sk.builtin.asnum$(r))})),t.getAttribLocation=new Sk.builtin.func((function(n,t,e){return n.gl.getAttribLocation(t,e.v)})),t.getUniformLocation=new Sk.builtin.func((function(n,t,e){return n.gl.getUniformLocation(t,e.v)})),t.shaderSource=new Sk.builtin.func((function(n,t,e){n.gl.shaderSource(t,e.v)})),t.drawArrays=new Sk.builtin.func((function(n,t,e,i){n.gl.drawArrays(Sk.builtin.asnum$(t),Sk.builtin.asnum$(e),Sk.builtin.asnum$(i))})),t.vertexAttribPointer=new Sk.builtin.func((function(n,t,e,i,r,u,a){n.gl.vertexAttribPointer(t,Sk.builtin.asnum$(e),Sk.builtin.asnum$(i),r,Sk.builtin.asnum$(u),Sk.builtin.asnum$(a))})),t.viewport=new Sk.builtin.func((function(n,t,e,i,r){n.gl.viewport(Sk.builtin.asnum$(t),Sk.builtin.asnum$(e),Sk.builtin.asnum$(i),Sk.builtin.asnum$(r))})),t.uniformMatrix4fv=new Sk.builtin.func((function(n,t,e,i){n.gl.uniformMatrix4fv(Sk.builtin.asnum$(t),e,i.v)})),t.setDrawFunc=new Sk.builtin.func((function(n,t){var e=(new Date).getTime();setInterval((function(){Sk.misceval.callsimArray(t,[n,(new Date).getTime()-e])}),1e3/60)}))}),"Context",[]),t.Float32Array=Sk.misceval.buildClass(t,(function(n,t){t.__init__=new Sk.builtin.func((function(n,t){n.v="number"==typeof t?new Float32Array(t):new Float32Array(Sk.ffi.remapToJs(t))})),t.__repr__=new Sk.builtin.func((function(n){for(var t=[],e=0;e(z=e.$d,O)),(e=>{O=e.$d}));return S(L,(()=>{function _strftime(e){return t=>e.$strftime(t).toString().toLowerCase()}function _strftime_timetuple(e,t){return O.strftime.tp$call([new i(e),t]).toString().toLowerCase()}const l=new i("fromordinal");function _struct_time(t){return O.struct_time.tp$call([new s(t.map((t=>new e(t))))])}function _localized_month(){const e=[()=>""];for(let t=0;t<12;t++){const i=new k(2001,t+1,1);e.push(_strftime(i))}return e}function _localized_day(){const e=[];for(let t=0;t<7;t++){const i=new k(2001,1,t+1);e.push(_strftime(i))}return e}const S={__name__:new i("_strptime")},k=z.date,L=z.timedelta,E=z.timezone;function _getlang(){return[t,t]}class LocaleTime{constructor(){this.lang=_getlang(),this.__calc_weekday(),this.__calc_month(),this.__calc_am_pm(),this.__calc_timezone(),this.__calc_date_time()}__calc_weekday(){this.a_weekday=_localized_day().map((e=>e("%a"))),this.f_weekday=_localized_day().map((e=>e("%A")))}__calc_month(){this.a_month=_localized_month().map((e=>e("%b"))),this.f_month=_localized_month().map((e=>e("%B")))}__calc_am_pm(){const e=[];[1,22].forEach((t=>{const i=_strftime_timetuple("%p",_struct_time([1999,3,17,t,44,55,2,76,0]));e.push(i)})),this.am_pm=e}__calc_date_time(){const e=_struct_time([1999,3,17,22,44,55,2,76,0]),i=[t,t,t];i[0]=_strftime_timetuple("%c",e),i[1]=_strftime_timetuple("%x",e),i[2]=_strftime_timetuple("%X",e);const s=[["%","%%"],[this.f_weekday[2],"%A"],[this.f_month[3],"%B"],[this.a_weekday[2],"%a"],[this.a_month[3],"%b"],[this.am_pm[1],"%p"],["1999","%Y"],["99","%y"],["22","%H"],["44","%M"],["55","%S"],["76","%j"],["17","%d"],["03","%m"],["3","%m"],["2","%w"],["10","%I"]];s.push(...this.timezone.flat().map((e=>[e,"%Z"]))),[[0,"%c"],[1,"%x"],[2,"%X"]].forEach((([e,t])=>{let n=i[e];s.forEach((([e,t])=>{e&&(n=n.replace(e,t))}));let a;a=_strftime_timetuple(t,_struct_time([1999,1,3,1,1,1,6,3,0])).includes("00")?"%W":"%U",i[e]=n.replace("11",a)})),this.LC_date_time=i[0],this.LC_date=i[1],this.LC_time=i[2]}__calc_timezone(){try{O.tzset.tp$call([])}catch{}this.tzname=O.tzname.v.map((e=>e.toString())),this.daylight=w(O.daylight);const e=[this.tzname[0].toLowerCase(),"utc","gmt"];let t;t=this.daylight?[this.tzname[1].toLowerCase()]:[],this.timezone=[e,t]}}class TimeRE{constructor(e=null){this.locale_time=e||new LocaleTime,Object.assign(this,{d:"(?3[0-1]|[1-2]\\\\d|0[1-9]|[1-9]| [1-9])",f:"(?[0-9]{1,6})",H:"(?2[0-3]|[0-1]\\\\d|\\\\d)",I:"(?1[0-2]|0[1-9]|[1-9])",G:"(?\\\\d\\\\d\\\\d\\\\d)",j:"(?36[0-6]|3[0-5]\\\\d|[1-2]\\\\d\\\\d|0[1-9]\\\\d|00[1-9]|[1-9]\\\\d|0[1-9]|[1-9])",m:"(?1[0-2]|0[1-9]|[1-9])",M:"(?[0-5]\\\\d|\\\\d)",S:"(?6[0-1]|[0-5]\\\\d|\\\\d)",U:"(?5[0-3]|[0-4]\\\\d|\\\\d)",w:"(?[0-6])",u:"(?[1-7])",V:"(?5[0-3]|0[1-9]|[1-4]\\\\d|\\\\d)",y:"(?\\\\d\\\\d)",Y:"(?\\\\d\\\\d\\\\d\\\\d)",z:"(?[+-]\\\\d\\\\d:?[0-5]\\\\d(:?[0-5]\\\\d(\\\\.\\\\d{1,6})?)?|Z)",A:this.__seqToRE(this.locale_time.f_weekday,"A"),a:this.__seqToRE(this.locale_time.a_weekday,"a"),B:this.__seqToRE(this.locale_time.f_month.slice(1),"B"),b:this.__seqToRE(this.locale_time.a_month.slice(1),"b"),p:this.__seqToRE(this.locale_time.am_pm,"p"),Z:this.__seqToRE(this.locale_time.timezone.flat(),"Z"),"%":"%"}),this.W=this.U.replace("U","W"),this.x=this.pattern(this.locale_time.LC_date),this.X=this.pattern(this.locale_time.LC_time),this.c=this.pattern(this.locale_time.LC_date_time)}__seqToRE(e,t){if((e=e.slice(0).sort(((e,t)=>t.length-e.length))).every((e=>""===e)))return"";return`(?<${t}>${e.map((e=>e)).join("|")})`}pattern(e){let t="";for(e=(e=e.replace(b,"\\\\$1")).replace(v,"\\\\s+");e.includes("%");){const i=e.indexOf("%")+1,s=this[e[i]];if(void 0===s)throw new h(e[i]);t=`${t}${e.slice(0,i-1)}${s}`,e=e.slice(i+1)}return t+e}compile(e){return new RegExp("^"+this.pattern(e),"i")}}let C=new TimeRE;const T=5;let A={};function _strptime(i,s="%a %b %d %H:%M:%S %Y"){function _checkString(e,t){if("string"!=typeof e&&!u(e))throw new m(`strptime() argument ${t} must be a str, not \'${o(e)}\'`)}_checkString(i,0),_checkString(s,1),i=i.toString(),s=s.toString();let n,_=C.locale_time;if(Object.keys(A).length>T&&(A={}),n=A[s],void 0===n)try{n=C.compile(s)}catch(V){if(V instanceof h){let e=V.args.v[0];throw"\\\\"==e&&(e="%"),new d(`\'${e}\' is a bad directive in format \'${s}\'`)}if(V instanceof f)throw new d("stray %% in format \'"+s+"\'");throw V}const c=i.match(n);if(null===c)throw new d(`time data \'${i}\' does not match format \'${s}\'`);if(i.length!==c[0].length)throw new d(`unconverted data remains: ${i.slice(c[0].length)}`);let w=t,p=t,g=1,$=1,y=0,S=0,b=0,v=0,z=-1,L=t,E=0,I=t,M=t,H=t,Y=t,j=t,U=c.groups||{};if(Object.keys(U).forEach((e=>{if(void 0!==U[e])if("y"===e)p=_as_integer(U.y),p+=p<=68?2e3:1900;else if("Y"===e)p=_as_integer(U.Y);else if("G"===e)w=_as_integer(U.G);else if("m"===e)g=_as_integer(U.m);else if("B"===e)g=_.f_month.indexOf(U.B.toLowerCase());else if("b"===e)g=_.a_month.indexOf(U.b.toLowerCase());else if("d"===e)$=_as_integer(U.d);else if("H"===e)y=_as_integer(U.H);else if("H"===e)y=_as_integer(U.H);else if("I"===e){y=_as_integer(U.I);const e=(U.p||"").toLowerCase();["",_.am_pm[0]].includes(e)?12===y&&(y=0):e===_.am_pm[1]&&12!==y&&(y+=12)}else if("M"===e)S=_as_integer(U.M);else if("S"===e)b=_as_integer(U.S);else if("f"===e){let e=U.f;e+="0".repeat(6-e.length),v=_as_integer(e)}else if("A"===e)Y=_.f_weekday.indexOf(U.A.toLowerCase());else if("a"===e)Y=_.a_weekday.indexOf(U.a.toLowerCase());else if("w"===e)Y=_as_integer(U.w),0===Y?Y=6:Y-=1;else if("u"===e)Y=_as_integer(U.u),Y-=1;else if("j"===e)j=_as_integer(U.j);else if(["U","W"].includes(e))M=_as_integer(U[e]),H="U"===e?6:0;else if("V"===e)I=_as_integer(U.V);else if("z"===e){let e=U.z;if("Z"===e)L=0;else{if(":"===e[3]&&(e=e.slice(0,3)+e.slice(4),e.length>5)){if(":"!==e[5]){const e=`Inconsistent use of : in ${U.z}`;throw new d(e)}e=e.slice(0,5)+e.slice(6)}const t=_as_integer(e.slice(1,3)),i=_as_integer(e.slice(3,5)),s=_as_integer(e.slice(5,7)||0);L=3600*t+60*i+s;const n=e.slice(8),a="0".repeat(6-n.length);E=_as_integer(n+a),e.startsWith("-")&&(L=-L,E=-E)}}else if("Z"===e){let e=U.Z.toLowerCase(),t=0;for(let i of _.timezone){if(i.includes(e)){const i=O.tzname.v;if(r(i[0],i[1],"Eq")&&a(O.daylight)&&!["utc","gmt"].includes(e))break;z=t}t++}}})),p===t&&w!==t){if(I===t||Y===t)throw new d("ISO year directive \'%G\' must be used with the ISO week directive \'%V\' and a weekday directive (\'%A\',\'%a\', \'%w\', or \'%u\').");if(j!==t)throw new d("Day of the year directive \'%j\' is not compatible with ISO year directive \'%G\'.Use \'%Y\' instead.")}else if(M===t&&I!==t)throw new d(Y===t?"ISO week directive \'%V\' must be used with the ISO year directive \'%G\' and a weekday directive (\'%A\', \'%a\', \'%w\', or \'%u\').":"ISO week directive \'%V\' is incompatible with the year directive \'%Y\'. Use the ISO year \'%G\' instead.");let x=!1;if(p===t&&2===g&&29===$?(p=1904,x=!0):p===t&&(p=1900),j===t&&Y!==t){if(M!==t){j=function _calc_julian_from_U_or_W(e,t,i,s){let n=(new k(e,1,1).$toOrdinal()+6)%7;return s||(n=(n+1)%7,i=(i+1)%7),0===t?1+i-n:(7-n)%7+7*(t-1)+1+i}(p,M,Y,0===H)}else w!==t&&I!==t&&([p,j]=function _calc_julian_from_V(e,t,i){let s=7*t+i-((new k(e,1,4).$toOrdinal()%7||7)+3);return s<1&&(s+=new k(e,1,1).$toOrdinal(),s-=new k(e-=1,1,1).$toOrdinal()),[e,s]}(w,I,Y+1));if(j!==t&&j<=0){p-=1;const e=function _is_leap(e){return e%4==0&&(e%100!=0||e%400==0)}(p)?366:365;j+=e}}if(j===t)j=new k(p,g,$).$toOrdinal()-new k(p,1,1).$toOrdinal()+1;else{const t=function _fromordinal(t){return k.tp$getattr(l).tp$call([new e(t)])}(j-1+new k(p,1,1).$toOrdinal());p=t.$year,g=t.$month,$=t.$day}Y===t&&(Y=(new k(p,g,$).$toOrdinal()+6)%7);const R=U.Z||t;return x&&(p=1900),[[p,g,$,y,S,b,Y,j,z,R,L],v,E]}return _("_strptime",S,{_strptime_time:{$meth:function _strptime_time(t,i="%a %b %d %H:%M:%S %Y"){let n=_strptime(t,i)[0].slice(0,11);return n=n.map(((t,i)=>i<9?new e(t):p(t))),O.struct_time.tp$call([new s(n)])},$flags:{NamedArgs:["data_string","format"],Defaults:["%a %b %d %H:%M:%S %Y"]}},_strptime_datetime:{$meth:function _strptime_datetime(s,r,l="%a %b %d %H:%M:%S %Y"){const[o,_,c]=_strptime(r,l),[m,d]=o.slice(-2),h=o.slice(0,6);let f,u;return h.push(_),h.map((t=>new e(t))),d!==t&&(f=new L(0,d,c),u=a(m)?new E(f,new i(m)):new E(f),h.push(u)),n(s,h)},$flags:{NamedArgs:["cls","data_string","format"],Defaults:["%a %b %d %H:%M:%S %Y"]}},_strptime:{$meth(i,n){const a=_strptime(i,n);return a[0]=new s(a[0].map((i=>i===t?i:new e(i)))),a[1]=new e(a[1]),a[2]=new e(a[2]),new s(a)},$flags:{NamedArgs:["data_string","format"],Defaults:["%a %b %d %H:%M:%S %Y"]}},_getlang:{$meth:()=>p(_getlang()),$flags:{NoArgs:!0}}}),S.LocaleTime=c("_strptime.LocaleTime",{constructor:function(){this.v=new LocaleTime},slots:{tp$getattr(e,t){return this.v.hasOwnProperty(e.toString())?p(this.v[e.toString()]):$.call(this,e,t)},tp$setattr(e,t){if(!this.v.hasOwnProperty(e.toString()))return y.call(this,e,t);this.v[e.toString()]=g(t)}}}),S}))}'}}},312:function(t,e,n){(function(){"use strict";var t=t||{};t.scope={},t.ASSUME_ES5=!1,t.ASSUME_NO_NATIVE_MAP=!1,t.ASSUME_NO_NATIVE_SET=!1,t.SIMPLE_FROUND_POLYFILL=!1,t.ISOLATE_POLYFILLS=!1,t.FORCE_POLYFILL_PROMISE=!1,t.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,t.defineProperty=t.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){return t==Array.prototype||t==Object.prototype||(t[e]=n.value),t},t.getGlobal=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof n.g&&n.g];for(var e=0;e(e=e||0)&&(e=Math.max(e+i,0));e{Sk.abstr.setUpSlots(t),Sk.abstr.setUpMethods(t),Sk.abstr.setUpGetSets(t),Sk.abstr.setUpClassMethods(t)})),n(19),n(20),n(21),[Sk.builtin.str,Sk.builtin.none,Sk.builtin.NotImplemented,Sk.builtin.object].forEach((t=>{(t=t.prototype).__doc__=t.hasOwnProperty("tp$doc")?new Sk.builtin.str(t.tp$doc):Sk.builtin.none.none$})),n(22),n(23),n(24),n(25),n(26),n(27),n(28),n(29),n(31),n(32),n(33),n(34),n(35),n(36),n(37),n(38),n(39),n(40),n(41),n(42),n(43),n(44),n(45),n(46),n(47),n(48),n(49),n(50),n(51),n(52),n(53),n(66),n(54),n(55),n(56),n(57),n(58),n(59),n(60),n(61),n(62),n(63),n(64),n(65)},function(t,e,n){(function(t){var e={build:{githash:"1d6da87991edd93117a53858367c32f27d77b396",date:"2023-09-01T06:58:47.589Z"}};e.global=void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e.exportSymbol=function(t,n){t=t.split(".");var i,s=e.global;for(i=0;i=t||0===e||4<=e)return"th";switch(e){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function o(t){"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t)}var a={de_DE:{identifier:"de-DE",days:"Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag".split(" "),shortDays:"So Mo Di Mi Do Fr Sa".split(" "),months:"Januar Februar März April Mai Juni Juli August September Oktober November Dezember".split(" "),shortMonths:"Jan Feb Mär Apr Mai Jun Jul Aug Sep Okt Nov Dez".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d.%m.%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},en_CA:{identifier:"en-CA",days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),ordinalSuffixes:"st nd rd th th th th th th th th th th th th th th th th th st nd rd th th th th th th th st".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},en_US:{identifier:"en-US",days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),ordinalSuffixes:"st nd rd th th th th th th th th th th th th th th th th th st nd rd th th th th th th th st".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%m/%d/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},es_MX:{identifier:"es-MX",days:"domingo lunes martes miércoles jueves viernes sábado".split(" "),shortDays:"dom lun mar mié jue vie sáb".split(" "),months:"enero febrero marzo abril mayo junio julio agosto septiembre octubre noviembre diciembre".split(" "),shortMonths:"ene feb mar abr may jun jul ago sep oct nov dic".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},fr_FR:{identifier:"fr-FR",days:"dimanche lundi mardi mercredi jeudi vendredi samedi".split(" "),shortDays:"dim. lun. mar. mer. jeu. ven. sam.".split(" "),months:"janvier février mars avril mai juin juillet août septembre octobre novembre décembre".split(" "),shortMonths:"janv. févr. mars avril mai juin juil. août sept. oct. nov. déc.".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},it_IT:{identifier:"it-IT",days:"domenica lunedì martedì mercoledì giovedì venerdì sabato".split(" "),shortDays:"dom lun mar mer gio ven sab".split(" "),months:"gennaio febbraio marzo aprile maggio giugno luglio agosto settembre ottobre novembre dicembre".split(" "),shortMonths:"gen feb mar apr mag giu lug ago set ott nov dic".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},nl_NL:{identifier:"nl-NL",days:"zondag maandag dinsdag woensdag donderdag vrijdag zaterdag".split(" "),shortDays:"zo ma di wo do vr za".split(" "),months:"januari februari maart april mei juni juli augustus september oktober november december".split(" "),shortMonths:"jan feb mrt apr mei jun jul aug sep okt nov dec".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},pt_BR:{identifier:"pt-BR",days:"domingo segunda terça quarta quinta sexta sábado".split(" "),shortDays:"Dom Seg Ter Qua Qui Sex Sáb".split(" "),months:"janeiro fevereiro março abril maio junho julho agosto setembro outubro novembro dezembro".split(" "),shortMonths:"Jan Fev Mar Abr Mai Jun Jul Ago Set Out Nov Dez".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},ru_RU:{identifier:"ru-RU",days:"Воскресенье Понедельник Вторник Среда Четверг Пятница Суббота".split(" "),shortDays:"Вс Пн Вт Ср Чт Пт Сб".split(" "),months:"Январь Февраль Март Апрель Май Июнь Июль Август Сентябрь Октябрь Ноябрь Декабрь".split(" "),shortMonths:"янв фев мар апр май июн июл авг сен окт ноя дек".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X",D:"%d.%m.%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},tr_TR:{identifier:"tr-TR",days:"Pazar Pazartesi Salı Çarşamba Perşembe Cuma Cumartesi".split(" "),shortDays:"Paz Pzt Sal Çrş Prş Cum Cts".split(" "),months:"Ocak Şubat Mart Nisan Mayıs Haziran Temmuz Ağustos Eylül Ekim Kasım Aralık".split(" "),shortMonths:"Oca Şub Mar Nis May Haz Tem Ağu Eyl Eki Kas Ara".split(" "),AM:"ÖÖ",PM:"ÖS",am:"ÖÖ",pm:"ÖS",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},zh_CN:{identifier:"zh-CN",days:"星期日 星期一 星期二 星期三 星期四 星期五 星期六".split(" "),shortDays:"日一二三四五六".split(""),months:"一月份 二月份 三月份 四月份 五月份 六月份 七月份 八月份 九月份 十月份 十一月份 十二月份".split(" "),shortMonths:"一月 二月 三月 四月 五月 六月 七月 八月 九月 十月 十一月 十二月".split(" "),AM:"上午",PM:"下午",am:"上午",pm:"下午",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}}},l=a.en_US,u=new function t(u,c,p){function h(t,a,l,u){for(var c="",p=null,_=!1,d=t.length,g=!1,b=0;ba.getHours()?l.am:l.pm;break;case 82:c+=h(l.formats.R,a,l,u);break;case 83:c+=e(a.getSeconds(),p);break;case 84:c+=h(l.formats.T,a,l,u);break;case 85:c+=e(s(a,"sunday"),p);break;case 87:c+=e(s(a,"monday"),p);break;case 88:c+=h(l.formats.X,a,l,u);break;case 89:c+=a.getFullYear();break;case 90:m&&0===f?c+="GMT":c+=(p=(p=(p=a).toString().match(/\(([\w\s]+)\)/))&&p[1])||"";break;case 97:c+=l.shortDays[a.getDay()];break;case 98:case 104:c+=l.shortMonths[a.getMonth()];break;case 99:c+=h(l.formats.c,a,l,u);break;case 100:c+=e(a.getDate(),p);break;case 101:c+=e(a.getDate(),null==p?" ":p);break;case 106:p=new Date(a.getFullYear(),0,1),c+=n(p=Math.ceil((a.getTime()-p.getTime())/864e5));break;case 107:c+=e(a.getHours(),null==p?" ":p);break;case 108:c+=e(i(a.getHours()),null==p?" ":p);break;case 109:c+=e(a.getMonth()+1,p);break;case 110:c+="\n";break;case 111:p=a.getDate(),c=l.ordinalSuffixes?c+(String(p)+(l.ordinalSuffixes[p-1]||r(p))):c+(String(p)+r(p));break;case 112:c+=12>a.getHours()?l.AM:l.PM;break;case 114:c+=h(l.formats.r,a,l,u);break;case 115:c+=Math.floor(u/1e3);break;case 116:c+="\t";break;case 117:c+=0===(p=a.getDay())?7:p;break;case 118:c+=h(l.formats.v,a,l,u);break;case 119:c+=a.getDay();break;case 120:c+=h(l.formats.x,a,l,u);break;case 121:c+=e(_=a.getFullYear()%100,p);break;case 122:m&&0===f?c+=g?"+00:00":"+0000":(p=0!==f?f/6e4:-a.getTimezoneOffset(),_=g?":":"",S=Math.abs(p%60),c+=(0>p?"-":"+")+e(Math.floor(Math.abs(p/60)))+_+e(S));break;default:_&&(c+="%"),c+=t[b]}p=null,_=!1}else 37===S?_=!0:c+=t[b]}return c}var _,d=u||l,f=c||0,m=p||!1,g=0,b=function(t,e){if(e){var n=e.getTime();if(m){var i=6e4*(e.getTimezoneOffset()||0);6e4*((e=new Date(n+i+f)).getTimezoneOffset()||0)!==i&&(e=6e4*(e.getTimezoneOffset()||0),e=new Date(n+e+f))}}else(n=Date.now())>g?(g=n,_=new Date(g),n=g,m&&(_=new Date(g+6e4*(_.getTimezoneOffset()||0)+f))):n=g,e=_;return h(t,e,d,n)};return b.localize=function(e){return new t(e||d,f,m)},b.localizeByIdentifier=function(t){var e=a[t];return e?b.localize(e):(o('[WARNING] No locale found with identifier "'+t+'".'),b)},b.timezone=function(e){var n=f,i=m,s=typeof e;return"number"!==s&&"string"!==s||(i=!0,"string"===s?n=(n="-"===e[0]?-1:1)*(60*(s=parseInt(e.slice(1,3),10))+(e=parseInt(e.slice(3,5),10)))*6e4:"number"===s&&(n=6e4*e)),new t(d,n,i)},b.utc=function(){return new t(d,f,!0)},b}(l,0,!1);if(void 0!==t)t.exports=u;else(function(){return this||(0,eval)("this")}()).strftime=u;"function"!=typeof Date.now&&(Date.now=function(){return+new Date})}()},function(t,e,n){t=n(5);const i=Sk.global.JSBI=void 0!==Sk.global.BigInt?{}:t;void 0===Sk.global.BigInt?(i.__isBigInt||(i.__isBigInt=t=>t instanceof i),i.powermod=(t,e,n)=>{const s=i.BigInt(1);let r=s;for(e=i.greaterThan(e,i.__ZERO)?e:i.unaryMinus(e);i.greaterThan(e,i.__ZERO);)i.bitwiseAnd(e,s)&&(r=i.remainder(i.multiply(r,t),n)),e=i.signedRightShift(e,s),t=i.remainder(i.multiply(t,t),n);return r}):Object.assign(i,{BigInt:Sk.global.BigInt,toNumber:t=>Number(t),toString:t=>t.toString(),__isBigInt:t=>"bigint"==typeof t,unaryMinus:t=>-t,bitwiseNot:t=>~t,bitwiseAnd:(t,e)=>t&e,bitwiseOr:(t,e)=>t|e,bitwiseXor:(t,e)=>t^e,exponentiate:(t,e)=>{const n=i.BigInt(1);let s=n;for(e=e>i.__ZERO?e:-e;e>i.__ZERO;)e&n&&(s*=t),e>>=n,t*=t;return s},powermod:(t,e,n)=>{const s=i.BigInt(1);let r=s;for(e=e>i.__ZERO?e:-e;e>i.__ZERO;)e&s&&(r=r*t%n),e>>=s,t=t*t%n;return r},multiply:(t,e)=>t*e,divide:(t,e)=>t/e,remainder:(t,e)=>t%e,add:(t,e)=>t+e,subtract:(t,e)=>t-e,leftShift:(t,e)=>t<t>>e,unsignedRightShift:(t,e)=>t>>>e,lessThan:(t,e)=>tt<=e,greaterThan:(t,e)=>t>e,greaterThanOrEqual:(t,e)=>t>=e,equal:(t,e)=>t===e,notEqual:(t,e)=>t!==e}),i.__ZERO=i.BigInt(0),i.__MAX_SAFE=i.BigInt(Number.MAX_SAFE_INTEGER),i.__MIN_SAFE=i.BigInt(-Number.MAX_SAFE_INTEGER),i.numberIfSafe=t=>i.lessThan(t,i.__MAX_SAFE)&&i.greaterThan(t,i.__MIN_SAFE)?i.toNumber(t):t,i.BigUp=t=>i.__isBigInt(t)?t:i.BigInt(t)},function(t,e,n){t.exports=function(){var t=Math.imul,e=Math.clz32,n=Math.abs,i=Math.max,s=Math.floor;class r extends Array{constructor(t,e){if(super(t),this.sign=e,t>r.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded")}static BigInt(t){var e=Number.isFinite;if("number"==typeof t){if(0===t)return r.__zero();if(r.__isOneDigitInt(t))return 0>t?r.__oneDigit(-t,!0):r.__oneDigit(t,!1);if(!e(t)||s(t)!==t)throw new RangeError("The number "+t+" cannot be converted to BigInt because it is not an integer");return r.__fromDouble(t)}if("string"==typeof t){if(null===(e=r.__fromString(t)))throw new SyntaxError("Cannot convert "+t+" to a BigInt");return e}if("boolean"==typeof t)return!0===t?r.__oneDigit(1,!1):r.__zero();if("object"==typeof t)return t.constructor===r?t:(t=r.__toPrimitive(t),r.BigInt(t));throw new TypeError("Cannot convert "+t+" to a BigInt")}toDebugString(){const t=["BigInt["];for(const e of this)t.push((e?(e>>>0).toString(16):e)+", ");return t.push("]"),t.join("")}toString(t){if(2>(t=void 0===t?10:t)||36>>12;const l=a-12;for(e=12<=a?0:i<<20+a,a=20+a,0>>30-l,e=i<>>30-a,a-=30;return 1!==(i=r.__decideRounding(t,a,o,i))&&(0!==i||1&~e)||0!=(e=e+1>>>0)||!(0!=++s>>>20&&(s=0,1023<++n))?(t=t.sign?-2147483648:0,n=n+1023<<20,r.__kBitConversionInts[1]=t|n|s,r.__kBitConversionInts[0]=e,r.__kBitConversionDouble[0]):t.sign?-1/0:1/0}static unaryMinus(t){if(0===t.length)return t;const e=t.__copy();return e.sign=!t.sign,e}static bitwiseNot(t){return t.sign?r.__absoluteSubOne(t).__trim():r.__absoluteAddOne(t,!0)}static exponentiate(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return r.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return!t.sign||1&e.__digit(0)?t:r.unaryMinus(t);if(1=r.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(0|e/30);return(t=new r(n,t.sign&&!!(1&e))).__initializeDigits(),t.__setDigit(n-1,1<>=1;0!==e;e>>=1)i=r.multiply(i,i),1&e&&(n=null===n?i:r.multiply(n,i));return n}static multiply(t,e){if(0===t.length)return t;if(0===e.length)return e;var n=t.length+e.length;30<=t.__clzmsd()+e.__clzmsd()&&n--,(n=new r(n,t.sign!==e.sign)).__initializeDigits();for(let i=0;ir.__absoluteCompare(t,e))return r.__zero();const n=t.sign!==e.sign,i=e.__unsignedDigit(0);if(1===e.length&&32767>=i){if(1===i)return n===t.sign?t:r.unaryMinus(t);t=r.__absoluteDivSmall(t,i,null)}else t=r.__absoluteDivLarge(t,e,!0,!1);return t.sign=n,t.__trim()}static remainder(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>r.__absoluteCompare(t,e))return t;const n=e.__unsignedDigit(0);return 1===e.length&&32767>=n?1===n||0===(e=r.__absoluteModSmall(t,n))?r.__zero():r.__oneDigit(e,t.sign):((e=r.__absoluteDivLarge(t,e,!1,!0)).sign=t.sign,e.__trim())}static add(t,e){const n=t.sign;return n===e.sign?r.__absoluteAdd(t,e,n):0<=r.__absoluteCompare(t,e)?r.__absoluteSub(t,e,n):r.__absoluteSub(e,t,!n)}static subtract(t,e){const n=t.sign;return n===e.sign?0<=r.__absoluteCompare(t,e)?r.__absoluteSub(t,e,n):r.__absoluteSub(e,t,!n):r.__absoluteAdd(t,e,n)}static leftShift(t,e){return 0===e.length||0===t.length?t:e.sign?r.__rightShiftByAbsolute(t,e):r.__leftShiftByAbsolute(t,e)}static signedRightShift(t,e){return 0===e.length||0===t.length?t:e.sign?r.__leftShiftByAbsolute(t,e):r.__rightShiftByAbsolute(t,e)}static unsignedRightShift(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}static lessThan(t,e){return 0>r.__compareToBigInt(t,e)}static lessThanOrEqual(t,e){return 0>=r.__compareToBigInt(t,e)}static greaterThan(t,e){return 0(t=s(t)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===t)return r.__zero();if(t>=r.__kMaxLengthBits)return e;const n=0|(t+29)/30;if(e.length(t=s(t)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===t)return r.__zero();if(e.sign){if(t>r.__kMaxLengthBits)throw new RangeError("BigInt too big");return r.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=r.__kMaxLengthBits)return e;const n=0|(t+29)/30;if(e.length>>i?r.__truncateToNBits(t,e):e}static ADD(t,e){if(t=r.__toPrimitive(t),e=r.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=r.__toNumeric(t),e=r.__toNumeric(e),r.__isBigInt(t)&&r.__isBigInt(e))return r.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}static LT(t,e){return r.__compare(t,e,0)}static LE(t,e){return r.__compare(t,e,1)}static GT(t,e){return r.__compare(t,e,2)}static GE(t,e){return r.__compare(t,e,3)}static EQ(t,e){for(;;){if(r.__isBigInt(t))return r.__isBigInt(e)?r.equal(t,e):r.EQ(e,t);if("number"==typeof t){if(r.__isBigInt(e))return r.__equalToNumber(e,t);if("object"!=typeof e)return t==e;e=r.__toPrimitive(e)}else if("string"==typeof t){if(r.__isBigInt(e))return null!==(t=r.__fromString(t))&&r.equal(t,e);if("object"!=typeof e)return t==e;e=r.__toPrimitive(e)}else if("boolean"==typeof t){if(r.__isBigInt(e))return r.__equalToNumber(e,+t);if("object"!=typeof e)return t==e;e=r.__toPrimitive(e)}else if("symbol"==typeof t){if(r.__isBigInt(e))return!1;if("object"!=typeof e)return t==e;e=r.__toPrimitive(e)}else{if("object"!=typeof t)return t==e;if("object"==typeof e&&e.constructor!==r)return t==e;t=r.__toPrimitive(t)}}}static NE(t,e){return!r.EQ(t,e)}static __zero(){return new r(0,!1)}static __oneDigit(t,e){return(e=new r(1,e)).__setDigit(0,t),e}__copy(){const t=new r(this.length,this.sign);for(let e=0;ee)e=-e-1;else{if(0===n)return-1;n--,i=t.__digit(n),e=29}if(!(i&(e=1<>>20)-1023,n=1+(0|e/30);t=new r(n,0>t);let i,s=1048575&r.__kBitConversionInts[1]|1048576,o=r.__kBitConversionInts[0];if(20>(e%=30)){var a=20-e;i=a+32,e=s>>>a,s=s<<32-a|o>>>a,o<<=32-a}else 20===e?(i=32,e=s,s=o):(i=32-(a=e-20),e=s<>>32-a,s=o<>>2,s=s<<30|o>>>2,o<<=30):e=0,t.__setDigit(n,e);return t.__trim()}static __isWhitespace(t){return!!(13>=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}static __fromString(t,e){e=void 0===e?0:e;let n=0;const i=t.length;let s=0;if(s===i)return r.__zero();let o=t.charCodeAt(s);for(;r.__isWhitespace(o);){if(++s===i)return r.__zero();o=t.charCodeAt(s)}if(43===o){if(++s===i)return null;o=t.charCodeAt(s),n=1}else if(45===o){if(++s===i)return null;o=t.charCodeAt(s),n=-1}if(0===e){if(e=10,48===o){if(++s===i)return r.__zero();if(o=t.charCodeAt(s),88===o||120===o){if(e=16,++s===i)return null;o=t.charCodeAt(s)}else if(79===o||111===o){if(e=8,++s===i)return null;o=t.charCodeAt(s)}else if(66===o||98===o){if(e=2,++s===i)return null;o=t.charCodeAt(s)}}}else if(16===e&&48===o){if(++s===i)return r.__zero();if(o=t.charCodeAt(s),88===o||120===o){if(++s===i)return null;o=t.charCodeAt(s)}}if(0!=n&&10!==e)return null;for(;48===o;){if(++s===i)return r.__zero();o=t.charCodeAt(s)}var a=i-s;let l=r.__kMaxBitsPerChar[e];var u=r.__kBitsPerCharTableMultiplier-1;if(a>1073741824/l)return null;a=new r(0|(29+(l*a+u>>>r.__kBitsPerCharTableShift))/30,!1);const c=10>e?e:10,p=10>>0>>0>>r.__kBitsPerCharTableShift)/30)}while(!h)}else{l>>=r.__kBitsPerCharTableShift,e=[];var h=[],_=!1;do{for(var d=0,f=0;;){if(o-48>>>0>>0>>l-r)}if(0!==s){if(i>=t.length)throw Error("implementation bug");t.__setDigit(i++,s)}for(;i>>1)+(85&i))>>>2)+(51&i))>>>4)+(15&i),--e;const s=t.__digit(n-1);var o=r.__clz30(s),a=0|(30*n-o+i-1)/i;if(t.sign&&a++,268435456>>(u=i-u),u=30-u;u>=i;)o[a--]=r.__kConversionChars[l&e],l>>>=i,u-=i}for(o[a--]=r.__kConversionChars[(l|s<>>i-u;0!==l;)o[a--]=r.__kConversionChars[l&e],l>>>=i;if(t.sign&&(o[a--]="-"),-1!=a)throw Error("implementation bug");return o.join("")}static __toStringGeneric(t,e,n){var i=t.length;if(0===i)return"";if(1===i)return e=t.__unsignedDigit(0).toString(e),!1===n&&t.sign&&(e="-"+e),e;var s=30*i-r.__clz30(t.__digit(i-1));i=r.__kMaxBitsPerChar[e]-1,i=1+(0|((s*=r.__kBitsPerCharTableMultiplier)+(i-1))/i)>>1;var o=(s=r.exponentiate(r.__oneDigit(e,!1),r.__oneDigit(i,!1))).__unsignedDigit(0);if(1===s.length&&32767>=o){(s=new r(t.length,!1)).__initializeDigits();var a=0;for(let e=2*t.length-1;0<=e;e--)a=a<<15|t.__halfDigit(e),s.__setHalfDigit(e,0|a/o),a=0|a%o;o=a.toString(e)}else s=(o=r.__absoluteDivLarge(t,s,!0,!0)).quotient,o=o.remainder.__trim(),o=r.__toStringGeneric(o,e,!0);for(s.__trim(),e=r.__toStringGeneric(s,e,!0);o.lengtht?r.__absoluteLess(n):0}static __compareToNumber(t,e){if(r.__isOneDigitInt(e)){const i=t.sign,s=0>e;if(i!==s)return r.__unequalSign(i);if(0===t.length){if(s)throw Error("implementation bug");return 0===e?0:-1}return 1e?r.__absoluteGreater(i):te)return r.__unequalSign(n);if(0===e)throw Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;if(r.__kBitConversionDouble[0]=e,2047==(e=2047&r.__kBitConversionInts[1]>>>20))throw Error("implementation bug: handled elsewhere");var i=e-1023;if(0>i)return r.__absoluteGreater(n);e=t.length;var s=t.__digit(e-1),o=r.__clz30(s),a=30*e-o;if(a<(i+=1))return r.__absoluteLess(n);if(a>i)return r.__absoluteGreater(n);i=1048576|1048575&r.__kBitConversionInts[1];let l=r.__kBitConversionInts[0];if((o=29-o)!=(0|(a-1)%30))throw Error("implementation bug");if(20>o){var u=20-o;o=u+32,a=i>>>u,i=i<<32-u|l>>>u,l<<=32-u}else 20===o?(o=32,a=i,i=l):(o=32-(u=o-20),a=i<>>32-u,i=l<>>=0)>(a>>>=0))return r.__absoluteGreater(n);if(s>>2,i=i<<30|l>>>2,l<<=30):a=0,(s=t.__unsignedDigit(e))>a)return r.__absoluteGreater(n);if(se&&t.__unsignedDigit(0)===n(e):0===r.__compareToDouble(t,e)}static __comparisonResultToBool(t,e){return 0===e?0>t:1===e?0>=t:2===e?0e;case 3:return t>=e}if(r.__isBigInt(t)&&"string"==typeof e)return null!==(e=r.__fromString(e))&&r.__comparisonResultToBool(r.__compareToBigInt(t,e),n);if("string"==typeof t&&r.__isBigInt(e))return null!==(t=r.__fromString(t))&&r.__comparisonResultToBool(r.__compareToBigInt(t,e),n);if(t=r.__toNumeric(t),e=r.__toNumeric(e),r.__isBigInt(t)){if(r.__isBigInt(e))return r.__comparisonResultToBool(r.__compareToBigInt(t,e),n);if("number"!=typeof e)throw Error("implementation bug");return r.__comparisonResultToBool(r.__compareToNumber(t,e),n)}if("number"!=typeof t)throw Error("implementation bug");if(r.__isBigInt(e))return r.__comparisonResultToBool(r.__compareToNumber(e,t),2^n);if("number"!=typeof e)throw Error("implementation bug");return 0===n?te:3===n?t>=e:void 0}__clzmsd(){return r.__clz30(this.__digit(this.length-1))}static __absoluteAdd(t,e,n){if(t.length>>30,n.__setDigit(s,1073741823&r)}for(;s>>30,n.__setDigit(s,1073741823&e);return s>>30,n.__setDigit(s,1073741823&r)}for(;s>>30,n.__setDigit(s,1073741823&e);return n.__trim()}static __absoluteAddOne(t,e,n){n=void 0===n?null:n;const i=t.length;null===n?n=new r(i,e):n.sign=e,e=1;for(let s=0;s>>30,n.__setDigit(s,1073741823&i)}return 0!=e&&n.__setDigitGrow(i,1),n}static __absoluteSubOne(t,e){const n=t.length,i=new r(e=e||n,!1);let s=1;for(let e=0;e>>30,i.__setDigit(e,1073741823&n)}if(0!=s)throw Error("implementation bug");for(t=n;tn?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}static __multiplyAccumulate(t,e,n,i){if(0!==e){var s=32767&e,o=e>>>15,a=e=0;for(let p,h=0;h>>15;l=r.__imul(u,s),u=r.__imul(u,o);const _=r.__imul(c,s);p+=a+l+e,e=p>>>30,p&=1073741823,p+=((32767&u)<<15)+((32767&_)<<15),e+=p>>>30,a=(c=r.__imul(c,o))+(u>>>15)+(_>>>15),n.__setDigit(i,1073741823&p)}for(;0!=e||0!==a;i++)t=n.__digit(i),t+=e+a,a=0,e=t>>>30,n.__setDigit(i,1073741823&t)}}static __internalMultiplyAdd(t,e,n,i,s){let o=0;for(let u=0;u>>15,e)))<<15)+o+n)>>>30,o=a>>>15,s.__setDigit(u,1073741823&l)}if(s.length>i)for(s.__setDigit(i++,n+o);ithis.length&&(n=this.length);const i=32767&t;t>>>=15;let s=0;for(let u=0;u>>15;o=r.__imul(a,i),a=r.__imul(a,t);const n=r.__imul(l,i);s=(o=e+o+s)>>>30,o&=1073741823,s+=(o+=((32767&a)<<15)+((32767&n)<<15))>>>30,e=(l=r.__imul(l,t))+(a>>>15)+(n>>>15),this.__setDigit(u,1073741823&o)}if(0!=s||0!==e)throw Error("implementation bug")}static __absoluteDivSmall(t,e,n){null===(n=void 0===n?null:n)&&(n=new r(t.length,!1));let i=0;for(let s,r=2*t.length-1;0<=r;r-=2){s=(i<<15|t.__halfDigit(r))>>>0;const o=0|s/e;i=0|s%e,s=(i<<15|t.__halfDigit(r-1))>>>0;const a=0|s/e;i=0|s%e,n.__setDigit(r>>>1,o<<15|a)}return n}static __absoluteModSmall(t,e){let n=0;for(let i=2*t.length-1;0<=i;i--)n=0|((n<<15|t.__halfDigit(i))>>>0)%e;return n}static __absoluteDivLarge(t,e,n,i){const s=e.__halfDigitLength(),o=e.length;var a=t.__halfDigitLength()-s;let l=null;n&&(l=new r(a+2>>>1,!1),l.__initializeDigits());const u=new r(s+2>>>1,!1);u.__initializeDigits();const c=r.__clz15(e.__halfDigit(s-1));0>>0)/p,a=0|a%p;const n=e.__halfDigit(s-2),o=t.__halfDigit(c+s-2);for(;r.__imul(i,n)>>>0>(a<<16|o)>>>0&&(i--,!(32767<(a+=p))););}r.__internalMultiplyAdd(e,i,0,o,u),0!==(a=t.__inplaceSub(u,c,s+1))&&(a=t.__inplaceAdd(e,c,s),t.__setHalfDigit(c+s,32767&t.__halfDigit(c+s)+a),i--),n&&(1&c?h=i<<15:l.__setDigit(c>>>1,h|i))}if(i)return t.__inplaceRightShift(c),n?{quotient:l,remainder:t}:t;if(n)return l;throw Error("unreachable")}static __clz15(t){return r.__clz30(t)-15}__inplaceAdd(t,e,n){let i=0;for(let s=0;s>>15,this.__setHalfDigit(e+s,32767&n)}return i}__inplaceSub(t,e,n){let i=0;if(1&e){e>>=1;for(var s=this.__digit(e),r=32767&s,o=0;o>>1;o++){var a=t.__digit(o);i=1&(s=(s>>>15)-(32767&a)-i)>>>15,this.__setDigit(e+o,(32767&s)<<15|32767&r),i=1&(r=(32767&(s=this.__digit(e+o+1)))-(a>>>15)-i)>>>15}const l=(s>>>15)-(32767&(a=t.__digit(o)))-i;if(i=1&l>>>15,this.__setDigit(e+o,(32767&l)<<15|32767&r),e+o+1>=this.length)throw new RangeError("out of bounds");!(1&n)&&(i=1&(r=(32767&(s=this.__digit(e+o+1)))-(a>>>15)-i)>>>15,this.__setDigit(e+t.length,1073709056&s|32767&r))}else{for(e>>=1,r=0;r>>15,i=1&(s=(s>>>15)-(a>>>15)-i)>>>15,this.__setDigit(e+r,(32767&s)<<15|32767&o);i=1&(s=(32767&(o=this.__digit(e+r)))-(32767&(t=t.__digit(r)))-i)>>>15,a=0,!(1&n)&&(i=1&(a=(o>>>15)-(t>>>15)-i)>>>15),this.__setDigit(e+r,(32767&a)<<15|32767&s)}return i}__inplaceRightShift(t){if(0!==t){var e=this.__digit(0)>>>t,n=this.length-1;for(let i=0;i>>t}this.__setDigit(n,e)}}static __specialLeftShift(t,e,n){const i=t.length,s=new r(i+n,!1);if(0===e){for(e=0;e>>30-e}return 0n)throw new RangeError("BigInt too big");e=0|n/30;var i=n%30;const s=t.length,o=0!==i&&0!=t.__digit(s-1)>>>30-i;var a=s+e+(o?1:0);if(n=new r(a,t.sign),0===i){for(i=0;i>>30-i}if(o)n.__setDigit(s+e,a);else if(0!==a)throw Error("implementation bug")}return n.__trim()}static __rightShiftByAbsolute(t,e){var n=t.length,i=t.sign,s=r.__toShiftAmount(e);if(0>s)return r.__rightShiftByMaximum(i);var o=s%30,a=n-(e=0|s/30);if(0>=a)return r.__rightShiftByMaximum(i);if(s=!1,i)if(t.__digit(e)&(1<>>o,n=n-e-1,l=0;l>>o}i.__setDigit(n,a)}return s&&(i=r.__absoluteAddOne(i,!0,i)),i.__trim()}static __rightShiftByMaximum(t){return t?r.__oneDigit(1,!0):r.__zero()}static __toShiftAmount(t){return 1r.__kMaxLengthBits?-1:t}static __toPrimitive(t,e){if(e=void 0===e?"default":e,"object"!=typeof t||t.constructor===r)return t;if("undefined"!=typeof Symbol&&"symbol"==typeof Symbol.toPrimitive){const n=t[Symbol.toPrimitive];if(n){if("object"!=typeof(t=n(e)))return t;throw new TypeError("Cannot convert object to primitive value")}}if((e=t.valueOf)&&"object"!=typeof(e=e.call(t)))return e;if((e=t.toString)&&"object"!=typeof(t=e.call(t)))return t;throw new TypeError("Cannot convert object to primitive value")}static __toNumeric(t){return r.__isBigInt(t)?t:+t}static __isBigInt(t){return"object"==typeof t&&null!==t&&t.constructor===r}static __truncateToNBits(t,e){var n=0|(t+29)/30;const i=new r(n,e.sign);--n;for(let t=0;t>>t),i.__setDigit(n,e),i.__trim()}static __truncateAndSubFromPowerOfTwo(t,e,n){var i=Math.min,s=0|(t+29)/30;n=new r(s,n);let o=0;var a=0;for(i=i(--s,e.length);o>>30,n.__setDigit(o,1073741823&t)}for(;o>>t,a=(t=1<<32-t)-e-a,a&=t-1),n.__setDigit(s,a),n.__trim()}__digit(t){return this[t]}__unsignedDigit(t){return this[t]>>>0}__setDigit(t,e){this[t]=0|e}__setDigitGrow(t,e){this[t]=0|e}__halfDigitLength(){const t=this.length;return 32767>=this.__unsignedDigit(t-1)?2*t-1:2*t}__halfDigit(t){return 32767&this[t>>>1]>>>15*(1&t)}__setHalfDigit(t,e){const n=t>>>1,i=this.__digit(n);this.__setDigit(n,1&t?32767&i|e<<15:1073709056&i|32767&e)}static __digitPow(t,e){let n=1;for(;0>>=1,t*=t;return n}static __isOneDigitInt(t){return(1073741823&t)===t}}return r.__kMaxLength=33554432,r.__kMaxLengthBits=r.__kMaxLength<<5,r.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],r.__kBitsPerCharTableShift=5,r.__kBitsPerCharTableMultiplier=1<>>0)/e)},r.__imul=t||function(t,e){return 0|t*e},r}()},function(t,e){[..."abc"].flat(),"a".matchAll(/a/g)},function(t,e,n){(function(t,e){!function(t,n){function i(t){delete a[t]}function s(t){if(l)setTimeout(s,0,t);else{var e=a[t];if(e){l=!0;try{var r=e.callback,o=e.args;switch(o.length){case 0:r();break;case 1:r(o[0]);break;case 2:r(o[0],o[1]);break;case 3:r(o[0],o[1],o[2]);break;default:r.apply(n,o)}}finally{i(t),l=!1}}}}if(!t.setImmediate){var r,o=1,a={},l=!1,u=t.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(t);c=c&&c.setTimeout?c:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){s(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(p="setImmediate$"+Math.random()+"$",h=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(p)&&s(+e.data.slice(p.length))},t.addEventListener?t.addEventListener("message",h,!1):t.attachEvent("onmessage",h),r=function(e){t.postMessage(p+e,"*")}):t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){s(t.data)},r=function(e){t.port2.postMessage(e)}}():u&&"onreadystatechange"in u.createElement("script")?function(){var t=u.documentElement;r=function(e){var n=u.createElement("script");n.onreadystatechange=function(){s(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():r=function(t){setTimeout(s,0,t)},c.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=Array(arguments.length-1),n=0;n the object's type\ntype(name, bases, dict) -> a new type",tp$call:function(t,e){if(this===Sk.builtin.type){if(1===t.length&&(void 0===e||!e.length))return t[0].ob$type;if(3!==t.length)throw new Sk.builtin.TypeError("type() takes 1 or 3 arguments")}let n=this.prototype.tp$new(t,e);if(n.$isSuspension)return Sk.misceval.chain(n,(i=>{if(n=i,n.ob$type.$isSubType(this))return n.tp$init(t,e)}),(()=>n));if(n.ob$type.$isSubType(this)){const i=n.tp$init(t,e);return void 0!==i&&i.$isSuspension?Sk.misceval.chain(i,(()=>n)):n}return n},tp$new:function(t,e){if(3!==t.length){if(1===t.length&&(void 0===e||!e.length))return t[0].ob$type;throw new Sk.builtin.TypeError("type() takes 1 or 3 arguments")}const i=t[0];var s=t[1];const o=t[2];if("dict"!==o.tp$name)throw new Sk.builtin.TypeError("type() argument 3 must be dict, not "+Sk.abstr.typeName(o));if(!Sk.builtin.checkString(i))throw new Sk.builtin.TypeError("type() argument 1 must be str, not "+Sk.abstr.typeName(i));const a=i.$jsstr();if("tuple"!==s.tp$name)throw new Sk.builtin.TypeError("type() argument 2 must be tuple, not "+Sk.abstr.typeName(s));r(a,t=function(){this.sk$hasDict&&(this.$d=new Sk.builtin.dict),this.$s=[]},s=s.sk$asarray(),this.constructor);const u=t.prototype;Sk.globals&&(u.__module__=Sk.globals.__name__),u.__doc__=Sk.builtin.none.none$;let c,p=void 0===(s=o.quick$lookup(Sk.builtin.str.$slots)),h=void 0!==t.$typeLookup(Sk.builtin.str.$dict);if(void 0!==s&&(c=new Set,(s=Sk.builtin.checkString(s)?[s]:Sk.misceval.arrayFromIterable(s)).forEach((t=>{if(!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("__slots__ items must be strings, not '"+Sk.abstr.typeName(t)+"'");if(!t.$isIdentifier())throw new Sk.builtin.TypeError("__slots__ must be identifiers");if(t===Sk.builtin.str.$dict){if(h)throw new Sk.builtin.TypeError("__dict__ slot disallowed: we already got one");p=!0}else c.add(Sk.mangleName(i,t))})),function(t,e){const n=e.prototype,i=n.sk$nslots||0;Object.defineProperty(n,"sk$nslots",{value:i+t.length,writable:!0}),t.length&&Object.defineProperty(e,"sk$solidSlotBase",{value:!0,writable:!0}),t.forEach(((t,s)=>{s+=i,n[t.$mangled]=new Sk.builtin.getset_descriptor(e,{$get(){const e=this.$s[s];if(void 0===e)throw new Sk.builtin.AttributeError(t);return e},$set(t){this.$s[s]=t}})}))}(s=[...c].sort(((t,e)=>t.toString().localeCompare(e.toString()))),t)),p&&!h&&(u.__dict__=new Sk.builtin.getset_descriptor(t,l),h=!0),Object.defineProperties(u,{ht$slots:{value:s||null,writable:!0},sk$hasDict:{value:h,writable:!0}}),o.$items().forEach((t=>{var[e,n]=t;if(c&&c.has(e))throw new Sk.builtin.ValueError("'"+e.toString()+"' in __slots__ conflicts with class variable");u[e.$mangled]=n})),u.hasOwnProperty("__qualname__")){if(s=u.__qualname__,!Sk.builtin.checkString(s))throw new Sk.builtin.TypeError("type __qualname__ must be a str, not '"+Sk.abstr.typeName(s)+"'");u.ht$qualname=s}return n(s=t.prototype,"__init_subclass__","classmethod"),n(s,"__new__","staticmethod"),n(s,"__class_getitem__","classmethod"),t.$allocateSlots(),function(t){const e=t.prototype;Object.keys(e).forEach((n=>{const i=Sk.abstr.lookupSpecial(e[n],Sk.builtin.str.$setname);if(void 0!==i)try{Sk.misceval.callsimArray(i,[t,new Sk.builtin.str(n)])}catch(i){throw(n=new Sk.builtin.RuntimeError("Error calling __set_name__ on '"+Sk.abstr.typeName(e[n])+"' instance '"+n+"' in '"+t.prototype.tp$name+"'")).$cause=i,n}}))}(t),function(t,e){t=new Sk.builtin.super_(t,t).tp$getattr(Sk.builtin.str.$initsubclass),Sk.misceval.callsimArray(t,[],e)}(t,e),t},tp$init:function(t,e){if(t&&1==t.length&&e&&e.length)throw new Sk.builtin.TypeError("type.__init__() takes no keyword arguments");if(3!=t.length&&1!=t.length)throw new Sk.builtin.TypeError("type.__init__() takes 1 or 3 arguments");return Sk.builtin.object.prototype.tp$init.call(this,[])},tp$getattr:function(t,e){var n=this.ob$type;const i=n.$typeLookup(t);let s;return void 0!==i&&(s=i.tp$descr_get,void 0!==s&&void 0!==i.tp$descr_set)?s.call(i,this,n,e):void 0!==(t=this.$typeLookup(t))?void 0!==(n=t.tp$descr_get)?e=n.call(t,null,this,e):t:void 0!==s?s.call(i,this,n,e):void 0!==i?i:void 0},tp$setattr:function(t,e,n){if(!this.sk$klass){if(void 0!==e)throw new Sk.builtin.TypeError("can't set attributes of built-in/extension type '"+this.prototype.tp$name+"'");throw new Sk.builtin.TypeError("can't delete attributes on type object '"+this.prototype.tp$name+"'")}const i=this.ob$type.$typeLookup(t);if(void 0!==i){const t=i.tp$descr_set;if(t)return t.call(i,this,e,n)}if(n=t.$mangled,void 0===e){if(!(e=this.prototype).hasOwnProperty(n))throw new Sk.builtin.AttributeError("type object '"+this.prototype.tp$name+"' has no attribute '"+t.$jsstr()+"'");delete e[n],void 0!==(t=Sk.dunderToSkulpt[n])&&(delete this.prototype[t],e.sk$prototypical||this.$allocateGetterSlot(n))}else this.prototype[n]=e,n in Sk.dunderToSkulpt&&this.$allocateSlot(n,e)},$r:function(){let t=this.prototype.__module__,e="",n="class";return t&&Sk.builtin.checkString(t)?e=t.v+".":t=null,t||this.sk$klass||Sk.__future__.class_repr||(n="type"),new Sk.builtin.str("<"+n+" '"+e+this.prototype.tp$name+"'>")}},writable:!0},tp$methods:{value:null,writable:!0},tp$classmethods:{value:null,writable:!0},tp$getsets:{value:null,writable:!0},sk$type:{value:!0},$isSubType:{value:function(t){return this===t||this.prototype instanceof t||!this.prototype.sk$prototypical&&this.prototype.tp$mro.includes(t)}},$allocateSlot:{value:function(t,e){const n=(t=Sk.slots[t]).$slot_name,i=this.prototype;i.hasOwnProperty(n)&&delete i[n],Object.defineProperty(i,n,{value:t.$slot_func(e),writable:!0,configurable:!0})}},$allocateSlots:{value:function(){const t=this.prototype;this.prototype.sk$prototypical?Object.keys(t).forEach((e=>{e in Sk.slots&&this.$allocateSlot(e,t[e])})):Object.keys(Sk.slots).forEach((e=>{t.hasOwnProperty(e)?this.$allocateSlot(e,t[e]):this.$allocateGetterSlot(e)})),t.hasOwnProperty("__eq__")&&!t.hasOwnProperty("__hash__")&&(t.tp$hash=t.__hash__=Sk.builtin.none.none$)}},$allocateGetterSlot:{value:function(t){const e=Sk.slots[t].$slot_name,n=this.prototype;n.hasOwnProperty(e)||Object.defineProperty(n,e,{configurable:!0,get(){const t=n.tp$mro;for(let n=1;nnew Sk.builtin.dict([]),$flags:{FastCall:!0}}};const l={$get(){const t=o(this.ob$type);return void 0!==t?t.tp$descr_get(this,this.ob$type):Sk.generic.getSetDict.$get.call(this)},$set(t){const e=o(this.ob$type);return void 0!==e?e.tp$descr_set(this,t):void 0!==t?Sk.generic.getSetDict.$set.call(this,t):void(this.$d=new Sk.builtin.dict([]))},$doc:"dictionary for instance variables (if defined)",$name:"__dict__"}},function(t,e){Sk.generic={},Sk.generic.getAttr=function(t,e){let n;const i=this.ob$type,s=i.$typeLookup(t);if(void 0!==s&&(n=s.tp$descr_get,void 0!==n&&void 0!==s.tp$descr_set))return n.call(s,this,i,e);const r=this.$d;return void 0!==r&&void 0!==(t=r.quick$lookup(t))?t:void 0!==n?n.call(s,this,i,e):void 0!==s?s:void 0},Sk.exportSymbol("Sk.generic.getAttr",Sk.generic.getAttr),Sk.generic.setAttr=function(t,e,n){var i=this.ob$type.$typeLookup(t);if(null!=i){const t=i.tp$descr_set;if(t)return t.call(i,this,e,n)}if(void 0!==(n=this.$d))if(n.mp$ass_subscript){if(void 0!==e)return n.mp$ass_subscript(t,e);try{return n.mp$ass_subscript(t)}catch(e){if(e instanceof Sk.builtin.KeyError)throw new Sk.builtin.AttributeError("'"+Sk.abstr.typeName(this)+"' object has no attribute '"+t.$jsstr()+"'");throw e}}else if("object"==typeof n){if(i=t.$mangled,void 0!==e)return void(n[i]=e);if(void 0!==n[i])return void delete n[i]}throw new Sk.builtin.AttributeError(this.sk$attrError()+" has no attribute '"+t.$jsstr()+"'")},Sk.exportSymbol("Sk.generic.setAttr",Sk.generic.setAttr),Sk.generic.new=function(t){return function(e,n){return this.constructor===t?new this.constructor:(e=new this.constructor,t.call(e),e)}},Sk.generic.newMethodDef={$meth(t,e){const n=this.prototype;if(1>t.length)throw t=n.tp$name,new Sk.builtin.TypeError(t+".__new__(): not enough arguments");var i=t.shift();if(void 0===i.sk$type)throw t=n.tp$name,new Sk.builtin.TypeError(t+"__new__(X): X is not a type object ("+Sk.abstr.typeName(i)+")");if(!i.$isSubType(this))throw t=n.tp$name,i=i.prototype.tp$name,new Sk.builtin.TypeError(t+".__new__("+i+"): "+i+" is not a subtype of "+t);const s=i.prototype.sk$staticNew.prototype;if(s.tp$new!==n.tp$new)throw t=n.tp$name,i=i.prototype.tp$name,new Sk.builtin.TypeError(t+".__new__("+i+") is not safe, use "+s.tp$name+".__new__()");return n.tp$new.call(i.prototype,t,e)},$flags:{FastCall:!0},$textsig:"($type, *args, **kwargs)",$name:"__new__"},Sk.generic.selfIter=function(){return this},Sk.generic.iterNextWithArrayCheckSize=function(){if(this.$seq.length!==this.$orig.get$size()){const t=this.tp$name.split("_")[0];throw new Sk.builtin.RuntimeError(t+" changed size during iteration")}if(!(this.$index>=this.$seq.length))return this.$seq[this.$index++]},Sk.generic.iterNextWithArray=function(){const t=this.$seq[this.$index++];return void 0===t&&(this.tp$iternext=()=>{}),t},Sk.generic.iterLengthHintWithArrayMethodDef={$meth:function(){return new Sk.builtin.int_(this.$seq.length-this.$index)},$flags:{NoArgs:!0}},Sk.generic.iterReverseLengthHintMethodDef={$meth:function(){return new Sk.builtin.int_(this.$index)},$flags:{NoArgs:!0}},Sk.generic.getSetDict={$get(){return this.$d},$set(t){if(void 0===t)throw new Sk.builtin.TypeError("cannot delete __dict__");if(!(t instanceof Sk.builtin.dict))throw new Sk.builtin.TypeError("__dict__ must be set to a dictionary, not a '"+Sk.abstr.typeName(t)+"'");this.$d=t},$doc:"dictionary for instance variables (if defined)",$name:"__dict__"},Sk.generic.seqCompare=function(t,e){if(this===t&&Sk.misceval.opAllowsEquality(e))return!0;if(!(t instanceof this.sk$builtinBase))return Sk.builtin.NotImplemented.NotImplemented$;const n=this.v;let i;if(t=t.v,n.length!==t.length&&("Eq"===e||"NotEq"===e))return"Eq"!==e;for(i=0;i=s||i>=r)switch(e){case"Lt":return sr;case"GtE":return s>=r;default:Sk.asserts.fail()}return"Eq"!==e&&("NotEq"===e||Sk.misceval.richCompareBool(n[i],t[i],e))},Sk.generic.classGetItem={__class_getitem__:{$meth(t){return new Sk.builtin.GenericAlias(this,t)},$flags:{OneArg:!0}}}},function(t,e){Sk.builtin.pyCheckArgs=function(t,e,n,i,s,r){if(e=e.length,void 0===i&&(i=1/0),s&&--e,r&&--e,ei)throw new Sk.builtin.TypeError((n===i?t+"() takes exactly "+n+" arguments":ei)throw new Sk.builtin.TypeError((n===i?t+"() takes exactly "+n+" arguments":e"};const r={Add:"+",Sub:"-",Mult:"*",MatMult:"@",Div:"/",FloorDiv:"//",Mod:"%",DivMod:"divmod()",Pow:"** or pow()",LShift:"<<",RShift:">>",BitAnd:"&",BitXor:"^",BitOr:"|"},o={UAdd:"+",USub:"-",Invert:"~"};Sk.abstr.numberBinOp=function(t,e,n){var s;if(!(s=i(t,e,n)))throw t=Sk.abstr.typeName(t),e=Sk.abstr.typeName(e),new Sk.builtin.TypeError("unsupported operand type(s) for "+r[n]+": '"+t+"' and '"+e+"'");return s},Sk.exportSymbol("Sk.abstr.numberBinOp",Sk.abstr.numberBinOp),Sk.abstr.numberInplaceBinOp=function(t,e,n){var i;if(!(i=s(t,e,n)))throw t=Sk.abstr.typeName(t),e=Sk.abstr.typeName(e),new Sk.builtin.TypeError("unsupported operand type(s) for "+r[n]+"=: '"+t+"' and '"+e+"'");return i},Sk.exportSymbol("Sk.abstr.numberInplaceBinOp",Sk.abstr.numberInplaceBinOp),Sk.abstr.numberUnaryOp=function(t,e){if("Not"===e)return Sk.misceval.isTrue(t)?Sk.builtin.bool.false$:Sk.builtin.bool.true$;t:{switch(e){case"USub":var n=t.nb$negative;break t;case"UAdd":n=t.nb$positive;break t;case"Invert":n=t.nb$invert;break t}n=void 0}if(!(n=void 0!==n?n.call(t):void 0))throw t=Sk.abstr.typeName(t),new Sk.builtin.TypeError("bad operand type for unary "+o[e]+": '"+t+"'");return n},Sk.exportSymbol("Sk.abstr.numberUnaryOp",Sk.abstr.numberUnaryOp),Sk.abstr.fixSeqIndex_=function(t,e){return 0>(e=Sk.builtin.asnum$(e))&&t.sq$length&&(e+=t.sq$length()),e},Sk.abstr.sequenceContains=function(t,e,n){return t.sq$contains?t.sq$contains(e,n):(t=Sk.misceval.iterFor(Sk.abstr.iter(t),(function(t){return!(t!==e&&!Sk.misceval.richCompareBool(t,e,"Eq"))&&new Sk.misceval.Break(!0)}),!1),n?t:Sk.misceval.retryOptionalSuspensionOrThrow(t))},Sk.abstr.sequenceConcat=function(t,e){if(t.sq$concat)return t.sq$concat(e);if(Sk.builtin.checkSequence(t)&&Sk.builtin.checkSequence(e)&&void 0!==(e=i(t,e,"Add")))return e;throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object can't be concatenated")},Sk.abstr.sequenceInPlaceConcat=function(t,e){if(t.sq$inplace_concat)return t.sq$inplace_concat(e);if(t.sq$concat)return t.sq$concat(e);if(Sk.builtin.checkSequence(t)&&Sk.builtin.checkSequence(e)&&void 0!==(e=s(t,e,"Add")))return e;throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object can't be concatenated")},Sk.abstr.sequenceGetIndexOf=function(t,e){if(t.index)return Sk.misceval.callsimArray(t.index,[t,e]);let n=0;for(let i=Sk.abstr.iter(t),s=i.tp$iternext();void 0!==s;s=i.tp$iternext()){if(Sk.misceval.richCompareBool(e,s,"Eq"))return new Sk.builtin.int_(n);n+=1}throw new Sk.builtin.ValueError("sequence.index(x): x not in sequence")},Sk.abstr.sequenceGetCountOf=function(t,e){if(t.count)return Sk.misceval.callsimArray(t.count,[t,e]);let n=0;for(let i=Sk.abstr.iter(t),s=i.tp$iternext();void 0!==s;s=i.tp$iternext())Sk.misceval.richCompareBool(e,s,"Eq")&&(n+=1);return new Sk.builtin.int_(n)},Sk.abstr.sequenceGetItem=function(t,e,n){return"number"==typeof e&&(e=new Sk.builtin.int_(e)),Sk.abstr.objectGetItem(t,e,n)},Sk.abstr.sequenceSetItem=function(t,e,n,i){return"number"==typeof e&&(e=new Sk.builtin.int_(e)),Sk.abstr.objectSetItem(t,e,n,i)},Sk.abstr.sequenceDelItem=function(t,e,n){return Sk.abstr.objectDelItem(t,e,n)},Sk.abstr.sequenceGetSlice=function(t,e,n){return Sk.abstr.objectGetItem(t,new Sk.builtin.slice(e,n))},Sk.abstr.sequenceDelSlice=function(t,e,n){return Sk.abstr.objectDelItem(t,new Sk.builtin.slice(e,n))},Sk.abstr.sequenceSetSlice=function(t,e,n,i){return Sk.abstr.objectSetItem(t,new Sk.builtin.slice(e,n))},Sk.abstr.sequenceUnpack=function(t,e,n,i){if(!Sk.builtin.checkIterable(t))throw new Sk.builtin.TypeError("cannot unpack non-iterable "+Sk.abstr.typeName(t)+" object");const s=Sk.abstr.iter(t),r=[];let o,a=0;return 0{if(r.push(t),++a===e)return new Sk.misceval.Break}))),Sk.misceval.chain(o,(()=>{if(r.length{if(void 0!==t)throw new Sk.builtin.ValueError("too many values to unpack (expected "+e+")");return r}));const t=[];return Sk.misceval.chain(Sk.misceval.iterFor(s,(e=>{t.push(e)})),(()=>{const i=t.length+e-n;if(0>i)throw new Sk.builtin.ValueError("not enough values to unpack (expected at least "+n+", got "+(n+i)+")");return r.push(new Sk.builtin.list(t.slice(0,i))),r.push(...t.slice(i)),r}))}))},Sk.abstr.mappingUnpackIntoKeywordArray=function(t,e,n){if(!(e instanceof Sk.builtin.dict)){var i=Sk.abstr.lookupSpecial(e,Sk.builtin.str.$keys);if(void 0===i)throw new Sk.builtin.TypeError("Object is not a mapping");return Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(i),(i=>Sk.misceval.iterFor(Sk.abstr.iter(i),(i=>{if(!Sk.builtin.checkString(i))throw new Sk.builtin.TypeError((n.$qualname?n.$qualname+"() ":"")+"keywords must be strings");return Sk.misceval.chain(e.mp$subscript(i,!0),(e=>{t.push(i.v),t.push(e)}))}))))}e.$items().forEach((e=>{var[i,s]=e;if(!Sk.builtin.checkString(i))throw new Sk.builtin.TypeError((n.$qualname?n.$qualname+"() ":"")+"keywords must be strings");t.push(i.v),t.push(s)}))},Sk.abstr.keywordArrayFromPyDict=function(t){const e=[];return t.$items().forEach((t=>{var[n,i]=t;if(!Sk.builtin.checkString(n))throw new Sk.builtin.TypeError("keywords must be strings");e.push(n.toString()),e.push(i)})),e},Sk.abstr.keywordArrayToPyDict=function(t){const e=new Sk.builtin.dict;for(let n=0;ne.length)throw new Sk.builtin.TypeError(t+"() expected at most "+e.length+" arguments ("+r+" given)");if(!i.length&&void 0===s)return n;if(r===e.length&&!i.length)return n;if(0===r&&e.length===(s&&s.length))return s;for(n=n.slice(0),r=0;rvoid 0===n[e]))).length)throw new Sk.builtin.TypeError(t+"() missing "+e.length+" required positional arguments: "+e.join(", "))}return n},Sk.exportSymbol("Sk.abstr.copyKeywordsToNamedArgs",Sk.abstr.copyKeywordsToNamedArgs),Sk.abstr.checkNoKwargs=function(t,e){if(e&&e.length)throw new Sk.builtin.TypeError(t+"() takes no keyword arguments")},Sk.exportSymbol("Sk.abstr.checkNoKwargs",Sk.abstr.checkNoKwargs),Sk.abstr.checkNoArgs=function(t,e,n){if(e=e.length+(n?n.length:0))throw new Sk.builtin.TypeError(t+"() takes no arguments ("+e+" given)")},Sk.exportSymbol("Sk.abstr.checkNoArgs",Sk.abstr.checkNoArgs),Sk.abstr.checkOneArg=function(t,e,n){if(Sk.abstr.checkNoKwargs(t,n),1!==e.length)throw new Sk.builtin.TypeError(t+"() takes exactly one argument ("+e.length+" given)")},Sk.exportSymbol("Sk.abstr.checkOneArg",Sk.abstr.checkOneArg),Sk.abstr.checkArgsLen=function(t,e,n,i){if(void 0===i&&(i=1/0),(e=e.length)i)throw new Sk.builtin.TypeError((n===i?t+"() takes exactly "+n+" arguments":eSk.builtin.str&&Sk.builtin.str.$fixReserved?(a=Sk.builtin.str.$fixReserved,Sk.builtin.str.$fixReserved(t)):t;Sk.abstr.setUpGetSets=function(t,e){if(void 0!==Sk.builtin.getset_descriptor){var n=t.prototype;e=e||n.tp$getsets||{},Object.entries(e).forEach((e=>{var[i,s]=e;s.$name=i,n[a(i)]=new Sk.builtin.getset_descriptor(t,s)})),Object.defineProperty(n,"tp$getsets",{value:null,writable:!0})}},Sk.abstr.setUpMethods=function(t,e){if(void 0!==Sk.builtin.method_descriptor){var n=t.prototype;e=e||n.tp$methods||{},Object.entries(e).forEach((e=>{var[i,s]=e;s.$name=i,n[a(i)]=new Sk.builtin.method_descriptor(t,s)})),Object.defineProperty(n,"tp$methods",{value:null,writable:!0})}},Sk.abstr.setUpClassMethods=function(t,e){if(void 0!==Sk.builtin.classmethod_descriptor){var n=t.prototype;e=e||n.tp$classmethods||{},Object.entries(e).forEach((e=>{var[i,s]=e;s.$name=i,n[a(i)]=new Sk.builtin.classmethod_descriptor(t,s)})),Object.defineProperty(n,"tp$classmethods",{value:null,writable:!0})}};const l={Eq:"ob$eq",NotEq:"ob$ne",Gt:"ob$gt",GtE:"ob$ge",Lt:"ob$lt",LtE:"ob$le"},u=Object.entries(l);Sk.abstr.setUpSlots=function(t,e){function n(e,n){s[e]=new Sk.builtin.wrapper_descriptor(t,Sk.slots[e],n)}function i(t,e){"string"==typeof t?n(t,e):t.forEach((t=>{n(t,e)}))}if(void 0!==Sk.builtin.wrapper_descriptor){var s=t.prototype;(e=e||s.tp$slots||{}).tp$new===Sk.generic.new&&(e.tp$new=Sk.generic.new(t)),e.tp$richcompare?function(t){u.forEach((e=>{var[n,i]=e;t[i]=function(t){return this.tp$richcompare(t,n)}}))}(e):e.ob$eq&&(e.tp$richcompare=function(t,e){return this[l[e]].call(this,t)}),e.tp$as_number&&function(t){const e=Sk.reflectedNumberSlots;Object.keys(e).forEach((n=>{if(void 0!==t[n]){const i=e[n],s=i.reflected,r=t[s];void 0!==r?null===r&&delete t[s]:t[s]=i.slot||t[n]}}))}(e),e.tp$as_sequence_or_mapping&&function(t){const e=Sk.sequenceAndMappingSlots;Object.keys(e).forEach((n=>{void 0!==t[n]&&e[n].forEach((e=>{t[e]=t[n]}))}))}(e),Object.entries(e).forEach((t=>{var[e,n]=t;Object.defineProperty(s,e,{value:n,writable:!0})})),e.tp$new&&(s.__new__=new Sk.builtin.sk_method(Sk.generic.newMethodDef,t),Object.defineProperty(s,"sk$staticNew",{value:t,writable:!0})),Sk.subSlots.main_slots.forEach((t=>{var[n,s]=t;void 0!==(t=e[n])&&i(s,t)}));var r=e.tp$hash;void 0!==r&&("function"==typeof r?n("__hash__",r):r===Sk.builtin.none.none$?s.__hash__=r:Sk.asserts.fail("invalid tp$hash")),e.tp$as_number&&Sk.subSlots.number_slots.forEach((t=>{var[n,s]=t;void 0!==(t=e[n])&&i(s,t)})),e.tp$as_sequence_or_mapping&&Sk.subSlots.sequence_and_mapping_slots.forEach((t=>{var[n,s]=t;void 0!==(t=e[n])&&i(s,t)})),Object.defineProperty(s,"tp$slots",{value:null,writable:!0})}},Sk.abstr.buildNativeClass=function(t,e){e=e||{},Sk.asserts.assert(e.hasOwnProperty("constructor"),"A constructor is required to build a native class");let n=e.constructor;Sk.abstr.setUpInheritance(t,n,e.base,e.meta),Sk.abstr.setUpBuiltinMro(n);const i=n.prototype;return Object.defineProperties(i,{tp$slots:{value:e.slots,writable:!0},tp$getsets:{value:e.getsets,writable:!0},tp$methods:{value:e.methods,writable:!0},tp$classmethods:{value:e.classmethods,writable:!0}}),Sk.abstr.setUpSlots(n,e.slots||{}),Sk.abstr.setUpMethods(n,e.methods),Sk.abstr.setUpGetSets(n,e.getsets),Sk.abstr.setUpClassMethods(n,e.classmethods),Object.entries(e.proto||{}).forEach((t=>{var[e,n]=t;Object.defineProperty(i,e,{value:n,writable:!0,enumerable:!(e.includes("$")||e in Object.prototype)})})),Object.entries(e.flags||{}).forEach((t=>{var[e,i]=t;Object.defineProperty(n,e,{value:i,writable:!0})})),i.hasOwnProperty("tp$iter")&&(i[Symbol.iterator]=function(){return this.tp$iter()[Symbol.iterator]()}),void 0!==Sk.builtin.str&&i.hasOwnProperty("tp$doc")&&!i.hasOwnProperty("__doc__")&&(t=i.tp$doc||null,i.__doc__="string"==typeof t?new Sk.builtin.str(t):Sk.builtin.none.none$),n},Sk.abstr.buildIteratorClass=function(t,e){return Sk.asserts.assert(e.hasOwnProperty("constructor"),"must provide a constructor"),e.slots=e.slots||{},e.slots.tp$iter=Sk.generic.selfIter,e.slots.tp$iternext=e.slots.tp$iternext||e.iternext,e.slots.tp$getattr=e.slots.tp$getattr||Sk.generic.getAttr,t=Sk.abstr.buildNativeClass(t,e),Sk.abstr.built$iterators.push(t),t.prototype[Symbol.iterator]=function(){return{next:()=>{const t=this.tp$iternext();return{value:t,done:void 0===t}}}},t},Sk.abstr.built$iterators=[],Sk.abstr.setUpModuleMethods=function(t,e,n){return Object.entries(n).forEach((n=>{var[i,s]=n;s.$name=s.$name||i,e[i]=new Sk.builtin.sk_method(s,null,t)})),e},Sk.abstr.superConstructor=function(t,e,n){var i=Array.prototype.slice.call(arguments,2);t.prototype.tp$base.apply(e,i)}},function(t,e){function n(t){const e=t.prototype,n=e.tp$base;if(null==n)return!1;const i=n.prototype;return!(n.sk$solidSlotBase||t.sk$solidSlotBase||i.sk$hasDict!==e.sk$hasDict||n.sk$solidBase&&n!==Sk.builtin.module)}const i=new WeakMap;Sk.builtin.object=Sk.abstr.buildNativeClass("object",{constructor:function(){Sk.asserts.assert(this instanceof Sk.builtin.object,"bad call to object, use 'new'")},base:null,slots:{tp$new(t,e){if(t.length||e&&e.length){if(this.tp$new!==Sk.builtin.object.prototype.tp$new)throw new Sk.builtin.TypeError("object.__new__() takes exactly one argument (the type to instantiate)");if(this.tp$init===Sk.builtin.object.prototype.tp$init)throw new Sk.builtin.TypeError(Sk.abstr.typeName(this)+"() takes no arguments")}return new this.constructor},tp$init(t,e){if(t.length||e&&e.length){if(this.tp$init!==Sk.builtin.object.prototype.tp$init)throw new Sk.builtin.TypeError("object.__init__() takes exactly one argument (the instance to initialize)");if(this.tp$new===Sk.builtin.object.prototype.tp$new)throw new Sk.builtin.TypeError(Sk.abstr.typeName(this)+".__init__() takes exactly one argument (the instance to initialize)")}},tp$getattr:Sk.generic.getAttr,tp$setattr:Sk.generic.setAttr,$r(){const t=Sk.abstr.lookupSpecial(this,Sk.builtin.str.$module);let e="";return t&&Sk.builtin.checkString(t)&&(e=t.v+"."),new Sk.builtin.str("<"+e+Sk.abstr.typeName(this)+" object>")},tp$str(){return this.$r()},tp$hash(){let t=i.get(this);return void 0!==t||(t=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER-Number.MAX_SAFE_INTEGER/2),i.set(this,t)),t},tp$richcompare(t,e){switch(e){case"Eq":t=this===t||Sk.builtin.NotImplemented.NotImplemented$;break;case"NotEq":(t=this.ob$eq(t,"Eq"))!==Sk.builtin.NotImplemented.NotImplemented$&&(t=!Sk.misceval.isTrue(t));break;default:t=Sk.builtin.NotImplemented.NotImplemented$}return t},tp$doc:"The most base type"},getsets:{__class__:{$get(){return this.ob$type},$set(t){if(void 0===t)throw new Sk.builtin.TypeError("can't delete __class__ attribute");if(!Sk.builtin.checkClass(t))throw new Sk.builtin.TypeError("__class__ must be set to a class, not '"+Sk.abstr.typeName(t)+"' object");const e=this.ob$type;if(!(e.$isSubType(Sk.builtin.module)&&t.$isSubType(Sk.builtin.module)||void 0!==e.prototype.ht$type&&void 0!==t.prototype.ht$type))throw new Sk.builtin.TypeError(" __class__ assignment only supported for heap types or ModuleType subclasses");{let i=e,s=t;for(;n(i);)i=i.prototype.tp$base;for(;n(s);)s=s.prototype.tp$base;if(i!==s&&(i.prototype.tp$base!==s.prototype.tp$base||!function(t,e){t=t.prototype,e=e.prototype;const n=t.ht$slots,i=e.ht$slots;return t.sk$hasDict===e.sk$hasDict&&(n===i||(n&&i?n.length===i.length&&n.every(((t,e)=>t===i[e])):(n&&(n.length||null))===(i&&(i.length||null))))}(i,s)))throw new Sk.builtin.TypeError("__class__ assignment: '"+t.prototype.tp$name+"' object layout differs from '"+e.prototype.tp$name+"'")}Object.setPrototypeOf(this,t.prototype)},$doc:"the object's class"}},methods:{__dir__:{$meth:function(){let t=Sk.abstr.lookupAttr(this,Sk.builtin.str.$dict);t=void 0===t?new Sk.builtin.dict([]):t instanceof Sk.builtin.dict?t.dict$copy():new Sk.builtin.dict([]);const e=Sk.abstr.lookupAttr(this,Sk.builtin.str.$class);return void 0!==e&&e.$mergeClassDict(t),new Sk.builtin.list(t.sk$asarray())},$flags:{NoArgs:!0},$doc:"Default dir() implementation."},__format__:{$meth(t){if(!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("__format__() argument must be str, not "+Sk.abstr.typeName(t));if(t!==Sk.builtin.str.$empty)throw new Sk.builtin.TypeError(`unsupported format string passed to ${Sk.abstr.typeName(this)}.__format__`);return this.tp$str()},$flags:{OneArg:!0},$doc:"Default object formatter."}},classmethods:{__init_subclass__:{$meth:t=>Sk.builtin.none.none$,$flags:{FastCall:!0,NoKwargs:!0}}},proto:{valueOf:Object.prototype.valueOf,toString(){return this.tp$str().v},hasOwnProperty:Object.prototype.hasOwnProperty,ht$type:void 0,sk$attrError(){return"'"+this.tp$name+"' object"},$mergeClassDict(t){var e=Sk.abstr.lookupAttr(this,Sk.builtin.str.$dict);if(void 0!==e&&t.dict$merge(e),void 0!==(e=Sk.abstr.lookupAttr(this,Sk.builtin.str.$bases))){var n=Sk.builtin.len(e).valueOf();for(let i=0;ivoid 0===t?Sk.builtin.none.none$:t))}function r(t,e,n){return Sk.abstr.checkNoKwargs(this.$name,n),Sk.abstr.checkArgsLen(this.$name,e,1,2),void 0===(t=this.call(t,...e))?Sk.builtin.none.none$:t}function o(t,e,n){return Sk.abstr.checkNoKwargs(this.$name,n),Sk.abstr.checkArgsLen(this.$name,e,2,2),Sk.misceval.chain(this.call(t,e[0],e[1],!0),(()=>Sk.builtin.none.none$))}function a(t,e,n){return Sk.abstr.checkOneArg(this.$name,e,n),t=this.call(t,e[0],void 0,!0),Sk.misceval.chain(t,(t=>void 0===t?Sk.builtin.none.none$:t))}function l(t,e,n){return(t=i.call(this,t,e,n))===Sk.builtin.NotImplemented.NotImplemented$?t:new Sk.builtin.bool(t)}function u(t,e,n){return function(i,s,r){return i=t.call(this,i,s,r),n?Sk.misceval.chain(i,e):e(Sk.misceval.retryOptionalSuspensionOrThrow(i))}}function c(t){return function(){const e=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return Sk.misceval.callsimArray(e,[])}}function p(t,e,n,i){return function(s){return function(){var r=s.tp$descr_get?s.tp$descr_get(this,this.ob$type):s;if(r=Sk.misceval.callsimArray(r,[]),!e(r))throw new Sk.builtin.TypeError(t+" should return "+n+" (returned "+Sk.abstr.typeName(r)+")");return void 0!==i?i(r):r}}}function h(t){return function(e){const n=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return Sk.misceval.callsimArray(n,[e])}}function _(t,e){let n=this.ob$type.$typeLookup(Sk.builtin.str.$getattribute);if(n instanceof Sk.builtin.wrapper_descriptor)return n.d$wrapped.call(this,t,e);n.tp$descr_get&&(n=n.tp$descr_get(this,this.ob$type));const i=Sk.misceval.tryCatch((()=>Sk.misceval.callsimOrSuspendArray(n,[t])),(t=>{if(!(t instanceof Sk.builtin.AttributeError))throw t}));return e?i:Sk.misceval.retryOptionalSuspensionOrThrow(i)}function d(t,e,n){return function(i){return function(i,s,r){let o;void 0===s?(o=e,n=null):o=t;let a=this.ob$type.$typeLookup(new Sk.builtin.str(o));if(a instanceof Sk.builtin.wrapper_descriptor)return a.d$wrapped.call(this,i,s);if(a.tp$descr_get&&(a=a.tp$descr_get(this,this.ob$type,r)),void 0===a){if(n)throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(this)+"' object "+n);throw new Sk.builtin.AttributeError(o)}return i=Sk.misceval.callsimOrSuspendArray(a,void 0===s?[i]:[i,s]),r?i:Sk.misceval.retryOptionalSuspensionOrThrow(i)}}}function f(t,e){let n=t.ob$type;for(;n&&void 0!==n.sk$klass;)n=n.prototype.tp$base;if(n&&n.prototype.tp$setattr!==e)throw new Sk.builtin.TypeError("can't apply this "+e.$name+" to "+Sk.abstr.typeName(t)+" object")}Sk.slots=Object.create(null),t=Sk.slots,Sk.slots.__init__={$name:"__init__",$slot_name:"tp$init",$slot_func:function(t){return function(e,n){const i=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return e=Sk.misceval.callsimOrSuspendArray(i,e,n),Sk.misceval.chain(e,(t=>{if(!Sk.builtin.checkNone(t)&&void 0!==t)throw new Sk.builtin.TypeError("__init__() should return None, not "+Sk.abstr.typeName(t))}))}},$wrapper:function(t,e,n){return this.call(t,e,n),Sk.builtin.none.none$},$textsig:"($self, /, *args, **kwargs)",$flags:{FastCall:!0},$doc:"Initialize self. See help(type(self)) for accurate signature."},t.__new__={$name:"__new__",$slot_name:"tp$new",$slot_func:function(t){const e=function(e,n){let i=t;return t.tp$descr_get&&(i=t.tp$descr_get(null,this.constructor)),Sk.misceval.callsimOrSuspendArray(i,[this.constructor,...e],n)};return e.sk$static_new=!1,e},$wrapper:null,$textsig:"($self, /, *args, **kwargs)",$flags:{FastCall:!0},$doc:"Create and return a new object."},t.__call__={$name:"__call__",$slot_name:"tp$call",$slot_func:function(t){return function(e,n){const i=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return Sk.misceval.callsimOrSuspendArray(i,e,n)}},$wrapper:function(t,e,n){return void 0===(t=t.tp$call(e,n))?Sk.builtin.none.none$:t},$textsig:"($self, /, *args, **kwargs)",$flags:{FastCall:!0},$doc:"Call self as a function."},t.__repr__={$name:"__repr__",$slot_name:"$r",$slot_func:p("__repr__",Sk.builtin.checkString,"str"),$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Return repr(self)."},t.__str__={$name:"__str__",$slot_name:"tp$str",$slot_func:p("__str__",Sk.builtin.checkString,"str"),$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Return str(self)."};var m=p("__hash__",Sk.builtin.checkInt,"int",(t=>"number"==typeof t.v?t.v:t.tp$hash()));t.__hash__={$name:"__hash__",$slot_name:"tp$hash",$slot_func:function(t){return t===Sk.builtin.none.none$?Sk.builtin.none.none$:m(t)},$wrapper:u(n,(t=>new Sk.builtin.int_(t))),$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Return hash(self)."},t.__getattribute__={$name:"__getattribute__",$slot_name:"tp$getattr",$slot_func:function(t){return function(t,e){let n=this.ob$type.$typeLookup(Sk.builtin.str.$getattr);if(void 0===n)return _.call(this,t,e);const i=Sk.misceval.chain(_.call(this,t,e),(e=>Sk.misceval.tryCatch((()=>void 0!==e?e:(n.tp$descr_get&&(n=n.tp$descr_get(this,this.ob$type)),Sk.misceval.callsimOrSuspendArray(n,[t]))),(function(t){if(!(t instanceof Sk.builtin.AttributeError))throw t}))));return e?i:Sk.misceval.retryOptionalSuspensionOrThrow(i)}},$wrapper:function(t,e,n){Sk.abstr.checkOneArg(this.$name,e,n);const i=e[0];if(!Sk.builtin.checkString(i))throw new Sk.builtin.TypeError("attribute name must be string, not '"+Sk.abstr.typeName(i)+"'");return e=this.call(t,i,!0),Sk.misceval.chain(e,(e=>{if(void 0===e)throw new Sk.builtin.AttributeError(Sk.abstr.typeName(t)+" has no attribute "+i.$jsstr());return e}))},$textsig:"($self, name, /)",$flags:{OneArg:!0},$doc:"Return getattr(self, name)."},t.__getattr__={$name:"__getattr__",$slot_name:"tp$getattr",$slot_func:t.__getattribute__.$slot_func,$wrapper:null,$textsig:"($self, name, /)",$flags:{OneArg:!0},$doc:"Return getattr(self, name)."},t.__setattr__={$name:"__setattr__",$slot_name:"tp$setattr",$slot_func:d("__setattr__","__delattr__"),$wrapper:function(t,e,n){return Sk.abstr.checkNoKwargs(this.$name,n),Sk.abstr.checkArgsLen(this.$name,e,2,2),f(t,this),Sk.misceval.chain(this.call(t,e[0],e[1],!0),(()=>Sk.builtin.none.none$))},$textsig:"($self, name, value, /)",$flags:{MinArgs:2,MaxArgs:2},$doc:"Implement setattr(self, name, value)."},t.__delattr__={$name:"__delattr__",$slot_name:"tp$setattr",$slot_func:t.__setattr__.$slot_func,$wrapper:function(t,e,n){return Sk.abstr.checkOneArg(this.$name,e,n),f(t,this),this.call(t,e[0]),Sk.builtin.none.none$},$textsig:"($self, name, /)",$flags:{OneArg:!0},$doc:"Implement delattr(self, name)."},t.__get__={$name:"__get__",$slot_name:"tp$descr_get",$slot_func:function(t){return function(e,n,i){null===e&&(e=Sk.builtin.none.none$),null==n&&(n=Sk.builtin.none.none$);const s=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return e=Sk.misceval.callsimOrSuspendArray(s,[e,n]),i?e:Sk.misceval.retryOptionalSuspensionOrThrow(e)}},$wrapper:function(t,e,n){if(Sk.abstr.checkNoKwargs(this.$name,n),Sk.abstr.checkArgsLen(this.$name,e,1,2),n=e[0],e=e[1],n===Sk.builtin.none.none$&&(n=null),e===Sk.builtin.none.none$&&(e=null),null===e&&null===n)throw new Sk.builtin.TypeError("__get__(None, None) is invalid");return this.call(t,n,e,!0)},$textsig:"($self, instance, owner, /)",$flags:{MinArgs:2,MaxArgs:2},$doc:"Return an attribute of instance, which is of type owner."},t.__set__={$name:"__set__",$slot_name:"tp$descr_set",$slot_func:d("__set__","__delete__"),$wrapper:o,$textsig:"($self, instance, value, /)",$flags:{MinArgs:2,MaxArgs:2},$doc:"Set an attribute of instance to value."},t.__delete__={$name:"__delete__",$slot_name:"tp$descr_set",$slot_func:t.__set__.$slot_func,$wrapper:a,$textsig:"($self, instance, /)",$flags:{OneArg:!0},$doc:"Delete an attribute of instance."},t.__eq__={$name:"__eq__",$slot_name:"ob$eq",$slot_func:h,$wrapper:l,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self==value."},t.__ge__={$name:"__ge__",$slot_name:"ob$ge",$slot_func:h,$wrapper:l,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self>=value."},t.__gt__={$name:"__gt__",$slot_name:"ob$gt",$slot_func:h,$wrapper:l,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self>value."},t.__le__={$name:"__le__",$slot_name:"ob$le",$slot_func:h,$wrapper:l,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self<=value."},t.__lt__={$name:"__lt__",$slot_name:"ob$lt",$slot_func:h,$wrapper:l,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return selfSk.misceval.callsimOrSuspendArray(n,[])),(t=>{if(!(t instanceof Sk.builtin.StopIteration))throw t;this.gi$ret=t.$value}));return e?i:Sk.misceval.retryOptionalSuspensionOrThrow(i)}},$wrapper:function(t,e,n){return Sk.abstr.checkNoArgs(this.$name,e,n),Sk.misceval.chain(t.tp$iternext(!0),(t=>{if(void 0===t)throw new Sk.builtin.StopIteration;return t}))},$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Implement next(self)."},t.__len__={$name:"__len__",$slot_name:"sq$length",$slot_func:function(t){return function(e){const n=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return e?(e=Sk.misceval.callsimOrSuspendArray(n,[]),Sk.misceval.chain(e,(t=>Sk.misceval.asIndexOrThrow(t)))):(e=Sk.misceval.callsimArray(n,[]),Sk.misceval.asIndexOrThrow(e))}},$wrapper:u((function(t,e,n){return Sk.abstr.checkNoArgs(this.$name,e,n),t=this.call(t,!0),Sk.misceval.chain(t,(t=>void 0===t?Sk.builtin.none.none$:t))}),(t=>new Sk.builtin.int_(t)),!0),$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return len(self)."},t.__contains__={$name:"__contains__",$slot_name:"sq$contains",$slot_func:function(t){return function(e,n){const i=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return e=Sk.misceval.callsimOrSuspendArray(i,[e]),(e=Sk.misceval.chain(e,(t=>Sk.misceval.isTrue(t)))).$isSuspension?n?e:Sk.misceval.retryOptionalSuspensionOrThrow(e):e}},$wrapper:u(s,(t=>new Sk.builtin.bool(t)),!0),$textsig:"($self, key, /)",$flags:{OneArg:!0},$doc:"Return key in self."},t.__getitem__={$name:"__getitem__",$slot_name:"mp$subscript",$slot_func:function(t){return function(e,n){const i=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return e=Sk.misceval.callsimOrSuspendArray(i,[e]),n?e:Sk.misceval.retryOptionalSuspensionOrThrow(e)}},$wrapper:s,$textsig:"($self, key, /)",$flags:{OneArg:!0},$doc:"Return self[key]."},t.__setitem__={$name:"__setitem__",$slot_name:"mp$ass_subscript",$slot_func:d("__setitem__","__delitem__","does not support item assignment"),$wrapper:o,$textsig:"($self, key, value, /)",$flags:{MinArgs:2,MaxArgs:2},$doc:"Set self[key] to value."},t.__delitem__={$name:"__delitem__",$slot_name:"mp$ass_subscript",$slot_func:t.__setitem__.$slot_func,$wrapper:a,$textsig:"($self, key, /)",$flags:{OneArg:!0},$doc:"Delete self[key]."},t.__add__={$name:"__add__",$slot_name:"nb$add",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self+value."},t.__radd__={$name:"__radd__",$slot_name:"nb$reflected_add",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value+self."},t.__iadd__={$name:"__iadd__",$slot_name:"nb$inplace_add",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self+=value."},t.__sub__={$name:"__sub__",$slot_name:"nb$subtract",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self-value."},t.__rsub__={$name:"__rsub__",$slot_name:"nb$reflected_subtract",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value-self."},t.__imul__={$name:"__imul__",$slot_name:"nb$inplace_multiply",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self*=value."},t.__mul__={$name:"__mul__",$slot_name:"nb$multiply",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self*value."},t.__rmul__={$name:"__rmul__",$slot_name:"nb$reflected_multiply",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value*self."},t.__isub__={$name:"__isub__",$slot_name:"nb$inplace_subtract",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self-=value."},t.__mod__={$name:"__mod__",$slot_name:"nb$remainder",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self%value."},t.__rmod__={$name:"__rmod__",$slot_name:"nb$reflected_remainder",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value%self."},t.__imod__={$name:"__imod__",$slot_name:"nb$inplace_remainder",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement value%=self."},t.__divmod__={$name:"__divmod__",$slot_name:"nb$divmod",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return divmod(self, value)."},t.__rdivmod__={$name:"__rdivmod__",$slot_name:"nb$reflected_divmod",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return divmod(value, self)"},t.__pos__={$name:"__pos__",$slot_name:"nb$positive",$slot_func:c,$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"+self"},t.__neg__={$name:"__neg__",$slot_name:"nb$negative",$slot_func:c,$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"-self"},t.__abs__={$name:"__abs__",$slot_name:"nb$abs",$slot_func:c,$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"abs(self)"},t.__bool__={$name:"__bool__",$slot_name:"nb$bool",$slot_func:p("__bool__",Sk.builtin.checkBool,"bool",(t=>0!==t.v)),$wrapper:u(n,(t=>new Sk.builtin.bool(t))),$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"self != 0"},t.__invert__={$name:"__invert__",$slot_name:"nb$invert",$slot_func:c,$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"~self"},t.__lshift__={$name:"__lshift__",$slot_name:"nb$lshift",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self<>value."},t.__rrshift__={$name:"__rrshift__",$slot_name:"nb$reflected_rshift",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value>>self."},t.__ilshift__={$name:"__ilshift__",$slot_name:"nb$inplace_lshift",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self<<=value."},t.__irshift__={$name:"__irshift__",$slot_name:"nb$inplace_rshift",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self=>>value."},t.__and__={$name:"__and__",$slot_name:"nb$and",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self&value."},t.__rand__={$name:"__rand__",$slot_name:"nb$refelcted_and",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value&self."},t.__iand__={$name:"__iand__",$slot_name:"nb$and",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self&=value."},t.__xor__={$name:"__xor__",$slot_name:"nb$xor",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self^value."},t.__rxor__={$name:"__rxor__",$slot_name:"nb$reflected_xor",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value^self."},t.__ixor__={$name:"__ixor__",$slot_name:"nb$inplace_xor",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self^=value."},t.__or__={$name:"__or__",$slot_name:"nb$or",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self|value."},t.__ror__={$name:"__ror__",$slot_name:"nb$reflected_or",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value|self."},t.__ior__={$name:"__ior__",$slot_name:"nb$inplace_or",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self|=value."},t.__int__={$name:"__int__",$slot_name:"nb$int",$slot_func:p("__int__",Sk.builtin.checkInt,"int"),$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"int(self)"},t.__float__={$name:"__float__",$slot_name:"nb$float",$slot_func:p("__float__",Sk.builtin.checkFloat,"float"),$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"float(self)"},t.__floordiv__={$name:"__floordiv__",$slot_name:"nb$floor_divide",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self//value."},t.__rfloordiv__={$name:"__rfloordiv__",$slot_name:"nb$reflected_floor_divide",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value//self."},t.__ifloordiv__={$name:"__ifloordiv__",$slot_name:"nb$inplace_floor_divide",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self//=value."},t.__truediv__={$name:"__truediv__",$slot_name:"nb$divide",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self/value."},t.__rtruediv__={$name:"__rtruediv__",$slot_name:"nb$reflected_divide",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value/self."},t.__itruediv__={$name:"__itruediv__",$slot_name:"nb$inplace_divide",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self/=value."},t.__index__={$name:"__index__",$slot_name:"nb$index",$slot_func:p("__index__",Sk.builtin.checkInt,"int",(t=>t.v)),$wrapper:u(n,(t=>new Sk.builtin.int_(t))),$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Return self converted to an integer, if self is suitable for use as an index into a list."},t.__pow__={$name:"__pow__",$slot_name:"nb$power",$slot_func:function(t){return function(e,n){const i=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return null==n?Sk.misceval.callsimArray(i,[e]):Sk.misceval.callsimArray(i,[e,n])}},$wrapper:r,$textsig:"($self, value, mod=None, /)",$flags:{MinArgs:1,MaxArgs:2},$doc:"Return pow(self, value, mod)."},t.__rpow__={$name:"__rpow__",$slot_name:"nb$reflected_power",$slot_func:t.__pow__.$slot_func,$wrapper:r,$textsig:"($self, value, mod=None, /)",$flags:{MinArgs:1,MaxArgs:2},$doc:"Return pow(value, self, mod)."},t.__ipow__={$name:"__ipow__",$slot_name:"nb$inplace_power",$slot_func:t.__pow__.$slot_func,$wrapper:r,$textsig:"($self, value, mod=None, /)",$flags:{MinArgs:1,MaxArgs:2},$doc:"Implement **="},t.__matmul__={$name:"__matmul__",$slot_name:"nb$matrix_multiply",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self@value."},t.__rmatmul__={$name:"__rmatmul__",$slot_name:"nb$reflected_matrix_multiply",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value@self."},t.__imatmul__={$name:"__imatmul__",$slot_name:"nb$inplace_matrix_multiply",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self@=value."},t.__long__={$name:"__long__",$slot_name:"nb$long",$slot_func:p("__long__",Sk.builtin.checkInt,"int"),$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"int(self)"};var g,b={next:{$name:"next",$slot_name:"tp$iternext",$slot_func:t.__next__.$slot_func,$wrapper:t.__next__.$wrapper,$textsig:t.__next__.$textsig,$flags:t.__next__.$flags},__nonzero__:{$name:"__nonzero__",$slot_name:"nb$bool",$slot_func:p("__nonzero__",Sk.builtin.checkInt,"int",(t=>0!==t.v)),$wrapper:u(n,(t=>new Sk.builtin.bool(t))),$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"x.__nonzero__() <==> x != 0"},__div__:{$name:"__div__",$slot_name:"nb$divide",$slot_func:h,$wrapper:i,$textsig:"($self, other/)",$flags:{OneArg:!0},$doc:"x.__div__(y) <==> x/y"},__rdiv__:{$name:"__rdiv__",$slot_name:"nb$reflected_divide",$slot_func:h,$wrapper:i,$textsig:"($self, other/)",$flags:{OneArg:!0},$doc:"x.__rdiv__(y) <==> x/y"},__idiv__:{$name:"__idiv__",$slot_name:"nb$inplace_divide",$slot_func:h,$wrapper:i,$textsig:"($self, other/)",$flags:{OneArg:!0},$doc:"implement self /= other"}};Sk.subSlots={main_slots:Object.entries({tp$init:"__init__",tp$call:"__call__",$r:"__repr__",tp$str:"__str__",tp$getattr:"__getattribute__",tp$setattr:["__setattr__","__delattr__"],ob$eq:"__eq__",ob$ne:"__ne__",ob$lt:"__lt__",ob$le:"__le__",ob$gt:"__gt__",ob$ge:"__ge__",tp$descr_get:"__get__",tp$descr_set:["__set__","__delete__"],tp$iter:"__iter__",tp$iternext:"__next__"}),number_slots:Object.entries({nb$abs:"__abs__",nb$negative:"__neg__",nb$positive:"__pos__",nb$int:"__int__",nb$long:"__long__",nb$float:"__float__",nb$index:"__index__",nb$add:"__add__",nb$reflected_add:"__radd__",nb$inplace_add:"__iadd__",nb$subtract:"__sub__",nb$reflected_subtract:"__rsub__",nb$inplace_subtract:"__isub__",nb$multiply:"__mul__",nb$reflected_multiply:"__rmul__",nb$inplace_multiply:"__imul__",nb$floor_divide:"__floordiv__",nb$reflected_floor_divide:"__rfloordiv__",nb$inplace_floor_divide:"__ifloordiv__",nb$invert:"__invert__",nb$remainder:"__mod__",nb$reflected_remainder:"__rmod__",nb$inplace_remainder:"__imod__",nb$divmod:"__divmod__",nb$reflected_divmod:"__rdivmod__",nb$power:"__pow__",nb$reflected_power:"__rpow__",nb$inplace_power:"__ipow__",nb$divide:"__truediv__",nb$reflected_divide:"__rtruediv__",nb$inplace_divide:"__itruediv__",nb$bool:"__bool__",nb$and:"__and__",nb$reflected_and:"__rand__",nb$inplace_and:"__iand__",nb$or:"__or__",nb$reflected_or:"__ror__",nb$inplace_or:"__ior__",nb$xor:"__xor__",nb$reflected_xor:"__rxor__",nb$inplace_xor:"__ixor__",nb$lshift:"__lshift__",nb$reflected_lshift:"__rlshift__",nb$rshift:"__rshift__",nb$reflected_rshift:"__rrshift__",nb$inplace_lshift:"__ilshift__",nb$inplace_rshift:"__irshift__",nb$matrix_multiply:"__matmul__",nb$reflected_matrix_multiply:"__rmatmul__",nb$inplace_matrix_multiply:"__imatmul__"}),sequence_and_mapping_slots:Object.entries({sq$length:"__len__",sq$contains:"__contains__",mp$subscript:"__getitem__",mp$ass_subscript:["__setitem__","__delitem__"],nb$add:"__add__",nb$multiply:"__mul__",nb$reflected_multiply:"__rmul__",nb$inplace_add:"__iadd__",nb$inplace_multiply:"__imul__"})},Sk.reflectedNumberSlots={nb$add:{reflected:"nb$reflected_add"},nb$subtract:{reflected:"nb$reflected_subtract",slot:function(t){return t instanceof this.constructor?t.nb$subtract(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$multiply:{reflected:"nb$reflected_multiply"},nb$divide:{reflected:"nb$reflected_divide",slot:function(t){return t instanceof this.constructor?t.nb$divide(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$floor_divide:{reflected:"nb$reflected_floor_divide",slot:function(t){return t instanceof this.constructor?t.nb$floor_divide(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$remainder:{reflected:"nb$reflected_remainder",slot:function(t){return t instanceof this.constructor?t.nb$remainder(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$divmod:{reflected:"nb$reflected_divmod",slot:function(t){return t instanceof this.constructor?t.nb$divmod(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$power:{reflected:"nb$reflected_power",slot:function(t,e){return t instanceof this.constructor?t.nb$power(this,e):Sk.builtin.NotImplemented.NotImplemented$}},nb$and:{reflected:"nb$reflected_and"},nb$or:{reflected:"nb$reflected_or"},nb$xor:{reflected:"nb$reflected_xor"},nb$lshift:{reflected:"nb$reflected_lshift",slot:function(t){return t instanceof this.constructor?t.nb$lshift(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$rshift:{reflected:"nb$reflected_rshift",slot:function(t){return t instanceof this.constructor?t.nb$rshift(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$matrix_multiply:{reflected:"nb$reflexted_matrix_multiply",slot:function(t){return t instanceof this.constructor?t.nb$matrix_multiply(this):Sk.builtin.NotImplemented.NotImplemented$}}},Sk.sequenceAndMappingSlots={sq$concat:["nb$add"],sq$repeat:["nb$multiply","nb$reflected_multiply"],mp$length:["sq$length"],sq$inplace_repeat:["nb$inplace_multiply"],sq$inplace_concat:["nb$inplace_add"]},Sk.dunderToSkulpt={__repr__:"$r",__str__:"tp$str",__init__:"tp$init",__new__:"tp$new",__hash__:"tp$hash",__call__:"tp$call",__iter__:"tp$iter",__next__:"tp$iternext",__eq__:"ob$eq",__ne__:"ob$ne",__lt__:"ob$lt",__le__:"ob$le",__gt__:"ob$gt",__ge__:"ob$ge",__abs__:"nb$abs",__neg__:"nb$negative",__pos__:"nb$positive",__int__:"nb$int",__float__:"nb$float",__index__:"nb$index",__add__:"nb$add",__radd__:"nb$reflected_add",__iadd__:"nb$inplace_add",__sub__:"nb$subtract",__rsub__:"nb$reflected_subtract",__isub__:"nb$inplace_subtract",__mul__:"nb$multiply",__rmul__:"nb$reflected_multiply",__imul__:"nb$inplace_multiply",__truediv__:"nb$divide",__rtruediv__:"nb$reflected_divide",__itruediv__:"nb$inplace_divide",__floordiv__:"nb$floor_divide",__rfloordiv__:"nb$reflected_floor_divide",__ifloordiv__:"nb$inplace_floor_divide",__invert__:"nb$invert",__mod__:"nb$remainder",__rmod__:"nb$reflected_remainder",__imod__:"nb$inplace_remainder",__divmod__:"nb$divmod",__rdivmod__:"nb$reflected_divmod",__pow__:"nb$power",__rpow__:"nb$reflected_power",__ipow__:"nb$inplace_power",__bool__:"nb$bool",__long__:"nb$long",__lshift__:"nb$lshift",__rlshift__:"nb$reflected_lshift",__ilshift__:"nb$inplace_lshift",__rshift__:"nb$rshift",__rrshift__:"nb$reflected_rshift",__irshift__:"nb$inplace_rshift",__and__:"nb$and",__rand__:"nb$reflected_and",__iand__:"nb$inplace_and",__or__:"nb$or",__ror__:"nb$reflected_or",__ior__:"nb$inplace_or",__xor__:"nb$xor",__rxor__:"nb$reflected_xor",__ixor__:"nb$inplace_xor",__matmul__:"nb$matrix_multiply",__rmatmul__:"nb$reflected_matrix_multiply",__imatmul__:"nb$inplace_matrix_multiply",__get__:"tp$descr_get",__set__:"tp$descr_set",__delete__:"tp$descr_set",__getattribute__:"tp$getattr",__getattr__:"tp$getattr",__setattr__:"tp$setattr",__delattr__:"tp$setattr",__len__:"sq$length",__contains__:"sq$contains",__getitem__:"mp$subscript",__setitem__:"mp$ass_subscript",__delitem__:"mp$ass_subscript"},Sk.exportSymbol("Sk.setupDunderMethods",Sk.setupDunderMethods),Sk.setupDunderMethods=function(t){function e(t,e,n){for(let i=0;i"tp$iternext"===t[0])),l=r.findIndex((t=>"nb$bool"===t[0])),u=Sk.dunderToSkulpt;if(t){u.__bool__="nb$bool",u.__next__="tp$iternext",delete u.__nonzero__,delete u.__div__,delete u.__rdiv__,delete u.__idiv__,delete u.next;for(let t in g)n[t]=g[t];for(let t in b)delete n[t];for(t=0;t")}const o={__doc__:{$get(){return this.d$def.$doc?new Sk.builtin.str(this.d$def.$doc):Sk.builtin.none.none$}},__objclass__:{$get(){return this.d$type}},__name__:{$get(){return new Sk.builtin.str(this.d$name)}}};t={__text_signature__:{$get(){return this.d$def.$textsig?new Sk.builtin.str(this.d$def.$textsig):Sk.builtin.none.none$}}},Sk.builtin.getset_descriptor=n("getset_descriptor",void 0,{constructor:function(t,e){this.d$def=e,this.$get=e.$get,this.$set=e.$set,this.d$type=t,this.d$name=e.$name},slots:{tp$descr_get(t,e,n){if(e=this.d$check(t))return e;if(void 0!==this.$get)return t=this.$get.call(t),n?t:Sk.misceval.retryOptionalSuspensionOrThrow(t);throw new Sk.builtin.AttributeError("getset_descriptor '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' objects is not readable")},tp$descr_set(t,e,n){if(this.d$set_check(t),void 0!==this.$set)return t=this.$set.call(t,e),n?t:Sk.misceval.retryOptionalSuspensionOrThrow(t);throw new Sk.builtin.AttributeError("attribute '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' objects is readonly")}}}),Sk.builtin.method_descriptor=n("method_descriptor","method",{constructor:function(t,e){this.d$def=e,this.$meth=e.$meth,this.d$type=t,this.d$name=e.$name||"",this.$flags=t=e.$flags||{},t.FastCall&&t.NoKwargs?this.tp$call=this.$methodFastCallNoKwargs:t.FastCall?this.tp$call=this.$methodFastCall:t.NoArgs?this.tp$call=this.$methodCallNoArgs:t.OneArg?this.tp$call=this.$methodCallOneArg:t.NamedArgs?this.tp$call=this.$methodCallNamedArgs:void 0!==t.MinArgs?this.tp$call=this.$methodCallMinArgs:(this.func_code=e.$meth,this.tp$call=this.$defaultCall,this.$memoiseFlags=Sk.builtin.func.prototype.$memoiseFlags,this.$resolveArgs=Sk.builtin.func.prototype.$resolveArgs)},slots:{tp$call(t,e){return this.tp$call(t,e)},tp$descr_get(t,e){let n;return(n=this.d$check(t))?n:new Sk.builtin.sk_method(this.d$def,t)}},getsets:t,proto:{$methodFastCall(t,e){const n=t.shift();return this.m$checkself(n),this.$meth.call(n,t,e)},$methodFastCallNoKwargs(t,e){const n=t.shift();return this.m$checkself(n),Sk.abstr.checkNoKwargs(this.d$name,e),this.$meth.call(n,t)},$methodCallNoArgs(t,e){const n=t.shift();return this.m$checkself(n),Sk.abstr.checkNoArgs(this.d$name,t,e),this.$meth.call(n)},$methodCallOneArg(t,e){const n=t.shift();return this.m$checkself(n),Sk.abstr.checkOneArg(this.d$name,t,e),this.$meth.call(n,t[0])},$methodCallNamedArgs(t,e){const n=t.shift();return this.m$checkself(n),t=Sk.abstr.copyKeywordsToNamedArgs(this.d$name,this.$flags.NamedArgs,t,e,this.$flags.Defaults),this.$meth.call(n,...t)},$methodCallMinArgs(t,e){const n=t.shift();return this.m$checkself(n),Sk.abstr.checkNoKwargs(this.d$name,e),Sk.abstr.checkArgsLen(this.d$name,t,this.$flags.MinArgs,this.$flags.MaxArgs),this.$meth.call(n,...t)},$defaultCall(t,e){return this.m$checkself(t[0]),Sk.builtin.func.prototype.tp$call.call(this,t,e)},m$checkself(t){if(void 0===t)throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' object needs an argument");this.d$check(t)}}}),Sk.builtin.wrapper_descriptor=n("wrapper_descriptor","slot wrapper",{constructor:function(t,e,n){this.d$def=e,this.d$type=t,this.d$name=n.$name=e.$name,this.d$wrapped=n},slots:{tp$descr_get(t,e){let n;return(n=this.d$check(t))?n:new Sk.builtin.method_wrapper(this,t)},tp$call(t,e){if(1>t.length)throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' object needs an argument");const n=t.shift();if(!n.ob$type.$isSubType(this.d$type))throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' requires a '"+this.d$type.prototype.tp$name+"' object but received a '"+Sk.abstr.typeName(n)+"'");return this.raw$call(n,t,e)}},proto:{raw$call(t,e,n){return this.d$wrapped.$name=this.d$name,this.d$def.$wrapper.call(this.d$wrapped,t,e,n)}}}),Sk.builtin.method_wrapper=n("method_wrapper",void 0,{constructor:function(t,e){this.m$descr=t,this.m$self=e,this.d$def=t.d$def,this.d$name=t.d$name,this.d$type=t.d$type},slots:{tp$call(t,e){return this.m$descr.raw$call(this.m$self,t,e)},tp$richcompare(t,e){return("Eq"===e||"NotEq"===e)&&t instanceof Sk.builtin.method_wrapper?(t=this.m$self===t.m$self&&this.m$descr===t.m$descr,"Eq"===e?t:!t):Sk.builtin.NotImplemented.NotImplemented$},$r(){return new Sk.builtin.str("")}},getsets:{__self__:{$get(){return this.m$self}}}}),Sk.builtin.classmethod_descriptor=n("classmethod_descriptor","method",{constructor:function(t,e){this.d$def=e,this.$meth=e.$meth,this.d$type=t,this.d$name=e.$name||""},slots:{tp$call(t,e){if(1>t.length)throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' object needs an argument");const n=t.shift();return this.tp$descr_get(null,n).tp$call(t,e)},tp$descr_get(t,e,n){if(void 0===e){if(null===t)throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' for type '"+this.d$type.prototype.tp$name+"' needs an object or a type");e=e||t.ob$type}if(!e.ob$type.$isSubType(Sk.builtin.type))throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' for type '"+this.d$type.prototype.tp$name+"' needs a type not a '"+Sk.abstr.typeName(e)+"' as arg 2");if(!e.$isSubType(this.d$type))throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' requires a '"+this.d$type.prototype.tp$name+"' object but received a '"+Sk.abstr.typeName(e)+"' object");return new Sk.builtin.sk_method(this.d$def,e)}},getsets:t}),[Sk.builtin.method_descriptor,Sk.builtin.getset_descriptor,Sk.builtin.wrapper_descriptor,Sk.builtin.method_wrapper,Sk.builtin.classmethod_descriptor].forEach((t=>{Sk.abstr.setUpSlots(t),Sk.abstr.setUpMethods(t),Sk.abstr.setUpGetSets(t)}))},function(t,e){Sk.builtin.sk_method=Sk.abstr.buildNativeClass("builtin_function_or_method",{constructor:function(t,e,n){this.$meth=t.$meth.bind(e),this.$doc=t.$doc,this.$self=e||null,this.$module=n?new Sk.builtin.str(n):null,this.$name=t.$name||t.$meth.name||"",this.m$def=t,this.$textsig=t.$textsig,this.$flags=t=t.$flags||{},t.FastCall&&t.NoKwargs?this.tp$call=this.$fastCallNoKwargs:t.FastCall?this.tp$call=this.$meth:t.NoArgs?this.tp$call=this.$callNoArgs:t.OneArg?this.tp$call=this.$callOneArg:t.NamedArgs?this.tp$call=this.$callNamedArgs:void 0!==t.MinArgs?this.tp$call=this.$callMinArgs:(this.func_code=this.$meth,this.tp$call=this.$defaultCallMethod)},proto:{$fastCallNoKwargs(t,e){return Sk.abstr.checkNoKwargs(this.$name,e),this.$meth(t)},$callNoArgs(t,e){return Sk.abstr.checkNoArgs(this.$name,t,e),this.$meth()},$callOneArg(t,e){return Sk.abstr.checkOneArg(this.$name,t,e),this.$meth(t[0])},$callNamedArgs(t,e){return t=Sk.abstr.copyKeywordsToNamedArgs(this.$name,this.$flags.NamedArgs,t,e,this.$flags.Defaults),this.$meth(...t)},$callMinArgs(t,e){return Sk.abstr.checkNoKwargs(this.$name,e),Sk.abstr.checkArgsLen(this.$name,t,this.$flags.MinArgs,this.$flags.MaxArgs),this.$meth(...t)},$defaultCallMethod(t,e){return null!==this.$self?Sk.builtin.func.prototype.tp$call.call(this,[this.$self,...t],e):Sk.builtin.func.prototype.tp$call.call(this,t,e)},$memoiseFlags(){return Sk.builtin.func.prototype.$memoiseFlags.call(this)},$resolveArgs(){return Sk.builtin.func.prototype.$resolveArgs.call(this)}},flags:{sk$unacceptableBase:!0},slots:{tp$getattr:Sk.generic.getAttr,$r(){return null===this.$self?new Sk.builtin.str(""):new Sk.builtin.str("")},tp$call(t,e){return this.tp$call(t,e)},tp$richcompare(t,e){return("Eq"===e||"NotEq"===e)&&t instanceof Sk.builtin.sk_method?(t=this.$self===t.$self&&this.m$def.$meth===t.m$def.$meth,"Eq"===e?t:!t):Sk.builtin.NotImplemented.NotImplemented$}},getsets:{__module__:{$get(){return this.$module||Sk.builtin.none.none$},$set(t){this.$module=t=t||Sk.builtin.none.none$}},__doc__:{$get(){return this.$doc?new Sk.builtin.str(this.$doc):Sk.builtin.none.none$}},__name__:{$get(){return new Sk.builtin.str(this.$name)}},__text_signature__:{$get(){return new Sk.builtin.str(this.$textsig)}},__self__:{$get(){return this.$self||Sk.sysModules.mp$lookup(this.$module)||Sk.builtin.none.none$}}}})},function(t,e){Sk.builtin.none=Sk.abstr.buildNativeClass("NoneType",{constructor:function(){return Sk.builtin.none.none$},slots:{tp$new:(t,e)=>(Sk.abstr.checkNoArgs("NoneType",t,e),Sk.builtin.none.none$),$r:()=>new Sk.builtin.str("None"),tp$as_number:!0,nb$bool:()=>!1},proto:{valueOf:()=>null},flags:{sk$unacceptableBase:!0}}),Sk.builtin.none.none$=Object.create(Sk.builtin.none.prototype,{v:{value:null,enumerable:!0}}),Sk.builtin.NotImplemented=Sk.abstr.buildNativeClass("NotImplementedType",{constructor:function(){return Sk.builtin.NotImplemented.NotImplemented$},slots:{$r:()=>new Sk.builtin.str("NotImplemented"),tp$new:(t,e)=>(Sk.abstr.checkNoArgs("NotImplementedType",t,e),Sk.builtin.NotImplemented.NotImplemented$)},flags:{sk$unacceptableBase:!0}}),Sk.builtin.NotImplemented.NotImplemented$=Object.create(Sk.builtin.NotImplemented.prototype,{v:{value:null,enumerable:!0}}),t=Sk.abstr.buildNativeClass("ellipsis",{constructor:function(){return Sk.builtin.Ellipsis},slots:{tp$new:(t,e)=>(Sk.abstr.checkNoArgs("ellipsis",t,e),Sk.builtin.Ellipsis),$r:()=>new Sk.builtin.str("Ellipsis")},flags:{sk$unacceptableBase:!0}}),Sk.builtin.Ellipsis=Object.create(t.prototype,{v:{value:"..."}})},function(t,e){const n=/^(?:(.)?([<>=\^]))?([\+\-\s])?(#)?(0)?(\d+)?(,|_)?(?:\.(\d+))?([bcdeEfFgGnosxX%])?$/;Sk.formatting={};let i=function(t,e,n,i){if(Sk.asserts.assert("string"==typeof e),t[6]){var s=parseInt(t[6],10);i=t[2]||(t[5]?"=":i?">":"<");let r=s-(e.length+(n?n.length:0));if(0>=r)return n+e;switch(s=(t[1]||(t[5]?"0":" ")).repeat(r),i){case"=":if("s"===t[9])throw new Sk.builtin.ValueError("'=' alignment not allowed in string format specifier");return n+s+e;case">":return s+n+e;case"<":return n+e+s;case"^":return t=Math.floor(r/2),s.substring(0,t)+n+e+s.substring(t)}}return n+e},s=function(t,e){return e?"-":"+"===t[3]?"+":" "===t[3]?" ":""};const r=/\B(?=(\d{3})+(?!\d))/g,o=/\B(?=([A-Za-z0-9]{4})+(?![A-Za-z0-9]))/g;let a=function(t,e,n){if(Sk.asserts.assert(e instanceof Sk.builtin.int_||e instanceof Sk.builtin.lng),t[8])throw new Sk.builtin.ValueError("Precision not allowed in integer format");var a=e.str$(n,!1);e=e.nb$isnegative(),e=s(t,e),t[4]&&(16===n?e+="0x":8===n?e+="0o":2===n&&(e+="0b"));const l=t[9];if("X"===l&&(a=a.toUpperCase()),"n"===t[9])a=(+a).toLocaleString();else if(t[7]){a=a.split(".");const e=t[7];if(","===e&&10!==n)throw new Sk.builtin.ValueError(`Cannot specify ',' with '${l}'`);a[0]=a[0].replace(10===n?r:o,e),a=a.join(".")}return i(t,a,e,!0)};Sk.formatting.mkNumber__format__=t=>function(e){if(!Sk.builtin.checkString(e))throw new Sk.builtin.TypeError("format() argument 2 must be str, not "+Sk.abstr.typeName(e));return new Sk.builtin.str(function(t,e,r){if(!e)return t.str$(10,!0);if(!(e=e.match(n)))throw new Sk.builtin.ValueError("Invalid format specifier");var o=e[9];if(o||(o=r?"g":"d"),-1==(r?"fFeEgG%":"bcdoxXnfFeEgG%").indexOf(o))throw new Sk.builtin.ValueError("Unknown format code '"+e[9]+"' for object of type '"+Sk.abstr.typeName(t)+"'");switch(o){case"d":case"n":return a(e,t,10);case"x":case"X":return a(e,t,16);case"o":return a(e,t,8);case"b":return a(e,t,2);case"c":if(e[3])throw new Sk.builtin.ValueError("Sign not allowed with integer format specifier 'c'");if(e[4])throw new Sk.builtin.ValueError("Alternate form not allowed with integer format specifier 'c'");if(e[7])throw new Sk.builtin.ValueError("Cannot specify ',' with 'c'");if(e[8])throw new Sk.builtin.ValueError("Cannot specify ',' with 'c'");return i(e,String.fromCodePoint(Sk.builtin.asnum$(t)),"",!0);case"f":case"F":case"e":case"E":case"g":case"G":{if(e[4])throw new Sk.builtin.ValueError("Alternate form (#) not allowed in float format specifier");if("string"==typeof(r=Sk.builtin.asnum$(t))&&(r=Number(r)),1/0===r)return i(e,"inf","",!0);if(-1/0===r)return i(e,"inf","-",!0);if(isNaN(r))return i(e,"nan","",!0);t=!1,0>r&&(r=-r,t=!0);var l=["toExponential","toFixed","toPrecision"]["efg".indexOf(o.toLowerCase())];let n=e[8]?parseInt(e[8],10):6;if(r=r[l](n),-1!=="EFG".indexOf(o)&&(r=r.toUpperCase()),"g"===o.toLowerCase()||!e[9]){if(l=r.match(/\.(\d*[1-9])?(0+)$/)){let[,t,e]=l;r=r.slice(0,t?-e.length:-(e.length+1))}-1!=r.indexOf(".")||e[9]||(r+=".0")}return"e"===o.toLowerCase()&&(r=r.replace(/^([-+]?[0-9]*\.?[0-9]+[eE][-+]?)([0-9])?$/,"$10$2")),e[7]&&((o=r.toString().split("."))[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r=o.join(".")),i(e,r,s(e,t),!0)}case"%":if(e[4])throw new Sk.builtin.ValueError("Alternate form (#) not allowed with format specifier '%'");return"string"==typeof(t=Sk.builtin.asnum$(t))&&(t=Number(t)),1/0===t?i(e,"inf%","",!0):-1/0===t?i(e,"inf%","-",!0):isNaN(t)?i(e,"nan%","",!0):(o=!1,0>t&&(t=-t,o=!0),r=e[8]?parseInt(e[8],10):6,t=(100*t).toFixed(r)+"%",i(e,t,s(e,o),!0));default:throw new Sk.builtin.ValueError("Unknown format code '"+e[9]+"'")}}(this,e.$jsstr(),t))},Sk.formatting.format=function(t,e){e=e||[];const n={};for(let t=0;tn?1/0:n;null!=(o=s.exec(t))&&li)return new Sk.builtin.tuple([new Sk.builtin.str(""),new Sk.builtin.str(""),new Sk.builtin.str(n)])}else if(i=n.indexOf(e),0>i)return new Sk.builtin.tuple([new Sk.builtin.str(n),new Sk.builtin.str(""),new Sk.builtin.str("")]);return new Sk.builtin.tuple([new Sk.builtin.str(n.substring(0,i)),new Sk.builtin.str(e),new Sk.builtin.str(n.substring(i+e.length))])}}function o(t,e){return function(n,i){if(n=Sk.misceval.asIndexSized(n,Sk.builtin.OverflowError),void 0===i)i=" ";else{if(!(i instanceof Sk.builtin.str&&1===i.sq$length()))throw new Sk.builtin.TypeError("the fill character must be a str of length 1");i=i.v}var s=this.sq$length();return s>=n?new Sk.builtin.str(this.v):e?(s=n-s,n=Math.floor(s/2)+(s&n&1),i=i.repeat(n)+this.v+i.repeat(s-n),new Sk.builtin.str(i)):(i=i.repeat(n-s),new Sk.builtin.str(t?i+this.v:this.v+i))}}function a(t,e,n){if(({start:e,end:n}=Sk.builtin.slice.startEnd$wrt(t,e,n)),t.$hasAstralCodePoints()){const i=t.codepoints[e];e=void 0===i?e+t.v.length-t.codepoints.length:i,n=void 0===(n=t.codepoints[n])?t.v.length:n}return{start:e,end:n}}function l(t){return function(e,n,i){if(e=this.get$tgt(e),({start:n,end:i}=a(this,n,i)),i=n&&e<=i?e:-1,this.codepoints){i=this.sq$length(),n=-1;for(let t=0;ts)return Sk.builtin.bool.false$;if(i=this.v.slice(i,s),n instanceof Sk.builtin.tuple){for(let s=Sk.abstr.iter(n),r=s.tp$iternext();void 0!==r;r=s.tp$iternext()){if(!(r instanceof Sk.builtin.str))throw new Sk.builtin.TypeError("tuple for "+t+" must only contain str, not "+Sk.abstr.typeName(r));if(e(i,r.v))return Sk.builtin.bool.true$}return Sk.builtin.bool.false$}return new Sk.builtin.bool(e(i,n.v))}}function c(t){return void 0===g[t]?t:t+"_$rw$"}var p=/^[0-9!#_]/,h=Object.create(null);Sk.builtin.str=Sk.abstr.buildNativeClass("str",{constructor:function(t){if(Sk.asserts.assert(this instanceof Sk.builtin.str,"bad call to str - use 'new'"),"string"!=typeof t)if(void 0===t)t="";else if(null===t)t="None";else{if(void 0!==t.tp$str)return t.tp$str();if("number"!=typeof t)throw new Sk.builtin.TypeError("could not convert object of type '"+Sk.abstr.typeName(t)+"' to str");t=Number.isFinite(t)?String(t):String(t).replace("Infinity","inf").replace("NaN","nan")}const e=h[t];if(void 0!==e)return e;h[t]=this,this.$mangled=c(t),this.$savedKeyHash=t.replace(p,"!$&"),this.v=t},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$doc:"str(object='') -> str\nstr(bytes_or_buffer[, encoding[, errors]]) -> str\n\nCreate a new string object from the given object. If encoding or\nerrors is specified, then the object must expose a data buffer\nthat will be decoded using the given encoding and error handler.\nOtherwise, returns the result of object.__str__() (if defined)\nor repr(object).\nencoding defaults to sys.getdefaultencoding().\nerrors defaults to 'strict'.",tp$new(t,e){if(e=e||[],this!==Sk.builtin.str.prototype)return this.$subtype_new(t,e);if(1>=t.length&&!e.length)return new Sk.builtin.str(t[0]);if(Sk.__future__.python3){const[n,i,s]=Sk.abstr.copyKeywordsToNamedArgs("str",["object","encoding","errors"],t,e);if(void 0===n||void 0===i&&void 0===s)return new Sk.builtin.str(n);if(Sk.builtin.bytes.check$encodeArgs("str",i,s),!Sk.builtin.checkBytes(n))throw new Sk.builtin.TypeError("decoding to str: need a bytes-like object, "+Sk.abstr.typeName(n)+" found");return Sk.builtin.bytes.$decode.call(n,i,s)}throw new Sk.builtin.TypeError("str takes at most one argument ("+(t.length+e.length)+" given)")},$r(){let t="'";-1!==this.v.indexOf("'")&&-1===this.v.indexOf('"')&&(t='"');const e=this.v.length;let n=t;for(let r=0;rs||57344<=s)&&!Sk.__future__.python3?n+="\\u"+("000"+s.toString(16)).slice(-4):55296<=s&&!Sk.__future__.python3?(i=this.v.codePointAt(r),r++,s="0000000"+(i=i.toString(16)).toString(16),n=4i||127<=s&&!Sk.__future__.python3?(2>(i=i.charCodeAt(0).toString(16)).length&&(i="0"+i),n+="\\x"+i):n+=i}return new Sk.builtin.str(n+t)},tp$str(){return this.constructor===Sk.builtin.str?this:new Sk.builtin.str(this.v)},tp$iter(){return new m(this)},tp$richcompare(t,e){if(!(t instanceof Sk.builtin.str))return Sk.builtin.NotImplemented.NotImplemented$;switch(e){case"Lt":return this.vt.v;case"GtE":return this.v>=t.v}},mp$subscript(t){let e;if(Sk.misceval.isIndex(t)){if(t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError),e=this.sq$length(),0>t&&(t+=e),0>t||t>=e)throw new Sk.builtin.IndexError("string index out of range");return this.codepoints?new Sk.builtin.str(this.v.substring(this.codepoints[t],this.codepoints[t+1])):new Sk.builtin.str(this.v.charAt(t))}if(t instanceof Sk.builtin.slice){let n="";return e=this.sq$length(),this.codepoints?t.sssiter$(e,(t=>{n+=this.v.substring(this.codepoints[t],this.codepoints[t+1])})):t.sssiter$(e,(t=>{n+=this.v.charAt(t)})),new Sk.builtin.str(n)}throw new Sk.builtin.TypeError("string indices must be integers, not "+Sk.abstr.typeName(t))},sq$length(){return this.$hasAstralCodePoints()?this.codepoints.length:this.v.length},sq$concat(t){if(!(t instanceof Sk.builtin.str))throw new Sk.builtin.TypeError("cannot concatenate 'str' and '"+Sk.abstr.typeName(t)+"' objects");return new Sk.builtin.str(this.v+t.v)},sq$repeat(t){if(!Sk.misceval.isIndex(t))throw new Sk.builtin.TypeError("can't multiply sequence by non-int of type '"+Sk.abstr.typeName(t)+"'");if((t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError))*this.v.length>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError;let e="";for(let n=0;n' requires string as left operand not "+Sk.abstr.typeName(t));return-1!==this.v.indexOf(t.v)},tp$as_number:!0,nb$remainder:function(t){const e=this.sk$builtinBase;t.constructor===Sk.builtin.tuple||t instanceof Sk.builtin.dict||t instanceof Sk.builtin.mappingproxy||(t=new Sk.builtin.tuple([t]));var n=0,i=this.$jsstr().replace(/%(\([a-zA-Z0-9]+\))?([#0 +\-]+)?(\*|[0-9]+)?(\.(\*|[0-9]+))?[hlL]?([diouxXeEfFgGcrsb%])/g,(function(i,s,r,o,a,l,u){var c,p,h,_,d;o=Sk.builtin.asnum$(o),a=Sk.builtin.asnum$(a),void 0!==s&&""!==s||"%"==u||(c=n++),""===a&&(a=void 0);var f=p=h=_=d=!1;if(r&&(-1!==r.indexOf("-")?_=!0:-1!==r.indexOf("0")&&(d=!0),-1!==r.indexOf("+")?p=!0:-1!==r.indexOf(" ")&&(h=!0),f=-1!==r.indexOf("#")),a&&(a=parseInt(a.substr(1),10)),r=function(t,e){var n;e=Sk.builtin.asnum$(e);var i=!1;if("number"==typeof t){0>t&&(t=-t,i=!0);var s=t.toString(e)}else t instanceof Sk.builtin.float_?(2<(s=t.str$(e,!1)).length&&".0"===s.substr(-2)&&(s=s.substr(0,s.length-2)),i=t.nb$isnegative()):(t instanceof Sk.builtin.int_||t instanceof Sk.builtin.lng)&&(s=t.str$(e,!1),i=t.nb$isnegative());if(Sk.asserts.assert(void 0!==s,"unhandled number format"),t=!1,a)for(n=s.length;ne){for(this.codepoints=[],t=0;te&&t++;return!0}}return this.codepoints=null,!1},sk$asarray(){const t=[];if(this.$hasAstralCodePoints()){var e=this.codepoints;for(let n=0;ni)return new Sk.builtin.str(this.v.replace(t,e));let s=0;return t=this.v.replace(t,(t=>s++e?0:2*(t.length/2-e);for(e=[],0>=n?n=0:e.push(new Sk.builtin.str(this.v.slice(0,t[n-1])));n{if(!(t instanceof Sk.builtin.str))throw new Sk.builtin.TypeError("sequence item "+e.length+": expected str, "+Sk.abstr.typeName(t)+" found");e.push(t.v)})),(()=>new Sk.builtin.str(e.join(this.v))))},$flags:{OneArg:!0},$textsig:"($self, iterable, /)",$doc:"Concatenate any number of strings.\n\nThe string whose method is called is inserted in between each given string.\nThe result is returned as a new string.\n\nExample: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'"},capitalize:{$meth:function(){return new Sk.builtin.str(this.v.charAt(0).toUpperCase()+this.v.slice(1).toLowerCase())},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return a capitalized version of the string.\n\nMore specifically, make the first character have upper case and the rest lower\ncase."},title:{$meth:function(){const t=this.v.replace(/[a-z][a-z]*/gi,(t=>t[0].toUpperCase()+t.substr(1).toLowerCase()));return new Sk.builtin.str(t)},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return a version of the string where each word is titlecased.\n\nMore specifically, words start with uppercased characters and all remaining\ncased characters have lower case."},center:{$meth:o(!1,!0),$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, width, fillchar=' ', /)",$doc:"Return a centered string of length width.\n\nPadding is done using the specified fill character (default is a space)."},count:{$meth:function(t,e,n){return t=this.get$tgt(t),({start:e,end:n}=a(this,e,n)),n int\n\nReturn the number of non-overlapping occurrences of substring sub in\nstring S[start:end]. Optional arguments start and end are\ninterpreted as in slice notation."},expandtabs:{$meth:function(t){if(!Sk.builtin.checkInt(t))throw new Sk.builtin.TypeError("an integer is required, got type"+Sk.abstr.typeName(t));t=Sk.builtin.asnum$(t);const e=Array(t+1).join(" "),n=this.v.replace(/([^\r\n\t]*)\t/g,((n,i)=>i+e.slice(i.length%t)));return new Sk.builtin.str(n)},$flags:{NamedArgs:["tabsize"],Defaults:[8]},$textsig:"($self, /, tabsize=8)",$doc:"Return a copy where all tab characters are expanded using spaces.\n\nIf tabsize is not given, a tab size of 8 characters is assumed."},find:{$meth:function(t,e,n){return new Sk.builtin.int_(this.find$left(t,e,n))},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."},partition:{$meth:r(!1),$flags:{OneArg:!0},$textsig:"($self, sep, /)",$doc:"Partition the string into three parts using the given separator.\n\nThis will search for the separator in the string. If the separator is found,\nreturns a 3-tuple containing the part before the separator, the separator\nitself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing the original string\nand two empty strings."},index:{$meth:function(t,e,n){if(-1===(t=this.find$left(t,e,n)))throw new Sk.builtin.ValueError("substring not found");return new Sk.builtin.int_(t)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in S where substring sub is found, \nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the substring is not found."},ljust:{$meth:o(!1,!1),$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, width, fillchar=' ', /)",$doc:"Return a left-justified string of length width.\n\nPadding is done using the specified fill character (default is a space)."},lower:{$meth(){return new Sk.builtin.str(this.v.toLowerCase())},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return a copy of the string converted to lowercase."},lstrip:{$meth:s(/^\s+/g,(t=>"^["+t+"]+")),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, chars=None, /)",$doc:"Return a copy of the string with leading whitespace removed.\n\nIf chars is given and not None, remove characters in chars instead."},rfind:{$meth(t,e,n){return new Sk.builtin.int_(this.find$right(t,e,n))},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.rfind(sub[, start[, end]]) -> int\n\nReturn the highest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."},rindex:{$meth:function(t,e,n){if(-1===(t=this.find$right(t,e,n)))throw new Sk.builtin.ValueError("substring not found");return new Sk.builtin.int_(t)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the substring is not found."},rjust:{$meth:o(!0,!1),$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, width, fillchar=' ', /)",$doc:"Return a right-justified string of length width.\n\nPadding is done using the specified fill character (default is a space)."},rstrip:{$meth:s(/\s+$/g,(t=>"["+t+"]+$")),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, chars=None, /)",$doc:"Return a copy of the string with trailing whitespace removed.\n\nIf chars is given and not None, remove characters in chars instead."},rpartition:{$meth:r(!0),$flags:{OneArg:!0},$textsig:"($self, sep, /)",$doc:"Partition the string into three parts using the given separator.\n\nThis will search for the separator in the string, starting at the end. If\nthe separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing two empty strings\nand the original string."},splitlines:{$meth:function(t){t=Sk.misceval.isTrue(t);const e=this.v,n=[],i=e.length;var s=0;for(let o=0;o"^["+t+"]+|["+t+"]+$")),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, chars=None, /)",$doc:"Return a copy of the string with leading and trailing whitespace remove.\n\nIf chars is given and not None, remove characters in chars instead."},swapcase:{$meth(){const t=this.v.replace(/[a-z]/gi,(t=>{const e=t.toLowerCase();return e===t?t.toUpperCase():e}));return new Sk.builtin.str(t)},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Convert uppercase characters to lowercase and lowercase characters to uppercase."},upper:{$meth(){return new Sk.builtin.str(this.v.toUpperCase())},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return a copy of the string converted to uppercase."},startswith:{$meth:u("startswith",((t,e)=>0===t.indexOf(e))),$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if S starts with the specified prefix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nprefix can also be a tuple of strings to try."},endswith:{$meth:u("endswith",((t,e)=>-1!==t.indexOf(e,t.length-e.length))),$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if S ends with the specified suffix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nsuffix can also be a tuple of strings to try."},isascii:{$meth(){return new Sk.builtin.bool(/^[\x00-\x7F]*$/.test(this.v))},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return True if all characters in the string are ASCII, False otherwise.\n\nASCII characters have code points in the range U+0000-U+007F.\nEmpty string is ASCII too."},islower:{$meth:function(){return new Sk.builtin.bool(this.v.length&&/[a-z]/.test(this.v)&&!/[A-Z]/.test(this.v))},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return True if the string is a lowercase string, False otherwise.\n\nA string is lowercase if all cased characters in the string are lowercase and\nthere is at least one cased character in the string."},isupper:{$meth:function(){return new Sk.builtin.bool(this.v.length&&!/[a-z]/.test(this.v)&&/[A-Z]/.test(this.v))},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return True if the string is an uppercase string, False otherwise.\n\nA string is uppercase if all cased characters in the string are uppercase and\nthere is at least one cased character in the string."},istitle:{$meth:function(){const t=this.v;let e,n=!1,i=!1;for(let s=0;s str\n\nReturn a formatted version of S, using substitutions from args and kwargs.\nThe substitutions are identified by braces ('{' and '}')."},__format__:{$meth:Sk.formatting.formatString,$flags:{OneArg:!0},$textsig:"($self, format_spec, /)",$doc:"Return a formatted version of the string as described by format_spec."},__getnewargs__:{$meth(){return new Sk.builtin.tuple(new Sk.builtin.str(this.v))},$flags:{NoArgs:!0},$textsig:null,$doc:null}}}),Sk.exportSymbol("Sk.builtin.str",Sk.builtin.str);var _=/^[A-Za-z0-9]+$/,d=/([.*+?=|\\\/()\[\]\{\}^$])/g,f=/^[\s\xa0]+/;Sk.builtin.str.$py2decode=new Sk.builtin.method_descriptor(Sk.builtin.str,{$name:"decode",$meth(t,e){const n=new Sk.builtin.bytes(this.v);return Sk.builtin.bytes.$decode.call(n,t,e)},$flags:{NamedArgs:["encoding","errors"]}});var m=Sk.abstr.buildIteratorClass("str_iterator",{constructor:function(t){this.$index=0,t.$hasAstralCodePoints()?(this.$seq=t.codepoints,this.tp$iternext=()=>{const e=this.$seq[this.$index];if(void 0!==e)return new Sk.builtin.str(t.v.substring(e,this.$seq[++this.$index]))}):(this.$seq=t.v,this.tp$iternext=()=>{const t=this.$seq[this.$index++];if(void 0!==t)return new Sk.builtin.str(t)})},iternext(){return this.tp$iternext()},methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$unacceptableBase:!0}}),g={abstract:!0,as:!0,boolean:!0,break:!0,byte:!0,case:!0,catch:!0,char:!0,class:!0,continue:!0,const:!0,debugger:!0,default:!0,delete:!0,do:!0,double:!0,else:!0,enum:!0,export:!0,extends:!0,false:!0,final:!0,finally:!0,float:!0,for:!0,function:!0,goto:!0,if:!0,implements:!0,import:!0,in:!0,instanceof:!0,int:!0,interface:!0,is:!0,long:!0,namespace:!0,native:!0,new:!0,null:!0,package:!0,private:!0,protected:!0,public:!0,return:!0,short:!0,static:!0,super:!0,switch:!0,synchronized:!0,this:!0,throw:!0,throws:!0,transient:!0,true:!0,try:!0,typeof:!0,use:!0,var:!0,void:!0,volatile:!0,while:!0,with:!0,constructor:!0,__defineGetter__:!0,__defineSetter__:!0,apply:!0,arguments:!0,call:!0,caller:!0,eval:!0,hasOwnProperty:!0,isPrototypeOf:!0,__lookupGetter__:!0,__lookupSetter__:!0,__noSuchMethod__:!0,propertyIsEnumerable:!0,prototype:!0,toSource:!0,toLocaleString:!0,toString:!0,unwatch:!0,valueOf:!0,watch:!0,length:!0,name:!0};Sk.builtin.str.reservedWords_=g,Sk.builtin.str.$fixReserved=c},function(t,e){Sk.builtin.func=Sk.abstr.buildNativeClass("function",{constructor:function(t,e,n,i){if(Sk.asserts.assert(this instanceof Sk.builtin.func,"builtin func should be called as a class with `new`"),this.func_code=t,this.func_globals=e||null,this.$name=t.co_name&&t.co_name.v||t.name||"",this.$d=Sk.builtin.dict?new Sk.builtin.dict:void 0,this.$doc=t.co_docstring||Sk.builtin.none.none$,this.$module=Sk.globals&&Sk.globals.__name__||Sk.builtin.none.none$,this.$qualname=t.co_qualname&&t.co_qualname.v||this.$name,void 0!==i)for(let t in i)n[t]=i[t];this.func_closure=n,this.func_annotations=null,this.$memoiseFlags(),this.memoised=t.co_fastcall||null,this.tp$call=t.co_fastcall?t.bind(this):Sk.builtin.func.prototype.tp$call.bind(this)},slots:{tp$getattr:Sk.generic.getAttr,tp$descr_get(t,e){return null===t?this:new Sk.builtin.method(this,t)},$r(){return new Sk.builtin.str("")},tp$call(t,e){if(this.memoised||(this.$memoiseFlags(),this.memoised=!0),void 0===this.co_argcount&&void 0===this.co_varnames&&!this.co_kwargs&&!this.func_closure){if(e&&0!==e.length)throw new Sk.builtin.TypeError(this.$name+"() takes no keyword arguments");return this.func_code.apply(this.func_globals,t)}return t=this.$resolveArgs(t,e),this.func_closure&&t.push(this.func_closure),this.func_code.apply(this.func_globals,t)}},getsets:{__name__:{$get(){return new Sk.builtin.str(this.$name)},$set(t){if(!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("__name__ must be set to a string object");this.$name=t.$jsstr()}},__qualname__:{$get(){return new Sk.builtin.str(this.$qualname)},$set(t){if(!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("__qualname__ must be set to a string object");this.$qualname=t.$jsstr()}},__dict__:Sk.generic.getSetDict,__annotations__:{$get(){return null===this.func_annotations?this.func_annotations=new Sk.builtin.dict([]):Array.isArray(this.func_annotations)&&(this.func_annotations=Sk.abstr.keywordArrayToPyDict(this.func_annotations)),this.func_annotations},$set(t){if(void 0===t||Sk.builtin.checkNone(t))this.func_annotations=new Sk.builtin.dict([]);else{if(!(t instanceof Sk.builtin.dict))throw new Sk.builtin.TypeError("__annotations__ must be set to a dict object");this.func_annotations=t}}},__defaults__:{$get(){return null==this.$defaults?Sk.builtin.none.none$:new Sk.builtin.tuple(this.$defaults)},$set(t){if(void 0===t||Sk.builtin.checkNone(t))this.$defaults=null;else{if(!(t instanceof Sk.builtin.tuple))throw new Sk.builtin.TypeError("__defaults__ must be set to a tuple object");this.$defaults=t.valueOf()}}},__doc__:{$get(){return this.$doc},$set(t){this.$doc=t||Sk.builtin.none.none$}},__module__:{$get(){return this.$module},$set(t){this.$module=t||Sk.builtin.none.none$}}},proto:{$memoiseFlags(){this.co_varnames=this.func_code.co_varnames,this.co_argcount=this.func_code.co_argcount,void 0===this.co_argcount&&this.co_varnames&&(this.co_argcount=this.co_varnames.length),this.co_kwonlyargcount=this.func_code.co_kwonlyargcount||0,this.co_varargs=this.func_code.co_varargs,this.co_kwargs=this.func_code.co_kwargs,this.$defaults=this.func_code.$defaults,this.$kwdefs=this.func_code.$kwdefs||[]},$resolveArgs:function(t,e){var n=this.co_argcount;void 0===n&&(n=this.co_varnames?this.co_varnames.length:t.length);var i=this.co_varnames||[],s=this.co_kwonlyargcount||0;let r,o=n+s;if(!(0!==s||this.co_kwargs||e&&0!==e.length||this.co_varargs)){if(t.length==n)return t;if(0===t.length&&this.$defaults&&this.$defaults.length===n){for(i=0;i!=this.$defaults.length;i++)t[i]=this.$defaults[i];return t}}this.co_kwargs&&(r=[]);var a=t.length;let l=t.length<=n?t:t.slice(0,n);if(this.co_varargs)t=t.length>l.length?t.slice(l.length):[],l[o]=new Sk.builtin.tuple(t);else if(a>n)throw new Sk.builtin.TypeError(`${this.$name}"() takes ${n} positional ${1==n?"argument":"arguments"} but ${a} ${1==a?"was":"were"} given`);if(e){if(this.func_code.no_kw)throw new Sk.builtin.TypeError(this.$name+"() takes no keyword arguments");for(t=0;t"'"+t+"'")).join(", ")));for(;tt.indexOf(".")&&0>t.indexOf("e")&&0>t.indexOf("E"))return t;var e=0;if(0<=t.indexOf("e")){var n=t.substr(0,t.indexOf("e"));e=t.substr(t.indexOf("e")+1)}else 0<=t.indexOf("E")?(n=t.substr(0,t.indexOf("e")),e=t.substr(t.indexOf("E")+1)):n=t;if(e=parseInt(e,10),0>(t=n.indexOf("."))){if(0<=e){for(;0-e?n.substr(0,n.length+e):0}for(n=0===t?n.substr(1):tn.length;)n+="0";return 0>=t?0:n.substr(0,t)},Sk.exportSymbol("Sk.builtin.asnum$nofloat",Sk.builtin.asnum$nofloat),Sk.builtin.round=function(t,e){if(void 0===t)throw new Sk.builtin.TypeError("a float is required");if(!Sk.__future__.dunder_round){if(!Sk.builtin.checkNumber(t))throw new Sk.builtin.TypeError("a float is required");if(t.round$)return t.round$(e);throw new Sk.builtin.AttributeError(Sk.abstr.typeName(t)+" instance has no attribute '__float__'")}if(void 0!==e&&!Sk.builtin.checkNone(e)&&!Sk.misceval.isIndex(e))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(e)+"' object cannot be interpreted as an index");if(void 0!==(t=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$round)))return void 0!==e?Sk.misceval.callsimArray(t,[e]):Sk.misceval.callsimArray(t,[]);throw new Sk.builtin.TypeError("a float is required")},Sk.builtin.len=function(t){if(!t.sq$length)throw new Sk.builtin.TypeError("object of type '"+Sk.abstr.typeName(t)+"' has no len()");return t=t.sq$length(!0),Sk.misceval.chain(t,(t=>new Sk.builtin.int_(t)))},Sk.builtin.min=function(t,e){let n;const i=t.length;if(!i)throw new Sk.builtin.TypeError("min expected 1 argument, got 0");const[s,r]=Sk.abstr.copyKeywordsToNamedArgs("min",["default","key"],[],e,[null,Sk.builtin.none.none$]);if(1{if(o=t,void 0!==o)return Sk.builtin.checkNone(r)?Sk.misceval.iterFor(n,(t=>{Sk.misceval.richCompareBool(t,o,"Lt")&&(o=t)})):Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(r,[o]),(t=>Sk.misceval.iterFor(n,(e=>Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(r,[e]),(n=>{Sk.misceval.richCompareBool(n,t,"Lt")&&(o=e,t=n)}))))))}),(()=>{if(void 0===o){if(null===s)throw new Sk.builtin.ValueError("min() arg is an empty sequence");o=s}return o}))},Sk.builtin.max=function(t,e){let n;const i=t.length;if(!i)throw new Sk.builtin.TypeError("max expected 1 argument, got 0");const[s,r]=Sk.abstr.copyKeywordsToNamedArgs("max",["default","key"],[],e,[null,Sk.builtin.none.none$]);if(1{if(o=t,void 0!==o)return Sk.builtin.checkNone(r)?Sk.misceval.iterFor(n,(t=>{Sk.misceval.richCompareBool(t,o,"Gt")&&(o=t)})):Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(r,[o]),(t=>Sk.misceval.iterFor(n,(e=>Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(r,[e]),(n=>{Sk.misceval.richCompareBool(n,t,"Gt")&&(o=e,t=n)}))))))}),(()=>{if(void 0===o){if(null===s)throw new Sk.builtin.ValueError("max() arg is an empty sequence");o=s}return o}))},Sk.builtin.min.co_fastcall=Sk.builtin.max.co_fastcall=1,Sk.builtin.any=function(t){return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(function(t){if(Sk.misceval.isTrue(t))return new Sk.misceval.Break(Sk.builtin.bool.true$)})),(t=>t||Sk.builtin.bool.false$))},Sk.builtin.all=function(t){return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(function(t){if(!Sk.misceval.isTrue(t))return new Sk.misceval.Break(Sk.builtin.bool.false$)})),(t=>t||Sk.builtin.bool.true$))},Sk.builtin.sum=function(t,e){const n=Sk.abstr.iter(t);if(void 0===e)var i=new Sk.builtin.int_(0);else{if(Sk.builtin.checkString(e))throw new Sk.builtin.TypeError("sum() can't sum strings [use ''.join(seq) instead]");i=e}return t=void 0===e||e.constructor===Sk.builtin.int_?Sk.misceval.iterFor(n,(t=>{if(t.constructor!==Sk.builtin.int_)return t.constructor===Sk.builtin.float_?(i=i.nb$float().nb$add(t),new Sk.misceval.Break("float")):(i=Sk.abstr.numberBinOp(i,t,"Add"),new Sk.misceval.Break("slow"));i=i.nb$add(t)})):e.constructor===Sk.builtin.float_?"float":"slow",Sk.misceval.chain(t,(t=>"float"===t?Sk.misceval.iterFor(n,(t=>{if(t.constructor!==Sk.builtin.float_&&t.constructor!==Sk.builtin.int_)return i=Sk.abstr.numberBinOp(i,t,"Add"),new Sk.misceval.Break("slow");i=i.nb$add(t)})):t),(t=>{if("slow"===t)return Sk.misceval.iterFor(n,(t=>{i=Sk.abstr.numberBinOp(i,t,"Add")}))}),(()=>i))},Sk.builtin.zip=function(){var t,e;if(0===arguments.length)return new Sk.builtin.list([]);var n=[];for(e=0;et||1114112<=t)throw new Sk.builtin.ValueError("chr() arg not in range(0x110000)")}else if(0>t||256<=t)throw new Sk.builtin.ValueError("chr() arg not in range(256)");return new Sk.builtin.str(String.fromCodePoint(t))},Sk.builtin.unichr=function(t){if(Sk.builtin.pyCheckArgsLen("unichr",arguments.length,1,1),!Sk.builtin.checkInt(t))throw new Sk.builtin.TypeError("an integer is required");t=Sk.builtin.asnum$(t);try{return new Sk.builtin.str(String.fromCodePoint(t))}catch(t){if(t instanceof RangeError)throw new Sk.builtin.ValueError(t.message);throw t}},Sk.builtin.int2str_=function(t,e,n){let i=Sk.misceval.asIndexOrThrow(t),s=i.toString(e);return s=0>i?"-"+n+s.slice(1):n+s,2!==e&&!Sk.__future__.python3&&(t instanceof Sk.builtin.lng||JSBI.__isBigInt(i))&&(s+="L"),new Sk.builtin.str(s)},Sk.builtin.hex=function(t){if(!Sk.misceval.isIndex(t))throw new Sk.builtin.TypeError("hex() argument can't be converted to hex");return Sk.builtin.int2str_(t,16,"0x")},Sk.builtin.oct=function(t){if(!Sk.misceval.isIndex(t))throw new Sk.builtin.TypeError("oct() argument can't be converted to hex");return Sk.__future__.octal_number_literal?Sk.builtin.int2str_(t,8,"0o"):Sk.builtin.int2str_(t,8,"0")},Sk.builtin.bin=function(t){if(!Sk.misceval.isIndex(t))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object can't be interpreted as an index");return Sk.builtin.int2str_(t,2,"0b")},Sk.builtin.dir=function(t){if(void 0!==t)return t=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$dir),Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(t,[]),(t=>Sk.builtin.sorted(t)));throw new Sk.builtin.NotImplementedError("skulpt does not yet support dir with no args")},Sk.builtin.repr=function(t){return t.$r()},Sk.builtin.ascii=function(t){return Sk.misceval.chain(t.$r(),(t=>{let e,n;for(n=0;n=s?(2>(i=s.toString(16)).length&&(i="0"+i),e+="\\x"+i):127s||57344<=s?e+="\\u"+("000"+s.toString(16)).slice(-4):55296<=s?(i=t.v.codePointAt(n),n++,s="0000000"+(i=i.toString(16)).toString(16),e=4t.tp$getattr(e,!0)),(t=>{if(!(t instanceof Sk.builtin.AttributeError))throw t}));return Sk.misceval.chain(i,(i=>{if(void 0===i){if(void 0!==n)return n;throw new Sk.builtin.AttributeError(t.sk$attrError()+" has no attribute "+Sk.misceval.objectRepr(e))}return i}))},Sk.builtin.setattr=function(t,e,n){if(!Sk.builtin.checkString(e))throw new Sk.builtin.TypeError("attribute name must be string");return Sk.misceval.chain(t.tp$setattr(e,n,!0),(()=>Sk.builtin.none.none$))},Sk.builtin.raw_input=function(t){var e=t||"";return Sk.misceval.chain(Sk.importModule("sys",!1,!0),(function(t){return Sk.inputfunTakesPrompt?Sk.builtin.file.$readline(t.$d.stdin,null,e):Sk.misceval.chain(void 0,(function(){return Sk.misceval.callsimOrSuspendArray(t.$d.stdout.write,[t.$d.stdout,new Sk.builtin.str(e)])}),(function(){return Sk.misceval.callsimOrSuspendArray(t.$d.stdin.readline,[t.$d.stdin])}))}))},Sk.builtin.input=Sk.builtin.raw_input,Sk.builtin.jseval=function(t){return t=Sk.global.eval(Sk.ffi.remapToJs(t)),Sk.ffi.remapToPy(t)},Sk.builtin.jsmillis=function(){return console.warn("jsmillis is deprecated"),(new Date).valueOf()};const n=Sk.abstr.buildNativeClass("code",{constructor:function(t,e){this.compiled=e,this.code=e.code,this.filename=t},slots:{tp$new(t,e){throw new Sk.builtin.NotImplementedError("cannot construct a code object in skulpt")},$r(){return new Sk.builtin.str(", file "+this.filename+">")}}});Sk.builtin.compile=function(t,e,i,s,r,o){return Sk.builtin.pyCheckType("source","str",Sk.builtin.checkString(t)),Sk.builtin.pyCheckType("filename","str",Sk.builtin.checkString(e)),Sk.builtin.pyCheckType("mode","str",Sk.builtin.checkString(i)),t=t.$jsstr(),e=e.$jsstr(),i=i.$jsstr(),Sk.misceval.chain(Sk.compile(t,e,i,!0),(t=>new n(e,t)))},Sk.builtin.exec=function(t,e,i){let s=e&&e.__file__;if(s=void 0!==s&&Sk.builtin.checkString(s)?s.toString():"",Sk.builtin.checkString(t))t=Sk.compile(t.$jsstr(),s,"exec",!0);else if("string"==typeof t)t=Sk.compile(t,s,"exec",!0);else if(!(t instanceof n))throw new Sk.builtin.TypeError("exec() arg 1 must be a string, bytes or code object");Sk.asserts.assert(void 0===e||e.constructor===Object,"internal calls to exec should be called with a javascript object for globals"),Sk.asserts.assert(void 0===i||i.constructor===Object,"internal calls to exec should be called with a javascript object for locals");const r=Sk.globals;return e=e||r,Sk.misceval.chain(t,(t=>Sk.global.eval(t.code)(e,i)),(t=>(Sk.globals=r,t)))},Sk.builtin.eval=function(t,e,i){if(Sk.builtin.checkString(t))t=t.$jsstr();else if(Sk.builtin.checkBytes(t))throw new Sk.builtin.NotImplementedError("bytes for eval is not yet implemented in skulpt");if("string"==typeof t){t=t.trim();var s=Sk.parse("?",t);if(1<(s=Sk.astFromParse(s.cst,"?",s.flags)).body.length||!(s.body[0]instanceof Sk.astnodes.Expr))throw new Sk.builtin.SyntaxError("invalid syntax");t="__final_res__ = "+t}else if(!(t instanceof n))throw new Sk.builtin.TypeError("eval() arg 1 must be a string, bytes or code object");return Sk.misceval.chain(Sk.builtin.exec(t,e,i),(t=>{const e=t.__final_res__||Sk.builtin.none.none$;return delete t.__final_res__,e}))},Sk.builtin.map=function(t,e){var n,i,s=[];if(Sk.builtin.pyCheckArgsLen("map",arguments.length,2),2((t=new Sk.builtin.list(t)).list$sort(e,n,i),t)))},Sk.builtin.filter=function(t,e){var n;if(Sk.builtin.pyCheckArgsLen("filter",arguments.length,2,2),!Sk.builtin.checkIterable(e))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(e)+"' object is not iterable");var i=function(){return[]},s=function(t,e){return t.push(e),t},r=function(t){return new Sk.builtin.list(t)};e.ob$type===Sk.builtin.str?(i=function(){return new Sk.builtin.str("")},s=function(t,e){return t.sq$concat(e)},r=function(t){return t}):e.ob$type===Sk.builtin.tuple&&(r=function(t){return new Sk.builtin.tuple(t)});var o=i(),a=Sk.abstr.iter(e);for(n=a.tp$iternext();void 0!==n;n=a.tp$iternext())i=t===Sk.builtin.none.none$?new Sk.builtin.bool(n):Sk.misceval.callsimArray(t,[n]),Sk.misceval.isTrue(i)&&(o=s(o,n));return r(o)},Sk.builtin.hasattr=function(t,e){if(!Sk.builtin.checkString(e))throw new Sk.builtin.TypeError("hasattr(): attribute name must be string");const n=Sk.misceval.tryCatch((()=>t.tp$getattr(e,!0)),(t=>{if(!(t instanceof Sk.builtin.AttributeError))throw t}));return Sk.misceval.chain(n,(t=>void 0===t?Sk.builtin.bool.false$:Sk.builtin.bool.true$))},Sk.builtin.pow=function(t,e,n){if(void 0===n||Sk.builtin.checkNone(n))return Sk.abstr.numberBinOp(t,e,"Pow");if(!(Sk.builtin.checkInt(t)&&Sk.builtin.checkInt(e)&&Sk.builtin.checkInt(n))){if(Sk.builtin.checkFloat(t)||Sk.builtin.checkComplex(t))return t.nb$power(e,n);throw new Sk.builtin.TypeError("unsupported operand type(s) for ** or pow(): '"+Sk.abstr.typeName(t)+"', '"+Sk.abstr.typeName(e)+"', '"+Sk.abstr.typeName(n)+"'")}return t.nb$power(e,n)},Sk.builtin.quit=function(t){throw t=new Sk.builtin.str(t).v,new Sk.builtin.SystemExit(t)},Sk.builtin.issubclass=function(t,e){if(!Sk.builtin.checkClass(t))throw new Sk.builtin.TypeError("issubclass() arg 1 must be a class");var n=Sk.builtin.checkClass(e);if(!(n||e instanceof Sk.builtin.tuple))throw new Sk.builtin.TypeError("issubclass() arg 2 must be a class or tuple of classes");if(n)return t.$isSubType(e)?Sk.builtin.bool.true$:Sk.builtin.bool.false$;for(n=0;n{if(void 0===n){if(e)return e;if(void 0!==(n=t.gi$ret)&&n!==Sk.builtin.none.none$)throw new Sk.builtin.StopIteration(n);throw new Sk.builtin.StopIteration}return n}))},Sk.builtin.reload=function(){throw new Sk.builtin.NotImplementedError("reload is not yet implemented")},Sk.builtin.vars=function(){throw new Sk.builtin.NotImplementedError("vars is not yet implemented")},Sk.builtin.apply_=function(){throw new Sk.builtin.NotImplementedError("apply is not yet implemented")},Sk.builtin.buffer=function(){throw new Sk.builtin.NotImplementedError("buffer is not yet implemented")},Sk.builtin.coerce=function(){throw new Sk.builtin.NotImplementedError("coerce is not yet implemented")},Sk.builtin.intern=function(){throw new Sk.builtin.NotImplementedError("intern is not yet implemented")}},function(t,e){function n(t,e){return e=new this.constructor,this.ht$type&&a.call(e),e.args=new Sk.builtin.tuple(t.slice(0)),e}function i(t,e){Sk.abstr.checkNoKwargs(Sk.abstr.typeName(this),e),this.args=new Sk.builtin.tuple(t.slice(0))}function s(){return 1>=this.args.v.length?new Sk.builtin.str(this.args.v[0]):this.args.$r()}function r(t,e,n,s,r,o){r||(r=[]);const a=s?{}:{sk$solidBase:!1};return n={tp$init:s||i,tp$doc:n},o&&(n.tp$str=o),Sk.abstr.buildNativeClass(e,{base:t,constructor:function(...e){t.apply(this,e),r.forEach(((t,n)=>{this["$"+t]=Sk.ffi.remapToPy(e[n])}))},slots:n,getsets:Object.fromEntries(r.map((t=>[t,{$get(){return this["$"+t]||Sk.builtin.none.none$},$set(e){this["$"+t]=e||Sk.builtin.none.none$}}]))),flags:a})}function o(t,e,s){const r=t.prototype.tp$init;return s={tp$doc:s,tp$init:r},r===i&&(s.tp$new=n),Sk.abstr.buildNativeClass(e,{base:t,constructor:function(...e){t.apply(this,e)},slots:s,flags:{sk$solidBase:!1}})}const a=Sk.abstr.buildNativeClass("BaseException",{constructor:function t(e,...n){Sk.asserts.assert(this instanceof t,"bad call to exception constructor, use 'new'"),"string"==typeof e&&(e=new Sk.builtin.str(e)),this.args=new Sk.builtin.tuple(e?[e]:[]),this.traceback=2<=n.length?[{filename:n[0]||"",lineno:n[1]}]:[],this.context=this.cause=null,this.$d=new Sk.builtin.dict},slots:{tp$getattr:Sk.generic.getAttr,tp$doc:"Common base class for all exceptions",tp$new:n,tp$init:i,$r(){let t=this.tp$name;return t+="("+this.args.v.map((t=>Sk.misceval.objectRepr(t))).join(", ")+")",new Sk.builtin.str(t)},tp$str:s},getsets:{args:{$get(){return this.args},$set(t){if(void 0===t)throw new Sk.builtin.TypeError("args may not be deleted");this.args=new Sk.builtin.tuple(t)}},__cause__:{$get(){return this.$cause||Sk.builtin.none.none$},$set(t){if(!(Sk.builtin.checkNone(t)||t instanceof Sk.builtin.BaseException))throw new B("exception cause must be None or derive from BaseException");this.$cause=t}},__dict__:Sk.generic.getSetDict},proto:{toString(){let t=this.tp$name;return t+=": "+this.tp$str().v,0!==this.traceback.length?t+" on line "+this.traceback[0].lineno:t+" at "}}});t=o(a,"SystemExit","Request to exit from the interpreter."),e=o(a,"KeyboardInterrupt","Program interrupted by user.");const l=o(a,"GeneratorExit","Request that a generator exit."),u=o(a,"Exception","Common base class for all non-exit exceptions."),c=r(u,"StopIteration","Signal the end from iterator.__next__().",(function(t,e){i.call(this,t,e),this.$value=t[0]||Sk.builtin.none.none$}),["value"]),p=o(u,"StopAsyncIteration","Signal the end from iterator.__anext__()."),h=o(u,"ArithmeticError","Base class for arithmetic errors."),_=o(h,"FloatingPointError","Floating point operation failed."),d=o(h,"OverflowError","Result too large to be represented."),f=o(h,"ZeroDivisionError","Second argument to a division or modulo operation was zero."),m=o(u,"AssertionError","Assertion failed."),g=o(u,"AttributeError","Attribute not found."),b=o(u,"BufferError","Buffer error."),S=o(u,"EOFError","Read beyond end of file."),k=r(u,"ImportError","Import can't find module, or can't find name in module.",(function(t,e){i.call(this,t);const[n,s]=Sk.abstr.copyKeywordsToNamedArgs("ImportError",["name","path"],[],e);this.$name=n,this.$path=s,1===t.length&&(this.$msg=t[0])}),["msg","name","path"],(function(){return Sk.builtin.checkString(this.$msg)?this.$msg:s.call(this)})),y=o(k,"ModuleNotFoundError","Module not found."),T=o(u,"LookupError","Base class for lookup errors."),v=o(T,"IndexError","Sequence index out of range."),$=r(T,"KeyError","Mapping key not found.",null,null,(function(){return 1===this.args.v.length?this.args.v[0].$r():s.call(this)})),w=o(u,"MemoryError","Out of memory."),E=o(u,"NameError","Name not found globally."),I=o(E,"UnboundLocalError","Local name referenced but not bound to a value."),A=r(u,"OSError","Base class for I/O related errors.",(function(t,e){i.call(this,t,e)})),O=o(A,"FileNotFoundError","File not found."),M=o(A,"TimeoutError","Timeout expired."),C=o(u,"ReferenceError","Weak ref proxy used after referent went away."),R=o(u,"RuntimeError","Unspecified run-time error."),x=o(R,"NotImplementedError","Method or function hasn't been implemented yet."),N=o(R,"RecursionError","Recursion limit exceeded."),L=r(u,"SyntaxError","Invalid syntax.",(function(t,e){i.call(this,t,e),1<=t.length&&(this.$msg=t[0]),2===t.length&&(t=new Sk.builtin.tuple(t[1]).v,this.$filename=t[0],this.$lineno=t[1],this.$offset=t[2],this.$text=t[3])}),["msg","filename","lineno","offset","text"],(function(){return s.call(this)})),D=o(L,"IndentationError","Improper indentation."),F=o(D,"TabError","Improper mixture of spaces and tabs."),P=o(u,"SystemError","Internal error in the Skulpt interpreter."),B=o(u,"TypeError","Inappropriate argument type."),V=o(u,"ValueError","Inappropriate argument value (of correct type)."),U=o(V,"UnicodeError","Unicode related error."),Y=o(U,"UnicodeDecodeError","Unicode decoding error."),j=o(U,"UnicodeEncodeError","Unicode encoding error.");Object.assign(Sk.builtin,{BaseException:a,SystemExit:t,KeyboardInterrupt:e,GeneratorExit:l,Exception:u,StopIteration:c,StopAsyncIteration:p,ArithmeticError:h,FloatingPointError:_,OverflowError:d,ZeroDivisionError:f,AssertionError:m,AttributeError:g,BufferError:b,EOFError:S,ImportError:k,ModuleNotFoundError:y,LookupError:T,IndexError:v,KeyError:$,MemoryError:w,NameError:E,UnboundLocalError:I,OSError:A,IOError:A,FileNotFoundError:O,TimeoutError:M,ReferenceError:C,RuntimeError:R,NotImplementedError:x,RecursionError:N,SyntaxError:L,IndentationError:D,TabError:F,SystemError:P,TypeError:B,ValueError:V,UnicodeError:U,UnicodeDecodeError:Y,UnicodeEncodeError:j}),Sk.builtin.SuspensionError=o(u,"SuspensionError","Unsupported Suspension in code."),Sk.builtin.ExternalError=Sk.abstr.buildNativeClass("ExternalError",{constructor:function(...t){if(this.nativeError=t[0],!Sk.builtin.checkString(this.nativeError)&&(t[0]=this.nativeError.toString(),t[0].startsWith("RangeError: Maximum call")))return t[0]="Maximum call stack size exceeded",new N(...t);u.apply(this,t)},base:u}),Sk.builtin.getExcInfo=function(t){return new Sk.builtin.tuple([t.ob$type||Sk.builtin.none.none$,t,Sk.builtin.none.none$])}},function(t,e){Sk.builtin.method=Sk.abstr.buildNativeClass("method",{constructor:function(t,e){Sk.asserts.assert(this instanceof Sk.builtin.method,"bad call to method constructor, use 'new'"),this.im_func=t,this.im_self=e,this.im_call=t.tp$call},slots:{$r(){let t=this.im_func.tp$getattr(Sk.builtin.str.$qualname)||this.im_func.tp$getattr(Sk.builtin.str.$name);return t=t&&t.v||"?",new Sk.builtin.str("")},tp$hash(){return Sk.abstr.objectHash(this.im_self)+Sk.abstr.objectHash(this.im_func)},tp$call(t,e){var n=this.im_call;if(void 0===n)throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(this.im_func)+"' object is not callable");return t=[this.im_self,...t],n.call(this.im_func,t,e)},tp$new(t,e){if(Sk.abstr.checkNoKwargs("method",e),Sk.abstr.checkArgsLen("method",t,2,2),e=t[0],t=t[1],!Sk.builtin.checkCallable(e))throw new Sk.builtin.TypeError("first argument must be callable");if(Sk.builtin.checkNone(t))throw new Sk.builtin.TypeError("self must not be None");return new Sk.builtin.method(e,t)},tp$richcompare(t,e){if("Eq"!=e&&"NotEq"!=e||!(t instanceof Sk.builtin.method))return Sk.builtin.NotImplemented.NotImplemented$;let n;try{n=Sk.misceval.richCompareBool(this.im_self,t.im_self,"Eq",!1)&&this.im_func==t.im_func}catch(t){n=!1}return"Eq"==e?n:!n},tp$descr_get(t,e){return this},tp$getattr(t,e){const n=Sk.abstr.lookupSpecial(this,t);return void 0!==n?n:this.im_func.tp$getattr(t,e)}},getsets:{__func__:{$get(){return this.im_func}},__self__:{$get(){return this.im_self}},__doc__:{$get(){return this.im_func.tp$getattr(Sk.builtin.str.$doc)}}},flags:{sk$unacceptableBase:!0}})},function(t,e){function n(t){if(null!=t){if(!0===t.sk$int)return t.v;if(void 0!==t.nb$index)return t.nb$index();if("number"==typeof t&&Number.isInteger(t))return t}}function i(t,e){const i=n(t);if(void 0!==i)return i;throw e=(e||"'{tp$name}' object cannot be interpreted as an integer").replace("{tp$name}",Sk.abstr.typeName(t)),new Sk.builtin.TypeError(e)}Sk.misceval={},Sk.misceval.Suspension=function(t,e,n){this.$isSuspension=!0,void 0!==t&&void 0!==e&&(this.resume=function(){return t(e.resume())}),this.child=e,this.optional=void 0!==e&&e.optional,this.data=void 0===n&&void 0!==e?e.data:n},Sk.exportSymbol("Sk.misceval.Suspension",Sk.misceval.Suspension),Sk.misceval.retryOptionalSuspensionOrThrow=function(t,e){for(;t instanceof Sk.misceval.Suspension;){if(!t.optional){e=new Sk.builtin.SuspensionError(e||"Cannot call a function that blocks or suspends here");const n=[];for(;null!=t;)t.$lineno&&n.push({filename:t.$filename,lineno:t.$lineno,colno:t.$colno}),t=t.child;throw n.reverse(),e.traceback.push(...n),e}t=t.resume()}return t},Sk.exportSymbol("Sk.misceval.retryOptionalSuspensionOrThrow",Sk.misceval.retryOptionalSuspensionOrThrow),Sk.misceval.isIndex=function(t){return null!=t&&(void 0!==t.nb$index||"number"==typeof t&&Number.isInteger(t))},Sk.exportSymbol("Sk.misceval.isIndex",Sk.misceval.isIndex),Sk.misceval.asIndex=n,Sk.misceval.asIndexSized=function(t,e,n){if("number"==typeof(n=i(t,n)))return n;if(null==e)return JSBI.lessThan(n,JSBI.__ZERO)?-Number.MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;throw new e("cannot fit '"+Sk.abstr.typeName(t)+"' into an index-sized integer")},Sk.misceval.asIndexOrThrow=i,Sk.misceval.applySlice=function(t,e,n,i){return Sk.abstr.objectGetItem(t,new Sk.builtin.slice(e,n,null),i)},Sk.exportSymbol("Sk.misceval.applySlice",Sk.misceval.applySlice),Sk.misceval.assignSlice=function(t,e,n,i,s){return e=new Sk.builtin.slice(e,n),null===i?Sk.abstr.objectDelItem(t,e):Sk.abstr.objectSetItem(t,e,i,s)},Sk.exportSymbol("Sk.misceval.assignSlice",Sk.misceval.assignSlice),Sk.misceval.arrayFromArguments=function(t){var e;if(1!=t.length)return t;var n=t[0];if(n instanceof Sk.builtin.set?n=n.tp$iter().$obj:n instanceof Sk.builtin.dict&&(n=Sk.builtin.dict.prototype.keys.func_code(n)),n instanceof Sk.builtin.list||n instanceof Sk.builtin.tuple)return n.v;if(Sk.builtin.checkIterable(n)){for(t=[],e=(n=Sk.abstr.iter(n)).tp$iternext();void 0!==e;e=n.tp$iternext())t.push(e);return t}throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(n)+"' object is not iterable")},Sk.exportSymbol("Sk.misceval.arrayFromArguments",Sk.misceval.arrayFromArguments),Sk.misceval.iterator=Sk.abstr.buildIteratorClass("iterator",{constructor:function(t,e){this.tp$iternext=e?t:function(e){let n=t();return e||void 0===n||!n.$isSuspension?n:Sk.misceval.retryOptionalSuspensionOrThrow(n)}},iternext:function(t){return this.tp$iternext(t)},flags:{sk$unacceptableBase:!0}}),Sk.misceval.swappedOp_={Eq:"Eq",NotEq:"NotEq",Lt:"Gt",LtE:"GtE",Gt:"Lt",GtE:"LtE"},Sk.misceval.opSymbols={Eq:"==",NotEq:"!=",Lt:"<",LtE:"<=",Gt:">",GtE:">=",Is:"is",IsNot:"is not",In_:"in",NotIn:"not in"},Sk.misceval.richCompareBool=function(t,e,n,i){Sk.asserts.assert(t.sk$object&&e.sk$object,"JS object passed to richCompareBool");var s=t.ob$type,r=e.ob$type,o=r!==s&&void 0===r.sk$baseClass&&r.$isSubType(s);if(!Sk.__future__.python3&&s!==r&&("GtE"===n||"Gt"===n||"LtE"===n||"Lt"===n)){var a=[Sk.builtin.float_,Sk.builtin.int_,Sk.builtin.lng,Sk.builtin.bool];const i=[Sk.builtin.dict,Sk.builtin.enumerate,Sk.builtin.filter_,Sk.builtin.list,Sk.builtin.map_,Sk.builtin.str,Sk.builtin.tuple,Sk.builtin.zip_];var l=a.indexOf(s);if(s=i.indexOf(s),a=a.indexOf(r),r=i.indexOf(r),t===Sk.builtin.none.none$)switch(n){case"Lt":case"LtE":return!0;case"Gt":case"GtE":return!1}if(e===Sk.builtin.none.none$)switch(n){case"Lt":case"LtE":return!1;case"Gt":case"GtE":return!0}if(-1!==l&&-1!==r)switch(n){case"Lt":case"LtE":return!0;case"Gt":case"GtE":return!1}if(-1!==s&&-1!==a)switch(n){case"Lt":case"LtE":return!1;case"Gt":case"GtE":return!0}if(-1!==s&&-1!==r)switch(n){case"Lt":return sr;case"GtE":return s>=r}}if("Is"===n)return t===e;if("IsNot"===n)return t!==e;if("In"===n)return Sk.misceval.chain(Sk.abstr.sequenceContains(e,t,i),Sk.misceval.isTrue);if("NotIn"===n)return Sk.misceval.chain(Sk.abstr.sequenceContains(e,t,i),(function(t){return!Sk.misceval.isTrue(t)}));if(l=(r={Eq:"ob$eq",NotEq:"ob$ne",Gt:"ob$gt",GtE:"ob$ge",Lt:"ob$lt",LtE:"ob$le"})[n],o&&(i=e[i=r[Sk.misceval.swappedOp_[n]]](t))!==Sk.builtin.NotImplemented.NotImplemented$||(i=t[l](e))!==Sk.builtin.NotImplemented.NotImplemented$||!o&&(i=e[i=r[Sk.misceval.swappedOp_[n]]](t))!==Sk.builtin.NotImplemented.NotImplemented$)return Sk.misceval.isTrue(i);if(!Sk.__future__.python3){if(o=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$cmp))try{if(i=Sk.misceval.callsimArray(o,[e]),Sk.builtin.checkNumber(i)){if(i=Sk.builtin.asnum$(i),"Eq"===n)return 0===i;if("NotEq"===n)return 0!==i;if("Lt"===n)return 0>i;if("Gt"===n)return 0=i;if("GtE"===n)return 0<=i}if(i!==Sk.builtin.NotImplemented.NotImplemented$)throw new Sk.builtin.TypeError("comparison did not return an int")}catch(t){throw new Sk.builtin.TypeError("comparison did not return an int")}if(o=Sk.abstr.lookupSpecial(e,Sk.builtin.str.$cmp))try{if(i=Sk.misceval.callsimArray(o,[t]),Sk.builtin.checkNumber(i)){if(i=Sk.builtin.asnum$(i),"Eq"===n)return 0===i;if("NotEq"===n)return 0!==i;if("Lt"===n)return 0i;if("LtE"===n)return 0<=i;if("GtE"===n)return 0>=i}if(i!==Sk.builtin.NotImplemented.NotImplemented$)throw new Sk.builtin.TypeError("comparison did not return an int")}catch(t){throw new Sk.builtin.TypeError("comparison did not return an int")}if(t===Sk.builtin.none.none$&&e===Sk.builtin.none.none$){if("Eq"===n)return t.v===e.v;if("NotEq"===n)return t.v!==e.v;if("Gt"===n)return t.v>e.v;if("GtE"===n)return t.v>=e.v;if("Lt"===n)return t.v";throw t}},Sk.exportSymbol("Sk.misceval.objectRepr",Sk.misceval.objectRepr),Sk.misceval.opAllowsEquality=function(t){switch(t){case"LtE":case"Eq":case"GtE":return!0}return!1},Sk.exportSymbol("Sk.misceval.opAllowsEquality",Sk.misceval.opAllowsEquality),Sk.misceval.isTrue=function(t){return!0===t||t===Sk.builtin.bool.true$||!1!==t&&t!==Sk.builtin.bool.false$&&null!=t&&(t.nb$bool?t.nb$bool():t.sq$length?0!==t.sq$length():!!t)},Sk.exportSymbol("Sk.misceval.isTrue",Sk.misceval.isTrue),Sk.misceval.softspace_=!1,Sk.misceval.print_=function(t){Sk.misceval.softspace_&&("\n"!==t&&Sk.output(" "),Sk.misceval.softspace_=!1);var e=new Sk.builtin.str(t);return Sk.misceval.chain(Sk.importModule("sys",!1,!0),(function(t){return Sk.misceval.apply(t.$d.stdout.write,void 0,void 0,void 0,[t.$d.stdout,e])}),(function(){var t;(t=0===e.v.length)||(t=!("\n"===(t=e.v[e.v.length-1])||"\t"===t||"\r"===t)),(t||" "===e.v[e.v.length-1])&&(Sk.misceval.softspace_=!0)}))},Sk.exportSymbol("Sk.misceval.print_",Sk.misceval.print_),Sk.misceval.loadname=function(t,e){if(void 0!==(e=e[t]))return e;if(void 0!==(e=Sk.builtins[t]))return e;throw new Sk.builtin.NameError("name '"+Sk.unfixReserved(t)+"' is not defined")},Sk.exportSymbol("Sk.misceval.loadname",Sk.misceval.loadname),Sk.misceval.call=function(t,e,n,i,s){return s=Array.prototype.slice.call(arguments,4),Sk.misceval.apply(t,e,n,i,s)},Sk.exportSymbol("Sk.misceval.call",Sk.misceval.call),Sk.misceval.callAsync=function(t,e,n,i,s,r){return r=Array.prototype.slice.call(arguments,5),Sk.misceval.applyAsync(t,e,n,i,s,r)},Sk.exportSymbol("Sk.misceval.callAsync",Sk.misceval.callAsync),Sk.misceval.callOrSuspend=function(t,e,n,i,s){return s=Array.prototype.slice.call(arguments,4),Sk.misceval.applyOrSuspend(t,e,n,i,s)},Sk.exportSymbol("Sk.misceval.callOrSuspend",Sk.misceval.callOrSuspend),Sk.misceval.callsim=function(t,e){return e=Array.prototype.slice.call(arguments,1),Sk.misceval.apply(t,void 0,void 0,void 0,e)},Sk.exportSymbol("Sk.misceval.callsim",Sk.misceval.callsim),Sk.misceval.callsimArray=function(t,e,n){return e=e||[],Sk.misceval.retryOptionalSuspensionOrThrow(Sk.misceval.callsimOrSuspendArray(t,e,n))},Sk.exportSymbol("Sk.misceval.callsimArray",Sk.misceval.callsimArray),Sk.misceval.callsimAsync=function(t,e,n){return n=Array.prototype.slice.call(arguments,2),Sk.misceval.applyAsync(t,e,void 0,void 0,void 0,n)},Sk.exportSymbol("Sk.misceval.callsimAsync",Sk.misceval.callsimAsync),Sk.misceval.callsimOrSuspend=function(t,e){return e=Array.prototype.slice.call(arguments,1),Sk.misceval.applyOrSuspend(t,void 0,void 0,void 0,e)},Sk.exportSymbol("Sk.misceval.callsimOrSuspend",Sk.misceval.callsimOrSuspend),Sk.misceval.callsimOrSuspendArray=function(t,e,n){return e=e||[],void 0!==t&&t.tp$call?t.tp$call(e,n):Sk.misceval.applyOrSuspend(t,void 0,void 0,n,e)},Sk.exportSymbol("Sk.misceval.callsimOrSuspendArray",Sk.misceval.callsimOrSuspendArray),Sk.misceval.apply=function(t,e,n,i,s){return(t=Sk.misceval.applyOrSuspend(t,e,n,i,s))instanceof Sk.misceval.Suspension?Sk.misceval.retryOptionalSuspensionOrThrow(t):t},Sk.exportSymbol("Sk.misceval.apply",Sk.misceval.apply),Sk.misceval.asyncToPromise=function(t,e){return new Promise((function(n,i){try{!function t(s){try{for(var r=function(){try{t(s.resume())}catch(t){i(t)}},o=function(t){try{s.data.result=t,r()}catch(t){i(t)}},a=function(t){try{s.data.error=t,r()}catch(t){i(t)}};s instanceof Sk.misceval.Suspension;){var l=e&&(e[s.data.type]||e["*"]);if(l){var u=l(s);if(u)return void u.then(t,i)}if("Sk.promise"==s.data.type)return void s.data.promise.then(o,a);if("Sk.yield"==s.data.type)return void Sk.global.setImmediate(r);if("Sk.delay"==s.data.type)return void Sk.global.setImmediate(r);if(!s.optional)throw new Sk.builtin.SuspensionError("Unhandled non-optional suspension of type '"+s.data.type+"'");s=s.resume()}n(s)}catch(t){i(t)}}(t())}catch(t){i(t)}}))},Sk.exportSymbol("Sk.misceval.asyncToPromise",Sk.misceval.asyncToPromise),Sk.misceval.applyAsync=function(t,e,n,i,s,r){return Sk.misceval.asyncToPromise((function(){return Sk.misceval.applyOrSuspend(e,n,i,s,r)}),t)},Sk.exportSymbol("Sk.misceval.applyAsync",Sk.misceval.applyAsync),Sk.misceval.chain=function(t,e){for(var n,i,s=1,r=t;;){if(s==arguments.length)return r;if(r&&r.$isSuspension)break;r=arguments[s](r),s++}for(i=Array(arguments.length-s),n=0;nt[i++]},e,n)},Sk.misceval.arrayFromIterable=function(t,e){if(void 0===t)return[];if(void 0===t.ht$type&&void 0!==t.sk$asarray)return t.sk$asarray();const n=[];return t=Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{n.push(t)})),(()=>n)),e?t:Sk.misceval.retryOptionalSuspensionOrThrow(t)},Sk.misceval.Break=function(t){if(!(this instanceof Sk.misceval.Break))return new Sk.misceval.Break(t);this.brValue=t},Sk.exportSymbol("Sk.misceval.Break",Sk.misceval.Break),Sk.misceval.applyOrSuspend=function(t,e,n,i,s){var r;if(null==t||t===Sk.builtin.none.none$)throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object is not callable");"function"==typeof t&&void 0===t.tp$call&&(t=new Sk.builtin.func(t));var o=t.tp$call;if(void 0!==o){if(n)for(r=(n=n.tp$iter()).tp$iternext();void 0!==r;r=n.tp$iternext())s.push(r);if(e)for(r=(n=Sk.abstr.iter(e)).tp$iternext();void 0!==r;r=n.tp$iternext()){if(!Sk.builtin.checkString(r))throw new Sk.builtin.TypeError("Function keywords must be strings");i.push(r.v),i.push(Sk.abstr.objectGetItem(e,r,!1))}return o.call(t,s,i,e)}if(void 0!==(o=t.__call__))return s.unshift(t),Sk.misceval.apply(o,e,n,i,s);throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object is not callable")},Sk.exportSymbol("Sk.misceval.applyOrSuspend",Sk.misceval.applyOrSuspend),Sk.misceval.promiseToSuspension=function(t){var e=new Sk.misceval.Suspension;return e.resume=function(){if(e.data.error)throw e.data.error;return e.data.result},e.data={type:"Sk.promise",promise:t},e},Sk.exportSymbol("Sk.misceval.promiseToSuspension",Sk.misceval.promiseToSuspension),Sk.misceval.buildClass=function(t,e,n,i,s,r){n=new Sk.builtin.str(n);const o=new Sk.builtin.tuple(i);let a;i=i||[];var l=!0;const u=(r=r||[]).indexOf("metaclass");-1{if(t=t.ob$type,!n.$isSubType(t)){if(!t.$isSubType(n))throw new Sk.builtin.TypeError("metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases");n=t}})),n}(a,i));let c=null;a!==Sk.builtin.type&&([c,h]=function(t,e,n,i,s){const r=t.tp$getattr(Sk.builtin.str.$prepare);let o,a=null;if(void 0===r)return[a,o];if(a=Sk.misceval.callsimArray(r,[e,n],i),!Sk.builtin.checkMapping(a))throw new Sk.builtin.TypeError(s?t.prototype.tp$name:".__prepare__() must return a mapping not '"+Sk.abstr.typeName(a)+"'");return o={get(t,e){try{return Sk.abstr.objectGetItem(t,new Sk.builtin.str(Sk.unfixReserved(e)))}catch(t){if(!(t instanceof Sk.builtin.KeyError))throw t}},set:(t,e,n)=>(Sk.abstr.objectSetItem(t,new Sk.builtin.str(Sk.unfixReserved(e)),n),!0)},[a,o]}(a,n,o,r,l)),i=!1;let p={};if(null===c)c=new Sk.builtin.dict([]);else if(c.constructor===Sk.builtin.dict||function(){const t=(Sk.global.navigator||{}).userAgent||"";return-1{Sk.abstr.objectSetItem(c,new Sk.builtin.str(t),p[t])})),Sk.misceval.callsimOrSuspendArray(a,[n,o,c],r)},Sk.exportSymbol("Sk.misceval.buildClass",Sk.misceval.buildClass)},function(t,e){Sk.builtin.callable_iter_=Sk.abstr.buildIteratorClass("callable_iterator",{constructor:function(t,e){if(!Sk.builtin.checkCallable(t))throw new Sk.builtin.TypeError("iter(v, w): v must be callable");this.$callable=t,this.$sentinel=e,this.$flag=!1},iternext(t){if(!0!==this.$flag){if(t)return t=Sk.misceval.callsimOrSuspendArray(this.$callable,[]),Sk.misceval.chain(t,(t=>{if(!Sk.misceval.richCompareBool(t,this.$sentinel,"Eq",!0))return t;this.$flag=!0}));if(t=Sk.misceval.callsimArray(this.$callable,[]),!Sk.misceval.richCompareBool(t,this.$sentinel,"Eq",!1))return t;this.$flag=!0}},flags:{sk$unacceptableBase:!0}}),Sk.builtin.seq_iter_=Sk.abstr.buildIteratorClass("iterator",{constructor:function(t){this.$index=0,this.$seq=t},iternext(t){let e;return e=Sk.misceval.tryCatch((()=>this.$seq.mp$subscript(new Sk.builtin.int_(this.$index++),t)),(t=>{if(!(t instanceof Sk.builtin.IndexError||t instanceof Sk.builtin.StopIteration))throw t;this.gi$ret=t.$value||Sk.builtin.none.none$})),t?e:Sk.misceval.retryOptionalSuspensionOrThrow(e)},methods:{__length_hint__:{$flags:{NoArgs:!0},$meth(){if(this.$seq.sq$length)return this.$seq.sq$length()-this.$index;throw new Sk.builtin.NotImplementedError("len is not implemented for "+Sk.abstr.typeName(this.$seq))}}},flags:{sk$unacceptableBase:!0}}),Sk.exportSymbol("Sk.builtin.callable_iter_",Sk.builtin.callable_iter_)},function(t,e){Sk.builtin.list=Sk.abstr.buildNativeClass("list",{constructor:function(t){void 0===t?t=[]:Array.isArray(t)||(t=Sk.misceval.arrayFromIterable(t)),Sk.asserts.assert(this instanceof Sk.builtin.list,"bad call to list, use 'new' with an Array of python objects"),this.v=t,this.in$repr=!1},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$hash:Sk.builtin.none.none$,tp$doc:"Built-in mutable sequence.\n\nIf no argument is given, the constructor creates a new empty list.\nThe argument must be an iterable if specified.",tp$new:Sk.generic.new,tp$init(t,e){return Sk.abstr.checkNoKwargs("list",e),Sk.abstr.checkArgsLen("list",t,0,1),Sk.misceval.chain(Sk.misceval.arrayFromIterable(t[0],!0),(t=>{this.v=t}))},$r(){if(this.in$repr)return new Sk.builtin.str("[...]");this.in$repr=!0;const t=this.v.map((t=>Sk.misceval.objectRepr(t)));return this.in$repr=!1,new Sk.builtin.str("["+t.join(", ")+"]")},tp$richcompare:Sk.generic.seqCompare,tp$iter(){return new n(this)},sq$length(){return this.v.length},sq$concat(t){if(!(t instanceof Sk.builtin.list))throw new Sk.builtin.TypeError("can only concatenate list to list");return new Sk.builtin.list(this.v.concat(t.v))},sq$contains(t){for(let e=this.tp$iter(),n=e.tp$iternext();void 0!==n;n=e.tp$iternext())if(n===t||Sk.misceval.richCompareBool(n,t,"Eq"))return!0;return!1},sq$repeat(t){if(!Sk.misceval.isIndex(t))throw new Sk.builtin.TypeError("can't multiply sequence by non-int of type '"+Sk.abstr.typeName(t)+"'");if((t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError))*this.v.length>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError;const e=[];for(let n=0;n{e.push(this.v[t])})),new Sk.builtin.list(e)}throw new Sk.builtin.TypeError("list indices must be integers or slices, not "+Sk.abstr.typeName(t))},mp$ass_subscript(t,e){void 0===e?this.del$subscript(t):this.ass$subscript(t,e)},sq$inplace_concat(t){return t===this?(this.v.push(...this.v),this):Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{this.v.push(t)})),(()=>this))},sq$inplace_repeat(t){if(!Sk.misceval.isIndex(t))throw new Sk.builtin.TypeError("can't multiply sequence by non-int of type '"+Sk.abstr.typeName(t)+"'");t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError);const e=this.v.length;if(0>=t)this.v.length=0;else if(t*e>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError;for(let n=1;n{this.v.push(t)})),(()=>Sk.builtin.none.none$))},$flags:{OneArg:!0},$textsig:"($self, iterable, /)",$doc:"Extend list by appending elements from the iterable."},pop:{$meth(t){t=void 0===t?this.v.length-1:Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError),t=this.list$inRange(t,"pop index out of range");const e=this.v[t];return this.v.splice(t,1),e},$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, index=-1, /)",$doc:"Remove and return item at index (default last).\n\nRaises IndexError if list is empty or index is out of range."},remove:{$meth(t){if(-1===(t=this.list$indexOf(t)))throw new Sk.builtin.ValueError("list.remove(x): x not in list");return this.v.splice(t,1),Sk.builtin.none.none$},$flags:{OneArg:!0},$textsig:"($self, value, /)",$doc:"Remove first occurrence of value.\n\nRaises ValueError if the value is not present."},sort:{$meth(t,e){if(t.length)throw new Sk.builtin.TypeError("sort() takes no positional arguments");const[n,i]=Sk.abstr.copyKeywordsToNamedArgs("sort",["key","reverse"],t,e,[Sk.builtin.none.none$,Sk.builtin.bool.false$]);return this.list$sort(void 0,n,i)},$flags:{FastCall:!0},$textsig:"($self, /, *, key=None, reverse=False)",$doc:"Stable sort *IN PLACE*."},index:{$meth(t,e,n){if(void 0!==e&&!Sk.misceval.isIndex(e)||void 0!==n&&!Sk.misceval.isIndex(n))throw new Sk.builtin.TypeError("slice indices must be integers or have an __index__ method");if(-1===(e=this.list$indexOf(t,e,n)))throw new Sk.builtin.ValueError(Sk.misceval.objectRepr(t)+" is not in list");return new Sk.builtin.int_(e)},$flags:{MinArgs:1,MaxArgs:3},$textsig:"($self, value, start=0, stop=sys.maxsize, /)",$doc:"Return first index of value.\n\nRaises ValueError if the value is not present."},count:{$meth(t){let e=0;const n=this.v.length;for(let i=0;it&&(t+=this.v.length),0<=t&&t{n.push(t)})),!Sk.builtin.checkIterable(e))throw new Sk.builtin.TypeError("must assign iterable to extended slice");if(t=Sk.misceval.arrayFromIterable(e),n.length!==t.length)throw new Sk.builtin.ValueError("attempt to assign sequence of size "+t.length+" to extended slice of size "+n.length);for(e=0;e{this.v.splice(t-n,1),n+=e}))},valueOf(){return this.v}}}),Sk.exportSymbol("Sk.builtin.list",Sk.builtin.list),Sk.builtin.list.py2$methods={sort:{$name:"sort",$meth(t,e){const[n,i,s]=Sk.abstr.copyKeywordsToNamedArgs("sort",["cmp","key","reverse"],t,e,[Sk.builtin.none.none$,Sk.builtin.none.none$,Sk.builtin.bool.false$]);return this.list$sort(n,i,s)},$flags:{FastCall:!0},$textsig:"($self, cmp=None, key=None, reverse=False)",$doc:"Stable sort *IN PLACE*."}};var n=Sk.abstr.buildIteratorClass("list_iterator",{constructor:function(t){this.$index=0,this.$seq=t.v},iternext:Sk.generic.iterNextWithArray,methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$unacceptableBase:!0}}),i=Sk.abstr.buildIteratorClass("list_reverseiterator",{constructor:function(t){this.$index=t.v.length-1,this.$seq=t.v},iternext(){const t=this.$seq[this.$index--];if(void 0!==t)return t;this.tp$iternext=()=>{}},methods:{__length_hint__:Sk.generic.iterReverseLengthHintMethodDef},flags:{sk$unacceptableBase:!0}})},function(t,e,n){function i(t){var e=t.replace(y,"").replace(T,"_").toLowerCase();return void 0===(e=k[e])?t:e}function s(t,e,n){if(void 0===e)e="utf-8";else{if(!Sk.builtin.checkString(e))throw new Sk.builtin.TypeError(t+"() argument "+("bytesstr".includes(t)?2:1)+" must be str not "+Sk.abstr.typeName(e));e=e.$jsstr()}if(void 0===n)n="strict";else{if(!Sk.builtin.checkString(n))throw new Sk.builtin.TypeError(t+"() argument "+("bytesstr".includes(t)?3:2)+" must be str not "+Sk.abstr.typeName(n));n=n.$jsstr()}return{encoding:e,errors:n}}function r(t,e,n){if(t=t.$jsstr(),e=i(e),"strict"!==n&&"ignore"!==n&&"replace"!==n)throw new Sk.builtin.NotImplementedError("'"+n+"' error handling not implemented in Skulpt");if("ascii"===e){for(s in e=[],t){const i=t.charCodeAt(s);if(127=t?"\\x":"\\u";return 3===(t=t.toString(16)).length&&(t=t.slice(1,3)),1===t.length?e+"0"+t:e+t}function a(t,e){if(({encoding:t,errors:e}=s("decode",t,e)),t=i(t),"strict"!==e&&"ignore"!==e&&"replace"!==e)throw new Sk.builtin.NotImplementedError("'"+e+"' error handling not implemented in Skulpt");if("ascii"===t){t=this.v;var n="";for(let i=0;i=n&&en)return new Sk.builtin.tuple([new Sk.builtin.bytes,new Sk.builtin.bytes,this])}else if(n=this.find$subleft(e,0,this.v.length),0>n)return new Sk.builtin.tuple([this,new Sk.builtin.bytes,new Sk.builtin.bytes]);return new Sk.builtin.tuple([new Sk.builtin.bytes(this.v.subarray(0,n)),new Sk.builtin.bytes(e),new Sk.builtin.bytes(this.v.subarray(n+e.length))])}}function p(t,e){return function(n){var i=void 0===n||n===Sk.builtin.none.none$?new Uint8Array([9,10,11,12,13,32,133]):this.get$raw(n);n=0;var s=this.v.length;if(t)for(;nn&&i.includes(this.v[s-1]);)s--;for(i=new Uint8Array(s-n),s=0;s=t||32===t}function d(t){return 97<=t&&122>=t}function f(t){return 65<=t&&90>=t}function m(t){return 48<=t&&57>=t}function g(t,e){return function(){return 0===this.v.length?e?Sk.builtin.bool.true$:Sk.builtin.bool.false$:this.v.every((e=>t(e)))?Sk.builtin.bool.true$:Sk.builtin.bool.false$}}function b(t,e){return function(){let n=!1;for(let i=0;i0<=t&&255>=t)),"bad internal call to bytes with array"),this.v=new Uint8Array(t);else if("string"==typeof t){let e;const n=new Uint8Array(t.length),i=t.length;for(let s=0;s bytes\nbytes(string, encoding[, errors]) -> bytes\nbytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\nbytes(int) -> bytes object of size given by the parameter initialized with null bytes\nbytes() -> empty bytes object\n\nConstruct an immutable array of bytes from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - any object implementing the buffer API.\n - an integer",tp$new(t,e){if(this!==Sk.builtin.bytes.prototype)return this.$subtype_new(t,e);let n;if(e=e||[],!(1>=t.length&&0==+e.length)){if([t,e,n]=Sk.abstr.copyKeywordsToNamedArgs("bytes",[null,"pySource","errors"],t,e),({encoding:e,errors:n}=s("bytes",e,n)),!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("encoding or errors without a string argument");return r(t,e,n)}if(void 0===(t=t[0]))return new Sk.builtin.bytes;if(void 0!==(e=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$bytes)))return t=Sk.misceval.callsimOrSuspendArray(e,[]),Sk.misceval.chain(t,(t=>{if(!Sk.builtin.checkBytes(t))throw new Sk.builtin.TypeError("__bytes__ returned non-bytes (type "+Sk.abstr.typeName(t)+")");return t}));if(Sk.misceval.isIndex(t)){if(0>(t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError)))throw new Sk.builtin.ValueError("negative count");return new Sk.builtin.bytes(t)}if(Sk.builtin.checkBytes(t))return new Sk.builtin.bytes(t.v);if(Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("string argument without an encoding");if(Sk.builtin.checkIterable(t)){let e=[];return t=Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{if(0>(t=Sk.misceval.asIndexSized(t))||255new Sk.builtin.bytes(e)))}throw new Sk.builtin.TypeError("cannot convert '"+Sk.abstr.typeName(t)+"' object into bytes")},$r(){let t,e="'";const n=-1!==this.v.indexOf(34);let i="";for(let s=0;st||10t||13t||126t.length||n[i]>t[i];case"GtE":return i===s&&n.length>=t.length||n[i]>=t[i]}},tp$hash(){return new Sk.builtin.str(this.$jsstr()).tp$hash()},tp$as_sequence_or_mapping:!0,mp$subscript(t){if(Sk.misceval.isIndex(t)){let e=Sk.misceval.asIndexSized(t,Sk.builtin.IndexError);if(void 0!==e){if(0>e&&(e=this.v.length+e),0>e||e>=this.v.length)throw new Sk.builtin.IndexError("index out of range");return new Sk.builtin.int_(this.v[e])}}else if(t instanceof Sk.builtin.slice){const e=[];return t.sssiter$(this.v.length,(t=>{e.push(this.v[t])})),new Sk.builtin.bytes(new Uint8Array(e))}throw new Sk.builtin.TypeError("byte indices must be integers or slices, not "+Sk.abstr.typeName(t))},sq$length(){return this.v.length},sq$concat(t){if(!(t instanceof Sk.builtin.bytes))throw new Sk.builtin.TypeError("can't concat "+Sk.abstr.typeName(t)+" to bytes");const e=new Uint8Array(this.v.length+t.v.length);let n;for(n=0;nNumber.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError;if(0>=t)return new Sk.builtin.bytes;t=new Uint8Array(e);let n=0;for(;n(t=Sk.misceval.asIndexOrThrow(t,"argument should be integer or bytes-like object, not {tp$name}"))||255(e=Sk.misceval.asIndexSized(e,Sk.builtin.OverflowError))?1/0:e,null!==(t=Sk.builtin.checkNone(t)?null:this.get$raw(t))&&!t.length)throw new Sk.builtin.ValueError("empty separator");return{sep:t,maxsplit:e}},find$left:u(!1),find$right:u(!0),find$subleft:function(t,e,n){n=n-t.length+1;let i=e;for(;it===this.v[i+e])))return i;i++}return-1},find$subright(t,e,n){let i=n-t.length;for(;i>=e;){if(t.every(((t,e)=>t===this.v[i+e])))return i;i--}return-1},$subtype_new(t,e){const n=new this.constructor;return t=Sk.builtin.bytes.prototype.tp$new(t,e),n.v=t.v,n},sk$asarray(){const t=[];return this.v.forEach((e=>{t.push(new Sk.builtin.int_(e))})),t},valueOf(){return this.v}},flags:{str$encode:r,$decode:a,check$encodeArgs:s},methods:{__getnewargs__:{$meth(){return new Sk.builtin.tuple(new Sk.builtin.bytes(this.v))},$flags:{NoArgs:!0},$textsig:null,$doc:null},capitalize:{$meth(){const t=this.v.length;if(0===t)return new Sk.builtin.bytes(this.v);const e=new Uint8Array(t);let n=this.v[0];e[0]=d(n)?n-32:n;for(let i=1;i copy of B\n\nReturn a copy of B with only its first character capitalized (ASCII)\nand the rest lower-cased."},center:{$meth:h("center",!1,!0),$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"B.center(width[, fillchar]) -> copy of B\n\nReturn B centered in a string of length width. Padding is\ndone using the specified fill character (default is a space)."},count:{$meth(t,e,n){t=this.get$tgt(t),({start:e,end:n}=Sk.builtin.slice.startEnd$wrt(this,e,n));let i=0;if("number"==typeof t)for(;et===this.v[s+e]))&&(i++,s+=t.length-1)}return new Sk.builtin.int_(i)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.count(sub[, start[, end]]) -> int\n\nReturn the number of non-overlapping occurrences of subsection sub in\nbytes B[start:end]. Optional arguments start and end are interpreted\nas in slice notation."},decode:{$meth:a,$flags:{NamedArgs:["encoding","errors"]},$textsig:"($self, /, encoding='utf-8', errors='strict')",$doc:"Decode the bytes using the codec registered for encoding.\n\n encoding\n The encoding with which to decode the bytes.\n errors\n The error handling scheme to use for the handling of decoding errors.\n The default is 'strict' meaning that decoding errors raise a\n UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n as well as any other name registered with codecs.register_error that\n can handle UnicodeDecodeErrors."},endswith:{$meth:l("endswith",((t,e)=>{const n=t.length-e.length;return 0<=n&&e.every(((e,i)=>e===t[n+i]))})),$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if B ends with the specified suffix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nsuffix can also be a tuple of bytes to try."},expandtabs:{$meth(t){t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError,"an integer is required (got type {tp$nam})");const e=[];let n=0;for(let s=0;s copy of B\n\nReturn a copy of B where all tab characters are expanded using spaces.\nIf tabsize is not given, a tab size of 8 characters is assumed."},find:{$meth:function(t,e,n){return new Sk.builtin.int_(this.find$left(t,e,n))},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."},hex:{$meth(){let t="";for(let e=0;e string\n\nCreate a string of hexadecimal numbers from a bytes object.\nExample: b'\\xb9\\x01\\xef'.hex() -> 'b901ef'."},index:{$meth:function(t,e,n){if(-1===(t=this.find$left(t,e,n)))throw new Sk.builtin.ValueError("subsection not found");return new Sk.builtin.int_(t)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the subsection is not found."},isalnum:{$meth:g((t=>m(t)||d(t)||f(t))),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isalnum() -> bool\n\nReturn True if all characters in B are alphanumeric\nand there is at least one character in B, False otherwise."},isalpha:{$meth:g((t=>65<=t&&90>=t||97<=t&&122>=t)),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isalpha() -> bool\n\nReturn True if all characters in B are alphabetic\nand there is at least one character in B, False otherwise."},isascii:{$meth:g((t=>0<=t&&127>=t),!0),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isascii() -> bool\n\nReturn True if B is empty or all characters in B are ASCII,\nFalse otherwise."},isdigit:{$meth:g(m),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isdigit() -> bool\n\nReturn True if all characters in B are digits\nand there is at least one character in B, False otherwise."},islower:{$meth:b(d,f),$flags:{NoArgs:!0},$textsig:null,$doc:"B.islower() -> bool\n\nReturn True if all cased characters in B are lowercase and there is\nat least one cased character in B, False otherwise."},isspace:{$meth:g(_),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isspace() -> bool\n\nReturn True if all characters in B are whitespace\nand there is at least one character in B, False otherwise."},istitle:{$meth:function(){let t=!1,e=!1;for(let n=0;n bool\n\nReturn True if B is a titlecased string and there is at least one\ncharacter in B, i.e. uppercase characters may only follow uncased\ncharacters and lowercase characters only cased ones. Return False\notherwise."},isupper:{$meth:b(f,d),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isupper() -> bool\n\nReturn True if all cased characters in B are uppercase and there is\nat least one cased character in B, False otherwise."},join:{$meth(t){const e=[];let n=0;return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{if(!(t instanceof Sk.builtin.bytes))throw new Sk.builtin.TypeError("sequence item "+n+": expected a bytes-like object, "+Sk.abstr.typeName(t)+" found");n++,e.length&&e.push(...this.v),e.push(...t.v)})),(()=>new Sk.builtin.bytes(new Uint8Array(e))))},$flags:{OneArg:!0},$textsig:"($self, iterable_of_bytes, /)",$doc:"Concatenate any number of bytes objects.\n\nThe bytes whose method is called is inserted in between each pair.\n\nThe result is returned as a new bytes object.\n\nExample: b'.'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'."},ljust:{$meth:h("ljust",!1,!1),$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"B.ljust(width[, fillchar]) -> copy of B\n\nReturn B left justified in a string of length width. Padding is\ndone using the specified fill character (default is a space)."},lower:{$meth:S((t=>f(t)?t+32:t)),$flags:{NoArgs:!0},$textsig:null,$doc:"B.lower() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to lowercase."},lstrip:{$meth:p(!0,!1),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, bytes=None, /)",$doc:"Strip leading bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading ASCII whitespace."},partition:{$meth:c(!1),$flags:{OneArg:!0},$textsig:"($self, sep, /)",$doc:"Partition the bytes into three parts using the given separator.\n\nThis will search for the separator sep in the bytes. If the separator is found,\nreturns a 3-tuple containing the part before the separator, the separator\nitself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing the original bytes\nobject and two empty bytes objects."},replace:{$meth(t,e,n){t=this.get$raw(t),e=this.get$raw(e),n=0>(n=void 0===n?-1:Sk.misceval.asIndexSized(n,Sk.builtin.OverflowError))?1/0:n;const i=[];let s=0;for(var r=0;r int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."},rindex:{$meth:function(t,e,n){if(-1===(t=this.find$right(t,e,n)))throw new Sk.builtin.ValueError("subsection not found");return new Sk.builtin.int_(t)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaise ValueError when the subsection is not found."},rjust:{$meth:h("rjust",!0,!1),$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"B.rjust(width[, fillchar]) -> copy of B\n\nReturn B right justified in a string of length width. Padding is\ndone using the specified fill character (default is a space)"},rpartition:{$meth:c(!0),$flags:{OneArg:!0},$textsig:"($self, sep, /)",$doc:"Partition the bytes into three parts using the given separator.\n\nThis will search for the separator sep in the bytes, starting at the end. If\nthe separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing two empty bytes\nobjects and the original bytes object."},rsplit:{$meth:function(t,e){({sep:t,maxsplit:e}=this.get$splitArgs(t,e));const n=[];let i=0,s=this.v.length;if(null!==t){for(;0<=s&&is)break;for(t=s+1,s--;0<=s&&!_(this.v[s]);)s--;n.push(new Sk.builtin.bytes(this.v.subarray(s+1,t))),i++}if(0<=s){for(;_(this.v[s]);)s--;0<=s&&n.push(new Sk.builtin.bytes(this.v.subarray(0,s+1)))}}return new Sk.builtin.list(n.reverse())},$flags:{NamedArgs:["sep","maxsplit"],Defaults:[Sk.builtin.none.none$,-1]},$textsig:"($self, /, sep=None, maxsplit=-1)",$doc:"Return a list of the sections in the bytes, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytes.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.\n\nSplitting is done starting at the end of the bytes and working to the front."},rstrip:{$meth:p(!1,!0),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, bytes=None, /)",$doc:"Strip trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip trailing ASCII whitespace."},split:{$meth:function(t,e){({sep:t,maxsplit:e}=this.get$splitArgs(t,e));const n=[],i=this.v.length;let s=0,r=0;if(null!==t){for(;re.length<=t.length&&e.every(((e,n)=>e===t[n])))),$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if B starts with the specified prefix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nprefix can also be a tuple of bytes to try."},strip:{$meth:p(!0,!0),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, bytes=None, /)",$doc:"Strip leading and trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading and trailing ASCII whitespace."},swapcase:{$meth:S((t=>f(t)?t+32:d(t)?t-32:t)),$flags:{NoArgs:!0},$textsig:null,$doc:"B.swapcase() -> copy of B\n\nReturn a copy of B with uppercase ASCII characters converted\nto lowercase ASCII and vice versa."},title:{$meth(){const t=this.v.length,e=new Uint8Array(t);let n=!1;for(let i=0;i copy of B\n\nReturn a titlecased version of B, i.e. ASCII words start with uppercase\ncharacters, all remaining cased characters have lowercase."},upper:{$meth:S((t=>d(t)?t-32:t)),$flags:{NoArgs:!0},$textsig:null,$doc:"B.upper() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to uppercase."},zfill:{$meth(t){const e=(t=Sk.misceval.asIndexSized(t,Sk.builtin.IndexError))-this.v.length;if(0>=e)return new Sk.builtin.bytes(this.v);const n=new Uint8Array(t);let i,s=0;for(43!==this.v[0]&&45!==this.v[0]||(n[0]=this.v[0],s++),n.fill(48,s,s+e),i=s,s+=e;s copy of B\n\nPad a numeric string B with zeros on the left, to fill a field\nof the specified width. B is never truncated."}},classmethods:{fromhex:{$meth:function(t){function e(e){for(let n=o;n b'\\\\xb9\\\\x01\\\\xef'."}}});var w=Sk.abstr.buildIteratorClass("bytes_iterator",{constructor:function(t){this.$index=0,this.$seq=t.v},iternext(){const t=this.$seq[this.$index++];if(void 0!==t)return new Sk.builtin.int_(t)},methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$unacceptableBase:!0}});Sk.exportSymbol("Sk.builtin.bytes",Sk.builtin.bytes)},function(t,e,n){(function(t){!function(t){function e(){}function n(){}var i=String.fromCharCode,s={}.toString,r=s.call(t.SharedArrayBuffer),o=s(),a=t.Uint8Array,l=a||Array,u=a?ArrayBuffer:l,c=u.isView||function(t){return t&&"length"in t},p=s.call(u.prototype);u=n.prototype;var h=t.TextEncoder,_=new(a?Uint16Array:l)(32);e.prototype.decode=function(t){if(!c(t)){var e=s.call(t);if(e!==p&&e!==r&&e!==o)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");t=a?new l(t):t||[]}for(var n,u,h,d=e="",f=0,m=0|t.length,g=m-32|0,b=0,S=0,k=0,y=-1;f>4){case 15:if(2!=(h=255&t[f=f+1|0])>>6||247>6?S+4|0:24,u=u+256&768;case 13:case 12:b<<=6,b|=(31&u)<<6|63&(h=255&t[f=f+1|0]),S=S+7|0,f>6&&b>>S&&1114112>b?(u=b,0<=(b=b-65536|0)&&(y=55296+(b>>10)|0,u=56320+(1023&b)|0,31>k?(_[k]=y,k=k+1|0,y=-1):(h=y,y=u,u=h))):(f=f-(u>>=8)-1|0,u=65533),b=S=0,n=f<=g?32:m-f|0;default:_[k]=u;continue;case 11:case 10:case 9:case 8:}_[k]=65533}if(d+=i(_[0],_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10],_[11],_[12],_[13],_[14],_[15],_[16],_[17],_[18],_[19],_[20],_[21],_[22],_[23],_[24],_[25],_[26],_[27],_[28],_[29],_[30],_[31]),32>k&&(d=d.slice(0,k-32|0)),f>>31,y=-1,d.length=o)i[s]=o;else{if(2047>=o)i[s]=192|o>>6;else{t:{if(55296<=o)if(56319>=o){var u=0|t.charCodeAt(e=e+1|0);if(56320<=u&&57343>=u){if(65535<(o=(o<<10)+u-56613888|0)){i[s]=240|o>>18,i[s=s+1|0]=128|o>>12&63,i[s=s+1|0]=128|o>>6&63,i[s=s+1|0]=128|63&o;continue}break t}o=65533}else 57343>=o&&(o=65533);!r&&e<<1>12,i[s=s+1|0]=128|o>>6&63}i[s=s+1|0]=128|63&o}}return a?i.subarray(0,s):i.slice(0,s)},h||(t.TextDecoder=e,t.TextEncoder=n)}(void 0===t?"undefined"==typeof self?this:self:t)}).call(this,n(0))},function(t,e){Sk.builtin.tuple=Sk.abstr.buildNativeClass("tuple",{constructor:function(t){void 0===t?t=[]:Array.isArray(t)||(t=Sk.misceval.arrayFromIterable(t)),Sk.asserts.assert(this instanceof Sk.builtin.tuple,"bad call to tuple, use 'new' with an Array of python objects"),this.v=t,this.in$repr=!1},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$doc:"Built-in immutable sequence.\n\nIf no argument is given, the constructor returns an empty tuple.\nIf iterable is specified the tuple is initialized from iterable's items.\n\nIf the argument is a tuple, the return value is the same object.",$r(){if(this.in$repr)return new Sk.builtin.str("(...)");this.in$repr=!0;let t=this.v.map((t=>Sk.misceval.objectRepr(t)));return this.in$repr=!1,t=t.join(", "),1===this.v.length&&(t+=","),new Sk.builtin.str("("+t+")")},tp$new(t,e){return this!==Sk.builtin.tuple.prototype?this.$subtype_new(t,e):(Sk.abstr.checkNoKwargs("tuple",e),Sk.abstr.checkArgsLen("tuple",t,0,1),void 0===(t=t[0])?new Sk.builtin.tuple([]):t.constructor===Sk.builtin.tuple?t:Sk.misceval.chain(Sk.misceval.arrayFromIterable(t,!0),(t=>new Sk.builtin.tuple(t))))},tp$hash(){let t,e=3430008,n=1000003;const i=this.v.length;for(let s=0;s(t=Sk.misceval.asIndexSized(t,Sk.builtin.IndexError))&&(t=this.v.length+t),0>t||t>=this.v.length)throw new Sk.builtin.IndexError("tuple index out of range");return this.v[t]}if(t instanceof Sk.builtin.slice){const e=[];return t.sssiter$(this.v.length,(t=>{e.push(this.v[t])})),new Sk.builtin.tuple(e)}throw new Sk.builtin.TypeError("tuple indices must be integers or slices, not "+Sk.abstr.typeName(t))},sq$length(){return this.v.length},sq$repeat(t){if(1===(t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError))&&this.constructor===Sk.builtin.tuple)return this;const e=[];for(let n=0;n(this.$seq=t.$items(),this.$version=t.$version,n&&(this.$seq=this.$seq.reverse()),this.tp$iternext=this.constructor.prototype.tp$iternext,this.tp$iternext())},iternext:e,methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$unacceptableBase:!0},proto:{next$item:a}})}function a(){if(this.$version!==this.$orig.$version){if(this.$seq.length!==this.$orig.get$size())throw new Sk.builtin.RuntimeError("dict changed size during iteration");throw new Sk.builtin.RuntimeError("dictionary keys changed during iteration")}return this.$seq[this.$index++]}Sk.builtin.dict=Sk.abstr.buildNativeClass("dict",{constructor:function(t){void 0===t&&(t=[]),Sk.asserts.assert(Array.isArray(t)&&0==t.length%2&&this instanceof Sk.builtin.dict,"bad call to dict constructor"),this.size=0,this.entries=Object.create(null),this.buckets={};for(let e=0;e new empty dictionary\ndict(mapping) -> new dictionary initialized from a mapping object's\n (key, value) pairs\ndict(iterable) -> new dictionary initialized as if via:\n d = {}\n for k, v in iterable:\n d[k] = v\ndict(**kwargs) -> new dictionary initialized with the name=value pairs\n in the keyword argument list. For example: dict(one=1, two=2)",$r(){if(this.in$repr)return new Sk.builtin.str("{...}");this.in$repr=!0;const t=this.$items().map((t=>{var[e,n]=t;return Sk.misceval.objectRepr(e)+": "+Sk.misceval.objectRepr(n)}));return this.in$repr=!1,new Sk.builtin.str("{"+t.join(", ")+"}")},tp$new:Sk.generic.new,tp$init(t,e){return this.update$common(t,e,"dict")},tp$iter(){return new h(this)},tp$richcompare(t,e){let n;if(!(t instanceof Sk.builtin.dict)||"Eq"!==e&&"NotEq"!==e)return Sk.builtin.NotImplemented.NotImplemented$;if(t===this)n=!0;else if(this.size!==t.size)n=!1;else{let e;n=this.$items().every((n=>{var[i,s]=n;return e=t.mp$lookup(i),void 0!==e&&(e===s||Sk.misceval.richCompareBool(s,e,"Eq"))}))}return"Eq"===e?n:!n},nb$or(t){if(!(t instanceof Sk.builtin.dict))return Sk.builtin.NotImplemented.NotImplemented$;const e=this.dict$copy();return e.dict$merge(t),e},nb$reflected_or(t){return t instanceof Sk.builtin.dict?((t=t.dict$copy()).dict$merge(this),t):Sk.builtin.NotImplemented.NotImplemented$},nb$inplace_or(t){return Sk.misceval.chain(this.update$onearg(t),(()=>this))},sq$length(){return this.get$size()},sq$contains(t){return void 0!==this.mp$lookup(t)},mp$subscript(t,e){var n=this.mp$lookup(t);if(void 0!==n)return n;if(void 0!==(n=Sk.abstr.lookupSpecial(this,Sk.builtin.str.$missing)))return t=Sk.misceval.callsimOrSuspendArray(n,[t]),e?t:Sk.misceval.retryOptionalSuspensionOrThrow(t);throw new Sk.builtin.KeyError(t)},mp$ass_subscript(t,e){if(void 0===e){if(void 0===this.pop$item(t))throw new Sk.builtin.KeyError(t)}else this.set$item(t,e)}},methods:{__reversed__:{$meth(){return new f(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"Return a reverse iterator over the dict keys."},get:{$meth(t,e){return this.mp$lookup(t)||e||Sk.builtin.none.none$},$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, key, default=None, /)",$doc:"Return the value for key if key is in the dictionary, else default."},setdefault:{$meth(t,e){let i;const s=n(t);return i="string"==typeof s?this.entries[s]:this.get$bucket_item(t,s),void 0!==i?i[1]:(e=e||Sk.builtin.none.none$,"string"==typeof s?this.entries[s]=[t,e]:this.set$bucket_item(t,e,s),this.size++,this.$version++,e)},$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, key, default=None, /)",$doc:"Insert key with a value of default if key is not in the dictionary.\n\nReturn the value for key if key is in the dictionary, else default."},pop:{$meth(t,e){const n=this.pop$item(t);if(void 0!==n)return n[1];if(void 0!==e)return e;throw new Sk.builtin.KeyError(t)},$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\nIf key is not found, d is returned if given, otherwise KeyError is raised"},popitem:{$meth(){const t=this.get$size();if(0===t)throw new Sk.builtin.KeyError("popitem(): dictionary is empty");const[e,n]=this.$items()[t-1];return this.pop$item(e),new Sk.builtin.tuple([e,n])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.popitem() -> (k, v), remove and return some (key, value) pair as a\n2-tuple; but raise KeyError if D is empty."},keys:{$meth(){return new u(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"D.keys() -> a set-like object providing a view on D's keys"},items:{$meth(){return new p(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"D.items() -> a set-like object providing a view on D's items"},values:{$meth(){return new c(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"D.values() -> an object providing a view on D's values"},update:{$meth(t,e){return Sk.misceval.chain(this.update$common(t,e,"update"),(()=>Sk.builtin.none.none$))},$flags:{FastCall:!0},$textsig:null,$doc:"D.update([E, ]**F) -> None. Update D from dict/iterable E and F.\nIf E is present and has a .keys() method, then does: for k in E: D[k] = E[k]\nIf E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v\nIn either case, this is followed by: for k in F: D[k] = F[k]"},clear:{$meth(){this.size=0,this.$version++,this.entries=Object.create(null),this.buckets={}},$flags:{NoArgs:!0},$textsig:null,$doc:"D.clear() -> None. Remove all items from D."},copy:{$meth(){return this.dict$copy()},$flags:{NoArgs:!0},$textsig:null,$doc:"D.copy() -> a shallow copy of D"}},classmethods:Object.assign({fromkeys:{$meth:function(t,e){e=e||Sk.builtin.none.none$;let n=this===Sk.builtin.dict?new this:this.tp$call([],[]);return Sk.misceval.chain(n,(i=>(n=i,Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>n.mp$ass_subscript(t,e,!0))))),(()=>n))},$flags:{MinArgs:1,MaxArgs:2},$textsig:"($type, iterable, value=None, /)",$doc:"Create a new dictionary with keys from iterable and values set to value."}},Sk.generic.classGetItem),proto:{quick$lookup:function(t){if(void 0!==(t=this.entries[t.$savedKeyHash]))return t[1]},mp$lookup:function(t){const e=n(t);if(void 0!==(t="string"==typeof e?this.entries[e]:this.get$bucket_item(t,e)))return t[1]},get$size(){return this.size},sk$asarray(){return Object.values(this.entries).map((t=>t[0]))},update$common:function(t,e,n){let i;return Sk.abstr.checkArgsLen(n,t,0,1),void 0!==(t=t[0])&&(i=this.update$onearg(t)),Sk.misceval.chain(i,(()=>{if(e)for(let t=0;tvoid 0===t))&&delete this.buckets[e],i},set$bucket_item:function(t,e,n){let i=this.buckets[n];t=[t,e],void 0===i?(this.buckets[n]=[t],n="#"+n+"_0"):-1!==(e=i.indexOf(void 0))?(n="#"+n+"_"+e,i[e]=t):(n="#"+n+"_"+i.length,i.push(t)),this.entries[n]=t},pop$item:function(t){const e=n(t);if("string"==typeof e?(t=this.entries[e],delete this.entries[e]):t=this.pop$bucket_item(t,e),void 0!==t)return this.size--,this.$version++,t},dict$merge:function(t){if(t.tp$iter!==Sk.builtin.dict.prototype.tp$iter){if(void 0===(e=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$keys)))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object is not a mapping");return Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(e),(e=>Sk.misceval.iterFor(Sk.abstr.iter(e),(e=>Sk.misceval.chain(Sk.abstr.objectGetItem(t,e,!0),(t=>{this.set$item(e,t)}))))))}var e=t.tp$iter();for(let n=e.tp$iternext();void 0!==n;n=e.tp$iternext()){const e=t.mp$subscript(n);this.set$item(n,e)}},dict$merge_seq:function(t){let e=0;return Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{if(!Sk.builtin.checkIterable(t))throw new Sk.builtin.TypeError("cannot convert dictionary update sequence element #"+e+" to a sequence");if(2!==(t=Sk.misceval.arrayFromIterable(t)).length)throw new Sk.builtin.ValueError("dictionary update sequence element #"+e+" has length "+t.length+"; 2 is required");this.set$item(t[0],t[1]),e++}))}}});const l={tp$getattr:Sk.generic.getAttr,tp$as_number:!0,tp$as_sequence_or_mapping:!0,tp$hash:Sk.builtin.none.none$,$r(){if(this.in$repr)return new Sk.builtin.str("...");this.in$repr=!0;let t=Sk.misceval.arrayFromIterable(this);return t=t.map((t=>Sk.misceval.objectRepr(t))),this.in$repr=!1,new Sk.builtin.str(Sk.abstr.typeName(this)+"(["+t.join(", ")+"])")},tp$richcompare(t,e){if(!(Sk.builtin.checkAnySet(t)||t instanceof u||t instanceof p))return Sk.builtin.NotImplemented.NotImplemented$;const n=this.sq$length(),i=t.sq$length();switch(e){case"NotEq":case"Eq":let r;return this===t?r=!0:n===i&&(r=s(this,t)),"NotEq"===e?!r:r;case"Lt":return ni&&s(t,this);case"GtE":return n>=i&&s(t,this)}},nb$subtract(t){const e=i(this);return e.difference.$meth.call(e,t)},nb$and(t){const e=i(this);return e.intersection.$meth.call(e,t)},nb$or(t){const e=i(this);return e.union.$meth.call(e,t)},nb$xor(t){const e=i(this);return e.symmetric_difference.$meth.call(e,t)},sq$length(){return this.dict.get$size()}};var u=r("dict_keys",{sq$contains(t){return void 0!==this.dict.mp$lookup(t)},tp$iter(){return new h(this.dict)}},(function(){return new f(this.dict)})),c=r("dict_values",{tp$iter(){return new d(this.dict)}},(function(){return new g(this.dict)})),p=r("dict_items",{sq$contains(t){if(!(t instanceof Sk.builtin.tuple&&2===t.sq$length()))return!1;var e=t.mp$subscript(new Sk.builtin.int_(0));return t=t.mp$subscript(new Sk.builtin.int_(1)),void 0!==(e=this.dict.mp$lookup(e))&&(e===t||Sk.misceval.richCompareBool(e,t,"Eq"))},tp$iter(){return new _(this.dict)}},(function(){return new m(this.dict)})),h=o("dict_keyiterator",(function(){const t=this.next$item();return t&&t[0]})),_=o("dict_itemiterator",(function(){const t=this.next$item();return t&&new Sk.builtin.tuple([t[0],t[1]])})),d=o("dict_valueiterator",(function(){const t=this.next$item();return t&&t[1]})),f=o("dict_reversekeyiterator",h.prototype.tp$iternext,!0),m=o("dict_reverseitemiterator",_.prototype.tp$iternext,!0),g=o("dict_reversevalueiterator",d.prototype.tp$iternext,!0);Sk.builtin.dict.py2$methods={has_key:{$name:"has_key",$flags:{OneArg:!0},$meth(t){return new Sk.builtin.bool(this.sq$contains(t))},$doc:"D.has_key(k) -> True if D has a key k, else False"},keys:{$name:"keys",$meth(){return new Sk.builtin.list(this.sk$asarray())},$flags:{NoArgs:!0},$textsig:null,$doc:"D.keys() -> a set-like object providing a view on D's keys"},items:{$name:"items",$meth(){return new Sk.builtin.list(this.$items().map((t=>{var[e,n]=t;return new Sk.builtin.tuple([e,n])})))},$flags:{NoArgs:!0},$textsig:null,$doc:"D.items() -> a set-like object providing a view on D's items"},values:{$name:"values",$meth(){return new Sk.builtin.list(this.$items().map((t=>([,t]=t,t))))},$flags:{NoArgs:!0},$textsig:null,$doc:"D.values() -> an object providing a view on D's values"}}},function(t,e){Sk.builtin.mappingproxy=Sk.abstr.buildNativeClass("mappingproxy",{constructor:function(t){if(Sk.asserts.assert(this instanceof Sk.builtin.mappingproxy,"bad call to mapping proxy, use 'new'"),void 0!==t){const e=t.constructor;e===Object||null===e||t.hasOwnProperty("sk$object")?(this.mapping=new Sk.builtin.dict([]),function(t,e){Object.defineProperties(t,{entries:{get:()=>{const t=Object.create(null);return Object.entries(e).forEach((e=>{var[n,i]=e;(n=Sk.unfixReserved(n)).includes("$")||(n=new Sk.builtin.str(n),t[n.$savedKeyHash]=[n,i])})),t},configurable:!0},size:{get:()=>Object.keys(e).map((t=>Sk.unfixReserved(t))).filter((t=>!t.includes("$"))).length,configurable:!0}})}(this.mapping,t)):Sk.builtin.checkMapping(t)?this.mapping=t:Sk.asserts.fail("unhandled case for mappingproxy")}},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$hash:Sk.builtin.none.none$,tp$new(t,e){if(Sk.abstr.checkNoKwargs("mappingproxy",e),Sk.abstr.checkOneArg("mappingproxy",t,e),t=t[0],!Sk.builtin.checkMapping(t))throw new Sk.builtin.TypeError("mappingproxy() argument must be a mapping, not "+Sk.abstr.typeName(t));return(e=new Sk.builtin.mappingproxy).mapping=t,e},tp$richcompare(t,e){return Sk.misceval.richCompareBool(this.mapping,t,e)},tp$str(){return this.mapping.tp$str()},$r(){return new Sk.builtin.str("mappingproxy("+Sk.misceval.objectRepr(this.mapping)+")")},mp$subscript(t,e){return this.mapping.mp$subscript(t,e)},sq$contains(t){return this.mapping.sq$contains(t)},sq$length(){return this.mapping.sq$length()},tp$iter(){return this.mapping.tp$iter()},tp$as_number:!0,nb$or(t){return t instanceof Sk.builtin.mappingproxy&&(t=t.mapping),Sk.abstr.numberBinOp(this.mapping,t,"BitOr")},nb$reflected_or(t){return t instanceof Sk.builtin.mappingproxy&&(t=t.mapping),Sk.abstr.numberBinOp(t,this.mapping,"BitOr")},nb$inplace_or(t){throw new Sk.builtin.TypeError("'|=' is not supported by "+Sk.abstr.typeName(this)+"; use '|' instead")}},methods:{get:{$meth(t,e){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$get),t,e)},$flags:{FastCall:!0},$textsig:null,$doc:"D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None."},keys:{$meth(){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$keys),[])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.keys() -> a set-like object providing a view on D's keys"},items:{$meth(){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$items),[])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.items() -> a set-like object providing a view on D's items"},values:{$meth(){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$values),[])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.values() -> a set-like object providing a view on D's values"},copy:{$meth(){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$copy),[])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.copy() -> a shallow copy of D"}},classmethods:Sk.generic.classGetItem,proto:{str$get:new Sk.builtin.str("get"),str$copy:new Sk.builtin.str("copy"),str$keys:new Sk.builtin.str("keys"),str$items:new Sk.builtin.str("items"),str$values:new Sk.builtin.str("values"),mp$lookup(t){return this.mapping.mp$lookup(t)}},flags:{sk$unacceptableBase:!0}})},function(t,e){Sk.builtin.property=Sk.abstr.buildNativeClass("property",{constructor:function(t,e,n,i){this.prop$get=t||Sk.builtin.none.none$,this.prop$set=e||Sk.builtin.none.none$,this.prop$del=n||Sk.builtin.none.none$,this.prop$doc=i||t&&t.$doc||Sk.builtin.none.none$},slots:{tp$getattr:Sk.generic.getAttr,tp$new:Sk.generic.new,tp$init(t,e){t=Sk.abstr.copyKeywordsToNamedArgs("property",["fget","fset","fdel","doc"],t,e,Array(4).fill(Sk.builtin.none.none$)),this.prop$get=t[0],this.prop$set=t[1],this.prop$del=t[2],Sk.builtin.checkNone(t[3])?Sk.builtin.checkNone(t[0])||(this.prop$doc=t[0].$doc||t[3]):this.prop$doc=t[3]},tp$doc:"Property attribute.\n\n fget\n function to be used for getting an attribute value\n fset\n function to be used for setting an attribute value\n fdel\n function to be used for del'ing an attribute\n doc\n docstring\n\nTypical use is to define a managed attribute x:\n\nclass C(object):\n def getx(self): return self._x\n def setx(self, value): self._x = value\n def delx(self): del self._x\n x = property(getx, setx, delx, 'I'm the 'x' property.')\n\nDecorators make defining new properties or modifying existing ones easy:\n\nclass C(object):\n @property\n def x(self):\n 'I am the 'x' property.'\n return self._x\n @x.setter\n def x(self, value):\n self._x = value\n @x.deleter\n def x(self):\n del self._x",tp$descr_get(t,e,n){if(null===t)return this;if(void 0===this.prop$get)throw new Sk.builtin.AttributeError("unreadable attribute");return t=Sk.misceval.callsimOrSuspendArray(this.prop$get,[t]),n?t:Sk.misceval.retryOptionalSuspensionOrThrow(t)},tp$descr_set(t,e,n){let i;if(i=null==e?this.prop$del:this.prop$set,Sk.builtin.checkNone(i))throw new Sk.builtin.AttributeError("can't "+(null==e?"delete":"set")+" attribute");if(!i.tp$call)throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(i)+"' is not callable");return t=null==e?i.tp$call([t]):i.tp$call([t,e]),n?t:Sk.misceval.retryOptionalSuspensionOrThrow(t)}},methods:{getter:{$meth(t){return new Sk.builtin.property(t,this.prop$set,this.prop$del,this.prop$doc)},$flags:{OneArg:!0}},setter:{$meth(t){return new Sk.builtin.property(this.prop$get,t,this.prop$del,this.prop$doc)},$flags:{OneArg:!0}},deleter:{$meth(t){return new Sk.builtin.property(this.prop$get,this.prop$set,t,this.prop$doc)},$flags:{OneArg:!0}}},getsets:{fget:{$get(){return this.prop$get}},fset:{$get(){return this.prop$set}},fdel:{$get(){return this.prop$del}},__doc__:{$get(){return this.prop$doc},$set(t){this.prop$doc=t=t||Sk.builtin.none.none$}}}}),Sk.builtin.classmethod=Sk.abstr.buildNativeClass("classmethod",{constructor:function(t){this.cm$callable=t,this.$d=new Sk.builtin.dict},slots:{tp$getattr:Sk.generic.getAttr,tp$new:Sk.generic.new,tp$init(t,e){Sk.abstr.checkNoKwargs("classmethod",e),Sk.abstr.checkArgsLen("classmethod",t,1,1),this.cm$callable=t[0]},tp$doc:"classmethod(function) -> method\n\nConvert a function to be a class method.\n\nA class method receives the class as implicit first argument,\njust like an instance method receives the instance.\nTo declare a class method, use this idiom:\n\n class C:\n @classmethod\n def f(cls, arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\nIf a class method is called for a derived class, the derived class\nobject is passed as the implied first argument.\n\nClass methods are different than C++ or Java static methods.\nIf you want those, see the staticmethod builtin.",tp$descr_get(t,e,n){const i=this.cm$callable;if(void 0===i)throw new Sk.builtin.RuntimeError("uninitialized classmethod object");return void 0===e&&(e=t.ob$type),(t=i.tp$descr_get)?t.call(i,e,n):new Sk.builtin.method(i,e)}},getsets:{__func__:{$get(){return this.cm$callable}},__dict__:Sk.generic.getSetDict}}),Sk.builtin.staticmethod=Sk.abstr.buildNativeClass("staticmethod",{constructor:function(t){this.sm$callable=t,this.$d=new Sk.builtin.dict},slots:{tp$getattr:Sk.generic.getAttr,tp$new:Sk.generic.new,tp$init(t,e){Sk.abstr.checkNoKwargs("staticmethod",e),Sk.abstr.checkArgsLen("staticmethod",t,1,1),this.sm$callable=t[0]},tp$doc:"staticmethod(function) -> method\n\nConvert a function to be a static method.\n\nA static method does not receive an implicit first argument.\nTo declare a static method, use this idiom:\n\n class C:\n @staticmethod\n def f(arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\n\nStatic methods in Python are similar to those found in Java or C++.\nFor a more advanced concept, see the classmethod builtin.",tp$descr_get(t,e){if(void 0===this.sm$callable)throw new Sk.builtin.RuntimeError("uninitialized staticmethod object");return this.sm$callable}},getsets:{__func__:{$get(){return this.sm$callable}},__dict__:Sk.generic.getSetDict}})},function(t,e){function n(t,e){return function(n){if(!(n instanceof Sk.builtin.int_))return Sk.builtin.NotImplemented.NotImplemented$;let i=this.v;if(n=n.v,"number"==typeof i&&"number"==typeof n){const e=t(i,n);if(p(e))return new Sk.builtin.int_(e)}return i=_(i),n=_(n),new Sk.builtin.int_(e(i,n))}}function i(t,e){return function(n){if(!(n instanceof Sk.builtin.int_))return Sk.builtin.NotImplemented.NotImplemented$;let i=this.v;return n=n.v,"number"==typeof i&&"number"==typeof n?t(i,n):(i=_(i),n=_(n),e(i,n))}}function s(t,e){return function(){let n=this.v;if("number"==typeof n){const e=t(n);if(void 0!==e)return new Sk.builtin.int_(e);n=_(n)}return new Sk.builtin.int_(e(n))}}function r(){return new Sk.builtin.int_(this.v)}function o(t,e){return function(n){if(!(n instanceof Sk.builtin.int_))return Sk.builtin.NotImplemented.NotImplemented$;let i=this.v;if(0===(n=n.v))throw new Sk.builtin.ZeroDivisionError("integer division or modulo by zero");return"number"==typeof i&&"number"==typeof n?new Sk.builtin.int_(t(i,n)):(i=_(i),n=_(n),new Sk.builtin.int_(JSBI.numberIfSafe(e(i,n))))}}function a(t,e){return function(n){if(!(n instanceof Sk.builtin.int_))return Sk.builtin.NotImplemented.NotImplemented$;if(n.nb$isnegative())throw new Sk.builtin.ValueError("negative shift count");let i=this.v;if(0===i)return new Sk.builtin.int_(0);if(n=n.v,"number"==typeof i&&"number"==typeof n&&53>n){const e=t(i,n);if(void 0!==e)return new Sk.builtin.int_(e)}return i=_(i),n=_(n),new Sk.builtin.int_(e(i,n))}}function l(t,e){return function(n){if(!(n instanceof Sk.builtin.int_))return Sk.builtin.NotImplemented.NotImplemented$;let i=this.v;return n=n.v,"number"==typeof i&&"number"==typeof n&&Math.abs(i)=-Number.MAX_SAFE_INTEGER}function h(t){return t<=Number.MAX_SAFE_INTEGER&&t>=-Number.MAX_SAFE_INTEGER?+t:JSBI.BigInt(t)}function _(t){return"number"==typeof t?JSBI.BigInt(t):t}function d(t){if(!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("'byteorder' must be str, not "+Sk.abstr.typeName(t));if("little"===(t=t.toString()))return 1;if("big"===t)return 0;throw new Sk.builtin.ValueError("byteorder must be either 'little' or 'big'")}Sk.builtin.int_=Sk.abstr.buildNativeClass("int",{constructor:function(t){let e;if(Sk.asserts.assert(this instanceof Sk.builtin.int_,"bad call to int use 'new'"),"number"==typeof t){if(-6t)return $[t];e=t}else if(JSBI.__isBigInt(t))e=t;else{if(void 0===t)return w;if("string"==typeof t)e=h(t);else{if(t.nb$int)return t.nb$int();Sk.asserts.fail("bad argument to int constructor")}}this.v=e},slots:{tp$as_number:!0,tp$doc:"int(x=0) -> integer\nint(x, base=10) -> integer\n\nConvert a number or string to an integer, or return 0 if no arguments\nare given. If x is a number, return x.__int__(). For floating point\nnumbers, this truncates towards zero.\n\nIf x is not a number or if base is given, then x must be a string,\nbytes, or bytearray instance representing an integer literal in the\ngiven base. The literal can be preceded by '+' or '-' and be surrounded\nby whitespace. The base defaults to 10. Valid bases are 0 and 2-36.\nBase 0 means to interpret the base from the string as an integer literal.\n>>> int('0b100', base=0)\n4",$r(){return new Sk.builtin.str(this.v.toString())},tp$hash(){var t=this.v;if("number"==typeof t){if(-1===t)return-2;if(536870911>t&&-536870911t==e),JSBI.equal),ob$ne:i(((t,e)=>t!=e),JSBI.notEqual),ob$gt:i(((t,e)=>t>e),JSBI.greaterThan),ob$ge:i(((t,e)=>t>=e),JSBI.greaterThanOrEqual),ob$lt:i(((t,e)=>tt<=e),JSBI.lessThanOrEqual),nb$int:r,nb$index(){return this.v},nb$float(){var t=this.v;if("number"==typeof t)return new Sk.builtin.float_(t);if(1/0===(t=parseFloat(JSBI.toNumber(t)))||-1/0===t)throw new Sk.builtin.OverflowError("int too large to convert to float");return new Sk.builtin.float_(t)},nb$isnegative(){const t=this.v;return"number"==typeof t?0>t:JSBI.lessThan(t,JSBI.__ZERO)},nb$ispositive(){const t=this.v;return"number"==typeof t?0<=t:JSBI.greaterThanOrEqual(t,JSBI.__ZERO)},nb$bool(){return 0!==this.v},nb$positive:r,nb$negative:s((t=>-t),JSBI.unaryMinus),nb$add:n(((t,e)=>t+e),((t,e)=>JSBI.numberIfSafe(JSBI.add(t,e)))),nb$subtract:n(((t,e)=>t-e),((t,e)=>JSBI.numberIfSafe(JSBI.subtract(t,e)))),nb$multiply:n(((t,e)=>t*e),((t,e)=>t===JSBI.__ZERO||e===JSBI.__ZERO?0:JSBI.multiply(t,e))),nb$divide:function(t){if(!Sk.__future__.python3)return this.nb$floor_divide(t);if(!(t instanceof Sk.builtin.int_))return Sk.builtin.NotImplemented.NotImplemented$;var e=this.v,n=t.v;if(0===n)throw new Sk.builtin.ZeroDivisionError("division by zero");if("number"==typeof e&&"number"==typeof n)return new Sk.builtin.float_(e/n);if(e=_(e),n=_(n),t=JSBI.lessThan(JSBI.bitwiseXor(e,n),JSBI.__ZERO),JSBI.equal(e,JSBI.__ZERO))return new Sk.builtin.float_(t?-0:0);if(e=u(e),n=u(n),JSBI.greaterThanOrEqual(e,JSBI.multiply(k,n)))throw new Sk.builtin.OverflowError("int/int too large to represent as a float");var i=e.toString(2).length-n.toString(2).length,s=JSBI.BigInt(0>i?-i:i);if((0<=i&&JSBI.greaterThanOrEqual(e,JSBI.multiply(JSBI.exponentiate(b,s),n))||0>i&&JSBI.greaterThanOrEqual(JSBI.multiply(e,JSBI.exponentiate(b,s)),n))&&(i+=1),i=Math.max(i,g)-m,e=JSBI.leftShift(e,JSBI.BigInt(Math.max(-i,0))),n=JSBI.leftShift(n,JSBI.BigInt(Math.max(i,0))),s=JSBI.divide(e,n),e=JSBI.remainder(e,n),e=JSBI.multiply(b,e),(JSBI.greaterThan(e,n)||JSBI.equal(e,n)&&JSBI.equal(JSBI.remainder(s,b),S))&&(s=JSBI.add(s,S)),1/0===(s=JSBI.toNumber(s))||-1/0===s)throw new Sk.builtin.OverflowError("int/int too large to represent as a float");return n=s*Math.pow(2,i),new Sk.builtin.float_(t?-n:n)},nb$floor_divide:o(((t,e)=>Math.floor(t/e)),c),nb$remainder:o(((t,e)=>t-Math.floor(t/e)*e),((t,e)=>JSBI.subtract(t,JSBI.multiply(e,c(t,e))))),nb$divmod(t){const e=this.nb$floor_divide(t);return t=this.nb$remainder(t),e===Sk.builtin.NotImplemented.NotImplemented$||t===Sk.builtin.NotImplemented.NotImplemented$?Sk.builtin.NotImplemented.NotImplemented$:new Sk.builtin.tuple([e,t])},nb$and:l(((t,e)=>t&e),JSBI.bitwiseAnd),nb$or:l(((t,e)=>t|e),JSBI.bitwiseOr),nb$xor:l(((t,e)=>t^e),JSBI.bitwiseXor),nb$abs:s(Math.abs,u),nb$lshift:a(((t,e)=>{if(p(t=2*t*T[e]))return t}),JSBI.leftShift),nb$rshift:a(((t,e)=>{Math.floor(t/T[e+1])}),((t,e)=>JSBI.numberIfSafe(JSBI.signedRightShift(t,e)))),nb$invert:s((t=>Math.abs(t)JSBI.numberIfSafe(JSBI.bitwiseNot(t)))),nb$power(t,e){let n;if(void 0!==e&&Sk.builtin.checkNone(e)&&(e=void 0),!(t instanceof Sk.builtin.int_&&(void 0===e||e instanceof Sk.builtin.int_)))return Sk.builtin.NotImplemented.NotImplemented$;const i=t.nb$isnegative();if(i&&void 0===e)return this.nb$float().nb$power(t.nb$float());let s=this.v;if(t=t.v,"number"==typeof s&&"number"==typeof t){const i=Math.pow(s,t);if(p(i)&&(n=new Sk.builtin.int_(i),void 0===e))return n}if(void 0!==e){if(i)throw new Sk.builtin.ValueError("pow() 2nd argument cannot be negative when 3rd argument specified");if(0===e.v)throw new Sk.builtin.ValueError("pow() 3rd argument cannot be 0");return void 0!==n?n.nb$remainder(e):new Sk.builtin.int_(JSBI.numberIfSafe(JSBI.powermod(_(s),_(t),_(e.v))))}return new Sk.builtin.int_(JSBI.exponentiate(_(s),_(t)))},nb$long(){return new Sk.builtin.lng(this.v)}},getsets:{real:{$get:r,$doc:"the real part of a complex number"},imag:{$get:()=>w,$doc:"the imaginary part of a complex number"},numerator:{$get:r},denominator:{$get:()=>E}},classmethods:{from_bytes:{$meth(t,e){Sk.abstr.checkArgsLen("from_bytes",t,0,2);let[n,i,s]=Sk.abstr.copyKeywordsToNamedArgs("from_bytes",["bytes","byteorder","signed"],t,e,[Sk.builtin.bool.false$]);if(t=d(i),n instanceof Sk.builtin.bytes||(n=Sk.misceval.callsimArray(Sk.builtin.bytes,[n])),Sk.misceval.isTrue(s))throw new Sk.builtin.NotImplementedError("from_bytes with signed=True is not yet implemented in Skulpt");const r=[];return n.valueOf().forEach((t=>{r.push(t.toString(16).padStart(2,"0"))})),t&&r.reverse(),t=new Sk.builtin.int_(JSBI.numberIfSafe(JSBI.BigInt("0x"+(r.join("")||"0")))),this===Sk.builtin.int_?t:Sk.misceval.callsimArray(this,[t])},$flags:{FastCall:!0}}},methods:{conjugate:{$meth:r,$flags:{NoArgs:!0},$textsig:null,$doc:"Returns self, the complex conjugate of any int."},bit_length:{$meth(){let t=this.v;return 0===t?new Sk.builtin.int_(0):(t="number"==typeof t?Math.abs(t):u(t),new Sk.builtin.int_(t.toString(2).length))},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Number of bits necessary to represent self in binary.\n\n>>> bin(37)\n'0b100101'\n>>> (37).bit_length()\n6"},to_bytes:{$meth(t,e){Sk.abstr.checkArgsLen("to_bytes",t,0,2);let[n,i,s]=Sk.abstr.copyKeywordsToNamedArgs("to_bytes",["length","byteorder","signed"],t,e,[Sk.builtin.bool.false$]);if(t=d(i),n=Sk.misceval.asIndexSized(n,Sk.builtin.OverflowError),0>n)throw new Sk.builtin.ValueError("length argument must be non-negative");if(Sk.misceval.isTrue(s))throw new Sk.builtin.NotImplementedError("to_bytes with signed=True is not yet implemented in Skulpt");if(this.nb$isnegative())throw new Sk.builtin.OverflowError("can't convert negative int to unsigned");(e=JSBI.BigInt(this.v).toString(16)).length%2&&(e="0"+e);var r=e.length/2;if(r>n){if(0===n&&"00"===e)return new Sk.builtin.bytes;throw new Sk.builtin.OverflowError("int too big to convert")}const o=Array(n).fill(0);r=n-r;let a=0;for(;rMath.abs(e)?new Sk.builtin.int_(0):Sk.__future__.bankers_rounding?(e/=t,n=Math.round(e),new Sk.builtin.int_((.5==(0e||36= 2 and <= 36");if("string"==typeof e&&(e=Number(e)),"0x"===t.substring(0,2).toLowerCase()){if(16===e||0===e)t=t.substring(2),e=16;else if(34>e)throw new Sk.builtin.ValueError("invalid literal for int() with base "+e+": '"+i+"'")}else if("0b"===t.substring(0,2).toLowerCase()){if(2===e||0===e)t=t.substring(2),e=2;else if(12>e)throw new Sk.builtin.ValueError("invalid literal for int() with base "+e+": '"+i+"'")}else if("0o"===t.substring(0,2).toLowerCase()){if(8===e||0===e)t=t.substring(2),e=8;else if(25>e)throw new Sk.builtin.ValueError("invalid literal for int() with base "+e+": '"+i+"'")}else if("0"===t.charAt(0)){if("0"===t)return 0;8!==e&&0!==e||(e=8)}if(0===e&&(e=10),-1!==t.indexOf("_")){if(-1!==t.indexOf("__"))throw new Sk.builtin.ValueError("invalid literal for int() with base "+e+": '"+i+"'");t=10!==e?t.replace(y,""):t.charAt(0)+t.substring(1).replace(y,"")}if(0===t.length)throw new Sk.builtin.ValueError("invalid literal for int() with base "+e+": '"+i+"'");for(n=0;n=r?o=r-48:65<=r&&90>=r?o=r-65+10:97<=r&&122>=r&&(o=r-97+10),o>=e)throw new Sk.builtin.ValueError("invalid literal for int() with base "+e+": '"+i+"'")}if(s&&(t="-"+t),p(o=parseInt(t,e)))return o;for(i=!1,"-"===t[0]&&(i=!0,t=t.substring(1)),e=JSBI.BigInt(e),s=S,n=JSBI.__ZERO,r=t.length-1;0<=r;r--)48<=(o=t.charCodeAt(r))&&57>=o?o-=48:65<=o&&90>=o?o=o-65+10:97<=o&&122>=o&&(o=o-97+10),o=JSBI.multiply(JSBI.BigInt(o),s),n=JSBI.add(n,o),s=JSBI.multiply(s,e);return i&&(n=JSBI.multiply(n,JSBI.BigInt(-1))),n},Sk.builtin.int_.py2$methods={},Sk.longFromStr=function(t,e){return Sk.__future__.python3?new Sk.builtin.int_(h(t)):(t=Sk.str2number(t,e),new Sk.builtin.lng(t))},Sk.exportSymbol("Sk.longFromStr",Sk.longFromStr),Sk.builtin.int_.withinThreshold=p,Sk.builtin.int_.stringToNumberOrBig=h;const T=[.5,1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824,2147483648,4294967296,8589934592,17179869184,34359738368,68719476736,137438953472,274877906944,549755813888,1099511627776,2199023255552,4398046511104,8796093022208,17592186044416,35184372088832,70368744177664,0x800000000000,281474976710656,562949953421312,0x4000000000000,0x8000000000000,4503599627370496,9007199254740992];Sk.builtin.lng=Sk.abstr.buildNativeClass("long",{base:Sk.builtin.int_,constructor:function(t){void 0!==(t=Sk.builtin.int_.call(this,t))&&(this.v=t.v)},slots:{$r(){return new Sk.builtin.str(this.v.toString()+"L")},tp$as_number:!0,nb$negative(){return new Sk.builtin.lng(v.nb$negative.call(this).v)},nb$positive(){return new Sk.builtin.lng(v.nb$positive.call(this).v)}}});const v=Sk.builtin.int_.prototype,$=[];for(t=-5;257>t;t++)$[t]=Object.create(Sk.builtin.int_.prototype,{v:{value:t}});const w=$[0],E=$[1]},function(t,e){const n=Sk.builtin.int_.prototype;Sk.builtin.bool=Sk.abstr.buildNativeClass("bool",{constructor:function(t){return Sk.misceval.isTrue(t)?Sk.builtin.bool.true$:Sk.builtin.bool.false$},base:Sk.builtin.int_,slots:{tp$doc:"bool(x) -> bool\n\nReturns True when the argument x is true, False otherwise.\nThe builtins True and False are the only two instances of the class bool.\nThe class bool is a subclass of the class int, and cannot be subclassed.",tp$new:(t,e)=>(Sk.abstr.checkNoKwargs("bool",e),Sk.abstr.checkArgsLen("bool",t,0,1),new Sk.builtin.bool(t[0])),$r(){return this.v?this.str$True:this.str$False},tp$as_number:!0,nb$and(t){return t.ob$type===Sk.builtin.bool?new Sk.builtin.bool(this.v&t.v):n.nb$and.call(this,t)},nb$or(t){return t.ob$type===Sk.builtin.bool?new Sk.builtin.bool(this.v|t.v):n.nb$or.call(this,t)},nb$xor(t){return t.ob$type===Sk.builtin.bool?new Sk.builtin.bool(this.v^t.v):n.nb$xor.call(this,t)}},flags:{sk$unacceptableBase:!0},methods:{__format__:{$meth(){return this.$r()},$flags:{OneArg:!0}}},proto:{str$False:new Sk.builtin.str("False"),str$True:new Sk.builtin.str("True"),valueOf(){return!!this.v}}}),Sk.exportSymbol("Sk.builtin.bool",Sk.builtin.bool),Sk.builtin.bool.true$=Object.create(Sk.builtin.bool.prototype,{v:{value:1,enumerable:!0}}),Sk.builtin.bool.false$=Object.create(Sk.builtin.bool.prototype,{v:{value:0,enumerable:!0}})},function(t,e){function n(t){const e=[t,0];if(0===t)return e;var n=Math.abs(t);let i=Math.max(-1023,Math.floor(Math.log2(n))+1);for(n*=Math.pow(2,-i);.5>n;)n*=2,i--;for(;1<=n;)n*=.5,i++;return 0>t&&(n=-n),e[0]=n,e[1]=i,e}function i(){return new Sk.builtin.float_(this.v)}function s(t){return function(e){const n=this.v;if("number"!=typeof(e=e.v)){if(!JSBI.__isBigInt(e))return Sk.builtin.NotImplemented.NotImplemented$;if(1/0==(e=parseFloat(JSBI.toNumber(e)))||-1/0==e)throw new Sk.builtin.OverflowError("int too large to convert to float")}return t(n,e)}}function r(t,e){return function(n){const i=this.v;if("number"!=typeof(n=n.v)){if(!JSBI.__isBigInt(n))return Sk.builtin.NotImplemented.NotImplemented$;if(void 0!==e)return e(i,n)}return t(i,n)}}function o(t){const e=s(t);return function(t,n){if(void 0!==n&&!Sk.builtin.checkNone(n))throw new Sk.builtin.TypeError("pow() 3rd argument not allowed unless all arguments are integers");return e.call(this,t)}}function a(t,e){if(0===e)throw new Sk.builtin.ZeroDivisionError("integer division or modulo by zero");return 1/0===t?1/0===e||-1/0===t?new Sk.builtin.float_(NaN):0>e?new Sk.builtin.float_(-1/0):new Sk.builtin.float_(1/0):-1/0===t?1/0===e||-1/0===t?new Sk.builtin.float_(NaN):0>e?new Sk.builtin.float_(1/0):new Sk.builtin.float_(-1/0):new Sk.builtin.float_(t/e)}function l(t,e){if(1/0===t||-1/0===t)return new Sk.builtin.float_(NaN);if(0===e)throw new Sk.builtin.ZeroDivisionError("integer division or modulo by zero");return 1/0===e?0>t?new Sk.builtin.float_(-1):new Sk.builtin.float_(0):-1/0===e?0>t||0!==t?new Sk.builtin.float_(0):new Sk.builtin.float_(-1):new Sk.builtin.float_(Math.floor(t/e))}function u(t,e){if(0===e)throw new Sk.builtin.ZeroDivisionError("integer division or modulo by zero");if(0===t)return new Sk.builtin.float_(0);if(1/0===e)return 1/0===t||-1/0===t?new Sk.builtin.float_(NaN):0t?0n&&(n+=e):0>e&&0!==n&&(n+=e),0===n&&(0>e?n=-0:-1/0==1/0/n&&(n=0)),new Sk.builtin.float_(n)}function c(t,e){if(0>t&&0!=e%1)return new Sk.builtin.complex(t,0).nb$power(new Sk.builtin.complex(e,0));if(0===t&&0>e)throw new Sk.builtin.ZeroDivisionError("0.0 cannot be raised to a negative power");const n=Math.pow(t,e);if(1/0===Math.abs(n)&&1/0!==Math.abs(t)&&1/0!==Math.abs(e))throw new Sk.builtin.OverflowError("Numerical result out of range");return new Sk.builtin.float_(n)}Sk.builtin.float_=Sk.abstr.buildNativeClass("float",{constructor:function(t){if(Sk.asserts.assert(this instanceof Sk.builtin.float_,"bad call to float use 'new'"),"number"==typeof t)this.v=t;else if(void 0===t)this.v=0;else if("string"==typeof t)this.v=parseFloat(t);else{if(t.nb$float)return t.nb$float();Sk.asserts.fail("bad argument to float constructor")}},slots:{tp$getattr:Sk.generic.getAttr,tp$as_number:!0,tp$doc:"Convert a string or number to a floating point number, if possible.",tp$hash(){var t=this.v;if(!Number.isFinite(t))return Number.isNaN(t)?0:0e&&(t=-1,e=-e);let s,r=0;for(;e;)r=r<<28&536870911|r>>1,e*=268435456,i-=28,s=Math.trunc(e),e-=s,r+=s,536870911<=r&&(r-=536870911);return i=0<=i?i%29:28-(-1-i)%29,r=(r<>29-i)*t,-1===r?-2:r},$r(){return new Sk.builtin.str(this.str$(10,!0))},tp$new(t,e){if(e&&e.length)throw new Sk.builtin.TypeError("float() takes no keyword arguments");if(t&&1t?Math.ceil(t):Math.floor(t),Sk.builtin.int_.withinThreshold(t)?new Sk.builtin.int_(t):new Sk.builtin.int_(JSBI.BigInt(t))},nb$float:i,nb$long(){return new Sk.builtin.lng(this.nb$int().v)},nb$add:s(((t,e)=>new Sk.builtin.float_(t+e))),nb$subtract:s(((t,e)=>new Sk.builtin.float_(t-e))),nb$reflected_subtract:s(((t,e)=>new Sk.builtin.float_(e-t))),nb$multiply:s(((t,e)=>new Sk.builtin.float_(t*e))),nb$divide:s(a),nb$reflected_divide:s(((t,e)=>a(e,t))),nb$floor_divide:s(l),nb$reflected_floor_divide:s(((t,e)=>l(e,t))),nb$remainder:s(u),nb$reflected_remainder:s(((t,e)=>u(e,t))),nb$divmod:s(((t,e)=>new Sk.builtin.tuple([l(t,e),u(t,e)]))),nb$reflected_divmod:s(((t,e)=>new Sk.builtin.tuple([l(e,t),u(e,t)]))),nb$power:o(c),nb$reflected_power:o(((t,e)=>c(e,t))),nb$abs(){return new Sk.builtin.float_(Math.abs(this.v))},nb$negative(){return new Sk.builtin.float_(-this.v)},nb$positive(){return new Sk.builtin.float_(this.v)},nb$bool(){return 0!==this.v},nb$isnegative(){return 0>this.v},nb$ispositive(){return 0<=this.v},ob$eq:r(((t,e)=>t==e),JSBI.EQ),ob$ne:r(((t,e)=>t!=e),JSBI.NE),ob$gt:r(((t,e)=>t>e),JSBI.GT),ob$ge:r(((t,e)=>t>=e),JSBI.GE),ob$lt:r(((t,e)=>tt<=e),JSBI.LE)},getsets:{real:{$get:i,$doc:"the real part of a complex number"},imag:{$get:()=>new Sk.builtin.float_(0),$doc:"the imaginary part of a complex number"}},methods:{conjugate:{$meth:i,$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return self, the complex conjugate of any float."},__trunc__:{$meth(){return this.nb$int()},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return the Integral closest to x between 0 and x."},__round__:{$meth(t){return this.round$(t)},$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, ndigits=None, /)",$doc:"Return the Integral closest to x, rounding half toward even.\n\nWhen an argument is passed, work like built-in round(x, ndigits)."},as_integer_ratio:{$meth(){if(!Number.isFinite(this.v)){if(Number.isNaN(this.v))throw new Sk.builtin.ValueError("cannot convert NaN to integer ratio");throw new Sk.builtin.OverflowError("cannot convert Infinity to integer ratio")}let[t,e]=n(this.v);for(var i=0;300>i&&t!=Math.floor(t);i++)t*=2,e--;i=new Sk.builtin.int_(Math.abs(e));let s=new Sk.builtin.int_(t),r=new Sk.builtin.int_(1);return 0>> (10.0).as_integer_ratio()\n(10, 1)\n>>> (0.0).as_integer_ratio()\n(0, 1)\n>>> (-.25).as_integer_ratio()\n(-1, 4)"},is_integer:{$meth(){return new Sk.builtin.bool(Number.isInteger(this.v))},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return True if the float is an integer."},__getnewargs__:{$meth(){return new Sk.builtin.tuple([this])},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:Sk.builtin.none.none$},__format__:{$meth:Sk.formatting.mkNumber__format__(!0),$flags:{OneArg:!0},$textsig:"($self, format_spec, /)",$doc:Sk.builtin.none.none$}},proto:{valueOf(){return this.v}}});const p=/_[eE]|[eE]_|\._|_\.|[+-]_|__/,h=/_(?=[^_])/g;Sk.builtin.float_.PyFloat_Check=function(t){return void 0!==t&&!!(Sk.builtin.checkNumber(t)||Sk.builtin.checkFloat(t)||t.ob$type.$isSubType(Sk.builtin.float_))},Sk.builtin.float_.prototype.toFixed=function(t){return t=Sk.builtin.asnum$(t),this.v.toFixed(t)},Sk.builtin.float_.prototype.round$=function(t){var e=Sk.builtin.asnum$(this),n=void 0===t?0:Sk.misceval.asIndexSized(t);if(Sk.__future__.bankers_rounding){e*=Math.pow(10,n);var i=Math.round(e);return n=(.5==(0n.length?e.toExponential():e.toExponential(11)),0>n.indexOf("e")&&0<=n.indexOf(".")){for(;"0"==n.charAt(n.length-1);)n=n.substring(0,n.length-1);"."==n.charAt(n.length-1)&&(n+="0")}n=(n=(n=n.replace(/\.0+e/,"e","i")).replace(/(e[-+])([1-9])$/,"$10$2")).replace(/0+(e.*)/,"$1")}else n=e.toString(t);return 0===this.v&&-1/0==1/this.v&&(n="-"+n),0>n.indexOf(".")&&0>n.indexOf("E")&&0>n.indexOf("e")&&(n+=".0"),n},Sk.builtin.float_.py2$methods={}},function(t,e){function n(t){let e=t.v;if("number"==typeof e)return e;if(t.nb$float&&(e=t.nb$float()),void 0===e)throw new Sk.builtin.TypeError("a float is required");return e.v}function i(t,e,n){return n===Sk.builtin.complex.prototype?new Sk.builtin.complex(t,e):(n=new n.constructor,Sk.builtin.complex.call(n,t,e),n)}function s(t,e){return function(n){const i=this.real,s=this.imag;var r=n.real;const o=n.v;if("number"==typeof r)n=n.imag;else if("number"==typeof o)r=o,n=0;else{if(!JSBI.__isBigInt(o))return Sk.builtin.NotImplemented.NotImplemented$;if(void 0===e){if(1/0==(r=parseFloat(JSBI.toNumber(o)))||-1/0==r)throw new Sk.builtin.OverflowError("int too large to convert to float")}else r=o.toString();n=0}return t(i,s,r,n)}}function r(t,e,n,i){var s=Math.abs(n);const r=Math.abs(i);if(s>=r){if(0===s)throw new Sk.builtin.ZeroDivisionError("complex division by zero");i=(t+e*(s=i/n))/(n+=i*s),t=(e-t*s)/n}else r>=s?(n=n*(s=n/i)+i,Sk.asserts.assert(0!==i),i=(t*s+e)/n,t=(e*s-t)/n):t=i=NaN;return new Sk.builtin.complex(i,t)}function o(t,e,n,i){if(0===n&&0===i){i=1;var s=0}else if(0===t&&0===e){if(0!==i||0>n)throw new Sk.builtin.ZeroDivisionError("complex division by zero");s=i=0}else{const r=Math.hypot(t,e);s=Math.pow(r,n),n*=t=Math.atan2(e,t),0!==i&&(s/=Math.exp(t*i),n+=i*Math.log(r)),i=s*Math.cos(n),s*=Math.sin(n)}return new Sk.builtin.complex(i,s)}function a(t,e,n){let i=1;var s=new Sk.builtin.complex(1,0);for(t=new Sk.builtin.complex(t,e);0=i;)n&i&&(s=new Sk.builtin.complex(s.real*t.real-s.imag*t.imag,s.real*t.imag+t.real*s.imag)),i<<=1,t=new Sk.builtin.complex(t.real*t.real-t.imag*t.imag,2*t.real*t.imag);return s}function l(t,e,n,i,s){switch(s=!1,e){case"e":case"f":case"g":break;case"E":s=!0,e="e";break;case"F":s=!0,e="f";break;case"r":if(0!==n)throw Error("Bad internall call");n=17,e="g";break;default:throw Error("Bad internall call")}if(isNaN(t))t="nan";else if(1/0===t)t="inf";else if(-1/0===t)t="-inf";else{i&l.Py_DTSF_ADD_DOT_0&&(e="g");var r="%"+(i&l.Py_DTSF_ALT?"#":"");null!=n&&(r=r+"."+n),t=(t=(r=new Sk.builtin.str(r+e)).nb$remainder(new Sk.builtin.float_(t))).v}return i&l.Py_DTSF_SIGN&&"-"!==t[0]&&(t="+"+t),s&&(t=t.toUpperCase()),t}Sk.builtin.complex=Sk.abstr.buildNativeClass("complex",{constructor:function(t,e){Sk.asserts.assert(this instanceof Sk.builtin.complex,"bad call to complex constructor, use 'new'"),this.real=t,this.imag=e},slots:{tp$as_number:!0,tp$doc:"Create a complex number from a real part and an optional imaginary part.\n\nThis is equivalent to (real + imag*1j) where imag defaults to 0.",tp$hash(){var t=new Sk.builtin.float_(this.real).tp$hash();return t=1003*new Sk.builtin.float_(this.imag).tp$hash()+t,Sk.builtin.int_.withinThreshold(t)?t:new Sk.builtin.int_(JSBI.BigInt(t)).tp$hash()},tp$getattr:Sk.generic.getAttr,tp$new(t,e){{var s,r=(t=Sk.abstr.copyKeywordsToNamedArgs("complex",["real","imag"],t,e,[null,null]))[1];let a=e=!1;var o=t[0];if(null!=o&&o.constructor===Sk.builtin.complex&&null==r)e=o;else if(Sk.builtin.checkString(o)){if(null!=r)throw new Sk.builtin.TypeError("complex() can't take second arg if first is a string");e=Sk.builtin.complex.complex_subtype_from_string(o,this)}else{if(null!=r&&Sk.builtin.checkString(r))throw new Sk.builtin.TypeError("complex() second arg can't be a string");if(null==o?t=null:t=void 0!==(t=Sk.abstr.lookupSpecial(o,Sk.builtin.str.$complex))?Sk.misceval.callsimArray(t,[]):null,null!=t&&t!==Sk.builtin.NotImplemented.NotImplemented$){if(!u(t))throw new Sk.builtin.TypeError("__complex__ should return a complex object");o=t}if(null!=o&&void 0===o.nb$float)throw new Sk.builtin.TypeError("complex() first argument must be a string or a number, not '"+Sk.abstr.typeName(o)+"'");if(null!=r&&void 0===r.nb$float)throw new Sk.builtin.TypeError("complex() second argument must be a number, not '"+Sk.abstr.typeName(o)+"'");null==o?o=t=0:u(o)?(t=o.real,o=o.imag,e=!0):(t=n(o),o=0),null==r?r=s=0:u(r)?(s=r.real,r=r.imag,a=!0):(s=n(r),r=0),!0===a&&(t-=r),!0===e&&(s+=o),e=i(t,s,this)}}return e},tp$richcompare(t,e){if("Eq"!==e&&"NotEq"!==e){if(Sk.builtin.checkNumber(t)||u(t))throw new Sk.builtin.TypeError("no ordering relation is defined for complex numbers");return Sk.builtin.NotImplemented.NotImplemented$}return s((function(t,n,i,s){return t=t==i&&n==s,"Eq"===e?t:!t}),!0).call(this,t)},$r(){{var t,e;let s=t="";var n=this.real,i=this.imag;(e=0===n)&&(e=1==(n?0>n?-1:1:0>1/n?-1:1)),e?(n="",e=l(i,"g",null,0,null)):(n=t=l(n,"g",null,0,null),e=l(i,"g",null,l.Py_DTSF_SIGN,null),0===i&&-1/0==1/i&&e&&"-"!==e[0]&&(e="-"+e),t="(",s=")"),i=new Sk.builtin.str(""+t+n+e+"j"+s)}return i},nb$int(){throw new Sk.builtin.TypeError("can't convert complex to int")},nb$long(){throw new Sk.builtin.TypeError("can't convert complex to long")},nb$float(){throw new Sk.builtin.TypeError("can't convert complex to float")},nb$positive(){return new Sk.builtin.complex(this.real,this.imag)},nb$negative(){return new Sk.builtin.complex(-this.real,-this.imag)},nb$bool(){return this.real||this.imag},nb$add:s(((t,e,n,i)=>new Sk.builtin.complex(t+n,e+i))),nb$subtract:s(((t,e,n,i)=>new Sk.builtin.complex(t-n,e-i))),nb$reflected_subtract:s(((t,e,n,i)=>new Sk.builtin.complex(n-t,i-e))),nb$multiply:s(((t,e,n,i)=>new Sk.builtin.complex(n*t-i*e,t*i+e*n))),nb$divide:s(r),nb$reflected_divide:s(((t,e,n,i)=>r(n,i,t,e))),nb$floor_divide(t){throw new Sk.builtin.TypeError("can't take floor of complex number.")},nb$reflected_floor_divide(t){throw new Sk.builtin.TypeError("can't take floor of complex number.")},nb$remainder(t){throw new Sk.builtin.TypeError("can't mod complex numbers.")},nb$reflected_remainder(t){throw new Sk.builtin.TypeError("can't mod complex numbers.")},nb$divmod(t){throw new Sk.builtin.TypeError("can't take floor or mod of complex number.")},nb$power(t,e){if(null!=e&&!Sk.builtin.checkNone(e))throw new Sk.builtin.ValueError("complex modulo");return _.call(this,t)},nb$reflected_power(t,e){if(null!=e&&!Sk.builtin.checkNone(e))throw new Sk.builtin.ValueError("complex modulo");return d.call(this,t)},nb$abs(){var t=this.real;const e=this.imag;if(!Number.isFinite(t)||!Number.isFinite(e))return 1/0===t||-1/0===t?new Sk.builtin.float_(Math.abs(t)):1/0===e||-1/0===e?new Sk.builtin.float_(Math.abs(e)):new Sk.builtin.float_(NaN);if(t=Math.hypot(t,e),!Number.isFinite(t))throw new Sk.builtin.OverflowError("absolute value too large");return new Sk.builtin.float_(t)}},getsets:{real:{$get(){return new Sk.builtin.float_(this.real)},$doc:"the real part of a complex number"},imag:{$get(){return new Sk.builtin.float_(this.imag)},$doc:"the imaginary part of a complex number"}},methods:{conjugate:{$meth(){return new Sk.builtin.complex(this.real,-this.imag)},$flags:{NoArgs:!0},$textsig:null,$doc:"complex.conjugate() -> complex\n\nReturn the complex conjugate of its argument. (3-4j).conjugate() == 3+4j."},__getnewargs__:{$meth(){return new Sk.builtin.tuple([new Sk.builtin.float_(this.real),new Sk.builtin.float_(this.imag)])},$flags:{NoArgs:!0},$textsig:null,$doc:Sk.builtin.none.none$},__format__:{$meth(t){if(Sk.builtin.checkString(t))throw new Sk.builtin.NotImplementedError("__format__ is not implemented for complex type.");throw new Sk.builtin.TypeError("__format__ requires str")},$flags:{OneArg:!0},$textsig:null,$doc:"complex.__format__() -> str\n\nConvert to a string according to format_spec."}}}),Sk.exportSymbol("Sk.builtin.complex",Sk.builtin.complex);const u=Sk.builtin.checkComplex,c=/_[eE]|[eE]_|\._|_\.|[+-]_|_j|j_/,p=/_(?=[^_])/g;Sk.builtin.complex.complex_subtype_from_string=function(t,e){e=e||Sk.builtin.complex.prototype;var n=0,s=0,r=!1;if(Sk.builtin.checkString(t))t=Sk.ffi.remapToJs(t);else if("string"!=typeof t)throw new TypeError("provided unsupported string-alike argument");if(-1!==t.indexOf("\0")||0===t.length||""===t)throw new Sk.builtin.ValueError("complex() arg is a malformed string");var o=0;for(t=(t=t.replace(/inf|infinity/gi,"Infinity")).replace(/nan/gi,"NaN");" "===t[o];)o++;if("("===t[o])for(r=!0,o++;" "===t[o];)o++;if(-1!==t.indexOf("_")){if(c.test(t))throw new Sk.builtin.ValueError("could not convert string to complex: '"+t+"'");t=t.charAt(0)+t.substring(1).replace(p,"")}var a=/^(?:[+-]?(?:(?:(?:\d*\.\d+)|(?:\d+\.?))(?:[eE][+-]?\d+)?|NaN|Infinity))/,l=t.substr(o),u=l.match(a);if(null!==u)if("j"===t[o+=u[0].length]||"J"===t[o])s=parseFloat(u[0]),o++;else if("+"===t[o]||"-"===t[o]){if(n=parseFloat(u[0]),null!==(u=t.substr(o).match(a))?(s=parseFloat(u[0]),o+=u[0].length):(s="+"===t[o]?1:-1,o++),"j"!==t[o]&&"J"!==t[o])throw new Sk.builtin.ValueError("complex() arg is malformed string");o++}else n=parseFloat(u[0]);else null!==(u=u=l.match(/^([+-]?[jJ])/))&&(s=1===u[0].length||"+"===u[0][0]?1:-1,o+=u[0].length);for(;" "===t[o];)o++;if(r){if(")"!==t[o])throw new Sk.builtin.ValueError("complex() arg is malformed string");for(o++;" "===t[o];)o++}if(t.length!==o)throw new Sk.builtin.ValueError("complex() arg is malformed string");return i(n,s,e)};const h=(t,e,n,i)=>{const s=0|n;return 0===i&&n===s?(100s?t=o(t,e,s,0):0h(n,i,t,e)));l.Py_DTSF_SIGN=1,l.Py_DTSF_ADD_DOT_0=2,l.Py_DTSF_ALT=4,l.Py_DTST_FINITE=0,l.Py_DTST_INFINITE=1,l.Py_DTST_NAN=2},function(t,e){Sk.builtin.slice=Sk.abstr.buildNativeClass("slice",{constructor:function(t,e,n){void 0===e&&void 0===n&&(e=t,t=Sk.builtin.none.none$),void 0===e&&(e=Sk.builtin.none.none$),void 0===n&&(n=Sk.builtin.none.none$),this.start=t,this.stop=e,this.step=n},slots:{tp$getattr:Sk.generic.getAttr,tp$doc:"slice(stop)\nslice(start, stop[, step])\n\nCreate a slice object. This is used for extended slicing (e.g. a[0:10:2]).",tp$hash:Sk.builtin.none.none$,tp$new:(t,e)=>(Sk.abstr.checkNoKwargs("slice",e),Sk.abstr.checkArgsLen("slice",t,1,3),new Sk.builtin.slice(...t)),$r(){const t=Sk.misceval.objectRepr(this.start),e=Sk.misceval.objectRepr(this.stop),n=Sk.misceval.objectRepr(this.step);return new Sk.builtin.str("slice("+t+", "+e+", "+n+")")},tp$richcompare(t,e){if(t.ob$type!==Sk.builtin.slice)return Sk.builtin.NotImplemented.NotImplemented$;const n=new Sk.builtin.tuple([this.start,this.stop,this.step]);return t=new Sk.builtin.tuple([t.start,t.stop,t.step]),n.tp$richcompare(t,e)}},getsets:{start:{$get(){return this.start}},step:{$get(){return this.step}},stop:{$get(){return this.stop}}},methods:{indices:{$meth:function(t){if(0>(t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError)))throw new Sk.builtin.TypeError("length should not be negative");const{start:e,stop:n,step:i}=this.slice$indices(t);return new Sk.builtin.tuple([new Sk.builtin.int_(e),new Sk.builtin.int_(n),new Sk.builtin.int_(i)])},$doc:"S.indices(len) -> (start, stop, stride)\n\nAssuming a sequence of length len, calculate the start and stop\nindices, and the stride length of the extended slice described by\nS. Out of bounds indices are clipped in a manner consistent with the\nhandling of normal slices.",$textsig:null,$flags:{OneArg:!0}}},proto:{slice$as_indices(t){let e;var n=t?t=>Sk.misceval.asIndexSized(t,null,"slice indices must be integers or None or have an __index__ method"):t=>Sk.misceval.asIndexOrThrow(t,"slice indices must be integers or None or have an __index__ method");if(Sk.builtin.checkNone(this.step))e=1;else if(e=n(this.step),0===e)throw new Sk.builtin.ValueError("slice step cannot be zero");return{start:t=Sk.builtin.checkNone(this.start)?null:n(this.start),stop:n=Sk.builtin.checkNone(this.stop)?null:n(this.stop),step:e}},$wrt:(t,e,n,i,s)=>(s=s?e=>JSBI.__isBigInt(e)?JSBI.add(e,JSBI.BigInt(t)):e+t:e=>e+t,0e&&(0>(e=s(e))&&(e=0)),null===n||n>t?n=t:0>n&&(n=s(n))):(null===e||e>=t?e=t-1:0>e&&(e=s(e)),null===n?n=-1:0>n&&(0>(n=s(n))&&(n=-1))),{start:e,stop:n,step:i}),slice$indices(t,e){let{start:n,stop:i,step:s}=this.slice$as_indices(!0,e);return this.$wrt(t,n,i,s,e)},sssiter$(t,e){let{start:n,stop:i,step:s}=this.slice$indices(t,!0);if(0i;t+=s)e(t)}},flags:{sk$unacceptableBase:!0}}),Sk.builtin.slice.startEnd$wrt=function(t,e,n){return t=t.sq$length(),void 0===e||Sk.builtin.checkNone(e)?e=0:0>(e=Sk.misceval.asIndexSized(e,null,"slice indices must be integers or have an __index__ method"))&&(0>(e+=t)&&(e=0)),void 0===n||Sk.builtin.checkNone(n)?n=t:0>(n=Sk.misceval.asIndexSized(n,null,"slice indices must be integers or have an __index__ method"))?0>(n+=t)&&(n=0):n>t&&(n=t),{start:e,end:n}}},function(t,e){function n(t){return function(e){return Sk.builtin.checkAnySet(e)?t.call(this,e):Sk.builtin.NotImplemented.NotImplemented$}}function i(t){return t instanceof Sk.builtin.set&&t.tp$hash===Sk.builtin.none.none$&&(t=new Sk.builtin.frozenset(Sk.misceval.arrayFromIterable(t))),t}t={},Sk.builtin.set=Sk.abstr.buildNativeClass("set",{constructor:function(t){void 0===t?t=[]:Array.isArray(t)||(t=Sk.misceval.arrayFromIterable(t)),Sk.asserts.assert(this instanceof Sk.builtin.set,"Bad call to set - must be called with an Array and 'new'");const e=[];for(let n=0;n new empty set object\nset(iterable) -> new set object\n\nBuild an unordered collection of unique elements.",tp$init(t,e){return Sk.abstr.checkNoKwargs("set",e),Sk.abstr.checkArgsLen("set",t,0,1),this.set$clear(),(t=t[0])&&this.set$update(t)},tp$new:Sk.generic.new,$r(){if(this.in$repr)return new Sk.builtin.str(Sk.abstr.typeName(this)+"(...)");this.in$repr=!0;const t=this.sk$asarray().map((t=>Sk.misceval.objectRepr(t)));return this.in$repr=!1,Sk.__future__.python3?0===t.length?new Sk.builtin.str(Sk.abstr.typeName(this)+"()"):this.ob$type!==Sk.builtin.set?new Sk.builtin.str(Sk.abstr.typeName(this)+"({"+t.join(", ")+"})"):new Sk.builtin.str("{"+t.join(", ")+"}"):new Sk.builtin.str(Sk.abstr.typeName(this)+"(["+t.join(", ")+"])")},tp$iter(){return new s(this)},tp$richcompare(t,e){if(!Sk.builtin.checkAnySet(t))return Sk.builtin.NotImplemented.NotImplemented$;switch(e){case"NotEq":case"Eq":return t=this===t||this.get$size()===t.get$size()&&Sk.misceval.isTrue(this.set$issubset(t)),"Eq"===e?t:!t;case"LtE":return this===t||Sk.misceval.isTrue(this.set$issubset(t));case"GtE":return this===t||Sk.misceval.isTrue(t.set$issubset(this));case"Lt":return this.get$size()t.get$size()&&Sk.misceval.isTrue(t.set$issubset(this))}},nb$subtract:n((function(t){return this.difference.$meth.call(this,t)})),nb$and:n((function(t){return this.intersection.$meth.call(this,t)})),nb$or:n((function(t){return this.union.$meth.call(this,t)})),nb$xor:n((function(t){return this.symmetric_difference.$meth.call(this,t)})),nb$inplace_subtract:n((function(t){return t===this&&(t=t.set$copy()),Sk.misceval.chain(this.difference_update.$meth.call(this,t),(()=>this))})),nb$inplace_and:n((function(t){return Sk.misceval.chain(this.intersection_update.$meth.call(this,t),(()=>this))})),nb$inplace_or:n((function(t){return Sk.misceval.chain(this.update.$meth.call(this,t),(()=>this))})),nb$inplace_xor:n((function(t){return t===this&&(t=t.set$copy()),Sk.misceval.chain(this.symmetric_difference_update.$meth.call(this,t),(()=>this))})),sq$length(){return this.get$size()},sq$contains(t){return t=i(t),this.v.sq$contains(t)}},methods:{add:{$meth(t){return this.set$add(t),Sk.builtin.none.none$},$flags:{OneArg:!0},$textsig:null,$doc:"Add an element to a set.\n\nThis has no effect if the element is already present."},clear:{$meth(){return this.set$clear(),Sk.builtin.none.none$},$flags:{NoArgs:!0},$textsig:null,$doc:"Remove all elements from this set."},copy:{$meth(){return this.set$copy()},$flags:{NoArgs:!0},$textsig:null,$doc:"Return a shallow copy of a set."},discard:{$meth(t){return t=i(t),this.set$discard(t),Sk.builtin.none.none$},$flags:{OneArg:!0},$textsig:null,$doc:"Remove an element from a set if it is a member.\n\nIf the element is not a member, do nothing."},difference:{$meth(...t){const e=this.set$copy();return Sk.misceval.chain(Sk.misceval.iterArray(t,(t=>e.set$difference_update(t))),(()=>e))},$flags:{MinArgs:0},$textsig:null,$doc:"Return the difference of two or more sets as a new set.\n\n(i.e. all elements that are in this set but not the others.)"},difference_update:{$meth(...t){return Sk.misceval.chain(Sk.misceval.iterArray(t,(t=>this.set$difference_update(t))),(()=>Sk.builtin.none.none$))},$flags:{MinArgs:0},$textsig:null,$doc:"Remove all elements of another set from this set."},intersection:{$meth(...t){return this.set$intersection_multi(...t)},$flags:{MinArgs:0},$textsig:null,$doc:"Return the intersection of two sets as a new set.\n\n(i.e. all elements that are in both sets.)"},intersection_update:{$meth(...t){return Sk.misceval.chain(this.set$intersection_multi(...t),(t=>(this.swap$bodies(t),Sk.builtin.none.none$)))},$flags:{MinArgs:0},$textsig:null,$doc:"Update a set with the intersection of itself and another."},isdisjoint:{$meth(t){return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{if(this.sq$contains(t))return new Sk.misceval.Break(Sk.builtin.bool.false$)})),(t=>t||Sk.builtin.bool.true$))},$flags:{OneArg:!0},$textsig:null,$doc:"Return True if two sets have a null intersection."},issubset:{$meth(t){return Sk.builtin.checkAnySet(t)||(t=this.set$make_basetype(t)),Sk.misceval.chain(t,(t=>this.set$issubset(t)))},$flags:{OneArg:!0},$textsig:null,$doc:"Report whether another set contains this set."},issuperset:{$meth(t){return Sk.builtin.checkAnySet(t)||(t=this.set$make_basetype(t)),Sk.misceval.chain(t,(t=>t.set$issubset(this)))},$flags:{OneArg:!0},$textsig:null,$doc:"Report whether this set contains another set."},pop:{$meth(){if(0===this.get$size())throw new Sk.builtin.KeyError("pop from an empty set");return Sk.misceval.callsimArray(this.v.popitem,[this.v]).v[0]},$flags:{NoArgs:!0},$textsig:null,$doc:"Remove and return an arbitrary set element.\nRaises KeyError if the set is empty."},remove:{$meth(t){const e=i(t);if(this.v.mp$lookup(e))return this.v.mp$ass_subscript(e),Sk.builtin.none.none$;throw new Sk.builtin.KeyError(t)},$flags:{OneArg:!0},$textsig:null,$doc:"Remove an element from a set; it must be a member.\n\nIf the element is not a member, raise a KeyError."},symmetric_difference:{$meth(t){let e;return Sk.misceval.chain(this.set$make_basetype(t),(t=>(e=t,e.set$symmetric_diff_update(this))),(()=>e))},$flags:{OneArg:!0},$textsig:null,$doc:"Return the symmetric difference of two sets as a new set.\n\n(i.e. all elements that are in exactly one of the sets.)"},symmetric_difference_update:{$meth(t){return Sk.builtin.checkAnySet(t)||(t=this.set$make_basetype(t)),Sk.misceval.chain(t,(t=>this.set$symmetric_diff_update(t)),(()=>Sk.builtin.none.none$))},$flags:{OneArg:!0},$textsig:null,$doc:"Update a set with the symmetric difference of itself and another."},union:{$meth(...t){const e=this.set$copy();return Sk.misceval.chain(Sk.misceval.iterArray(t,(t=>e.set$update(t))),(()=>e))},$flags:{MinArgs:0},$textsig:null,$doc:"Return the union of sets as a new set.\n\n(i.e. all elements that are in either set.)"},update:{$meth(...t){return Sk.misceval.chain(Sk.misceval.iterArray(t,(t=>this.set$update(t))),(()=>Sk.builtin.none.none$))},$flags:{MinArgs:0},$textsig:null,$doc:"Update a set with the union of itself and others."}},classmethods:Sk.generic.classGetItem,proto:Object.assign(t,{sk$asarray(){return this.v.sk$asarray()},get$size(){return this.v.sq$length()},set$add(t){this.v.mp$ass_subscript(t,!0)},set$make_basetype(t){return Sk.misceval.chain(Sk.misceval.arrayFromIterable(t,!0),(t=>new this.sk$builtinBase(t)))},set$discard(t){return this.v.pop$item(t)},set$clear(){this.v=new Sk.builtin.dict([])},set$copy(){const t=new this.sk$builtinBase;return t.v=this.v.dict$copy(),t},set$difference_update(t){return Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{this.set$discard(t)}))},set$intersection(t){const e=new this.sk$builtinBase;return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{this.sq$contains(t)&&e.set$add(t)})),(()=>e))},set$intersection_multi(...t){if(!t.length)return this.set$copy();let e=this;return Sk.misceval.chain(Sk.misceval.iterArray(t,(t=>Sk.misceval.chain(e.set$intersection(t),(t=>{e=t})))),(()=>e))},set$issubset(t){if(this.get$size()>t.get$size())return Sk.builtin.bool.false$;for(let e=this.tp$iter(),n=e.tp$iternext();void 0!==n;n=e.tp$iternext())if(!t.sq$contains(n))return Sk.builtin.bool.false$;return Sk.builtin.bool.true$},set$symmetric_diff_update(t){return Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{void 0===this.set$discard(t)&&this.set$add(t)}))},set$update(t){return Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{this.set$add(t)}))},swap$bodies(t){this.v=t.v}})}),Sk.exportSymbol("Sk.builtin.set",Sk.builtin.set),e=Sk.builtin.set.prototype,Sk.builtin.frozenset=Sk.abstr.buildNativeClass("frozenset",{constructor:function(t){void 0===t?t=[]:Array.isArray(t)||(t=Sk.misceval.arrayFromIterable(t)),Sk.asserts.assert(this instanceof Sk.builtin.frozenset,"bad call to frozen set - must be called with 'new'");const e=[];for(let n=0;n empty frozenset object\nfrozenset(iterable) -> frozenset object\n\nBuild an immutable unordered collection of unique elements.",tp$hash(){let t=1927868237;const e=this.sk$asarray();t*=e.length+1;for(let n=0;nt.length?new Sk.builtin.frozenset(t):Sk.builtin.frozenset.$emptyset)))},$r:e.$r,tp$iter:e.tp$iter,tp$richcompare:e.tp$richcompare,nb$subtract:e.nb$subtract,nb$and:e.nb$and,nb$or:e.nb$or,nb$xor:e.nb$xor,sq$length:e.sq$length,sq$contains:e.sq$contains},methods:{copy:Object.assign({},e.copy.d$def,{$meth(){return this.constructor===this.sk$builtinBase?this:new Sk.builtin.frozenset(this.sk$asarray())}}),difference:e.difference.d$def,intersection:e.intersection.d$def,isdisjoint:e.isdisjoint.d$def,issubset:e.issubset.d$def,issuperset:e.issuperset.d$def,symmetric_difference:e.symmetric_difference.d$def,union:e.union.d$def},classmethods:Sk.generic.classGetItem,proto:Object.assign({$subtype_new(t,e){const n=new this.constructor;return Sk.misceval.chain(Sk.builtin.frozenset.prototype.tp$new(t),(t=>(n.v=t.v,n)))}},t)}),Sk.builtin.frozenset.$emptyset=new Sk.builtin.frozenset([]),Sk.exportSymbol("Sk.builtin.frozenset",Sk.builtin.frozenset);var s=Sk.abstr.buildIteratorClass("set_iterator",{constructor:function(t){this.$index=0,this.$seq=t.sk$asarray(),this.$orig=t},iternext:Sk.generic.iterNextWithArrayCheckSize,methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$unacceptableBase:!0}})},function(t,e){Sk.builtin.print=function(t,e){let n,[i,s,r]=Sk.abstr.copyKeywordsToNamedArgs("print",["sep","end","file","flush"],[],e);if(void 0===i||Sk.builtin.checkNone(i))i=" ";else{if(!Sk.builtin.checkString(i))throw new Sk.builtin.TypeError("sep must be None or a string, not "+Sk.abstr.typeName(i));i=i.$jsstr()}if(void 0===s||Sk.builtin.checkNone(s))s="\n";else{if(!Sk.builtin.checkString(s))throw new Sk.builtin.TypeError("end must be None or a string, not "+Sk.abstr.typeName(s));s=s.$jsstr()}if(void 0!==r&&!Sk.builtin.checkNone(r)&&(n=Sk.abstr.lookupSpecial(r,Sk.builtin.str.$write),void 0===n))throw new Sk.builtin.AttributeError("'"+Sk.abstr.typeName(r)+"' object has no attribute 'write'");const o=new Sk.builtin.str(t.map((t=>new Sk.builtin.str(t).toString())).join(i)+s);if(void 0===n)return Sk.misceval.chain(Sk.importModule("sys",!1,!0),(t=>(n=Sk.abstr.lookupSpecial(t.$d.stdout,Sk.builtin.str.$write))&&Sk.misceval.callsimOrSuspendArray(n,[o])));Sk.misceval.callsimArray(n,[o])},Sk.builtin.print.co_fastcall=1},function(t,e){Sk.builtin.module=Sk.abstr.buildNativeClass("module",{constructor:function(){this.$d={}},slots:{tp$doc:"Create a module object.\n\nThe name must be a string; the optional doc argument can have any type.",tp$getattr(t,e){var n=this.$d[t.$mangled];if(void 0!==n)return n;if(void 0!==(n=this.ob$type.$typeLookup(t))){const t=n.tp$descr_get;return t?t.call(n,this,this.ob$type,e):n}const i=this.$d.__getattr__;return void 0!==i?(n=Sk.misceval.tryCatch((()=>Sk.misceval.callsimOrSuspendArray(i,[t])),(t=>{if(!(t instanceof Sk.builtin.AttributeError))throw t})),e?n:Sk.misceval.retryOptionalSuspensionOrThrow(n)):void 0},tp$setattr:Sk.generic.setAttr,tp$new:Sk.generic.new,tp$init(t,e){const[n,i]=Sk.abstr.copyKeywordsToNamedArgs("module",["name","doc"],t,e,[Sk.builtin.none.none$]);Sk.builtin.pyCheckType("module","string",n),this.init$dict(n,i)},$r(){let t=this.get$name();if(void 0!==t){var e=this.get$mod_reprf();if(void 0!==e)return Sk.misceval.callsimOrSuspendArray(e,[this])}return t=void 0===t?"'?'":t,e=void 0===(e=this.from$file())?this.empty_or$loader():e,new Sk.builtin.str("")}},getsets:{__dict__:{$get(){return new Sk.builtin.mappingproxy(this.$d)}}},methods:{__dir__:{$meth(){const t=this.tp$getattr(Sk.builtin.str.$dict);if(!Sk.builtin.checkMapping(t))throw new Sk.builtin.TypeError("__dict__ is not a dictionary");const e=t.mp$lookup(Sk.builtin.str.$dir);return void 0!==e?Sk.misceval.callsimOrSuspendArray(e,[]):new Sk.builtin.list(Sk.misceval.arrayFromIterable(t))},$flags:{NoArgs:!0},$doc:"__dir__() -> list\nspecialized dir() implementation"}},proto:{sk$hasDict:!0,init$dict(t,e){this.$d.__name__=t,this.$d.__doc__=e,this.$d.__package__=Sk.builtin.none.none$,this.$d.__spec__=Sk.builtin.none.none$,this.$d.__loader__=Sk.builtin.none.none$},sk$attrError(){let t=this.get$name();return t=void 0===t?"module":"module "+t,this.$initializing&&(t="(most likely due to a circular import) partially initialized "+t),t},get$name(){const t=this.tp$getattr(Sk.builtin.str.$name);return t&&Sk.misceval.objectRepr(t)},from$file(){const t=this.tp$getattr(Sk.builtin.str.$file);return t&&" from "+Sk.misceval.objectRepr(t)},empty_or$loader(){if(this.$js&&this.$js.includes("$builtinmodule"))return" (built-in)";const t=this.tp$getattr(Sk.builtin.str.$loader);return void 0===t||Sk.builtin.checkNone(t)?"":" ("+Sk.misceval.objectRepr(t)+")"},get$mod_reprf(){const t=this.tp$getattr(Sk.builtin.str.$loader);return t&&t.tp$getattr(this.str$mod_repr)},str$mod_repr:new Sk.builtin.str("module_repr")}}),Sk.exportSymbol("Sk.builtin.module",Sk.builtin.module)},function(t,e){Sk.builtin.structseq_types={},Sk.builtin.make_structseq=function(t,e,n,i,s){i=void 0===i?{}:i,s=void 0===s?null:s;const r=t+"."+e,o=[],a={};Object.keys(n).forEach(((t,e)=>{o.push(t),a[t]={$get(){return this.v[e]},$doc:n[t]}}));const l=o.length;let u=l;Object.keys(i).forEach(((t,e)=>{a[t]={$get(){return this.$hidden[e]||Sk.builtin.none.none$},$doc:i[t]},u++}));var c=Sk.abstr.buildNativeClass(r,{constructor:function(t,e){Sk.asserts.assert(this instanceof c),Sk.builtin.tuple.call(this,t),this.$hidden=e||[]},base:Sk.builtin.tuple,slots:{tp$new(t,e){if(Sk.abstr.checkOneArg(r,t,e),(t=Sk.misceval.arrayFromIterable(t[0])).lengthu)throw new Sk.builtin.TypeError(r+"() takes an at most "+u+"-sequence ("+t.length+"-sequence given)");return new c(t.slice(0,l),t.slice(l))},tp$doc:s||Sk.builtin.none.none$,$r(){var t;if(0===this.v.length)return new Sk.builtin.str(r+"()");var e=[];for(t=0;t")}},iternext(t,e){var n=this;if(this.gi$running)throw new Sk.builtin.ValueError("generator already executing");return this.gi$running=!0,void 0===e&&(e=Sk.builtin.none.none$),this.gi$sentvalue=e,e=[this],this.func_closure&&e.push(this.func_closure),function e(i){if(i instanceof Sk.misceval.Suspension){if(t)return new Sk.misceval.Suspension(e,i);i=Sk.misceval.retryOptionalSuspensionOrThrow(i)}if(n.gi$running=!1,Sk.asserts.assert(void 0!==i),Array.isArray(i))return n.gi$resumeat=i[0],i[1];n.gi$ret=i}(this.func_code.apply(this.func_globals,e))},methods:{send:{$meth(t){return Sk.misceval.chain(this.tp$iternext(!0,t),(t=>{if(void 0===t)throw void 0!==(t=this.gi$ret)&&t!==Sk.builtin.none.none$?new Sk.builtin.StopIteration(t):new Sk.builtin.StopIteration;return t}))},$flags:{OneArg:!0},$doc:"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration."}}}),Sk.exportSymbol("Sk.builtin.generator",Sk.builtin.generator),Sk.builtin.makeGenerator=function(t,e){var n,i=new Sk.builtin.generator(null,null,null);for(n in i.tp$iternext=t,e)e.hasOwnProperty(n)&&(i[n]=e[n]);return i},Sk.exportSymbol("Sk.builtin.makeGenerator",Sk.builtin.makeGenerator)},function(t,e){Sk.builtin.file=function(t,e,n){var i;if(!(this instanceof Sk.builtin.file))return new Sk.builtin.file(t,e,n);if(this.mode=e,this.name=Sk.ffi.remapToJs(t),this.closed=!1,"/dev/stdout"===this.name)this.data$=Sk.builtin.none.none$,this.fileno=1;else if("/dev/stdin"===this.name)this.fileno=0;else if("/dev/stderr"===this.name)this.fileno=2;else{if(Sk.inBrowser)if(this.fileno=10,null==(n=document.getElementById(t.v))){if("w"!=e.v&&"a"!=e.v)throw new Sk.builtin.IOError("[Errno 2] No such file or directory: '"+t.v+"'");this.data$=""}else"textarea"==n.nodeName.toLowerCase()?this.data$=n.value:this.data$=n.textContent;else this.fileno=11,this.data$=Sk.read(t.v);for(i in this.lineList=this.data$.split("\n"),this.lineList=this.lineList.slice(0,-1),this.lineList)this.lineList[i]+="\n";this.currentLine=0}return this.pos$=0,Sk.fileopen&&10<=this.fileno&&Sk.fileopen(this),this},Sk.abstr.setUpInheritance("file",Sk.builtin.file,Sk.builtin.object),Sk.abstr.setUpBuiltinMro(Sk.builtin.file),Sk.builtin.file.prototype.$r=function(){return new Sk.builtin.str("<"+(this.closed?"closed":"open")+"file '"+this.name+"', mode '"+Sk.ffi.remapToJs(this.mode)+"'>")},Sk.builtin.file.prototype.tp$iter=function(){var t={tp$iter:function(){return t},$obj:this,$index:this.currentLine,$lines:this.lineList,tp$iternext:function(){if(!(t.$index>=t.$lines.length))return new Sk.builtin.str(t.$lines[t.$index++])}};return t},Sk.abstr.setUpSlots(Sk.builtin.file),Sk.builtin.file.prototype.__enter__=new Sk.builtin.func((function(t){return t})),Sk.builtin.file.prototype.__exit__=new Sk.builtin.func((function(t){return Sk.misceval.callsimArray(Sk.builtin.file.prototype.close,[t])})),Sk.builtin.file.prototype.close=new Sk.builtin.func((function(t){return t.closed=!0,Sk.builtin.none.none$})),Sk.builtin.file.prototype.flush=new Sk.builtin.func((function(t){})),Sk.builtin.file.prototype.fileno=new Sk.builtin.func((function(t){return this.fileno})),Sk.builtin.file.prototype.isatty=new Sk.builtin.func((function(t){return!1})),Sk.builtin.file.prototype.read=new Sk.builtin.func((function(t,e){var n=t.data$.length;if(t.closed)throw new Sk.builtin.ValueError("I/O operation on closed file");var i=void 0===e?n:Sk.ffi.remapToJs(e);return i=new Sk.builtin.str(t.data$.substr(t.pos$,i)),t.pos$=void 0===e?n:t.pos$+Sk.ffi.remapToJs(e),t.pos$>=n&&(t.pos$=n),i})),Sk.builtin.file.$readline=function(t,e,n){if(0===t.fileno){if(t=Sk.ffi.remapToJs(n),(t=Sk.inputfun(t||""))instanceof Promise||t&&"function"==typeof t.then){var i=new Sk.misceval.Suspension;return i.resume=function(){if(i.data.error)throw i.data.error;return new Sk.builtin.str(i.data.result)},i.data={type:"Sk.promise",promise:t},i}return new Sk.builtin.str(t)}return e="",t.currentLinen(t,e))));if("object"===i){if((i=t.constructor)===Object&&Object.getPrototypeOf(t)===c||void 0===i)return e.dictHook?e.dictHook(t):l(t,e);if(i===Uint8Array)return new Sk.builtin.bytes(t);if(i===Set)return a(t,e);if(i===Map){const i=new Sk.builtin.dict;return t.forEach(((t,s)=>{i.mp$ass_subscript(n(s,e),n(t,e))})),i}return i===Sk.misceval.Suspension?t:e.proxyHook?e.proxyHook(t):u(t)}if(e.unhandledHook)return e.unhandledHook(t);Sk.asserts.fail("unhandled remap case of type "+i)}function i(t,e){if(null==t)return t;const n=t.valueOf();if(null===n)return n;const o=typeof n;return e=e||{},"string"===o?e.stringHook?e.stringHook(n):n:"boolean"===o?n:"number"===o?e.numberHook?e.numberHook(n,t):n:JSBI.__isBigInt(n)?e.bigintHook?e.bigintHook(n,t):n:Array.isArray(n)?e.arrayHook?e.arrayHook(n,t):n.map((t=>i(t,e))):n.sk$object?t instanceof Sk.builtin.dict?e.dictHook?e.dictHook(t):r(t,e):t instanceof Sk.builtin.set?e.setHook?e.setHook(t):new Set(s(t,e)):e.unhandledHook?e.unhandledHook(t):void 0:"object"===o?e.objectHook?e.objectHook(n,t):n:"function"===o?e.funcHook?e.funcHook(n,t):n:void Sk.asserts.fail("unhandled type "+o)}function s(t,e){return Array.from(t,(t=>i(t,e)))}function r(t,e){const n={};return t.$items().forEach((t=>{var[s,r]=t;n[s.valueOf()]=i(r,e)})),n}function o(t){return Number.isInteger(t)?Math.abs(t)n(t,e))))}function l(t,e){const i=new Sk.builtin.dict;return Object.entries(t).forEach((t=>{var[s,r]=t;i.mp$ass_subscript(new Sk.builtin.str(s),n(r,e))})),i}function u(t,e){if(null==t)return Sk.builtin.none.none$;var i=typeof t;if("object"!==i&&"function"!==i)return n(t);if(e=e||{},i=_.get(t)){if(e.bound===i.$bound)return i;e.name||(e.name=i.$name)}return e=new g(t,e),_.set(t,e),e}Sk.ffi={remapToPy:n,remapToJs:i,toPy:n,toJs:i,isTrue:function(t){return null!=t&&t.nb$bool?t.nb$bool():t.sq$length?0!==t.sq$length():!!t},toJsString:function(t){return String(t)},toJsNumber:function(t){return Number(t)},toJsArray:s,toJsHashMap:r,toPyDict:l,toPyFloat:function(t){return new Sk.builtin.float_(Number(t))},toPyInt:function(t){if("number"==typeof t)return t=Math.trunc(t),Math.abs(t)n(t,e))))},toPyTuple:function(t,e){return new Sk.builtin.tuple(Array.from(t,(t=>n(t,e))))},toPySet:a,numberToPy:o,proxy:u};const c=Object.prototype,p=Function.prototype,h=/^-?\d+$/,_=new WeakMap,d={dictHook:t=>u(t),unhandledHook:t=>String(t)},f=(t,e)=>({dictHook:t=>u(t),funcHook:n=>u(n,{bound:t,name:e}),unhandledHook:t=>String(t)}),m={unhandledHook:t=>{var e=_.get(t);if(e)return e;if(e={v:t,$isPyWrapped:!0,unwrap:()=>t},void 0===t.tp$call)return _.set(t,e),e;const s=(...e)=>{e=e.map((t=>n(t,d)));let s=Sk.misceval.tryCatch((()=>Sk.misceval.chain(t.tp$call(e),(t=>i(t,m)))),(t=>{if(!Sk.uncaughtException)throw t;Sk.uncaughtException(t)}));for(;s instanceof Sk.misceval.Suspension;){if(!s.optional)return Sk.misceval.asyncToPromise((()=>s));s=s.resume()}return s};return _.set(t,Object.assign(s,e)),s}},g=Sk.abstr.buildNativeClass("Proxy",{constructor:function(t,e){if(void 0===t)throw new Sk.builtin.TypeError("Proxy cannot be called from python");this.js$wrapped=t,this.$module=null,this.$methods=Object.create(null),this.in$repr=!1,e||(e={}),Object.defineProperties(this,this.memoized$slots),"function"==typeof t?(this.is$callable=!0,this.$bound=e.bound,this.$name=e.name||t.name||"(native JS)",2>=this.$name.length&&(this.$name+=" (native JS)")):(this.is$callable=!1,delete this.is$type,this.is$type=!1,this.$name=e.name)},slots:{tp$doc:"proxy for a javascript object",tp$hash(){return Sk.builtin.object.prototype.tp$hash.call(this.js$wrapped)},tp$getattr(t){return this.$lookup(t)||Sk.generic.getAttr.call(this,t)},tp$setattr(t,e){t=t.toString(),void 0===e?delete this.js$wrapped[t]:this.js$wrapped[t]=i(e,m)},$r(){if(this.is$callable){if(this.is$type||!this.$bound)return new Sk.builtin.str("<"+this.tp$name+" '"+this.$name+"'>");var t=Sk.misceval.objectRepr(u(this.$bound));return new Sk.builtin.str("")}return this.js$proto===c?this.in$repr?new Sk.builtin.str("{...}"):(this.in$repr=!0,t=Object.entries(this.js$wrapped).map((t=>{var[e,i]=t;return i=n(i,f(this.js$wrapped,e)),"'"+e+"': "+Sk.misceval.objectRepr(i)})),t=new Sk.builtin.str("proxyobject({"+t.join(", ")+"})"),this.in$repr=!1,t):new Sk.builtin.str("<"+this.tp$name+" "+("proxyobject"===this.tp$name?"object":"proxyobject")+">")},tp$as_sequence_or_mapping:!0,mp$subscript(t){const e=this.$lookup(t);if(void 0===e)throw new Sk.builtin.LookupError(t);return e},mp$ass_subscript(t,e){return this.tp$setattr(t,e)},sq$contains(t){return i(t)in this.js$wrapped},ob$eq(t){return this.js$wrapped===t.js$wrapped},ob$ne(t){return this.js$wrapped!==t.js$wrapped},tp$as_number:!0,nb$bool(){return this.js$proto===c?0new Sk.builtin.str(t)))))},$flags:{NoArgs:!0}},__new__:{$meth(t,...e){if(!(t instanceof g))throw new Sk.builtin.TypeError("expected a proxy object as the first argument not "+Sk.abstr.typeName(t));try{return t.$new(e)}catch(e){if(e instanceof TypeError&&e.message.includes("not a constructor"))throw new Sk.builtin.TypeError(Sk.misceval.objectRepr(t)+" is not a constructor");throw e}},$flags:{MinArgs:1}},__call__:{$meth(t,e){if("function"!=typeof this.js$wrapped)throw new Sk.builtin.TypeError("'"+this.tp$name+"' object is not callable");return this.$call(t,e)},$flags:{FastCall:!0}},keys:{$meth(){return new Sk.builtin.list(Object.keys(this.js$wrapped).map((t=>new Sk.builtin.str(t))))},$flags:{NoArgs:!0}},get:{$meth(t,e){return this.$lookup(t)||e||Sk.builtin.none.none$},$flags:{MinArgs:1,MaxArgs:2}}},getsets:{__class__:{$get(){return n(this.js$wrapped.constructor,d)},$set(){throw new Sk.builtin.TypeError("not writable")}},__name__:{$get(){return new Sk.builtin.str(this.$name)}},__module__:{$get(){return this.$module||Sk.builtin.none.none$},$set(t){this.$module=t}}},proto:{valueOf(){return this.js$wrapped},$new(t,e){return Sk.abstr.checkNoKwargs("__new__",e),n(new this.js$wrapped(...t.map((t=>i(t,m)))),{dictHook:t=>u(t),proxyHook:t=>u(t,{name:this.$name})})},$call(t,e){return Sk.abstr.checkNoKwargs("__call__",e),Sk.misceval.chain(this.js$wrapped.apply(this.$bound,t.map((t=>i(t,m)))),(t=>t instanceof Promise?Sk.misceval.promiseToSuspension(t):t),(t=>n(t,d)))},$lookup(t){t=t.toString();const e=this.js$wrapped[t];return void 0!==e?n(e,f(this.js$wrapped,t)):t in this.js$wrapped?Sk.builtin.none.none$:void 0},memoized$slots:{js$proto:{configurable:!0,get(){return delete this.js$proto,this.js$proto=Object.getPrototypeOf(this.js$wrapped)}},$dir:{configurable:!0,get(){const t=[];let e=this.js$wrapped;for(;null!=e&&e!==c&&e!==p;)t.push(...Object.getOwnPropertyNames(e)),e=Object.getPrototypeOf(e);return new Set(t)}},tp$iter:{configurable:!0,get(){return delete this.tp$iter,void 0!==this.js$wrapped[Symbol.iterator]?this.tp$iter=()=>u(this.js$wrapped[Symbol.iterator]()):this.tp$iter=()=>{throw new Sk.builtin.TypeError(Sk.misceval.objectRepr(this)+" is not iterable")}}},tp$iternext:{configurable:!0,get(){if(delete this.tp$iternext,void 0!==this.js$wrapped.next)return this.tp$iternext=()=>{const t=this.js$wrapped.next().value;return t&&n(t,d)}}},sq$length:{configurable:!0,get(){if(delete this.sq$length,!this.is$callable&&void 0!==this.js$wrapped.length)return this.sq$length=()=>this.js$wrapped.length}},tp$call:{configurable:!0,get(){if(delete this.tp$call,this.is$callable)return this.tp$call=this.is$type?this.$new:this.$call}},tp$name:{configurable:!0,get(){if(delete this.tp$name,this.is$callable)return this.tp$name=this.is$type?"proxyclass":this.$bound?"proxymethod":"proxyfunction";{const t=this.js$wrapped;let e=t[Symbol.toStringTag]||this.$name||t.constructor&&t.constructor.name||"proxyobject";return"Object"===e?e="proxyobject":2>=e.length&&(e=u(t.constructor).$name),this.tp$name=e}}},is$type:{configurable:!0,get(){delete this.is$type;var t=this.js$wrapped;const e=t.prototype;if(void 0===e)return this.is$type=t===Sk.global.Proxy;{const e=S.call(t).match(b);t=null===e?null:"class"===e[0]||!k.has(t)}return!0===t?this.is$type=!0:!1===t?this.is$type=!1:1e;r+=n)s.push(new Sk.builtin.int_(r));else{if(t=r=JSBI.BigInt(t),n=JSBI.BigInt(n),e=JSBI.BigInt(e),JSBI.greaterThan(n,JSBI.__ZERO))for(;JSBI.lessThan(r,e);)s.push(new Sk.builtin.int_(i(r))),r=JSBI.add(r,n);else for(;JSBI.greaterThan(r,e);)s.push(new Sk.builtin.int_(i(r))),r=JSBI.add(r,n);t=i(t),n=i(n),e=i(e)}return new Sk.builtin.range_(t,e,n,s)}function i(t){return JSBI.lessThan(t,JSBI.__MAX_SAFE)&&JSBI.greaterThan(t,JSBI.__MIN_SAFE)?JSBI.toNumber(t):t}Sk.builtin.range_=Sk.abstr.buildNativeClass("range",{constructor:function(t,e,n,i){this.start=t,this.stop=e,this.step=n,this.v=i},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$doc:"range(stop) -> range object\nrange(start, stop[, step]) -> range object\n\nReturn an object that produces a sequence of integers from start (inclusive)\nto stop (exclusive) by step. range(i, j) produces i, i+1, i+2, ..., j-1.\nstart defaults to 0, and stop is omitted! range(4) produces 0, 1, 2, 3.\nThese are exactly the valid indices for a list of 4 elements.\nWhen step is given, it specifies the increment (or decrement).",tp$new:(t,e)=>(Sk.abstr.checkNoKwargs("range",e),Sk.abstr.checkArgsLen("range",t,1,3),n(t[0],t[1],t[2])),$r(){let t="range("+this.start+", "+this.stop;return 1!=this.step&&(t+=", "+this.step),new Sk.builtin.str(t+")")},tp$richcompare(t,e){return"Eq"!==e&&"NotEq"!==e||t.ob$type!==Sk.builtin.range_?Sk.builtin.NotImplemented.NotImplemented$:(t=new Sk.builtin.list(t.v),new Sk.builtin.list(this.v).tp$richcompare(t,e))},tp$iter(){return new s(this)},nb$bool(){return 0!==this.v.length},sq$contains(t){const e=this.v;for(let n=0;n(t=Sk.misceval.asIndexSized(t))&&(t=this.v.length+t),0>t||t>=this.v.length)throw new Sk.builtin.IndexError("range object index out of range");return this.v[t]}if(t.constructor===Sk.builtin.slice){const e=[],n=this.v;t.sssiter$(n.length,(t=>{e.push(n[t])}));let{start:i,stop:s,step:r}=t.slice$indices(n.length);return i=Sk.misceval.asIndex(n[i])||this.start,s=Sk.misceval.asIndex(n[s])||this.stop,r="number"==typeof this.step?r*this.step:JSBI.multiply(this.step,JSBI.BigInt(r)),new Sk.builtin.range_(i,s,r,e)}throw new Sk.builtin.TypeError("range indices must be integers or slices, not "+Sk.abstr.typeName(t))}},getsets:{start:{$get(){return new Sk.builtin.int_(this.start)}},step:{$get(){return new Sk.builtin.int_(this.step)}},stop:{$get(){return new Sk.builtin.int_(this.stop)}}},methods:{__reversed__:{$meth(){return new r(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"Return a reverse iterator."},count:{$meth(t){let e=0;for(let n=0;n integer -- return number of occurrences of value"},index:{$meth(t){for(let e=0;e integer -- return index of value.\nRaise ValueError if the value is not present."}},proto:{sk$asarray(){return this.v.slice(0)}},flags:{sk$unacceptableBase:!0}});var s=Sk.abstr.buildIteratorClass("range_iterator",{constructor:function(t){this.$index=0,this.$seq=t.v},iternext(){return this.$seq[this.$index++]},methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$unacceptableBase:!0}}),r=Sk.abstr.buildIteratorClass("range_reverseiterator",{constructor:function(t){this.$seq=t.v,this.$index=this.$seq.length-1},iternext(){return this.$seq[this.$index--]},methods:{__length_hint__:Sk.generic.iterReverseLengthHintMethodDef},flags:{sk$unacceptableBase:!0}});Sk.builtin.range=Sk.builtin.xrange=function(t,e,i){return t=n(t,e,i),new Sk.builtin.list(t.v)}},function(t,e){Sk.builtin.enumerate=Sk.abstr.buildIteratorClass("enumerate",{constructor:function(t,e){if(!(this instanceof Sk.builtin.enumerate))throw TypeError("Failed to construct 'enumerate': Please use the 'new' operator");return this.$iterable=t,this.$index=e,this},iternext(t){const e=Sk.misceval.chain(this.$iterable.tp$iternext(t),(t=>{if(void 0!==t)return new Sk.builtin.tuple([new Sk.builtin.int_(this.$index++),t])}));return t?e:Sk.misceval.retryOptionalSuspensionOrThrow(e)},slots:{tp$doc:"Return an enumerate object.\n\n iterable\n an object supporting iteration\n\nThe enumerate object yields pairs containing a count (from start, which\ndefaults to zero) and a value yielded by the iterable argument.\n\nenumerate is useful for obtaining an indexed list:\n (0, seq[0]), (1, seq[1]), (2, seq[2]), ...",tp$new(t,e){let[n,i]=Sk.abstr.copyKeywordsToNamedArgs("enumerate",["iterable","start"],t,e,[new Sk.builtin.int_(0)]);return n=Sk.abstr.iter(n),i=Sk.misceval.asIndexOrThrow(i),this===Sk.builtin.enumerate.prototype?new Sk.builtin.enumerate(n,i):(t=new this.constructor,Sk.builtin.enumerate.call(t,n,i),t)}},classmethods:Sk.generic.classGetItem}),Sk.exportSymbol("Sk.builtin.enumerate",Sk.builtin.enumerate)},function(t,e){Sk.builtin.filter_=Sk.abstr.buildIteratorClass("filter",{constructor:function(t,e){this.$func=t,this.$iterable=e},iternext(t){const e=Sk.misceval.iterFor(this.$iterable,(t=>Sk.misceval.chain(this.check$filter(t),(t=>t?new Sk.misceval.Break(t):void 0))));return t?e:Sk.misceval.retryOptionalSuspensionOrThrow(e)},slots:{tp$doc:"Return an iterator yielding those items of iterable for which function(item)\nis true. If function is None, return the items that are true.",tp$new(t,e){let[n,i]=Sk.abstr.copyKeywordsToNamedArgs("filter",["predicate","iterable"],t,e,[]);return n=Sk.builtin.checkNone(n)?null:n,i=Sk.abstr.iter(i),this===Sk.builtin.filter_.prototype?new Sk.builtin.filter_(n,i):(t=new this.constructor,Sk.builtin.filter_.call(t,n,i),t)}},proto:{check$filter(t){let e;return e=null===this.$func?t:Sk.misceval.callsimOrSuspendArray(this.$func,[t]),Sk.misceval.chain(e,(e=>Sk.misceval.isTrue(e)?t:void 0))}}}),Sk.exportSymbol("Sk.builtin.filter_",Sk.builtin.filter_)},function(t,e){Sk.builtin.map_=Sk.abstr.buildIteratorClass("map",{constructor:function(t,e){this.$func=t,this.$iters=e},iternext(t){const e=[],n=Sk.misceval.chain(Sk.misceval.iterArray(this.$iters,(n=>Sk.misceval.chain(n.tp$iternext(t),(t=>{if(void 0===t)return new Sk.misceval.Break(!0);e.push(t)})))),(t=>t?void 0:Sk.misceval.callsimOrSuspendArray(this.$func,e)));return t?n:Sk.misceval.retryOptionalSuspensionOrThrow(n)},slots:{tp$doc:"map(func, *iterables) --\x3e map object\n\nMake an iterator that computes the function using arguments from\neach of the iterables. Stops when the shortest iterable is exhausted.",tp$new(t,e){this===Sk.builtin.map_.prototype&&Sk.abstr.checkNoKwargs("map",e),Sk.abstr.checkArgsLen("map",t,2),e=t[0];const n=[];for(let e=1;ethis.$idx)){var e=Sk.misceval.tryCatch((()=>Sk.abstr.objectGetItem(this.$seq,new Sk.builtin.int_(this.$idx--),t)),(t=>{if(!(t instanceof Sk.builtin.IndexError))throw t;this.$idx=-1}));return t?e:Sk.misceval.retryOptionalSuspensionOrThrow(e)}},slots:{tp$doc:"Return a reverse iterator over the values of the given sequence.",tp$new(t,e){if(this===Sk.builtin.reversed.prototype&&Sk.abstr.checkNoKwargs("reversed",e),Sk.abstr.checkArgsLen("reversed",t,1,1),t=t[0],void 0!==(e=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$reversed)))return Sk.misceval.callsimArray(e,[]);if(!Sk.builtin.checkSequence(t)||void 0===Sk.abstr.lookupSpecial(t,Sk.builtin.str.$len))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object is not a sequence");return this===Sk.builtin.reversed.prototype?new Sk.builtin.reversed(t):(e=new this.constructor,Sk.builtin.reversed.call(e,t),e)}},methods:{__length_hint__:{$meth:function(){return 0<=this.$idx?new Sk.builtin.int_(this.$idx):new Sk.builtin.int_(0)},$flags:{NoArgs:!0}}}})},function(t,e){Sk.builtin.zip_=Sk.abstr.buildIteratorClass("zip",{constructor:function(t){this.$iters=t,0===t.length&&(this.tp$iternext=()=>{})},iternext(t){const e=[],n=Sk.misceval.chain(Sk.misceval.iterArray(this.$iters,(n=>Sk.misceval.chain(n.tp$iternext(t),(t=>{if(void 0===t)return new Sk.misceval.Break(!0);e.push(t)})))),(t=>t?void 0:new Sk.builtin.tuple(e)));return t?n:Sk.misceval.retryOptionalSuspensionOrThrow(n)},slots:{tp$doc:"zip(iter1 [,iter2 [...]]) --\x3e zip object\n\nReturn a zip object whose .__next__() method returns a tuple where\nthe i-th element comes from the i-th iterable argument. The .__next__()\nmethod continues until the shortest iterable in the argument sequence\nis exhausted and then it raises StopIteration.",tp$new(t,e){this===Sk.builtin.zip_.prototype&&Sk.abstr.checkNoKwargs("zip",e),e=[];for(let n=0;n":n.T_RARROW,".":n.T_DOT,"...":n.T_ELLIPSIS,"/":n.T_SLASH,"//":n.T_DOUBLESLASH,"//=":n.T_DOUBLESLASHEQUAL,"/=":n.T_SLASHEQUAL,":":n.T_COLON,";":n.T_SEMI,"<":n.T_LESS,"<<":n.T_LEFTSHIFT,"<<=":n.T_LEFTSHIFTEQUAL,"<=":n.T_LESSEQUAL,"=":n.T_EQUAL,"==":n.T_EQEQUAL,">":n.T_GREATER,">=":n.T_GREATEREQUAL,">>":n.T_RIGHTSHIFT,">>=":n.T_RIGHTSHIFTEQUAL,"@":n.T_AT,"@=":n.T_ATEQUAL,"[":n.T_LSQB,"]":n.T_RSQB,"^":n.T_CIRCUMFLEX,"^=":n.T_CIRCUMFLEXEQUAL,"{":n.T_LBRACE,"|":n.T_VBAR,"|=":n.T_VBAREQUAL,"}":n.T_RBRACE,"~":n.T_TILDE};var i={};!function(){for(var t in n)i[n[t]]=t}(),["tok_name","ISTERMINAL","ISNONTERMINAL","ISEOF"].concat(Object.keys(i).map((function(t){return i[t]}))),Sk.token={},Sk.token.tokens=n,Sk.token.tok_name=i,Sk.token.EXACT_TOKEN_TYPES=t,Sk.token.ISTERMINAL=function(t){return t=n.T_NT_OFFSET},Sk.token.ISEOF=function(t){return t==n.T_ENDMARKER},Sk.exportSymbol("Sk.token",Sk.token),Sk.exportSymbol("Sk.token.tokens",Sk.token.tokens),Sk.exportSymbol("Sk.token.tok_name",Sk.token.tok_name),Sk.exportSymbol("Sk.token.EXACT_TOKEN_TYPES"),Sk.exportSymbol("Sk.token.ISTERMINAL",Sk.token.ISTERMINAL),Sk.exportSymbol("Sk.token.ISNONTERMINAL",Sk.token.ISNONTERMINAL),Sk.exportSymbol("Sk.token.ISEOF",Sk.token.ISEOF)},function(t,e){Sk.OpMap={"(":Sk.token.tokens.T_LPAR,")":Sk.token.tokens.T_RPAR,"[":Sk.token.tokens.T_LSQB,"]":Sk.token.tokens.T_RSQB,":":Sk.token.tokens.T_COLON,",":Sk.token.tokens.T_COMMA,";":Sk.token.tokens.T_SEMI,"+":Sk.token.tokens.T_PLUS,"-":Sk.token.tokens.T_MINUS,"*":Sk.token.tokens.T_STAR,"/":Sk.token.tokens.T_SLASH,"|":Sk.token.tokens.T_VBAR,"&":Sk.token.tokens.T_AMPER,"<":Sk.token.tokens.T_LESS,">":Sk.token.tokens.T_GREATER,"=":Sk.token.tokens.T_EQUAL,".":Sk.token.tokens.T_DOT,"%":Sk.token.tokens.T_PERCENT,"`":Sk.token.tokens.T_BACKQUOTE,"{":Sk.token.tokens.T_LBRACE,"}":Sk.token.tokens.T_RBRACE,"@":Sk.token.tokens.T_AT,"@=":Sk.token.tokens.T_ATEQUAL,"==":Sk.token.tokens.T_EQEQUAL,"!=":Sk.token.tokens.T_NOTEQUAL,"<>":Sk.token.tokens.T_NOTEQUAL,"<=":Sk.token.tokens.T_LESSEQUAL,">=":Sk.token.tokens.T_GREATEREQUAL,"~":Sk.token.tokens.T_TILDE,"^":Sk.token.tokens.T_CIRCUMFLEX,"<<":Sk.token.tokens.T_LEFTSHIFT,">>":Sk.token.tokens.T_RIGHTSHIFT,"**":Sk.token.tokens.T_DOUBLESTAR,"+=":Sk.token.tokens.T_PLUSEQUAL,"-=":Sk.token.tokens.T_MINEQUAL,"*=":Sk.token.tokens.T_STAREQUAL,"/=":Sk.token.tokens.T_SLASHEQUAL,"%=":Sk.token.tokens.T_PERCENTEQUAL,"&=":Sk.token.tokens.T_AMPEREQUAL,"|=":Sk.token.tokens.T_VBAREQUAL,"^=":Sk.token.tokens.T_CIRCUMFLEXEQUAL,"<<=":Sk.token.tokens.T_LEFTSHIFTEQUAL,">>=":Sk.token.tokens.T_RIGHTSHIFTEQUAL,"**=":Sk.token.tokens.T_DOUBLESTAREQUAL,"//":Sk.token.tokens.T_DOUBLESLASH,"//=":Sk.token.tokens.T_DOUBLESLASHEQUAL,"->":Sk.token.tokens.T_RARROW,"...":Sk.token.tokens.T_ELLIPSIS},Sk.ParseTables={sym:{and_expr:257,and_test:258,annassign:259,arglist:260,argument:261,arith_expr:262,assert_stmt:263,async_funcdef:264,async_stmt:265,atom:266,atom_expr:267,augassign:268,break_stmt:269,classdef:270,comp_for:271,comp_if:272,comp_iter:273,comp_op:274,comparison:275,compound_stmt:276,continue_stmt:277,debugger_stmt:278,decorated:279,decorator:280,decorators:281,del_stmt:282,dictorsetmaker:283,dotted_as_name:284,dotted_as_names:285,dotted_name:286,encoding_decl:287,eval_input:288,except_clause:289,expr:290,expr_stmt:291,exprlist:292,factor:293,file_input:294,flow_stmt:295,for_stmt:296,funcdef:297,global_stmt:298,if_stmt:299,import_as_name:300,import_as_names:301,import_from:302,import_name:303,import_stmt:304,lambdef:305,lambdef_nocond:306,nonlocal_stmt:307,not_test:308,or_test:309,parameters:310,pass_stmt:311,power:312,print_stmt:313,raise_stmt:314,return_stmt:315,shift_expr:316,simple_stmt:317,single_input:256,sliceop:318,small_stmt:319,star_expr:320,stmt:321,subscript:322,subscriptlist:323,suite:324,term:325,test:326,test_nocond:327,testlist:328,testlist_comp:329,testlist_star_expr:330,tfpdef:331,trailer:332,try_stmt:333,typedargslist:334,varargslist:335,vfpdef:336,while_stmt:337,with_item:338,with_stmt:339,xor_expr:340,yield_arg:341,yield_expr:342,yield_stmt:343},number2symbol:{256:"single_input",257:"and_expr",258:"and_test",259:"annassign",260:"arglist",261:"argument",262:"arith_expr",263:"assert_stmt",264:"async_funcdef",265:"async_stmt",266:"atom",267:"atom_expr",268:"augassign",269:"break_stmt",270:"classdef",271:"comp_for",272:"comp_if",273:"comp_iter",274:"comp_op",275:"comparison",276:"compound_stmt",277:"continue_stmt",278:"debugger_stmt",279:"decorated",280:"decorator",281:"decorators",282:"del_stmt",283:"dictorsetmaker",284:"dotted_as_name",285:"dotted_as_names",286:"dotted_name",287:"encoding_decl",288:"eval_input",289:"except_clause",290:"expr",291:"expr_stmt",292:"exprlist",293:"factor",294:"file_input",295:"flow_stmt",296:"for_stmt",297:"funcdef",298:"global_stmt",299:"if_stmt",300:"import_as_name",301:"import_as_names",302:"import_from",303:"import_name",304:"import_stmt",305:"lambdef",306:"lambdef_nocond",307:"nonlocal_stmt",308:"not_test",309:"or_test",310:"parameters",311:"pass_stmt",312:"power",313:"print_stmt",314:"raise_stmt",315:"return_stmt",316:"shift_expr",317:"simple_stmt",318:"sliceop",319:"small_stmt",320:"star_expr",321:"stmt",322:"subscript",323:"subscriptlist",324:"suite",325:"term",326:"test",327:"test_nocond",328:"testlist",329:"testlist_comp",330:"testlist_star_expr",331:"tfpdef",332:"trailer",333:"try_stmt",334:"typedargslist",335:"varargslist",336:"vfpdef",337:"while_stmt",338:"with_item",339:"with_stmt",340:"xor_expr",341:"yield_arg",342:"yield_expr",343:"yield_stmt"},dfas:{256:[[[[1,1],[2,1],[3,2]],[[0,1]],[[2,1]]],{2:1,4:1,5:1,6:1,7:1,8:1,9:1,10:1,11:1,12:1,13:1,14:1,15:1,16:1,17:1,18:1,19:1,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,34:1,35:1,36:1,37:1,38:1,39:1,40:1,41:1,42:1,43:1}],257:[[[[44,1]],[[45,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],258:[[[[46,1]],[[47,0],[0,1]]],{6:1,7:1,8:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],259:[[[[48,1]],[[49,2]],[[50,3],[0,2]],[[49,4]],[[0,4]]],{48:1}],260:[[[[51,1]],[[52,2],[0,1]],[[51,1],[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,53:1}],261:[[[[49,1],[15,2],[53,2]],[[50,2],[54,3],[0,1]],[[49,3]],[[0,3]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,53:1}],262:[[[[55,1]],[[30,0],[43,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],263:[[[[24,1]],[[49,2]],[[52,3],[0,2]],[[49,4]],[[0,4]]],{24:1}],264:[[[[10,1]],[[56,2]],[[0,2]]],{10:1}],265:[[[[10,1]],[[57,2],[56,2],[58,2]],[[0,2]]],{10:1}],266:[[[[6,1],[25,1],[33,1],[9,1],[11,1],[12,2],[35,3],[38,4],[19,1],[7,5]],[[0,1]],[[59,1],[60,6]],[[61,1],[62,7],[63,7]],[[64,1],[63,8]],[[7,5],[0,5]],[[59,1]],[[61,1]],[[64,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,25:1,33:1,35:1,38:1}],267:[[[[29,1],[65,2]],[[65,2]],[[66,2],[0,2]]],{6:1,7:1,9:1,11:1,12:1,19:1,25:1,29:1,33:1,35:1,38:1}],268:[[[[67,1],[68,1],[69,1],[70,1],[71,1],[72,1],[73,1],[74,1],[75,1],[76,1],[77,1],[78,1],[79,1]],[[0,1]]],{67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:1,75:1,76:1,77:1,78:1,79:1}],269:[[[[39,1]],[[0,1]]],{39:1}],270:[[[[13,1]],[[25,2]],[[48,3],[35,4]],[[80,5]],[[61,6],[81,7]],[[0,5]],[[48,3]],[[61,6]]],{13:1}],271:[[[[10,1],[34,2]],[[34,2]],[[82,3]],[[83,4]],[[84,5]],[[85,6],[0,5]],[[0,6]]],{10:1,34:1}],272:[[[[37,1]],[[86,2]],[[85,3],[0,2]],[[0,3]]],{37:1}],273:[[[[87,1],[54,1]],[[0,1]]],{10:1,34:1,37:1}],274:[[[[88,1],[89,1],[8,2],[90,1],[88,1],[83,1],[91,1],[92,3],[93,1],[94,1]],[[0,1]],[[83,1]],[[8,1],[0,3]]],{8:1,83:1,88:1,89:1,90:1,91:1,92:1,93:1,94:1}],275:[[[[95,1]],[[96,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],276:[[[[97,1],[98,1],[58,1],[99,1],[57,1],[100,1],[56,1],[101,1],[102,1]],[[0,1]]],{4:1,10:1,13:1,20:1,21:1,34:1,37:1,41:1,42:1}],277:[[[[40,1]],[[0,1]]],{40:1}],278:[[[[17,1]],[[0,1]]],{17:1}],279:[[[[103,1]],[[56,2],[104,2],[99,2]],[[0,2]]],{41:1}],280:[[[[41,1]],[[105,2]],[[2,4],[35,3]],[[61,5],[81,6]],[[0,4]],[[2,4]],[[61,5]]],{41:1}],281:[[[[106,1]],[[106,1],[0,1]]],{41:1}],282:[[[[27,1]],[[82,2]],[[0,2]]],{27:1}],283:[[[[49,1],[107,2],[53,3]],[[48,4],[54,5],[52,6],[0,1]],[[54,5],[52,6],[0,2]],[[95,7]],[[49,7]],[[0,5]],[[49,8],[107,8],[0,6]],[[54,5],[52,9],[0,7]],[[52,6],[0,8]],[[49,10],[53,11],[0,9]],[[48,12]],[[95,13]],[[49,13]],[[52,9],[0,13]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,53:1}],284:[[[[105,1]],[[108,2],[0,1]],[[25,3]],[[0,3]]],{25:1}],285:[[[[109,1]],[[52,0],[0,1]]],{25:1}],286:[[[[25,1]],[[110,0],[0,1]]],{25:1}],287:[[[[25,1]],[[0,1]]],{25:1}],288:[[[[111,1]],[[2,1],[112,2]],[[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],289:[[[[113,1]],[[49,2],[0,1]],[[108,3],[52,3],[0,2]],[[49,4]],[[0,4]]],{113:1}],290:[[[[114,1]],[[115,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],291:[[[[116,1]],[[117,2],[50,3],[118,4],[0,1]],[[111,4],[62,4]],[[116,5],[62,5]],[[0,4]],[[50,3],[0,5]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],292:[[[[95,1],[107,1]],[[52,2],[0,1]],[[95,1],[107,1],[0,2]]],{6:1,7:1,9:1,11:1,12:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],293:[[[[119,2],[30,1],[22,1],[43,1]],[[120,2]],[[0,2]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],294:[[[[2,0],[112,1],[121,0]],[[0,1]]],{2:1,4:1,5:1,6:1,7:1,8:1,9:1,10:1,11:1,12:1,13:1,14:1,15:1,16:1,17:1,18:1,19:1,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,34:1,35:1,36:1,37:1,38:1,39:1,40:1,41:1,42:1,43:1,112:1}],295:[[[[122,1],[123,1],[124,1],[125,1],[126,1]],[[0,1]]],{5:1,23:1,31:1,39:1,40:1}],296:[[[[34,1]],[[82,2]],[[83,3]],[[111,4]],[[48,5]],[[80,6]],[[127,7],[0,6]],[[48,8]],[[80,9]],[[0,9]]],{34:1}],297:[[[[4,1]],[[25,2]],[[128,3]],[[48,4],[129,5]],[[80,6]],[[49,7]],[[0,6]],[[48,4]]],{4:1}],298:[[[[26,1]],[[25,2]],[[52,1],[0,2]]],{26:1}],299:[[[[37,1]],[[49,2]],[[48,3]],[[80,4]],[[127,5],[130,1],[0,4]],[[48,6]],[[80,7]],[[0,7]]],{37:1}],300:[[[[25,1]],[[108,2],[0,1]],[[25,3]],[[0,3]]],{25:1}],301:[[[[131,1]],[[52,2],[0,1]],[[131,1],[0,2]]],{25:1}],302:[[[[36,1]],[[105,2],[19,3],[110,3]],[[32,4]],[[105,2],[19,3],[32,4],[110,3]],[[132,5],[15,5],[35,6]],[[0,5]],[[132,7]],[[61,5]]],{36:1}],303:[[[[32,1]],[[133,2]],[[0,2]]],{32:1}],304:[[[[134,1],[135,1]],[[0,1]]],{32:1,36:1}],305:[[[[14,1]],[[48,2],[136,3]],[[49,4]],[[48,2]],[[0,4]]],{14:1}],306:[[[[14,1]],[[48,2],[136,3]],[[86,4]],[[48,2]],[[0,4]]],{14:1}],307:[[[[18,1]],[[25,2]],[[52,1],[0,2]]],{18:1}],308:[[[[8,1],[137,2]],[[46,2]],[[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],309:[[[[138,1]],[[139,0],[0,1]]],{6:1,7:1,8:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],310:[[[[35,1]],[[61,2],[140,3]],[[0,2]],[[61,2]]],{35:1}],311:[[[[28,1]],[[0,1]]],{28:1}],312:[[[[141,1]],[[53,2],[0,1]],[[120,3]],[[0,3]]],{6:1,7:1,9:1,11:1,12:1,19:1,25:1,29:1,33:1,35:1,38:1}],313:[[[[16,1]],[[49,2],[142,3],[0,1]],[[52,4],[0,2]],[[49,5]],[[49,2],[0,4]],[[52,6],[0,5]],[[49,7]],[[52,8],[0,7]],[[49,7],[0,8]]],{16:1}],314:[[[[5,1]],[[49,2],[0,1]],[[36,3],[52,3],[0,2]],[[49,4]],[[52,5],[0,4]],[[49,6]],[[0,6]]],{5:1}],315:[[[[23,1]],[[111,2],[0,1]],[[0,2]]],{23:1}],316:[[[[143,1]],[[144,0],[142,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],317:[[[[145,1]],[[2,2],[146,3]],[[0,2]],[[145,1],[2,2]]],{5:1,6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,16:1,17:1,18:1,19:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,35:1,36:1,38:1,39:1,40:1,43:1}],318:[[[[48,1]],[[49,2],[0,1]],[[0,2]]],{48:1}],319:[[[[147,1],[148,1],[149,1],[150,1],[151,1],[152,1],[153,1],[154,1],[155,1],[156,1]],[[0,1]]],{5:1,6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,16:1,17:1,18:1,19:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,35:1,36:1,38:1,39:1,40:1,43:1}],320:[[[[15,1]],[[95,2]],[[0,2]]],{15:1}],321:[[[[1,1],[3,1]],[[0,1]]],{4:1,5:1,6:1,7:1,8:1,9:1,10:1,11:1,12:1,13:1,14:1,15:1,16:1,17:1,18:1,19:1,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,34:1,35:1,36:1,37:1,38:1,39:1,40:1,41:1,42:1,43:1}],322:[[[[49,1],[48,2]],[[48,2],[0,1]],[[49,3],[157,4],[0,2]],[[157,4],[0,3]],[[0,4]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,48:1}],323:[[[[158,1]],[[52,2],[0,1]],[[158,1],[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,48:1}],324:[[[[1,1],[2,2]],[[0,1]],[[159,3]],[[121,4]],[[160,1],[121,4]]],{2:1,5:1,6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,16:1,17:1,18:1,19:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,35:1,36:1,38:1,39:1,40:1,43:1}],325:[[[[120,1]],[[161,0],[15,0],[162,0],[41,0],[163,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],326:[[[[84,1],[164,2]],[[37,3],[0,1]],[[0,2]],[[84,4]],[[127,5]],[[49,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],327:[[[[165,1],[84,1]],[[0,1]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],328:[[[[49,1]],[[52,2],[0,1]],[[49,1],[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],329:[[[[49,1],[107,1]],[[54,2],[52,3],[0,1]],[[0,2]],[[49,4],[107,4],[0,3]],[[52,3],[0,4]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],330:[[[[49,1],[107,1]],[[52,2],[0,1]],[[49,1],[107,1],[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],331:[[[[25,1]],[[48,2],[0,1]],[[49,3]],[[0,3]]],{25:1}],332:[[[[35,1],[110,2],[38,3]],[[61,4],[81,5]],[[25,4]],[[166,6]],[[0,4]],[[61,4]],[[64,4]]],{35:1,38:1,110:1}],333:[[[[20,1]],[[48,2]],[[80,3]],[[167,4],[168,5]],[[48,6]],[[48,7]],[[80,8]],[[80,9]],[[167,4],[127,10],[168,5],[0,8]],[[0,9]],[[48,11]],[[80,12]],[[168,5],[0,12]]],{20:1}],334:[[[[15,1],[169,2],[53,3]],[[169,4],[52,5],[0,1]],[[50,6],[52,7],[0,2]],[[169,8]],[[52,5],[0,4]],[[169,9],[53,3],[0,5]],[[49,10]],[[15,11],[169,2],[53,3],[0,7]],[[52,12],[0,8]],[[50,13],[52,5],[0,9]],[[52,7],[0,10]],[[169,14],[52,15],[0,11]],[[0,12]],[[49,4]],[[52,15],[0,14]],[[169,16],[53,3],[0,15]],[[50,17],[52,15],[0,16]],[[49,14]]],{15:1,25:1,53:1}],335:[[[[15,1],[53,2],[170,3]],[[170,5],[52,4],[0,1]],[[170,6]],[[50,7],[52,8],[0,3]],[[53,2],[170,9],[0,4]],[[52,4],[0,5]],[[52,10],[0,6]],[[49,11]],[[15,12],[53,2],[170,3],[0,8]],[[50,13],[52,4],[0,9]],[[0,10]],[[52,8],[0,11]],[[52,15],[170,14],[0,12]],[[49,5]],[[52,15],[0,14]],[[53,2],[170,16],[0,15]],[[50,17],[52,15],[0,16]],[[49,14]]],{15:1,25:1,53:1}],336:[[[[25,1]],[[0,1]]],{25:1}],337:[[[[21,1]],[[49,2]],[[48,3]],[[80,4]],[[127,5],[0,4]],[[48,6]],[[80,7]],[[0,7]]],{21:1}],338:[[[[49,1]],[[108,2],[0,1]],[[95,3]],[[0,3]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],339:[[[[42,1]],[[171,2]],[[48,3],[52,1]],[[80,4]],[[0,4]]],{42:1}],340:[[[[172,1]],[[173,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],341:[[[[111,2],[36,1]],[[49,2]],[[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,36:1,38:1,43:1}],342:[[[[31,1]],[[174,2],[0,1]],[[0,2]]],{31:1}],343:[[[[62,1]],[[0,1]]],{31:1}]},states:[[[[1,1],[2,1],[3,2]],[[0,1]],[[2,1]]],[[[44,1]],[[45,0],[0,1]]],[[[46,1]],[[47,0],[0,1]]],[[[48,1]],[[49,2]],[[50,3],[0,2]],[[49,4]],[[0,4]]],[[[51,1]],[[52,2],[0,1]],[[51,1],[0,2]]],[[[49,1],[15,2],[53,2]],[[50,2],[54,3],[0,1]],[[49,3]],[[0,3]]],[[[55,1]],[[30,0],[43,0],[0,1]]],[[[24,1]],[[49,2]],[[52,3],[0,2]],[[49,4]],[[0,4]]],[[[10,1]],[[56,2]],[[0,2]]],[[[10,1]],[[57,2],[56,2],[58,2]],[[0,2]]],[[[6,1],[25,1],[33,1],[9,1],[11,1],[12,2],[35,3],[38,4],[19,1],[7,5]],[[0,1]],[[59,1],[60,6]],[[61,1],[62,7],[63,7]],[[64,1],[63,8]],[[7,5],[0,5]],[[59,1]],[[61,1]],[[64,1]]],[[[29,1],[65,2]],[[65,2]],[[66,2],[0,2]]],[[[67,1],[68,1],[69,1],[70,1],[71,1],[72,1],[73,1],[74,1],[75,1],[76,1],[77,1],[78,1],[79,1]],[[0,1]]],[[[39,1]],[[0,1]]],[[[13,1]],[[25,2]],[[48,3],[35,4]],[[80,5]],[[61,6],[81,7]],[[0,5]],[[48,3]],[[61,6]]],[[[10,1],[34,2]],[[34,2]],[[82,3]],[[83,4]],[[84,5]],[[85,6],[0,5]],[[0,6]]],[[[37,1]],[[86,2]],[[85,3],[0,2]],[[0,3]]],[[[87,1],[54,1]],[[0,1]]],[[[88,1],[89,1],[8,2],[90,1],[88,1],[83,1],[91,1],[92,3],[93,1],[94,1]],[[0,1]],[[83,1]],[[8,1],[0,3]]],[[[95,1]],[[96,0],[0,1]]],[[[97,1],[98,1],[58,1],[99,1],[57,1],[100,1],[56,1],[101,1],[102,1]],[[0,1]]],[[[40,1]],[[0,1]]],[[[17,1]],[[0,1]]],[[[103,1]],[[56,2],[104,2],[99,2]],[[0,2]]],[[[41,1]],[[105,2]],[[2,4],[35,3]],[[61,5],[81,6]],[[0,4]],[[2,4]],[[61,5]]],[[[106,1]],[[106,1],[0,1]]],[[[27,1]],[[82,2]],[[0,2]]],[[[49,1],[107,2],[53,3]],[[48,4],[54,5],[52,6],[0,1]],[[54,5],[52,6],[0,2]],[[95,7]],[[49,7]],[[0,5]],[[49,8],[107,8],[0,6]],[[54,5],[52,9],[0,7]],[[52,6],[0,8]],[[49,10],[53,11],[0,9]],[[48,12]],[[95,13]],[[49,13]],[[52,9],[0,13]]],[[[105,1]],[[108,2],[0,1]],[[25,3]],[[0,3]]],[[[109,1]],[[52,0],[0,1]]],[[[25,1]],[[110,0],[0,1]]],[[[25,1]],[[0,1]]],[[[111,1]],[[2,1],[112,2]],[[0,2]]],[[[113,1]],[[49,2],[0,1]],[[108,3],[52,3],[0,2]],[[49,4]],[[0,4]]],[[[114,1]],[[115,0],[0,1]]],[[[116,1]],[[117,2],[50,3],[118,4],[0,1]],[[111,4],[62,4]],[[116,5],[62,5]],[[0,4]],[[50,3],[0,5]]],[[[95,1],[107,1]],[[52,2],[0,1]],[[95,1],[107,1],[0,2]]],[[[119,2],[30,1],[22,1],[43,1]],[[120,2]],[[0,2]]],[[[2,0],[112,1],[121,0]],[[0,1]]],[[[122,1],[123,1],[124,1],[125,1],[126,1]],[[0,1]]],[[[34,1]],[[82,2]],[[83,3]],[[111,4]],[[48,5]],[[80,6]],[[127,7],[0,6]],[[48,8]],[[80,9]],[[0,9]]],[[[4,1]],[[25,2]],[[128,3]],[[48,4],[129,5]],[[80,6]],[[49,7]],[[0,6]],[[48,4]]],[[[26,1]],[[25,2]],[[52,1],[0,2]]],[[[37,1]],[[49,2]],[[48,3]],[[80,4]],[[127,5],[130,1],[0,4]],[[48,6]],[[80,7]],[[0,7]]],[[[25,1]],[[108,2],[0,1]],[[25,3]],[[0,3]]],[[[131,1]],[[52,2],[0,1]],[[131,1],[0,2]]],[[[36,1]],[[105,2],[19,3],[110,3]],[[32,4]],[[105,2],[19,3],[32,4],[110,3]],[[132,5],[15,5],[35,6]],[[0,5]],[[132,7]],[[61,5]]],[[[32,1]],[[133,2]],[[0,2]]],[[[134,1],[135,1]],[[0,1]]],[[[14,1]],[[48,2],[136,3]],[[49,4]],[[48,2]],[[0,4]]],[[[14,1]],[[48,2],[136,3]],[[86,4]],[[48,2]],[[0,4]]],[[[18,1]],[[25,2]],[[52,1],[0,2]]],[[[8,1],[137,2]],[[46,2]],[[0,2]]],[[[138,1]],[[139,0],[0,1]]],[[[35,1]],[[61,2],[140,3]],[[0,2]],[[61,2]]],[[[28,1]],[[0,1]]],[[[141,1]],[[53,2],[0,1]],[[120,3]],[[0,3]]],[[[16,1]],[[49,2],[142,3],[0,1]],[[52,4],[0,2]],[[49,5]],[[49,2],[0,4]],[[52,6],[0,5]],[[49,7]],[[52,8],[0,7]],[[49,7],[0,8]]],[[[5,1]],[[49,2],[0,1]],[[36,3],[52,3],[0,2]],[[49,4]],[[52,5],[0,4]],[[49,6]],[[0,6]]],[[[23,1]],[[111,2],[0,1]],[[0,2]]],[[[143,1]],[[144,0],[142,0],[0,1]]],[[[145,1]],[[2,2],[146,3]],[[0,2]],[[145,1],[2,2]]],[[[48,1]],[[49,2],[0,1]],[[0,2]]],[[[147,1],[148,1],[149,1],[150,1],[151,1],[152,1],[153,1],[154,1],[155,1],[156,1]],[[0,1]]],[[[15,1]],[[95,2]],[[0,2]]],[[[1,1],[3,1]],[[0,1]]],[[[49,1],[48,2]],[[48,2],[0,1]],[[49,3],[157,4],[0,2]],[[157,4],[0,3]],[[0,4]]],[[[158,1]],[[52,2],[0,1]],[[158,1],[0,2]]],[[[1,1],[2,2]],[[0,1]],[[159,3]],[[121,4]],[[160,1],[121,4]]],[[[120,1]],[[161,0],[15,0],[162,0],[41,0],[163,0],[0,1]]],[[[84,1],[164,2]],[[37,3],[0,1]],[[0,2]],[[84,4]],[[127,5]],[[49,2]]],[[[165,1],[84,1]],[[0,1]]],[[[49,1]],[[52,2],[0,1]],[[49,1],[0,2]]],[[[49,1],[107,1]],[[54,2],[52,3],[0,1]],[[0,2]],[[49,4],[107,4],[0,3]],[[52,3],[0,4]]],[[[49,1],[107,1]],[[52,2],[0,1]],[[49,1],[107,1],[0,2]]],[[[25,1]],[[48,2],[0,1]],[[49,3]],[[0,3]]],[[[35,1],[110,2],[38,3]],[[61,4],[81,5]],[[25,4]],[[166,6]],[[0,4]],[[61,4]],[[64,4]]],[[[20,1]],[[48,2]],[[80,3]],[[167,4],[168,5]],[[48,6]],[[48,7]],[[80,8]],[[80,9]],[[167,4],[127,10],[168,5],[0,8]],[[0,9]],[[48,11]],[[80,12]],[[168,5],[0,12]]],[[[15,1],[169,2],[53,3]],[[169,4],[52,5],[0,1]],[[50,6],[52,7],[0,2]],[[169,8]],[[52,5],[0,4]],[[169,9],[53,3],[0,5]],[[49,10]],[[15,11],[169,2],[53,3],[0,7]],[[52,12],[0,8]],[[50,13],[52,5],[0,9]],[[52,7],[0,10]],[[169,14],[52,15],[0,11]],[[0,12]],[[49,4]],[[52,15],[0,14]],[[169,16],[53,3],[0,15]],[[50,17],[52,15],[0,16]],[[49,14]]],[[[15,1],[53,2],[170,3]],[[170,5],[52,4],[0,1]],[[170,6]],[[50,7],[52,8],[0,3]],[[53,2],[170,9],[0,4]],[[52,4],[0,5]],[[52,10],[0,6]],[[49,11]],[[15,12],[53,2],[170,3],[0,8]],[[50,13],[52,4],[0,9]],[[0,10]],[[52,8],[0,11]],[[52,15],[170,14],[0,12]],[[49,5]],[[52,15],[0,14]],[[53,2],[170,16],[0,15]],[[50,17],[52,15],[0,16]],[[49,14]]],[[[25,1]],[[0,1]]],[[[21,1]],[[49,2]],[[48,3]],[[80,4]],[[127,5],[0,4]],[[48,6]],[[80,7]],[[0,7]]],[[[49,1]],[[108,2],[0,1]],[[95,3]],[[0,3]]],[[[42,1]],[[171,2]],[[48,3],[52,1]],[[80,4]],[[0,4]]],[[[172,1]],[[173,0],[0,1]]],[[[111,2],[36,1]],[[49,2]],[[0,2]]],[[[31,1]],[[174,2],[0,1]],[[0,2]]],[[[62,1]],[[0,1]]]],labels:[[0,"EMPTY"],[317,null],[4,null],[276,null],[1,"def"],[1,"raise"],[1,"True"],[3,null],[1,"not"],[1,"None"],[55,null],[2,null],[25,null],[1,"class"],[1,"lambda"],[16,null],[1,"print"],[1,"debugger"],[1,"nonlocal"],[52,null],[1,"try"],[1,"while"],[31,null],[1,"return"],[1,"assert"],[1,null],[1,"global"],[1,"del"],[1,"pass"],[54,null],[15,null],[1,"yield"],[1,"import"],[1,"False"],[1,"for"],[7,null],[1,"from"],[1,"if"],[9,null],[1,"break"],[1,"continue"],[49,null],[1,"with"],[14,null],[316,null],[19,null],[308,null],[1,"and"],[11,null],[326,null],[22,null],[261,null],[12,null],[35,null],[271,null],[325,null],[297,null],[339,null],[296,null],[26,null],[283,null],[8,null],[342,null],[329,null],[10,null],[266,null],[332,null],[45,null],[38,null],[40,null],[50,null],[46,null],[41,null],[42,null],[36,null],[43,null],[48,null],[44,null],[37,null],[39,null],[324,null],[260,null],[292,null],[1,"in"],[309,null],[273,null],[327,null],[272,null],[28,null],[21,null],[27,null],[29,null],[1,"is"],[30,null],[20,null],[290,null],[274,null],[333,null],[299,null],[270,null],[337,null],[279,null],[265,null],[281,null],[264,null],[286,null],[280,null],[320,null],[1,"as"],[284,null],[23,null],[328,null],[0,null],[1,"except"],[340,null],[18,null],[330,null],[268,null],[259,null],[312,null],[293,null],[321,null],[269,null],[277,null],[314,null],[315,null],[343,null],[1,"else"],[310,null],[51,null],[1,"elif"],[300,null],[301,null],[285,null],[303,null],[302,null],[335,null],[275,null],[258,null],[1,"or"],[334,null],[267,null],[34,null],[262,null],[33,null],[319,null],[13,null],[295,null],[263,null],[291,null],[311,null],[307,null],[313,null],[282,null],[298,null],[304,null],[278,null],[318,null],[322,null],[5,null],[6,null],[47,null],[17,null],[24,null],[305,null],[306,null],[323,null],[289,null],[1,"finally"],[331,null],[336,null],[338,null],[257,null],[32,null],[341,null]],keywords:{False:33,None:9,True:6,and:47,as:108,assert:24,break:39,class:13,continue:40,debugger:17,def:4,del:27,elif:130,else:127,except:113,finally:168,for:34,from:36,global:26,if:37,import:32,in:83,is:92,lambda:14,nonlocal:18,not:8,or:139,pass:28,print:16,raise:5,return:23,try:20,while:21,with:42,yield:31},tokens:{0:112,1:25,2:11,3:7,4:2,5:159,6:160,7:35,8:61,9:38,10:64,11:48,12:52,13:146,14:43,15:30,16:15,17:162,18:115,19:45,20:94,21:89,22:50,23:110,24:163,25:12,26:59,27:90,28:88,29:91,30:93,31:22,32:173,33:144,34:142,35:53,36:74,37:78,38:68,39:79,40:69,41:72,42:73,43:75,44:77,45:67,46:71,47:161,48:76,49:41,50:70,51:129,52:19,54:29,55:10},start:256}},function(t,e){function n(t,e){return this.filename=t,this.grammar=e,this.p_flags=0,this}n.FUTURE_PRINT_FUNCTION="print_function",n.FUTURE_UNICODE_LITERALS="unicode_literals",n.FUTURE_DIVISION="division",n.FUTURE_ABSOLUTE_IMPORT="absolute_import",n.FUTURE_WITH_STATEMENT="with_statement",n.FUTURE_NESTED_SCOPES="nested_scopes",n.FUTURE_GENERATORS="generators",n.CO_FUTURE_PRINT_FUNCTION=65536,n.CO_FUTURE_UNICODE_LITERALS=131072,n.CO_FUTURE_DIVISON=8192,n.CO_FUTURE_ABSOLUTE_IMPORT=16384,n.CO_FUTURE_WITH_STATEMENT=32768,n.prototype.setup=function(t){t=t||this.grammar.start,this.stack=[{dfa:this.grammar.dfas[t],state:0,node:{type:t,value:null,context:null,children:[]}}],this.used_names={}},n.prototype.addtoken=function(t,e,n){var i,s=this.classify(t,e,n);t:for(;;){var r=this.stack[this.stack.length-1],o=r.dfa[0],a=o[r.state];for(i=0;ic),this.shift(t,e,u,n),n=u;1===o[n].length&&0===o[n][0][0]&&o[n][0][1]===n;){if(this.pop(),0===this.stack.length)return!0;n=(r=this.stack[this.stack.length-1]).state,o=r.dfa[0]}return!1}if(256<=c&&(l=(l=this.grammar.dfas[c])[1]).hasOwnProperty(s)){this.push(c,this.grammar.dfas[c],u,n);continue t}}e:{for(o=[0,r.state],r=a.length;r--;)if(a[r][0]===o[0]&&a[r][1]===o[1]){a=!0;break e}a=!1}if(!a)throw t=n[0][0],new Sk.builtin.SyntaxError("bad input",this.filename,t,n);if(this.pop(),0===this.stack.length)throw new Sk.builtin.SyntaxError("too much input",this.filename)}},n.prototype.classify=function(t,e,i){if(t===Sk.token.tokens.T_NAME){this.used_names[e]=!0;var s=this.grammar.keywords.hasOwnProperty(e)&&this.grammar.keywords[e];if("print"===e&&(this.p_flags&n.CO_FUTURE_PRINT_FUNCTION||!0===Sk.__future__.print_function)&&(s=!1),s)return s}if(!(s=this.grammar.tokens.hasOwnProperty(t)&&this.grammar.tokens[t])){e="#"+t;for(let n in Sk.token.tokens)if(Sk.token.tokens[n]==t){e=n;break}throw new Sk.builtin.SyntaxError("bad token "+e,this.filename,i[0][0],i)}return s},n.prototype.shift=function(t,e,n,i){var s=this.stack[this.stack.length-1].dfa,r=this.stack[this.stack.length-1].node;r.children.push({type:t,value:e,lineno:i[0][0],col_offset:i[0][1],children:null}),this.stack[this.stack.length-1]={dfa:s,state:n,node:r}},n.prototype.push=function(t,e,n,i){t={type:t,value:null,lineno:i[0][0],col_offset:i[0][1],children:[]},this.stack[this.stack.length-1]={dfa:this.stack[this.stack.length-1].dfa,state:n,node:this.stack[this.stack.length-1].node},this.stack.push({dfa:e,state:0,node:t})},n.prototype.pop=function(){var t=this.stack.pop().node;if(t)if(0!==this.stack.length){this.stack[this.stack.length-1].node.children.push(t)}else this.rootnode=t,this.rootnode.used_names=this.used_names},Sk.parse=function(t,e){var i,s=Sk.token.tokens.T_COMMENT,r=Sk.token.tokens.T_NL,o=Sk.token.tokens.T_OP,a=Sk.token.tokens.T_ENDMARKER,l=Sk.token.tokens.T_ENCODING,u=!1,c=function(t,e){return void 0===e&&(e="file_input"),t=new n(t,Sk.ParseTables),"file_input"===e?t.setup(Sk.ParseTables.sym.file_input):Sk.asserts.fail("todo;"),t}(t);if(Sk._tokenize(t,(i=e.split("\n").reverse().map((function(t){return t+"\n"})),function(){if(0===i.length)throw new Sk.builtin.Exception("EOF");return i.pop()}),"utf-8",(function(t){var e=null;t.type!==s&&t.type!==r&&t.type!==l&&(t.type===o&&(e=Sk.OpMap[t.string]),c.addtoken(e||t.type,t.string,[t.start,t.end,t.line]),t.type===a&&(u=!0))})),!u)throw new Sk.builtin.SyntaxError("incomplete input",this.filename);return{cst:c.rootnode,flags:c.p_flags}},Sk.parseTreeDump=function(t,e){var n,i=""+(e=e||"");if(256<=t.type)for(i+=Sk.ParseTables.number2symbol[t.type]+"\n",n=0;n=i(e)||o+2==i(e)&&s(e,o+1).type==V.T_COMMA)throw new Sk.builtin.SyntaxError("named arguments must follow bare *",t.c_filename,e.lineno);(_=s(e,o+1)).type==V.T_COMMA?o=$(t,e,o+=2,u,c):(p=v(t,_),(o+=3)t.c_feature_version)return o(t,l,"Async functions are only supported in Python 3.5 and greater"),null;r(l,B.funcdef);var d=h(s(l,p));if(u(t,0,s(l,p),0))return null;var f=w(t,s(l,p+1));if(!f)return null;if(s(l,p+2).type==V.T_RARROW){if(!(c=F(t,s(l,p+3))))return null;p+=2}if(s(l,p+3).type==V.T_TYPE_COMMENT){if(!(_=V.T_NEW_TYPE_COMMENT(s(l,p+3))))return null;p+=1}var g=m(t,s(l,p+3));if(!g)return null;if(1":return Sk.astnodes.RShift;case"&":return Sk.astnodes.BitAnd;case"^":return Sk.astnodes.BitXor;case"|":return Sk.astnodes.BitOr;case"*":return"*"===e.value.charAt(1)?Sk.astnodes.Pow:Sk.astnodes.Mult;case"@":if(Sk.__future__.python3)return Sk.astnodes.MatMult;default:Sk.asserts.fail("invalid augassign")}}(0,s(e,1)),a,e.lineno,e.col_offset)}if(s(e,1).type===B.annassign){if(!Sk.__future__.python3)throw new Sk.builtin.SyntaxError("Annotated assignment is not supported in Python 2",t.c_filename,e.lineno);n=s(e,0);var l=s(e,1),p=1;for(o=n;1==i(o);)o=s(o,0);switch(0o(r,a,"f-string: expecting '}'");for(Sk.asserts.assert(e<=n);e=e),Sk.asserts.assert("{"==t.charAt(e-1)),Sk.asserts.assert("}"==t.charAt(n)||"!"==t.charAt(n)||":"==t.charAt(n)),t=t.substring(e,n),/^\s*$/.test(t)&&o(i,s,"f-string: empty expression not allowed");try{let e=Sk.parse("","("+t+")");var r=Sk.astFromParse(e.cst,"",e.flags)}catch(t){throw t.traceback&&t.traceback[0]&&((r=t.traceback[0]).lineno=(r.lineno||1)-1+s.lineno,r.filename=i.c_filename),t}return Sk.asserts.assert(1==r.body.length&&r.body[0].constructor===Sk.astnodes.Expr),r.body[0].value}(t,l,e,r,a),"!"==t.charAt(e)&&(++e>=n&&d(),c=t.charAt(e),e++,"s"!=c&&"r"!=c&&"a"!=c&&o(r,a,"f-string: invalid conversion character: expected 's', 'r', or 'a'")),e>=n&&d(),":"==t.charAt(e)&&(++e>=n&&d(),[u,e]=x(t,e,n,i,s+1,r,a)),(e>=n||"}"!=t.charAt(e))&&d(),e++,[new Sk.astnodes.FormattedValue(l,c,u,a.lineno,a.col_offset),e]}function x(t,e,n,i,s,r,o){let a=[],l=t=>{if(-1!==t.indexOf("}")){if(/(^|[^}])}(}})*($|[^}])/.test(t))throw new Sk.builtin.SyntaxError("f-string: single '}' is not allowed",r.c_filename,o.lineno,o.col_offset);t=t.replace(/}}/g,"}")}a.push(new Sk.astnodes.Str(new Sk.builtin.str(t),o.lineno,o.col_offset,r.end_lineno,o.end_col_offset))};for(;ei&&(u=-1,n=i))}if(-1===u){l(t.substring(e,n)),e=n;break}if(u+1=l.length){if("None"===l)return new Sk.astnodes.NameConstant(Sk.builtin.none.none$,e.lineno,e.col_offset);if("True"===l)return new Sk.astnodes.NameConstant(Sk.builtin.bool.true$,e.lineno,e.col_offset);if("False"===l)return new Sk.astnodes.NameConstant(Sk.builtin.bool.false$,e.lineno,e.col_offset)}return t=h(l),new Sk.astnodes.Name(t,Sk.astnodes.Load,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);case V.T_STRING:n=[];for(var u=0;u=y&&o(p,_,"Truncated \\xNN escape"),T+=String.fromCharCode(parseInt(b.substr(m+1,2),16)),m+=2):k||"u"!==g?k||"U"!==g?T+="\\"+g:(m+8>=y&&o(p,_,"Truncated \\UXXXXXXXX escape"),T+=String.fromCodePoint(parseInt(b.substr(m+1,8),16)),m+=8):(m+4>=y&&o(p,_,"Truncated \\uXXXX escape"),T+=String.fromCharCode(parseInt(b.substr(m+1,4),16)),m+=4))):k&&127l.charCodeAt(1)&&(l="0o"+l.substring(1)),n=!0,"l"!==u&&"L"!==u||(l=l.slice(0,-1),n=!1),l=(u=Number(l))>Number.MAX_SAFE_INTEGER?n?new Sk.builtin.int_(JSBI.BigInt(l)):new Sk.builtin.lng(JSBI.BigInt(l)):n?new Sk.builtin.int_(u):new Sk.builtin.lng(u)),new t(l,e.lineno,e.col_offset);case V.T_ELLIPSIS:return new Sk.astnodes.Ellipsis(e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);case V.T_LPAR:return(n=s(e,1)).type==V.T_RPAR?new Sk.astnodes.Tuple([],Sk.astnodes.Load,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset):n.type==B.yield_expr?F(t,n):1==i(n)?M(t,n):s(n,1).type==B.comp_for?d(S(t,n),e):d(M(t,n),e);case V.T_LSQB:return(n=s(e,1)).type==V.T_RSQB?new Sk.astnodes.List([],Sk.astnodes.Load,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset):(r(n,B.testlist_comp),1==i(n)||s(n,1).type==V.T_COMMA?(t=f(t,n))?new Sk.astnodes.List(t,Sk.astnodes.Load,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset):null:(l=n,Sk.asserts.assert(l.type==B.testlist_comp),d(t=O(t,l,1),e)));case V.T_LBRACE:if((n=s(e,1)).type==V.T_RBRACE)return new Sk.astnodes.Dict(null,null,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);if(l=s(n,0).type==V.T_DOUBLESTAR,1==i(n)||13-l&&s(n,3-l).type==B.comp_for){if(l)return o(t,e,"dict unpacking cannot be used in dict comprehension"),null;l=n,Sk.asserts.assert(3>11&7,this.__namespaces=n||[]}function i(t,e,n,i,s){this.symFlags={},this.name=e,this.varnames=[],this.children=[],this.blockType=n,this.returnsValue=this.varkeywords=this.varargs=this.generator=this.childHasFree=this.hasFree=this.isNested=!1,this.lineno=s,this.table=t,t.cur&&(t.cur.nested||"function"===t.cur.blockType)&&(this.isNested=!0),i.scopeId=a++,t.stss[i.scopeId]=this,this.symbols={}}function s(t){this.filename=t,this.top=this.cur=null,this.stack=[],this.curClass=this.global=null,this.tmpname=0,this.stss={}}function r(t,e){var n;for(n=0;n>11&7)||2==t}))),this._funcGlobals},i.prototype.get_frees=function(){return Sk.asserts.assert("function"==this.get_type(),"get_frees only valid for function scopes"),this._funcFrees||(this._funcFrees=this._identsMatching((function(t){return 4==(t>>11&7)}))),this._funcFrees},i.prototype.get_methods=function(){var t;if(Sk.asserts.assert("class"==this.get_type(),"get_methods only valid for class scopes"),!this._classMethods){var e=[];for(t=0;t>11&7},s.prototype.getStsForAst=function(t){return Sk.asserts.assert(void 0!==t.scopeId,"ast wasn't added to st?"),t=this.stss[t.scopeId],Sk.asserts.assert(void 0!==t,"unknown sym tab entry"),t},s.prototype.SEQStmt=function(t){var e,n;if(null!==t){Sk.asserts.assert(Sk.isArrayLike(t),"SEQ: nodes isn't array? got "+t.toString());var i=t.length;for(n=0;n","").replace(" ","_"))};var a=Sk.builtin.str.reservedWords_;n.prototype.makeConstant=function(t){var e,n="";for(e=0;e Sk.execLimit) {throw new Sk.builtin.TimeoutError(Sk.timeoutMsg())}"),null!==Sk.yieldLimit&&this.u.canSuspend&&(t=t+"if (!$waking && ($dateNow - Sk.lastYield > Sk.yieldLimit)) {var $susp = $saveSuspension({data: {type: 'Sk.yield'}, resume: function() {}}, '"+this.filename+"',$currLineNo,$currColNo);",t+="$susp.$blk = $blk;$susp.optional = true;return $susp;}$waking = false;",this.u.doesSuspend=!0)),t},n.prototype._jumpfalse=function(t,e){t=this._gr("jfalse","(",t,"===false||!Sk.misceval.isTrue(",t,"))"),o("if(",t,"){/*test failed */$blk=",e,";continue;}")},n.prototype._jumpundef=function(t,e){o("if(",t,"===undefined){$blk=",e,";continue;}")},n.prototype._jumpnotundef=function(t,e){o("if(",t,"!==undefined){$blk=",e,";continue;}")},n.prototype._jumptrue=function(t,e){t=this._gr("jtrue","(",t,"===true||Sk.misceval.isTrue(",t,"))"),o("if(",t,"){/*test passed */$blk=",e,";continue;}")},n.prototype._jump=function(t){null===this.u.blocks[this.u.curblock]._next&&(o("$blk=",t,";"),this.u.blocks[this.u.curblock]._next=t)},n.prototype._checkSuspension=function(t){if(this.u.canSuspend){var e=this.newBlock("function return or resume suspension");this._jump(e),this.setBlock(e),t=t||{lineno:"$currLineNo",col_offset:"$currColNo"},o("if ($ret && $ret.$isSuspension) { return $saveSuspension($ret,'"+this.filename+"',"+t.lineno+","+t.col_offset+"); }"),this.u.doesSuspend=!0,this.u.tempsToSave=this.u.tempsToSave.concat(this.u.localtemps)}else o("if ($ret && $ret.$isSuspension) { $ret = Sk.misceval.retryOptionalSuspensionOrThrow($ret); }")},n.prototype.cunpackstarstoarray=function(t,e){if(!t||0==t.length)return"[]";let n=!1;for(let i of t){if(e&&n)throw new Sk.builtin.SyntaxError("Extended argument unpacking is not permitted in Python 2");i.constructor===Sk.astnodes.Starred&&(n=!0)}if(n){e=this._gr("unpack","[]");for(let n of t)n.constructor!==Sk.astnodes.Starred?o(e,".push(",this.vexpr(n),");"):(o("$ret = Sk.misceval.iterFor(Sk.abstr.iter(",this.vexpr(n.value),"), function(e) { ",e,".push(e); });"),this._checkSuspension());return e}return"["+t.map((t=>this.vexpr(t))).join(",")+"]"},n.prototype.cunpackkwstoarray=function(t,e){var n="undefined";if(t&&0=n.length&&(n=this.vexpr(s),"dict"===t?(t=this.vexpr(r),o(e,".mp$ass_subscript(",t,",",n,");")):"list"===t?o(e,".v.push(",n,");"):"set"===t&&o(e,".v.mp$ass_subscript(",n,", true);"),this._jump(c),this.setBlock(c)),this._jump(u),this.setBlock(p),e},n.prototype.cyield=function(t){if(this.u.ste.blockType!==Sk.SYMTAB_CONSTS.FunctionBlock)throw new Sk.builtin.SyntaxError("'yield' outside function",this.filename,t.lineno);var e="Sk.builtin.none.none$";return t.value&&(e=this.vexpr(t.value)),t=this.newBlock("after yield"),o("return [/*resume*/",t,",/*ret*/",e,"];"),this.setBlock(t),"$gen.gi$sentvalue"},n.prototype.cyieldfrom=function(t){if(this.u.ste.blockType!==Sk.SYMTAB_CONSTS.FunctionBlock)throw new Sk.builtin.SyntaxError("'yield' outside function",this.filename,t.lineno);var e=this.vexpr(t.value);e=this._gr("iter","Sk.abstr.iter(",e,")"),o("$gen."+e+"=",e,";");var n=this.newBlock("after iter"),i=this.newBlock("after yield from");this._jump(n),this.setBlock(n);var s=this.gensym("retval");o(e,"=$gen.",e,";"),o("var ",s,";"),o("if ($gen.gi$sentvalue === Sk.builtin.none.none$ || "+e+".constructor === Sk.builtin.generator) {"),o("$ret=",e,".tp$iternext(true, $gen.gi$sentvalue);"),o("} else {");var r=this.makeConstant("new Sk.builtin.str('send');");return o("$ret=Sk.misceval.tryCatch("),o("function(){"),o("return Sk.misceval.callsimOrSuspendArray(Sk.abstr.gattr(",e,",",r,"), [$gen.gi$sentvalue]);},"),o("function (e) { "),o("if (e instanceof Sk.builtin.StopIteration) { "),o(e,".gi$ret = e.$value;"),o("return undefined;"),o("} else { throw e; }"),o("}"),o(");"),o("}"),this._checkSuspension(t),o(s,"=$ret;"),o("if(",s,"===undefined) {"),o("$gen.gi$sentvalue=$gen."+e+".gi$ret;"),o("$blk=",i,";continue;"),o("}"),o("return [/*resume*/",n,",/*ret*/",s,"];"),this.setBlock(i),"$gen.gi$sentvalue"},n.prototype.ccompare=function(t){var e;Sk.asserts.assert(t.ops.length===t.comparators.length);var n=this.vexpr(t.left),i=t.ops.length,s=this.newBlock("done"),r=this._gr("compareres","null");for(e=0;ethis.u.lineno&&(this.u.lineno=t.lineno,this.u.linenoSet=!1),t.constructor){case Sk.astnodes.BoolOp:return this.cboolop(t);case Sk.astnodes.BinOp:return this._gr("binop","Sk.abstr.numberBinOp(",this.vexpr(t.left),",",this.vexpr(t.right),",'",t.op.prototype._astname,"')");case Sk.astnodes.UnaryOp:return this._gr("unaryop","Sk.abstr.numberUnaryOp(",this.vexpr(t.operand),",'",t.op.prototype._astname,"')");case Sk.astnodes.Lambda:return this.clambda(t);case Sk.astnodes.IfExp:return this.cifexp(t);case Sk.astnodes.Dict:return this.cdict(t);case Sk.astnodes.ListComp:return this.clistcomp(t);case Sk.astnodes.DictComp:return this.cdictcomp(t);case Sk.astnodes.SetComp:return this.csetcomp(t);case Sk.astnodes.GeneratorExp:return this.cgenexp(t);case Sk.astnodes.Yield:return this.cyield(t);case Sk.astnodes.YieldFrom:return this.cyieldfrom(t);case Sk.astnodes.Compare:return this.ccompare(t);case Sk.astnodes.Call:return e=this.ccall(t),this.annotateSource(t),e;case Sk.astnodes.Num:if("number"==typeof t.n)return t.n;if(t.n instanceof Sk.builtin.lng)return this.makeConstant("new Sk.builtin.lng('"+t.n.v.toString()+"')");if(t.n instanceof Sk.builtin.int_)return"number"==typeof t.n.v?this.makeConstant("new Sk.builtin.int_("+t.n.v+")"):this.makeConstant("new Sk.builtin.int_('"+t.n.v.toString()+"')");if(t.n instanceof Sk.builtin.float_)return t=0===t.n.v&&-1/0==1/t.n.v?"-0":t.n.v,this.makeConstant("new Sk.builtin.float_("+t+")");if(t.n instanceof Sk.builtin.complex)return this.makeConstant("new Sk.builtin.complex("+(0===t.n.real&&-1/0==1/t.n.real?"-0":t.n.real)+", "+(0===t.n.imag&&-1/0==1/t.n.imag?"-0":t.n.imag)+")");Sk.asserts.fail("unhandled Num type");case Sk.astnodes.Bytes:if(Sk.__future__.python3){for(e=[],t=t.s.$jsstr(),n=0;ni||127<=i&&256>i?n+"\\x"+("0"+i.toString(16)).substr(-2):256<=i?n+"\\u"+("000"+i.toString(16)).substr(-4):n+t.charAt(s);return t=n+'"',e.call(this,"new Sk.builtin.str(",t,")");case Sk.astnodes.Attribute:switch(t.ctx!==Sk.astnodes.AugLoad&&t.ctx!==Sk.astnodes.AugStore&&(s=this.vexpr(t.value)),i=(i=t.attr.$r().v).substring(1,i.length-1),i=r(this.u.private_,new Sk.builtin.str(i)).v,i=this.makeConstant("new Sk.builtin.str('"+i+"')"),t.ctx){case Sk.astnodes.AugLoad:return o("$ret = ",n,".tp$getattr(",i,", true);"),this._checkSuspension(t),o("\nif ($ret === undefined) {"),o("\nthrow new Sk.builtin.AttributeError(",n,'.sk$attrError() + " has no attribute \'" + ',i,'.$jsstr() + "\'");'),o("\n};"),this._gr("lattr","$ret");case Sk.astnodes.Load:return o("$ret = ",s,".tp$getattr(",i,", true);"),this._checkSuspension(t),o("\nif ($ret === undefined) {"),o("\nthrow new Sk.builtin.AttributeError(",s,'.sk$attrError() + " has no attribute \'" + ',i,'.$jsstr() + "\'");'),o("\n};"),this._gr("lattr","$ret");case Sk.astnodes.AugStore:o("$ret = undefined;"),o("if(",e,"!==undefined){"),o("$ret = ",n,".tp$setattr(",i,",",e,", true);"),o("}"),this._checkSuspension(t);break;case Sk.astnodes.Store:o("$ret = ",s,".tp$setattr(",i,",",e,", true);"),this._checkSuspension(t);break;case Sk.astnodes.Del:o("$ret = ",s,".tp$setattr(",i,", undefined, true);"),this._checkSuspension(t);break;default:Sk.asserts.fail("invalid attribute expression")}break;case Sk.astnodes.Subscript:switch(t.ctx){case Sk.astnodes.AugLoad:return o("$ret = Sk.abstr.objectGetItem(",n,",",i,", true);"),this._checkSuspension(t),this._gr("gitem","$ret");case Sk.astnodes.Load:case Sk.astnodes.Store:case Sk.astnodes.Del:return this.vslice(t.slice,t.ctx,this.vexpr(t.value),e);case Sk.astnodes.AugStore:o("$ret=undefined;"),o("if(",e,"!==undefined){"),o("$ret=Sk.abstr.objectSetItem(",n,",",i,",",e,", true)"),o("}"),this._checkSuspension(t);break;default:Sk.asserts.fail("invalid subscript expression")}break;case Sk.astnodes.Name:return this.nameop(t.id,t.ctx,e);case Sk.astnodes.NameConstant:if(t.ctx===Sk.astnodes.Store||t.ctx===Sk.astnodes.AugStore||t.ctx===Sk.astnodes.Del)throw new Sk.builtin.SyntaxError("can not assign to a constant name");switch(t.value){case Sk.builtin.none.none$:return"Sk.builtin.none.none$";case Sk.builtin.bool.true$:return"Sk.builtin.bool.true$";case Sk.builtin.bool.false$:return"Sk.builtin.bool.false$";default:Sk.asserts.fail("invalid named constant")}break;case Sk.astnodes.List:return this.ctuplelistorset(t,e,"list");case Sk.astnodes.Tuple:return this.ctuplelistorset(t,e,"tuple");case Sk.astnodes.Set:return this.ctuplelistorset(t,e,"set");case Sk.astnodes.Starred:if(t.ctx===Sk.astnodes.Store)throw new Sk.builtin.SyntaxError("starred assignment target must be in a list or tuple",this.filename,t.lineno);throw new Sk.builtin.SyntaxError("can't use starred expression here",this.filename,t.lineno);case Sk.astnodes.JoinedStr:return this.cjoinedstr(t);case Sk.astnodes.FormattedValue:return this.cformattedvalue(t);case Sk.astnodes.Ellipsis:return this.makeConstant("Sk.builtin.Ellipsis");default:Sk.asserts.fail("unhandled case "+t.constructor.name+" vexpr")}},n.prototype.vseqexpr=function(t,e){var n;Sk.asserts.assert(void 0===e||t.length===e.length);var i=[];for(n=0;n",this.u.blocks[e]._next=null,e},n.prototype.setBlock=function(t){Sk.asserts.assert(0<=t&&t0) { $err=err; $blk=$exc.pop(); } else { throw err; } }};",o+="var $saveSuspension = function($child, $filename, $lineno, $colno) {var susp = new Sk.misceval.Suspension(); susp.child=$child;susp.resume=function(){"+t.scopename+".$wakingSuspension=susp; return "+t.scopename+"("+(t.ste.generator?"$gen":"")+"); };susp.data=susp.child.data;susp.$blk=$blk;susp.$loc=$loc;susp.$gbl=$gbl;susp.$exc=$exc;susp.$err=$err;susp.$postfinally=$postfinally;susp.$filename=$filename;susp.$lineno=$lineno;susp.$colno=$colno;susp.optional=susp.child.optional;"+(r?"susp.$cell=$cell;":""),s={},e=0;et?this.vexpr(t):"undefined"))),i&&i.vararg&&(d=i.vararg),i&&i.kwarg&&(f=i.kwarg),!Sk.__future__.python3&&i&&i.kwonlyargs&&0!=i.kwonlyargs.length)throw new Sk.builtin.SyntaxError("Keyword-only arguments are not supported in Python 2");var m=this.enterScope(e,t,t.lineno,this.canSuspend),g=this.u.ste.generator,b=this.u.ste.hasFree,S=this.u.ste.childHasFree,k=this.newBlock("codeobj entry");this.u.prefixCode="var "+m+"=(function "+this.niceName(e.v)+"$(";var y=[];if(g){if(f)throw new Sk.builtin.SyntaxError(e.v+"(): keyword arguments in generators not supported",this.filename,t.lineno);if(d)throw new Sk.builtin.SyntaxError(e.v+"(): variable number of arguments in generators not supported",this.filename,t.lineno);y.push("$gen")}else{for(f&&(y.push("$kwa"),this.u.tempsToSave.push("$kwa")),u=0;i&&u0) { $err = err; $blk=$exc.pop(); continue; } else { throw err; }} }});",a.call(this,m),i){for(let t of i.args)c.push(t.arg.v);for(let t of i.kwonlyargs||[])c.push(t.arg.v);this.u.argnames=c}if(this.exitScope(),0"),null,t.args,(function(e){e=this.vexpr(t.body),o("return ",e,";")}))},n.prototype.cifexp=function(t){var e=this.newBlock("next of ifexp"),n=this.newBlock("end of ifexp"),i=this._gr("res","null"),s=this.vexpr(t.test);return this._jumpfalse(s,e),o(i,"=",this.vexpr(t.body),";"),this._jump(n),this.setBlock(e),o(i,"=",this.vexpr(t.orelse),";"),this._jump(n),this.setBlock(n),i},n.prototype.cgenexpgen=function(t,e,n){var i=this.newBlock("start for "+e),s=this.newBlock("skip for "+e);this.newBlock("if cleanup for "+e);var r=this.newBlock("end for "+e),a=t[e];if(0===e)var l="$loc.$iter0";else{var u=this.vexpr(a.iter);l="$loc."+this.gensym("iter"),o(l,"=","Sk.abstr.iter(",u,");")}this._jump(i),this.setBlock(i),this.annotateSource(n),o("$ret = Sk.abstr.iternext(",l,this.u.canSuspend?", true":", false",");"),this._checkSuspension(n),u=this._gr("next","$ret"),this._jumpundef(u,r),this.vexpr(a.target,u);var c=a.ifs?a.ifs.length:0;for(l=0;l=t.length&&(this.annotateSource(n),t=this.vexpr(n),o("return [",s,"/*resume*/,",t,"/*ret*/];"),this.setBlock(s)),this._jump(i),this.setBlock(r),1===e&&o("return Sk.builtin.none.none$;")},n.prototype.cgenexp=function(t){var e=this.buildcodeobj(t,new Sk.builtin.str(""),null,null,(function(e){this.cgenexpgen(t.generators,0,t.elt)}));return e=this._gr("gener","Sk.misceval.callsimArray(",e,");"),o(e,".gi$locals.$iter0=Sk.abstr.iter(",this.vexpr(t.generators[0].iter),");"),e},n.prototype.cclass=function(t){Sk.asserts.assert(t instanceof Sk.astnodes.ClassDef);var e=this.vseqexpr(t.decorator_list),n=this.vseqexpr(t.bases);let i=this.cunpackkwstoarray(t.keywords);var s=this.enterScope(t.name,t,t.lineno),r=this.newBlock("class entry");this.u.prefixCode="var "+s+"=(function $"+t.name.v+"$class_outer($globals,$locals,$cell){var $gbl=$globals,$loc=$locals,$free=$globals;",this.u.switchCode+="(function $"+t.name.v+"$_closure($cell){",this.u.switchCode+="var $blk="+r+",$exc=[],$ret=undefined,$postfinally=undefined,$currLineNo=undefined,$currColNo=undefined;",null!==Sk.execLimit&&(this.u.switchCode+="if (typeof Sk.execStart === 'undefined') {Sk.execStart = Date.now()}"),null!==Sk.yieldLimit&&this.u.canSuspend&&(this.u.switchCode+="if (typeof Sk.lastYield === 'undefined') {Sk.lastYield = Date.now()}"),this.u.switchCode+="while(true){try{",this.u.switchCode+=this.outputInterruptTest(),this.u.switchCode+="switch($blk){",this.u.suffixCode="}}catch(err){ if (!(err instanceof Sk.builtin.BaseException)) { err = new Sk.builtin.ExternalError(err); } err.traceback.push({lineno: $currLineNo, colno: $currColNo, filename: '"+this.filename+"'}); if ($exc.length>0) { $err = err; $blk=$exc.pop(); continue; } else { throw err; }}}",this.u.suffixCode+="}).call(null, $cell);});",this.u.private_=t.name,this.cbody(t.body,t.name),o("return;"),this.exitScope(),o("$ret = Sk.misceval.buildClass($gbl,",s,",",t.name.$r().v,",[",n,"], $cell, ",i,");"),this._checkSuspension();for(let t of e.reverse())o("$ret = Sk.misceval.callsimOrSuspendArray(",t,", [$ret]);"),this._checkSuspension();this.nameop(t.name,Sk.astnodes.Store,"$ret")},n.prototype.ccontinue=function(t){var e=this.peekFinallyBlock();if(0==this.u.continueBlocks.length)throw new Sk.builtin.SyntaxError("'continue' outside loop",this.filename,t.lineno);t=this.u.continueBlocks[this.u.continueBlocks.length-1],Sk.asserts.assert(this.u.breakBlocks.length===this.u.continueBlocks.length),e&&e.breakDepth==this.u.continueBlocks.length?o("$postfinally={isBreak:true,gotoBlock:",t,"};"):this._jump(t)},n.prototype.cbreak=function(t){var e=this.peekFinallyBlock();if(0===this.u.breakBlocks.length)throw new Sk.builtin.SyntaxError("'break' outside loop",this.filename,t.lineno);t=this.u.breakBlocks[this.u.breakBlocks.length-1],e&&e.breakDepth==this.u.breakBlocks.length?o("$postfinally={isBreak:true,gotoBlock:",t,"};"):this._jump(t)},n.prototype.vstmt=function(t,e){if(this.u.lineno=t.lineno,this.u.linenoSet=!1,this.u.localtemps=[],Sk.debugging&&this.u.canSuspend){var n=this.newBlock("debug breakpoint for line "+t.lineno);o("if (Sk.breakpoints('"+this.filename+"',"+t.lineno+","+t.col_offset+")) {","var $susp = $saveSuspension({data: {type: 'Sk.debug'}, resume: function() {}}, '"+this.filename+"',"+t.lineno+","+t.col_offset+");","$susp.$blk = "+n+";","$susp.optional = true;","return $susp;","}"),this._jump(n),this.setBlock(n),this.u.doesSuspend=!0}switch(this.annotateSource(t),t.constructor){case Sk.astnodes.FunctionDef:this.cfunction(t,e);break;case Sk.astnodes.ClassDef:this.cclass(t);break;case Sk.astnodes.Return:if(this.u.ste.blockType!==Sk.SYMTAB_CONSTS.FunctionBlock)throw new Sk.builtin.SyntaxError("'return' outside function",this.filename,t.lineno);n=t.value?this.vexpr(t.value):"Sk.builtin.none.none$",0==this.u.finallyBlocks.length?o("return ",n,";"):(o("$postfinally={returning:",n,"};"),this._jump(this.peekFinallyBlock().blk));break;case Sk.astnodes.Delete:this.vseqexpr(t.targets);break;case Sk.astnodes.Assign:var i=t.targets.length;for(n=this.vexpr(t.value),e=0;e"!==t.name.v){var e=t.name.$r().v;e=e.substring(1,e.length-1),o(t.scopename,".co_name=new Sk.builtins['str']('",e,"');"),this.stack.length&&"class"==this.u.ste.blockType&&o(t.scopename,".co_qualname=new Sk.builtins['str']('"+this.u.name.v+"."+e+"');")}for(var n in t.consts)t.consts.hasOwnProperty(n)&&(t.suffixCode+=n+" = "+t.consts[n]+";")},n.prototype.cbody=function(t,e){var n=0;const i=this.maybeCDocstringOfBody(t);for(null!==i&&(o("$loc.__doc__ = ",i,";"),n=1);n"),t,0,this.canSuspend),n=this.newBlock("module entry");if(this.u.prefixCode="var "+e+"=(function($forcegbl, $forceloc){",this.u.varDeclsCode="var $gbl = $forcegbl || {}, $blk="+n+",$exc=[],$loc=$forceloc || $gbl,$cell={},$err=undefined;var $ret=undefined,$postfinally=undefined,$currLineNo=undefined,$currColNo=undefined;",null!==Sk.execLimit&&(this.u.varDeclsCode+="if (typeof Sk.execStart === 'undefined') {Sk.execStart = Date.now()}"),null!==Sk.yieldLimit&&this.u.canSuspend&&(this.u.varDeclsCode+="if (typeof Sk.lastYield === 'undefined') {Sk.lastYield = Date.now()}"),this.u.varDeclsCode+="var $waking=false; if ("+e+".$wakingSuspension!==undefined) { $wakeFromSuspension(); $waking=true; }if (Sk.retainGlobals) { if (Sk.globals) { $gbl = Sk.globals; Sk.globals = $gbl; $loc = $gbl; } else { Sk.globals = $gbl; }} else { Sk.globals = $gbl; }",this.u.switchCode="while(true){try{",this.u.switchCode+=this.outputInterruptTest(),this.u.switchCode+="switch($blk){",this.u.suffixCode="}",this.u.suffixCode+="}catch(err){ if (!(err instanceof Sk.builtin.BaseException)) { err = new Sk.builtin.ExternalError(err); } err.traceback.push({lineno: $currLineNo, colno: $currColNo, filename: '"+this.filename+"'}); if ($exc.length>0) { $err = err; $blk=$exc.pop(); continue; } else { throw err; }} } });",t.constructor===Sk.astnodes.Module)this.cbody(t.body),o("return $loc;");else Sk.asserts.fail("todo; unhandled case in compilerMod");return this.exitScope(),this.result.push(this.outputAllUnits()),e},Sk.compile=function(t,e,i,s){i=Sk.__future__,Sk.__future__=Object.create(Sk.__future__);var r=Sk.parse(e,t),o=Sk.astFromParse(r.cst,e,r.flags);return r=r.flags,s=(t=new n(e,Sk.symboltable(o,e),r,s,t)).cmod(o),Sk.__future__=i,{funcname:"$compiledmod",code:`var $compiledmod = function() {${t.result.join("")}\nreturn ${s};}();\n$compiledmod;`,filename:e}},Sk.exportSymbol("Sk.compile",Sk.compile),Sk.resetCompiler=function(){Sk.gensymcount=0},Sk.exportSymbol("Sk.resetCompiler",Sk.resetCompiler),Sk.fixReserved=s,Sk.exportSymbol("Sk.fixReserved",Sk.fixReserved),Sk.unfixReserved=function(t){return t.replace(/_\$rw\$$/,"")},Sk.exportSymbol("Sk.unfixReserved",Sk.unfixReserved),Sk.mangleName=r,Sk.exportSymbol("Sk.mangleName",Sk.mangleName),Sk.reservedWords_=a,Sk.exportSymbol("Sk.reservedWords_",Sk.reservedWords_)},function(t,e){Sk.sysmodules=new Sk.builtin.dict([]),Sk.realsyspath=void 0,Sk.importSearchPathForName=function(t,e,n){var i=t.replace(/\./g,"/"),s=function(t,e){return Sk.misceval.chain(Sk.misceval.tryCatch((function(){return Sk.read(t)}),(function(t){})),(function(n){if(void 0!==n)return new Sk.misceval.Break({filename:t,code:n,packagePath:e})}))};return void 0===n&&(n=Sk.realsyspath),Sk.misceval.iterFor(n.tp$iter(),(function(t){return Sk.misceval.chain(s(t.v+"/"+i+e,!1),(function(n){return n||s(t.v+"/"+i+"/__init__"+e,t.v+"/"+i)}))}))},Sk.importSetUpPath=function(t){if(!Sk.realsyspath){var e=[new Sk.builtin.str("src/builtin"),new Sk.builtin.str("src/lib"),new Sk.builtin.str(".")];for(t=0;ti;++i)t+=" ";n[e-1]="/* "+t+e+" */ "+n[e-1]}return n.join("\n")}(r),Sk.debugout(r)}"$compiledmod"!==i.funcname&&(r+="\n"+i.funcname+";");var o=new Sk.builtin.str(n),l=new Sk.builtin.str(t);Sk.sysmodules.mp$ass_subscript(o,c),s&&s.tp$setattr(l,c);var u=Sk.global.eval(r);c.init$dict(o,Sk.builtin.none.none$),c.$d.__package__=i.packagePath?o:m?new Sk.builtin.str(_+m):h||Sk.builtin.none.none$,i.packagePath&&(c.$d.__path__=new Sk.builtin.tuple([new Sk.builtin.str(i.packagePath)])),i.filename&&"$builtinmodule"!==i.funcname&&(c.$d.__file__=new Sk.builtin.str(i.filename));var p=s&&s.$initializing;return c.$initializing=!0,s&&!p&&(s.$initializing=!0),Sk.misceval.tryCatch((()=>Sk.misceval.chain(u(c.$d),(t=>(c.$initializing=!1,s&&!p&&(s.$initializing=!1),t)))),(t=>{try{Sk.abstr.objectDelItem(Sk.sysmodules,o)}catch(t){}if(s)try{s.tp$setattr(l,void 0)}catch(t){}throw c.$initializing=!1,s&&!p&&(s.$initializing=!1),t}))}}),(function(e){var n;if(void 0===e){if(r&&!p)return;throw new Sk.builtin.ModuleNotFoundError("No module named "+Sk.misceval.objectRepr(new Sk.builtin.str(t)))}if(e!==c.$d){for(n in c.$d)e[n]||(e[n]=c.$d[n]);c.$d=e}if(Sk.onAfterImport&&"function"==typeof Sk.onAfterImport)try{Sk.onAfterImport(t)}catch(t){}return p?(u.tp$setattr(new Sk.builtin.str(f[f.length-1]),c),p):c}))}));return o?g:Sk.misceval.retryOptionalSuspensionOrThrow(g)},Sk.importModule=function(t,e,n){return Sk.importModuleInternal_(t,e,void 0,void 0,void 0,!1,n)},Sk.importMain=function(t,e,n){return Sk.dateSet=!1,Sk.filesLoaded=!1,Sk.sysmodules=new Sk.builtin.dict([]),Sk.realsyspath=void 0,Sk.resetCompiler(),Sk.importModuleInternal_(t,e,"__main__",void 0,void 0,!1,n)},Sk.importMainWithBody=function(t,e,n,i){return Sk.dateSet=!1,Sk.filesLoaded=!1,Sk.sysmodules=new Sk.builtin.dict([]),Sk.realsyspath=void 0,Sk.resetCompiler(),Sk.importModuleInternal_(t,e,"__main__",n,void 0,!1,i)},Sk.importBuiltinWithBody=function(t,e,n,i){return Sk.importModuleInternal_(t,e,"__builtin__."+t,n,void 0,!1,i)},Sk.builtin.__import__=function(t,e,n,i,s){t=t.toString();var r,o=Sk.globals;if(null==s&&(s=Sk.__future__.absolute_import?0:-1),0!==s&&e.__package__&&e.__package__!==Sk.builtin.none.none$){if((r=e.__package__.v)&&0=e.length)throw new Sk.builtin.ImportError("Attempted relative import beyond toplevel package");e.length-=s-1,r=e.join(".")}var a=Sk.sysmodules.quick$lookup(new Sk.builtin.str(r))}if(0Sk.importModuleInternal_(s,void 0,void 0,void 0,n,!0,!0)))}return Sk.misceval.chain(...e,(function(){return Sk.asserts.assert(n),n}))}return e}),(function(t){return o!==Sk.globals&&(Sk.globals=o),t}))},Sk.importStar=function(t,e,n){if(n=t.tp$getattr(new Sk.builtin.str("__all__")))for(let i=Sk.abstr.iter(n),s=i.tp$iternext();void 0!==s;s=i.tp$iternext())e[s.v]=Sk.abstr.gattr(t,s);else{n=Object.getOwnPropertyNames(t.$d);for(let i in n)"_"!=n[i].charAt(0)&&(e[n[i]]=t.$d[n[i]])}},Sk.exportSymbol("Sk.importMain",Sk.importMain),Sk.exportSymbol("Sk.importMainWithBody",Sk.importMainWithBody),Sk.exportSymbol("Sk.importBuiltinWithBody",Sk.importBuiltinWithBody),Sk.exportSymbol("Sk.builtin.__import__",Sk.builtin.__import__),Sk.exportSymbol("Sk.importStar",Sk.importStar)},function(t,e){Sk.builtin.timSort=function(t,e){this.list=new Sk.builtin.list(t.v),this.MIN_GALLOP=7,this.listlength=e||t.sq$length()},Sk.builtin.timSort.prototype.lt=function(t,e){return Sk.misceval.richCompareBool(t,e,"Lt")},Sk.builtin.timSort.prototype.le=function(t,e){return!this.lt(e,t)},Sk.builtin.timSort.prototype.setitem=function(t,e){this.list.v[t]=e},Sk.builtin.timSort.prototype.binary_sort=function(t,e){var n;for(n=t.base+e;n>1);this.lt(e,t.getitem(r))?s=r:i=r+1}for(Sk.asserts.assert(i===s),r=n;r>i;r--)t.setitem(r,t.getitem(r-1));t.setitem(i,e)}},Sk.builtin.timSort.prototype.count_run=function(t){var e;if(1>=t.len)var n=t.len,i=!1;else if(n=2,this.lt(t.getitem(t.base+1),t.getitem(t.base)))for(i=!0,e=t.base+2;ee.len)){for(this.merge_init(),t=this.merge_compute_minrun(e.len);0s&&(l=s),a+=n,l+=n}else{for(s=n+1;ls&&(l=s),o=n-a,a=n-l,l=o}for(Sk.asserts.assert(-1<=a>1),i(e.getitem(e.base+n),t)?a=n+1:l=n;return Sk.asserts.assert(a==l),l},Sk.builtin.timSort.prototype.merge_init=function(){this.min_gallop=this.MIN_GALLOP,this.pending=[]},Sk.builtin.timSort.prototype.merge_lo=function(t,e){var n,i,s;Sk.asserts.assert(0=r)break}else{if(this.setitem(o,t.popleft()),o++,1==t.len)return;if(i=0,++n>=r)break}for(r+=1;;){for(this.min_gallop=r-=1=t.len)return;if(this.setitem(o,e.popleft()),o++,0===e.len)return;for(i=this.gallop(t.getitem(t.base),e,0,!1),s=e.base;s=r)break}else{if(o--,this.setitem(o,l),e.len--,1==e.len)return;if(n=0,++i>=r)break}}for(r+=1;;){this.min_gallop=r-=1t.base+u-1;s--)o--,this.setitem(o,t.getitem(s));if(t.len-=n,0===t.len)return;if(o--,this.setitem(o,e.popright()),1==e.len)return;for(a=t.getitem(t.base+t.len-1),u=this.gallop(a,e,e.len-1,!1),i=e.len-u,s=e.base+e.len-1;s>e.base+u-1;s--)o--,this.setitem(o,e.getitem(s));if(e.len-=i,1>=e.len)return;if(o--,this.setitem(o,t.popright()),0===t.len)return;if(nt.base-1;s--)o--,this.setitem(o,t.getitem(s));for(s=e.base+e.len-1;s>e.base-1;s--)o--,this.setitem(o,e.getitem(s))}},Sk.builtin.timSort.prototype.merge_at=function(t){0>t&&(t=this.pending.length+t);var e=this.pending[t],n=this.pending[t+1];Sk.asserts.assert(0>=1;return t+e},Sk.builtin.listSlice=function(t,e,n){this.list=t,this.base=e,this.len=n},Sk.builtin.listSlice.prototype.copyitems=function(){var t=this.base,e=this.base+this.len;return Sk.asserts.assert(0<=t<=e),new Sk.builtin.listSlice(new Sk.builtin.list(this.list.v.slice(t,e)),0,this.len)},Sk.builtin.listSlice.prototype.advance=function(t){this.base+=t,this.len-=t,Sk.asserts.assert(this.base<=this.list.sq$length())},Sk.builtin.listSlice.prototype.getitem=function(t){return this.list.v[t]},Sk.builtin.listSlice.prototype.setitem=function(t,e){this.list.v[t]=e},Sk.builtin.listSlice.prototype.popleft=function(){var t=this.list.v[this.base];return this.base++,this.len--,t},Sk.builtin.listSlice.prototype.popright=function(){return this.len--,this.list.v[this.base+this.len]},Sk.builtin.listSlice.prototype.reverse=function(){for(var t,e,n=this.list,i=this.base,s=i+this.len-1;i same as super(__class__, )\nsuper(type) -> unbound super object\nsuper(type, obj) -> bound super object; requires isinstance(obj, type)\nsuper(type, type2) -> bound super object; requires issubclass(type2, type)\nTypical use to call a cooperative superclass method:\nclass C(B):\n def meth(self, arg):\n super().meth(arg)\nThis works for class methods too:\nclass C(B):\n @classmethod\n def cmeth(cls, arg):\n super().cmeth(arg)\n",tp$new:Sk.generic.new,tp$init(t,e){if(Sk.abstr.checkNoKwargs("super",e),Sk.abstr.checkArgsLen("super",t,1,2),e=t[0],t=t[1],!Sk.builtin.checkClass(e))throw new Sk.builtin.TypeError("must be type, not "+Sk.abstr.typeName(e));this.obj=t,this.type=e,null!=this.obj&&(this.obj_type=this.$supercheck(e,this.obj))},$r(){return this.obj?new Sk.builtin.str(", <"+Sk.abstr.typeName(this.obj)+" object>>"):new Sk.builtin.str(", NULL>")},tp$getattr(t,e){let n=this.obj_type;if(null==n)return Sk.generic.getAttr.call(this,t,e);var i=n.prototype.tp$mro;const s=i.length;if(t===Sk.builtin.str.$class)return Sk.generic.getAttr.call(this,t,e);let r,o;for(r=0;r+1=s)return Sk.generic.getAttr.call(this,t,e);for(t=t.$mangled;r(Sk.abstr.checkNoKwargs("GenericAlias",e),Sk.abstr.checkArgsLen("GenericAlias",t,2,2),new Sk.builtin.GenericAlias(t[0],t[1])),tp$getattr(t,e){return Sk.builtin.checkString(t)&&!this.attr$exc.includes(t)?this.$origin.tp$getattr(t,e):Sk.generic.getAttr.call(this,t,e)},$r(){const t=this.ga$repr(this.$origin);let e="";return this.$args.v.forEach(((t,n)=>{e+=0{this.is$typevar(e)&&0>this.tuple$index(t,e)&&t.push(e)})),this.$params=new Sk.builtin.tuple(t)},tuple$index:(t,e)=>t.indexOf(e),is$typevar(t){if("TypeVar"!==t.tp$name)return!1;if(void 0===(t=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$module)))throw Sk.builtin.RuntimeError("found object withought a __module__");return"typing"===t.toString()},ga$repr(t){if(t===Sk.builtin.Ellipsis)return"...";if(Sk.abstr.lookupSpecial(t,this.str$orig)&&Sk.abstr.lookupSpecial(t,this.str$args))return Sk.misceval.objectRepr(t);const e=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$qualname);if(void 0===e)return Sk.misceval.objectRepr(t);const n=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$module);return void 0===n||Sk.builtin.checkNone(n)?Sk.misceval.objectRepr(t):"builtins"===n.toString()?e.toString():n.toString()+"."+e.toString()},str$orig:new Sk.builtin.str("__origin__"),str$args:new Sk.builtin.str("__args__"),attr$exc:"__origin__ __args__ __parameters__ __mro_entries__ __reduce_ex__ __reduce__".split(" ").map((t=>new Sk.builtin.str(t)))}})},function(t,e){function n(t,e){let n;if(void 0===t||Sk.builtin.checkNone(t))t=void 0;else{if(!(t instanceof Sk.builtin.dict))throw new Sk.builtin.TypeError(e+" must be a dict or None, not "+Sk.abstr.typeName(t));n={},t.$items().forEach((t=>{var[e,i]=t;Sk.builtin.checkString(e)&&(n[e.$mangled]=i)}))}return n}function i(t,e){if(void 0!==t&&!Sk.builtin.checkNone(t))for(let n in e)t.mp$ass_subscript(new Sk.builtin.str(Sk.unfixReserved(n)),e[n])}Sk.builtins={round:null,len:null,min:null,max:null,sum:null,abs:null,fabs:null,ord:null,chr:null,hex:null,oct:null,bin:null,dir:null,repr:null,open:null,isinstance:null,hash:null,getattr:null,hasattr:null,id:null,sorted:null,any:null,all:null,enumerate:Sk.builtin.enumerate,filter:Sk.builtin.filter_,map:Sk.builtin.map_,range:Sk.builtin.range_,reversed:Sk.builtin.reversed,zip:Sk.builtin.zip_,BaseException:Sk.builtin.BaseException,AttributeError:Sk.builtin.AttributeError,ValueError:Sk.builtin.ValueError,Exception:Sk.builtin.Exception,ZeroDivisionError:Sk.builtin.ZeroDivisionError,AssertionError:Sk.builtin.AssertionError,ImportError:Sk.builtin.ImportError,ModuleNotFoundError:Sk.builtin.ModuleNotFoundError,IndentationError:Sk.builtin.IndentationError,IndexError:Sk.builtin.IndexError,LookupError:Sk.builtin.LookupError,KeyError:Sk.builtin.KeyError,TypeError:Sk.builtin.TypeError,UnicodeDecodeError:Sk.builtin.UnicodeDecodeError,UnicodeEncodeError:Sk.builtin.UnicodeEncodeError,NameError:Sk.builtin.NameError,UnboundLocalError:Sk.builtin.UnboundLocalError,IOError:Sk.builtin.IOError,NotImplementedError:Sk.builtin.NotImplementedError,SystemExit:Sk.builtin.SystemExit,OverflowError:Sk.builtin.OverflowError,OperationError:Sk.builtin.OperationError,NegativePowerError:Sk.builtin.NegativePowerError,RuntimeError:Sk.builtin.RuntimeError,RecursionError:Sk.builtin.RecursionError,StopIteration:Sk.builtin.StopIteration,SyntaxError:Sk.builtin.SyntaxError,SystemError:Sk.builtin.SystemError,KeyboardInterrupt:Sk.builtin.KeyboardInterrupt,float_$rw$:Sk.builtin.float_,int_$rw$:Sk.builtin.int_,bool:Sk.builtin.bool,complex:Sk.builtin.complex,dict:Sk.builtin.dict,file:Sk.builtin.file,frozenset:Sk.builtin.frozenset,function:Sk.builtin.func,generator:Sk.builtin.generator,list:Sk.builtin.list,long_$rw$:Sk.builtin.lng,method:Sk.builtin.method,object:Sk.builtin.object,slice:Sk.builtin.slice,str:Sk.builtin.str,set:Sk.builtin.set,tuple:Sk.builtin.tuple,type:Sk.builtin.type,input:null,raw_input:new Sk.builtin.func(Sk.builtin.raw_input),setattr:null,jseval:Sk.builtin.jseval,jsmillis:Sk.builtin.jsmillis,quit:new Sk.builtin.func(Sk.builtin.quit),exit:new Sk.builtin.func(Sk.builtin.quit),print:null,divmod:null,format:null,globals:null,issubclass:null,iter:null,execfile:Sk.builtin.execfile,help:Sk.builtin.help,memoryview:Sk.builtin.memoryview,reload:Sk.builtin.reload,super_$rw$:Sk.builtin.super_,unichr:new Sk.builtin.func(Sk.builtin.unichr),vars:Sk.builtin.vars,apply_$rw$:Sk.builtin.apply_,buffer:Sk.builtin.buffer,coerce:Sk.builtin.coerce,intern:Sk.builtin.intern,property:Sk.builtin.property,classmethod:Sk.builtin.classmethod,staticmethod:Sk.builtin.staticmethod,Ellipsis:Sk.builtin.Ellipsis},t=Sk.builtin.none.none$,e=new Sk.builtin.tuple;const s=new Sk.builtin.int_(0);Sk.abstr.setUpModuleMethods("builtins",Sk.builtins,{__import__:{$meth(t,e,i,s,r){if(!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("__import__() argument 1 must be str, not "+t.tp$name);if(t===Sk.builtin.str.$empty&&0===r.v)throw new Sk.builtin.ValueError("Empty module name");return e=n(e,"globals")||{},s=Sk.ffi.remapToJs(s),r=Sk.ffi.remapToJs(r),Sk.builtin.__import__(t,e,void 0,s,r)},$flags:{NamedArgs:["name","globals","locals","fromlist","level"],Defaults:[t,t,e,s]},$textsig:null,$doc:"__import__(name, globals=None, locals=None, fromlist=(), level=0) -> module\n\nImport a module. Because this function is meant for use by the Python\ninterpreter and not for general use, it is better to use\nimportlib.import_module() to programmatically import a module.\n\nThe globals argument is only used to determine the context;\nthey are not modified. The locals argument is unused. The fromlist\nshould be a list of names to emulate ``from name import ...'', or an\nempty list to emulate ``import name''.\nWhen importing a module from a package, note that __import__('A.B', ...)\nreturns package A when fromlist is empty, but its submodule B when\nfromlist is not empty. The level argument is used to determine whether to\nperform absolute or relative imports: 0 is absolute, while a positive number\nis the number of parent directories to search relative to the current module."},abs:{$meth:Sk.builtin.abs,$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the absolute value of the argument."},all:{$meth:Sk.builtin.all,$flags:{OneArg:!0},$textsig:"($module, iterable, /)",$doc:"Return True if bool(x) is True for all values x in the iterable.\n\nIf the iterable is empty, return True."},any:{$meth:Sk.builtin.any,$flags:{OneArg:!0},$textsig:"($module, iterable, /)",$doc:"Return True if bool(x) is True for any x in the iterable.\n\nIf the iterable is empty, return False."},ascii:{$meth:Sk.builtin.ascii,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return an ASCII-only representation of an object.\n\nAs repr(), return a string containing a printable representation of an\nobject, but escape the non-ASCII characters in the string returned by\nrepr() using \\\\x, \\\\u or \\\\U escapes. This generates a string similar\nto that returned by repr() in Python 2."},bin:{$meth:Sk.builtin.bin,$flags:{OneArg:!0},$textsig:"($module, number, /)",$doc:"Return the binary representation of an integer.\n\n >>> bin(2796202)\n '0b1010101010101010101010'"},callable:{$meth:Sk.builtin.callable,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return whether the object is callable (i.e., some kind of function).\n\nNote that classes are callable, as are instances of classes with a\n__call__() method."},chr:{$meth:Sk.builtin.chr,$flags:{OneArg:!0},$textsig:"($module, i, /)",$doc:"Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."},compile:{$meth:Sk.builtin.compile,$flags:{MinArgs:3,MaxArgs:6},$textsig:"($module, /, source, filename, mode, flags=0,\n dont_inherit=False, optimize=-1)",$doc:"Compile source into a code object that can be executed by exec() or eval().\n\nThe source code may represent a Python module, statement or expression.\nThe filename will be used for run-time error messages.\nThe mode must be 'exec' to compile a module, 'single' to compile a\nsingle (interactive) statement, or 'eval' to compile an expression.\nThe flags argument, if present, controls which future statements influence\nthe compilation of the code.\nThe dont_inherit argument, if true, stops the compilation inheriting\nthe effects of any future statements in effect in the code calling\ncompile; if absent or false these statements do influence the compilation,\nin addition to any features explicitly specified."},delattr:{$meth:Sk.builtin.delattr,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, obj, name, /)",$doc:"Deletes the named attribute from the given object.\n\ndelattr(x, 'y') is equivalent to ``del x.y''"},dir:{$meth:Sk.builtin.dir,$flags:{MinArgs:0,MaxArgs:1},$textsig:null,$doc:"dir([object]) -> list of strings\n\nIf called without an argument, return the names in the current scope.\nElse, return an alphabetized list of names comprising (some of) the attributes\nof the given object, and of attributes reachable from it.\nIf the object supplies a method named __dir__, it will be used; otherwise\nthe default dir() logic is used and returns:\n for a module object: the module's attributes.\n for a class object: its attributes, and recursively the attributes\n of its bases.\n for any other object: its attributes, its class's attributes, and\n recursively the attributes of its class's base classes."},divmod:{$meth:Sk.builtin.divmod,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, x, y, /)",$doc:"Return the tuple (x//y, x%y). Invariant: div*y + mod == x."},eval_$rw$:{$name:"eval",$meth:function(t,e,s){const r=n(e,"globals"),o=n(s,"locals");return Sk.misceval.chain(Sk.builtin.eval(t,r,o),(t=>(i(e,r),i(s,o),t)))},$flags:{MinArgs:1,MaxArgs:3},$textsig:"($module, source, globals=None, locals=None, /)",$doc:"Evaluate the given source in the context of globals and locals.\n\nThe source may be a string representing a Python expression\nor a code object as returned by compile().\nThe globals must be a dictionary and locals can be any mapping,\ndefaulting to the current globals and locals.\nIf only globals is given, locals defaults to it."},exec:{$meth:function(t,e,s){const r=n(e,"globals"),o=n(s,"locals");return Sk.misceval.chain(Sk.builtin.exec(t,r,o),(t=>(i(e,r),i(s,o),Sk.builtin.none.none$)))},$flags:{MinArgs:1,MaxArgs:3},$textsig:"($module, source, globals=None, locals=None, /)",$doc:"Execute the given source in the context of globals and locals.\n\nThe source may be a string representing one or more Python statements\nor a code object as returned by compile().\nThe globals must be a dictionary and locals can be any mapping,\ndefaulting to the current globals and locals.\nIf only globals is given, locals defaults to it."},format:{$meth:Sk.builtin.format,$flags:{MinArgs:1,MaxArgs:2},$textsig:"($module, value, format_spec='', /)",$doc:"Return value.__format__(format_spec)\n\nformat_spec defaults to the empty string.\nSee the Format Specification Mini-Language section of help('FORMATTING') for\ndetails."},getattr:{$meth:Sk.builtin.getattr,$flags:{MinArgs:2,MaxArgs:3},$textsig:null,$doc:"getattr(object, name[, default]) -> value\n\nGet a named attribute from an object; getattr(x, 'y') is equivalent to x.y.\nWhen a default argument is given, it is returned when the attribute doesn't\nexist; without it, an exception is raised in that case."},globals:{$meth:Sk.builtin.globals,$flags:{NoArgs:!0},$textsig:"($module, /)",$doc:"Return the dictionary containing the current scope's global variables.\n\nNOTE: Updates to this dictionary *will* affect name lookups in the current\nglobal scope and vice-versa."},hasattr:{$meth:Sk.builtin.hasattr,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, obj, name, /)",$doc:"Return whether the object has an attribute with the given name.\n\nThis is done by calling getattr(obj, name) and catching AttributeError."},hash:{$meth:Sk.builtin.hash,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return the hash value for the given object.\n\nTwo objects that compare equal must also have the same hash value, but the\nreverse is not necessarily true."},hex:{$meth:Sk.builtin.hex,$flags:{OneArg:!0},$textsig:"($module, number, /)",$doc:"Return the hexadecimal representation of an integer.\n\n >>> hex(12648430)\n '0xc0ffee'"},id:{$meth:Sk.builtin.id,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return the identity of an object.\n\nThis is guaranteed to be unique among simultaneously existing objects.\n(CPython uses the object's memory address.)"},input:{$meth:Sk.builtin.input,$flags:{MinArgs:0,MaxArgs:1},$textsig:"($module, prompt=None, /)",$doc:"Read a string from standard input. The trailing newline is stripped.\n\nThe prompt string, if given, is printed to standard output without a\ntrailing newline before reading input.\n\nIf the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError.\nOn *nix systems, readline is used if available."},isinstance:{$meth:Sk.builtin.isinstance,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, obj, class_or_tuple, /)",$doc:"Return whether an object is an instance of a class or of a subclass thereof.\n\nA tuple, as in ``isinstance(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``isinstance(x, A) or isinstance(x, B)\nor ...`` etc."},issubclass:{$meth:Sk.builtin.issubclass,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, cls, class_or_tuple, /)",$doc:"Return whether 'cls' is a derived from another class or is the same class.\n\nA tuple, as in ``issubclass(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``issubclass(x, A) or issubclass(x, B)\nor ...`` etc."},iter:{$meth:Sk.builtin.iter,$flags:{MinArgs:1,MaxArgs:2},$textsig:"($module, iterable /)",$doc:"iter(iterable) -> iterator\niter(callable, sentinel) -> iterator\n\nGet an iterator from an object. In the first form, the argument must\nsupply its own iterator, or be a sequence.\nIn the second form, the callable is called until it returns the sentinel."},len:{$meth:Sk.builtin.len,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return the number of items in a container."},locals:{$meth:Sk.builtin.locals,$flags:{NoArgs:!0},$textsig:"($module, /)",$doc:"Return a dictionary containing the current scope's local variables.\n\nNOTE: Whether or not updates to this dictionary will affect name lookups in\nthe local scope and vice-versa is *implementation dependent* and not\ncovered by any backwards compatibility guarantees."},max:{$meth:Sk.builtin.max,$flags:{FastCall:!0},$textsig:null,$doc:"max(iterable, *[, default=obj, key=func]) -> value\nmax(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its biggest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the largest argument."},min:{$meth:Sk.builtin.min,$flags:{FastCall:!0},$textsig:null,$doc:"min(iterable, *[, default=obj, key=func]) -> value\nmin(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its smallest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the smallest argument."},next:{$name:"next",$meth:Sk.builtin.next_,$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"next(iterator[, default])\n\nReturn the next item from the iterator. If default is given and the iterator\nis exhausted, it is returned instead of raising StopIteration."},oct:{$meth:Sk.builtin.oct,$flags:{OneArg:!0},$textsig:"($module, number, /)",$doc:"Return the octal representation of an integer.\n\n >>> oct(342391)\n '0o1234567'"},open:{$meth:Sk.builtin.open,$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"open(name[, mode[, buffering]]) -> file object\n\nOpen a file using the file() type, returns a file object. This is the\npreferred way to open a file. See file.__doc__ for further information."},ord:{$meth:Sk.builtin.ord,$flags:{OneArg:!0},$textsig:"($module, c, /)",$doc:"Return the Unicode code point for a one-character string."},pow:{$meth:Sk.builtin.pow,$flags:{MinArgs:2,MaxArgs:3},$textsig:"($module, x, y, z=None, /)",$doc:"Equivalent to x**y (with two arguments) or x**y % z (with three arguments)\n\nSome types, such as ints, are able to use a more efficient algorithm when\ninvoked using the three argument form."},print:{$meth:Sk.builtin.print,$flags:{FastCall:!0},$textsig:null,$doc:"print(value, ..., sep=' ', end='\\n', file=sys.stdout, flush=False)\n\nPrints the values to a stream, or to sys.stdout by default.\nOptional keyword arguments:\nfile: a file-like object (stream); defaults to the current sys.stdout.\nsep: string inserted between values, default a space.\nend: string appended after the last value, default a newline.\nflush: whether to forcibly flush the stream."},repr:{$meth:Sk.builtin.repr,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return the canonical string representation of the object.\n\nFor many object types, including most builtins, eval(repr(obj)) == obj."},round:{$meth:Sk.builtin.round,$flags:{NamedArgs:["number","ndigits"]},$textsig:"($module, /, number, ndigits=None)",$doc:"Round a number to a given precision in decimal digits.\n\nThe return value is an integer if ndigits is omitted or None. Otherwise\nthe return value has the same type as the number. ndigits may be negative."},setattr:{$meth:Sk.builtin.setattr,$flags:{MinArgs:3,MaxArgs:3},$textsig:"($module, obj, name, value, /)",$doc:"Sets the named attribute on the given object to the specified value.\n\nsetattr(x, 'y', v) is equivalent to ``x.y = v''"},sorted:{$meth:Sk.builtin.sorted,$flags:{NamedArgs:[null,"cmp","key","reverse"],Defaults:[Sk.builtin.none.none$,Sk.builtin.none.none$,Sk.builtin.bool.false$]},$textsig:"($module, iterable, /, *, key=None, reverse=False)",$doc:"Return a new list containing all items from the iterable in ascending order.\n\nA custom key function can be supplied to customize the sort order, and the\nreverse flag can be set to request the result in descending order."},sum:{$meth:Sk.builtin.sum,$flags:{NamedArgs:[null,"start"],Defaults:[new Sk.builtin.int_(0)]},$textsig:"($module, iterable, /, start=0)",$doc:"Return the sum of a 'start' value (default: 0) plus an iterable of numbers\n\nWhen the iterable is empty, return the start value.\nThis function is intended specifically for use with numeric values and may\nreject non-numeric types."},vars:{$meth:Sk.builtin.vars,$flags:{MinArgs:0,MaxArgs:1},$textsig:null,$doc:"vars([object]) -> dictionary\n\nWithout arguments, equivalent to locals().\nWith an argument, equivalent to object.__dict__."}}),Sk.setupObjects=function(t){t?(Sk.builtins.filter=Sk.builtin.filter_,Sk.builtins.map=Sk.builtin.map_,Sk.builtins.zip=Sk.builtin.zip_,Sk.builtins.range=Sk.builtin.range_,delete Sk.builtins.reduce,delete Sk.builtins.xrange,delete Sk.builtins.StandardError,delete Sk.builtins.unicode,delete Sk.builtins.basestring,delete Sk.builtins.long_$rw$,Sk.builtin.int_.prototype.$r=function(){return new Sk.builtin.str(this.v.toString())},delete Sk.builtin.int_.prototype.tp$str,delete Sk.builtin.bool.prototype.tp$str,delete Sk.builtins.raw_input,delete Sk.builtins.unichr,delete Sk.builtin.str.prototype.decode,Sk.builtins.bytes=Sk.builtin.bytes,Sk.builtins.ascii=new Sk.builtin.sk_method({$meth:Sk.builtin.ascii,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return an ASCII-only representation of an object.\n\nAs repr(), return a string containing a printable representation of an\nobject, but escape the non-ASCII characters in the string returned by\nrepr() using \\\\x, \\\\u or \\\\U escapes. This generates a string similar\nto that returned by repr() in Python 2."},null,"builtins")):(Sk.builtins.range=new Sk.builtin.sk_method({$meth:Sk.builtin.range,$name:"range",$flags:{MinArgs:1,MaxArgs:3}},void 0,"builtins"),Sk.builtins.xrange=new Sk.builtin.sk_method({$meth:Sk.builtin.xrange,$name:"xrange",$flags:{MinArgs:1,MaxArgs:3}},null,"builtins"),Sk.builtins.reduce=new Sk.builtin.sk_method({$meth:Sk.builtin.reduce,$name:"reduce",$flags:{MinArgs:2,MaxArgs:3}},null,"builtins"),Sk.builtins.filter=new Sk.builtin.func(Sk.builtin.filter),Sk.builtins.map=new Sk.builtin.func(Sk.builtin.map),Sk.builtins.zip=new Sk.builtin.func(Sk.builtin.zip),Sk.builtins.StandardError=Sk.builtin.Exception,Sk.builtins.unicode=Sk.builtin.str,Sk.builtins.basestring=Sk.builtin.str,Sk.builtins.long_$rw$=Sk.builtin.lng,Sk.builtin.int_.prototype.$r=function(){const t=this.v;return"number"==typeof t?new Sk.builtin.str(t.toString()):new Sk.builtin.str(t.toString()+"L")},Sk.builtin.int_.prototype.tp$str=function(){return new Sk.builtin.str(this.v.toString())},Sk.builtin.bool.prototype.tp$str=function(){return this.$r()},Sk.builtins.raw_input=new Sk.builtin.func(Sk.builtin.raw_input),Sk.builtins.unichr=new Sk.builtin.func(Sk.builtin.unichr),Sk.builtin.str.prototype.decode=Sk.builtin.str.$py2decode,delete Sk.builtins.bytes,delete Sk.builtins.ascii)},Sk.exportSymbol("Sk.setupObjects",Sk.setupObjects),Sk.exportSymbol("Sk.builtins",Sk.builtins)},function(t,e){Sk.builtin.str.$empty=new Sk.builtin.str(""),Sk.builtin.str.$emptystr=Sk.builtin.str.$empty,Sk.builtin.str.$utf8=new Sk.builtin.str("utf-8"),Sk.builtin.str.$ascii=new Sk.builtin.str("ascii"),Sk.builtin.str.$default_factory=new Sk.builtin.str("default_factory"),Sk.builtin.str.$imag=new Sk.builtin.str("imag"),Sk.builtin.str.$real=new Sk.builtin.str("real"),Sk.builtin.str.$abs=new Sk.builtin.str("__abs__"),Sk.builtin.str.$bases=new Sk.builtin.str("__bases__"),Sk.builtin.str.$bytes=new Sk.builtin.str("__bytes__"),Sk.builtin.str.$call=new Sk.builtin.str("__call__"),Sk.builtin.str.$class=new Sk.builtin.str("__class__"),Sk.builtin.str.$class_getitem=new Sk.builtin.str("__class_getitem__"),Sk.builtin.str.$cmp=new Sk.builtin.str("__cmp__"),Sk.builtin.str.$complex=new Sk.builtin.str("__complex__"),Sk.builtin.str.$contains=new Sk.builtin.str("__contains__"),Sk.builtin.str.$copy=new Sk.builtin.str("__copy__"),Sk.builtin.str.$dict=new Sk.builtin.str("__dict__"),Sk.builtin.str.$dir=new Sk.builtin.str("__dir__"),Sk.builtin.str.$doc=new Sk.builtin.str("__doc__"),Sk.builtin.str.$enter=new Sk.builtin.str("__enter__"),Sk.builtin.str.$eq=new Sk.builtin.str("__eq__"),Sk.builtin.str.$exit=new Sk.builtin.str("__exit__"),Sk.builtin.str.$index=new Sk.builtin.str("__index__"),Sk.builtin.str.$init=new Sk.builtin.str("__init__"),Sk.builtin.str.$initsubclass=new Sk.builtin.str("__init_subclass__"),Sk.builtin.str.$int_=new Sk.builtin.str("__int__"),Sk.builtin.str.$iter=new Sk.builtin.str("__iter__"),Sk.builtin.str.$file=new Sk.builtin.str("__file__"),Sk.builtin.str.$float_=new Sk.builtin.str("__float__"),Sk.builtin.str.$format=new Sk.builtin.str("__format__"),Sk.builtin.str.$ge=new Sk.builtin.str("__ge__"),Sk.builtin.str.$getattr=new Sk.builtin.str("__getattr__"),Sk.builtin.str.$getattribute=new Sk.builtin.str("__getattribute__"),Sk.builtin.str.$getitem=new Sk.builtin.str("__getitem__"),Sk.builtin.str.$gt=new Sk.builtin.str("__gt__"),Sk.builtin.str.$keys=new Sk.builtin.str("keys"),Sk.builtin.str.$le=new Sk.builtin.str("__le__"),Sk.builtin.str.$len=new Sk.builtin.str("__len__"),Sk.builtin.str.$length_hint=new Sk.builtin.str("__length_hint__"),Sk.builtin.str.$loader=new Sk.builtin.str("__loader__"),Sk.builtin.str.$lt=new Sk.builtin.str("__lt__"),Sk.builtin.str.$module=new Sk.builtin.str("__module__"),Sk.builtin.str.$missing=new Sk.builtin.str("__missing__"),Sk.builtin.str.$name=new Sk.builtin.str("__name__"),Sk.builtin.str.$ne=new Sk.builtin.str("__ne__"),Sk.builtin.str.$new=new Sk.builtin.str("__new__"),Sk.builtin.str.$next=new Sk.builtin.str("__next__"),Sk.builtin.str.$path=new Sk.builtin.str("__path__"),Sk.builtin.str.$prepare=new Sk.builtin.str("__prepare__"),Sk.builtin.str.$qualname=new Sk.builtin.str("__qualname__"),Sk.builtin.str.$repr=new Sk.builtin.str("__repr__"),Sk.builtin.str.$reversed=new Sk.builtin.str("__reversed__"),Sk.builtin.str.$round=new Sk.builtin.str("__round__"),Sk.builtin.str.$setattr=new Sk.builtin.str("__setattr__"),Sk.builtin.str.$setitem=new Sk.builtin.str("__setitem__"),Sk.builtin.str.$slots=new Sk.builtin.str("__slots__"),Sk.builtin.str.$str=new Sk.builtin.str("__str__"),Sk.builtin.str.$setname=new Sk.builtin.str("__set_name__"),Sk.builtin.str.$trunc=new Sk.builtin.str("__trunc__"),Sk.builtin.str.$write=new Sk.builtin.str("write"),Sk.misceval.op2method_={Eq:Sk.builtin.str.$eq,NotEq:Sk.builtin.str.$ne,Gt:Sk.builtin.str.$gt,GtE:Sk.builtin.str.$ge,Lt:Sk.builtin.str.$lt,LtE:Sk.builtin.str.$le}},function(t,e,n){function i(t,e,n,i,s){this.type=t,this.string=e,this.start=n,this.end=i,this.line=s}function s(t){return"("+Array.prototype.slice.call(arguments).join("|")+")"}function r(t){return s.apply(null,arguments)+"?"}function o(t,e){for(var n=t.length;n--;)if(t[n]===e)return!0;return!1}function a(t){return t=t.normalize("NFKC"),E.test(t)}function l(){return" FR RF Br BR Fr r B R b bR f rb rB F Rf U rF u RB br fR fr rf Rb".split(" ")}function u(t){t?delete Sk.token.EXACT_TOKEN_TYPES["<>"]:Sk.token.EXACT_TOKEN_TYPES["<>"]=Sk.token.tokens.T_NOTEQUAL,I=Object.keys(Sk.token.EXACT_TOKEN_TYPES).sort(),A=s.apply(this,I.reverse().map((function(t){return t&&d.test(t)?t.replace(_,"\\$&"):t}))),O=s("\\r?\\n",A)}n.r(e),(t={Cc:"\\0-\\x1F\\x7F-\\x9F",Cf:"\\xAD\\u0600-\\u0605\\u061C\\u06DD\\u070F\\u08E2\\u180E\\u200B-\\u200F\\u202A-\\u202E\\u2060-\\u2064\\u2066-\\u206F\\uFEFF\\uFFF9-\\uFFFB",Co:"\\uE000-\\uF8FF",Cs:"\\uD800-\\uDFFF",Ll:"a-z\\xB5\\xDF-\\xF6\\xF8-\\xFF\\u0101\\u0103\\u0105\\u0107\\u0109\\u010B\\u010D\\u010F\\u0111\\u0113\\u0115\\u0117\\u0119\\u011B\\u011D\\u011F\\u0121\\u0123\\u0125\\u0127\\u0129\\u012B\\u012D\\u012F\\u0131\\u0133\\u0135\\u0137\\u0138\\u013A\\u013C\\u013E\\u0140\\u0142\\u0144\\u0146\\u0148\\u0149\\u014B\\u014D\\u014F\\u0151\\u0153\\u0155\\u0157\\u0159\\u015B\\u015D\\u015F\\u0161\\u0163\\u0165\\u0167\\u0169\\u016B\\u016D\\u016F\\u0171\\u0173\\u0175\\u0177\\u017A\\u017C\\u017E-\\u0180\\u0183\\u0185\\u0188\\u018C\\u018D\\u0192\\u0195\\u0199-\\u019B\\u019E\\u01A1\\u01A3\\u01A5\\u01A8\\u01AA\\u01AB\\u01AD\\u01B0\\u01B4\\u01B6\\u01B9\\u01BA\\u01BD-\\u01BF\\u01C6\\u01C9\\u01CC\\u01CE\\u01D0\\u01D2\\u01D4\\u01D6\\u01D8\\u01DA\\u01DC\\u01DD\\u01DF\\u01E1\\u01E3\\u01E5\\u01E7\\u01E9\\u01EB\\u01ED\\u01EF\\u01F0\\u01F3\\u01F5\\u01F9\\u01FB\\u01FD\\u01FF\\u0201\\u0203\\u0205\\u0207\\u0209\\u020B\\u020D\\u020F\\u0211\\u0213\\u0215\\u0217\\u0219\\u021B\\u021D\\u021F\\u0221\\u0223\\u0225\\u0227\\u0229\\u022B\\u022D\\u022F\\u0231\\u0233-\\u0239\\u023C\\u023F\\u0240\\u0242\\u0247\\u0249\\u024B\\u024D\\u024F-\\u0293\\u0295-\\u02AF\\u0371\\u0373\\u0377\\u037B-\\u037D\\u0390\\u03AC-\\u03CE\\u03D0\\u03D1\\u03D5-\\u03D7\\u03D9\\u03DB\\u03DD\\u03DF\\u03E1\\u03E3\\u03E5\\u03E7\\u03E9\\u03EB\\u03ED\\u03EF-\\u03F3\\u03F5\\u03F8\\u03FB\\u03FC\\u0430-\\u045F\\u0461\\u0463\\u0465\\u0467\\u0469\\u046B\\u046D\\u046F\\u0471\\u0473\\u0475\\u0477\\u0479\\u047B\\u047D\\u047F\\u0481\\u048B\\u048D\\u048F\\u0491\\u0493\\u0495\\u0497\\u0499\\u049B\\u049D\\u049F\\u04A1\\u04A3\\u04A5\\u04A7\\u04A9\\u04AB\\u04AD\\u04AF\\u04B1\\u04B3\\u04B5\\u04B7\\u04B9\\u04BB\\u04BD\\u04BF\\u04C2\\u04C4\\u04C6\\u04C8\\u04CA\\u04CC\\u04CE\\u04CF\\u04D1\\u04D3\\u04D5\\u04D7\\u04D9\\u04DB\\u04DD\\u04DF\\u04E1\\u04E3\\u04E5\\u04E7\\u04E9\\u04EB\\u04ED\\u04EF\\u04F1\\u04F3\\u04F5\\u04F7\\u04F9\\u04FB\\u04FD\\u04FF\\u0501\\u0503\\u0505\\u0507\\u0509\\u050B\\u050D\\u050F\\u0511\\u0513\\u0515\\u0517\\u0519\\u051B\\u051D\\u051F\\u0521\\u0523\\u0525\\u0527\\u0529\\u052B\\u052D\\u052F\\u0560-\\u0588\\u10D0-\\u10FA\\u10FD-\\u10FF\\u13F8-\\u13FD\\u1C80-\\u1C88\\u1D00-\\u1D2B\\u1D6B-\\u1D77\\u1D79-\\u1D9A\\u1E01\\u1E03\\u1E05\\u1E07\\u1E09\\u1E0B\\u1E0D\\u1E0F\\u1E11\\u1E13\\u1E15\\u1E17\\u1E19\\u1E1B\\u1E1D\\u1E1F\\u1E21\\u1E23\\u1E25\\u1E27\\u1E29\\u1E2B\\u1E2D\\u1E2F\\u1E31\\u1E33\\u1E35\\u1E37\\u1E39\\u1E3B\\u1E3D\\u1E3F\\u1E41\\u1E43\\u1E45\\u1E47\\u1E49\\u1E4B\\u1E4D\\u1E4F\\u1E51\\u1E53\\u1E55\\u1E57\\u1E59\\u1E5B\\u1E5D\\u1E5F\\u1E61\\u1E63\\u1E65\\u1E67\\u1E69\\u1E6B\\u1E6D\\u1E6F\\u1E71\\u1E73\\u1E75\\u1E77\\u1E79\\u1E7B\\u1E7D\\u1E7F\\u1E81\\u1E83\\u1E85\\u1E87\\u1E89\\u1E8B\\u1E8D\\u1E8F\\u1E91\\u1E93\\u1E95-\\u1E9D\\u1E9F\\u1EA1\\u1EA3\\u1EA5\\u1EA7\\u1EA9\\u1EAB\\u1EAD\\u1EAF\\u1EB1\\u1EB3\\u1EB5\\u1EB7\\u1EB9\\u1EBB\\u1EBD\\u1EBF\\u1EC1\\u1EC3\\u1EC5\\u1EC7\\u1EC9\\u1ECB\\u1ECD\\u1ECF\\u1ED1\\u1ED3\\u1ED5\\u1ED7\\u1ED9\\u1EDB\\u1EDD\\u1EDF\\u1EE1\\u1EE3\\u1EE5\\u1EE7\\u1EE9\\u1EEB\\u1EED\\u1EEF\\u1EF1\\u1EF3\\u1EF5\\u1EF7\\u1EF9\\u1EFB\\u1EFD\\u1EFF-\\u1F07\\u1F10-\\u1F15\\u1F20-\\u1F27\\u1F30-\\u1F37\\u1F40-\\u1F45\\u1F50-\\u1F57\\u1F60-\\u1F67\\u1F70-\\u1F7D\\u1F80-\\u1F87\\u1F90-\\u1F97\\u1FA0-\\u1FA7\\u1FB0-\\u1FB4\\u1FB6\\u1FB7\\u1FBE\\u1FC2-\\u1FC4\\u1FC6\\u1FC7\\u1FD0-\\u1FD3\\u1FD6\\u1FD7\\u1FE0-\\u1FE7\\u1FF2-\\u1FF4\\u1FF6\\u1FF7\\u210A\\u210E\\u210F\\u2113\\u212F\\u2134\\u2139\\u213C\\u213D\\u2146-\\u2149\\u214E\\u2184\\u2C30-\\u2C5E\\u2C61\\u2C65\\u2C66\\u2C68\\u2C6A\\u2C6C\\u2C71\\u2C73\\u2C74\\u2C76-\\u2C7B\\u2C81\\u2C83\\u2C85\\u2C87\\u2C89\\u2C8B\\u2C8D\\u2C8F\\u2C91\\u2C93\\u2C95\\u2C97\\u2C99\\u2C9B\\u2C9D\\u2C9F\\u2CA1\\u2CA3\\u2CA5\\u2CA7\\u2CA9\\u2CAB\\u2CAD\\u2CAF\\u2CB1\\u2CB3\\u2CB5\\u2CB7\\u2CB9\\u2CBB\\u2CBD\\u2CBF\\u2CC1\\u2CC3\\u2CC5\\u2CC7\\u2CC9\\u2CCB\\u2CCD\\u2CCF\\u2CD1\\u2CD3\\u2CD5\\u2CD7\\u2CD9\\u2CDB\\u2CDD\\u2CDF\\u2CE1\\u2CE3\\u2CE4\\u2CEC\\u2CEE\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\uA641\\uA643\\uA645\\uA647\\uA649\\uA64B\\uA64D\\uA64F\\uA651\\uA653\\uA655\\uA657\\uA659\\uA65B\\uA65D\\uA65F\\uA661\\uA663\\uA665\\uA667\\uA669\\uA66B\\uA66D\\uA681\\uA683\\uA685\\uA687\\uA689\\uA68B\\uA68D\\uA68F\\uA691\\uA693\\uA695\\uA697\\uA699\\uA69B\\uA723\\uA725\\uA727\\uA729\\uA72B\\uA72D\\uA72F-\\uA731\\uA733\\uA735\\uA737\\uA739\\uA73B\\uA73D\\uA73F\\uA741\\uA743\\uA745\\uA747\\uA749\\uA74B\\uA74D\\uA74F\\uA751\\uA753\\uA755\\uA757\\uA759\\uA75B\\uA75D\\uA75F\\uA761\\uA763\\uA765\\uA767\\uA769\\uA76B\\uA76D\\uA76F\\uA771-\\uA778\\uA77A\\uA77C\\uA77F\\uA781\\uA783\\uA785\\uA787\\uA78C\\uA78E\\uA791\\uA793-\\uA795\\uA797\\uA799\\uA79B\\uA79D\\uA79F\\uA7A1\\uA7A3\\uA7A5\\uA7A7\\uA7A9\\uA7AF\\uA7B5\\uA7B7\\uA7B9\\uA7BB\\uA7BD\\uA7BF\\uA7C3\\uA7C8\\uA7CA\\uA7F6\\uA7FA\\uAB30-\\uAB5A\\uAB60-\\uAB68\\uAB70-\\uABBF\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFF41-\\uFF5A",Lm:"\\u02B0-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0374\\u037A\\u0559\\u0640\\u06E5\\u06E6\\u07F4\\u07F5\\u07FA\\u081A\\u0824\\u0828\\u0971\\u0E46\\u0EC6\\u10FC\\u17D7\\u1843\\u1AA7\\u1C78-\\u1C7D\\u1D2C-\\u1D6A\\u1D78\\u1D9B-\\u1DBF\\u2071\\u207F\\u2090-\\u209C\\u2C7C\\u2C7D\\u2D6F\\u2E2F\\u3005\\u3031-\\u3035\\u303B\\u309D\\u309E\\u30FC-\\u30FE\\uA015\\uA4F8-\\uA4FD\\uA60C\\uA67F\\uA69C\\uA69D\\uA717-\\uA71F\\uA770\\uA788\\uA7F8\\uA7F9\\uA9CF\\uA9E6\\uAA70\\uAADD\\uAAF3\\uAAF4\\uAB5C-\\uAB5F\\uAB69\\uFF70\\uFF9E\\uFF9F",Lo:"\\xAA\\xBA\\u01BB\\u01C0-\\u01C3\\u0294\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u063F\\u0641-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u0800-\\u0815\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08C7\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0972-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E45\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u1100-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17DC\\u1820-\\u1842\\u1844-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C77\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u2135-\\u2138\\u2D30-\\u2D67\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3006\\u303C\\u3041-\\u3096\\u309F\\u30A1-\\u30FA\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\u9FFC\\uA000-\\uA014\\uA016-\\uA48C\\uA4D0-\\uA4F7\\uA500-\\uA60B\\uA610-\\uA61F\\uA62A\\uA62B\\uA66E\\uA6A0-\\uA6E5\\uA78F\\uA7F7\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9E0-\\uA9E4\\uA9E7-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA6F\\uAA71-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB\\uAADC\\uAAE0-\\uAAEA\\uAAF2\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF66-\\uFF6F\\uFF71-\\uFF9D\\uFFA0-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC",Lt:"\\u01C5\\u01C8\\u01CB\\u01F2\\u1F88-\\u1F8F\\u1F98-\\u1F9F\\u1FA8-\\u1FAF\\u1FBC\\u1FCC\\u1FFC",Lu:"A-Z\\xC0-\\xD6\\xD8-\\xDE\\u0100\\u0102\\u0104\\u0106\\u0108\\u010A\\u010C\\u010E\\u0110\\u0112\\u0114\\u0116\\u0118\\u011A\\u011C\\u011E\\u0120\\u0122\\u0124\\u0126\\u0128\\u012A\\u012C\\u012E\\u0130\\u0132\\u0134\\u0136\\u0139\\u013B\\u013D\\u013F\\u0141\\u0143\\u0145\\u0147\\u014A\\u014C\\u014E\\u0150\\u0152\\u0154\\u0156\\u0158\\u015A\\u015C\\u015E\\u0160\\u0162\\u0164\\u0166\\u0168\\u016A\\u016C\\u016E\\u0170\\u0172\\u0174\\u0176\\u0178\\u0179\\u017B\\u017D\\u0181\\u0182\\u0184\\u0186\\u0187\\u0189-\\u018B\\u018E-\\u0191\\u0193\\u0194\\u0196-\\u0198\\u019C\\u019D\\u019F\\u01A0\\u01A2\\u01A4\\u01A6\\u01A7\\u01A9\\u01AC\\u01AE\\u01AF\\u01B1-\\u01B3\\u01B5\\u01B7\\u01B8\\u01BC\\u01C4\\u01C7\\u01CA\\u01CD\\u01CF\\u01D1\\u01D3\\u01D5\\u01D7\\u01D9\\u01DB\\u01DE\\u01E0\\u01E2\\u01E4\\u01E6\\u01E8\\u01EA\\u01EC\\u01EE\\u01F1\\u01F4\\u01F6-\\u01F8\\u01FA\\u01FC\\u01FE\\u0200\\u0202\\u0204\\u0206\\u0208\\u020A\\u020C\\u020E\\u0210\\u0212\\u0214\\u0216\\u0218\\u021A\\u021C\\u021E\\u0220\\u0222\\u0224\\u0226\\u0228\\u022A\\u022C\\u022E\\u0230\\u0232\\u023A\\u023B\\u023D\\u023E\\u0241\\u0243-\\u0246\\u0248\\u024A\\u024C\\u024E\\u0370\\u0372\\u0376\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E\\u038F\\u0391-\\u03A1\\u03A3-\\u03AB\\u03CF\\u03D2-\\u03D4\\u03D8\\u03DA\\u03DC\\u03DE\\u03E0\\u03E2\\u03E4\\u03E6\\u03E8\\u03EA\\u03EC\\u03EE\\u03F4\\u03F7\\u03F9\\u03FA\\u03FD-\\u042F\\u0460\\u0462\\u0464\\u0466\\u0468\\u046A\\u046C\\u046E\\u0470\\u0472\\u0474\\u0476\\u0478\\u047A\\u047C\\u047E\\u0480\\u048A\\u048C\\u048E\\u0490\\u0492\\u0494\\u0496\\u0498\\u049A\\u049C\\u049E\\u04A0\\u04A2\\u04A4\\u04A6\\u04A8\\u04AA\\u04AC\\u04AE\\u04B0\\u04B2\\u04B4\\u04B6\\u04B8\\u04BA\\u04BC\\u04BE\\u04C0\\u04C1\\u04C3\\u04C5\\u04C7\\u04C9\\u04CB\\u04CD\\u04D0\\u04D2\\u04D4\\u04D6\\u04D8\\u04DA\\u04DC\\u04DE\\u04E0\\u04E2\\u04E4\\u04E6\\u04E8\\u04EA\\u04EC\\u04EE\\u04F0\\u04F2\\u04F4\\u04F6\\u04F8\\u04FA\\u04FC\\u04FE\\u0500\\u0502\\u0504\\u0506\\u0508\\u050A\\u050C\\u050E\\u0510\\u0512\\u0514\\u0516\\u0518\\u051A\\u051C\\u051E\\u0520\\u0522\\u0524\\u0526\\u0528\\u052A\\u052C\\u052E\\u0531-\\u0556\\u10A0-\\u10C5\\u10C7\\u10CD\\u13A0-\\u13F5\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1E00\\u1E02\\u1E04\\u1E06\\u1E08\\u1E0A\\u1E0C\\u1E0E\\u1E10\\u1E12\\u1E14\\u1E16\\u1E18\\u1E1A\\u1E1C\\u1E1E\\u1E20\\u1E22\\u1E24\\u1E26\\u1E28\\u1E2A\\u1E2C\\u1E2E\\u1E30\\u1E32\\u1E34\\u1E36\\u1E38\\u1E3A\\u1E3C\\u1E3E\\u1E40\\u1E42\\u1E44\\u1E46\\u1E48\\u1E4A\\u1E4C\\u1E4E\\u1E50\\u1E52\\u1E54\\u1E56\\u1E58\\u1E5A\\u1E5C\\u1E5E\\u1E60\\u1E62\\u1E64\\u1E66\\u1E68\\u1E6A\\u1E6C\\u1E6E\\u1E70\\u1E72\\u1E74\\u1E76\\u1E78\\u1E7A\\u1E7C\\u1E7E\\u1E80\\u1E82\\u1E84\\u1E86\\u1E88\\u1E8A\\u1E8C\\u1E8E\\u1E90\\u1E92\\u1E94\\u1E9E\\u1EA0\\u1EA2\\u1EA4\\u1EA6\\u1EA8\\u1EAA\\u1EAC\\u1EAE\\u1EB0\\u1EB2\\u1EB4\\u1EB6\\u1EB8\\u1EBA\\u1EBC\\u1EBE\\u1EC0\\u1EC2\\u1EC4\\u1EC6\\u1EC8\\u1ECA\\u1ECC\\u1ECE\\u1ED0\\u1ED2\\u1ED4\\u1ED6\\u1ED8\\u1EDA\\u1EDC\\u1EDE\\u1EE0\\u1EE2\\u1EE4\\u1EE6\\u1EE8\\u1EEA\\u1EEC\\u1EEE\\u1EF0\\u1EF2\\u1EF4\\u1EF6\\u1EF8\\u1EFA\\u1EFC\\u1EFE\\u1F08-\\u1F0F\\u1F18-\\u1F1D\\u1F28-\\u1F2F\\u1F38-\\u1F3F\\u1F48-\\u1F4D\\u1F59\\u1F5B\\u1F5D\\u1F5F\\u1F68-\\u1F6F\\u1FB8-\\u1FBB\\u1FC8-\\u1FCB\\u1FD8-\\u1FDB\\u1FE8-\\u1FEC\\u1FF8-\\u1FFB\\u2102\\u2107\\u210B-\\u210D\\u2110-\\u2112\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u2130-\\u2133\\u213E\\u213F\\u2145\\u2183\\u2C00-\\u2C2E\\u2C60\\u2C62-\\u2C64\\u2C67\\u2C69\\u2C6B\\u2C6D-\\u2C70\\u2C72\\u2C75\\u2C7E-\\u2C80\\u2C82\\u2C84\\u2C86\\u2C88\\u2C8A\\u2C8C\\u2C8E\\u2C90\\u2C92\\u2C94\\u2C96\\u2C98\\u2C9A\\u2C9C\\u2C9E\\u2CA0\\u2CA2\\u2CA4\\u2CA6\\u2CA8\\u2CAA\\u2CAC\\u2CAE\\u2CB0\\u2CB2\\u2CB4\\u2CB6\\u2CB8\\u2CBA\\u2CBC\\u2CBE\\u2CC0\\u2CC2\\u2CC4\\u2CC6\\u2CC8\\u2CCA\\u2CCC\\u2CCE\\u2CD0\\u2CD2\\u2CD4\\u2CD6\\u2CD8\\u2CDA\\u2CDC\\u2CDE\\u2CE0\\u2CE2\\u2CEB\\u2CED\\u2CF2\\uA640\\uA642\\uA644\\uA646\\uA648\\uA64A\\uA64C\\uA64E\\uA650\\uA652\\uA654\\uA656\\uA658\\uA65A\\uA65C\\uA65E\\uA660\\uA662\\uA664\\uA666\\uA668\\uA66A\\uA66C\\uA680\\uA682\\uA684\\uA686\\uA688\\uA68A\\uA68C\\uA68E\\uA690\\uA692\\uA694\\uA696\\uA698\\uA69A\\uA722\\uA724\\uA726\\uA728\\uA72A\\uA72C\\uA72E\\uA732\\uA734\\uA736\\uA738\\uA73A\\uA73C\\uA73E\\uA740\\uA742\\uA744\\uA746\\uA748\\uA74A\\uA74C\\uA74E\\uA750\\uA752\\uA754\\uA756\\uA758\\uA75A\\uA75C\\uA75E\\uA760\\uA762\\uA764\\uA766\\uA768\\uA76A\\uA76C\\uA76E\\uA779\\uA77B\\uA77D\\uA77E\\uA780\\uA782\\uA784\\uA786\\uA78B\\uA78D\\uA790\\uA792\\uA796\\uA798\\uA79A\\uA79C\\uA79E\\uA7A0\\uA7A2\\uA7A4\\uA7A6\\uA7A8\\uA7AA-\\uA7AE\\uA7B0-\\uA7B4\\uA7B6\\uA7B8\\uA7BA\\uA7BC\\uA7BE\\uA7C2\\uA7C4-\\uA7C7\\uA7C9\\uA7F5\\uFF21-\\uFF3A",M:"\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1AC0\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F",Mc:"\\u0903\\u093B\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u094F\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u1A19\\u1A1A\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1BE7\\u1BEA-\\u1BEC\\u1BEE\\u1BF2\\u1BF3\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF7\\u302E\\u302F\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BE-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uAA7D\\uAAEB\\uAAEE\\uAAEF\\uAAF5\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC",Me:"\\u0488\\u0489\\u1ABE\\u20DD-\\u20E0\\u20E2-\\u20E4\\uA670-\\uA672",Mn:"\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0902\\u093A\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0957\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u09FE\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B55\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C00\\u0C04\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D00\\u0D01\\u0D3B\\u0D3C\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0D81\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4\\u17B5\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u1885\\u1886\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A1B\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1AB0-\\u1ABD\\u1ABF\\u1AC0\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1BAB-\\u1BAD\\u1BE6\\u1BE8\\u1BE9\\u1BED\\u1BEF-\\u1BF1\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1CF4\\u1CF8\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302D\\u3099\\u309A\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA82C\\uA8C4\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uA9BD\\uA9E5\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAA7C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEC\\uAAED\\uAAF6\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F",Nd:"0-9\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0DE6-\\u0DEF\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uA9F0-\\uA9F9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19",Nl:"\\u16EE-\\u16F0\\u2160-\\u2182\\u2185-\\u2188\\u3007\\u3021-\\u3029\\u3038-\\u303A\\uA6E6-\\uA6EF",No:"\\xB2\\xB3\\xB9\\xBC-\\xBE\\u09F4-\\u09F9\\u0B72-\\u0B77\\u0BF0-\\u0BF2\\u0C78-\\u0C7E\\u0D58-\\u0D5E\\u0D70-\\u0D78\\u0F2A-\\u0F33\\u1369-\\u137C\\u17F0-\\u17F9\\u19DA\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u215F\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA830-\\uA835",Pc:"_\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F",Pd:"\\-\\u058A\\u05BE\\u1400\\u1806\\u2010-\\u2015\\u2E17\\u2E1A\\u2E3A\\u2E3B\\u2E40\\u301C\\u3030\\u30A0\\uFE31\\uFE32\\uFE58\\uFE63\\uFF0D",Pe:"\\)\\]\\}\\u0F3B\\u0F3D\\u169C\\u2046\\u207E\\u208E\\u2309\\u230B\\u232A\\u2769\\u276B\\u276D\\u276F\\u2771\\u2773\\u2775\\u27C6\\u27E7\\u27E9\\u27EB\\u27ED\\u27EF\\u2984\\u2986\\u2988\\u298A\\u298C\\u298E\\u2990\\u2992\\u2994\\u2996\\u2998\\u29D9\\u29DB\\u29FD\\u2E23\\u2E25\\u2E27\\u2E29\\u3009\\u300B\\u300D\\u300F\\u3011\\u3015\\u3017\\u3019\\u301B\\u301E\\u301F\\uFD3E\\uFE18\\uFE36\\uFE38\\uFE3A\\uFE3C\\uFE3E\\uFE40\\uFE42\\uFE44\\uFE48\\uFE5A\\uFE5C\\uFE5E\\uFF09\\uFF3D\\uFF5D\\uFF60\\uFF63",Pf:"\\xBB\\u2019\\u201D\\u203A\\u2E03\\u2E05\\u2E0A\\u2E0D\\u2E1D\\u2E21",Pi:"\\xAB\\u2018\\u201B\\u201C\\u201F\\u2039\\u2E02\\u2E04\\u2E09\\u2E0C\\u2E1C\\u2E20",Po:"!-#%-'\\*,\\.\\/:;\\?@\\xA1\\xA7\\xB6\\xB7\\xBF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061E\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u166E\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u1805\\u1807-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2016\\u2017\\u2020-\\u2027\\u2030-\\u2038\\u203B-\\u203E\\u2041-\\u2043\\u2047-\\u2051\\u2053\\u2055-\\u205E\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00\\u2E01\\u2E06-\\u2E08\\u2E0B\\u2E0E-\\u2E16\\u2E18\\u2E19\\u2E1B\\u2E1E\\u2E1F\\u2E2A-\\u2E2E\\u2E30-\\u2E39\\u2E3C-\\u2E3F\\u2E41\\u2E43-\\u2E4F\\u2E52\\u3001-\\u3003\\u303D\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uAAF0\\uAAF1\\uABEB\\uFE10-\\uFE16\\uFE19\\uFE30\\uFE45\\uFE46\\uFE49-\\uFE4C\\uFE50-\\uFE52\\uFE54-\\uFE57\\uFE5F-\\uFE61\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF07\\uFF0A\\uFF0C\\uFF0E\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3C\\uFF61\\uFF64\\uFF65",Ps:"\\(\\[\\{\\u0F3A\\u0F3C\\u169B\\u201A\\u201E\\u2045\\u207D\\u208D\\u2308\\u230A\\u2329\\u2768\\u276A\\u276C\\u276E\\u2770\\u2772\\u2774\\u27C5\\u27E6\\u27E8\\u27EA\\u27EC\\u27EE\\u2983\\u2985\\u2987\\u2989\\u298B\\u298D\\u298F\\u2991\\u2993\\u2995\\u2997\\u29D8\\u29DA\\u29FC\\u2E22\\u2E24\\u2E26\\u2E28\\u2E42\\u3008\\u300A\\u300C\\u300E\\u3010\\u3014\\u3016\\u3018\\u301A\\u301D\\uFD3F\\uFE17\\uFE35\\uFE37\\uFE39\\uFE3B\\uFE3D\\uFE3F\\uFE41\\uFE43\\uFE47\\uFE59\\uFE5B\\uFE5D\\uFF08\\uFF3B\\uFF5B\\uFF5F\\uFF62",Sc:"\\$\\xA2-\\xA5\\u058F\\u060B\\u07FE\\u07FF\\u09F2\\u09F3\\u09FB\\u0AF1\\u0BF9\\u0E3F\\u17DB\\u20A0-\\u20BF\\uA838\\uFDFC\\uFE69\\uFF04\\uFFE0\\uFFE1\\uFFE5\\uFFE6",Sk:"\\^`\\xA8\\xAF\\xB4\\xB8\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384\\u0385\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD\\u1FFE\\u309B\\u309C\\uA700-\\uA716\\uA720\\uA721\\uA789\\uA78A\\uAB5B\\uAB6A\\uAB6B\\uFBB2-\\uFBC1\\uFF3E\\uFF40\\uFFE3",Sm:"\\+<->\\|~\\xAC\\xB1\\xD7\\xF7\\u03F6\\u0606-\\u0608\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u2118\\u2140-\\u2144\\u214B\\u2190-\\u2194\\u219A\\u219B\\u21A0\\u21A3\\u21A6\\u21AE\\u21CE\\u21CF\\u21D2\\u21D4\\u21F4-\\u22FF\\u2320\\u2321\\u237C\\u239B-\\u23B3\\u23DC-\\u23E1\\u25B7\\u25C1\\u25F8-\\u25FF\\u266F\\u27C0-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u27FF\\u2900-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2AFF\\u2B30-\\u2B44\\u2B47-\\u2B4C\\uFB29\\uFE62\\uFE64-\\uFE66\\uFF0B\\uFF1C-\\uFF1E\\uFF5C\\uFF5E\\uFFE2\\uFFE9-\\uFFEC",So:"\\xA6\\xA9\\xAE\\xB0\\u0482\\u058D\\u058E\\u060E\\u060F\\u06DE\\u06E9\\u06FD\\u06FE\\u07F6\\u09FA\\u0B70\\u0BF3-\\u0BF8\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE\\u0FCF\\u0FD5-\\u0FD8\\u109E\\u109F\\u1390-\\u1399\\u166D\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u2100\\u2101\\u2103-\\u2106\\u2108\\u2109\\u2114\\u2116\\u2117\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A\\u213B\\u214A\\u214C\\u214D\\u214F\\u218A\\u218B\\u2195-\\u2199\\u219C-\\u219F\\u21A1\\u21A2\\u21A4\\u21A5\\u21A7-\\u21AD\\u21AF-\\u21CD\\u21D0\\u21D1\\u21D3\\u21D5-\\u21F3\\u2300-\\u2307\\u230C-\\u231F\\u2322-\\u2328\\u232B-\\u237B\\u237D-\\u239A\\u23B4-\\u23DB\\u23E2-\\u2426\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u25B6\\u25B8-\\u25C0\\u25C2-\\u25F7\\u2600-\\u266E\\u2670-\\u2767\\u2794-\\u27BF\\u2800-\\u28FF\\u2B00-\\u2B2F\\u2B45\\u2B46\\u2B4D-\\u2B73\\u2B76-\\u2B95\\u2B97-\\u2BFF\\u2CE5-\\u2CEA\\u2E50\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFB\\u3004\\u3012\\u3013\\u3020\\u3036\\u3037\\u303E\\u303F\\u3190\\u3191\\u3196-\\u319F\\u31C0-\\u31E3\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA828-\\uA82B\\uA836\\uA837\\uA839\\uAA77-\\uAA79\\uFDFD\\uFFE4\\uFFE8\\uFFED\\uFFEE\\uFFFC\\uFFFD",Zl:"\\u2028",Zp:"\\u2029",Zs:" \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000"}).C=t.Cc+t.Cf+t.Cs+t.Co,t.L=t.Lu+t.Ll+t.Lt+t.Lm+t.Mn+t.Lo,t.LC=t.Lu+t.Ll+t.Lt,t.M=t.Mn+t.Mc+t.Me,t.N=t.Nd+t.Nl+t.No,t.P=t.Pc+t.Pd+t.Ps+t.Pe+t.Pi+t.Pf+t.Po,t.S=t.Sm+t.Sc+t.Sk+t.So,t.Z=t.Zs+t.Zl+t.Zp,t.w="_"+t.L+t.N,t.b="(?:["+t.w+"](?:[^"+t.w+"]|$)|(?:^|[^"+t.w+"])["+t.w+"])",t.bOut="(?=[^"+t.w+"]|$)",t.bIn="(?:^|[^"+t.w+"])",t.bInCapture="(?:^|([^"+t.w+"]))",t.B="(?:["+t.w+"]["+t.w+"]|[^"+t.w+"][^"+t.w+"])",t.d=t.N;var c=Sk.token.tokens;const p=Sk.builtin.SyntaxError,h=Sk.builtin.SyntaxError;i.prototype.exact_type=function(){return this.type==c.T_OP&&this.string in Sk.token.EXACT_TOKEN_TYPES?Sk.token.EXACT_TOKEN_TYPES[this.string]:this.type};var _=/[\\^$.*+?()[\]{}|]/g,d=RegExp(_.source);const{Lu:f,Ll:m,Lt:g,Lm:b,Lo:S,Nl:k,Mn:y,Mc:T,Nd:v,Pc:$}=t,w="["+(t=f+m+g+b+S+k+"_\\u1885-\\u1886\\u2118\\u212E\\u309B-\\u309C")+"]+["+(t+y+T+v+$)+"\\u00B7\\u0387\\u1369-\\u1371\\u19DA]*",E=new RegExp("^"+w+"$");Sk.token.isIdentifier=a,function(t){s.apply(null,arguments)}("\\\\\\r?\\n[ \\f\\t]*"),r("#[^\\r\\n]*"),t=s("[0-9](?:_?[0-9])*\\.(?:[0-9](?:_?[0-9])*)?","\\.[0-9](?:_?[0-9])*")+r("[eE][-+]?[0-9](?:_?[0-9])*");var I,A,O,M=s(t,"[0-9](?:_?[0-9])*[eE][-+]?[0-9](?:_?[0-9])*"),C=s("[0-9](?:_?[0-9])*[jJ]",M+"[jJ]");t=s.apply(null,l()),e=s(t+"'''",t+'"""'),s(t+"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*'",t+'"[^\\n"\\\\]*(?:\\\\.[^\\n"\\\\]*)*"'),u(!0),Sk.token.setupTokens=u;var R=s(t+"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*"+s("'","\\\\\\r?\\n"),t+'"[^\\n"\\\\]*(?:\\\\.[^\\n"\\\\]*)*'+s('"',"\\\\\\r?\\n")),x=s("\\\\\\r?\\n|$","#[^\\r\\n]*",e),N={};t=l();for(let e of t)N[e+"'"]="^[^'\\\\]*(?:\\\\.[^'\\\\]*)*'",N[e+'"']='^[^"\\\\]*(?:\\\\.[^"\\\\]*)*"',N[e+"'''"]="^[^'\\\\]*(?:(?:\\\\.|'(?!''))[^'\\\\]*)*'''",N[e+'"""']='^[^"\\\\]*(?:(?:\\\\.|"(?!""))[^"\\\\]*)*"""';let L=[],D=[];for(let e of t)L.push(e+'"'),L.push(e+"'"),D.push(e+'"""'),D.push(e+"'''");Sk._tokenize=function(t,e,n,r){var l=Sk.__future__.python3?"":"(?:L?)";l=s("0[xX](?:_?[0-9a-fA-F])+"+l,"0[bB](?:_?[01])+"+l,Sk.__future__.silent_octal_literal?"0([oO]?)(?:_?[0-7])+"+l:"0([oO])(?:_?[0-7])+"+l,"(?:0(?:_?0)*|[1-9](?:_?[0-9])*)"+l),l=s(C,M,l),l="[ \\f\\t]*"+s(x,l,O,R,w),l=new RegExp(l);var u,_,d,f=0,m=0,g=0,b="",S=0,k=null,y=[0],T=void 0,v=void 0;void 0!==n&&("utf-8-sig"==n&&(n="utf-8"),r(new i(c.T_ENCODING,n,[0,0],[0,0],"")));for(var $=n="";;){try{n=$,$=e()}catch(t){$=""}f+=1;var E=0,I=$.length;if(b){if(!$)throw new p("EOF in multi-line string",t,v[0],v[1]);T.lastIndex=0;var A=T.exec($);if(!A){S&&"\\\n"!==$.substring($.length-2)&&"\\\r\n"!==$.substring($.length-3)?(r(new i(c.T_ERRORTOKEN,b+$,v,[f,$.length],k)),b="",k=null):(b+=$,k+=$);continue}E=_=A[0].length,r(new i(c.T_STRING,b+$.substring(0,_),v,[f,_],k+$)),b="",S=0,k=null}else if(0!=m||g){if(!$)throw new p("EOF in multi-line statement",t,f,0);g=0}else{if(!$)break;for(u=0;Ey[y.length-1]&&(y.push(u),r(new i(c.T_INDENT,$.substring(E),[f,0],[f,E],$)));u{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";var t={};n.r(t),n.d(t,{controls_type:()=>nt,controls_typeLists:()=>it,variables_change:()=>tt,variables_get:()=>Q,variables_global:()=>et,variables_set:()=>Z});var e={};n.r(e),n.d(e,{base_setup:()=>ot,controls_delay:()=>at,controls_end_program:()=>lt,controls_except:()=>yt,controls_finally:()=>Tt,controls_flow_statements:()=>dt,controls_for:()=>ft,controls_forEach:()=>pt,controls_for_range:()=>mt,controls_if:()=>ut,controls_if_else:()=>St,controls_if_elseif:()=>bt,controls_if_if:()=>gt,controls_lambda:()=>$t,controls_main:()=>rt,controls_pass:()=>wt,controls_range:()=>ct,controls_repeat_ext:()=>vt,controls_thread:()=>Et,controls_try:()=>kt,controls_try_finally:()=>_t,controls_whileUntil:()=>ht,do_while:()=>It,garbage_collection:()=>At,get_mem_alloc:()=>Ot,get_mem_free:()=>Mt});var i={};n.r(i),n.d(i,{base_map:()=>Kt,math_arithmetic:()=>Lt,math_bit:()=>Ft,math_constant:()=>xt,math_constant_mp:()=>Nt,math_constrain:()=>Gt,math_dec:()=>Bt,math_indexer_number:()=>Ht,math_map:()=>Xt,math_max_min:()=>Ut,math_number:()=>Rt,math_number_base_conversion:()=>Yt,math_random:()=>jt,math_random_seed:()=>qt,math_round:()=>zt,math_selfcalcu:()=>Dt,math_to_int:()=>Vt,math_trig:()=>Pt,text_to_number:()=>Wt,text_to_number_skulpt:()=>Jt});var s={};n.r(s),n.d(s,{ascii_to_char:()=>ie,char_to_ascii:()=>se,number_to_text:()=>re,os_system:()=>Me,text:()=>Zt,text_capital:()=>de,text_center:()=>fe,text_char:()=>ee,text_char_at:()=>le,text_char_at2:()=>ae,text_char_at3:()=>Ee,text_compareTo:()=>we,text_compare_to:()=>_e,text_create_with_container:()=>Te,text_create_with_item:()=>ve,text_encode:()=>Ae,text_equals_starts_ends:()=>he,text_eval:()=>Oe,text_find:()=>me,text_format:()=>ye,text_format_noreturn:()=>Ie,text_join:()=>ne,text_join_seq:()=>ge,text_length:()=>oe,text_random_char:()=>ue,text_replace:()=>be,text_split:()=>Se,text_strip:()=>ke,text_substring:()=>pe,text_substring2:()=>ce,text_substring3:()=>$e,text_textarea:()=>te});var r={};n.r(r),n.d(r,{list_many_input:()=>Ze,list_tolist:()=>an,list_tolist2:()=>fn,list_trig:()=>Je,lists_2d_get_col_row_data:()=>Le,lists_2d_get_data_with_col_row:()=>Ne,lists_append_extend:()=>Ue,lists_change_to:()=>Qe,lists_change_to_general:()=>en,lists_clear:()=>He,lists_create_with:()=>De,lists_create_with2:()=>ln,lists_create_with_container:()=>Pe,lists_create_with_item:()=>Be,lists_create_with_noreturn:()=>tn,lists_create_with_text:()=>Fe,lists_create_with_text2:()=>un,lists_del_general:()=>nn,lists_find:()=>We,lists_getIndex3:()=>cn,lists_getSublist3:()=>pn,lists_get_index:()=>Re,lists_get_random_item:()=>Ye,lists_get_random_sublist:()=>je,lists_get_sublist:()=>xe,lists_insert_value:()=>Ge,lists_insert_value2:()=>_n,lists_pop:()=>ze,lists_remove_at:()=>qe,lists_remove_at2:()=>dn,lists_reverse:()=>Xe,lists_setIndex3:()=>hn,lists_set_index:()=>Ve,lists_sort:()=>Ke,lists_zip:()=>sn,lists_zip_container:()=>rn,lists_zip_item:()=>on});var o={};n.r(o),n.d(o,{dicts_add_change_del:()=>Cn,dicts_add_or_change:()=>vn,dicts_clear:()=>En,dicts_create_with:()=>gn,dicts_create_with_container:()=>bn,dicts_create_with_item:()=>Sn,dicts_create_with_noreturn:()=>Nn,dicts_deldict:()=>Mn,dicts_delete:()=>$n,dicts_get:()=>yn,dicts_get_default:()=>Tn,dicts_items:()=>In,dicts_keys:()=>kn,dicts_length:()=>On,dicts_pop:()=>Rn,dicts_setdefault:()=>xn,dicts_to_json:()=>Dn,dicts_todict:()=>Ln,dicts_update:()=>wn,dicts_values:()=>An,json_to_dicts:()=>Fn});var a={};n.r(a),n.d(a,{logic_boolean:()=>jn,logic_compare:()=>Bn,logic_compare_continous:()=>Vn,logic_is:()=>qn,logic_is_in:()=>Hn,logic_negate:()=>Yn,logic_null:()=>Gn,logic_operation:()=>Un,logic_tobool:()=>zn,logic_true_or_false:()=>Xn});var l={};n.r(l),n.d(l,{sdcard_mount:()=>gi,sdcard_use_spi_init:()=>mi,storage_can_write_ornot:()=>ii,storage_change_dir:()=>di,storage_close_file:()=>ri,storage_delete_file:()=>ai,storage_file_seek:()=>ci,storage_file_tell:()=>ui,storage_file_write:()=>Zn,storage_fileopen:()=>Jn,storage_fileopen_new:()=>Kn,storage_fileopen_new_encoding:()=>Qn,storage_get_a_line:()=>ni,storage_get_contents:()=>ei,storage_get_contents_without_para:()=>ti,storage_get_current_dir:()=>pi,storage_get_file_size:()=>li,storage_get_filename:()=>si,storage_is_file:()=>fi,storage_list_all_files:()=>oi,storage_make_dir:()=>hi,storage_open_file_with_os:()=>Wn,storage_rename:()=>_i});var u={};n.r(u),n.d(u,{procedures_callnoreturn:()=>Ti,procedures_callreturn:()=>vi,procedures_defnoreturn:()=>bi,procedures_defreturn:()=>Si,procedures_ifreturn:()=>$i,procedures_mutatorarg:()=>yi,procedures_mutatorcontainer:()=>ki,procedures_return:()=>wi});var c={};n.r(c),n.d(c,{tuple_change_to:()=>Fi,tuple_create_with:()=>Ii,tuple_create_with_container:()=>Ai,tuple_create_with_item:()=>Oi,tuple_create_with_noreturn:()=>Ui,tuple_create_with_text2:()=>Mi,tuple_create_with_text_return:()=>Ci,tuple_del:()=>Ni,tuple_find:()=>Pi,tuple_getIndex:()=>Ri,tuple_getSublist:()=>Vi,tuple_get_random_item:()=>ji,tuple_get_sublist:()=>Yi,tuple_join:()=>Li,tuple_length:()=>xi,tuple_max:()=>Di,tuple_totuple:()=>Gi,tuple_trig:()=>Bi});var p={};n.r(p),n.d(p,{set_add_discard:()=>ts,set_clear:()=>Ki,set_create_with:()=>Hi,set_create_with_container:()=>qi,set_create_with_item:()=>zi,set_create_with_text_return:()=>is,set_length:()=>Wi,set_operate:()=>Qi,set_operate_update:()=>Zi,set_pop:()=>Ji,set_sub:()=>es,set_toset:()=>ss,set_update:()=>ns});var h={};n.r(h),n.d(h,{html_content:()=>us,html_content_more:()=>cs,html_document:()=>os,html_form:()=>hs,html_head_body:()=>ls,html_style:()=>ps,html_style_color:()=>ds,html_style_content:()=>_s,html_text:()=>fs,html_title:()=>as});var _={};n.r(_),n.d(_,{attribute_access:()=>Os,function_call:()=>Es,function_call_container:()=>Is,function_call_item:()=>As,raw_block:()=>bs,raw_empty:()=>ks,raw_expression:()=>Ss,raw_table:()=>gs,text_comment:()=>ys,text_print_multiple:()=>vs,text_print_multiple_container:()=>$s,text_print_multiple_item:()=>ws,type_check:()=>Ts});var d={};n.r(d),n.d(d,{algorithm_add_path:()=>Ds,algorithm_add_school:()=>Rs,algorithm_all_books:()=>Qs,algorithm_all_books_sequence:()=>Zs,algorithm_book_scale:()=>pr,algorithm_check_feet:()=>Tr,algorithm_chick_calculate:()=>yr,algorithm_color_seclet:()=>Vr,algorithm_current_school:()=>Ys,algorithm_del_path:()=>Fs,algorithm_delete_book:()=>ar,algorithm_delete_books:()=>lr,algorithm_delete_books2:()=>ur,algorithm_divide_books:()=>rr,algorithm_find_path:()=>xs,algorithm_first_book:()=>tr,algorithm_fz_calc:()=>Er,algorithm_fz_calc_first_min:()=>Ir,algorithm_fz_compare:()=>Ar,algorithm_fz_move:()=>Mr,algorithm_fz_set_min:()=>Or,algorithm_get_book_num:()=>fr,algorithm_get_current_location:()=>Pr,algorithm_get_half_books:()=>or,algorithm_hxdb_add:()=>Lr,algorithm_hxdb_init_soldier:()=>Rr,algorithm_hxdb_last_line:()=>Nr,algorithm_hxdb_result:()=>Dr,algorithm_hxdb_stand_in_line:()=>xr,algorithm_init_fzsf:()=>wr,algorithm_init_hxdb:()=>Cr,algorithm_init_jttl:()=>br,algorithm_move_recent:()=>Hs,algorithm_new_path:()=>Ns,algorithm_next_book:()=>ir,algorithm_no_left:()=>Bs,algorithm_no_path:()=>js,algorithm_no_ring2:()=>er,algorithm_not_home:()=>qs,algorithm_not_school:()=>zs,algorithm_number_add:()=>_r,algorithm_number_zero:()=>hr,algorithm_prepare:()=>Cs,algorithm_prepare2:()=>Us,algorithm_prepare_2_1:()=>Gs,algorithm_prepare_2_2:()=>Xs,algorithm_print_book2:()=>cr,algorithm_print_divide:()=>gr,algorithm_print_jttl_answer:()=>vr,algorithm_print_number:()=>dr,algorithm_print_path:()=>Vs,algorithm_print_path2:()=>Ws,algorithm_print_sequence:()=>mr,algorithm_rabbit_add:()=>$r,algorithm_rabbit_number_in_range:()=>kr,algorithm_rabbit_zero:()=>Sr,algorithm_return_path:()=>Ps,algorithm_set_path:()=>Ls,algorithm_two_left:()=>sr,algorithm_void_path:()=>Br,algorithm_yes_ring2:()=>nr,hanoi_init:()=>Js,hanoi_init_offline:()=>Fr,hanoi_move:()=>Ks});var f={};n.r(f),n.d(f,{factory_block:()=>Kr,factory_block_return:()=>Qr,factory_block_return_with_textarea:()=>to,factory_block_with_textarea:()=>Zr,factory_callMethod_noreturn:()=>Wr,factory_callMethod_return:()=>Jr,factory_create_with_container:()=>Xr,factory_create_with_item:()=>Hr,factory_declare:()=>zr,factory_from_import:()=>Yr,factory_function_noreturn:()=>Gr,factory_function_return:()=>qr,factory_import:()=>jr});var m={};n.r(m),n.d(m,{array_create:()=>bo,array_toarray:()=>Ro,dataframe_create:()=>so,dataframe_create_from_index:()=>oo,dataframe_create_from_one_index:()=>ro,dataframe_get:()=>Oo,numpy_trig:()=>Eo,pandas_readcsv:()=>Ao,pl_axes:()=>_o,pl_bar:()=>To,pl_hist:()=>$o,pl_label:()=>go,pl_legend:()=>fo,pl_pie:()=>vo,pl_plot:()=>po,pl_plot_bar:()=>So,pl_plot_easy:()=>co,pl_plot_scatter:()=>ko,pl_plot_xy:()=>yo,pl_savefig:()=>Mo,pl_show:()=>ho,pl_subplot:()=>Io,pl_text:()=>Co,pl_ticks:()=>wo,pl_title:()=>mo,plot_axes:()=>Do,plot_bar:()=>jo,plot_hist:()=>Xo,plot_label:()=>Bo,plot_legend:()=>Fo,plot_pie:()=>Go,plot_plot:()=>No,plot_plot_bar:()=>Vo,plot_plot_easy:()=>xo,plot_plot_scatter:()=>Uo,plot_plot_xy:()=>Yo,plot_savefig:()=>zo,plot_show:()=>Lo,plot_subplot:()=>qo,plot_text:()=>Wo,plot_ticks:()=>Ho,plot_title:()=>Po,series_create:()=>no,series_create_from_index:()=>io,series_create_from_text:()=>ao,series_get_num:()=>uo,series_index_value:()=>lo});var g={};n.r(g),n.d(g,{inout_input:()=>Ko,inout_print:()=>Qo,inout_print_container:()=>ia,inout_print_end:()=>ta,inout_print_inline:()=>Zo,inout_print_item:()=>sa,inout_print_many:()=>na,inout_type_input:()=>ea});var b={};n.r(b),n.d(b,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>ka,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>Sa,IOT_EMQX_PING:()=>ga,IOT_FORMATTING:()=>fa,IOT_FORMAT_STRING:()=>ma,IOT_MIXIO_NTP:()=>ba,IOT_MIXIO_PUBLISH:()=>aa,IOT_MIXIO_SUBSCRIBE:()=>la,IOT_MIXIO_UNSUBSCRIBE:()=>ua,iot_mixio_check:()=>ha,iot_mixio_connect:()=>oa,iot_mixio_connect_only:()=>pa,iot_mixio_disconnect:()=>ca,iot_mixio_format_msg:()=>da,iot_mixio_format_topic:()=>_a,iot_mixly_key:()=>ya,iot_mixly_key_py:()=>Ta});var S={};n.r(S),n.d(S,{Panic_with_status_code:()=>Ia,base_delay:()=>$a,controls_millis:()=>wa,controls_mstimer2:()=>Oa,controls_mstimer2_start:()=>Ma,controls_mstimer2_stop:()=>Ca,reset:()=>Aa,time_localtime:()=>Ea,time_sleep:()=>Ra});var k={};n.r(k),n.d(k,{turtle_bgcolor:()=>Za,turtle_bgcolor_hex:()=>ll,turtle_bgcolor_hex_new:()=>il,turtle_circle:()=>Ja,turtle_circle_advanced:()=>Ka,turtle_clear:()=>Ga,turtle_clone:()=>nl,turtle_color:()=>ol,turtle_color_hex:()=>al,turtle_color_seclet:()=>bl,turtle_create:()=>Na,turtle_done:()=>La,turtle_exitonclick:()=>Da,turtle_fill:()=>Ha,turtle_fillcolor:()=>el,turtle_fillcolor_hex:()=>cl,turtle_fillcolor_hex_new:()=>rl,turtle_getscreen:()=>Sl,turtle_goto:()=>Ua,turtle_listen:()=>vl,turtle_move:()=>Fa,turtle_numinput:()=>_l,turtle_onclick:()=>yl,turtle_onkey:()=>kl,turtle_ontimer:()=>Tl,turtle_pencolor:()=>tl,turtle_pencolor_hex:()=>ul,turtle_pencolor_hex_new:()=>sl,turtle_penup:()=>Xa,turtle_pos_shape:()=>ja,turtle_rotate:()=>Pa,turtle_screen_delay:()=>Va,turtle_screen_savefig:()=>$l,turtle_setheading:()=>Ba,turtle_setxy:()=>Ya,turtle_shape:()=>pl,turtle_shapesize:()=>hl,turtle_size:()=>za,turtle_size_speed:()=>qa,turtle_speed:()=>Wa,turtle_textinput:()=>dl,turtle_visible:()=>Qa,turtle_write:()=>fl,turtle_write_format:()=>ml,turtle_write_format_skulpt:()=>gl});var y={};n.r(y),n.d(y,{controls_type:()=>Ol,controls_typeLists:()=>Ml,variables_change:()=>Il,variables_get:()=>wl,variables_global:()=>Al,variables_set:()=>El});var T={};n.r(T),n.d(T,{Panic_with_status_code:()=>Vl,base_setup:()=>Rl,controls_delay:()=>Bl,controls_flow_statements:()=>Pl,controls_for:()=>Ll,controls_forEach:()=>Xl,controls_for_range:()=>Dl,controls_if:()=>xl,controls_interrupts:()=>jl,controls_lambda:()=>ql,controls_main:()=>Cl,controls_millis:()=>Ul,controls_nointerrupts:()=>Gl,controls_pass:()=>Wl,controls_range:()=>Hl,controls_repeat:()=>nu,controls_repeat_ext:()=>Ql,controls_thread:()=>Jl,controls_try_finally:()=>Nl,controls_whileUntil:()=>Fl,do_while:()=>Kl,garbage_collection:()=>Zl,get_mem_alloc:()=>tu,get_mem_free:()=>eu,reset:()=>Yl,time_sleep:()=>zl});var v={};n.r(v),n.d(v,{base_map:()=>vu,math_arithmetic:()=>au,math_bit:()=>ou,math_constant:()=>su,math_constant_mp:()=>ru,math_constrain:()=>mu,math_dec:()=>pu,math_indexer_number:()=>Su,math_map:()=>fu,math_max_min:()=>_u,math_number:()=>iu,math_number_base_conversion:()=>gu,math_random:()=>du,math_random_seed:()=>bu,math_round:()=>ku,math_selfcalcu:()=>lu,math_single:()=>uu,math_to_int:()=>hu,math_trig:()=>cu,text_to_number:()=>yu,text_to_number_skulpt:()=>Tu});var w={};n.r(w),n.d(w,{ascii_to_char:()=>Au,char_to_ascii:()=>Ou,number_to_text:()=>Mu,os_system:()=>Zu,text:()=>$u,text_capital:()=>Bu,text_center:()=>Vu,text_char:()=>Eu,text_char_at:()=>xu,text_char_at2:()=>Ru,text_char_at3:()=>Ju,text_compareTo:()=>Wu,text_compare_to:()=>Du,text_encode:()=>Ku,text_equals_starts_ends:()=>Lu,text_eval:()=>Qu,text_find:()=>Uu,text_format:()=>Hu,text_format_noreturn:()=>qu,text_join:()=>Iu,text_join_seq:()=>Yu,text_length:()=>Cu,text_random_char:()=>Nu,text_replace:()=>ju,text_split:()=>Gu,text_strip:()=>Xu,text_substring:()=>Pu,text_substring2:()=>Fu,text_substring3:()=>zu,text_textarea:()=>wu});var E={};n.r(E),n.d(E,{list_many_input:()=>Sc,list_tolist:()=>Cc,list_tolist2:()=>Rc,list_trig:()=>mc,lists_2d_get_col_row_data:()=>nc,lists_2d_get_data_with_col_row:()=>ec,lists_append_extend:()=>ac,lists_change_to:()=>bc,lists_change_to_general:()=>yc,lists_clear:()=>hc,lists_create_with:()=>ic,lists_create_with2:()=>vc,lists_create_with_noreturn:()=>kc,lists_create_with_text:()=>sc,lists_create_with_text2:()=>$c,lists_del_general:()=>Tc,lists_find:()=>_c,lists_getIndex3:()=>wc,lists_getSublist3:()=>Ec,lists_get_index:()=>rc,lists_get_random_item:()=>lc,lists_get_random_sublist:()=>uc,lists_get_sublist:()=>tc,lists_insert_value:()=>cc,lists_insert_value2:()=>Ac,lists_pop:()=>fc,lists_remove_at:()=>dc,lists_remove_at2:()=>Oc,lists_reverse:()=>pc,lists_setIndex3:()=>Ic,lists_set_index:()=>oc,lists_sort:()=>gc,lists_zip:()=>Mc});var I={};n.r(I),n.d(I,{dicts_add_change_del:()=>Xc,dicts_add_or_change:()=>Fc,dicts_clear:()=>Vc,dicts_create_with:()=>xc,dicts_create_with_noreturn:()=>zc,dicts_deldict:()=>Gc,dicts_delete:()=>Pc,dicts_get:()=>Lc,dicts_get_default:()=>Dc,dicts_items:()=>Uc,dicts_keys:()=>Nc,dicts_length:()=>jc,dicts_pop:()=>Hc,dicts_setdefault:()=>qc,dicts_to_json:()=>Jc,dicts_todict:()=>Wc,dicts_update:()=>Bc,dicts_values:()=>Yc,json_to_dicts:()=>Kc});var A={};n.r(A),n.d(A,{logic_boolean:()=>np,logic_compare:()=>Qc,logic_compare_continous:()=>Zc,logic_is:()=>op,logic_is_in:()=>rp,logic_negate:()=>ep,logic_null:()=>ip,logic_operation:()=>tp,logic_tobool:()=>ap,logic_true_or_false:()=>sp});var O={};n.r(O),n.d(O,{sdcard_mount:()=>Mp,sdcard_use_spi_init:()=>Op,storage_can_write_ornot:()=>mp,storage_change_dir:()=>$p,storage_close_file:()=>bp,storage_delete_file:()=>kp,storage_file_seek:()=>vp,storage_file_tell:()=>Tp,storage_file_write:()=>hp,storage_fileopen:()=>up,storage_fileopen_new:()=>cp,storage_fileopen_new_encoding:()=>pp,storage_get_a_line:()=>fp,storage_get_contents:()=>dp,storage_get_contents_without_para:()=>_p,storage_get_current_dir:()=>wp,storage_get_file_size:()=>yp,storage_get_filename:()=>gp,storage_is_file:()=>Ap,storage_list_all_files:()=>Sp,storage_make_dir:()=>Ep,storage_open_file_with_os:()=>lp,storage_rename:()=>Ip});var M={};n.r(M),n.d(M,{procedures_callnoreturn:()=>Np,procedures_callreturn:()=>xp,procedures_defnoreturn:()=>Rp,procedures_defreturn:()=>Cp,procedures_ifreturn:()=>Lp,procedures_return:()=>Dp});var C={};n.r(C),n.d(C,{tuple_change_to:()=>Xp,tuple_create_with:()=>Fp,tuple_create_with_noreturn:()=>Wp,tuple_create_with_text2:()=>Pp,tuple_create_with_text_return:()=>Bp,tuple_del:()=>Yp,tuple_find:()=>Hp,tuple_getIndex:()=>Vp,tuple_getSublist:()=>zp,tuple_get_random_item:()=>Kp,tuple_get_sublist:()=>Jp,tuple_join:()=>jp,tuple_length:()=>Up,tuple_max:()=>Gp,tuple_totuple:()=>Qp,tuple_trig:()=>qp});var R={};n.r(R),n.d(R,{set_add_discard:()=>rh,set_clear:()=>nh,set_create_with:()=>Zp,set_create_with_text_return:()=>lh,set_length:()=>th,set_operate:()=>ih,set_operate_update:()=>sh,set_pop:()=>eh,set_sub:()=>oh,set_toset:()=>uh,set_update:()=>ah});var x={};n.r(x),n.d(x,{html_content:()=>_h,html_content_more:()=>dh,html_document:()=>ch,html_form:()=>mh,html_head_body:()=>hh,html_style:()=>fh,html_style_content:()=>gh,html_text:()=>bh,html_title:()=>ph});var N={};n.r(N),n.d(N,{attribute_access:()=>wh,function_call:()=>$h,raw_block:()=>Sh,raw_empty:()=>yh,raw_expression:()=>kh,raw_table:()=>Th,type_check:()=>vh});var L={};n.r(L),n.d(L,{algorithm_add_path:()=>Ch,algorithm_add_school:()=>Ih,algorithm_all_books:()=>zh,algorithm_all_books_sequence:()=>qh,algorithm_book_scale:()=>s_,algorithm_check_feet:()=>h_,algorithm_chick_calculate:()=>p_,algorithm_color_seclet:()=>O_,algorithm_current_school:()=>Fh,algorithm_del_path:()=>Rh,algorithm_delete_book:()=>n_,algorithm_divide_books:()=>t_,algorithm_find_path:()=>Ah,algorithm_first_book:()=>Wh,algorithm_fz_calc:()=>m_,algorithm_fz_compare:()=>g_,algorithm_fz_move:()=>S_,algorithm_fz_set_min:()=>b_,algorithm_get_current_location:()=>I_,algorithm_get_half_books:()=>e_,algorithm_hxdb_add:()=>$_,algorithm_hxdb_init_soldier:()=>y_,algorithm_hxdb_last_line:()=>v_,algorithm_hxdb_result:()=>w_,algorithm_hxdb_stand_in_line:()=>T_,algorithm_init_fzsf:()=>f_,algorithm_init_hxdb:()=>k_,algorithm_init_jttl:()=>l_,algorithm_move_recent:()=>Uh,algorithm_new_path:()=>Oh,algorithm_next_book:()=>Qh,algorithm_no_left:()=>Nh,algorithm_no_path:()=>Ph,algorithm_no_ring2:()=>Jh,algorithm_not_home:()=>Yh,algorithm_not_school:()=>jh,algorithm_number_add:()=>o_,algorithm_number_zero:()=>r_,algorithm_prepare:()=>Eh,algorithm_prepare2:()=>Dh,algorithm_prepare_2_1:()=>Bh,algorithm_prepare_2_2:()=>Vh,algorithm_print_book2:()=>i_,algorithm_print_jttl_answer:()=>__,algorithm_print_number:()=>a_,algorithm_print_path:()=>Lh,algorithm_print_path2:()=>Gh,algorithm_rabbit_add:()=>d_,algorithm_rabbit_number_in_range:()=>c_,algorithm_rabbit_zero:()=>u_,algorithm_return_path:()=>xh,algorithm_set_path:()=>Mh,algorithm_two_left:()=>Zh,algorithm_void_path:()=>A_,algorithm_yes_ring2:()=>Kh,hanoi_init:()=>Xh,hanoi_init_offline:()=>E_,hanoi_move:()=>Hh});var D={};n.r(D),n.d(D,{factory_block:()=>F_,factory_block_return:()=>P_,factory_block_return_with_textarea:()=>V_,factory_block_with_textarea:()=>B_,factory_callMethod_noreturn:()=>L_,factory_callMethod_return:()=>D_,factory_declare:()=>N_,factory_from_import:()=>M_,factory_function_noreturn:()=>R_,factory_function_return:()=>x_,factory_import:()=>C_});var F={};n.r(F),n.d(F,{array_create:()=>nd,array_toarray:()=>md,dataframe_create:()=>j_,dataframe_create_from_index:()=>G_,dataframe_create_from_one_index:()=>X_,dataframe_get:()=>_d,numpy_trig:()=>cd,pandas_readcsv:()=>hd,pl_axes:()=>J_,pl_bar:()=>od,pl_hist:()=>ld,pl_label:()=>ed,pl_legend:()=>Z_,pl_pie:()=>ad,pl_plot:()=>Q_,pl_plot_bar:()=>id,pl_plot_easy:()=>K_,pl_plot_scatter:()=>sd,pl_plot_xy:()=>rd,pl_savefig:()=>dd,pl_show:()=>W_,pl_subplot:()=>pd,pl_text:()=>fd,pl_ticks:()=>ud,pl_title:()=>td,plot_axes:()=>bd,plot_bar:()=>Id,plot_hist:()=>Od,plot_label:()=>vd,plot_legend:()=>yd,plot_pie:()=>Ad,plot_plot:()=>kd,plot_plot_bar:()=>$d,plot_plot_easy:()=>Sd,plot_plot_scatter:()=>wd,plot_plot_xy:()=>Ed,plot_savefig:()=>Rd,plot_show:()=>gd,plot_subplot:()=>Cd,plot_text:()=>xd,plot_ticks:()=>Md,plot_title:()=>Td,series_create:()=>U_,series_create_from_index:()=>Y_,series_create_from_text:()=>H_,series_get_num:()=>z_,series_index_value:()=>q_});var P={};n.r(P),n.d(P,{inout_input:()=>Nd,inout_print:()=>Ld,inout_print_end:()=>Fd,inout_print_inline:()=>Dd,inout_print_many:()=>Bd,inout_type_input:()=>Pd});var B={};n.r(B),n.d(B,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>Kd,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>Zd,IOT_EMQX_PING:()=>tf,IOT_FORMATTING:()=>Wd,IOT_FORMAT_STRING:()=>Jd,IOT_MIXIO_PUBLISH:()=>Ud,IOT_MIXIO_SUBSCRIBE:()=>Yd,IOT_MIXIO_UNSUBSCRIBE:()=>jd,iot_mixio_check:()=>Hd,iot_mixio_connect:()=>Vd,iot_mixio_connect_only:()=>Xd,iot_mixio_disconnect:()=>Gd,iot_mixio_format_msg:()=>zd,iot_mixio_format_topic:()=>qd,iot_mixly_key:()=>Qd,iot_mixly_key_py:()=>ef});var V={};n.r(V),n.d(V,{controls_end_program:()=>sf,controls_millis:()=>nf,time_localtime:()=>rf});var U={};n.r(U),n.d(U,{turtle_bgcolor:()=>wf,turtle_bgcolor_hex:()=>Of,turtle_bgcolor_hex_new:()=>Rf,turtle_circle:()=>yf,turtle_circle_advanced:()=>vf,turtle_clear:()=>ff,turtle_clone:()=>Af,turtle_color:()=>Df,turtle_color_hex:()=>Lf,turtle_color_seclet:()=>Gf,turtle_create:()=>of,turtle_done:()=>af,turtle_exitonclick:()=>lf,turtle_fill:()=>gf,turtle_fillcolor:()=>If,turtle_fillcolor_hex:()=>Cf,turtle_fillcolor_hex_new:()=>Nf,turtle_getscreen:()=>Xf,turtle_goto:()=>_f,turtle_listen:()=>Wf,turtle_move:()=>uf,turtle_numinput:()=>Vf,turtle_onclick:()=>qf,turtle_onkey:()=>Hf,turtle_ontimer:()=>zf,turtle_pencolor:()=>Ef,turtle_pencolor_hex:()=>Mf,turtle_pencolor_hex_new:()=>xf,turtle_penup:()=>mf,turtle_pos_shape:()=>df,turtle_rotate:()=>cf,turtle_screen_delay:()=>hf,turtle_screen_savefig:()=>Jf,turtle_setheading:()=>pf,turtle_setxy:()=>Tf,turtle_shape:()=>Ff,turtle_shapesize:()=>Pf,turtle_size:()=>Sf,turtle_size_speed:()=>bf,turtle_speed:()=>kf,turtle_textinput:()=>Bf,turtle_visible:()=>$f,turtle_write:()=>Uf,turtle_write_format:()=>Yf,turtle_write_format_skulpt:()=>jf});const Y=Blockly,j=Mixly,G={NAME_TYPE:"VARIABLE",allVariables:function(t){var e;if(t.getDescendants)e=t.getDescendants();else{if(!t.getAllBlocks)throw"Not Block or Workspace: "+t;e=t.getAllBlocks()}for(var n=Object.create(null),i=0;i1&&(o+=i)):n=o}else n="i";return n}},X=G,H={};H.NAME_TYPE=Y.PROCEDURE_CATEGORY_NAME,H.allProcedures=function(t){for(var e=t.getAllBlocks(!1),n=[],i=[],s=0;s{var t={23:()=>{Sk.builtinFiles={files:{"src/builtin/this.py":'s = """Gur Mra bs Clguba, ol Gvz Crgref\n\nOrnhgvshy vf orggre guna htyl.\nRkcyvpvg vf orggre guna vzcyvpvg.\nFvzcyr vf orggre guna pbzcyrk.\nPbzcyrk vf orggre guna pbzcyvpngrq.\nSyng vf orggre guna arfgrq.\nFcnefr vf orggre guna qrafr.\nErnqnovyvgl pbhagf.\nFcrpvny pnfrf nera\'g fcrpvny rabhtu gb oernx gur ehyrf.\nNygubhtu cenpgvpnyvgl orngf chevgl.\nReebef fubhyq arire cnff fvyragyl.\nHayrff rkcyvpvgyl fvyraprq.\nVa gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.\nGurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg.\nNygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh\'er Qhgpu.\nAbj vf orggre guna arire.\nNygubhtu arire vf bsgra orggre guna *evtug* abj.\nVs gur vzcyrzragngvba vf uneq gb rkcynva, vg\'f n onq vqrn.\nVs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.\nAnzrfcnprf ner bar ubaxvat terng vqrn -- yrg\'f qb zber bs gubfr!"""\n\nd = {}\nfor c in (65, 97):\n for i in range(26):\n d[chr(i+c)] = chr((i+13) % 26 + c)\n\nprint("".join([d.get(c, c) for c in s]))\n',"src/lib/abc.py":'import _sk_fail; _sk_fail._("abc")\n',"src/lib/aifc.py":'import _sk_fail; _sk_fail._("aifc")\n',"src/lib/antigravity.py":'import webbrowser\n\nwebbrowser.open("https://xkcd.com/353/")\n',"src/lib/anydbm.py":'import _sk_fail; _sk_fail._("anydbm")\n',"src/lib/ast.py":'import _sk_fail; _sk_fail._("ast")\n',"src/lib/asynchat.py":'import _sk_fail; _sk_fail._("asynchat")\n',"src/lib/asyncore.py":'import _sk_fail; _sk_fail._("asyncore")\n',"src/lib/atexit.py":'import _sk_fail; _sk_fail._("atexit")\n',"src/lib/audiodev.py":'import _sk_fail; _sk_fail._("audiodev")\n',"src/lib/base64.py":'import _sk_fail; _sk_fail._("base64")\n',"src/lib/BaseHTTPServer.py":'import _sk_fail; _sk_fail._("BaseHTTPServer")\n',"src/lib/Bastion.py":'import _sk_fail; _sk_fail._("Bastion")\n',"src/lib/bdb.py":'import _sk_fail; _sk_fail._("bdb")\n',"src/lib/binhex.py":'import _sk_fail; _sk_fail._("binhex")\n',"src/lib/bisect.py":'"""Bisection algorithms."""\n\ndef insort_right(a, x, lo=0, hi=None):\n """Insert item x in list a, and keep it sorted assuming a is sorted.\n\n If x is already in a, insert it to the right of the rightmost x.\n\n Optional args lo (default 0) and hi (default len(a)) bound the\n slice of a to be searched.\n """\n\n if lo < 0:\n raise ValueError(\'lo must be non-negative\')\n if hi is None:\n hi = len(a)\n while lo < hi:\n mid = (lo+hi)//2\n if x < a[mid]: hi = mid\n else: lo = mid+1\n a.insert(lo, x)\n\ndef bisect_right(a, x, lo=0, hi=None):\n """Return the index where to insert item x in list a, assuming a is sorted.\n\n The return value i is such that all e in a[:i] have e <= x, and all e in\n a[i:] have e > x. So if x already appears in the list, a.insert(x) will\n insert just after the rightmost x already there.\n\n Optional args lo (default 0) and hi (default len(a)) bound the\n slice of a to be searched.\n """\n\n if lo < 0:\n raise ValueError(\'lo must be non-negative\')\n if hi is None:\n hi = len(a)\n while lo < hi:\n mid = (lo+hi)//2\n if x < a[mid]: hi = mid\n else: lo = mid+1\n return lo\n\ndef insort_left(a, x, lo=0, hi=None):\n """Insert item x in list a, and keep it sorted assuming a is sorted.\n\n If x is already in a, insert it to the left of the leftmost x.\n\n Optional args lo (default 0) and hi (default len(a)) bound the\n slice of a to be searched.\n """\n\n if lo < 0:\n raise ValueError(\'lo must be non-negative\')\n if hi is None:\n hi = len(a)\n while lo < hi:\n mid = (lo+hi)//2\n if a[mid] < x: lo = mid+1\n else: hi = mid\n a.insert(lo, x)\n\n\ndef bisect_left(a, x, lo=0, hi=None):\n """Return the index where to insert item x in list a, assuming a is sorted.\n\n The return value i is such that all e in a[:i] have e < x, and all e in\n a[i:] have e >= x. So if x already appears in the list, a.insert(x) will\n insert just before the leftmost x already there.\n\n Optional args lo (default 0) and hi (default len(a)) bound the\n slice of a to be searched.\n """\n\n if lo < 0:\n raise ValueError(\'lo must be non-negative\')\n if hi is None:\n hi = len(a)\n while lo < hi:\n mid = (lo+hi)//2\n if a[mid] < x: lo = mid+1\n else: hi = mid\n return lo\n\n# Overwrite above definitions with a fast C implementation\ntry:\n from _bisect import *\nexcept ImportError:\n pass\n\n# Create aliases\nbisect = bisect_right\ninsort = insort_right\n',"src/lib/bsddb/__init__.py":'import _sk_fail; _sk_fail._("bsddb")\n',"src/lib/cgi.py":'import _sk_fail; _sk_fail._("cgi")\n',"src/lib/CGIHTTPServer.py":'import _sk_fail; _sk_fail._("CGIHTTPServer")\n',"src/lib/cgitb.py":'import _sk_fail; _sk_fail._("cgitb")\n',"src/lib/chunk.py":'import _sk_fail; _sk_fail._("chunk")\n',"src/lib/cmd.py":'import _sk_fail; _sk_fail._("cmd")\n',"src/lib/code.py":'import _sk_fail; _sk_fail._("code")\n',"src/lib/codecs.py":'import _sk_fail; _sk_fail._("codecs")\n',"src/lib/codeop.py":'import _sk_fail; _sk_fail._("codeop")\n',"src/lib/colorsys.py":'import _sk_fail; _sk_fail._("colorsys")\n',"src/lib/commands.py":'import _sk_fail; _sk_fail._("commands")\n',"src/lib/compileall.py":'import _sk_fail; _sk_fail._("compileall")\n',"src/lib/compiler/__init__.py":'import _sk_fail; _sk_fail._("compiler")\n',"src/lib/config/__init__.py":'import _sk_fail; _sk_fail._("config")\n',"src/lib/ConfigParser.py":'import _sk_fail; _sk_fail._("ConfigParser")\n',"src/lib/contextlib.py":'import _sk_fail; _sk_fail._("contextlib")\n',"src/lib/Cookie.py":'import _sk_fail; _sk_fail._("Cookie")\n',"src/lib/cookielib.py":'import _sk_fail; _sk_fail._("cookielib")\n',"src/lib/copy.py":'"""\nThis file was modified from CPython.\nCopyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,\n2011, 2012, 2013, 2014, 2015 Python Software Foundation; All Rights Reserved\n"""\nimport types\nclass Error(Exception):\n pass\nerror = Error \nclass _EmptyClass:\n pass\ntry:\n long\nexcept NameError:\n long = int\ntry:\n bytes\nexcept NameError:\n bytes = str\n\ndef check_notimplemented_state(x):\n getstate = getattr(x, "__getstate__", None)\n setstate = getattr(x, "__setstate__", None)\n initargs = getattr(x, "__getinitargs__", None)\n if getstate or setstate or initargs:\n raise NotImplementedError("Skulpt does not yet support copying with user-defined __getstate__, __setstate__ or __getinitargs__()")\n\n\ndef copy(x):\n cls = type(x)\n if callable(x):\n return x\n copier = getattr(cls, "__copy__", None)\n if copier:\n return copier(x)\n if cls in (type(None), int, float, bool, str, bytes, tuple, type, frozenset, long):\n return x\n if (cls == list) or (cls == dict) or (cls == set) or (cls == slice):\n return cls(x)\n reductor = getattr(x, "__reduce_ex__", None)\n if reductor:\n rv = reductor(4)\n else:\n reductor = getattr(x, "__reduce__", None)\n if reductor:\n rv = reductor()\n elif str(cls)[1:6] == "class":\n check_notimplemented_state(x)\n copier = _copy_inst\n return copier(x)\n else:\n raise Error("un(shallow)copyable object of type %s" % cls)\n if isinstance(rv, str):\n return x\n return _reconstruct(x, rv, 0)\n\ndef _copy_inst(x):\n if hasattr(x, \'__copy__\'):\n return x.__copy__()\n if hasattr(x, \'__getinitargs__\'):\n args = x.__getinitargs__()\n y = x.__class__(*args)\n else:\n y = _EmptyClass()\n y.__class__ = x.__class__\n if hasattr(x, \'__getstate__\'):\n state = x.__getstate__()\n else:\n state = x.__dict__\n if hasattr(y, \'__setstate__\'):\n y.__setstate__(state)\n else:\n y.__dict__.update(state)\n return y\n\nd = _deepcopy_dispatch = {}\n\ndef deepcopy(x, memo=None, _nil=[]):\n """Deep copy operation on arbitrary Python objects.\n See the module\'s __doc__ string for more info.\n """\n if memo is None:\n memo = {}\n idx = id(x)\n y = memo.get(idx, _nil)\n if y is not _nil:\n return y\n cls = type(x)\n copier = _deepcopy_dispatch.get(cls)\n if copier:\n y = copier(x, memo)\n else:\n try:\n issc = issubclass(cls, type)\n except TypeError: # cls is not a class (old Boost; see SF #502085)\n issc = 0\n if issc:\n y = _deepcopy_atomic(x, memo)\n else:\n copier = getattr(x, "__deepcopy__", None)\n if copier:\n y = copier(memo)\n else:\n reductor = getattr(x, "__reduce_ex__", None)\n if reductor:\n rv = reductor(2)\n else:\n rv = None\n reductor = getattr(x, "__reduce__", None)\n if reductor:\n rv = reductor()\n elif str(cls)[1:6] == "class":\n check_notimplemented_state(x)\n copier = _deepcopy_dispatch["InstanceType"]\n y = copier(x, memo)\n else:\n raise Error(\n "un(deep)copyable object of type %s" % cls)\n if rv is not None:\n y = _reconstruct(x, rv, 1, memo)\n memo[idx] = y\n _keep_alive(x, memo) # Make sure x lives at least as long as d\n return y\n\ndef _deepcopy_atomic(x, memo):\n return x\nd[type(None)] = _deepcopy_atomic\n# d[type(Ellipsis)] = _deepcopy_atomic\nd[type(NotImplemented)] = _deepcopy_atomic\nd[int] = _deepcopy_atomic\nd[float] = _deepcopy_atomic\nd[bool] = _deepcopy_atomic\nd[complex] = _deepcopy_atomic\nd[bytes] = _deepcopy_atomic\nd[str] = _deepcopy_atomic\n# try:\n# d[types.CodeType] = _deepcopy_atomic\n# except AttributeError:\n# pass\nd[type] = _deepcopy_atomic\n# d[types.BuiltinFunctionType] = _deepcopy_atomic\nd[types.FunctionType] = _deepcopy_atomic\n# d[weakref.ref] = _deepcopy_atomic\n\ndef _deepcopy_list(x, memo):\n y = []\n memo[id(x)] = y\n for a in x:\n y.append(deepcopy(a, memo))\n return y\nd[list] = _deepcopy_list\n\ndef _deepcopy_set(x, memo):\n result = set([]) # make empty set\n memo[id(x)] = result # register this set in the memo for loop checking\n for a in x: # go through elements of set\n result.add(deepcopy(a, memo)) # add the copied elements into the new set\n return result # return the new set\nd[set] = _deepcopy_set\n\ndef _deepcopy_frozenset(x, memo):\n result = frozenset(_deepcopy_set(x,memo)) \n memo[id(x)] = result \n return result\nd[frozenset] = _deepcopy_frozenset\n\ndef _deepcopy_tuple(x, memo):\n y = [deepcopy(a, memo) for a in x]\n # We\'re not going to put the tuple in the memo, but it\'s still important we\n # check for it, in case the tuple contains recursive mutable structures.\n try:\n return memo[id(x)]\n except KeyError:\n pass\n for k, j in zip(x, y):\n if k is not j:\n y = tuple(y)\n break\n else:\n y = x\n return y\nd[tuple] = _deepcopy_tuple\n\ndef _deepcopy_dict(x, memo):\n y = {}\n memo[id(x)] = y\n for key, value in x.items():\n y[deepcopy(key, memo)] = deepcopy(value, memo)\n return y\nd[dict] = _deepcopy_dict\n\n# def _deepcopy_method(x, memo): # Copy instance methods\n# y = type(x)(x.im_func, deepcopy(x.im_self, memo), x.im_class);\n# return y\nd[types.MethodType] = _deepcopy_atomic\n\ndef _deepcopy_inst(x, memo):\n if hasattr(x, \'__deepcopy__\'):\n return x.__deepcopy__(memo)\n if hasattr(x, \'__getinitargs__\'):\n args = x.__getinitargs__()\n args = deepcopy(args, memo)\n y = x.__class__(*args)\n else:\n y = _EmptyClass()\n y.__class__ = x.__class__\n memo[id(x)] = y\n if hasattr(x, \'__getstate__\'):\n state = x.__getstate__()\n else:\n state = x.__dict__\n state = deepcopy(state, memo)\n if hasattr(y, \'__setstate__\'):\n y.__setstate__(state)\n else:\n y.__dict__.update(state)\n return y\nd["InstanceType"] = _deepcopy_inst\n\ndef _keep_alive(x, memo):\n """Keeps a reference to the object x in the memo.\n Because we remember objects by their id, we have\n to assure that possibly temporary objects are kept\n alive by referencing them.\n We store a reference at the id of the memo, which should\n normally not be used unless someone tries to deepcopy\n the memo itself...\n """\n try:\n memo[id(memo)].append(x)\n except KeyError:\n # aha, this is the first one :-)\n memo[id(memo)]=[x]\n\ndef _reconstruct(x, info, deep, memo=None):\n if isinstance(info, str):\n return x\n assert isinstance(info, tuple)\n if memo is None:\n memo = {}\n n = len(info)\n assert n in (2, 3, 4, 5)\n callable, args = info[:2]\n if n > 2:\n state = info[2]\n else:\n state = None\n if n > 3:\n listiter = info[3]\n else:\n listiter = None\n if n > 4:\n dictiter = info[4]\n else:\n dictiter = None\n if deep:\n args = deepcopy(args, memo)\n y = callable(*args)\n memo[id(x)] = y\n\n if state is not None:\n if deep:\n state = deepcopy(state, memo)\n if hasattr(y, \'__setstate__\'):\n y.__setstate__(state)\n else:\n if isinstance(state, tuple) and len(state) == 2:\n state, slotstate = state\n else:\n slotstate = None\n if state is not None:\n y.__dict__.update(state)\n if slotstate is not None:\n for key, value in slotstate.items():\n setattr(y, key, value)\n\n if listiter is not None:\n for item in listiter:\n if deep:\n item = deepcopy(item, memo)\n y.append(item)\n if dictiter is not None:\n for key, value in dictiter:\n if deep:\n key = deepcopy(key, memo)\n value = deepcopy(value, memo)\n y[key] = value\n return y\n\ndel d\n\ndel types\n\n# Helper for instance creation without calling __init__\nclass _EmptyClass:\n pass',"src/lib/copy_reg.py":'import _sk_fail; _sk_fail._("copy_reg")\n',"src/lib/cProfile.py":'import _sk_fail; _sk_fail._("cProfile")\n',"src/lib/csv.py":'import _sk_fail; _sk_fail._("csv")\n',"src/lib/ctypes/macholib/__init__.py":'import _sk_fail; _sk_fail._("macholib")\n',"src/lib/ctypes/__init__.py":'import _sk_fail; _sk_fail._("ctypes")\n',"src/lib/curses/__init__.py":'import _sk_fail; _sk_fail._("curses")\n',"src/lib/dbhash.py":'import _sk_fail; _sk_fail._("dbhash")\n',"src/lib/decimal.py":'import _sk_fail; _sk_fail._("decimal")\n',"src/lib/difflib.py":'import _sk_fail; _sk_fail._("difflib")\n',"src/lib/dircache.py":'import _sk_fail; _sk_fail._("dircache")\n',"src/lib/dis.py":'import _sk_fail; _sk_fail._("dis")\n',"src/lib/distutils/command/__init__.py":'import _sk_fail; _sk_fail._("command")\n',"src/lib/distutils/tests/__init__.py":'import _sk_fail; _sk_fail._("tests")\n',"src/lib/distutils/__init__.py":'import _sk_fail; _sk_fail._("distutils")\n',"src/lib/doctest.py":'import _sk_fail; _sk_fail._("doctest")\n',"src/lib/DocXMLRPCServer.py":'import _sk_fail; _sk_fail._("DocXMLRPCServer")\n',"src/lib/dumbdbm.py":'import _sk_fail; _sk_fail._("dumbdbm")\n',"src/lib/dummy_thread.py":'import _sk_fail; _sk_fail._("dummy_thread")\n',"src/lib/dummy_threading.py":'import _sk_fail; _sk_fail._("dummy_threading")\n',"src/lib/email/mime/__init__.py":'import _sk_fail; _sk_fail._("mime")\n',"src/lib/email/test/data/__init__.py":'import _sk_fail; _sk_fail._("data")\n',"src/lib/email/__init__.py":'import _sk_fail; _sk_fail._("email")\n',"src/lib/encodings/__init__.py":'import _sk_fail; _sk_fail._("encodings")\n',"src/lib/filecmp.py":'import _sk_fail; _sk_fail._("filecmp")\n',"src/lib/fileinput.py":'import _sk_fail; _sk_fail._("fileinput")\n',"src/lib/fnmatch.py":'import _sk_fail; _sk_fail._("fnmatch")\n',"src/lib/formatter.py":'import _sk_fail; _sk_fail._("formatter")\n',"src/lib/fpformat.py":'import _sk_fail; _sk_fail._("fpformat")\n',"src/lib/fractions.py":'import _sk_fail; _sk_fail._("fractions")\n',"src/lib/ftplib.py":'import _sk_fail; _sk_fail._("ftplib")\n',"src/lib/genericpath.py":'import _sk_fail; _sk_fail._("genericpath")\n',"src/lib/getopt.py":'import _sk_fail; _sk_fail._("getopt")\n',"src/lib/getpass.py":'import _sk_fail; _sk_fail._("getpass")\n',"src/lib/gettext.py":'import _sk_fail; _sk_fail._("gettext")\n',"src/lib/glob.py":'import _sk_fail; _sk_fail._("glob")\n',"src/lib/gzip.py":'import _sk_fail; _sk_fail._("gzip")\n',"src/lib/hashlib.py":'import _sk_fail; _sk_fail._("hashlib")\n',"src/lib/heapq.py":'import _sk_fail; _sk_fail._("heapq")\n',"src/lib/hmac.py":'import _sk_fail; _sk_fail._("hmac")\n',"src/lib/hotshot/__init__.py":'import _sk_fail; _sk_fail._("hotshot")\n',"src/lib/htmlentitydefs.py":'import _sk_fail; _sk_fail._("htmlentitydefs")\n',"src/lib/htmllib.py":'import _sk_fail; _sk_fail._("htmllib")\n',"src/lib/HTMLParser.py":'import _sk_fail; _sk_fail._("HTMLParser")\n',"src/lib/httplib.py":'import _sk_fail; _sk_fail._("httplib")\n',"src/lib/idlelib/Icons/__init__.py":'import _sk_fail; _sk_fail._("Icons")\n',"src/lib/idlelib/__init__.py":'import _sk_fail; _sk_fail._("idlelib")\n',"src/lib/ihooks.py":'import _sk_fail; _sk_fail._("ihooks")\n',"src/lib/imaplib.py":'import _sk_fail; _sk_fail._("imaplib")\n',"src/lib/imghdr.py":'import _sk_fail; _sk_fail._("imghdr")\n',"src/lib/imputil.py":'import _sk_fail; _sk_fail._("imputil")\n',"src/lib/io.py":'import _sk_fail; _sk_fail._("io")\n',"src/lib/lib-dynload/__init__.py":'import _sk_fail; _sk_fail._("lib-dynload")\n',"src/lib/lib-tk/__init__.py":'import _sk_fail; _sk_fail._("lib-tk")\n',"src/lib/lib2to3/fixes/__init__.py":'import _sk_fail; _sk_fail._("fixes")\n',"src/lib/lib2to3/pgen2/__init__.py":'import _sk_fail; _sk_fail._("pgen2")\n',"src/lib/lib2to3/tests/__init__.py":'import _sk_fail; _sk_fail._("tests")\n',"src/lib/lib2to3/__init__.py":'import _sk_fail; _sk_fail._("lib2to3")\n',"src/lib/linecache.py":'import _sk_fail; _sk_fail._("linecache")\n',"src/lib/locale.py":'import _sk_fail; _sk_fail._("locale")\n',"src/lib/logging/__init__.py":'import _sk_fail; _sk_fail._("logging")\n',"src/lib/macpath.py":'import _sk_fail; _sk_fail._("macpath")\n',"src/lib/macurl2path.py":'import _sk_fail; _sk_fail._("macurl2path")\n',"src/lib/mailbox.py":'import _sk_fail; _sk_fail._("mailbox")\n',"src/lib/mailcap.py":'import _sk_fail; _sk_fail._("mailcap")\n',"src/lib/markupbase.py":'import _sk_fail; _sk_fail._("markupbase")\n',"src/lib/md5.py":'import _sk_fail; _sk_fail._("md5")\n',"src/lib/mhlib.py":'import _sk_fail; _sk_fail._("mhlib")\n',"src/lib/mimetools.py":'import _sk_fail; _sk_fail._("mimetools")\n',"src/lib/mimetypes.py":'import _sk_fail; _sk_fail._("mimetypes")\n',"src/lib/MimeWriter.py":'import _sk_fail; _sk_fail._("MimeWriter")\n',"src/lib/mimify.py":'import _sk_fail; _sk_fail._("mimify")\n',"src/lib/modulefinder.py":'import _sk_fail; _sk_fail._("modulefinder")\n',"src/lib/multifile.py":'import _sk_fail; _sk_fail._("multifile")\n',"src/lib/multiprocessing/dummy/__init__.py":'import _sk_fail; _sk_fail._("dummy")\n',"src/lib/multiprocessing/__init__.py":'import _sk_fail; _sk_fail._("multiprocessing")\n',"src/lib/mutex.py":'import _sk_fail; _sk_fail._("mutex")\n',"src/lib/netrc.py":'import _sk_fail; _sk_fail._("netrc")\n',"src/lib/new.py":'import _sk_fail; _sk_fail._("new")\n',"src/lib/nntplib.py":'import _sk_fail; _sk_fail._("nntplib")\n',"src/lib/ntpath.py":'import _sk_fail; _sk_fail._("ntpath")\n',"src/lib/nturl2path.py":'import _sk_fail; _sk_fail._("nturl2path")\n',"src/lib/numbers.py":"Number = (int, float, complex)\nIntegral = int\nComplex = complex\n","src/lib/opcode.py":'import _sk_fail; _sk_fail._("opcode")\n',"src/lib/optparse.py":'import _sk_fail; _sk_fail._("optparse")\n',"src/lib/os.py":'import _sk_fail; _sk_fail._("os")\n',"src/lib/os2emxpath.py":'import _sk_fail; _sk_fail._("os2emxpath")\n',"src/lib/pdb.py":'import _sk_fail; _sk_fail._("pdb")\n',"src/lib/pickle.py":'import _sk_fail; _sk_fail._("pickle")\n',"src/lib/pickletools.py":'import _sk_fail; _sk_fail._("pickletools")\n',"src/lib/pipes.py":'import _sk_fail; _sk_fail._("pipes")\n',"src/lib/pkgutil.py":'import _sk_fail; _sk_fail._("pkgutil")\n',"src/lib/platform.py":'import _sk_fail; _sk_fail._("platform")\n',"src/lib/plistlib.py":'import _sk_fail; _sk_fail._("plistlib")\n',"src/lib/popen2.py":'import _sk_fail; _sk_fail._("popen2")\n',"src/lib/poplib.py":'import _sk_fail; _sk_fail._("poplib")\n',"src/lib/posixfile.py":'import _sk_fail; _sk_fail._("posixfile")\n',"src/lib/posixpath.py":'import _sk_fail; _sk_fail._("posixpath")\n',"src/lib/pprint.py":'import _sk_fail; _sk_fail._("pprint")\n',"src/lib/profile.py":'import _sk_fail; _sk_fail._("profile")\n',"src/lib/pstats.py":'import _sk_fail; _sk_fail._("pstats")\n',"src/lib/pty.py":'import _sk_fail; _sk_fail._("pty")\n',"src/lib/pyclbr.py":'import _sk_fail; _sk_fail._("pyclbr")\n',"src/lib/pydoc.py":'import _sk_fail; _sk_fail._("pydoc")\n',"src/lib/pydoc_topics.py":'import _sk_fail; _sk_fail._("pydoc_topics")\n',"src/lib/pythonds/basic/deque.py":"# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005\n# \n#deque.py\n\n\nclass Deque:\n def __init__(self):\n self.items = []\n\n def isEmpty(self):\n return self.items == []\n\n def addFront(self, item):\n self.items.append(item)\n\n def addRear(self, item):\n self.items.insert(0,item)\n\n def removeFront(self):\n return self.items.pop()\n\n def removeRear(self):\n return self.items.pop(0)\n\n def size(self):\n return len(self.items)\n","src/lib/pythonds/basic/queue.py":"# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005\n# \n#queue.py\n\nclass Queue:\n def __init__(self):\n self.items = []\n\n def isEmpty(self):\n return self.items == []\n\n def enqueue(self, item):\n self.items.insert(0,item)\n\n def dequeue(self):\n return self.items.pop()\n\n def size(self):\n return len(self.items)\n","src/lib/pythonds/basic/stack.py":"# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005\n# \n#stack.py\n\nclass Stack:\n def __init__(self):\n self.items = []\n\n def isEmpty(self):\n return self.items == []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n return self.items.pop()\n\n def peek(self):\n return self.items[len(self.items)-1]\n\n def size(self):\n return len(self.items)\n\n","src/lib/pythonds/basic/__init__.py":'\n#__all__ = ["stack"]\n\n\n#from .stack import Stack\n#from .queue import Queue\n\n\n\n',"src/lib/pythonds/graphs/adjGraph.py":'#\n# adjGraph\n#\n# Created by Brad Miller on 2005-02-24.\n# Copyright (c) 2005 Brad Miller, David Ranum, Luther College. All rights reserved.\n#\n\nimport sys\nimport os\nimport unittest\n\nclass Graph:\n def __init__(self):\n self.vertices = {}\n self.numVertices = 0\n \n def addVertex(self,key):\n self.numVertices = self.numVertices + 1\n newVertex = Vertex(key)\n self.vertices[key] = newVertex\n return newVertex\n \n def getVertex(self,n):\n if n in self.vertices:\n return self.vertices[n]\n else:\n return None\n\n def __contains__(self,n):\n return n in self.vertices\n \n def addEdge(self,f,t,cost=0):\n if f not in self.vertices:\n nv = self.addVertex(f)\n if t not in self.vertices:\n nv = self.addVertex(t)\n self.vertices[f].addNeighbor(self.vertices[t],cost)\n \n def getVertices(self):\n return list(self.vertices.keys())\n \n def __iter__(self):\n return iter(self.vertices.values())\n \nclass Vertex:\n def __init__(self,num):\n self.id = num\n self.connectedTo = {}\n self.color = \'white\'\n self.dist = sys.maxsize\n self.pred = None\n self.disc = 0\n self.fin = 0\n\n # def __lt__(self,o):\n # return self.id < o.id\n \n def addNeighbor(self,nbr,weight=0):\n self.connectedTo[nbr] = weight\n \n def setColor(self,color):\n self.color = color\n \n def setDistance(self,d):\n self.dist = d\n\n def setPred(self,p):\n self.pred = p\n\n def setDiscovery(self,dtime):\n self.disc = dtime\n \n def setFinish(self,ftime):\n self.fin = ftime\n \n def getFinish(self):\n return self.fin\n \n def getDiscovery(self):\n return self.disc\n \n def getPred(self):\n return self.pred\n \n def getDistance(self):\n return self.dist\n \n def getColor(self):\n return self.color\n \n def getConnections(self):\n return self.connectedTo.keys()\n \n def getWeight(self,nbr):\n return self.connectedTo[nbr]\n \n def __str__(self):\n return str(self.id) + ":color " + self.color + ":disc " + str(self.disc) + ":fin " + str(self.fin) + ":dist " + str(self.dist) + ":pred \\n\\t[" + str(self.pred)+ "]\\n"\n \n def getId(self):\n return self.id\n\nclass adjGraphTests(unittest.TestCase):\n def setUp(self):\n self.tGraph = Graph()\n \n def testMakeGraph(self):\n gFile = open("test.dat")\n for line in gFile:\n fVertex, tVertex = line.split(\'|\')\n fVertex = int(fVertex)\n tVertex = int(tVertex)\n self.tGraph.addEdge(fVertex,tVertex)\n for i in self.tGraph:\n adj = i.getAdj()\n for k in adj:\n print(i, k)\n\n \nif __name__ == \'__main__\':\n unittest.main()\n \n',"src/lib/pythonds/graphs/priorityQueue.py":"# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005\n# \nimport unittest\n\n# this implementation of binary heap takes key value pairs,\n# we will assume that the keys are all comparable\n\nclass PriorityQueue:\n def __init__(self):\n self.heapArray = [(0,0)]\n self.currentSize = 0\n\n def buildHeap(self,alist):\n self.currentSize = len(alist)\n self.heapArray = [(0,0)]\n for i in alist:\n self.heapArray.append(i)\n i = len(alist) // 2 \n while (i > 0):\n self.percDown(i)\n i = i - 1\n \n def percDown(self,i):\n while (i * 2) <= self.currentSize:\n mc = self.minChild(i)\n if self.heapArray[i][0] > self.heapArray[mc][0]:\n tmp = self.heapArray[i]\n self.heapArray[i] = self.heapArray[mc]\n self.heapArray[mc] = tmp\n i = mc\n \n def minChild(self,i):\n if i*2 > self.currentSize:\n return -1\n else:\n if i*2 + 1 > self.currentSize:\n return i*2\n else:\n if self.heapArray[i*2][0] < self.heapArray[i*2+1][0]:\n return i*2\n else:\n return i*2+1\n\n def percUp(self,i):\n while i // 2 > 0:\n if self.heapArray[i][0] < self.heapArray[i//2][0]:\n tmp = self.heapArray[i//2]\n self.heapArray[i//2] = self.heapArray[i]\n self.heapArray[i] = tmp\n i = i//2\n \n def add(self,k):\n self.heapArray.append(k)\n self.currentSize = self.currentSize + 1\n self.percUp(self.currentSize)\n\n def delMin(self):\n retval = self.heapArray[1][1]\n self.heapArray[1] = self.heapArray[self.currentSize]\n self.currentSize = self.currentSize - 1\n self.heapArray.pop()\n self.percDown(1)\n return retval\n \n def isEmpty(self):\n if self.currentSize == 0:\n return True\n else:\n return False\n\n def decreaseKey(self,val,amt):\n # this is a little wierd, but we need to find the heap thing to decrease by\n # looking at its value\n done = False\n i = 1\n myKey = 0\n while not done and i <= self.currentSize:\n if self.heapArray[i][1] == val:\n done = True\n myKey = i\n else:\n i = i + 1\n if myKey > 0:\n self.heapArray[myKey] = (amt,self.heapArray[myKey][1])\n self.percUp(myKey)\n \n def __contains__(self,vtx):\n for pair in self.heapArray:\n if pair[1] == vtx:\n return True\n return False\n \nclass TestBinHeap(unittest.TestCase):\n def setUp(self):\n self.theHeap = PriorityQueue()\n self.theHeap.add((2,'x'))\n self.theHeap.add((3,'y'))\n self.theHeap.add((5,'z'))\n self.theHeap.add((6,'a'))\n self.theHeap.add((4,'d'))\n\n\n def testInsert(self):\n assert self.theHeap.currentSize == 5\n\n def testDelmin(self):\n assert self.theHeap.delMin() == 'x'\n assert self.theHeap.delMin() == 'y'\n \n def testDecKey(self):\n self.theHeap.decreaseKey('d',1)\n assert self.theHeap.delMin() == 'd'\n \nif __name__ == '__main__':\n unittest.main()\n","src/lib/pythonds/graphs/__init__.py":"\n\nfrom .adjGraph import Graph\nfrom .adjGraph import Vertex\nfrom .priorityQueue import PriorityQueue\n","src/lib/pythonds/trees/balance.py":"#!/bin/env python3.1\n# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005, 2010\n# \n\nfrom .bst import BinarySearchTree, TreeNode\n\nclass AVLTree(BinarySearchTree):\n '''\n Author: Brad Miller\n Date: 1/15/2005\n Description: Imlement a binary search tree with the following interface\n functions: \n __contains__(y) <==> y in x\n __getitem__(y) <==> x[y]\n __init__()\n __len__() <==> len(x)\n __setitem__(k,v) <==> x[k] = v\n clear()\n get(k)\n has_key(k)\n items() \n keys() \n values()\n put(k,v)\n '''\n\n\n def _put(self,key,val,currentNode):\n if key < currentNode.key:\n if currentNode.hasLeftChild():\n self._put(key,val,currentNode.leftChild)\n else:\n currentNode.leftChild = TreeNode(key,val,parent=currentNode)\n self.updateBalance(currentNode.leftChild)\n else:\n if currentNode.hasRightChild():\n self._put(key,val,currentNode.rightChild)\n else:\n currentNode.rightChild = TreeNode(key,val,parent=currentNode)\n self.updateBalance(currentNode.rightChild) \n\n def updateBalance(self,node):\n if node.balanceFactor > 1 or node.balanceFactor < -1:\n self.rebalance(node)\n return\n if node.parent != None:\n if node.isLeftChild():\n node.parent.balanceFactor += 1\n elif node.isRightChild():\n node.parent.balanceFactor -= 1\n\n if node.parent.balanceFactor != 0:\n self.updateBalance(node.parent)\n\n def rebalance(self,node):\n if node.balanceFactor < 0:\n if node.rightChild.balanceFactor > 0:\n # Do an LR Rotation\n self.rotateRight(node.rightChild)\n self.rotateLeft(node)\n else:\n # single left\n self.rotateLeft(node)\n elif node.balanceFactor > 0:\n if node.leftChild.balanceFactor < 0:\n # Do an RL Rotation\n self.rotateLeft(node.leftChild)\n self.rotateRight(node)\n else:\n # single right\n self.rotateRight(node)\n\n def rotateLeft(self,rotRoot):\n newRoot = rotRoot.rightChild\n rotRoot.rightChild = newRoot.leftChild\n if newRoot.leftChild != None:\n newRoot.leftChild.parent = rotRoot\n newRoot.parent = rotRoot.parent\n if rotRoot.isRoot():\n self.root = newRoot\n else:\n if rotRoot.isLeftChild():\n rotRoot.parent.leftChild = newRoot\n else:\n rotRoot.parent.rightChild = newRoot\n newRoot.leftChild = rotRoot\n rotRoot.parent = newRoot\n rotRoot.balanceFactor = rotRoot.balanceFactor + 1 - min(newRoot.balanceFactor, 0)\n newRoot.balanceFactor = newRoot.balanceFactor + 1 + max(rotRoot.balanceFactor, 0)\n\n\n def rotateRight(self,rotRoot):\n newRoot = rotRoot.leftChild\n rotRoot.leftChild = newRoot.rightChild\n if newRoot.rightChild != None:\n newRoot.rightChild.parent = rotRoot\n newRoot.parent = rotRoot.parent\n if rotRoot.isRoot():\n self.root = newRoot\n else:\n if rotRoot.isRightChild():\n rotRoot.parent.rightChild = newRoot\n else:\n rotRoot.parent.leftChild = newRoot\n newRoot.rightChild = rotRoot\n rotRoot.parent = newRoot\n rotRoot.balanceFactor = rotRoot.balanceFactor - 1 - max(newRoot.balanceFactor, 0)\n newRoot.balanceFactor = newRoot.balanceFactor - 1 + min(rotRoot.balanceFactor, 0)\n \n","src/lib/pythonds/trees/binaryTree.py":"# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005\n# \n\nclass BinaryTree:\n \"\"\"\n A recursive implementation of Binary Tree\n Using links and Nodes approach.\n \"\"\" \n def __init__(self,rootObj):\n self.key = rootObj\n self.leftChild = None\n self.rightChild = None\n\n def insertLeft(self,newNode):\n if self.leftChild == None:\n self.leftChild = BinaryTree(newNode)\n else:\n t = BinaryTree(newNode)\n t.left = self.leftChild\n self.leftChild = t\n \n def insertRight(self,newNode):\n if self.rightChild == None:\n self.rightChild = BinaryTree(newNode)\n else:\n t = BinaryTree(newNode)\n t.right = self.rightChild\n self.rightChild = t\n\n def isLeaf(self):\n return ((not self.leftChild) and (not self.rightChild))\n\n def getRightChild(self):\n return self.rightChild\n\n def getLeftChild(self):\n return self.leftChild\n\n def setRootVal(self,obj):\n self.key = obj\n\n def getRootVal(self,):\n return self.key\n\n def inorder(self):\n if self.leftChild:\n self.leftChild.inorder()\n print(self.key)\n if self.rightChild:\n self.rightChild.inorder()\n\n def postorder(self):\n if self.leftChild:\n self.leftChild.postorder()\n if self.rightChild:\n self.rightChild.postorder()\n print(self.key)\n\n\n def preorder(self):\n print(self.key)\n if self.leftChild:\n self.leftChild.preorder()\n if self.rightChild:\n self.rightChild.preorder()\n\n def printexp(self):\n if self.leftChild:\n print('(')\n self.leftChild.printexp()\n print(self.key)\n if self.rightChild:\n self.rightChild.printexp()\n print(')')\n\n def postordereval(self):\n opers = {'+':operator.add, '-':operator.sub, '*':operator.mul, '/':operator.truediv}\n res1 = None\n res2 = None\n if self.leftChild:\n res1 = self.leftChild.postordereval() #// \\label{peleft}\n if self.rightChild:\n res2 = self.rightChild.postordereval() #// \\label{peright}\n if res1 and res2:\n return opers[self.key](res1,res2) #// \\label{peeval}\n else:\n return self.key\n\ndef inorder(tree):\n if tree != None:\n inorder(tree.getLeftChild())\n print(tree.getRootVal())\n inorder(tree.getRightChild())\n\ndef printexp(tree):\n if tree.leftChild:\n print('(')\n printexp(tree.getLeftChild())\n print(tree.getRootVal())\n if tree.rightChild:\n printexp(tree.getRightChild())\n print(')') \n\ndef printexp(tree):\n sVal = \"\"\n if tree:\n sVal = '(' + printexp(tree.getLeftChild())\n sVal = sVal + str(tree.getRootVal())\n sVal = sVal + printexp(tree.getRightChild()) + ')'\n return sVal\n\ndef postordereval(tree):\n opers = {'+':operator.add, '-':operator.sub, '*':operator.mul, '/':operator.truediv}\n res1 = None\n res2 = None\n if tree:\n res1 = postordereval(tree.getLeftChild()) #// \\label{peleft}\n res2 = postordereval(tree.getRightChild()) #// \\label{peright}\n if res1 and res2:\n return opers[tree.getRootVal()](res1,res2) #// \\label{peeval}\n else:\n return tree.getRootVal()\n\ndef height(tree):\n if tree == None:\n return -1\n else:\n return 1 + max(height(tree.leftChild),height(tree.rightChild))\n\n# t = BinaryTree(7)\n# t.insertLeft(3)\n# t.insertRight(9)\n# inorder(t)\n# import operator\n# x = BinaryTree('*')\n# x.insertLeft('+')\n# l = x.getLeftChild()\n# l.insertLeft(4)\n# l.insertRight(5)\n# x.insertRight(7)\n# print(printexp(x))\n# print(postordereval(x))\n# print(height(x))\n","src/lib/pythonds/trees/binheap.py":"# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005\n# \n\n# this heap takes key value pairs, we will assume that the keys are integers\nclass BinHeap:\n def __init__(self):\n self.heapList = [0]\n self.currentSize = 0\n\n\n def buildHeap(self,alist):\n i = len(alist) // 2\n self.currentSize = len(alist)\n self.heapList = [0] + alist[:]\n print(len(self.heapList), i)\n while (i > 0):\n print(self.heapList, i)\n self.percDown(i)\n i = i - 1\n print(self.heapList,i)\n \n def percDown(self,i):\n while (i * 2) <= self.currentSize:\n mc = self.minChild(i)\n if self.heapList[i] > self.heapList[mc]:\n tmp = self.heapList[i]\n self.heapList[i] = self.heapList[mc]\n self.heapList[mc] = tmp\n i = mc\n \n def minChild(self,i):\n if i * 2 + 1 > self.currentSize:\n return i * 2\n else:\n if self.heapList[i * 2] < self.heapList[i * 2 + 1]:\n return i * 2\n else:\n return i * 2 + 1\n\n def percUp(self,i):\n while i // 2 > 0:\n if self.heapList[i] < self.heapList[i//2]:\n tmp = self.heapList[i // 2]\n self.heapList[i // 2] = self.heapList[i]\n self.heapList[i] = tmp\n i = i // 2\n \n def insert(self,k):\n self.heapList.append(k)\n self.currentSize = self.currentSize + 1\n self.percUp(self.currentSize)\n\n def delMin(self):\n retval = self.heapList[1]\n self.heapList[1] = self.heapList[self.currentSize]\n self.currentSize = self.currentSize - 1\n self.heapList.pop()\n self.percDown(1)\n return retval\n \n def isEmpty(self):\n if currentSize == 0:\n return True\n else:\n return False\n","src/lib/pythonds/trees/bst.py":"#!/bin/env python3.1\n# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005, 2010\n# \n\nclass BinarySearchTree:\n '''\n Author: Brad Miller\n Date: 1/15/2005\n Description: Imlement a binary search tree with the following interface\n functions: \n __contains__(y) <==> y in x\n __getitem__(y) <==> x[y]\n __init__()\n __len__() <==> len(x)\n __setitem__(k,v) <==> x[k] = v\n clear()\n get(k)\n items() \n keys() \n values()\n put(k,v)\n in\n del <==> \n '''\n\n def __init__(self):\n self.root = None\n self.size = 0\n \n def put(self,key,val):\n if self.root:\n self._put(key,val,self.root)\n else:\n self.root = TreeNode(key,val)\n self.size = self.size + 1\n\n def _put(self,key,val,currentNode):\n if key < currentNode.key:\n if currentNode.hasLeftChild():\n self._put(key,val,currentNode.leftChild)\n else:\n currentNode.leftChild = TreeNode(key,val,parent=currentNode)\n else:\n if currentNode.hasRightChild():\n self._put(key,val,currentNode.rightChild)\n else:\n currentNode.rightChild = TreeNode(key,val,parent=currentNode)\n \n def __setitem__(self,k,v):\n self.put(k,v)\n\n def get(self,key):\n if self.root:\n res = self._get(key,self.root)\n if res:\n return res.payload\n else:\n return None\n else:\n return None\n \n def _get(self,key,currentNode):\n if not currentNode:\n return None\n elif currentNode.key == key:\n return currentNode\n elif key < currentNode.key:\n return self._get(key,currentNode.leftChild)\n else:\n return self._get(key,currentNode.rightChild)\n \n \n def __getitem__(self,key):\n res = self.get(key)\n if res:\n return res\n else:\n raise KeyError('Error, key not in tree')\n \n\n def __contains__(self,key):\n if self._get(key,self.root):\n return True\n else:\n return False\n \n def length(self):\n return self.size\n\n def __len__(self):\n return self.size\n\n def __iter__(self):\n return self.root.__iter__()\n \n def delete(self,key):\n if self.size > 1:\n nodeToRemove = self._get(key,self.root)\n if nodeToRemove:\n self.remove(nodeToRemove)\n self.size = self.size-1\n else:\n raise KeyError('Error, key not in tree')\n elif self.size == 1 and self.root.key == key:\n self.root = None\n self.size = self.size - 1\n else:\n raise KeyError('Error, key not in tree')\n\n def __delitem__(self,key):\n self.delete(key)\n \n def remove(self,currentNode):\n if currentNode.isLeaf(): #leaf\n if currentNode == currentNode.parent.leftChild:\n currentNode.parent.leftChild = None\n else:\n currentNode.parent.rightChild = None\n elif currentNode.hasBothChildren(): #interior\n succ = currentNode.findSuccessor()\n succ.spliceOut()\n currentNode.key = succ.key\n currentNode.payload = succ.payload\n else: # this node has one child\n if currentNode.hasLeftChild():\n if currentNode.isLeftChild():\n currentNode.leftChild.parent = currentNode.parent\n currentNode.parent.leftChild = currentNode.leftChild\n elif currentNode.isRightChild():\n currentNode.leftChild.parent = currentNode.parent\n currentNode.parent.rightChild = currentNode.leftChild\n else:\n currentNode.replaceNodeData(currentNode.leftChild.key,\n currentNode.leftChild.payload,\n currentNode.leftChild.leftChild,\n currentNode.leftChild.rightChild)\n else:\n if currentNode.isLeftChild():\n currentNode.rightChild.parent = currentNode.parent\n currentNode.parent.leftChild = currentNode.rightChild\n elif currentNode.isRightChild():\n currentNode.rightChild.parent = currentNode.parent\n currentNode.parent.rightChild = currentNode.rightChild\n else:\n currentNode.replaceNodeData(currentNode.rightChild.key,\n currentNode.rightChild.payload,\n currentNode.rightChild.leftChild,\n currentNode.rightChild.rightChild)\n\n def inorder(self):\n self._inorder(self.root)\n\n def _inorder(self,tree):\n if tree != None:\n self._inorder(tree.leftChild)\n print(tree.key)\n self._inorder(tree.rightChild)\n\n def postorder(self):\n self._postorder(self.root)\n\n def _postorder(self, tree):\n if tree:\n self._postorder(tree.rightChild)\n self._postorder(tree.leftChild)\n print(tree.key) \n\n def preorder(self):\n self._preorder(self,self.root)\n\n def _preorder(self,tree):\n if tree:\n print(tree.key) \n self._preorder(tree.leftChild)\n self._preorder(tree.rightChild)\n\n \nclass TreeNode:\n def __init__(self,key,val,left=None,right=None,parent=None):\n self.key = key\n self.payload = val\n self.leftChild = left\n self.rightChild = right\n self.parent = parent\n self.balanceFactor = 0\n \n def hasLeftChild(self):\n return self.leftChild\n\n def hasRightChild(self):\n return self.rightChild\n \n def isLeftChild(self):\n return self.parent and self.parent.leftChild == self\n\n def isRightChild(self):\n return self.parent and self.parent.rightChild == self\n\n def isRoot(self):\n return not self.parent\n\n def isLeaf(self):\n return not (self.rightChild or self.leftChild)\n\n def hasAnyChildren(self):\n return self.rightChild or self.leftChild\n\n def hasBothChildren(self):\n return self.rightChild and self.leftChild\n \n def replaceNodeData(self,key,value,lc,rc):\n self.key = key\n self.payload = value\n self.leftChild = lc\n self.rightChild = rc\n if self.hasLeftChild():\n self.leftChild.parent = self\n if self.hasRightChild():\n self.rightChild.parent = self\n \n def findSuccessor(self):\n succ = None\n if self.hasRightChild():\n succ = self.rightChild.findMin()\n else:\n if self.parent:\n if self.isLeftChild():\n succ = self.parent\n else:\n self.parent.rightChild = None\n succ = self.parent.findSuccessor()\n self.parent.rightChild = self\n return succ\n\n\n def spliceOut(self):\n if self.isLeaf():\n if self.isLeftChild():\n self.parent.leftChild = None\n else:\n self.parent.rightChild = None\n elif self.hasAnyChildren():\n if self.hasLeftChild():\n if self.isLeftChild():\n self.parent.leftChild = self.leftChild\n else:\n self.parent.rightChild = self.leftChild\n self.leftChild.parent = self.parent\n else:\n if self.isLeftChild():\n self.parent.leftChild = self.rightChild\n else:\n self.parent.rightChild = self.rightChild\n self.rightChild.parent = self.parent\n\n def findMin(self):\n current = self\n while current.hasLeftChild():\n current = current.leftChild\n return current\n\n def __iter__(self):\n \"\"\"The standard inorder traversal of a binary tree.\"\"\"\n if self:\n if self.hasLeftChild():\n for elem in self.leftChild:\n yield elem\n yield self.key\n if self.hasRightChild():\n for elem in self.rightChild:\n yield elem\n\n \n","src/lib/pythonds/trees/__init__.py":"\n# from .binaryTree import BinaryTree\n# from .balance import AVLTree\n# from .bst import BinarySearchTree\n# from .binheap import BinHeap\n\n\n","src/lib/pythonds/__init__.py":"","src/lib/py_compile.py":'import _sk_fail; _sk_fail._("py_compile")\n',"src/lib/Queue.py":'import _sk_fail; _sk_fail._("Queue")\n',"src/lib/quopri.py":'import _sk_fail; _sk_fail._("quopri")\n',"src/lib/repr.py":'import _sk_fail; _sk_fail._("repr")\n',"src/lib/rexec.py":'import _sk_fail; _sk_fail._("rexec")\n',"src/lib/rfc822.py":'import _sk_fail; _sk_fail._("rfc822")\n',"src/lib/rlcompleter.py":'import _sk_fail; _sk_fail._("rlcompleter")\n',"src/lib/robotparser.py":'import _sk_fail; _sk_fail._("robotparser")\n',"src/lib/runpy.py":'import _sk_fail; _sk_fail._("runpy")\n',"src/lib/sched.py":'import _sk_fail; _sk_fail._("sched")\n',"src/lib/sets.py":'import _sk_fail; _sk_fail._("sets")\n',"src/lib/sgmllib.py":'import _sk_fail; _sk_fail._("sgmllib")\n',"src/lib/sha.py":'import _sk_fail; _sk_fail._("sha")\n',"src/lib/shelve.py":'import _sk_fail; _sk_fail._("shelve")\n',"src/lib/shlex.py":'import _sk_fail; _sk_fail._("shlex")\n',"src/lib/shutil.py":'import _sk_fail; _sk_fail._("shutil")\n',"src/lib/SimpleHTTPServer.py":'import _sk_fail; _sk_fail._("SimpleHTTPServer")\n',"src/lib/SimpleXMLRPCServer.py":'import _sk_fail; _sk_fail._("SimpleXMLRPCServer")\n',"src/lib/site.py":'import _sk_fail; _sk_fail._("site")\n',"src/lib/smtpd.py":'import _sk_fail; _sk_fail._("smtpd")\n',"src/lib/smtplib.py":'import _sk_fail; _sk_fail._("smtplib")\n',"src/lib/sndhdr.py":'import _sk_fail; _sk_fail._("sndhdr")\n',"src/lib/socket.py":'import _sk_fail; _sk_fail._("socket")\n',"src/lib/SocketServer.py":'import _sk_fail; _sk_fail._("SocketServer")\n',"src/lib/sqlite3/__init__.py":'import _sk_fail; _sk_fail._("sqlite3")\n',"src/lib/sre.py":'import _sk_fail; _sk_fail._("sre")\n',"src/lib/sre_compile.py":'import _sk_fail; _sk_fail._("sre_compile")\n',"src/lib/sre_constants.py":'import _sk_fail; _sk_fail._("sre_constants")\n',"src/lib/sre_parse.py":'import _sk_fail; _sk_fail._("sre_parse")\n',"src/lib/ssl.py":'import _sk_fail; _sk_fail._("ssl")\n',"src/lib/stat.py":'import _sk_fail; _sk_fail._("stat")\n',"src/lib/statvfs.py":'import _sk_fail; _sk_fail._("statvfs")\n',"src/lib/StringIO.py":'r"""File-like objects that read from or write to a string buffer.\n\nThis implements (nearly) all stdio methods.\n\nf = StringIO() # ready for writing\nf = StringIO(buf) # ready for reading\nf.close() # explicitly release resources held\nflag = f.isatty() # always false\npos = f.tell() # get current position\nf.seek(pos) # set current position\nf.seek(pos, mode) # mode 0: absolute; 1: relative; 2: relative to EOF\nbuf = f.read() # read until EOF\nbuf = f.read(n) # read up to n bytes\nbuf = f.readline() # read until end of line (\'\\n\') or EOF\nlist = f.readlines()# list of f.readline() results until EOF\nf.truncate([size]) # truncate file at to at most size (default: current pos)\nf.write(buf) # write at current position\nf.writelines(list) # for line in list: f.write(line)\nf.getvalue() # return whole file\'s contents as a string\n\nNotes:\n- Using a real file is often faster (but less convenient).\n- There\'s also a much faster implementation in C, called cStringIO, but\n it\'s not subclassable.\n- fileno() is left unimplemented so that code which uses it triggers\n an exception early.\n- Seeking far beyond EOF and then writing will insert real null\n bytes that occupy space in the buffer.\n- There\'s a simple test set (see end of this file).\n"""\n\n__all__ = ["StringIO"]\n\ndef _complain_ifclosed(closed):\n if closed:\n raise ValueError("I/O operation on closed file")\n\nclass StringIO:\n """class StringIO([buffer])\n\n When a StringIO object is created, it can be initialized to an existing\n string by passing the string to the constructor. If no string is given,\n the StringIO will start empty.\n\n The StringIO object can accept either Unicode or 8-bit strings, but\n mixing the two may take some care. If both are used, 8-bit strings that\n cannot be interpreted as 7-bit ASCII (that use the 8th bit) will cause\n a UnicodeError to be raised when getvalue() is called.\n """\n def __init__(self, buf = \'\'):\n # Force self.buf to be a string or unicode\n if not isinstance(buf, str):\n buf = str(buf)\n self.buf = buf\n self.len = len(buf)\n self.buflist = []\n self.pos = 0\n self.closed = False\n self.softspace = 0\n\n def __iter__(self):\n return self\n\n def next(self):\n """A file object is its own iterator, for example iter(f) returns f\n (unless f is closed). When a file is used as an iterator, typically\n in a for loop (for example, for line in f: print line), the next()\n method is called repeatedly. This method returns the next input line,\n or raises StopIteration when EOF is hit.\n """\n _complain_ifclosed(self.closed)\n r = self.readline()\n if not r:\n raise StopIteration\n return r\n\n def close(self):\n """Free the memory buffer.\n """\n if not self.closed:\n self.closed = True\n self.buf = None\n self.pos = None\n\n def isatty(self):\n """Returns False because StringIO objects are not connected to a\n tty-like device.\n """\n _complain_ifclosed(self.closed)\n return False\n\n def seek(self, pos, mode = 0):\n """Set the file\'s current position.\n\n The mode argument is optional and defaults to 0 (absolute file\n positioning); other values are 1 (seek relative to the current\n position) and 2 (seek relative to the file\'s end).\n\n There is no return value.\n """\n _complain_ifclosed(self.closed)\n if self.buflist:\n self.buf += \'\'.join(self.buflist)\n self.buflist = []\n if mode == 1:\n pos += self.pos\n elif mode == 2:\n pos += self.len\n self.pos = max(0, pos)\n\n def tell(self):\n """Return the file\'s current position."""\n _complain_ifclosed(self.closed)\n return self.pos\n\n def read(self, n = -1):\n """Read at most size bytes from the file\n (less if the read hits EOF before obtaining size bytes).\n\n If the size argument is negative or omitted, read all data until EOF\n is reached. The bytes are returned as a string object. An empty\n string is returned when EOF is encountered immediately.\n """\n _complain_ifclosed(self.closed)\n if self.buflist:\n self.buf += \'\'.join(self.buflist)\n self.buflist = []\n if n is None or n < 0:\n newpos = self.len\n else:\n newpos = min(self.pos+n, self.len)\n r = self.buf[self.pos:newpos]\n self.pos = newpos\n return r\n\n def readline(self, length=None):\n r"""Read one entire line from the file.\n\n A trailing newline character is kept in the string (but may be absent\n when a file ends with an incomplete line). If the size argument is\n present and non-negative, it is a maximum byte count (including the\n trailing newline) and an incomplete line may be returned.\n\n An empty string is returned only when EOF is encountered immediately.\n\n Note: Unlike stdio\'s fgets(), the returned string contains null\n characters (\'\\0\') if they occurred in the input.\n """\n _complain_ifclosed(self.closed)\n if self.buflist:\n self.buf += \'\'.join(self.buflist)\n self.buflist = []\n i = self.buf.find(\'\\n\', self.pos)\n if i < 0:\n newpos = self.len\n else:\n newpos = i+1\n if length is not None and length >= 0:\n if self.pos + length < newpos:\n newpos = self.pos + length\n r = self.buf[self.pos:newpos]\n self.pos = newpos\n return r\n\n def readlines(self, sizehint = 0):\n """Read until EOF using readline() and return a list containing the\n lines thus read.\n\n If the optional sizehint argument is present, instead of reading up\n to EOF, whole lines totalling approximately sizehint bytes (or more\n to accommodate a final whole line).\n """\n total = 0\n lines = []\n line = self.readline()\n while line:\n lines.append(line)\n total += len(line)\n if 0 < sizehint <= total:\n break\n line = self.readline()\n return lines\n\n def truncate(self, size=None):\n """Truncate the file\'s size.\n\n If the optional size argument is present, the file is truncated to\n (at most) that size. The size defaults to the current position.\n The current file position is not changed unless the position\n is beyond the new file size.\n\n If the specified size exceeds the file\'s current size, the\n file remains unchanged.\n """\n _complain_ifclosed(self.closed)\n if size is None:\n size = self.pos\n elif size < 0:\n raise IOError(22, "Negative size not allowed")\n elif size < self.pos:\n self.pos = size\n self.buf = self.getvalue()[:size]\n self.len = size\n\n def write(self, s):\n """Write a string to the file.\n\n There is no return value.\n """\n _complain_ifclosed(self.closed)\n if not s: return\n # Force s to be a string or unicode\n if not isinstance(s, str):\n s = str(s)\n spos = self.pos\n slen = self.len\n if spos == slen:\n self.buflist.append(s)\n self.len = self.pos = spos + len(s)\n return\n if spos > slen:\n self.buflist.append(\'\\0\'*(spos - slen))\n slen = spos\n newpos = spos + len(s)\n if spos < slen:\n if self.buflist:\n self.buf += \'\'.join(self.buflist)\n self.buflist = [self.buf[:spos], s, self.buf[newpos:]]\n self.buf = \'\'\n if newpos > slen:\n slen = newpos\n else:\n self.buflist.append(s)\n slen = newpos\n self.len = slen\n self.pos = newpos\n\n def writelines(self, iterable):\n """Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings. There\n is no return value.\n\n (The name is intended to match readlines(); writelines() does not add\n line separators.)\n """\n write = self.write\n for line in iterable:\n write(line)\n\n def flush(self):\n """Flush the internal buffer\n """\n _complain_ifclosed(self.closed)\n\n def getvalue(self):\n """\n Retrieve the entire contents of the "file" at any time before\n the StringIO object\'s close() method is called.\n\n The StringIO object can accept either Unicode or 8-bit strings,\n but mixing the two may take some care. If both are used, 8-bit\n strings that cannot be interpreted as 7-bit ASCII (that use the\n 8th bit) will cause a UnicodeError to be raised when getvalue()\n is called.\n """\n _complain_ifclosed(self.closed)\n if self.buflist:\n self.buf += \'\'.join(self.buflist)\n self.buflist = []\n return self.buf\n',"src/lib/stringold.py":'import _sk_fail; _sk_fail._("stringold")\n',"src/lib/stringprep.py":'import _sk_fail; _sk_fail._("stringprep")\n',"src/lib/struct.py":'import _sk_fail; _sk_fail._("struct")\n',"src/lib/subprocess.py":'import _sk_fail; _sk_fail._("subprocess")\n',"src/lib/sunau.py":'import _sk_fail; _sk_fail._("sunau")\n',"src/lib/sunaudio.py":'import _sk_fail; _sk_fail._("sunaudio")\n',"src/lib/symbol.py":'import _sk_fail; _sk_fail._("symbol")\n',"src/lib/symtable.py":'import _sk_fail; _sk_fail._("symtable")\n',"src/lib/tabnanny.py":'import _sk_fail; _sk_fail._("tabnanny")\n',"src/lib/tarfile.py":'import _sk_fail; _sk_fail._("tarfile")\n',"src/lib/telnetlib.py":'import _sk_fail; _sk_fail._("telnetlib")\n',"src/lib/tempfile.py":'import _sk_fail; _sk_fail._("tempfile")\n',"src/lib/test/ann_module.py":"\n\n\"\"\"\nThe module for testing variable annotations.\nEmpty lines above are for good reason (testing for correct line numbers)\n\"\"\"\n\n# from typing import Optional\n# from functools import wraps\n\n__annotations__[1] = 2\n\nclass C:\n\n x = 5; #y: Optional['C'] = None\n\n# from typing import Tuple\nx: int = 5; y: str = x;# f: Tuple[int, int]\n\nclass M(type):\n\n __annotations__['123'] = 123\n o: type = object\n\n(pars): bool = True\n\nclass D(C):\n j: str = 'hi'; k: str= 'bye'\n\n# from types import new_class\n# h_class = new_class('H', (C,))\n# j_class = new_class('J')\n\nclass F():\n z: int = 5\n def __init__(self, x):\n pass\n\nclass Y(F):\n def __init__(self):\n super(F, self).__init__(123)\n\nclass Meta(type):\n def __new__(meta, name, bases, namespace):\n return super().__new__(meta, name, bases, namespace)\n\nclass S(metaclass = Meta):\n x: str = 'something'\n y: str = 'something else'\n\n# def foo(x: int = 10):\n# def bar(y: List[str]):\n# x: str = 'yes'\n# bar()\n\n# def dec(func):\n# @wraps(func)\n# def wrapper(*args, **kwargs):\n# return func(*args, **kwargs)\n# return wrapper\n","src/lib/test/ann_module2.py":'"""\nSome correct syntax for variable annotation here.\nMore examples are in test_grammar and test_parser.\n"""\n\n# from typing import no_type_check, ClassVar\n\ni: int = 1\nj: int\nx: float = i/10\n\ndef f():\n # class C: ...\n class C: pass\n return C()\n\nf().new_attr: object = object()\n\nclass C:\n def __init__(self, x: int) -> None:\n self.x = x\n\nc = C(5)\nc.new_attr: int = 10\n\n__annotations__ = {}\n\n\n# @no_type_check\n# class NTC:\n# def meth(self, param: complex) -> None:\n# ...\n\n# class CV:\n# var: ClassVar[\'CV\']\n\n# CV.var = CV()\n',"src/lib/test/ann_module3.py":'"""\nCorrect syntax for variable annotation that should fail at runtime\nin a certain manner. More examples are in test_grammar and test_parser.\n"""\n\ndef f_bad_ann():\n __annotations__[1] = 2\n\nclass C_OK:\n def __init__(self, x: int) -> None:\n self.x: no_such_name = x # This one is OK as proposed by Guido\n\nclass D_bad_ann:\n def __init__(self, x: int) -> None:\n sfel.y: int = 0\n\ndef g_bad_ann():\n no_such_name.attr: int = 0\n',"src/lib/test/bad_getattr.py":'x = 1\n\n__getattr__ = "Surprise!"\n__dir__ = "Surprise again!"\n',"src/lib/test/bad_getattr2.py":'def __getattr__():\n "Bad one"\n\nx = 1\n\ndef __dir__(bad_sig):\n return []\n',"src/lib/test/bad_getattr3.py":"def __getattr__(name):\n global __getattr__\n if name != 'delgetattr':\n raise AttributeError\n del __getattr__\n raise AttributeError\n","src/lib/test/decimaltestdata/__init__.py":'import _sk_fail; _sk_fail._("decimaltestdata")\n',"src/lib/test/good_getattr.py":"x = 1\n\ndef __dir__():\n return ['a', 'b', 'c']\n\ndef __getattr__(name):\n if name == \"yolo\":\n raise AttributeError(\"Deprecated, use whatever instead\")\n return f\"There is {name}\"\n\ny = 2\n","src/lib/test/test_support.py":'"""Supporting definitions for the Python regression tests."""\n\nif __name__ != \'test.test_support\':\n raise ImportError(\'test_support must be imported from the test package\')\n\nimport unittest\n\n\n# def run_unittest(*classes):\n# """Run tests from unittest.TestCase-derived classes."""\n# valid_types = (unittest.TestSuite, unittest.TestCase)\n# suite = unittest.TestSuite()\n# for cls in classes:\n# if isinstance(cls, str):\n# if cls in sys.modules:\n# suite.addTest(unittest.findTestCases(sys.modules[cls]))\n# else:\n# raise ValueError("str arguments must be keys in sys.modules")\n# elif isinstance(cls, valid_types):\n# suite.addTest(cls)\n# else:\n# suite.addTest(unittest.makeSuite(cls))\n# _run_suite(suite)\n\ndef run_unittest(*classes):\n """Run tests from unittest.TestCase-derived classes."""\n for cls in classes:\n print cls\n if issubclass(cls, unittest.TestCase):\n cls().main()\n else:\n print "Don\'t know what to do with ", cls\n',"src/lib/test/__init__.py":"__author__ = 'bmiller'\n\ndef testEqual(actual, expected):\n if type(expected) == type(1):\n if actual == expected:\n print('Pass')\n return True\n elif type(expected) == type(1.11):\n if abs(actual-expected) < 0.00001:\n print('Pass')\n return True\n else:\n if actual == expected:\n print('Pass')\n return True\n print('Test Failed: expected ' + str(expected) + ' but got ' + str(actual))\n return False\n\ndef testNotEqual(actual, expected):\n pass\n\n","src/lib/textwrap.py":"\"\"\"Text wrapping and filling.\n\"\"\"\n\n# Copyright (C) 1999-2001 Gregory P. Ward.\n# Copyright (C) 2002, 2003 Python Software Foundation.\n# Written by Greg Ward \n\nimport re, string\n\n__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent', 'shorten']\n\n# Hardcode the recognized whitespace characters to the US-ASCII\n# whitespace characters. The main reason for doing this is that\n# some Unicode spaces (like \\u00a0) are non-breaking whitespaces.\n_whitespace = '\\t\\n\\x0b\\x0c\\r '\n\nclass TextWrapper:\n \"\"\"\n Object for wrapping/filling text. The public interface consists of\n the wrap() and fill() methods; the other methods are just there for\n subclasses to override in order to tweak the default behaviour.\n If you want to completely replace the main wrapping algorithm,\n you'll probably have to override _wrap_chunks().\n Several instance attributes control various aspects of wrapping:\n width (default: 70)\n the maximum width of wrapped lines (unless break_long_words\n is false)\n initial_indent (default: \"\")\n string that will be prepended to the first line of wrapped\n output. Counts towards the line's width.\n subsequent_indent (default: \"\")\n string that will be prepended to all lines save the first\n of wrapped output; also counts towards each line's width.\n expand_tabs (default: true)\n Expand tabs in input text to spaces before further processing.\n Each tab will become 0 .. 'tabsize' spaces, depending on its position\n in its line. If false, each tab is treated as a single character.\n tabsize (default: 8)\n Expand tabs in input text to 0 .. 'tabsize' spaces, unless\n 'expand_tabs' is false.\n replace_whitespace (default: true)\n Replace all whitespace characters in the input text by spaces\n after tab expansion. Note that if expand_tabs is false and\n replace_whitespace is true, every tab will be converted to a\n single space!\n fix_sentence_endings (default: false)\n Ensure that sentence-ending punctuation is always followed\n by two spaces. Off by default because the algorithm is\n (unavoidably) imperfect.\n break_long_words (default: true)\n Break words longer than 'width'. If false, those words will not\n be broken, and some lines might be longer than 'width'.\n break_on_hyphens (default: true)\n Allow breaking hyphenated words. If true, wrapping will occur\n preferably on whitespaces and right after hyphens part of\n compound words.\n drop_whitespace (default: true)\n Drop leading and trailing whitespace from lines.\n max_lines (default: None)\n Truncate wrapped lines.\n placeholder (default: ' [...]')\n Append to the last line of truncated text.\n \"\"\"\n\n unicode_whitespace_trans = {}\n # uspace = ord(' ')\n uspace = ' '\n for x in _whitespace:\n # unicode_whitespace_trans[ord(x)] = uspace\n unicode_whitespace_trans[x] = uspace\n\n # This funky little regex is just the trick for splitting\n # text up into word-wrappable chunks. E.g.\n # \"Hello there -- you goof-ball, use the -b option!\"\n # splits into\n # Hello/ /there/ /--/ /you/ /goof-/ball,/ /use/ /the/ /-b/ /option!\n # (after stripping out empty strings).\n wordsep_re = re.compile(\n r'(\\s+|' # any whitespace\n r'[^\\s\\w]*\\w+[^0-9\\W]-(?=\\w+[^0-9\\W]))') # hyphenated words\n em_dash = re.compile(r'(\\s+|' # any whitespace\n r'[^\\s\\w]*\\w+[^0-9\\W]-(?=\\w+[^0-9\\W])|' # hyphenated words\n r'(?!^)-{2,}(?=\\w))') # em-dash\n\n \n # This less funky little regex just split on recognized spaces. E.g.\n # \"Hello there -- you goof-ball, use the -b option!\"\n # splits into\n # Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/\n wordsep_simple_re = re.compile(r'(\\s+)')\n\n\n # XXX this is not locale- or charset-aware -- string.lowercase\n # is US-ASCII only (and therefore English-only)\n sentence_end_re = re.compile(r'[a-z]' # lowercase letter\n r'[\\.\\!\\?]' # sentence-ending punct.\n r'[\\\"\\']?' # optional end-of-quote\n r'\\Z') # end of chunk\n sentence_end_re = r'[a-z][\\.\\!\\?][\\\"\\']?'\n\n def __init__(self,\n width=70,\n initial_indent=\"\",\n subsequent_indent=\"\",\n expand_tabs=True,\n replace_whitespace=True,\n fix_sentence_endings=False,\n break_long_words=True,\n drop_whitespace=True,\n break_on_hyphens=True,\n tabsize=8,\n max_lines=None,\n placeholder=' [...]'):\n self.width = width\n self.initial_indent = initial_indent\n self.subsequent_indent = subsequent_indent\n self.expand_tabs = expand_tabs\n self.replace_whitespace = replace_whitespace\n self.fix_sentence_endings = fix_sentence_endings\n self.break_long_words = break_long_words\n self.drop_whitespace = drop_whitespace\n self.break_on_hyphens = break_on_hyphens\n self.tabsize = tabsize\n self.max_lines = max_lines\n self.placeholder = placeholder\n\n\n # -- Private methods -----------------------------------------------\n # (possibly useful for subclasses to override)\n\n def _munge_whitespace(self, text):\n \"\"\"_munge_whitespace(text : string) -> string\n Munge whitespace in text: expand tabs and convert all other\n whitespace characters to spaces. Eg. \" foo\\\\tbar\\\\n\\\\nbaz\"\n becomes \" foo bar baz\".\n \"\"\"\n if self.expand_tabs:\n text = text.expandtabs(self.tabsize)\n if self.replace_whitespace:\n for key, val in self.unicode_whitespace_trans.items():\n text = text.replace(key, val)\n return text\n\n\n def _split(self, text):\n \"\"\"_split(text : string) -> [string]\n Split the text to wrap into indivisible chunks. Chunks are\n not quite the same as words; see _wrap_chunks() for full\n details. As an example, the text\n Look, goof-ball -- use the -b option!\n breaks into the following chunks:\n 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',\n 'use', ' ', 'the', ' ', '-b', ' ', 'option!'\n if break_on_hyphens is True, or in:\n 'Look,', ' ', 'goof-ball', ' ', '--', ' ',\n 'use', ' ', 'the', ' ', '-b', ' ', option!'\n otherwise.\n \"\"\"\n if self.break_on_hyphens is True:\n chunks = self.wordsep_re.split(text)\n if \"--\" in text:\n chunks = [item \n for sublist in [self.em_dash.split(chunk) for chunk in chunks] \n for item in sublist]\n else:\n chunks = self.wordsep_simple_re.split(text)\n chunks = [c for c in chunks if c]\n return chunks\n\n def _fix_sentence_endings(self, chunks):\n \"\"\"_fix_sentence_endings(chunks : [string])\n Correct for sentence endings buried in 'chunks'. Eg. when the\n original text contains \"... foo.\\\\nBar ...\", munge_whitespace()\n and split() will convert that to [..., \"foo.\", \" \", \"Bar\", ...]\n which has one too few spaces; this method simply changes the one\n space to two.\n \"\"\"\n i = 0\n # patsearch = self.sentence_end_re.search\n while i < len(chunks)-1:\n if chunks[i+1] == \" \" and re.search(self.sentence_end_re, chunks[i]) and chunks[i][-1] in \".!?\\\"\\'\":\n chunks[i+1] = \" \"\n i += 2\n else:\n i += 1\n\n def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width):\n \"\"\"_handle_long_word(chunks : [string],\n cur_line : [string],\n cur_len : int, width : int)\n Handle a chunk of text (most likely a word, not whitespace) that\n is too long to fit in any line.\n \"\"\"\n # Figure out when indent is larger than the specified width, and make\n # sure at least one character is stripped off on every pass\n if width < 1:\n space_left = 1\n else:\n space_left = width - cur_len\n\n # If we're allowed to break long words, then do so: put as much\n # of the next chunk onto the current line as will fit.\n if self.break_long_words:\n cur_line.append(reversed_chunks[-1][:space_left])\n reversed_chunks[-1] = reversed_chunks[-1][space_left:]\n\n # Otherwise, we have to preserve the long word intact. Only add\n # it to the current line if there's nothing already there --\n # that minimizes how much we violate the width constraint.\n elif not cur_line:\n cur_line.append(reversed_chunks.pop())\n\n # If we're not allowed to break long words, and there's already\n # text on the current line, do nothing. Next time through the\n # main loop of _wrap_chunks(), we'll wind up here again, but\n # cur_len will be zero, so the next line will be entirely\n # devoted to the long word that we can't handle right now.\n\n def _wrap_chunks(self, chunks):\n \"\"\"_wrap_chunks(chunks : [string]) -> [string]\n Wrap a sequence of text chunks and return a list of lines of\n length 'self.width' or less. (If 'break_long_words' is false,\n some lines may be longer than this.) Chunks correspond roughly\n to words and the whitespace between them: each chunk is\n indivisible (modulo 'break_long_words'), but a line break can\n come between any two chunks. Chunks should not have internal\n whitespace; ie. a chunk is either all whitespace or a \"word\".\n Whitespace chunks will be removed from the beginning and end of\n lines, but apart from that whitespace is preserved.\n \"\"\"\n lines = []\n if self.width <= 0:\n raise ValueError(\"invalid width %r (must be > 0)\" % self.width)\n if self.max_lines is not None:\n if self.max_lines > 1:\n indent = self.subsequent_indent\n else:\n indent = self.initial_indent\n if len(indent) + len(self.placeholder.lstrip()) > self.width:\n raise ValueError(\"placeholder too large for max width\")\n\n # Arrange in reverse order so items can be efficiently popped\n # from a stack of chucks.\n chunks.reverse()\n\n while chunks:\n\n # Start the list of chunks that will make up the current line.\n # cur_len is just the length of all the chunks in cur_line.\n cur_line = []\n cur_len = 0\n\n # Figure out which static string will prefix this line.\n if lines:\n indent = self.subsequent_indent\n else:\n indent = self.initial_indent\n\n # Maximum width for this line.\n width = self.width - len(indent)\n\n # First chunk on line is whitespace -- drop it, unless this\n # is the very beginning of the text (ie. no lines started yet).\n if self.drop_whitespace and chunks[-1].strip() == '' and lines:\n del chunks[-1]\n\n while chunks:\n l = len(chunks[-1])\n\n # Can at least squeeze this chunk onto the current line.\n if cur_len + l <= width:\n cur_line.append(chunks.pop())\n cur_len += l\n\n # Nope, this line is full.\n else:\n break\n\n # The current line is full, and the next chunk is too big to\n # fit on *any* line (not just this one).\n if chunks and len(chunks[-1]) > width:\n self._handle_long_word(chunks, cur_line, cur_len, width)\n cur_len = sum(map(len, cur_line))\n\n # If the last chunk on this line is all whitespace, drop it.\n if self.drop_whitespace and cur_line and cur_line[-1].strip() == '':\n cur_len -= len(cur_line[-1])\n del cur_line[-1]\n\n if cur_line:\n if (self.max_lines is None or\n len(lines) + 1 < self.max_lines or\n (not chunks or\n self.drop_whitespace and\n len(chunks) == 1 and\n not chunks[0].strip()) and cur_len <= width):\n # Convert current line back to a string and store it in\n # list of all lines (return value).\n lines.append(indent + ''.join(cur_line))\n else:\n while cur_line:\n if (cur_line[-1].strip() and\n cur_len + len(self.placeholder) <= width):\n cur_line.append(self.placeholder)\n lines.append(indent + ''.join(cur_line))\n break\n cur_len -= len(cur_line[-1])\n del cur_line[-1]\n else:\n if lines:\n prev_line = lines[-1].rstrip()\n if (len(prev_line) + len(self.placeholder) <=\n self.width):\n lines[-1] = prev_line + self.placeholder\n break\n lines.append(indent + self.placeholder.lstrip())\n break\n\n return lines\n\n def _split_chunks(self, text):\n text = self._munge_whitespace(text)\n return self._split(text)\n\n # -- Public interface ----------------------------------------------\n\n def wrap(self, text):\n \"\"\"wrap(text : string) -> [string]\n Reformat the single paragraph in 'text' so it fits in lines of\n no more than 'self.width' columns, and return a list of wrapped\n lines. Tabs in 'text' are expanded with string.expandtabs(),\n and all other whitespace characters (including newline) are\n converted to space.\n \"\"\"\n chunks = self._split_chunks(text)\n if self.fix_sentence_endings:\n self._fix_sentence_endings(chunks)\n return self._wrap_chunks(chunks)\n\n def fill(self, text):\n \"\"\"fill(text : string) -> string\n Reformat the single paragraph in 'text' to fit in lines of no\n more than 'self.width' columns, and return a new string\n containing the entire wrapped paragraph.\n \"\"\"\n return \"\\n\".join(self.wrap(text))\n\n\n# -- Convenience interface ---------------------------------------------\n\ndef wrap(text, width=70, **kwargs):\n \"\"\"Wrap a single paragraph of text, returning a list of wrapped lines.\n Reformat the single paragraph in 'text' so it fits in lines of no\n more than 'width' columns, and return a list of wrapped lines. By\n default, tabs in 'text' are expanded with string.expandtabs(), and\n all other whitespace characters (including newline) are converted to\n space. See TextWrapper class for available keyword args to customize\n wrapping behaviour.\n \"\"\"\n w = TextWrapper(width=width, **kwargs)\n return w.wrap(text)\n\ndef fill(text, width=70, **kwargs):\n \"\"\"Fill a single paragraph of text, returning a new string.\n Reformat the single paragraph in 'text' to fit in lines of no more\n than 'width' columns, and return a new string containing the entire\n wrapped paragraph. As with wrap(), tabs are expanded and other\n whitespace characters converted to space. See TextWrapper class for\n available keyword args to customize wrapping behaviour.\n \"\"\"\n w = TextWrapper(width=width, **kwargs)\n return w.fill(text)\n\ndef shorten(text, width, **kwargs):\n \"\"\"Collapse and truncate the given text to fit in the given width.\n The text first has its whitespace collapsed. If it then fits in\n the *width*, it is returned as is. Otherwise, as many words\n as possible are joined and then the placeholder is appended::\n >>> textwrap.shorten(\"Hello world!\", width=12)\n 'Hello world!'\n >>> textwrap.shorten(\"Hello world!\", width=11)\n 'Hello [...]'\n \"\"\"\n w = TextWrapper(width=width, max_lines=1, **kwargs)\n return w.fill(' '.join(text.strip().split()))\n\n\n# -- Loosely related functionality -------------------------------------\n\n# _whitespace_only_re = re.compile('^[ \\t]+$', re.MULTILINE)\n# _leading_whitespace_re = re.compile('(^[ \\t]*)(?:[^ \\t\\n])', re.MULTILINE)\n\ndef dedent(text):\n \"\"\"Remove any common leading whitespace from every line in `text`.\n This can be used to make triple-quoted strings line up with the left\n edge of the display, while still presenting them in the source code\n in indented form.\n Note that tabs and spaces are both treated as whitespace, but they\n are not equal: the lines \" hello\" and \"\\\\thello\" are\n considered to have no common leading whitespace.\n Entirely blank lines are normalized to a newline character.\n \"\"\"\n # Look for the longest leading string of spaces and tabs common to\n # all lines.\n margin = None\n\n indents = re.findall(r'(^[ \\t]*)(?:[^ \\t\\n])',text, re.MULTILINE)\n for indent in indents:\n if margin is None:\n margin = indent\n\n # Current line more deeply indented than previous winner:\n # no change (previous winner is still on top).\n elif indent.startswith(margin):\n pass\n\n # Current line consistent with and no deeper than previous winner:\n # it's the new winner.\n elif margin.startswith(indent):\n margin = indent\n\n # Find the largest common whitespace between current line and previous\n # winner.\n else:\n for i, (x, y) in enumerate(zip(margin, indent)):\n if x != y:\n margin = margin[:i]\n break\n # sanity check (testing/debugging only)\n if 0 and margin:\n for line in text.split(\"\\n\"):\n assert not line or line.startswith(margin), \\\n \"line = %r, margin = %r\" % (line, margin)\n\n if margin:\n lines = [line[len(margin):] \n if line.strip()\n else line.strip() \n for line in text.split(\"\\n\")]\n text = \"\\n\".join(lines)\n return text\n\n\ndef indent(text, prefix, predicate=None):\n \"\"\"Adds 'prefix' to the beginning of selected lines in 'text'.\n If 'predicate' is provided, 'prefix' will only be added to the lines\n where 'predicate(line)' is True. If 'predicate' is not provided,\n it will default to adding 'prefix' to all non-empty lines that do not\n consist solely of whitespace characters.\n \"\"\"\n if predicate is None:\n def predicate(line):\n return line.strip()\n\n def prefixed_lines():\n for line in text.splitlines(True):\n yield (prefix + line if predicate(line) else line)\n return ''.join(prefixed_lines())\n\n\nif __name__ == \"__main__\":\n #print dedent(\"\\tfoo\\n\\tbar\")\n #print dedent(\" \\thello there\\n \\t how are you?\")\n print(dedent(\"Hello there.\\n This is indented.\"))","src/lib/this.py":'import _sk_fail; _sk_fail._("this")\n',"src/lib/threading.py":'import _sk_fail; _sk_fail._("threading")\n',"src/lib/timeit.py":'import _sk_fail; _sk_fail._("timeit")\n',"src/lib/toaiff.py":'import _sk_fail; _sk_fail._("toaiff")\n',"src/lib/trace.py":'import _sk_fail; _sk_fail._("trace")\n',"src/lib/traceback.py":'import _sk_fail; _sk_fail._("traceback")\n',"src/lib/tty.py":'import _sk_fail; _sk_fail._("tty")\n',"src/lib/types.py":'"""\nThis file was modified from CPython.\nCopyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,\n2011, 2012, 2013, 2014, 2015 Python Software Foundation; All Rights Reserved\n"""\n"""Define names for all type symbols known in the standard interpreter.\nTypes that are part of optional modules (e.g. array) are not listed.\n"""\nimport sys\n\n# Iterators in Python aren\'t a matter of type but of protocol. A large\n# and changing number of builtin types implement *some* flavor of\n# iterator. Don\'t check the type! Use hasattr to check for both\n# "__iter__" and "next" attributes instead.\nMappingProxyType = type(type.__dict__)\nWrapperDescriptorType = type(object.__init__)\nMethodWrapperType = type(object().__str__)\nMethodDescriptorType = type(str.join)\nClassMethodDescriptorType = type(dict.__dict__[\'fromkeys\'])\n\nNoneType = type(None)\nTypeType = type\nObjectType = object\nIntType = int\ntry:\n LongType = long\nexcept: pass\nFloatType = float\nBooleanType = bool\ntry:\n ComplexType = complex\nexcept NameError:\n pass\nStringType = str\n\n# StringTypes is already outdated. Instead of writing "type(x) in\n# types.StringTypes", you should use "isinstance(x, basestring)". But\n# we keep around for compatibility with Python 2.2.\ntry:\n UnicodeType = unicode\n StringTypes = (StringType, UnicodeType)\nexcept NameError:\n StringTypes = (StringType,)\n\nBufferType = buffer\n\nTupleType = tuple\nListType = list\nDictType = DictionaryType = dict\n\ndef _f(): pass\nFunctionType = type(_f)\nLambdaType = type(lambda: None) # Same as FunctionType\n#CodeType = type(_f.func_code)\n\ndef _g():\n yield 1\nGeneratorType = type(_g())\n\nclass _C:\n def _m(self): pass\nClassType = type(_C)\nUnboundMethodType = type(_C._m) # Same as MethodType\n_x = _C()\nInstanceType = type(_x)\nMethodType = type(_x._m)\nBuiltinFunctionType = type(len)\nBuiltinMethodType = type([].append) # Same as BuiltinFunctionType\n\nModuleType = type(sys)\nFileType = file\ntry:\n XRangeType = xrange\nexcept NameError:\n pass\n\n# try:\n# raise TypeError\n# except TypeError:\n# tb = sys.exc_info()[2]\n# TracebackType = type(tb)\n# FrameType = type(tb.tb_frame)\n# del tb\n\nSliceType = slice\nEllipsisType = type(Ellipsis)\n\n# DictProxyType = type(TypeType.__dict__)\nNotImplementedType = type(NotImplemented)\n\n# For Jython, the following two types are identical\n# GetSetDescriptorType = type(FunctionType.func_code)\n# MemberDescriptorType = type(FunctionType.func_globals)\n\ndel sys, _f, _g, _C, _x # Not for export\n__all__ = list(n for n in globals() if n[:1] != \'_\')\n\nGenericAlias = type(type[int])',"src/lib/unittest/gui.py":"import document\nfrom unittest import TestCase\n\nclass TestCaseGui(TestCase):\n def __init__(self):\n TestCase.__init__(self)\n self.divid = document.currentDiv()\n self.mydiv = document.getElementById(self.divid)\n res = document.getElementById(self.divid+'_unit_results')\n if res:\n self.resdiv = res\n res.innerHTML = ''\n else:\n self.resdiv = document.createElement('div')\n self.resdiv.setAttribute('id',self.divid+'_unit_results')\n self.resdiv.setAttribute('class','unittest-results')\n self.mydiv.appendChild(self.resdiv)\n\n\n def main(self):\n t = document.createElement('table')\n self.resTable = t\n self.resdiv.appendChild(self.resTable)\n\n headers = ['Result','Actual Value','Expected Value','Notes']\n row = document.createElement('tr')\n for item in headers:\n head = document.createElement('th')\n head.setAttribute('class','ac-feedback')\n head.innerHTML = item\n head.setCSS('text-align','center')\n row.appendChild(head)\n self.resTable.appendChild(row)\n\n for func in self.tlist:\n try:\n self.setUp()\n func()\n self.tearDown()\n except Exception as e:\n self.appendResult('Error', None, None, e)\n self.numFailed += 1\n self.showSummary()\n\n def appendResult(self,res,actual,expected,param):\n trimActual = False\n if len(str(actual)) > 15:\n trimActual = True\n actualType = type(actual)\n trimExpected = False\n if len(str(expected)) > 15:\n trimExpected = True\n expectedType = type(expected)\n row = document.createElement('tr')\n err = False\n if res == 'Error':\n err = True\n msg = 'Error: %s' % param\n errorData = document.createElement('td')\n errorData.setAttribute('class','ac-feedback')\n errorData.innerHTML = 'ERROR'\n errorData.setCSS('background-color','#de8e96')\n errorData.setCSS('text-align','center')\n row.appendChild(errorData)\n elif res:\n passed = document.createElement('td')\n passed.setAttribute('class','ac-feedback')\n passed.innerHTML = 'Pass'\n passed.setCSS('background-color','#83d382')\n passed.setCSS('text-align','center')\n row.appendChild(passed)\n self.numPassed += 1\n else:\n fail = document.createElement('td')\n fail.setAttribute('class','ac-feedback')\n fail.innerHTML = 'Fail'\n fail.setCSS('background-color','#de8e96')\n fail.setCSS('text-align','center')\n row.appendChild(fail)\n self.numFailed += 1\n\n\n act = document.createElement('td')\n act.setAttribute('class','ac-feedback')\n if trimActual:\n actHTML = str(actual)[:5] + \"...\" + str(actual)[-5:]\n if actualType == str:\n actHTML = repr(actHTML)\n act.innerHTML = actHTML\n else:\n act.innerHTML = repr(actual)\n act.setCSS('text-align','center')\n row.appendChild(act)\n\n expect = document.createElement('td')\n expect.setAttribute('class','ac-feedback')\n\n if trimExpected:\n expectedHTML = str(expected)[:5] + \"...\" + str(expected)[-5:]\n if expectedType == str:\n expectedHTML = repr(expectedHTML)\n expect.innerHTML = expectedHTML\n else:\n expect.innerHTML = repr(expected)\n expect.setCSS('text-align','center')\n row.appendChild(expect)\n inp = document.createElement('td')\n inp.setAttribute('class','ac-feedback')\n\n if err:\n inp.innerHTML = msg\n else:\n inp.innerHTML = param\n inp.setCSS('text-align','center')\n row.appendChild(inp)\n self.resTable.appendChild(row)\n\n\n def showSummary(self):\n pct = self.numPassed / (self.numPassed+self.numFailed) * 100\n pTag = document.createElement('p')\n pTag.innerHTML = \"You passed: \" + str(pct) + \"% of the tests\"\n self.resdiv.appendChild(pTag)\n","src/lib/unittest/__init__.py":'__author__ = \'bmiller\'\n\'\'\'\nThis is the start of something that behaves like\nthe unittest module from cpython.\n\n\'\'\'\nimport re\n\nclass _AssertRaisesContext(object):\n """A context manager used to implement TestCase.assertRaises* methods."""\n def __init__(self, expected, test_case):\n self.test_case = test_case\n self.expected = expected\n self.exception = None\n\n def _is_subtype(self, expected, basetype):\n if isinstance(expected, tuple):\n return all(self._is_subtype(e, basetype) for e in expected)\n return isinstance(expected, type) and issubclass(expected, basetype)\n\n def handle(self, args, kwargs):\n """\n If args is empty, assertRaises is being used as a\n context manager, so return self.\n If args is not empty, call a callable passing positional and keyword\n arguments.\n """\n try:\n if not self._is_subtype(self.expected, BaseException):\n raise TypeError(\'assertRaises() arg 1 must be an exception type or tuple of exception types\')\n if not args:\n return self\n\n callable_obj = args[0]\n args = args[1:]\n with self:\n callable_obj(*args, **kwargs) \n\n finally:\n # bpo-23890: manually break a reference cycle\n self = None\n\n def __enter__(self):\n return self\n\n def __exit__(self, exc_type, exc_value, tb):\n res = True\n feedback = ""\n self.exception = exc_value\n try:\n act_exc = exc_type.__name__\n except AttributeError:\n act_exc = str(exc_type)\n try:\n exp_exc = self.expected.__name__\n except AttributeError:\n exp_exc = str(self.expected)\n\n if exc_type is None:\n res = False\n feedback = "{} not raised".format(exp_exc)\n elif not issubclass(exc_type, self.expected):\n res = False\n feedback = "Expected {} but got {}".format(exp_exc, act_exc)\n\n self.test_case.appendResult(res, act_exc, exp_exc, feedback)\n return True\n\n\nclass TestCase(object):\n def __init__(self):\n self.numPassed = 0\n self.numFailed = 0\n self.assertPassed = 0\n self.assertFailed = 0\n self.verbosity = 1\n self.tlist = []\n testNames = {}\n for name in dir(self):\n if name[:4] == \'test\' and name not in testNames:\n self.tlist.append(getattr(self,name))\n testNames[name]=True\n\n def setUp(self):\n pass\n\n def tearDown(self):\n pass\n \n def cleanName(self,funcName):\n return funcName.__func__.__name__\n\n def main(self):\n\n for func in self.tlist:\n if self.verbosity > 1:\n print(\'Running %s\' % self.cleanName(func))\n try:\n self.setUp()\n self.assertPassed = 0\n self.assertFailed = 0\n func()\n self.tearDown()\n if self.assertFailed == 0:\n self.numPassed += 1\n else:\n self.numFailed += 1\n print(\'Tests failed in %s \' % self.cleanName(func))\n except Exception as e:\n self.assertFailed += 1\n self.numFailed += 1\n print(\'Test threw exception in %s (%s)\' % (self.cleanName(func), e))\n self.showSummary()\n\n def assertEqual(self, actual, expected, feedback=""):\n res = actual==expected\n if not res and feedback == "":\n feedback = "Expected %s to equal %s" % (str(actual),str(expected))\n self.appendResult(res, actual ,expected, feedback)\n\n def assertNotEqual(self, actual, expected, feedback=""):\n res = actual != expected\n if not res and feedback == "":\n feedback = "Expected %s to not equal %s" % (str(actual),str(expected))\n self.appendResult(res, actual, expected, feedback)\n\n def assertTrue(self,x, feedback=""):\n res = bool(x) is True\n if not res and feedback == "":\n feedback = "Expected %s to be True" % (str(x))\n self.appendResult(res, x, True, feedback)\n\n def assertFalse(self,x, feedback=""):\n res = not bool(x)\n if not res and feedback == "":\n feedback = "Expected %s to be False" % (str(x))\n self.appendResult(res, x, False, feedback)\n\n def assertIs(self,a,b, feedback=""):\n res = a is b\n if not res and feedback == "":\n feedback = "Expected %s to be the same object as %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertIsNot(self,a,b, feedback=""):\n res = a is not b\n if not res and feedback == "":\n feedback = "Expected %s to not be the same object as %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertIsNone(self,x, feedback=""):\n res = x is None\n if not res and feedback == "":\n feedback = "Expected %s to be None" % (str(x))\n self.appendResult(res, x, None, feedback)\n\n def assertIsNotNone(self,x, feedback=""):\n res = x is not None\n if not res and feedback == "":\n feedback = "Expected %s to not be None" % (str(x))\n self.appendResult(res, x, None, feedback)\n\n def assertIn(self, a, b, feedback=""):\n res = a in b\n if not res and feedback == "":\n feedback = "Expected %s to be in %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertNotIn(self, a, b, feedback=""):\n res = a not in b\n if not res and feedback == "":\n feedback = "Expected %s to not be in %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertIsInstance(self,a,b, feedback=""):\n res = isinstance(a,b)\n if not res and feedback == "":\n feedback = "Expected %s to be an instance of %s" % (str(a), str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertNotIsInstance(self,a,b, feedback=""):\n res = not isinstance(a,b)\n if not res and feedback == "":\n feedback = "Expected %s to not be an instance of %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertRegex(self, text, expected_regex, feedback=""):\n """Fail the test unless the text matches the regular expression."""\n if isinstance(expected_regex, (str, )): #bytes\n assert expected_regex, "expected_regex must not be empty."\n expected_regex = re.compile(expected_regex)\n if not expected_regex.search(text):\n res = False\n if feedback == "":\n feedback = "Regex didn\'t match: %r not found in %r" % (\n repr(expected_regex), text)\n else:\n res = True\n self.appendResult(res, text, expected_regex, feedback)\n\n def assertNotRegex(self, text, unexpected_regex, feedback=""):\n """Fail the test if the text matches the regular expression."""\n if isinstance(unexpected_regex, (str, )): # bytes\n unexpected_regex = re.compile(unexpected_regex)\n match = unexpected_regex.search(text)\n if match:\n feedback = \'Regex matched: %r matches %r in %r\' % (\n text[match.start() : match.end()],\n repr(unexpected_regex),\n text)\n # _formatMessage ensures the longMessage option is respected\n self.appendResult(not bool(match), text, unexpected_regex, feedback)\n\n def assertAlmostEqual(self, a, b, places=7, feedback="", delta=None):\n\n if delta is not None:\n res = abs(a-b) <= delta\n else:\n if places is None:\n places = 7\n res = round(a-b, places) == 0\n \n if not res and feedback == "":\n feedback = "Expected %s to equal %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertNotAlmostEqual(self, a, b, places=7, feedback="", delta=None):\n\n if delta is not None:\n res = not (a == b) and abs(a - b) > delta\n else:\n if places is None:\n places = 7\n\n res = round(a-b, places) != 0\n\n if not res and feedback == "":\n feedback = "Expected %s to not equal %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertGreater(self,a,b, feedback=""):\n res = a > b\n if not res and feedback == "":\n feedback = "Expected %s to be greater than %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertGreaterEqual(self,a,b, feedback=""):\n res = a >= b\n if not res and feedback == "":\n feedback = "Expected %s to be >= %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertLess(self, a, b, feedback=""):\n res = a < b\n if not res and feedback == "":\n feedback = "Expected %s to be less than %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def assertLessEqual(self,a,b, feedback=""):\n res = a <= b\n if not res and feedback == "":\n feedback = "Expected %s to be <= %s" % (str(a),str(b))\n self.appendResult(res, a, b, feedback)\n\n def appendResult(self,res,actual,expected,feedback):\n if res:\n msg = \'Pass\'\n self.assertPassed += 1\n else:\n msg = \'Fail: \' + feedback\n print(msg)\n self.assertFailed += 1\n\n def assertRaises(self, expected_exception, *args, **kwargs):\n context = _AssertRaisesContext(expected_exception, self)\n try:\n return context.handle(args, kwargs)\n finally:\n # bpo-23890: manually break a reference cycle\n context = None\n\n def fail(self, msg=None):\n if msg is None:\n msg = \'Fail\'\n else:\n msg = \'Fail: \' + msg\n print(msg)\n self.assertFailed += 1\n\n def showSummary(self):\n # don\'t divde by zero\n # pct = self.numPassed / (self.numPassed+self.numFailed) * 100\n print("Ran %d tests, passed: %d failed: %d\\n" % (self.numPassed+self.numFailed,\n self.numPassed, self.numFailed))\n\n\n\ndef main(verbosity=1):\n glob = globals() # globals() still needs work\n for name in glob:\n if type(glob[name]) == type and issubclass(glob[name], TestCase):\n try:\n tc = glob[name]()\n tc.verbosity = verbosity\n tc.main()\n except:\n print("Uncaught Error in: ", name)\n',"src/lib/urllib2.py":'import _sk_fail; _sk_fail._("urllib2")\n',"src/lib/urlparse.py":'import _sk_fail; _sk_fail._("urlparse")\n',"src/lib/user.py":'import _sk_fail; _sk_fail._("user")\n',"src/lib/UserDict.py":'import _sk_fail; _sk_fail._("UserDict")\n',"src/lib/UserList.py":'import _sk_fail; _sk_fail._("UserList")\n',"src/lib/UserString.py":'import _sk_fail; _sk_fail._("UserString")\n',"src/lib/uu.py":'import _sk_fail; _sk_fail._("uu")\n',"src/lib/warnings.py":'import _sk_fail; _sk_fail._("warnings")\n',"src/lib/wave.py":'import _sk_fail; _sk_fail._("wave")\n',"src/lib/weakref.py":'import _sk_fail; _sk_fail._("weakref")\n',"src/lib/whichdb.py":'import _sk_fail; _sk_fail._("whichdb")\n',"src/lib/wsgiref/__init__.py":'import _sk_fail; _sk_fail._("wsgiref")\n',"src/lib/xdrlib.py":'import _sk_fail; _sk_fail._("xdrlib")\n',"src/lib/xml/dom/__init__.py":'import _sk_fail; _sk_fail._("dom")\n',"src/lib/xml/etree/__init__.py":'import _sk_fail; _sk_fail._("etree")\n',"src/lib/xml/parsers/__init__.py":'import _sk_fail; _sk_fail._("parsers")\n',"src/lib/xml/sax/__init__.py":'import _sk_fail; _sk_fail._("sax")\n',"src/lib/xml/__init__.py":'import _sk_fail; _sk_fail._("xml")\n',"src/lib/xmllib.py":'import _sk_fail; _sk_fail._("xmllib")\n',"src/lib/xmlrpclib.py":'import _sk_fail; _sk_fail._("xmlrpclib")\n',"src/lib/zipfile.py":'import _sk_fail; _sk_fail._("zipfile")\n',"src/lib/_abcoll.py":'import _sk_fail; _sk_fail._("_abcoll")\n',"src/lib/_LWPCookieJar.py":'import _sk_fail; _sk_fail._("_LWPCookieJar")\n',"src/lib/_MozillaCookieJar.py":'import _sk_fail; _sk_fail._("_MozillaCookieJar")\n',"src/lib/_sk_fail.py":'class NotImplementedImportError(ImportError, NotImplementedError): pass\n\ndef _(name):\n msg = "{} is not yet implemented in Skulpt".format(name)\n raise NotImplementedImportError(msg, name=name)\n',"src/lib/_threading_local.py":'import _sk_fail; _sk_fail._("_threading_local")\n',"src/lib/__future__.py":'import _sk_fail;_sk_fail._("__future__")\n',"src/lib/__phello__.foo.py":'import _sk_fail; _sk_fail._("__phello__.foo")\n',"src/builtin/sys.js":'var $builtinmodule=function(i){var t,n={},e=[],u=Sk.getSysArgv();for(t=0;tnew Sk.builtin.str("utf-8"))),n.getExecutionLimit=new Sk.builtin.func((function(){return null===Sk.execLimit?Sk.builtin.none.none$:new Sk.builtin.int_(Sk.execLimit)})),n.setExecutionLimit=new Sk.builtin.func((function(i){if(null===Sk.execLimit)throw new Sk.builtin.NotImplementedError("Execution limiting is not enabled");void 0!==i&&(Sk.execLimit=Sk.builtin.asnum$(i))})),n.resetTimeout=new Sk.builtin.func((function(){Sk.execStart=new Date})),n.getYieldLimit=new Sk.builtin.func((function(){return null===Sk.yieldLimit?Sk.builtin.none.none$:new Sk.builtin.int_(Sk.yieldLimit)})),n.setYieldLimit=new Sk.builtin.func((function(i){if(null===Sk.yieldLimit)throw new Sk.builtin.NotImplementedError("Yielding is not enabled");void 0!==i&&(Sk.yieldLimit=Sk.builtin.asnum$(i))})),n.debug=new Sk.builtin.func((function(){return Sk.builtin.none.none$}));const o=Sk.builtin.make_structseq("sys","float_info",{max:"DBL_MAX -- maximum representable finite float",max_exp:"DBL_MAX_EXP -- maximum int e such that radix**(e-1) is representable",max_10_exp:"DBL_MAX_10_EXP -- maximum int e such that 10**e is representable",min:"DBL_MIN -- Minimum positive normalized float",min_exp:"DBL_MIN_EXP -- minimum int e such that radix**(e-1) is a normalized float",min_10_exp:"DBL_MIN_10_EXP -- minimum int e such that 10**e is a normalized",dig:"DBL_DIG -- digits",mant_dig:"DBL_MANT_DIG -- mantissa digits",epsilon:"DBL_EPSILON -- Difference between 1 and the next representable float",radix:"FLT_RADIX -- radix of exponent",rounds:"FLT_ROUNDS -- rounding mode"});n.float_info=new o([Number.MAX_VALUE,Math.floor(Math.log2(Number.MAX_VALUE)),Math.floor(Math.log10(Number.MAX_VALUE)),Number.MIN_VALUE,Math.ceil(Math.log2(Number.MIN_VALUE)),Math.ceil(Math.log10(Number.MIN_VALUE)),15,Math.log2(Number.MAX_SAFE_INTEGER),Number.EPSILON,2,1].map((i=>Sk.ffi.remapToPy(i))));const s=Sk.builtin.make_structseq("sys","int_info",{bits_per_digit:"size of a digit in bits",sizeof_digit:"size in bytes of the C type used to represent a digit"});n.int_info=new s([30,4].map((i=>Sk.ffi.remapToPy(i))));const l=Sk.builtin.make_structseq("sys","hash_info",{width:"width of the type used for hashing, in bits",modulus:"prime number giving the modulus on which the hash function is based",inf:"value to be used for hash of a positive infinity",nan:"value to be used for hash of a nan",imag:"multiplier used for the imaginary part of a complex number",algorithm:"name of the algorithm for hashing of str, bytes and memoryviews",hash_bits:"internal output size of hash algorithm",seed_bits:"seed size of hash algorithm",cutoff:"small string optimization cutoff"});return n.hash_info=new l([32,536870911,314159,0,1000003,"siphash24",32,128,0].map((i=>Sk.ffi.remapToPy(i)))),n.__stdout__=new Sk.builtin.file(new Sk.builtin.str("/dev/stdout"),new Sk.builtin.str("w")),n.__stdin__=new Sk.builtin.file(new Sk.builtin.str("/dev/stdin"),new Sk.builtin.str("r")),n.stdout=n.__stdout__,n.stdin=n.__stdin__,n};',"src/lib/array.js":'function $builtinmodule(e){var n={},t=["c","b","B","u","h","H","i","I","l","L","f","d"];return n.__name__=new Sk.builtin.str("array"),n.array=Sk.misceval.buildClass(n,(function(e,n){n.__init__=new Sk.builtin.func((function(e,n,i){if(Sk.builtin.pyCheckArgsLen("__init__",arguments.length,2,3),-1==t.indexOf(Sk.ffi.remapToJs(n)))throw new Sk.builtin.ValueError("bad typecode (must be c, b, B, u, h, H, i, I, l, L, f or d)");if(i&&!Sk.builtin.checkIterable(i))throw new Sk.builtin.TypeError("iteration over non-sequence");if(e.$d.mp$ass_subscript(new Sk.builtin.str("typecode"),n),e.$d.mp$ass_subscript(new Sk.builtin.str("__module__"),new Sk.builtin.str("array")),e.typecode=n,void 0===i)e.internalIterable=new Sk.builtin.list;else if(i instanceof Sk.builtin.list)e.internalIterable=i;else{e.internalIterable=new Sk.builtin.list;for(let n=Sk.abstr.iter(i),t=n.tp$iternext();void 0!==t;t=n.tp$iternext())Sk.misceval.callsimArray(e.internalIterable.append,[e.internalIterable,t])}})),n.__repr__=new Sk.builtin.func((function(e){var n=Sk.ffi.remapToJs(e.typecode),t="";return Sk.ffi.remapToJs(e.internalIterable).length&&(t="c"==Sk.ffi.remapToJs(e.typecode)?", \'"+Sk.ffi.remapToJs(e.internalIterable).join("")+"\'":", "+Sk.ffi.remapToJs(Sk.misceval.callsimArray(e.internalIterable.__repr__,[e.internalIterable]))),new Sk.builtin.str("array(\'"+n+"\'"+t+")")})),n.__str__=n.__repr__,n.__getattribute__=new Sk.builtin.func((function(e,n){return e.tp$getattr(n)})),n.append=new Sk.builtin.func((function(e,n){return Sk.misceval.callsimArray(e.internalIterable.append,[e.internalIterable,n]),Sk.builtin.none.none$})),n.extend=new Sk.builtin.func((function(e,n){if(Sk.builtin.pyCheckArgsLen("__init__",arguments.length,2,2),!Sk.builtin.checkIterable(n))throw new Sk.builtin.TypeError("iteration over non-sequence");for(let t=Sk.abstr.iter(n),i=t.tp$iternext();void 0!==i;i=t.tp$iternext())Sk.misceval.callsimArray(e.internalIterable.append,[e.internalIterable,i])}))}),"array",[]),n}',"src/lib/calendar.js":'function $builtinmodule(e){const t={},{misceval:{chain:n},importModule:r}=Sk,importOrSuspend=e=>r(e,!1,!0);return n(importOrSuspend("datetime"),(e=>(t.datetime=e,importOrSuspend("itertools"))),(e=>(t.iterRepeat=e.$d.repeat,t.iterChain=e.$d.chain,calendarModule(t))))}function calendarModule(e){const{abstr:{setUpModuleMethods:t,numberBinOp:n,iter:r,objectGetItem:o},builtin:{bool:s,bool:{true$:m,false$:d},func:l,int_:i,list:c,none:{none$:f},str:h,slice:w,tuple:y,range:u,max:_,min:g,property:k,print:p,enumerate:$,ValueError:b},ffi:{remapToPy:M},misceval:{isTrue:T,iterator:C,arrayFromIterable:O,buildClass:L,richCompareBool:x,asIndexOrThrow:F,objectRepr:I,callsimArray:A},global:v,global:{strftime:E}}=Sk,S=new i(0),H=new i(1),D=new i(2),N=new i(3),R=new i(6),j=new i(7),J=new i(9),P=new i(12),Y=new i(13),U=new i(24),z=new i(60),le=(e,t)=>x(e,t,"LtE"),eq=(e,t)=>x(e,t,"Eq"),mod=(e,t)=>n(e,t,"Mod"),add=(e,t)=>n(e,t,"Add"),sub=(e,t)=>n(e,t,"Sub"),mul=(e,t)=>n(e,t,"Mult"),inc=e=>add(e,H),dec=e=>sub(e,H),mod7=e=>mod(e,j),getA=(e,t)=>e.tp$getattr(new h(t)),callA=(e,t,...n)=>A(e.tp$getattr(new h(t)),n);function*iterJs(e){const t=r(e);let n;for(;n=t.tp$iternext();)yield n}function iterFn(e,t){return e=r(e),new C((()=>{const n=e.tp$iternext();return n&&t(n)}),!0)}function makePyMethod(e,t,{args:n,name:r,doc:o,defaults:s}){t.co_varnames=["self",...n||[]],t.co_docstring=o?new h(o):f,s&&(t.$defaults=s),t.co_name=new h(r),t.co_qualname=new h(e+"."+r);const m=new l(t);return m.$module=Q.__name__,m}const{datetime:B,iterRepeat:W,iterChain:q}=e;let{MINYEAR:G,MAXYEAR:X,date:V}=B.$d;const K=getA(h,"center"),pyCenter=(e,t)=>A(K,[e,t]),pyRStrip=e=>new h(e.toString().trimRight());G=G.valueOf(),X=X.valueOf();const Q={__name__:new h("calendar"),__all__:M(["IllegalMonthError","IllegalWeekdayError","setfirstweekday","firstweekday","isleap","leapdays","weekday","monthrange","monthcalendar","prmonth","month","prcal","calendar","timegm","month_name","month_abbr","day_name","day_abbr","Calendar","TextCalendar","HTMLCalendar","LocaleTextCalendar","LocaleHTMLCalendar","weekheader"])};function makeErr(e,t){return L(Q,((e,n)=>{n.__init__=new l((function __init__(e,t){e.$attr=t})),n.__str__=new l((function __str__(e){return new h(t.replace("$",I(e.$attr)))}))}),e,[b])}const Z=makeErr("IllegalMonthError","bad month $; must be 1-12"),ee=makeErr("IllegalWeekdayError","bad weekday number $; must be 0 (Monday) to 6 (Sunday)"),te=1,ae=2,ne=[0,31,28,31,30,31,30,31,31,30,31,30,31];function mkLocalizedCls(e,t){t.__init__=new l((function __init__(e,t){e.format=t})),t.__getitem__=new l((function __getitem__(t,n){const r=o(e,n);if(n instanceof w){const e=[];for(const n of r.valueOf())e.push(A(n,[t.format]));return new c(e)}return A(r,[t.format])}));const n=new i(e.valueOf().length);t.__len__=new l((function __len__(e){return n}))}const re=new h("strftime"),oe=L(Q,((e,t)=>{let n=[new l((e=>h.$empty))];for(let r=0;r<12;r++){const e=new V(2001,r+1,1);n.push(e.tp$getattr(re))}n=new c(n),t._months=n,mkLocalizedCls(n,t)}),"_localized_month"),se=L(Q,((e,t)=>{let n=[];for(let r=0;r<7;r++){const e=new V(2001,1,r+1);n.push(e.tp$getattr(re))}n=new c(n),t._days=n,mkLocalizedCls(n,t)}),"_localized_day"),me=A(se,[new h("%A")]),de=A(se,[new h("%a")]),ie=A(oe,[new h("%B")]),ce=A(oe,[new h("%b")]),[fe,he,we,ye,ue,_e,ge]=[0,1,2,3,4,5,6];function isleap(e){return(e=F(e))%4==0&&(e%100!=0||e%400==0)}function weekday(e,t,n){e=F(e),G<=e&&e<=X||(e=2e3+e%400);const r=A(V,[new i(e),t,n]);return callA(V,"weekday",r)}function monthrange(e,t){if(!le(H,t)||!le(t,P))throw A(Z,[t]);const n=weekday(e,t,H);t=F(t);const r=ne[t]+Number(t===ae&&isleap(e));return[n,new i(r)]}function iterweekdays(e){return iterFn(A(u,[e.fwd,add(e.fwd,j)]),mod7)}function itermonthdates(e,t,n){return iterFn(itermonthdays3(e,t,n),(e=>A(V,e.valueOf())))}function itermonthdays(e,t,n){const[r,o]=monthrange(t,n),s=mod7(sub(r,e.fwd)),m=A(W,[S,s]),d=A(u,[H,inc(o)]),l=mod7(sub(e.fwd,add(r,o))),i=A(W,[S,l]);return A(q,[m,d,i])}function itermonthdays2(e,t,n){return iterFn(A($,[itermonthdays(e,t,n),e.fwd]),(e=>{const[t,n]=e.valueOf();return new y([n,mod7(t)])}))}function itermonthdays3(e,t,n){const ymdIter=(e,t,n)=>iterFn(n,(n=>new y([e,t,n]))),[r,o]=monthrange(t,n),s=mod7(sub(r,e.fwd)),m=mod7(sub(e.fwd,add(r,o))),[d,l]=function _prevmonth(e,t){return eq(t,H)?[dec(e),P]:[e,dec(t)]}(t,n),c=inc(function _monthlen(e,t){return t=F(t),new i(ne[t]+Number(t===ae&&isleap(e)))}(d,l)),f=A(u,[sub(c,s),c]),h=A(u,[H,inc(o)]),[w,_]=function _nextmonth(e,t){return eq(t,P)?[inc(e),H]:[e,inc(t)]}(t,n),g=A(u,[H,inc(m)]);return A(q,[ymdIter(d,l,f),ymdIter(t,n,h),ymdIter(w,_,g)])}function itermonthdays4(e,t,n){const r=itermonthdays3(e,t,n);let o=0;return iterFn(r,(t=>new y([...t.valueOf(),mod7(add(e.fwd,new i(o++)))])))}function _monthIter(e,t,n,r){const o=O(e(t,n,r)),s=[];for(let m=0;m{const n=makePyMethod.bind(null,"Calendar"),r=["firstweekday"],o=["year","month"],s=["year","width"],m={__init__:n((function __init__(e,t){return Object.defineProperty(e,"fwd",{get(){return mod7(this._fwd)},set(e){return this._fwd=e,!0}}),e.fwd=t,f}),{name:"__init__",args:r,defaults:[S]}),getfirstweekday:n((function getfirstweekday(e){return e.fwd}),{name:"getfirstweekday"}),setfirstweekday:n((function setfirstweekday(e,t){return e.fwd=t,f}),{name:"setfirstweekday",args:r}),iterweekdays:n(iterweekdays,{name:"iterweekdays"}),itermonthdates:n(itermonthdates,{name:"itermonthdates",args:o}),itermonthdays:n(itermonthdays,{name:"itermonthdays",args:o}),itermonthdays2:n(itermonthdays2,{name:"itermonthdays2",args:o}),itermonthdays3:n(itermonthdays3,{name:"itermonthdays3",args:o}),itermonthdays4:n(itermonthdays4,{name:"itermonthdays4",args:o}),monthdatescalendar:n(monthdatescalendar,{name:"monthdatescalendar",args:o}),monthdays2calendar:n(monthdays2calendar,{name:"monthdays2calendar",args:o}),monthdayscalendar:n(monthdayscalendar,{name:"monthdayscalendar",args:o}),yeardatescalendar:n(yeardatescalendar,{name:"yeardatescalendar",args:s,defaults:[N]}),yeardays2calendar:n(yeardays2calendar,{name:"yeardays2calendar",args:s,defaults:[N]}),yeardayscalendar:n(yeardayscalendar,{name:"yeardayscalendar",args:s,defaults:[N]})};m.firstweekday=new k(m.getfirstweekday,m.setfirstweekday),Object.assign(t,m)}),"Calendar");function doTextFormatweekday(e,t,n){let r;return r=x(n,J,"GtE")?me:de,pyCenter(o(o(r,t),new w(f,n)),n)}function doTextFormatmonthname(e,t,n,r,s=!0){let m=o(ie,n);return T(s)&&(m=mod(new h("%s %r"),new y([m,t]))),pyCenter(m,r)}const pe=L(Q,((e,t)=>{const txtPrint=e=>p([e],["end",h.$empty]);const n=doTextFormatweekday;function formatweekheader(e,t){const n=[];for(const r of iterJs(iterweekdays(e)))n.push(callA(e,"formatweekday",r,t).toString());return new h(n.join(" "))}const r=doTextFormatmonthname;const o=makePyMethod.bind(null,"TextCalendar"),s={prweek:o((function prweek(e,t,n){txtPrint(callA(e,"formatweek",t,n))}),{name:"prweek",args:["theweek","width"]}),formatday:o((function formatday(e,t,n,r){let o;return o=eq(t,S)?h.$empty:mod(new h("%2i"),t),pyCenter(o,r)}),{name:"formatday",args:["day","weekday","width"]}),formatweek:o((function formatweek(e,t,n){const r=[];for(const o of iterJs(t)){const[t,s]=o.valueOf();r.push(callA(e,"formatday",t,s,n).toString())}return new h(r.join(" "))}),{name:"formatweek",args:["theweek","width"]}),formatweekday:o(n,{name:"formatweekday",args:["day","width"]}),formatweekheader:o(formatweekheader,{name:"formatweekheader",args:["width"]}),formatmonthname:o(r,{name:"formatmonthname",args:["theyear","themonth","width","withyear"],defaults:[m]}),prmonth:o((function prmonth(e,t,n,r,o){txtPrint(callA(e,"formatmonth",t,n,r,o))}),{name:"prmonth",args:["theyear","themonth","w","l"],defaults:[S,S]}),formatmonth:o((function formatmonth(e,t,n,r,o){const addNewLines=e=>new h(e+"\\n".repeat(o.valueOf()));r=_([D,r]),o=_([H,o]);let s=callA(e,"formatmonthname",t,n,dec(mul(j,inc(r))),!0);s=pyRStrip(s),s=addNewLines(s),s=add(s,pyRStrip(callA(e,"formatweekheader",r))),s=addNewLines(s);for(const m of iterJs(monthdays2calendar(e,t,n)))s=add(s,pyRStrip(callA(e,"formatweek",m,r))),s=addNewLines(s);return s}),{name:"formatmonth",args:["thyear","themonth","w","l"],defaults:[S,S]}),formatyear:o((function formatyear(e,t,n,r,o,s){n=_([D,n]),r=_([H,r]),o=_([D,o]);const m=dec(mul(inc(n),j));let d="";const a=e=>d+=e;a(pyRStrip(pyCenter(t.$r(),add(mul(m,s),mul(o,dec(s)))))),a("\\n".repeat(r));const l=formatweekheader(e,n);let f=0;for(const w of iterJs(yeardays2calendar(e,t,s))){const d=new i(f),y=inc(mul(s,d)),_=g([inc(mul(s,inc(d))),Y]),k=A(u,[y,_]);a("\\n".repeat(r));const p=iterFn(k,(n=>callA(e,"formatmonthname",t,n,m,!1)));a(pyRStrip(formatstring(p,m,o))),a("\\n".repeat(r));const $=iterFn(k,(e=>l));a(pyRStrip(formatstring($,m,o))),a("\\n".repeat(r));const b=Math.max(...w.valueOf().map((e=>e.valueOf().length)));for(let t=0;t=r.length?s.push(h.$empty):s.push(callA(e,"formatweek",r[t],n));a(pyRStrip(formatstring(new c(s),m,o))),a("\\n".repeat(r))}f++}return new h(d)}),{name:"formatyear",args:["theyear","w","l","c","m"],defaults:[D,H,R,N]}),pryear:o((function pryear(e,t,n,r,o,s){txtPrint(callA(e,"formatyear",t,n,r,o,s))}),{name:"pryear",args:["theyear","w","l","c","m"],defaults:[S,S,R,N]})};Object.assign(t,s)}),"TextCalendar",[ke]);function doHtmlFormatweekday(e,t){return new h(`${o(de,t)}`)}function doHtmlFormatmonthname(e,t,n,r=!0){let s=""+o(ie,n);return T(r)&&(s+=" "+t),new h(`${s}`)}const $e=L(Q,((e,t)=>{const n=M(["mon","tue","wed","thu","fri","sat","sun"]),r=n,s=new h("noday"),d=new h("month"),l=d,c=new h("year"),w=c,u=new h(\' \'),g=new h(\'%d\');const k=doHtmlFormatweekday;function formatweekheader(e){let t="";for(const n of iterJs(iterweekdays(e)))t+=callA(e,"formatweekday",n);return new h(`${t}`)}const p=doHtmlFormatmonthname;const $=makePyMethod.bind(null,"HTMLCalendar"),b={formatday:$((function formatday(e,t,n){return eq(t,S)?mod(u,getA(e,"cssclass_noday")):mod(g,new y([o(getA(e,"cssclasses"),n),t]))}),{name:"formatday",args:["day","weekday"]}),formatweek:$((function formatweek(e,t){let n="";for(const r of iterJs(t)){const[t,o]=r.valueOf();n+=callA(e,"formatday",t,o)}return new h(`${n}`)}),{name:"formatweek",args:["theweek"]}),formatweekday:$(k,{name:"formatweekday",args:["day"]}),formatweekheader:$(formatweekheader,{name:"formatweekheader"}),formatmonthname:$(p,{name:"formatmonthname",args:["theyear","themonth","withyear"],defaults:[m]}),formatmonth:$((function formatmonth(e,t,n,r=!0){let o="";const a=e=>o+=e+"\\n";a(``),a(callA(e,"formatmonthname",t,n,r)),a(formatweekheader(e));for(const s of iterJs(monthdays2calendar(e,t,n)))a(callA(e,"formatweek",s));return a("
"),new h(o)}),{name:"formatmonth",args:["thyear","themonth","withyear"],defaults:[m]}),formatyear:$((function formatyear(e,t,n){let r="";const a=e=>r+=e;n=_([n,H]).valueOf(),a(``),a("\\n"),a(``);for(let o=te;o");const r=Math.min(o+n,13);for(let n=o;n"),a(callA(e,"formatmonth",t,new i(n),!1)),a("");a("")}return a("
${t}
"),new h(r)}),{name:"formatyear",args:["theyear","width"],defaults:[N]}),formatyearpage:$((function formatyearpage(e,t,n=3,r="calendar.css",o=null){null!==o&&o!==f||(o=new h("utf-8"));let s="";const a=e=>s+=e;return a(`\\n`),a(\'\\n\'),a("\\n"),a("\\n"),a(`\\n`),r!==f&&a(`\\n`),a(`Calendar for ${t}\\n`),a("\\n"),a("\\n"),a(callA(e,"formatyear",t,n)),a("\\n"),a("\\n"),callA(h,"encode",new h(s),o,new h("ignore"))}),{name:"formatyearpage",args:["theyear","width","css","encoding"],defaults:[N,new h("calendar.css"),new h("utf-8")]}),cssclasses:n,cssclasses_weekday_head:r,cssclass_noday:s,cssclass_month_head:d,cssclass_month:l,cssclass_year_head:c,cssclass_year:w};Object.assign(t,b)}),"HTMLCalendar",[ke]);function withLocale(e,t){const n=E.localizeByIdentifier(e.toString());v.strftime=n;try{return t()}finally{v.strftime=E}}function localInit(e,t){T(t)||(t=new h("en_US")),e.locale=t}const be=L(Q,((e,t)=>{const n=makePyMethod.bind(null,"LocaleTextCalendar"),r={__init__:n((function __init__(e,t,n){return callA(pe,"__init__",e,t),localInit(e,n),f}),{name:"__init__",args:["firstweekday","locale"],defaults:[S,f]}),formatweekday:n((function formatweekday(e,t,n){return withLocale(e.locale,(()=>doTextFormatweekday(0,t,n)))}),{name:"formatweekday",args:["day","width"]}),formatmonthname:n((function formatmonthname(e,t,n,r,o){return withLocale(e.locale,(()=>doTextFormatmonthname(0,t,n,r,o)))}),{name:"formatmonthname",args:["theyear","themonth","width","withyear"],defaults:[m]})};Object.assign(t,r)}),"LocaleTextCalendar",[pe]),Me=L(Q,((e,t)=>{const n=makePyMethod.bind(null,"LocaleHTMLCalendar"),r={__init__:n((function __init__(e,t,n){return callA($e,"__init__",e,t),localInit(e,n),f}),{name:"__init__",args:["firstweekday","locale"],defaults:[S,f]}),formatweekday:n((function formatweekday(e,t){return withLocale(e.locale,(()=>doHtmlFormatweekday(e,t)))}),{name:"formatweekday",args:["day"]}),formatmonthname:n((function formatmonthname(e,t,n,r){return withLocale(e.locale,(()=>doHtmlFormatmonthname(e,t,n,r)))}),{name:"formatmonthname",args:["theyear","themonth","withyear"],defaults:[m]})};Object.assign(t,r)}),"LocaleHTMLCalendar",[$e]),Te=A(pe,[]);Object.assign(Q,{IllegalMonthError:Z,IllegalWeekdayError:ee,day_name:me,month_name:ie,day_abbr:de,month_abbr:ce,January:new i(te),February:new i(ae),mdays:M(ne),MONDAY:new i(fe),TUESDAY:new i(he),WEDNESDAY:new i(we),THURSDAY:new i(ye),FRIDAY:new i(ue),SATURDAY:new i(_e),SUNDAY:new i(ge),Calendar:ke,TextCalendar:pe,HTMLCalendar:$e,LocaleTextCalendar:be,LocaleHTMLCalendar:Me,c:Te,firstweekday:getA(Te,"getfirstweekday"),monthcalendar:getA(Te,"monthdayscalendar"),prweek:getA(Te,"prweek"),week:getA(Te,"formatweek"),weekheader:getA(Te,"formatweekheader"),prmonth:getA(Te,"prmonth"),month:getA(Te,"formatmonth"),calendar:getA(Te,"formatyear"),prcal:getA(Te,"pryear")});const Ce=new i(20),Oe=R;function formatstring(e,t,n){t||(t=Ce),n||(n=Oe),n=mul(n,new h(" "));const r=[];for(const o of iterJs(e))r.push(pyCenter(o,t).toString());return new h(r.join(n.toString()))}const Le=getA(V,"toordinal"),xe=A(Le,[new V(1970,1,1)]);return t("calendar",Q,{isleap:{$meth:e=>s(isleap(e)),$flags:{NamedArgs:["year"]},$doc:"Return True for leap years, False for non-leap years"},leapdays:{$meth(e,t){e=F(e)-1,t=F(t)-1;const n=Math.floor;return new i(n(t/4)-n(e/4)-(n(t/100)-n(e/100))+(n(t/400)-n(e/400)))},$flags:{MinArgs:2,MaxArgs:2}},weekday:{$meth:weekday,$flags:{NamedArgs:["year","month","day"]},$doc:"Return weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31)."},monthrange:{$meth:(e,t)=>new y(monthrange(e,t)),$flags:{NamedArgs:["year","month"]},$doc:"Return weekday (0-6 ~ Mon-Sun) and number of days (28-31) for year, month."},setfirstweekday:{$meth(e){const t=F(e);if(!(fe<=t&&t<=ge))throw A(ee,[e]);Te.fwd=e},$flags:{NamedArgs:["firstweekday"]}},format:{$meth:function format(e,t,n){return p([formatstring(e,t,n)]),f},$flags:{NamedArgs:["cols","colwidth","spacing"],Defaults:[Ce,Oe]}},formatstring:{$meth:formatstring,$flags:{NamedArgs:["cols","colwidth","spacing"],Defaults:[Ce,Oe]}},timegm:{$meth(e){const[t,n,r,o,s,m]=e.valueOf(),d=A(V,[t,n,H]),l=A(Le,[d]),i=add(sub(l,xe),dec(r)),c=add(mul(i,U),o),f=add(mul(c,z),s);return add(mul(f,z),m)},$flags:{OneArg:!0}}}),Q}',"src/lib/collections.js":'function $builtinmodule(t){const e={};return Sk.misceval.chain(Sk.importModule("keyword",!1,!0),(t=>(e._iskeyword=t.$d.iskeyword,Sk.importModule("itertools",!1,!0))),(t=>(e._chain=t.$d.chain,e._starmap=t.$d.starmap,e._repeat=t.$d.repeat,Sk.importModule("operator",!1,!0))),(t=>{e._itemgetter=t.$d.itemgetter}),(()=>collections_mod(e)))}function collections_mod(t){function counterNumberSlot(e){return function(i){if(void 0!==i&&!(i instanceof t.Counter))return Sk.builtin.NotImplemented.NotImplemented$;const s=new t.Counter;return e.call(this,s,i),s}}function counterInplaceSlot(t,e){return function(i){if(!(i instanceof Sk.builtin.dict))throw new Sk.builtin.TypeError("Counter "+t+"= "+Sk.abstr.typeName(i)+" is not supported");return e.call(this,i),this.keep$positive()}}t.__all__=new Sk.builtin.list(["deque","defaultdict","namedtuple","Counter","OrderedDict"].map((t=>new Sk.builtin.str(t)))),t.defaultdict=Sk.abstr.buildNativeClass("collections.defaultdict",{constructor:function defaultdict(t,e){this.default_factory=t,Sk.builtin.dict.call(this,e)},base:Sk.builtin.dict,methods:{copy:{$meth(){return this.$copy()},$flags:{NoArgs:!0}},__copy__:{$meth(){return this.$copy()},$flags:{NoArgs:!0}},__missing__:{$meth(t){if(Sk.builtin.checkNone(this.default_factory))throw new Sk.builtin.KeyError(Sk.misceval.objectRepr(t));{const e=Sk.misceval.callsimArray(this.default_factory,[]);return this.mp$ass_subscript(t,e),e}},$flags:{OneArg:!0}}},getsets:{default_factory:{$get(){return this.default_factory},$set(t){t=t||Sk.builtin.none.none$,this.default_factory=t}}},slots:{tp$doc:"defaultdict(default_factory[, ...]) --\\x3e dict with default factory\\n\\nThe default factory is called without arguments to produce\\na new value when a key is not present, in __getitem__ only.\\nA defaultdict compares equal to a dict with the same items.\\nAll remaining arguments are treated the same as if they were\\npassed to the dict constructor, including keyword arguments.\\n",tp$init(t,e){const i=t.shift();if(void 0===i)this.default_factory=Sk.builtin.none.none$;else{if(!Sk.builtin.checkCallable(i)&&!Sk.builtin.checkNone(i))throw new Sk.builtin.TypeError("first argument must be callable");this.default_factory=i}return Sk.builtin.dict.prototype.tp$init.call(this,t,e)},$r(){const t=Sk.misceval.objectRepr(this.default_factory),e=Sk.builtin.dict.prototype.$r.call(this).v;return new Sk.builtin.str("defaultdict("+t+", "+e+")")}},proto:{$copy(){const e=[];return Sk.misceval.iterFor(Sk.abstr.iter(this),(t=>{e.push(t),e.push(this.mp$subscript(t))})),new t.defaultdict(this.default_factory,e)}}}),t.Counter=Sk.abstr.buildNativeClass("Counter",{constructor:function Counter(){this.$d=new Sk.builtin.dict,Sk.builtin.dict.apply(this)},base:Sk.builtin.dict,methods:{elements:{$flags:{NoArgs:!0},$meth(){const e=t._chain.tp$getattr(new Sk.builtin.str("from_iterable")),i=t._starmap,s=t._repeat,n=Sk.misceval.callsimArray;return n(e,[n(i,[s,n(this.tp$getattr(this.str$items))])])}},most_common:{$flags:{NamedArgs:["n"],Defaults:[Sk.builtin.none.none$]},$meth(t){const e=this.sq$length();t=Sk.builtin.checkNone(t)||(t=Sk.misceval.asIndexOrThrow(t))>e?e:t<0?0:t;const i=this.$items().sort(((t,e)=>Sk.misceval.richCompareBool(t[1],e[1],"Lt")?1:Sk.misceval.richCompareBool(t[1],e[1],"Gt")?-1:0));return new Sk.builtin.list(i.slice(0,t).map((t=>new Sk.builtin.tuple(t))))}},update:{$flags:{FastCall:!0},$meth(t,e){return Sk.abstr.checkArgsLen("update",t,0,1),this.counter$update(t,e)}},subtract:{$flags:{FastCall:!0},$meth(t,e){Sk.abstr.checkArgsLen("subtract",t,0,1);const i=t[0];if(void 0!==i)if(i instanceof Sk.builtin.dict)for(let s=Sk.abstr.iter(i),n=s.tp$iternext();void 0!==n;n=s.tp$iternext()){const t=this.mp$subscript(n);this.mp$ass_subscript(n,Sk.abstr.numberBinOp(t,i.mp$subscript(n),"Sub"))}else for(let s=Sk.abstr.iter(i),n=s.tp$iternext();void 0!==n;n=s.tp$iternext()){const t=this.mp$subscript(n);this.mp$ass_subscript(n,Sk.abstr.numberBinOp(t,this.$one,"Sub"))}e=e||[];for(let s=0;s>> c = Counter(\'abcdeabcdabcaba\') # count elements from a string\\n\\n >>> c.most_common(3) # three most common elements\\n [(\'a\', 5), (\'b\', 4), (\'c\', 3)]\\n >>> sorted(c) # list all unique elements\\n [\'a\', \'b\', \'c\', \'d\', \'e\']\\n >>> \'\'.join(sorted(c.elements())) # list elements with repetitions\\n \'aaaaabbbbcccdde\'\\n >>> sum(c.values()) # total of all counts\\n 15\\n\\n >>> c[\'a\'] # count of letter \'a\'\\n 5\\n >>> for elem in \'shazam\': # update counts from an iterable\\n ... c[elem] += 1 # by adding 1 to each element\'s count\\n >>> c[\'a\'] # now there are seven \'a\'\\n 7\\n >>> del c[\'b\'] # remove all \'b\'\\n >>> c[\'b\'] # now there are zero \'b\'\\n 0\\n\\n >>> d = Counter(\'simsalabim\') # make another counter\\n >>> c.update(d) # add in the second counter\\n >>> c[\'a\'] # now there are nine \'a\'\\n 9\\n\\n >>> c.clear() # empty the counter\\n >>> c\\n Counter()\\n\\n Note: If a count is set to zero or reduced to zero, it will remain\\n in the counter until the entry is deleted or the counter is cleared:\\n\\n >>> c = Counter(\'aaabbc\')\\n >>> c[\'b\'] -= 2 # reduce the count of \'b\' by two\\n >>> c.most_common() # \'b\' is still in, but its count is zero\\n [(\'a\', 3), (\'c\', 1), (\'b\', 0)]\\n\\n",tp$init(t,e){return Sk.abstr.checkArgsLen(this.tpjs_name,t,0,1),this.counter$update(t,e)},$r(){const t=this.size>0?Sk.builtin.dict.prototype.$r.call(this).v:"";return new Sk.builtin.str(Sk.abstr.typeName(this)+"("+t+")")},tp$as_sequence_or_mapping:!0,mp$ass_subscript(t,e){return void 0===e?this.mp$lookup(t)&&Sk.builtin.dict.prototype.mp$ass_subscript.call(this,t,e):Sk.builtin.dict.prototype.mp$ass_subscript.call(this,t,e)},tp$as_number:!0,nb$positive:counterNumberSlot((function(t){this.$items().forEach((([e,i])=>{Sk.misceval.richCompareBool(i,this.$zero,"Gt")&&t.mp$ass_subscript(e,i)}))})),nb$negative:counterNumberSlot((function(t){this.$items().forEach((([e,i])=>{Sk.misceval.richCompareBool(i,this.$zero,"Lt")&&t.mp$ass_subscript(e,Sk.abstr.numberBinOp(this.$zero,i,"Sub"))}))})),nb$subtract:counterNumberSlot((function(t,e){this.$items().forEach((([i,s])=>{const n=Sk.abstr.numberBinOp(s,e.mp$subscript(i),"Sub");Sk.misceval.richCompareBool(n,this.$zero,"Gt")&&t.mp$ass_subscript(i,n)})),e.$items().forEach((([e,i])=>{void 0===this.mp$lookup(e)&&Sk.misceval.richCompareBool(i,this.$zero,"Lt")&&t.mp$ass_subscript(e,Sk.abstr.numberBinOp(this.$zero,i,"Sub"))}))})),nb$add:counterNumberSlot((function(t,e){this.$items().forEach((([i,s])=>{const n=Sk.abstr.numberBinOp(s,e.mp$subscript(i),"Add");Sk.misceval.richCompareBool(n,this.$zero,"Gt")&&t.mp$ass_subscript(i,n)})),e.$items().forEach((([e,i])=>{void 0===this.mp$lookup(e)&&Sk.misceval.richCompareBool(i,this.$zero,"Gt")&&t.mp$ass_subscript(e,i)}))})),nb$inplace_add:counterInplaceSlot("+",(function(t){t.$items().forEach((([t,e])=>{const i=Sk.abstr.numberInplaceBinOp(this.mp$subscript(t),e,"Add");this.mp$ass_subscript(t,i)}))})),nb$inplace_subtract:counterInplaceSlot("-",(function(t){t.$items().forEach((([t,e])=>{const i=Sk.abstr.numberInplaceBinOp(this.mp$subscript(t),e,"Sub");this.mp$ass_subscript(t,i)}))})),nb$or:counterNumberSlot((function(t,e){this.$items().forEach((([i,s])=>{const n=e.mp$subscript(i),r=Sk.misceval.richCompareBool(s,n,"Lt")?n:s;Sk.misceval.richCompareBool(r,this.$zero,"Gt")&&t.mp$ass_subscript(i,r)})),e.$items().forEach((([e,i])=>{void 0===this.mp$lookup(e)&&Sk.misceval.richCompareBool(i,this.$zero,"Gt")&&t.mp$ass_subscript(e,i)}))})),nb$and:counterNumberSlot((function(t,e){this.$items().forEach((([i,s])=>{const n=e.mp$subscript(i),r=Sk.misceval.richCompareBool(s,n,"Lt")?s:n;Sk.misceval.richCompareBool(r,this.$zero,"Gt")&&t.mp$ass_subscript(i,r)}))})),nb$inplace_and:counterInplaceSlot("&",(function(t){this.$items().forEach((([e,i])=>{const s=t.mp$subscript(e);Sk.misceval.richCompareBool(s,i,"Lt")&&this.mp$ass_subscript(e,s)}))})),nb$inplace_or:counterInplaceSlot("|",(function(t){t.$items().forEach((([t,e])=>{Sk.misceval.richCompareBool(e,this.mp$subscript(t),"Gt")&&this.mp$ass_subscript(t,e)}))})),nb$reflected_and:null,nb$reflected_or:null,nb$reflected_add:null,nb$reflected_subtract:null},proto:{keep$positive(){return this.$items().forEach((([t,e])=>{Sk.misceval.richCompareBool(e,this.$zero,"LtE")&&this.mp$ass_subscript(t)})),this},$zero:new Sk.builtin.int_(0),$one:new Sk.builtin.int_(1),str$items:new Sk.builtin.str("items"),counter$update(t,e){const i=t[0];if(void 0!==i)if(Sk.builtin.checkMapping(i))if(this.sq$length())for(let s=Sk.abstr.iter(i),n=s.tp$iternext();void 0!==n;n=s.tp$iternext()){const t=this.mp$subscript(n);this.mp$ass_subscript(n,Sk.abstr.numberBinOp(t,i.mp$subscript(n),"Add"))}else this.update$common(t,void 0,"update");else for(let s=Sk.abstr.iter(i),n=s.tp$iternext();void 0!==n;n=s.tp$iternext()){const t=this.mp$subscript(n);this.mp$ass_subscript(n,Sk.abstr.numberBinOp(t,this.$one,"Add"))}if(e&&e.length)if(this.sq$length())for(let s=0;s`(${Sk.misceval.objectRepr(t)}, ${Sk.misceval.objectRepr(e)})`));return t=0===t.length?"":"["+t.join(", ")+"]",this.in$repr=!1,new Sk.builtin.str(Sk.abstr.typeName(this)+"("+t+")")},tp$richcompare(e,i){if("Eq"!==i&&"Ne"!==i)return Sk.builtin.NotImplemented.NotImplemented$;if(!(e instanceof t.OrderedDict))return Sk.builtin.dict.prototype.tp$richcompare.call(this,e,i);const s="Eq"==i,n=this.size;if(n!==e.size)return!s;const r=e.$items(),a=this.$items();for(let t=0;t=r||l>=a)switch(i){case"Lt":return ra;case"GtE":return r>=a}return"Eq"!==i&&("NotEq"===i||Sk.misceval.richCompareBool(n[this.head+l&this.mask],e[s.head+l&s.mask],i))},tp$iter(){return new e(this)},$r(){const t=[],e=this.tail-this.head&this.mask;if(this.$entered_repr)return new Sk.builtin.str("[...]");this.$entered_repr=!0;for(let s=0;s=e||t<-e)throw new Sk.builtin.IndexError("deque index out of range");const i=(t>=0?this.head:this.tail)+t&this.mask;return this.v[i]},mp$ass_subscript(t,e){t=Sk.misceval.asIndexOrThrow(t);const i=this.tail-this.head&this.mask;if(t>=i||t<-i)throw new Sk.builtin.IndexError("deque index out of range");void 0===e?this.del$item(t):this.set$item(t,e)},nb$inplace_add(t){this.maxlen=void 0;for(let e=Sk.abstr.iter(t),i=e.tp$iternext();void 0!==i;i=e.tp$iternext())this.$push(i);return this},nb$inplace_multiply(t){(t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError,"can\'t multiply sequence by non-int of type \'{tp$name}\'"))<=0&&this.$clear();const e=this.$copy(),i=this.tail-this.head&this.mask;for(let s=1;s integer -- return number of occurrences of value"},extend:{$meth(t){return this.$extend(t),Sk.builtin.none.none$},$flags:{OneArg:!0},$textsig:null,$doc:"Extend the right side of the deque with elements from the iterable"},extendleft:{$meth(t){for(let e=Sk.abstr.iter(t),i=e.tp$iternext();void 0!==i;i=e.tp$iternext())this.$pushLeft(i);return Sk.builtin.none.none$},$flags:{OneArg:!0},$textsig:null,$doc:"Extend the left side of the deque with elements from the iterable"},index:{$meth(t,e,i){const s=this.$index(t,e,i);if(void 0!==s)return new Sk.builtin.int_(s);throw new Sk.builtin.ValueError(Sk.misceval.objectRepr(t)+" is not in deque")},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"D.index(value, [start, [stop]]) -> integer -- return first index of value.\\nRaises ValueError if the value is not present."},insert:{$meth(t,e){t=Sk.misceval.asIndexOrThrow(t,"integer argument expected, got {tp$name}");const i=this.tail-this.head&this.mask;if(void 0!==this.maxlen&&i>=this.maxlen)throw new Sk.builtin.IndexError("deque already at its maximum size");t>i&&(t=i),t<=-i&&(t=0);const s=(t>=0?this.head:this.tail)+t&this.mask;let n=this.tail;for(this.tail=this.tail+1&this.mask;n!==s;){const t=n-1&this.mask;this.v[n]=this.v[t],n=t}return this.v[s]=e,this.head===this.tail&&this.$resize(this.v.length,this.v.length<<1),Sk.builtin.none.none$},$flags:{MinArgs:2,MaxArgs:2},$textsig:null,$doc:"D.insert(index, object) -- insert object before index"},pop:{$meth(){return this.$pop()},$flags:{NoArgs:!0},$textsig:null,$doc:"Remove and return the rightmost element."},popleft:{$meth(){return this.$popLeft()},$flags:{NoArgs:!0},$textsig:null,$doc:"Remove and return the leftmost element."},remove:{$meth(t){const e=this.$index(t);if(void 0===e)throw new Sk.builtin.ValueError(Sk.misceval.objectRepr(t)+" is not in deque");let i=this.head+e&this.mask;for(;i!==this.tail;){const t=i+1&this.mask;this.v[i]=this.v[t],i=t}this.tail=this.tail-1&this.mask;var s=this.tail-this.head&this.mask;s>>1&&this.$resize(s,this.v.length>>>1)},$flags:{OneArg:!0},$textsig:null,$doc:"D.remove(value) -- remove first occurrence of value."},__reversed__:{$meth(){return new i(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"D.__reversed__() -- return a reverse iterator over the deque"},reverse:{$meth(){const t=this.head,e=this.tail,i=this.mask,s=this.tail-this.head&this.mask;for(let n=0;n<~~(s/2);n++){const s=e-n-1&i,r=t+n&i,a=this.v[s];this.v[s]=this.v[r],this.v[r]=a}return Sk.builtin.none.none$},$flags:{NoArgs:!0},$textsig:null,$doc:"D.reverse() -- reverse *IN PLACE*"},rotate:{$meth(t){t=void 0===t?1:Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError);const e=this.head,i=this.tail;if(0===t||e===i)return this;if(this.head=e-t&this.mask,this.tail=i-t&this.mask,t>0)for(let s=1;s<=t;s++){const t=e-s&this.mask,n=i-s&this.mask;this.v[t]=this.v[n],this.v[n]=void 0}else for(let s=0;s>t;s--){const t=i-s&this.mask,n=e-s&this.mask;this.v[t]=this.v[n],this.v[n]=void 0}return Sk.builtin.none.none$},$flags:{MinArgs:0,MaxArgs:1},$textsig:null,$doc:"Rotate the deque n steps to the right (default n=1). If n is negative, rotates left."}},classmethods:Sk.generic.classGetItem,getsets:{maxlen:{$get(){return void 0===this.maxlen?Sk.builtin.none.none$:new Sk.builtin.int_(this.maxlen)},$doc:"maximum size of a deque or None if unbounded"}},proto:{$clear(){this.head=0,this.tail=0,this.mask=1,this.v=new Array(2)},$copy(){return new t.deque(this.v.slice(0),this.maxlen,this.head,this.tail,this.mask)},$extend(t){for(let e=Sk.abstr.iter(t),i=e.tp$iternext();void 0!==i;i=e.tp$iternext())this.$push(i)},set$item(t,e){const i=(t>=0?this.head:this.tail)+t&this.mask;this.v[i]=e},del$item(t){let e=(t>=0?this.head:this.tail)+t&this.mask;for(;e!==this.tail;){const t=e+1&this.mask;this.v[e]=this.v[t],e=t}const i=this.tail-this.head&this.mask;this.tail=this.tail-1&this.mask,i>>1&&this.$resize(i,this.v.length>>>1)},$push(t){this.v[this.tail]=t,this.tail=this.tail+1&this.mask,this.head===this.tail&&this.$resize(this.v.length,this.v.length<<1);const e=this.tail-this.head&this.mask;return void 0!==this.maxlen&&e>this.maxlen&&this.$popLeft(),this},$pushLeft(t){this.head=this.head-1&this.mask,this.v[this.head]=t,this.head===this.tail&&this.$resize(this.v.length,this.v.length<<1);const e=this.tail-this.head&this.mask;return void 0!==this.maxlen&&e>this.maxlen&&this.$pop(),this},$pop(){if(this.head===this.tail)throw new Sk.builtin.IndexError("pop from an empty deque");this.tail=this.tail-1&this.mask;const t=this.v[this.tail];this.v[this.tail]=void 0;const e=this.tail-this.head&this.mask;return e>>1&&this.$resize(e,this.v.length>>>1),t},$popLeft(){if(this.head===this.tail)throw new Sk.builtin.IndexError("pop from an empty deque");const t=this.v[this.head];this.v[this.head]=void 0,this.head=this.head+1&this.mask;const e=this.tail-this.head&this.mask;return e>>1&&this.$resize(e,this.v.length>>>1),t},$resize(t,e){const i=this.head,s=this.mask;if(this.head=0,this.tail=t,this.mask=e-1,0===i)return void(this.v.length=e);const n=new Array(e);for(let r=0;r=0?i:i<-s?0:s+i;for(let o=e>=0?e:e<-s?0:s+e;o=this.$length)return;const t=(this.$index>=0?this.$head:this.$tail)+this.$index&this.$mask;return this.$index++,this.dq[t]},methods:{__length_hint__:{$meth:function __length_hint__(){return new Sk.builtin.int_(this.$length-this.$index)},$flags:{NoArgs:!0}}}}),i=Sk.abstr.buildIteratorClass("_collections._deque_reverse_iterator",{constructor:function _deque_reverse_iterator(t){this.$index=(t.tail-t.head&t.mask)-1,this.dq=t.v,this.$head=t.head,this.$mask=t.mask},iternext(){if(this.$index<0)return;const t=this.$head+this.$index&this.$mask;return this.$index--,this.dq[t]},methods:{__length_hint__:Sk.generic.iterReverseLengthHintMethodDef}}),s=new RegExp(/^[0-9].*/),n=new RegExp(/^[0-9_].*/),r=new RegExp(/^\\w*$/),a=/,/g,o=/\\s+/;function namedtuple(e,i,l,h,c){if(e=e.tp$str(),Sk.misceval.isTrue(Sk.misceval.callsimArray(t._iskeyword,[e])))throw new Sk.builtin.ValueError("Type names and field names cannot be a keyword: \'"+Sk.misceval.objectRepr(e)+"\'");const u=e.$jsstr();if(s.test(u)||!r.test(u)||!u)throw new Sk.builtin.ValueError("Type names and field names must be valid identifiers: \'"+u+"\'");let m,d;if(Sk.builtin.checkString(i))m=i.$jsstr().replace(a," ").split(o),1==m.length&&""===m[0]&&(m=[]),d=m.map((t=>new Sk.builtin.str(t)));else{m=[],d=[];for(let t=Sk.abstr.iter(i),e=t.tp$iternext();void 0!==e;e=t.tp$iternext())e=e.tp$str(),d.push(e),m.push(e.$jsstr())}let p=new Set;if(Sk.misceval.isTrue(l))for(let s=0;sm.length)throw new Sk.builtin.TypeError("Got more default values than field names");for(let t=0,e=d.length-b.length;e"\'"+t.$jsstr()+"\'"))+"]")}return r}_make.co_varnames=["_cls","iterable"],_asdict.co_varnames=["self"],_replace.co_kwargs=1,_replace.co_varnames=["_self"];const S={};for(let s=0;sm[e]+"="+Sk.misceval.objectRepr(t)));return new Sk.builtin.str(Sk.abstr.typeName(this)+"("+t.join(", ")+")")}},flags:{sk$klass:!0},proto:Object.assign({__module__:Sk.builtin.checkNone(c)?Sk.globals.__name__:c,__slots__:new Sk.builtin.tuple,_fields:$,_field_defaults:f,_make:new Sk.builtin.classmethod(new Sk.builtin.func(_make)),_asdict:new Sk.builtin.func(_asdict),_replace:new Sk.builtin.func(_replace)},S)})}return namedtuple.co_argcount=2,namedtuple.co_kwonlyargcount=3,namedtuple.$kwdefs=[Sk.builtin.bool.false$,Sk.builtin.none.none$,Sk.builtin.none.none$],namedtuple.co_varnames=["typename","field_names","rename","defaults","module"],t.namedtuple=new Sk.builtin.func(namedtuple),t}',"src/lib/datetime.js":'function $builtinmodule(){const{isTrue:t,richCompareBool:e,asIndexOrThrow:n,asIndexSized:i,objectRepr:s,opAllowsEquality:o,callsimArray:r,callsimOrSuspendArray:a}=Sk.misceval,{numberBinOp:$,typeName:c,buildNativeClass:h,checkArgsLen:m,objectHash:u,copyKeywordsToNamedArgs:l}=Sk.abstr,{int_:f,float_:d,str:w,bytes:_,tuple:p,bool:{true$:g},none:{none$:y},NotImplemented:{NotImplemented$:b},TypeError:z,ValueError:v,OverflowError:M,ZeroDivisionError:A,NotImplementedError:x,checkNumber:N,checkFloat:S,checkString:k,checkInt:O,asnum$:I,round:E,getattr:T}=Sk.builtin,{remapToPy:D,remapToJs:R}=Sk.ffi,intRound=t=>E(t).nb$int(),q=$,C=new w("auto"),U=new w("utcoffset"),Y=new w("tzname"),j=new w("as_integer_ratio"),F=new w("dst"),H=new w("isoformat"),J=new w("replace"),B=new w("fromtimestamp"),G=new w("fromordinal"),L=new w("utcfromtimestamp"),X=new w("strftime"),P=new w("fromutc"),W=new f(0),Z=new d(0),K=new f(7),V=new f(60),Q=new f(3600),tt=new f(1e3),et=new f(1e6),nt=new d(1e6),it=new f(86400),st=new d(86400);let ot=null;function pyDivMod(t,e){return q(t,e,"DivMod").v}function $divMod(t,e){if("number"!=typeof t||"number"!=typeof e)return t=JSBI.BigInt(t),e=JSBI.BigInt(e),[JSBI.toNumber(JSBI.divide(t,e)),JSBI.toNumber(JSBI.remainder(t,e))];if(0===e)throw new A("integer division or modulo by zero");return[Math.floor(t/e),t-Math.floor(t/e)*e]}function modf(t){const e=(t=I(t))<0?-1:1;return t=Math.abs(t),[new d(e*(t-Math.floor(t))),new d(e*Math.floor(t))]}function _d(t,e="0",n=2){return t.toString().padStart(n,e)}const rt=/^[0-9]+$/;function _as_integer(t){if(!rt.test(t))throw new Error;return parseInt(t)}function _as_int_ratio(t){let e=r(t.tp$getattr(j));if(!(e instanceof p))throw new z("unexpected return type from as_integer_ratio(): expected tuple, got \'"+c(e)+"\'");if(e=e.v,2!==e.length)throw new v("as_integer_ratio() must return a 2-tuple");return e}return Sk.misceval.chain(Sk.importModule("time",!1,!0),(a=>{const $=a.$d,E={__name__:new w("datetime"),__all__:new Sk.builtin.list(["date","datetime","time","timedelta","timezone","tzinfo","MINYEAR","MAXYEAR"].map((t=>new w(t))))};function _cmp(t,e){for(let n=0;ne[n]?1:-1;return 0}function _do_compare(t,e,n){const i=t.$cmp(e,n);switch(n){case"Lt":return i<0;case"LtE":return i<=0;case"Eq":return 0===i;case"NotEq":return 0!==i;case"Gt":return i>0;case"GtE":return i>=0}}const j=9999;E.MINYEAR=new f(1),E.MAXYEAR=new f(j);const rt=3652059,at=[-1,31,28,31,30,31,30,31,31,30,31,30,31],$t=[-1];let ct=0;function _is_leap(t){return t%4==0&&(t%100!=0||t%400==0)}function _days_before_year(t){const e=t-1;return 365*e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400)}function _days_before_month(t,e){return $t[e]+(e>2&&_is_leap(t))}function _ymd2ord(t,e,n){return _days_before_year(t)+_days_before_month(t,e)+n}at.slice(1).forEach((t=>{$t.push(ct),ct+=t}));const ht=_days_before_year(401),mt=_days_before_year(101),ut=_days_before_year(5);function _ord2ymd(t){if((t=n(t))>Number.MAX_SAFE_INTEGER)throw new M("Python int too large to convert to js number");if(t<1)throw new v("ordinal must be >= 1");let e,i,s,o;t-=1,[e,t]=$divMod(t,ht);let r=400*e+1;if([i,t]=$divMod(t,mt),[s,t]=$divMod(t,ut),[o,t]=$divMod(t,365),r+=100*i+4*s+o,4===o||4===i)return[r-1,12,31].map((t=>new f(t)));const a=3===o&&(24!==s||3===i);let $=t+50>>5,c=$t[$]+($>2&&a);return c>t&&($-=1,c-=at[$]+(2===$&&a)),[r,$,(t-=c)+1].map((t=>new f(t)))}const lt=[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ft=[null,"Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function _build_struct_time(t,e,n,i,s,o,r){const a=(_ymd2ord(t,e,n)+6)%7,c=_days_before_month(t,e)+n;return $.struct_time.tp$call([new p([t,e,n,i,s,o,a,c,r].map((t=>new f(t))))])}const dt={hours:t=>_d(t),minutes:(t,e)=>_d(t)+":"+_d(e),seconds:(t,e,n)=>_d(t)+":"+_d(e)+":"+_d(n),milliseconds:(t,e,n,i)=>_d(t)+":"+_d(e)+":"+_d(n)+"."+_d(i,"0",3),microseconds:(t,e,n,i)=>_d(t)+":"+_d(e)+":"+_d(n)+"."+_d(i,"0",6)};function _format_time(t,e,n,i,s="auto"){if("string"!=typeof s&&!k(s))throw new z("must be str, not "+c(s));"auto"===(s=s.toString())?s=i?"microseconds":"seconds":"milliseconds"===s&&(i=Math.floor(i/1e3));let o=dt[s];if(void 0===o)throw new v("Unknown timespec value");return o(t,e,n,i)}function _format_offset(t){let e,n="";if(t!==y){let i,s,o;return t.$days<0?(e="-",t=new wt(-t.$days,-t.$secs,-t.$micro)):e="+",[i,s]=pyDivMod(t,pt),[s,o]=pyDivMod(s,gt),n+=e+`${_d(i)}:${_d(s)}`,(o.$secs||o.$micro)&&(n+=":"+_d(o.$secs,"0",2),o.$micro&&(n+="."+_d(o.$micro,"0",6))),n}}function _wrap_strftime(t,e,n){let i=null,s=null,o=null,a=[],c=0;const h=e.length;for(;cnew f(t)))}function _parse_hh_mm_ss_ff(t){const e=t.length,n=[0,0,0,0];let i=0;for(let s=0;s<3;s++){if(e-i<2)throw new v("Incomplete time component");n[s]=_as_integer(t.slice(i,i+2)),i+=2;const o=t.substr(i,1);if(!o||s>=2)break;if(":"!==o)throw new v("Invalid time separator: "+o);i+=1}if(i0?t.slice(0,e-1):t),s=y;if(e>0){if(n=t.slice(e),![5,8,15].includes(n.length))throw new v("Malformed time zone string");const i=_parse_hh_mm_ss_ff(n);if(i.every((t=>0===t)))s=St.prototype.utc;else{const n="-"===t[e-1]?-1:1,o=new wt(0,n*(3600*i[0]+60*i[1]+i[2]),n*i[3]);s=new St(o)}}return i=i.map((t=>new f(t))),i.push(s),i}function _check_tzname(t){if(t!==y&&!k(t))throw new z("tzinfo.tzname() must return None or string, not \'"+c(t)+"\'")}function _check_utc_offset(t,n){if(n!==y){if(!(n instanceof wt))throw new z(`tzinfo.${t}() must return None or timedelta, not \'${c(n)}\'`);if(!e(zt,n,"Lt")||!e(n,_t,"Lt"))throw new v(`${t}()=${n.toString()}, must be strictly between -timedelta(hours=24) and timedelta(hours=24)`)}}function _check_date_fields(t,e=null,i=null){if(null===e||null===i){throw new z(`function missing required argument \'${null===i?"day":"month"}\' (pos ${null===i?"3":"2"})`)}if(t=n(t),e=n(e),i=n(i),!(1<=t&&t<=j))throw new v("year must be in 1.."+j,new f(t));if(!(1<=e&&e<=12))throw new v("month must be in 1..12",new f(e));const s=function _days_in_month(t,e){return 2===e&&_is_leap(t)?29:at[e]}(t,e);if(!(1<=i&&i<=s))throw new v("day must be in 1.."+s,new f(i));return[t,e,i]}function _check_time_fields(t,e,i,s,o){if(t=n(t),e=n(e),i=n(i),s=n(s),o=n(o),!(0<=t&&t<=23))throw new v("hour must be in 0..23",new f(t));if(!(0<=e&&e<=59))throw new v("minute must be in 0..59",new f(e));if(!(0<=i&&i<=59))throw new v("second must be in 0..59",new f(i));if(!(0<=s&&s<=999999))throw new v("microsecond must be in 0..999999",new f(s));if(0!==o&&1!==o)throw new v("fold must be either 0 or 1",new f(o));return[t,e,i,s,o]}function _check_tzinfo_arg(t){if(t!==y&&!(t instanceof Mt))throw new z("tzinfo argument must be None or of a tzinfo subclass")}function _divide_and_round(t,e){let[n,i]=$divMod(t,e);return i*=2,((e>0?i>e:i999999999)throw new M(`days=${t}; must have magnitude <= 999999999`)},slots:{tp$new(t,e){let i,s,o,r,a,$,c,[h,m,u,d,w,_,p]=l("timedelta",["days","seconds","microseconds","milliseconds","minutes","hours","weeks"],t,e,new Array(7).fill(W));i=s=o=W,h=q(h,q(p,K,"Mult"),"Add"),m=q(m,q(q(w,V,"Mult"),q(_,Q,"Mult"),"Add"),"Add"),u=q(u,q(d,tt,"Mult"),"Add"),S(h)?([r,h]=modf(h),[a,$]=modf(q(r,st,"Mult")),s=new f($),i=new f(h)):(a=Z,i=h),S(m)?([c,m]=modf(m),m=new f(m),c=q(c,a,"Add")):c=a,[h,m]=pyDivMod(m,it),i=q(i,h,"Add"),s=q(s,new f(m),"Add");const g=q(c,nt,"Mult");if(S(u)?(u=intRound(q(u,g,"Add")),[m,u]=pyDivMod(u,et),[h,m]=pyDivMod(m,it),i=q(i,h,"Add"),s=q(s,m,"Add")):(u=new f(u),[m,u]=pyDivMod(u,et),[h,m]=pyDivMod(m,it),i=q(i,h,"Add"),s=q(s,m,"Add"),u=intRound(q(u,g,"Add"))),[m,o]=pyDivMod(u,et),s=q(s,m,"Add"),[h,s]=pyDivMod(s,it),i=q(i,h,"Add"),i=n(i),s=n(s),o=n(o),Math.abs(i)>999999999)throw new M("timedelta # of days is too large: "+h.toString());if(this===wt.prototype)return new wt(i,s,o);{const t=new this.constructor;return wt.call(t,i,s,o),t}},$r(){const t=[];return this.$days&&t.push(`days=${this.$days}`),this.$secs&&t.push(`seconds=${this.$secs}`),this.$micro&&t.push(`microseconds=${this.$micro}`),t.length||t.push("0"),new w(`${this.tp$name}(${t.join(", ")})`)},tp$str(){const t=this.$secs%60;let e=Math.floor(this.$secs/60);const n=Math.floor(e/60);e%=60;let i=`${n}:${_d(e)}:${_d(t)}`;if(this.$days){i=`${this.$days} day${function plural(t){return 1!==Math.abs(t)?"s":""}(this.$days)}, `+i}return this.$micro&&(i+=`.${_d(this.$micro,"0",6)}`),new w(i)},tp$as_number:!0,nb$add(t){return t instanceof wt?new wt(this.$days+t.$days,this.$secs+t.$secs,this.$micro+t.$micro):b},nb$subtract(t){return t instanceof wt?new wt(this.$days-t.$days,this.$secs-t.$secs,this.$micro-t.$micro):b},nb$positive(){return this},nb$negative(){return new wt(-this.$days,-this.$secs,-this.$micro)},nb$abs(){return this.$days<0?this.nb$negative():this},nb$multiply(t){if(O(t))return t=i(t,M),new wt(this.$days*t,this.$secs*t,this.$micro*t);if(S(t)){const e=this.$toMicrosecs();let[s,o]=_as_int_ratio(t);return s=i(s,M),o=n(o),new wt(0,0,_divide_and_round(e*s,o))}return b},nb$floor_divide(t){const e=this.$toMicrosecs();if(t instanceof wt){const n=t.$toMicrosecs();if(0===n)throw new A("integer division or modulo by zero");return new f(Math.floor(e/n))}if(O(t)){if(0===(t=i(t,M)))throw new A("integer division or modulo by zero");return new wt(0,0,Math.floor(e/t))}return b},nb$divide(t){const e=this.$toMicrosecs();if(t instanceof wt){if(0===t.$toMicrosecs())throw new A("integer division or modulo by zero");return new d(e/t.$toMicrosecs())}if(O(t))return t=n(t),new wt(0,0,_divide_and_round(e,t));if(S(t)){let[s,o]=_as_int_ratio(t);return s=n(s),o=i(o,M),new wt(0,0,_divide_and_round(o*e,s))}return b},nb$remainder(t){if(!(t instanceof wt))return b;const e=this.$toMicrosecs(),n=t.$toMicrosecs();if(0===n)throw new A("integer division or modulo by zero");const i=e-Math.floor(e/n)*n;return new wt(0,0,i)},nb$divmod(t){if(!(t instanceof wt))return b;const e=this.$toMicrosecs(),n=t.$toMicrosecs(),[i,s]=$divMod(e,n);return new p([new f(i),new wt(0,0,s)])},tp$richcompare(t,e){return t instanceof wt?_do_compare(this,t,e):b},tp$hash(){return-1===this.$hashcode&&(this.$hashcode=u(new p(this.$getState().map((t=>new f(t)))))),this.$hashcode},nb$bool(){return 0!==this.$days||0!==this.$secs||0!==this.$micro}},methods:{total_seconds:{$meth(){return new d(((86400*this.$days+this.$secs)*10**6+this.$micro)/10**6)},$flags:{NoArgs:!0},$doc:"Total seconds in the duration."},__reduce__:{$meth(){return new p([this.ob$type,new p(this.$getState().map((t=>D(t))))])},$flags:{NoArgs:!0},$textsig:null,$doc:"__reduce__() -> (cls, state)"}},getsets:{days:{$get(){return new f(this.$days)},$doc:"Number of days."},seconds:{$get(){return new f(this.$secs)},$doc:"Number of seconds (>= 0 and less than 1 day)."},microseconds:{$get(){return new f(this.$micro)},$doc:"Number of microseconds (>= 0 and less than 1 second)."}},proto:{$toMicrosecs(){return 1e6*(86400*this.$days+this.$secs)+this.$micro},$cmp(t){return _cmp(this.$getState(),t.$getState())},$getState(){return[this.$days,this.$secs,this.$micro]}}});wt.prototype.min=new wt(-999999999),wt.prototype.max=new wt(999999999,86399,999999),wt.prototype.resolution=new wt(0,0,1);const _t=new wt(1),pt=new wt(0,3600),gt=new wt(0,60),yt=new wt(0,1),bt=new wt(0),zt=new wt(-1),vt=E.date=h("datetime.date",{constructor:function date(t,e,n){this.$year=t,this.$month=e,this.$day=n,this.$hashcode=-1},slots:{tp$new(t,e){let n,[i,s,o]=l("date",["year","month","day"],t,e,[null,null]);if(null===s&&i instanceof _&&4===(n=i.valueOf()).length&&1<=n[2]&&n[2]<=12){const t=new this.constructor;return t.$setState(n),t}if([i,s,o]=_check_date_fields(i,s,o),this===vt.prototype)return new vt(i,s,o);{const t=new this.constructor;return vt.call(t,i,s,o),t}},$r(){return new w(`${this.tp$name}(${this.$year}, ${this.$month}, ${this.$day})`)},tp$str(){return this.tp$getattr(H).tp$call([])},tp$richcompare(t,e){return t instanceof vt?_do_compare(this,t,e):b},tp$hash(){return-1===this.$hashcode&&(this.$hashcode=u(this.$getState())),this.$hashcode},tp$as_number:!0,nb$add(t){if(t instanceof wt){const e=this.$toOrdinal()+t.$days;if(0 local date from a POSIX timestamp (like time.time())."},fromordinal:{$meth:function fromordinal(t){return this.tp$call(_ord2ymd(t))},$flags:{OneArg:!0},$textsig:null,$doc:"int -> date corresponding to a proleptic Gregorian ordinal."},fromisocalendar:{$meth:function fromisocalendar(t,e,i){if(t=n(t),e=n(e),i=n(i),!(1<=t&&t<=j))throw new v(`Year is out of range: ${t}`);let s,o;if(!(0 date corresponding to a proleptic Gregorian ordinal."},fromisoformat:{$meth:function fromisoformat(t){if(!k(t))throw new z("fromisoformat: argument must be str");t=t.toString();try{if(10!==t.length)throw new Error;return this.tp$call(_parse_isoformat_date(t))}catch(e){throw new v("Invalid isoformat string: \'"+t+"\'")}},$flags:{OneArg:!0},$textsig:null,$doc:"str -> Construct a date from the output of date.isoformat()"},today:{$meth:function today(){const t=$.time.tp$call([]);return this.tp$getattr(B).tp$call([t])},$flags:{NoArgs:!0},$textsig:null,$doc:"Current date or datetime: same as self.__class__.fromtimestamp(time.time())."}},methods:{ctime:{$meth:function ctime(){const t=this.$toOrdinal()%7||7,e=ft[t],n=lt[this.$month];return new w(`${e} ${n} ${_d(this.$day," ",2)} 00:00:00 ${_d(this.$year,"0",4)}`)},$flags:{NoArgs:!0},$textsig:null,$doc:"Return ctime() style string."},strftime:{$meth:function strftime(t){if(!k(t))throw new z("must be str, not "+c(t));return _wrap_strftime(this,t=t.toString(),this.$timetuple())},$flags:{OneArg:!0},$textsig:null,$doc:"format -> strftime() style string."},__format__:{$meth:function __format__(t){if(!k(t))throw new z("must be str, not "+c(t));return t!==w.$empty?this.tp$getattr(X).tp$call([t]):this.tp$str()},$flags:{OneArg:!0},$textsig:null,$doc:"Formats self with strftime."},timetuple:{$meth:function timetuple(){return this.$timetuple()},$flags:{NoArgs:!0},$textsig:null,$doc:"Return time tuple, compatible with time.localtime()."},isocalendar:{$meth:function isocalendar(){let t=this.$year,e=_isoweek1monday(t);const n=_ymd2ord(this.$year,this.$month,this.$day);let[i,s]=$divMod(n-e,7);return i<0?(t-=1,e=_isoweek1monday(t),[i,s]=$divMod(n-e,7)):i>=52&&n>=_isoweek1monday(t+1)&&(t+=1,i=0),new At(new f(t),new f(i+1),new f(s+1))},$flags:{NoArgs:!0},$textsig:null,$doc:"Return a 3-tuple containing ISO year, week number, and weekday."},isoformat:{$meth:function isoformat(){return this.$isoformat()},$flags:{NoArgs:!0},$textsig:null,$doc:"Return string in ISO 8601 format, YYYY-MM-DD."},isoweekday:{$meth:function isoweekday(){return new f(this.$toOrdinal()%7||7)},$flags:{NoArgs:!0},$textsig:null,$doc:"Return the day of the week represented by the date.\\nMonday == 1 ... Sunday == 7"},toordinal:{$meth:function toordinal(){return new f(this.$toOrdinal())},$flags:{NoArgs:!0},$textsig:null,$doc:"Return proleptic Gregorian ordinal. January 1 of year 1 is day 1."},weekday:{$meth:function weekday(){return new f((this.$toOrdinal()+6)%7)},$flags:{NoArgs:!0},$textsig:null,$doc:"Return the day of the week represented by the date.\\nMonday == 0 ... Sunday == 6"},replace:{$meth:function replace(t,e,n){return t===y&&(t=new f(this.$year)),e===y&&(e=new f(this.$month)),n===y&&(n=new f(this.$day)),this.ob$type.tp$call([t,e,n])},$flags:{NamedArgs:["year","month","day"],Defaults:[y,y,y]},$textsig:null,$doc:"Return date with new specified fields."},__reduce__:{$meth(){return new p([this.ob$type,new p([this.$getState()])])},$flags:{NoArgs:!0},$textsig:null,$doc:"__reduce__() -> (cls, state)"}},getsets:{year:{$get(){return new f(this.$year)},$doc:"year (1-9999)"},month:{$get(){return new f(this.$month)},$doc:"month (1-12)"},day:{$get(){return new f(this.$day)},$doc:"day (1-31)"}},proto:{$cmp(t){return _cmp([this.$year,this.$month,this.$day],[t.$year,t.$month,t.$day])},$getState(){const[t,e]=$divMod(this.$year,256);return new _([t,e,this.$month,this.$day])},$setState(t){const[e,n,i,s]=t,o=256*e+n;this.$year=o,this.$month=i,this.$day=s},$toOrdinal(){return _ymd2ord(this.$year,this.$month,this.$day)},$isoformat(){return new w(`${_d(this.$year,"0",4)}-${_d(this.$month,"0",2)}-${_d(this.$day,"0",2)}`)},$timetuple(){return _build_struct_time(this.$year,this.$month,this.$day,this.$hour||0,this.$min||0,this.$sec||0,-1)},$strftime(t=""){return _wrap_strftime(this,t.toString(),this.$timetuple())}}});vt.prototype.min=new vt(1,1,1),vt.prototype.max=new vt(9999,12,31),vt.prototype.resolution=new wt(1);const Mt=E.tzinfo=h("datetime.tzinfo",{constructor:function tzinfo(){},methods:{tzname:{$meth:function tzname(t){throw new x("tzinfo subclass must override tzname()")},$flags:{OneArg:!0},$textsig:null,$doc:"datetime -> string name of time zone."},utcoffset:{$meth:function utcoffset(t){throw new x("tzinfo subclass must override utcoffset()")},$flags:{OneArg:!0},$textsig:null,$doc:"datetime -> timedelta showing offset from UTC, negative values indicating West of UTC"},dst:{$meth:function dst(t){throw new x("tzinfo subclass must override dst()")},$flags:{OneArg:!0},$textsig:null,$doc:"datetime -> DST offset as timedelta positive east of UTC."},fromutc:{$meth:function fromutc(e){if(!(e instanceof Nt))throw new z("fromutc() requires a datetime argument");if(e.$tzinfo!==this)throw new v("dt.tzinfo is not self");const n=r(e.tp$getattr(U));if(n===y)throw new v("fromutc() requires a non-None utcoffset() result");let i=r(e.tp$getattr(F));if(i===y)throw new v("fromutc() requires a non-None dst() result");const s=q(n,i,"Sub");if(t(s)&&(e=q(e,s,"Add"),i=r(e.tp$getattr(F)),i===y))throw new v("fromutc(): dt.dst gave inconsistent results; cannot convert");return q(e,i,"Add")},$flags:{OneArg:!0},$textsig:null,$doc:"datetime in UTC -> datetime in local time."},__reduce__:{$meth(){let e,n;const i=T(this,new w("__getinitargs__"),y);e=i!==y?r(i,[]):new p;const s=T(this,new w("__getstate__"),y);return s!==y?n=r(s,[]):(n=T(this,new w("__dict__"),y),n=t(n)?n:y),new p(n===y?[this.ob$type,e]:[this.ob$type,e,n])},$flags:{NoArgs:!0},$textsig:null,$doc:"-> (cls, state)"}}}),At=h("datetime.IsoCalendarDate",{base:p,constructor:function IsoCalendarDate(t,e,n){this.y=t,this.w=e,this.wd=n,p.call(this,[t,e,n])},slots:{tp$new(t,e){const[n,i,s]=l("IsoCalendarDate",["year","week","weekday"],t,e);return new this.constructor(n,i,s)},$r(){return new w(`${this.tp$name}(year=${this.y}, week=${this.w}, weekday=${this.wd})`)}},getsets:{year:{$get(){return this.y}},week:{$get(){return this.w}},weekday:{$get(){return this.wd}}}}),xt=E.time=h("datetime.time",{constructor:function time(t=0,e=0,n=0,i=0,s=null,o=0){this.$hour=t,this.$min=e,this.$sec=n,this.$micro=i,this.$tzinfo=s||y,this.$fold=o,this.$hashcode=-1},slots:{tp$new(t,e){m("time",t,0,5);let n,[i,s,o,r,a,$]=l("time",["hour","minute","second","microsecond","tzinfo","fold"],t,e,[W,W,W,W,y,W]);if(i instanceof _&&6===(n=i.valueOf()).length&&(127&n[0])<24){const t=new this.constructor;return t.$setState(n,s===W?y:s),t}if([i,s,o,r,$]=_check_time_fields(i,s,o,r,$),_check_tzinfo_arg(a),this===xt.prototype)return new xt(i,s,o,r,a,$);{const t=new this.constructor;return xt.call(t,i,s,o,r,a,$),t}},tp$richcompare(t,e){return t instanceof xt?_do_compare(this,t,e):b},tp$hash(){if(-1===this.$hashcode){const e=this.$fold?r(this.tp$getattr(J),[],["fold",W]):this,n=r(e.tp$getattr(U));if(t(n)){let[t,e]=pyDivMod(new wt(0,3600*this.$hour+60*this.$min).nb$subtract(n),pt);e=e.nb$floor_divide(gt),0<=t&&t<=24?(t=I(t),e=I(e),this.$hashcode=u(new xt(t,e,this.$sec,this.$micro))):this.$hashcode=u(new p([t,e,new f(this.$sec),new f(this.$micro)]))}else this.$hashcode=u(e.$getState()[0])}return this.$hashcode},$r(){let t;return t=0!==this.$micro?`, ${this.$sec}, ${this.$micro}`:0!==this.$sec?`, ${this.$sec}`:"",t=`${this.tp$name}(${this.$hour}, ${this.$min}${t})`,this.$tzinfo!==y&&(t=t.slice(0,-1)+", tzinfo="+s(this.$tzinfo)+")"),this.$fold&&(t=t.slice(0,-1)+", fold=1)"),new w(t)},tp$str(){return this.tp$getattr(H).tp$call([])}},methods:{isoformat:{$meth:function isoformat(t){let e=_format_time(this.$hour,this.$min,this.$sec,this.$micro,t);const n=this.$tzstr();return n&&(e+=n),new w(e)},$flags:{NamedArgs:["timespec"],Defaults:[C]},$textsig:null,$doc:"Return string in ISO 8601 format, [HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].\\n\\ntimespec specifies what components of the time to include.\\n"},strftime:{$meth:function strftime(t){if(!k(t))throw new z("must be str, not "+c(t));return _wrap_strftime(this,t=t.toString(),new p([1900,1,1,this.$hour,this.$min,this.$sec,0,1,-1].map((t=>new f(t)))))},$flags:{OneArg:!0},$textsig:null,$doc:"format -> strftime() style string."},__format__:{$meth:function __format__(t){if(!k(t))throw new z("must be str, not "+c(t));return t!==w.$empty?this.tp$getattr(X).tp$call([t]):this.tp$str()},$flags:{OneArg:!0},$textsig:null,$doc:"Formats self with strftime."},utcoffset:{$meth:function utcoffset(){if(this.$tzinfo===y)return y;const t=this.$tzinfo.tp$getattr(U),e=r(t,[y]);return _check_utc_offset("utcoffset",e),e},$flags:{NoArgs:!0},$textsig:null,$doc:"Return self.tzinfo.utcoffset(self)."},tzname:{$meth:function tzname(){if(this.$tzinfo===y)return y;const t=this.$tzinfo.tp$getattr(Y),e=r(t,[y]);return _check_tzname(e),e},$flags:{NoArgs:!0},$textsig:null,$doc:"Return self.tzinfo.tzname(self)."},dst:{$meth:function dst(){if(this.$tzinfo===y)return y;const t=this.$tzinfo.tp$getattr(F),e=r(t,[y]);return _check_utc_offset("dst",e),e},$flags:{NoArgs:!0},$textsig:null,$doc:"Return self.tzinfo.dst(self)."},replace:{$meth:function replace(t,e){m("replace",t,0,5);let[n,i,s,o,r,a]=l("replace",["hour","minute","second","microsecond","tzinfo","fold"],t,e,[y,y,y,y,g,y]);return n===y&&(n=new f(this.$hour)),i===y&&(i=new f(this.$min)),s===y&&(s=new f(this.$sec)),o===y&&(o=new f(this.$micro)),r===g&&(r=this.$tzinfo),a===y&&(a=new f(this.$fold)),this.ob$type.tp$call([n,i,s,o,r],["fold",a])},$flags:{FastCall:!0},$textsig:null,$doc:"Return time with new specified fields."},__reduce_ex__:{$meth(t){return new p([this.ob$type,new p(this.$getState(R(t)))])},$flags:{OneArg:!0},$textsig:null,$doc:"__reduce_ex__(proto) -> (cls, state)"},__reduce__:{$meth(){return this.tp$getattr(new w("__reduce_ex__")).tp$call([new f(2)])},$flags:{NoArgs:!0},$textsig:null,$doc:"__reduce__() -> (cls, state)"}},classmethods:{fromisoformat:{$meth:function fromisoformat(t){if(!k(t))throw new z("fromisoformat: argument must be str");t=t.toString();try{return this.tp$call(_parse_isoformat_time(t))}catch{throw new v("Invalid isofrmat string: \'"+t+"\'")}},$flags:{OneArg:!0},$textsig:null,$doc:"string -> time from time.isoformat() output"}},getsets:{hour:{$get(){return new f(this.$hour)}},minute:{$get(){return new f(this.$min)}},second:{$get(){return new f(this.$sec)}},microsecond:{$get(){return new f(this.$micro)}},tzinfo:{$get(){return this.$tzinfo}},fold:{$get(){return new f(this.$fold)}}},proto:{$cmp(t,n){const s=this.$tzinfo,o=t.$tzinfo;let a,$,c;if(a=$=y,s===o?c=!0:(a=r(this.tp$getattr(U)),$=r(t.tp$getattr(U)),c=e(a,$,"Eq")),c)return _cmp([this.$hour,this.$min,this.$sec,this.$micro],[t.$hour,t.$min,t.$sec,t.$micro]);if(a===y||$===y){if("Eq"===n||"NotEq"===n)return 2;throw new z("cannot compare naive and aware times")}const h=60*this.$hour+this.$min-i(a.nb$floor_divide(gt)),m=60*t.$hour+t.$min-i($.nb$floor_divide(gt));return _cmp([h,this.$sec,this.$micro],[m,t.$sec,t.$micro])},$tzstr(){return _format_offset(r(this.tp$getattr(U)))},$getState(t=3){let[e,n]=$divMod(this.$micro,256),[i,s]=$divMod(e,256),o=this.$hour;this.$fold&&t>3&&(o+=128);const r=new _([o,this.$min,this.$sec,i,s,n]);return this.$tzinfo===y?[r]:[r,this.$tzinfo]},$setState(t,e){const[n,i,s,o,r,a]=t;n>127?(this.$fold=1,this.$hour=n-128):(this.$fold=0,this.$hour=n),this.$min=i,this.$sec=s,this.$micro=(o<<8|r)<<8|a,this.$tzinfo=e}}});xt.prototype.min=new xt(0,0,0),xt.prototype.max=new xt(23,59,59,999999),xt.prototype.resolution=new wt;const Nt=E.datetime=h("datetime.datetime",{base:vt,constructor:function datetime(t,e,n,i=0,s=0,o=0,r=0,a=null,$=0){this.$year=t,this.$month=e,this.$day=n,this.$hour=i,this.$min=s,this.$sec=o,this.$micro=r,this.$tzinfo=a||y,this.$fold=$,this.$hashcode=-1},slots:{tp$new(t,e){m("datetime",t,0,9);let n,[i,s,o,r,a,$,c,h,u]=l("time",["year","month","day","hour","minute","second","microsecond","tzinfo","fold"],t,e,[null,null,W,W,W,W,y,W]);if(i instanceof _&&10===(n=i.valueOf()).length&&(127&n[2])<=12){const t=new this.constructor;return t.$setState(n,null===s?y:s),t}if([i,s,o]=_check_date_fields(i,s,o),[r,a,$,c,u]=_check_time_fields(r,a,$,c,u),_check_tzinfo_arg(h),this===Nt.prototype)return new Nt(i,s,o,r,a,$,c,h,u);{const t=new this.constructor;return Nt.call(t,i,s,o,r,a,$,c,h,u),t}},$r(){const t=[this.$year,this.$month,this.$day,this.$hour,this.$min,this.$sec,this.$micro];0===t[t.length-1]&&t.pop(),0===t[t.length-1]&&t.pop();let e=`${this.tp$name}(${t.join(", ")})`;return this.$tzinfo!==y&&(e=e.slice(0,-1)+", tzinfo="+s(this.$tzinfo)+")"),this.$fold&&(e=e.slice(0,-1)+", fold=1)"),new w(e)},tp$str(){return this.tp$getattr(H).tp$call([],["sep",new w(" ")])},tp$richcompare(t,e){if(t instanceof Nt)return _do_compare(this,t,e);if(!(t instanceof vt))return b;if("Eq"===e||"NotEq"===e)return"NotEq"===e;throw new z(`can\'t compare \'${c(this)}\' to \'${c(t)}\'`)},tp$as_number:!0,nb$add(t){if(!(t instanceof wt))return b;let e=new wt(this.$toOrdinal(),3600*this.$hour+60*this.$min+this.$sec,this.$micro);e=q(e,t,"Add");let[n,i]=$divMod(e.$secs,3600),[s,o]=$divMod(i,60);if(0 string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].\\nsep is used to separate the year from the time, and defaults to \'T\'.\\ntimespec specifies what components of the time to include (allowed values are \'auto\', \'hours\', \'minutes\', \'seconds\', \'milliseconds\', and \'microseconds\').\\n"},utcoffset:{$meth:function utcoffset(){if(this.$tzinfo===y)return y;const t=this.$tzinfo.tp$getattr(U),e=r(t,[this]);return _check_utc_offset("utcoffset",e),e},$flags:{NoArgs:!0},$textsig:null,$doc:"Return self.tzinfo.utcoffset(self)."},tzname:{$meth:function tzname(){if(this.$tzinfo===y)return y;const t=this.$tzinfo.tp$getattr(Y),e=r(t,[this]);return _check_tzname(e),e},$flags:{NoArgs:!0},$textsig:null,$doc:"Return self.tzinfo.tzname(self)."},dst:{$meth:function dst(){if(this.$tzinfo===y)return y;const t=this.$tzinfo.tp$getattr(F),e=r(t,[this]);return _check_utc_offset("dst",e),e},$flags:{NoArgs:!0},$textsig:null,$doc:"Return self.tzinfo.dst(self)."},replace:{$meth:function replace(t,e){m("replace",t,0,8);let[n,i,s,o,r,a,$,c,h]=l("replace",["year","month","day","hour","minute","second","microsecond","tzinfo","fold"],t,e,[y,y,y,y,y,y,y,g,y]);return n===y&&(n=new f(this.$year)),i===y&&(i=new f(this.$month)),s===y&&(s=new f(this.$day)),o===y&&(o=new f(this.$hour)),r===y&&(r=new f(this.$min)),a===y&&(a=new f(this.$sec)),$===y&&($=new f(this.$micro)),c===g&&(c=this.$tzinfo),h===y&&(h=new f(this.$fold)),this.ob$type.tp$call([n,i,s,o,r,a,$,c],["fold",h])},$flags:{FastCall:!0},$textsig:null,$doc:"Return datetime with new specified fields."},astimezone:{$meth:function astimezone(t){if(t===y)t=this.$localTimezone();else if(!(t instanceof Mt))throw new z("tz argument must be an instance of tzinfo");let e,n=this.$tzinfo;if(n===y?(n=this.$localTimezone(),e=r(n.tp$getattr(U),[this])):(e=r(n.tp$getattr(U),[this]),e===y&&(n=r(this.tp$getattr(J),[],["tzinfo",y]).$localTimezone(),e=r(n.tp$getattr(U),[this]))),t===n)return this;const i=r(this.nb$subtract(e).tp$getattr(J),[],["tzinfo",t]);return t.tp$getattr(P).tp$call([i])},$flags:{NamedArgs:["tz"],Defaults:[y]},$textsig:null,$doc:"tz -> convert to local time in new timezone tz\\n"},__reduce_ex__:{$meth(t){return new p([this.ob$type,new p(this.$getState(R(t)))])},$flags:{OneArg:!0},$textsig:null,$doc:"__reduce_ex__(proto) -> (cls, state)"},__reduce__:{$meth(){return this.tp$getattr(new w("__reduce_ex__")).tp$call([new f(2)])},$flags:{NoArgs:!0},$textsig:null,$doc:"__reduce__() -> (cls, state)"}},classmethods:{now:{$meth:function now(t){const e=$.time.tp$call([]);return this.tp$getattr(B).tp$call([e,t])},$flags:{NamedArgs:["tz"],Defaults:[y]},$textsig:"($type, /, tz=None)",$doc:"Returns new datetime object representing current time local to tz.\\n\\n tz\\n Timezone object.\\n\\nIf no tz is specified, uses local timezone."},utcnow:{$meth:function utcnow(){const t=$.time.tp$call([]);return this.tp$getattr(L).tp$call([t])},$flags:{NoArgs:!0},$textsig:null,$doc:"Return a new datetime representing UTC day and time."},fromtimestamp:{$meth:function fromtimestamp(t,e){return _check_tzinfo_arg(e),this.prototype.$fromtimestamp.call(this,t,e!==y,e)},$flags:{NamedArgs:["timestamp","tz"],Defaults:[y]},$textsig:null,$doc:"timestamp[, tz] -> tz\'s local time from POSIX timestamp."},utcfromtimestamp:{$meth:function utcfromtimestamp(t){return this.prototype.$fromtimestamp.call(this,t,!0,y)},$flags:{OneArg:!0},$textsig:null,$doc:"Construct a naive UTC datetime from a POSIX timestamp."},strptime:{$meth:function strptime(t,e){return null===ot?Sk.misceval.chain(Sk.importModule("_strptime",!1,!0),(n=>(ot=n.tp$getattr(new w("_strptime_datetime")),ot.tp$call([this,t,e])))):ot.tp$call([this,t,e])},$flags:{MinArgs:2,MaxArgs:2},$textsig:null,$doc:"string, format -> new datetime parsed from a string (like time.strptime())."},combine:{$meth:function combine(t,e,n){if(!(t instanceof vt))throw new z("date argument must be a date instance");if(!(e instanceof xt))throw new z("time argument must be a time instance");n===g&&(n=e.$tzinfo);const i=[t.$year,t.$month,t.$day,e.$hour,e.$min,e.$sec,e.$micro].map((t=>new f(t)));return i.push(n),this.tp$call(i,["fold",new f(e.$fold)])},$flags:{NamedArgs:["date","time","tzinfo"],Defaults:[g]},$textsig:null,$doc:"date, time -> datetime with same date and time fields"},fromisoformat:{$meth:function fromisoformat(t){if(!k(t))throw new z("fromisoformat: argument must be str");const e=(t=t.toString()).slice(0,10),n=t.slice(11);let i,s;try{i=_parse_isoformat_date(e)}catch(o){throw new v("Invalid isoformat string: \'"+t+"\'")}if(n)try{s=_parse_isoformat_time(n)}catch(o){throw new v("Invalid isoformat string: \'"+t+"\'")}else s=[W,W,W,W,y];return this.tp$call(i.concat(s))},$flags:{OneArg:!0},$textsig:null,$doc:"string -> datetime from datetime.isoformat() output"}},getsets:{hour:{$get(){return new f(this.$hour)}},minute:{$get(){return new f(this.$min)}},second:{$get(){return new f(this.$sec)}},microsecond:{$get(){return new f(this.$micro)}},tzinfo:{$get(){return this.$tzinfo}},fold:{$get(){return new f(this.$fold)}}},proto:{$cmp(n,i){const s=this.$tzinfo,o=n.$tzinfo;let a,$,c;if(a=$=y,s===o)c=!0;else{if(a=r(this.tp$getattr(U)),$=r(n.tp$getattr(U)),"Eq"===i||"NotEq"===i){const t=r(this.tp$getattr(J),[],["fold",new f(Number(!this.$fold))]);if(e(a,r(t.tp$getattr(U)),"NotEq"))return 2;const i=r(n.tp$getattr(J),[],["fold",new f(Number(!n.$fold))]);if(e($,r(i.tp$getattr(U)),"NotEq"))return 2}c=e(a,$,"Eq")}if(c)return _cmp([this.$year,this.$month,this.$day,this.$hour,this.$min,this.$sec,this.$micro],[n.$year,n.$month,n.$day,n.$hour,n.$min,n.$sec,n.$micro]);if(a===y||$===y){if("Eq"===i||"NotEq"===i)return 2;throw new z("cannot compare naive and aware datetimes")}const h=this.nb$subtract(n);return h.$days<0?-1:t(h)?1:0},$mkTime(){const t=new Nt(1970,1,1),e=this.nb$subtract(t).nb$floor_divide(yt);function local(e){const[n,i,s,o,r,a]=$.localtime.tp$call([e]).v;return Nt.tp$call([n,i,s,o,r,a]).nb$subtract(t).nb$floor_divide(yt)}let n,i,s=local(e).nb$subtract(e),o=e.nb$subtract(s),r=local(o);if(r.ob$eq(e)){if(n=o.nb$add([new f(-86400),new f(86400)][this.$fold]),i=local(n).nb$subtract(n),s.ob$eq(i))return o}else i=r.nb$subtract(o);n=e.nb$subtract(i);if(local(n).ob$eq(e))return n;if(r.ob$eq(e))return o;const a=o.ob$ge(n)?o:n;return[a,o===a?n:o][this.$fold]},$fromtimestamp(t,n,s){let o;if(!N(t))throw new z("a number is required, (got \'"+c(t)+"\'");[o,t]=modf(t);let a=intRound(q(o,nt,"Mult"));a=a.v,t=t.v,a>=1e6?(t+=1,a-=1e6):a<0&&(t-=1,a+=1e6),t=new f(t),Number.isInteger(a)||(a=Math.trunc(a)),a=new f(a);const h=n?$.gmtime:$.localtime;function converter(t){return h.tp$call([t]).v}let[m,u,l,d,_,p]=converter(t);p=new f(Math.min(i(p),59));let g=r(this,[m,u,l,d,_,p,a,s]);if(s===y){const n=86400;[m,u,l,d,_,p]=converter(q(t,new f(n),"Sub"));const i=r(this,[m,u,l,d,_,p,a,s]),o=q(q(g,i,"Sub"),new wt(0,n),"Sub");if(o.$days<0){[m,u,l,d,_,p]=converter(q(t,q(o,yt,"FloorDiv"),"Add"));const n=r(this,[m,u,l,d,_,p,a,s]);e(n,g,"Eq")&&(g.$fold=1)}}else g=r(s.tp$getattr(new w("fromutc")),[g]);return g},$localTimezone(){let t;t=this.$tzinfo===y?this.$mkTime():this.nb$subtract(kt).nb$floor_divide(yt);const e=$.localtime.tp$call([t]),n=(Nt.tp$call(e.v.slice(0,6)),e.tp$getattr(new w("tm_gmtoff"))),i=e.tp$getattr(new w("tm_zone"));return new St(wt.tp$call([W,n]),i)},$getState(t=3){let[e,n]=$divMod(this.$year,256),[i,s]=$divMod(this.$micro,256),[o,r]=$divMod(i,256),a=this.$month;this.$fold&&t>3&&(a+=128);const $=new _([e,n,a,this.$day,this.$hour,this.$min,this.$sec,o,r,s]);return this.$tzinfo===y?[$]:[$,this.$tzinfo]},$setState(t,e){const[n,i,s,o,r,a,$,c,h,m]=t;s>127?(this.$fold=1,this.$month=s-128):(this.$fold=0,this.$month=s),this.$year=256*n+i,this.$day=o,this.$hour=r,this.$min=a,this.$sec=$,this.$micro=(c<<8|h)<<8|m,this.$tzinfo=e}}});function _isoweek1monday(t){const e=_ymd2ord(t,1,1),n=(e+6)%7;let i=e-n;return n>3&&(i+=7),i}Nt.prototype.min=new Nt(1,1,1),Nt.prototype.max=new Nt(9999,12,31,23,59,59,999999),Nt.prototype.resolution=new wt(0,0,1);const St=E.timezone=h("datetime.timezone",{base:Mt,constructor:function timezone(t,n){if(this.$offset=t,this.$name=n||y,!e(this.$minoffset,t,"LtE")||!e(this.$maxoffset,t,"GtE"))throw new v("offset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).")},slots:{tp$new(e,n){let[i,s]=l("timezone",["offset","name"],e,n,[null]);if(!(i instanceof wt))throw new z("offset must be a timedelta");if(null===s){if(!t(i))return this.utc;s=y}else if(!k(s))throw new z("name must be a string");if(this===St.prototype)return new St(i,s);{const t=new this.constructor;return St.call(t,i,s),t}},tp$richcompare(t,n){if(!(t instanceof St))return b;const i=e(this.$offset,t.$offset,"Eq");return"NotEq"===n?!i:"Eq"===n||i&&o(n)?i:b},$r(){return this===this.utc?new w("datetime.timezone.utc"):this.$name===y?new w(`${this.tp$name}(${s(this.$offset)})`):new w(`${this.tp$name}(${s(this.$offset)}, ${s(this.$name)})`)},tp$str(){return this.tp$getattr(Y).tp$call([y])},tp$hash(){return u(this.$offset)}},methods:{tzname:{$meth:function tzname(t){if(t instanceof Nt||t===y)return this.$name===y?this.$nameFromOff(this.$offset):this.$name;throw new z("tzname() argument must be a datetime instance or None")},$flags:{OneArg:!0},$textsig:null,$doc:"If name is specified when timezone is created, returns the name. Otherwise returns offset as \'UTC(+|-)HH:MM\'."},utcoffset:{$meth:function utcoffset(t){if(t instanceof Nt||t===y)return this.$offset;throw new z("utcoffset() argument must be a datetime instance or None")},$flags:{OneArg:!0},$textsig:null,$doc:"Return fixed offset."},dst:{$meth:function dst(t){if(t instanceof Nt||t===y)return y;throw new z("dst() argument must be a datetime instance or None")},$flags:{OneArg:!0},$textsig:null,$doc:"Return None."},fromutc:{$meth:function fromutc(t){if(t instanceof Nt){if(t.$tzinfo!==this)throw new v("fromutc: dt.tzinfo is not self");return q(t,this.$offset,"Add")}throw new z("fromutc() argument must be a datetime instance or None")},$flags:{OneArg:!0},$textsig:null,$doc:"datetime in UTC -> datetime in local time."},__getinitargs__:{$meth(){return this.$name===y?new p([this.$offset]):new p([this.$offset,this.$name])},$flags:{NoArgs:!0}}},proto:{$maxoffset:new wt(0,86399,999999),$minoffset:new wt(-1,0,1),$nameFromOff(n){if(!t(n))return new w("UTC");let i,s,o,r,a,$;return e(n,bt,"Lt")?(i="-",n=n.nb$negative()):i="+",[s,o]=pyDivMod(n,pt),[r,o]=pyDivMod(o,gt),a=o.$secs,$=o.$micro,new w($?`UTC${i}${_d(s)}:${_d(r)}:${_d(a)}.${_d($,"0",6)}`:a?`UTC${i}${_d(s)}:${_d(r)}:${_d(a)}`:`UTC${i}${_d(s)}:${_d(r)}`)}}});St.prototype.utc=new St(new wt(0)),St.prototype.min=new St(new wt(0,-86340,0)),St.prototype.max=new St(new wt(0,86340,0));const kt=new Nt(1970,1,1,0,0,0,0,St.prototype.utc);return E}))}',"src/lib/document.js":'function $builtinmodule(){const{builtin:{str:t},misceval:{callsimArray:e},ffi:{toPy:r},abstr:{gattr:a}}=Sk,n={__name__:new t("document")},_=r(Sk.global.document);return Sk.abstr.setUpModuleMethods("document",n,{__getattr__:{$meth:t=>a(_,t,!0),$flags:{OneArg:!0}},__dir__:{$meth:()=>e(_.tp$getattr(t.$dir)),$flags:{NoArgs:!0}}}),n}',"src/lib/fractions.js":'function $builtinmodule(t){const e={};return Sk.misceval.chain(Sk.importModule("math",!1,!0),(t=>(e.math=t,Sk.importModule("sys",!1,!0))),(t=>(e.sys=t,fractionsMod(e))))}function fractionsMod({math:t,sys:e}){const{builtin:{int_:n,bool:{true$:i,false$:r},none:{none$:s},NotImplemented:{NotImplemented$:o},tuple:a,float_:$,complex:u,str:h,isinstance:l,TypeError:m,ZeroDivisionError:d,ValueError:f,NotImplementedError:c,abs:_,round:b,pow:p},ffi:{remapToPy:g},abstr:{buildNativeClass:w,copyKeywordsToNamedArgs:v,numberBinOp:y,typeName:k,lookupSpecial:E,checkArgsLen:N},misceval:{isTrue:F,richCompareBool:A,callsimArray:S,objectRepr:M}}=Sk,O={__name__:new h("fractions"),__all__:g(["Fraction"])},D=/^\\s*(?[-+]?)(?=\\d|\\.\\d)(?\\d*)(?:(?:\\/(?\\d+))?|(?:\\.(?\\d*))?(?:E(?[-+]?\\d+))?)\\s*$/i,q=new n(0),x=new n(1),z=new n(2),I=new n(10),T=new h("numerator"),R=new h("denominator"),B=new h("as_integer_ratio"),C=new h("from_float"),getNumer=t=>t.tp$getattr(T),getDenom=t=>t.tp$getattr(R),mul=(t,e)=>y(t,e,"Mult"),div=(t,e)=>y(t,e,"Div"),pow=(t,e)=>y(t,e,"Pow"),add=(t,e)=>y(t,e,"Add"),sub=(t,e)=>y(t,e,"Sub"),floorDiv=(t,e)=>y(t,e,"FloorDiv"),divmod=(t,e)=>y(t,e,"DivMod"),mod=(t,e)=>y(t,e,"Mod"),K=t.tp$getattr(new h("gcd")),eq=(t,e)=>A(t,e,"Eq"),lt=(t,e)=>A(t,e,"Lt"),ge=(t,e)=>A(t,e,"GtE"),L={NoArgs:!0},P={OneArg:!0},j=e.tp$getattr(new h("hash_info")),G=j.tp$getattr(new h("modulus")),V=j.tp$getattr(new h("inf"));function _operator_fallbacks(t,e){return[function(n){return isRational(n)?t(this,n):n instanceof $?e(this.nb$float(),n):n instanceof u?e(S(u,[this]),n):o},function(n){return isRational(n)?t(n,this):n instanceof $?e(n,this.nb$float()):n instanceof u?e(n,S(u,[this])):o}]}const[Z,H]=_operator_fallbacks(((t,e)=>{const n=getDenom(t),i=getDenom(e);return S(ot,[add(mul(getNumer(t),i),mul(getNumer(e),n)),mul(n,i)])}),add),[J,Q]=_operator_fallbacks(((t,e)=>{const n=getDenom(t),i=getDenom(e);return S(ot,[sub(mul(getNumer(t),i),mul(getNumer(e),n)),mul(n,i)])}),sub),[U,W]=_operator_fallbacks(((t,e)=>S(ot,[mul(getNumer(t),getNumer(e)),mul(getDenom(t),getDenom(e))])),mul),[X,Y]=_operator_fallbacks(((t,e)=>S(ot,[mul(getNumer(t),getDenom(e)),mul(getDenom(t),getNumer(e))])),div),[tt,et]=_operator_fallbacks(((t,e)=>floorDiv(mul(getNumer(t),getDenom(e)),mul(getDenom(t),getNumer(e)))),floorDiv),[nt,it]=_operator_fallbacks(((t,e)=>{const n=getDenom(t),i=getDenom(e),[r,s]=divmod(mul(getNumer(t),i),mul(n,getNumer(e))).valueOf();return new a([r,S(ot,[s,mul(n,i)])])}),divmod),[rt,st]=_operator_fallbacks(((t,e)=>{const n=getDenom(t),i=getDenom(e),r=mod(mul(getNumer(t),i),mul(getNumer(e),n));return S(ot,[r,mul(n,i)])}),mod),ot=O.Fraction=w("fractions.Fraction",{constructor:function(t,e){this.$num=t||q,this.$den=e||x},slots:{tp$new(t,e){N("Fraction",t,0,2);let[r,o,a]=v("Fraction",["numerator","denominator","_normalize"],t,e,[q,s,i]);const u=new this.constructor;if(o===s){if(r.ob$type===n)return u.$num=r,u.$den=x,u;if(isRational(r))return u.$num=getNumer(r),u.$den=getDenom(r),u;if(r instanceof $)return[u.$num,u.$den]=S(r.tp$getattr(B)).valueOf(),u;if(!(r instanceof h))throw new m("argument should be a string or a Rational instance");{const t=r.toString().match(D);if(null===t)throw new f("Invalid literal for Fraction: "+M(r));r=new n(t.groups.num||"0");const e=t.groups.denom;if(e)o=new n(e);else{o=x;const e=t.groups.decimal;if(e){const t=new n(""+10**e.length);r=add(mul(r,t),new n(e)),o=mul(o,t)}let i=t.groups.exp;i&&(i=new n(i),lt(i,q)?o=mul(o,pow(I,i.nb$negative())):r=mul(r,pow(I,i)))}"-"==t.groups.sign&&(r=r.nb$negative())}}else if(r.ob$type===n&&o.ob$type===n);else{if(!isRational(r)||!isRational(o))throw new m("both arguments should be Rational instances");[r,o]=[mul(getNumer(r),getDenom(o)),mul(getNumer(o),getDenom(r))]}if(eq(o,q))throw new d(`Fraction(${r}, 0)`);if(F(a)){let t=S(K,[r,o]);lt(o,q)&&(t=t.nb$negative()),r=floorDiv(r,t),o=floorDiv(o,t)}return u.$num=r,u.$den=o,u},$r(){const t=E(this.ob$type,h.$name);return new h(`${t}(${this.$num}, ${this.$den})`)},tp$str(){return eq(this.$den,x)?new h(this.$num):new h(`${this.$num}/${this.$den}`)},tp$hash(){const t=p(this.$den,sub(G,z),G);let e;e=F(t)?mod(mul(_(this.$num),t),G):V;let n=ge(this,q)?e:e.nb$negative();return n=n.tp$hash(),-1===n?-2:n},tp$richcompare(t,e){const op=(t,n)=>A(t,n,e);if("Eq"===e||"NotEq"==e){if(t.ob$type===n){const n=eq(this.$num,t)&&eq(this.$den,x);return"Eq"===e?n:!n}if(t instanceof ot||t instanceof n){const n=eq(this.$num,getNumer(t))&&eq(this.$den,getDenom(t));return"Eq"===e?n:!n}t instanceof u&&eq(t.tp$getattr(new h("imag")),q)&&(t=t.tp$getattr(new h("real")))}return isRational(t)?op(mul(getNumer(this),getDenom(t)),mul(getDenom(this),getNumer(t))):t instanceof $?Number.isFinite(t.valueOf())?op(this,S(this.tp$getattr(C),[t])):op(new $(0),t):o},tp$as_number:!0,nb$add:Z,nb$reflected_add:H,nb$subtract:J,nb$reflected_subtract:Q,nb$multiply:U,nb$reflected_multiply:W,nb$divide:X,nb$reflected_divide:Y,nb$floor_divide:tt,nb$reflected_floor_divide:et,nb$divmod:nt,nb$reflected_divmod:it,nb$remainder:rt,nb$reflected_remainder:st,nb$power(t){if(isRational(t)){if(eq(getDenom(t),x)){let e=getNumer(t);return ge(e,q)?S(ot,[pow(this.$num,e),pow(this.$den,e)],["_normalize",r]):ge(this.$num,q)?(e=e.nb$negative(),S(ot,[pow(this.$den,e),pow(this.$num,e)],["_normalize",r])):(e=e.nb$negative(),S(ot,[pow(this.$den.nb$negative(),e),pow(this.$num.nb$negative(),e)],["_normalize",r]))}return pow(this.nb$float(),S($,[t]))}return pow(this.nb$float(),t)},nb$reflected_power(t){return eq(this.$den,x)&&ge(this.$num,q)?pow(t,this.$num):isRational(t)?pow(new ot(getNumer(t),getDenom(t)),this):eq(this.$den,x)?pow(t,this.$num):pow(t,this.nb$float())},nb$positive(){return new ot(this.$num,this.$den)},nb$negative(){return new ot(this.$num.nb$negative(),this.$den)},nb$abs(){return new ot(this.$num.nb$abs(),this.$den)},nb$bool(){return this.$num.nb$bool()},nb$float(){return div(this.$num,this.$den)}},methods:{as_integer_ratio:{$meth(){return new a([this.$num,this.$den])},$flags:L},limit_denominator:{$meth(t){if(lt(t,x))throw new f("max_denominator should be at least 1");if(ge(t,this.$den))return S(ot,[this]);let[e,n,i,r]=[q,x,x,q],s=this.$num,o=this.$den;for(;;){const a=floorDiv(s,o),$=add(n,mul(a,r));if(lt(t,$))break;[e,n,i,r]=[i,r,add(e,mul(a,i)),$],[s,o]=[o,sub(s,mul(a,o))]}const a=floorDiv(sub(t,n),r),$=S(ot,[add(e,mul(a,i)),add(n,mul(a,r))]),u=S(ot,[i,r]);return ge(_(sub($,this)),_(sub(u,this)))?u:$},$flags:{NamedArgs:["max_denominator"],Defaults:[new n(1e6)]}},__trunc__:{$meth(){return lt(this.$num,q)?floorDiv(this.$num.nb$negative(),this.$den).nb$negative():floorDiv(this.$num,this.$den)},$flags:L},__floor__:{$meth(){return floorDiv(this.$num,this.$den)},$flags:L},__ceil__:{$meth(){return floorDiv(this.$num.nb$negative(),this.$den).nb$negative()},$flags:L},__round__:{$meth(t){if(t===s){const[t,e]=divmod(this.$num,this.$den).valueOf(),n=mul(e,z);return lt(n,this.$den)?t:lt(this.$den,n)?add(t,x):eq(mod(t,z),q)?t:add(t,x)}const e=pow(I,_(t));return lt(q,t)?S(ot,[b(mul(this,e)),e]):S(ot,[mul(b(div(this,e)),e)])},$flags:{NamedArgs:["ndigits"],Defaults:[s]}},__reduce__:{$meth(){return new a([this.ob$type,new a([new h(this)])])},$flags:L},__copy__:{$meth(){return this.ob$type===ot?this:S(this.ob$type,[this.$num,this.$den])},$flags:L},__deepcopy__:{$meth(t){return this.ob$type===ot?this:S(this.ob$type,[this.$num,this.$den])},$flags:P}},classmethods:{from_float:{$meth(t){if(t instanceof n)return S(this,[t]);if(t instanceof $){const[e,n]=S(t.tp$getattr(B)).valueOf();return S(this,[e,n])}throw new m(`${k(this)}.from_float() only takes floats, not ${M(t)}, (${k(t)})`)},$flags:P},from_decimal:{$meth(){throw c("from_decimal not yet implemented in SKulpt")},$flags:P}},getsets:{numerator:{$get(){return this.$num}},denominator:{$get(){return this.$den}},_numerator:{$get(){return this.$num},$set(t){this.$num=t}},_denominator:{$get(){return this.$den},$set(t){this.$den=t}}}}),at=new a([n,ot]),isRational=t=>F(l(t,at));return O}',"src/lib/functools.js":'function $builtinmodule(){const t={};return Sk.misceval.chain(Sk.importModule("collections",!1,!0),(e=>(t._namedtuple=e.$d.namedtuple,functools_mod(t))))}function functools_mod(t){const{object:e,int_:n,str:r,list:s,tuple:a,dict:i,none:{none$:o},bool:{false$:c},NotImplemented:{NotImplemented$:_},bool:l,func:p,method:u,TypeError:h,RuntimeError:d,ValueError:f,NotImplementedError:m,AttributeErrror:w,OverflowError:g,checkNone:$,checkBool:y,checkCallable:k,checkClass:b}=Sk.builtin,{callsimArray:x,callsimOrSuspendArray:A,iterFor:S,chain:E,isIndex:v,asIndexSized:N,isTrue:P,richCompareBool:j,objectRepr:R}=Sk.misceval,{remapToPy:z}=Sk.ffi,{buildNativeClass:q,setUpModuleMethods:T,keywordArrayFromPyDict:I,keywordArrayToPyDict:D,objectHash:C,lookupSpecial:M,copyKeywordsToNamedArgs:W,typeName:F,iter:U,gattr:O}=Sk.abstr,{getSetDict:G,getAttr:B,setAttr:K}=Sk.generic;function proxyFail(t){return new p((()=>{throw new m(t+" is not yet implemented in skulpt")}))}Object.assign(t,{__name__:new r("functools"),__doc__:new r("Tools for working with functions and callable objects"),__all__:new s(["update_wrapper","wraps","WRAPPER_ASSIGNMENTS","WRAPPER_UPDATES","total_ordering","cmp_to_key","cache","lru_cache","reduce","partial","partialmethod","singledispatch","singledispatchmethod","cached_property"].map((t=>new r(t)))),WRAPPER_ASSIGNMENTS:new a(["__module__","__name__","__qualname__","__doc__","__annotations__"].map((t=>new r(t)))),WRAPPER_UPDATES:new a([new r("__dict__")]),singledispatch:proxyFail("singledispatch"),singledispatchmethod:proxyFail("singledispatchmethod"),cached_property:proxyFail("cached_property")});const L=new r("cache_parameters");function _lru_cache(e,n){if(n||(n=c),v(e))(e=N(e,g))<0&&(e=0);else{if(k(e)&&y(n)){const r=e,s=new V(r,e=128,n);return s.tp$setattr(L,new p((()=>z({maxsize:e,typed:n})))),A(t.update_wrapper,[s,r])}if(!$(e))throw new h("Expected first argument to be an integer, a callable, or None")}return new p((r=>{const s=new V(r,e,n);return s.tp$setattr(L,new p((()=>z({maxsize:e,typed:n})))),A(t.update_wrapper,[s,r])}))}const H=t._CacheInfo=x(t._namedtuple,["CacheInfo",["hits","misses","maxsize","currsize"]].map((t=>z(t))),["module",new r("functools")]),V=q("functools._lru_cache_wrapper",{constructor:function _lru_cache_wrapper(t,e,n,r){if(!k(t))throw new h("the first argument must be callable");let s;if($(e))s=infinite_lru_cache_wrapper,e=-1;else{if(!v(e))throw new h("maxsize should be integer or None");(e=N(e,g))<0&&(e=0),s=0===e?uncached_lru_cache_wrapper:bounded_lru_cache_wrapper}this.root={},this.root.prev=this.root.next=this.root,this.wrapper=s,this.maxsize=e,this.typed=n,this.cache=new i([]),this.func=t,this.misses=this.hits=0,this.$d=new i([])},slots:{tp$new(t,e){const[n,r,s,a]=W("_lru_cache_wrapper",["user_function","maxsize","typed","cache_info_type"],t,e);return new V(n,r,s,a)},tp$call(t,e){return this.wrapper(t,e)},tp$descr_get(t,e){return null===t?this:new u(this,t)},tp$doc:"Create a cached callable that wraps another function.\\n\\nuser_function: the function being cached\\n\\nmaxsize: 0 for no caching\\n None for unlimited cache size\\n n for a bounded cache\\n\\ntyped: False cache f(3) and f(3.0) as identical calls\\n True cache f(3) and f(3.0) as distinct calls\\n\\ncache_info_type: namedtuple class with the fields:\\n hits misses currsize maxsize\\n"},methods:{cache_info:{$meth(){return A(H,[this.hits,this.misses,-1===this.maxsize?o:this.maxsize,this.cache.get$size()].map((t=>z(t))))},$flags:{NoArgs:!0},$doc:"Report cache statistics"},cache_clear:{$meth(){return this.hits=this.misses=0,this.root={},this.root.next=this.root.prev=this.root,A(this.cache.tp$getattr(new r("clear"),!0))},$flags:{NoArgs:!0},$doc:"Clear the cache and cache statistics"},__deepcopy__:{$meth(t){return this},$flags:{OneArg:!0}},__copy__:{$meth(){return this},$flags:{NoArgs:!0}}},getsets:{__dict__:G}});function infinite_lru_cache_wrapper(t,e){const n=_make_key(t,e,this.typed),r=this.cache.mp$lookup(n);return void 0!==r?(this.hits++,r):(this.misses++,E(A(this.func,t,e),(t=>(this.cache.mp$ass_subscript(n,t),t))))}function uncached_lru_cache_wrapper(t,e){return this.misses++,A(this.func,t,e)}function bounded_lru_cache_wrapper(t,e){const n=_make_key(t,e,this.typed),r=this.cache.mp$lookup(n);if(void 0!==r){const{result:t}=r;return lru_cache_extract_link(r),lru_cache_append_link(this,r),this.hits++,t}return this.misses++,E(A(this.func,t,e),(t=>{if(void 0!==this.cache.mp$lookup(n))return t;if(this.cache.get$size()t.ob$type)),...i.map((t=>t.ob$type)));else if(1===s.length&&X.has(s[0].ob$type))return s[0];return new J(s)}function partial_adjust_args_kwargs(t,e){if(t=this.arg_arr.concat(t),e){e=D(e);const t=this.kwdict.dict$copy();t.dict$merge(e),e=I(t)}else e=I(this.kwdict);return{args:t,kwargs:e}}function partial_new(t,e){if(t.length<1)throw new h("type \'partial\' takes at least 1 argument");let n,r,s=t.shift();if(s instanceof this.sk$builtinBase){const t=s;s=t.fn,n=t.arg_arr,r=t.kwdict}this.check$func(s),n&&(t=n.concat(t));let a=D(e=e||[]);if(r){const t=r.dict$copy();t.dict$merge(a),a=t}if(this.sk$builtinBase===this.constructor)return new this.constructor(s,t,a);{const e=new this.constructor;return this.sk$builtinBase.call(e,s,t,a),e}}function partial_repr(){if(this.in$repr)return new r("...");this.in$repr=!0;const t=[R(this.fn)];return this.arg_arr.forEach((e=>{t.push(R(e))})),this.kwdict.$items().forEach((([e,n])=>{t.push(e.toString()+"="+R(n))})),this.in$repr=!1,new r(this.tp$name+"("+t.join(", ")+")")}t.partial=q("functools.partial",{constructor:function partial(t,e,n){this.fn=t,this.arg_arr=e,this.arg_tup=new a(e),this.kwdict=n,this.in$repr=!1,this.$d=new i([])},slots:{tp$new:partial_new,tp$call(t,e){return({args:t,kwargs:e}=this.adj$args_kws(t,e)),this.fn.tp$call(t,e)},tp$doc:"partial(func, *args, **keywords) - new function with partial application\\n of the given arguments and keywords.\\n",$r:partial_repr,tp$getattr:B,tp$setattr:K},getsets:{func:{$get(){return this.fn},$doc:"function object to use in future partial calls"},args:{$get(){return this.arg_tup},$doc:"tuple of arguments to future partial calls"},keywords:{$get(){return this.kwdict},$doc:"dictionary of keyword arguments to future partial calls"},__dict__:G},methods:{},classmethods:Sk.generic.classGetItem,proto:{adj$args_kws:partial_adjust_args_kwargs,check$func(t){if(!k(t))throw new h("the first argument must be callable")}}}),t.partialmethod=q("functools.partialmethod",{constructor:function partialmethod(t,e,n){this.fn=t,this.arg_arr=e,this.arg_tup=new a(e),this.kwdict=n},slots:{tp$new:partial_new,tp$doc:"Method descriptor with partial application of the given arguments\\n and keywords.\\n\\n Supports wrapping existing descriptors and handles non-descriptor\\n callables as instance methods.\\n ",$r:partial_repr,tp$descr_get(e,n){let r;if(this.fn.tp$descr_get){const s=this.fn.tp$descr_get(e,n);if(s!==this.fn){if(!k(s))throw new h("type \'partial\' requires a callable");r=new t.partial(s,this.arg_arr.slice(0),this.kwdict.dict$copy());const e=M(s,this.str$self);void 0!==e&&r.tp$setattr(this.str$self,e)}}return void 0===r&&(r=this.make$unbound().tp$descr_get(e,n)),r}},methods:{_make_unbound_method:{$meth(){return this.make$unbound()},$flags:{NoArgs:!0}}},classmethods:Sk.generic.classGetItem,getsets:{func:{$get(){return this.fn},$doc:"function object to use in future partial calls"},args:{$get(){return this.arg_tup},$doc:"tuple of arguments to future partial calls"},keywords:{$get(){return this.kwdict},$doc:"dictionary of keyword arguments to future partial calls"},__dict__:G},proto:{str$self:new r("__self__"),make$unbound(){const t=this;function _method(e,n){const r=e.shift();return({args:e,kwargs:n}=t.adj$args_kws(e,n)),e.unshift(r),A(t.fn,e,n)}return _method.co_fastcall=!0,new p(_method)},adj$args_kws:partial_adjust_args_kwargs,check$func(t){if(!k(t)&&void 0===t.tp$descr_get)throw new h(R(t)+" is not callable or a descriptor")}}});const Y={__lt__:r.$lt,__le__:r.$le,__gt__:r.$gt,__ge__:r.$ge};function from_slot(t,e){const n=Y[t];function compare_slot(t,r){let s=x(t.tp$getattr(n),[r]);return s===_?s:(s=P(s),new l(e(s,t,r)))}return compare_slot.co_name=n,compare_slot}const Z=from_slot("__lt__",((t,e,n)=>!t&&j(e,n,"NotEq"))),tt=from_slot("__lt__",((t,e,n)=>t||j(e,n,"Eq"))),et=from_slot("__lt__",(t=>!t)),nt=from_slot("__le__",((t,e,n)=>!t||j(e,n,"Eq"))),rt=from_slot("__le__",((t,e,n)=>t&&j(e,n,"NotEq"))),st=from_slot("__le__",(t=>!t)),at=from_slot("__gt__",((t,e,n)=>!t&&j(e,n,"NotEq"))),it=from_slot("__gt__",((t,e,n)=>t||j(e,n,"Eq"))),ot=from_slot("__gt__",(t=>!t)),ct=from_slot("__ge__",((t,e,n)=>!t||j(e,n,"Eq"))),_t=from_slot("__ge__",((t,e,n)=>t&&j(e,n,"NotEq"))),lt=from_slot("__ge__",(t=>!t)),pt={__lt__:{__gt__:new p(Z),__le__:new p(tt),__ge__:new p(et)},__le__:{__ge__:new p(nt),__lt__:new p(rt),__gt__:new p(st)},__gt__:{__lt__:new p(at),__ge__:new p(it),__le__:new p(ot)},__ge__:{__le__:new p(ct),__gt__:new p(_t),__lt__:new p(lt)}},ut={__lt__:"ob$lt",__le__:"ob$le",__gt__:"ob$gt",__ge__:"ob$ge"};const ht=new n(0),dt=q("functools.KeyWrapper",{constructor:function(t,e){this.cmp=t,this.obj=e},slots:{tp$call(t,e){const[n]=W("K",["obj"],t,e,[]);return new dt(this.cmp,n)},tp$richcompare(t,e){if(!(t instanceof dt))throw new h("other argument must be K instance");const n=this.obj,r=t.obj;if(!n||!r)throw new w("object");const s=A(this.cmp,[n,r]);return E(s,(t=>j(t,ht,e)))},tp$getattr:B,tp$hash:o},getsets:{obj:{$get(){return this.obj||o},$set(t){this.obj=t},$doc:"Value wrapped by a key function."}}}),ft=new r("update"),mt=new r("__wrapped__");return T("functools",t,{cache:{$meth:function cache(t){return A(_lru_cache(o),[t])},$flags:{OneArg:!0},$doc:\'Simple lightweight unbounded cache. Sometimes called "memoize".\',$textsig:"($module, user_function, /)"},lru_cache:{$meth:_lru_cache,$flags:{NamedArgs:["maxsize","typed"],Defaults:[new n(128),c]},$doc:"Least-recently-used cache decorator.\\n\\nIf *maxsize* is set to None, the LRU features are disabled and the cache\\ncan grow without bound.\\n\\nIf *typed* is True, arguments of different types will be cached separately.\\nFor example, f(3.0) and f(3) will be treated as distinct calls with\\ndistinct results.\\n\\nArguments to the cached function must be hashable.\\n\\nView the cache statistics named tuple (hits, misses, maxsize, currsize)\\nwith f.cache_info(). Clear the cache and statistics with f.cache_clear().\\nAccess the underlying function with f.__wrapped__.\\n\\nSee: http://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)"},cmp_to_key:{$meth:function cmp_to_key(t){return new dt(t)},$flags:{NamedArgs:["mycmp"],Defaults:[]},$doc:"Convert a cmp= function into a key= function.",$textsig:"($module, cmp, /)"},reduce:{$meth:function reduce(t,e,n){const r=U(e);let s;return n=n||r.tp$iternext(!0),E(n,(e=>{if(void 0===e)throw new h("reduce() of empty sequence with no initial value");return s=e,S(r,(e=>E(A(t,[s,e]),(t=>{s=t}))))}),(()=>s))},$flags:{MinArgs:2,MaxArgs:3},$doc:"reduce(function, sequence[, initial]) -> value\\n\\nApply a function of two arguments cumulatively to the items of a sequence,\\nfrom left to right, so as to reduce the sequence to a single value.\\nFor example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates\\n((((1+2)+3)+4)+5). If initial is present, it is placed before the items\\nof the sequence in the calculation, and serves as a default when the\\nsequence is empty.",$textsig:"($module, function, sequence[, initial], /)"},total_ordering:{$meth:function total_ordering(t){const n=[];if(!b(t))throw new h("total ordering only supported for type objects not \'"+F(t)+"\'");if(Object.keys(pt).forEach((r=>{const s=ut[r];t.prototype[s]!==e.prototype[s]&&n.push(r)})),!n.length)throw new f("must define atleast one ordering operation: <, >, <=, >=");const r=n[0];return Object.entries(pt[r]).forEach((([e,r])=>{n.includes(e)||t.tp$setattr(Y[e],r)})),t},$flags:{OneArg:!0},$doc:"Class decorator that fills in missing ordering methods"},update_wrapper:{$meth:function update_wrapper(t,e,n,r){let s,a=U(n);for(let i=a.tp$iternext();void 0!==i;i=a.tp$iternext())void 0!==(s=e.tp$getattr(i))&&t.tp$setattr(i,s);a=U(r);for(let o=a.tp$iternext();void 0!==o;o=a.tp$iternext()){s=e.tp$getattr(o)||new i([]);const n=O(t,o),r=O(n,ft);x(r,[s])}return t.tp$setattr(mt,e),t},$flags:{NamedArgs:["wrapper","wrapped","assigned","updated"],Defaults:[t.WRAPPER_ASSIGNMENTS,t.WRAPPER_UPDATES]},$doc:"Update a wrapper function to look like the wrapped function\\n\\n wrapper is the function to be updated\\n wrapped is the original function\\n assigned is a tuple naming the attributes assigned directly\\n from the wrapped function to the wrapper function (defaults to\\n functools.WRAPPER_ASSIGNMENTS)\\n updated is a tuple naming the attributes of the wrapper that\\n are updated with the corresponding attribute from the wrapped\\n function (defaults to functools.WRAPPER_UPDATES)\\n ",$textsig:"($module, /, wrapper, wrapped, assigned=(\'__module__\', \'__name__\', \'__qualname__\', \'__doc__\', \'__annotations__\'), updated=(\'__dict__\',))"},wraps:{$meth:function wraps(e,n,r){const s=["wrapped",e,"assigned",n,"updated",r];return A(t.partial,[t.update_wrapper],s)},$flags:{NamedArgs:["wrapped","assigned","updated"],Defaults:[t.WRAPPER_ASSIGNMENTS,t.WRAPPER_UPDATES]},$doc:"Decorator factory to apply update_wrapper() to a wrapper function\\n\\n Returns a decorator that invokes update_wrapper() with the decorated\\n function as the wrapper argument and the arguments to wraps() as the\\n remaining arguments. Default arguments are as for update_wrapper().\\n This is a convenience function to simplify applying partial() to\\n update_wrapper().\\n ",$textsig:"($module, /, wrapped, assigned=(\'__module__\', \'__name__\', \'__qualname__\', \'__doc__\', \'__annotations__\'), updated=(\'__dict__\',))"}}),t}',"src/lib/image.js":'var ImageMod,$builtinmodule;ImageMod||((ImageMod={}).canvasLib=[]),$builtinmodule=function(e){var n,t,i,a,u,l,r,s={__name__:new Sk.builtin.str("image")};return s.Image=Sk.misceval.buildClass(s,(function(e,n){u=function(e){e.width=e.image.width,e.height=e.image.height,e.delay=0,e.updateCount=0,e.updateInterval=1,e.lastx=0,e.lasty=0,e.canvas=document.createElement("canvas"),e.canvas.height=e.height,e.canvas.width=e.width,e.ctx=e.canvas.getContext("2d"),e.ctx.drawImage(e.image,0,0),e.imagedata=e.ctx.getImageData(0,0,e.width,e.height)},n.__init__=new Sk.builtin.func((function(e,n){var t;Sk.builtin.pyCheckArgsLen("__init__",arguments.length,2,2);try{e.image=document.getElementById(Sk.ffi.remapToJs(n)),u(e)}catch(i){e.image=null}if(null==e.image)return(t=new Sk.misceval.Suspension).resume=function(){if(t.data.error)throw new Sk.builtin.IOError(t.data.error.message)},t.data={type:"Sk.promise",promise:new Promise((function(t,i){var a=new Image;a.crossOrigin="",a.onerror=function(){i(Error("Failed to load URL: "+a.src))},a.onload=function(){e.image=this,u(e),t()},a.src=r(n)}))},t})),r=function(e){var n,t,i="function"==typeof Sk.imageProxy?Sk.imageProxy:function(e){return(n=document.createElement("a")).href=t,window.location.host!==n.host?Sk.imageProxy+"/"+e:e};return t=i(t=Sk.ffi.remapToJs(e))},l=function(e,n,t){if(n<0||t<0||n>=e.width||t>=e.height)throw new Sk.builtin.ValueError("Pixel index out of range.")};var setdelay=function(e,n,t){var i;Sk.builtin.pyCheckArgsLen("setdelay",arguments.length,2,3),e.delay=Sk.ffi.remapToJs(n),i=Sk.builtin.asnum$(t),e.updateInterval=i||1};n.set_delay=new Sk.builtin.func(setdelay),n.setDelay=new Sk.builtin.func(setdelay);var getpixels=function(e){var n,t=[];for(Sk.builtin.pyCheckArgsLen("getpixels",arguments.length,1,1),n=0;n=e.width?e.lastCtx.putImageData(e.imagedata,e.lastUlx,e.lastUly,0,e.lasty,e.width,2):e.lasty+e.updateInterval>=e.height?e.lastCtx.putImageData(e.imagedata,e.lastUlx,e.lastUly,e.lastx,0,2,e.height):e.lastCtx.putImageData(e.imagedata,e.lastUlx,e.lastUly,Math.min(n,e.lastx),Math.min(t,e.lasty),Math.max(Math.abs(n-e.lastx),1),Math.max(Math.abs(t-e.lasty),1)),e.lastx=n,e.lasty=t,e.delay>0?window.setTimeout(i,e.delay):i()):i()}))},i};var setpixel=function(e,n,t,i){var u;return Sk.builtin.pyCheckArgsLen("setpixel",arguments.length,4,4),n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t),l(e,n,t),u=4*t*e.width+4*n,e.imagedata.data[u]=Sk.builtin.asnum$(Sk.misceval.callsimArray(i.getRed,[i])),e.imagedata.data[u+1]=Sk.builtin.asnum$(Sk.misceval.callsimArray(i.getGreen,[i])),e.imagedata.data[u+2]=Sk.builtin.asnum$(Sk.misceval.callsimArray(i.getBlue,[i])),e.imagedata.data[u+3]=255,a(e,n,t)};n.set_pixel=new Sk.builtin.func(setpixel),n.setPixel=new Sk.builtin.func(setpixel);var setpixelat=function(e,n,t){var i,u,r;return Sk.builtin.pyCheckArgsLen("setpixelat",arguments.length,3,3),i=(n=Sk.builtin.asnum$(n))%e.image.width,u=Math.floor(n/e.image.width),l(e,i,u),r=4*u*e.width+4*i,e.imagedata.data[r]=Sk.builtin.asnum$(Sk.misceval.callsimArray(t.getRed,[t])),e.imagedata.data[r+1]=Sk.builtin.asnum$(Sk.misceval.callsimArray(t.getGreen,[t])),e.imagedata.data[r+2]=Sk.builtin.asnum$(Sk.misceval.callsimArray(t.getBlue,[t])),e.imagedata.data[r+3]=255,a(e,i,u)};n.set_pixel_at=new Sk.builtin.func(setpixelat),n.setPixelAt=new Sk.builtin.func(setpixelat);var updatepixel=function(e,n){var t,i,u;return Sk.builtin.pyCheckArgsLen("updatepixel",arguments.length,2,2),t=Sk.builtin.asnum$(Sk.misceval.callsimArray(n.getX,[n])),i=Sk.builtin.asnum$(Sk.misceval.callsimArray(n.getY,[n])),l(e,t,i),u=4*i*e.width+4*t,e.imagedata.data[u]=Sk.builtin.asnum$(Sk.misceval.callsimArray(n.getRed,[n])),e.imagedata.data[u+1]=Sk.builtin.asnum$(Sk.misceval.callsimArray(n.getGreen,[n])),e.imagedata.data[u+2]=Sk.builtin.asnum$(Sk.misceval.callsimArray(n.getBlue,[n])),e.imagedata.data[u+3]=255,a(e,t,i)};n.update_pixel=new Sk.builtin.func(updatepixel),n.updatePixel=new Sk.builtin.func(updatepixel);var getheight=function(e){return Sk.builtin.pyCheckArgsLen("getheight",arguments.length,1,1),new Sk.builtin.int_(e.height)};n.get_height=new Sk.builtin.func(getheight),n.getHeight=new Sk.builtin.func(getheight);var getwidth=function(e,n){return Sk.builtin.pyCheckArgsLen("getwidth",arguments.length,1,1),new Sk.builtin.int_(e.width)};n.get_width=new Sk.builtin.func(getwidth),n.getWidth=new Sk.builtin.func(getwidth),n.__getattr__=new Sk.builtin.func((function(e,n){return"height"===(n=Sk.ffi.remapToJs(n))?Sk.builtin.assk$(e.height):"width"===n?Sk.builtin.assk$(e.width):void 0})),n.__setattr__=new Sk.builtin.func((function(e,n,t){throw"height"===(n=Sk.ffi.remapToJs(n))||"width"===n?new Sk.builtin.Exception("Cannot change height or width they can only be set on creation"):new Sk.builtin.Exception("Unknown attribute: "+n)})),n.draw=new Sk.builtin.func((function(e,n,t,i){var a;return Sk.builtin.pyCheckArgsLen("draw",arguments.length,2,4),(a=new Sk.misceval.Suspension).resume=function(){return Sk.builtin.none.none$},a.data={type:"Sk.promise",promise:new Promise((function(a,u){var l;n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t),i=Sk.builtin.asnum$(i),l=Sk.misceval.callsimArray(n.getWin,[n]).getContext("2d"),void 0===t&&(t=0,i=0),e.lastUlx=t,e.lastUly=i,e.lastCtx=l,l.putImageData(e.imagedata,t,i),e.delay>0?window.setTimeout(a,e.delay):window.setTimeout(a,200)}))},a}))}),"Image",[]),i=function(e,n){n.__init__=new Sk.builtin.func((function(e,n,t){Sk.builtin.pyCheckArgsLen("__init__",arguments.length,3,3),e.width=Sk.builtin.asnum$(n),e.height=Sk.builtin.asnum$(t),e.canvas=document.createElement("canvas"),e.ctx=e.canvas.getContext("2d"),e.canvas.height=e.height,e.canvas.width=e.width,e.imagedata=e.ctx.getImageData(0,0,e.width,e.height)}))},s.EmptyImage=Sk.misceval.buildClass(s,i,"EmptyImage",[s.Image]),t=function(e,n){n.__init__=new Sk.builtin.func((function(e,n,t,i,a,u){Sk.builtin.pyCheckArgsLen("__init__",arguments.length,4,6),e.red=Sk.builtin.asnum$(n),e.green=Sk.builtin.asnum$(t),e.blue=Sk.builtin.asnum$(i),e.x=Sk.builtin.asnum$(a),e.y=Sk.builtin.asnum$(u)}));var getred=function(e){return Sk.builtin.pyCheckArgsLen("getred",arguments.length,1,1),Sk.builtin.assk$(e.red)};n.get_red=new Sk.builtin.func(getred),n.getRed=new Sk.builtin.func(getred);var getgreen=function(e){return Sk.builtin.pyCheckArgsLen("getgreen",arguments.length,1,1),Sk.builtin.assk$(e.green)};n.get_green=new Sk.builtin.func(getgreen),n.getGreen=new Sk.builtin.func(getgreen);var getblue=function(e){return Sk.builtin.pyCheckArgsLen("getblue",arguments.length,1,1),Sk.builtin.assk$(e.blue)};n.get_blue=new Sk.builtin.func(getblue),n.getBlue=new Sk.builtin.func(getblue);var getx=function(e){return Sk.builtin.pyCheckArgsLen("getx",arguments.length,1,1),Sk.builtin.assk$(e.x)};n.get_x=new Sk.builtin.func(getx),n.getX=new Sk.builtin.func(getx);var gety=function(e){return Sk.builtin.pyCheckArgsLen("gety",arguments.length,1,1),Sk.builtin.assk$(e.y)};n.get_y=new Sk.builtin.func(gety),n.getY=new Sk.builtin.func(gety);var setred=function(e,n){Sk.builtin.pyCheckArgsLen("setred",arguments.length,2,2),e.red=Sk.builtin.asnum$(n)};n.set_red=new Sk.builtin.func(setred),n.setRed=new Sk.builtin.func(setred);var setgreen=function(e,n){Sk.builtin.pyCheckArgsLen("setgreen",arguments.length,2,2),e.green=Sk.builtin.asnum$(n)};n.set_green=new Sk.builtin.func(setgreen),n.setGreen=new Sk.builtin.func(setgreen);var setblue=function(e,n){Sk.builtin.pyCheckArgsLen("setblue",arguments.length,2,2),e.blue=Sk.builtin.asnum$(n)};n.set_blue=new Sk.builtin.func(setblue),n.setBlue=new Sk.builtin.func(setblue),n.__getattr__=new Sk.builtin.func((function(e,n){return"red"===(n=Sk.ffi.remapToJs(n))?Sk.builtin.assk$(e.red):"green"===n?Sk.builtin.assk$(e.green):"blue"===n?Sk.builtin.assk$(e.blue):void 0})),n.__setattr__=new Sk.builtin.func((function(e,n,t){"red"!==(n=Sk.ffi.remapToJs(n))&&"green"!==n&&"blue"!==n||(e[n]=Sk.builtin.asnum$(t))}));var setx=function(e,n){Sk.builtin.pyCheckArgsLen("setx",arguments.length,2,2),e.x=Sk.builtin.asnum$(n)};n.set_x=new Sk.builtin.func(setx),n.setX=new Sk.builtin.func(setx);var sety=function(e,n){Sk.builtin.pyCheckArgsLen("sety",arguments.length,2,2),e.y=Sk.builtin.asnum$(n)};n.set_y=new Sk.builtin.func(sety),n.setY=new Sk.builtin.func(sety),n.__getitem__=new Sk.builtin.func((function(e,n){return 0===(n=Sk.builtin.asnum$(n))?e.red:1==n?e.green:2==n?e.blue:void 0})),n.__str__=new Sk.builtin.func((function(e){return Sk.ffi.remapToPy("["+e.red+","+e.green+","+e.blue+"]")})),n.getColorTuple=new Sk.builtin.func((function(e,n,t){})),n.setRange=new Sk.builtin.func((function(e,n){e.max=Sk.builtin.asnum$(n)}))},s.Pixel=Sk.misceval.buildClass(s,t,"Pixel",[]),n=function(e,n){n.__init__=new Sk.builtin.func((function(e,n,t){var i,a,u;Sk.builtin.pyCheckArgsLen("__init__",arguments.length,1,3),void 0===(i=ImageMod.canvasLib[Sk.canvas])?(a=document.createElement("canvas"),u=document.getElementById(Sk.canvas),e.theScreen=a,u.appendChild(a),ImageMod.canvasLib[Sk.canvas]=a,ImageMod.canvasLib[Sk.canvas]=e.theScreen):(e.theScreen=i,e.theScreen.height=e.theScreen.height),void 0!==n?(e.theScreen.height=t.v,e.theScreen.width=n.v):(Sk.availableHeight&&(e.theScreen.height=Sk.availableHeight),Sk.availableWidth&&(e.theScreen.width=Sk.availableWidth)),e.theScreen.style.display="block"})),n.getWin=new Sk.builtin.func((function(e){return e.theScreen})),n.exitonclick=new Sk.builtin.func((function(e){var n=e.theScreen.id;e.theScreen.onclick=function(){document.getElementById(n).style.display="none",document.getElementById(n).onclick=null,delete ImageMod.canvasLib[n]}}))},s.ImageWin=Sk.misceval.buildClass(s,n,"ImageWin",[]),s};',"src/lib/itertools.js":'var $builtinmodule=function(t){var e={};function combinationsNew(t,e,i){let r,s;[r,s]=Sk.abstr.copyKeywordsToNamedArgs(t.tp$name,["iterable","r"],e,i,[]);const n=Sk.misceval.arrayFromIterable(r);if(s=Sk.misceval.asIndexSized(s,Sk.builtin.OverFlowError),s<0)throw new Sk.builtin.ValueError("r must be non-negative");if(this===t)return new t.constructor(n,s);{const e=new this.constructor;return t.constructor.call(e,n,s),e}}return e.accumulate=Sk.abstr.buildIteratorClass("itertools.accumulate",{constructor:function accumulate(t,e,i){this.iter=t,this.func=e,this.total=i,this.tp$iternext=()=>(this.total=Sk.builtin.checkNone(this.total)?this.iter.tp$iternext():this.total,this.tp$iternext=this.constructor.prototype.tp$iternext,this.total)},iternext(t){let e=this.iter.tp$iternext();if(void 0!==e)return this.total=Sk.misceval.callsimArray(this.func,[this.total,e]),this.total},slots:{tp$doc:"accumulate(iterable[, func, initial]) --\\x3e accumulate object\\n\\nReturn series of accumulated sums (or other binary function results).",tp$new(t,i){Sk.abstr.checkArgsLen("accumulate",t,0,2);let[r,s,n]=Sk.abstr.copyKeywordsToNamedArgs("accumulate",["iterable","func","initial"],t,i,[Sk.builtin.none.none$,Sk.builtin.none.none$]);if(r=Sk.abstr.iter(r),s=Sk.builtin.checkNone(s)?new Sk.builtin.func(((t,e)=>Sk.abstr.numberBinOp(t,e,"Add"))):s,this===e.accumulate.prototype)return new e.accumulate(r,s,n);{const t=new this.constructor;return e.accumulate.call(t,r,s,n),t}}}}),e.chain=Sk.abstr.buildIteratorClass("itertools.chain",{constructor:function chain(t){this.iterables=t,this.current_it=null,this.tp$iternext=()=>{if(this.tp$iternext=this.constructor.prototype.tp$iternext,this.current_it=this.iterables.tp$iternext(),void 0!==this.current_it)return this.current_it=Sk.abstr.iter(this.current_it),this.tp$iternext();this.tp$iternext=()=>{}}},iternext(t){let e;for(;void 0===e;){if(e=this.current_it.tp$iternext(),void 0!==e)return e;if(this.current_it=this.iterables.tp$iternext(),void 0===this.current_it)return void(this.tp$iternext=()=>{});this.current_it=Sk.abstr.iter(this.current_it)}},slots:{tp$doc:"chain(*iterables) --\\x3e chain object\\n\\nReturn a chain object whose .__next__() method returns elements from the\\nfirst iterable until it is exhausted, then elements from the next\\niterable, until all of the iterables are exhausted.",tp$new(t,i){if(Sk.abstr.checkNoKwargs("chain",i),t=new Sk.builtin.tuple(t.slice(0)).tp$iter(),this===e.chain.prototype)return new e.chain(t);{const i=new this.constructor;return e.chain.call(i,t),i}}},classmethods:Object.assign({from_iterable:{$meth(t){const i=Sk.abstr.iter(t);return new e.chain(i)},$flags:{OneArg:!0},$doc:"chain.from_iterable(iterable) --\\x3e chain object\\n\\nAlternate chain() constructor taking a single iterable argument\\nthat evaluates lazily.",$textsig:null}},Sk.generic.classGetItem)}),e.combinations=Sk.abstr.buildIteratorClass("itertools.combinations",{constructor:function combinations(t,e){this.pool=t,this.r=e,this.indices=new Array(e).fill().map(((t,e)=>e)),this.n=t.length,this.tp$iternext=()=>{if(!(this.r>this.n))return this.tp$iternext=this.constructor.prototype.tp$iternext,new Sk.builtin.tuple(this.pool.slice(0,this.r))}},iternext(t){let e,i=!1;for(e=this.r-1;e>=0;e--)if(this.indices[e]!=e+this.n-this.r){i=!0;break}if(!i)return void(this.r=0);this.indices[e]++;for(let s=e+1;sthis.pool[t]));return new Sk.builtin.tuple(r)},slots:{tp$doc:"combinations(iterable, r) --\\x3e combinations object\\n\\nReturn successive r-length combinations of elements in the iterable.\\n\\ncombinations(range(4), 3) --\\x3e (0,1,2), (0,1,3), (0,2,3), (1,2,3)",tp$new(t,i){return combinationsNew.call(this,e.combinations.prototype,t,i)}}}),e.combinations_with_replacement=Sk.abstr.buildIteratorClass("itertools.combinations_with_replacement",{constructor:function combinations_with_replacement(t,e){this.pool=t,this.r=e,this.indices=new Array(e).fill(0),this.n=t.length,this.tp$iternext=()=>{if(this.r&&!this.n)return;this.tp$iternext=this.constructor.prototype.tp$iternext;const t=this.indices.map((t=>this.pool[t]));return new Sk.builtin.tuple(t)}},iternext(t){let e,i=!1;for(e=this.r-1;e>=0;e--)if(this.indices[e]!=this.n-1){i=!0;break}if(!i)return void(this.r=0);const r=this.indices[e]+1;for(let n=e;nthis.pool[t]));return new Sk.builtin.tuple(s)},slots:{tp$doc:"combinations_with_replacement(iterable, r) --\\x3e combinations_with_replacement object\\n\\nReturn successive r-length combinations of elements in the iterable\\nallowing individual elements to have successive repeats.\\ncombinations_with_replacement(\'ABC\', 2) --\\x3e AA AB AC BB BC CC",tp$new(t,i){return combinationsNew.call(this,e.combinations_with_replacement.prototype,t,i)}}}),e.compress=Sk.abstr.buildIteratorClass("itertools.compress",{constructor:function compress(t,e){this.data=t,this.selectors=e},iternext(){let t=this.data.tp$iternext(),e=this.selectors.tp$iternext();for(;void 0!==t&&void 0!==e;){if(Sk.misceval.isTrue(e))return t;t=this.data.tp$iternext(),e=this.selectors.tp$iternext()}},slots:{tp$doc:"compress(data, selectors) --\\x3e iterator over selected data\\n\\nReturn data elements corresponding to true selector elements.\\nForms a shorter iterator from selected data elements using the\\nselectors to choose the data elements.",tp$new(t,i){let r,s;if([r,s]=Sk.abstr.copyKeywordsToNamedArgs("compress",["data","selectors"],t,i,[]),r=Sk.abstr.iter(r),s=Sk.abstr.iter(s),this===e.count.prototype)return new e.compress(r,s);{const t=new this.constructor;return e.compress.call(t,r,s),t}}}}),e.count=Sk.abstr.buildIteratorClass("itertools.count",{constructor:function count(t,e){this.start=t,this.step=e},iternext(){const t=this.start;return this.start=Sk.abstr.numberBinOp(this.start,this.step,"Add"),t},slots:{tp$doc:"count(start=0, step=1) --\\x3e count object\\n\\nReturn a count object whose .__next__() method returns consecutive values.\\nEquivalent to:\\n\\n def count(firstval=0, step=1):\\n x = firstval\\n while 1:\\n yield x\\n x += step\\n",tp$new(t,i){const[r,s]=Sk.abstr.copyKeywordsToNamedArgs("count",["start","step"],t,i,[new Sk.builtin.int_(0),new Sk.builtin.int_(1)]);if(!Sk.builtin.checkNumber(r)&&!Sk.builtin.checkComplex(r))throw new Sk.builtin.TypeError("a number is required");if(!Sk.builtin.checkNumber(s)&&!Sk.builtin.checkComplex(s))throw new Sk.builtin.TypeError("a number is required");if(this===e.count.prototype)return new e.count(r,s);{const t=new this.constructor;return e.count.call(t,r,s),t}},$r(){const t=Sk.misceval.objectRepr(this.start);let e=Sk.misceval.objectRepr(this.step);return e="1"===e?"":", "+e,new Sk.builtin.str(Sk.abstr.typeName(this)+"("+t+e+")")}}}),e.cycle=Sk.abstr.buildIteratorClass("itertools.cycle",{constructor:function cycle(t){this.iter=t,this.saved=[],this.consumed=!1,this.i=0,this.length},iternext(){let t;if(!this.consumed){if(t=this.iter.tp$iternext(),void 0!==t)return this.saved.push(t),t;if(this.consumed=!0,this.length=this.saved.length,!this.length)return}return t=this.saved[this.i],this.i=(this.i+1)%this.length,t},slots:{tp$doc:"cycle(iterable) --\\x3e cycle object\\n\\nReturn elements from the iterable until it is exhausted.\\nThen repeat the sequence indefinitely.",tp$new(t,i){Sk.abstr.checkOneArg("cycle",t,i);const r=Sk.abstr.iter(t[0]);if(this===e.cycle.prototype)return new e.cycle(r);{const t=new this.constructor;return e.cycle.call(t,r),t}}}}),e.dropwhile=Sk.abstr.buildIteratorClass("itertools.dropwhile",{constructor:function dropwhile(t,e){this.predicate=t,this.iter=e,this.passed},iternext(){let t=this.iter.tp$iternext();for(;void 0===this.passed&&void 0!==t;){const e=Sk.misceval.callsimArray(this.predicate,[t]);if(!Sk.misceval.isTrue(e))return this.passed=!0,t;t=this.iter.tp$iternext()}return t},slots:{tp$doc:"dropwhile(predicate, iterable) --\\x3e dropwhile object\\n\\nDrop items from the iterable while predicate(item) is true.\\nAfterwards, return every element until the iterable is exhausted.",tp$new(t,i){Sk.abstr.checkNoKwargs("dropwhile",i),Sk.abstr.checkArgsLen("dropwhile",t,2,2);const r=t[0],s=Sk.abstr.iter(t[1]);if(this===e.dropwhile.prototype)return new e.dropwhile(r,s);{const t=new this.constructor;return e.dropwhile.call(t,r,s),t}}}}),e.filterfalse=Sk.abstr.buildIteratorClass("itertools.filterfalse",{constructor:function filterfalse(t,e){this.predicate=t,this.iter=e},iternext(t){let e=this.iter.tp$iternext();if(void 0===e)return;let i=Sk.misceval.callsimArray(this.predicate,[e]);for(;Sk.misceval.isTrue(i);){if(e=this.iter.tp$iternext(),void 0===e)return;i=Sk.misceval.callsimArray(this.predicate,[e])}return e},slots:{tp$doc:"filterfalse(function or None, sequence) --\\x3e filterfalse object\\n\\nReturn those items of sequence for which function(item) is false.\\nIf function is None, return the items that are false.",tp$new(t,i){Sk.abstr.checkNoKwargs("filterfalse",i),Sk.abstr.checkArgsLen("filterfalse",t,2,2);const r=Sk.builtin.checkNone(t[0])?Sk.builtin.bool:t[0],s=Sk.abstr.iter(t[1]);if(this===e.filterfalse.prototype)return new e.filterfalse(r,s);{const t=new this.constructor;return e.filterfalse.call(t,r,s),t}}}}),e._grouper=Sk.abstr.buildIteratorClass("itertools._grouper",{constructor:function _grouper(t,e){this.groupby=t,this.tgtkey=t.tgtkey,this.id=t.id},iternext(t){const e=Sk.misceval.richCompareBool(this.groupby.currkey,this.tgtkey,"Eq");if(this.groupby.id===this.id&&e){let t=this.groupby.currval;return this.groupby.currval=this.groupby.iter.tp$iternext(),void 0!==this.groupby.currval&&(this.groupby.currkey=Sk.misceval.callsimArray(this.groupby.keyf,[this.groupby.currval])),t}}}),e.groupby=Sk.abstr.buildIteratorClass("itertools.groupby",{constructor:function groupby(t,e){this.iter=t,this.keyf=e,this.currval,this.currkey=this.tgtkey=new Sk.builtin.object,this.id},iternext(t){this.id=new Object;let i=Sk.misceval.richCompareBool(this.currkey,this.tgtkey,"Eq");for(;i;){if(this.currval=this.iter.tp$iternext(),void 0===this.currval)return;this.currkey=Sk.misceval.callsimArray(this.keyf,[this.currval]),i=Sk.misceval.richCompareBool(this.currkey,this.tgtkey,"Eq")}this.tgtkey=this.currkey;const r=new e._grouper(this);return new Sk.builtin.tuple([this.currkey,r])},slots:{tp$doc:"groupby(iterable, key=None) -> make an iterator that returns consecutive\\nkeys and groups from the iterable. If the key function is not specified or\\nis None, the element itself is used for grouping.\\n",tp$new(t,i){let r,s;if([r,s]=Sk.abstr.copyKeywordsToNamedArgs("groupby",["iterable","key"],t,i,[Sk.builtin.none.none$]),r=Sk.abstr.iter(r),s=Sk.builtin.checkNone(s)?new Sk.builtin.func((t=>t)):s,this===e.groupby.prototype)return new e.groupby(r,s);{const t=new this.constructor;return e.groupby.call(t,r,s),t}}}}),e.islice=Sk.abstr.buildIteratorClass("itertools.islice",{constructor:function islice(t,e,i,r){this.iter=t,this.previt=e,this.stop=i,this.step=r,this.tp$iternext=()=>{if(this.tp$iternext=this.constructor.prototype.tp$iternext,!(this.previt>=this.stop)){for(let t=0;t=this.stop)){for(let t=this.previt+1;tNumber.MAX_SAFE_INTEGER)throw new Sk.builtin.ValueError("Stop for islice() must be None or an integer: 0 <= x <= sys.maxsize.");if(!Sk.builtin.checkNone(s)&&!Sk.misceval.isIndex(s))throw new Sk.builtin.ValueError("Indices for islice() must be None or an integer: 0 <= x <= sys.maxsize.");if(s=Sk.builtin.checkNone(s)?0:Sk.misceval.asIndexSized(s),s<0||s>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.ValueError("Indices for islice() must be None or an integer: 0 <= x <= sys.maxsize.");if(!Sk.builtin.checkNone(o)&&!Sk.misceval.isIndex(o))throw new Sk.builtin.ValueError("Step for islice() must be a positive integer or None");if(o=Sk.builtin.checkNone(o)?1:Sk.misceval.asIndexSized(o),o<=0||o>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.ValueError("Step for islice() must be a positive integer or None.");if(this===e.islice.prototype)return new e.islice(r,s,n,o);{const t=new this.constructor;return e.islice.call(t,r,s,n,o),t}}}}),e.permutations=Sk.abstr.buildIteratorClass("itertools.permutations",{constructor:function permutations(t,e){this.pool=t,this.r=e;const i=t.length;this.indices=new Array(i).fill().map(((t,e)=>e)),this.cycles=new Array(e).fill().map(((t,e)=>i-e)),this.n=i,this.tp$iternext=()=>{if(!(this.r>this.n))return this.tp$iternext=this.constructor.prototype.tp$iternext,new Sk.builtin.tuple(this.pool.slice(0,this.r))}},iternext(t){for(let e=this.r-1;e>=0;e--){if(this.cycles[e]--,0!=this.cycles[e]){const t=this.cycles[e];[this.indices[e],this.indices[this.n-t]]=[this.indices[this.n-t],this.indices[e]];const i=this.indices.map((t=>this.pool[t])).slice(0,this.r);return new Sk.builtin.tuple(i)}this.indices.push(this.indices.splice(e,1)[0]),this.cycles[e]=this.n-e}this.r=0},slots:{tp$doc:"permutations(iterable[, r]) --\\x3e permutations object\\n\\nReturn successive r-length permutations of elements in the iterable.\\n\\npermutations(range(3), 2) --\\x3e (0,1), (0,2), (1,0), (1,2), (2,0), (2,1)",tp$new(t,i){let r,s;[r,s]=Sk.abstr.copyKeywordsToNamedArgs("permutations",["iterable","r"],t,i,[Sk.builtin.none.none$]);const n=Sk.misceval.arrayFromIterable(r);if(s=Sk.builtin.checkNone(s)?n.length:Sk.misceval.asIndexSized(s,Sk.builtin.OverFlowError),s<0)throw new Sk.builtin.ValueError("r must be non-negative");if(this===e.permutations.prototype)return new e.permutations(n,s);{const t=new this.constructor;return e.permutations.call(t,n,s),t}}}}),e.product=Sk.abstr.buildIteratorClass("itertools.product",{constructor:function product(t){this.pools=t,this.n=t.length,this.indices=Array(t.length).fill(0),this.pool_sizes=t.map((t=>t.length)),this.tp$iternext=()=>{this.tp$iternext=this.constructor.prototype.tp$iternext;const t=this.indices.map(((t,e)=>this.pools[e][this.indices[e]]));if(!t.some((t=>void 0===t)))return new Sk.builtin.tuple(t);this.n=0}},iternext(t){let e=this.n-1;for(;e>=0&&e=this.pool_sizes[e]?(this.indices[e]=-1,e--):e++;if(this.n&&!this.indices.every((t=>-1===t))){const t=this.indices.map(((t,e)=>this.pools[e][this.indices[e]]));return new Sk.builtin.tuple(t)}this.n=0},slots:{tp$doc:"product(*iterables, repeat=1) --\\x3e product object\\n\\nCartesian product of input iterables. Equivalent to nested for-loops.\\n\\nFor example, product(A, B) returns the same as: ((x,y) for x in A for y in B).\\nThe leftmost iterators are in the outermost for-loop, so the output tuples\\ncycle in a manner similar to an odometer (with the rightmost element changing\\non every iteration).\\n\\nTo compute the product of an iterable with itself, specify the number\\nof repetitions with the optional repeat keyword argument. For example,\\nproduct(A, repeat=4) means the same as product(A, A, A, A).\\n\\nproduct(\'ab\', range(3)) --\\x3e (\'a\',0) (\'a\',1) (\'a\',2) (\'b\',0) (\'b\',1) (\'b\',2)\\nproduct((0,1), (0,1), (0,1)) --\\x3e (0,0,0) (0,0,1) (0,1,0) (0,1,1) (1,0,0) ...",tp$new(t,i){let[r]=Sk.abstr.copyKeywordsToNamedArgs("product",["repeat"],[],i,[new Sk.builtin.int_(1)]);if(r=Sk.misceval.asIndexSized(r,Sk.builtin.OverFlowError),r<0)throw new Sk.builtin.ValueError("repeat argument cannot be negative");const s=[];for(let e=0;ethis.object)},iternext(t){return this.times-- >0?this.object:void 0},slots:{tp$doc:"repeat(object [,times]) -> create an iterator which returns the object\\nfor the specified number of times. If not specified, returns the object\\nendlessly.",tp$new(t,i){let r,s;if([r,s]=Sk.abstr.copyKeywordsToNamedArgs("repeat",["object","times"],t,i,[null]),s=null!==s?Sk.misceval.asIndexSized(s,Sk.builtin.OverFlowError):void 0,this===e.repeat.prototype)return new e.repeat(r,s);{const t=new this.constructor;return e.repeat.call(t,r,s),t}},$r(){const t=Sk.misceval.objectRepr(this.object),e=void 0===this.times?"":", "+(this.times>=0?this.times:0);return new Sk.builtin.str(Sk.abstr.typeName(this)+"("+t+e+")")}},methods:{__lenght_hint__:{$meth(){if(void 0===this.times)throw new Sk.builtin.TypeError("len() of unsized object");return new Sk.builtin.int_(this.times)},$flags:{NoArgs:!0},$textsig:null}}}),e.starmap=Sk.abstr.buildIteratorClass("itertools.starmap",{constructor:function starmap(t,e){this.func=t,this.iter=e},iternext(t){const e=this.iter.tp$iternext();if(void 0===e)return;const i=Sk.misceval.arrayFromIterable(e);return Sk.misceval.callsimArray(this.func,i)},slots:{tp$new(t,i){let r,s;if([r,s]=Sk.abstr.copyKeywordsToNamedArgs("starmap",["func","iterable"],t,i,[]),s=Sk.abstr.iter(s),r=Sk.builtin.checkNone(r)?Sk.builtin.bool:r,this===e.starmap.prototype)return new e.starmap(r,s);{const t=new this.constructor;return e.starmap.call(t,r,s),t}}}}),e.takewhile=Sk.abstr.buildIteratorClass("itertools.takewhile",{constructor:function takewhile(t,e){this.predicate=t,this.iter=e},iternext(){const t=this.iter.tp$iternext();if(void 0!==t){const e=Sk.misceval.callsimArray(this.predicate,[t]);if(Sk.misceval.isTrue(e))return t;this.tp$iternext=()=>{}}},slots:{tp$doc:"takewhile(predicate, iterable) --\\x3e takewhile object\\n\\nReturn successive entries from an iterable as long as the \\npredicate evaluates to true for each entry.",tp$new(t,i){Sk.abstr.checkNoKwargs("takewhile",i),Sk.abstr.checkArgsLen("takewhile",t,2,2);const r=t[0],s=Sk.abstr.iter(t[1]);if(this===e.takewhile.prototype)return new e.takewhile(r,s);{const t=new this.constructor;return e.takewhile.call(t,r,s),t}}}}),e.tee=new Sk.builtin.func((function(){throw new Sk.builtin.NotImplementedError("tee is not yet implemented in Skulpt")})),e.zip_longest=Sk.abstr.buildIteratorClass("itertools.zip_longest",{constructor:function zip_longest(t,e){this.iters=t,this.fillvalue=e,this.active=this.iters.length},iternext(t){if(!this.active)return;let i;const r=[];for(let s=0;s{throw new a(e+" is not yet implemented in skulpt")}))}const j=E.JSONDecodeError=N("json.JSONDecodeError",{base:l,constructor:function JSONDecodeError(e,t,n){const r=t.slice(0,n),o=r.split("\\n").length,s=n-r.lastIndexOf("\\n"),i=`${e}: line ${o} column ${s} (char ${n})`;l.call(this,i),this.$msg=e,this.$doc=t,this.$pos=n,this.$lineno=o,this.$colno=s},getsets:Object.fromEntries(["msg","doc","pos","lineno","colno"].map((e=>[e,{$get(){return g(this["$"+e])}}])))});class JSONEncoder{constructor(e,t,n,r,o,s,i,l){this.skipkeys=e,this.ensure_ascii=t,this.check_circular=n,this.allow_nan=r,this.indent=o,this.separators=s,this.sort_keys=l,this.item_separator=", ",this.key_separator=": ",null!==this.separators?[this.item_separator,this.key_separator]=this.separators:null!==this.indent&&(this.item_separator=","),null!==i&&(this.default=i),this.encoder=this.make_encoder()}default(e){throw new i(`Object of type ${y(e)} is not JSON serializable`)}encode(t){return new e(this.encoder(t))}make_encoder(){let e,t;e=this.check_circular?new Set:null,t=(this.ensure_ascii,JSON.stringify);return function _make_iterencode(e,t,n,r,s,a,u,h,d){null!==r&&"string"!=typeof r&&(r=" ".repeat(r));let f,p,g,w;null!==e?(f=t=>{if(e.has(t))throw new l("Circular reference detected");e.add(t)},p=t=>e.delete(t)):(f=e=>{},p=e=>{});null!==r?(g=(e,t)=>{t+=1;const n="\\n"+r.repeat(t);return[e+=n,t,u+n]},w=(e,t,n)=>(n-=1,e+="\\n"+r.repeat(n)+t)):(g=(e,t)=>[e,t,u],w=(e,t,n)=>e+t);const _unhandled=(e,n)=>{f(e);const r=_iterencode(t(e),n);return p(e),r},_iterencode_list=(e,t)=>{if(!e.length)return"[]";let n,r;f(e),[n,t,r]=g("[",t);let o=!0;for(let s of e)o?o=!1:n+=r,n+=_iterencode(s,t);return p(e),w(n,"]",t)},_iterencode_dict=(e,t)=>{if(!e.sq$length())return"{}";let r,l;f(e),[r,t,l]=g("{",t);let u=!0;if(h){const t=$(e.tp$getattr(v)),n=c(t);e=$(o,[n])}for(let[o,c]of e.$items()){const e=o.valueOf(),h=typeof e;if("string"===h)o=e;else if("number"===h)o=s(o);else if("boolean"===h||null===e)o=String(e);else{if(!JSBI.__isBigInt(e)){if(d)continue;throw new i("keys must be str, int, float, bool or None, not "+y(o))}o=e.toString()}u?u=!1:r+=l,r+=n(o),r+=a,r+=_iterencode(c,t)}return p(e),w(r,"}",t)},_iterencode=(e,t=0)=>String(m(e,{stringHook:e=>n(e),numberHook:(e,t)=>s(t),bigintHook:e=>e.toString(),dictHook:e=>_iterencode_dict(e,t),arrayHook:e=>_iterencode_list(e,t),setHook:e=>_unhandled(e,t),funcHook:(e,n)=>_unhandled(n,t),objecthook:(e,n)=>_unhandled(n,t),unhandledHook:e=>_unhandled(e,t)}));return _iterencode}(e,this.default,t,this.indent,((e,t=this.allow_nan)=>{const n=e.valueOf();let r;if(Number.isFinite(n))return J(e);if(r=n.toString(),!t)throw new l("Out of range float values are not JSON compliant: "+J(e));return r}),this.key_separator,this.item_separator,this.sort_keys,this.skipkeys)}}const v=new e("items");const x=[!1,!0,!0,!0,null,null,null,!1],D=new JSONEncoder(...x),F=/(-?(?:0|[1-9]\\d*))(\\.\\d+)?([eE][-+]?\\d+)?/;const I=/"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"/m;function scanstring(t,n){const r=t.substring(n-1).match(I);if(null===r)throw new j("Unterminated string starting at",t,n-1);try{return[new e(JSON.parse(r[0])),n+r[0].length-1]}catch(o){let e=o.message.match(/(?:column|position) (\\d+)/);e=e&&Number(e[1]);n=n+(e||0)-(void 0===o.columnNumber?1:2);const r=o.message.replace("JSON.parse: ","").replace(/ at line \\d+ column \\d+ of the JSON data/,"").replace(/ in JSON at position \\d+$/,"");throw new j(r,t,n)}}const A=/[ \\t\\n\\r]*/;function JSONArray(e,t,r){const o=[];let s=e[t];const adjust_white_space=()=>{if(" "===s||"\\t"===s||"\\n"===s||"\\r"===s){const n=e.substring(t).match(A);t+=n[0].length,s=e[t]}};if(adjust_white_space(),"]"===s)return[new n([]),t+1];for(;;){let n;if([n,t]=r(e,t),void 0===n)throw new j("Expecting value",e,t);if(o.push(n),s=e[t],adjust_white_space(),t++,"]"===s)break;if(","!==s)throw new j("Expecting \',\' delimiter",e,t-1);s=e[t],adjust_white_space()}return[new n(o),t]}function JSONObject(e,t,s,i,l){let a=[],c=e[t];const adjust_white_space=()=>{if(" "===c||"\\t"===c||"\\n"===c||"\\r"===c){const n=e.substring(t).match(A);t+=n[0].length,c=e[t]}};if(\'"\'!==c){if(adjust_white_space(),"}"===c){if(null!==l){return[l(new n([])),t+1]}return a=new o([]),null!==i&&(a=i(a)),[a,t+1]}if(\'"\'!==c)throw new j("Expecting property name enclosed in double quotes",e,t)}let u,h;for(t+=1;;){if([u,t]=scanstring(e,t),":"!==(c=e[t])&&(adjust_white_space(),":"!==e[t]))throw new j("Expecting \':\' delimiter",e,t);if(c=e[++t],adjust_white_space(),[h,t]=s(e,t),void 0===h)throw new j("Expecting value",e,t);if(c=e[t],a.push([u,h]),adjust_white_space(),t++,"}"===c)break;if(","!==c)throw new j("Expecting \',\' delimiter",e,t-1);if(c=e[t],adjust_white_space(),t++,\'"\'!==c)throw new j("Expecting property name enclosed in double quotes",e,t-1)}if(null!==l){return[l(new n(a.map((e=>new r(e))))),t]}return a=new o(a.flat()),null!==i&&(a=i(a)),[a,t]}const H={NaN:new t(NaN),Infinity:new t(1/0),"-Infinity":new t(-1/0)};class JSONDecoder{constructor(e,t,n,r,o){this.object_hook=e,this.parse_float=t||w,this.parse_int=n||_,this.parse_constant=r||(e=>H[e]),this.object_pairs_hook=o,this.parse_object=JSONObject,this.parse_array=JSONArray,this.parse_string=scanstring,this.scan_once=function make_scanner(e){const{parse_object:t,parse_array:n,parse_string:r,parse_float:o,parse_int:s,parse_constant:i,object_hook:l,object_pairs_hook:a}=e,scan_once=(e,c)=>{const f=e[c];if(void 0===f)return[f,c];if(\'"\'===f)return r(e,c+1);if("{"===f)return t(e,c+1,scan_once,l,a);if("["===f)return n(e,c+1,scan_once);if("n"===f&&"null"===e.substring(c,c+4))return[u,c+4];if("t"===f&&"true"===e.substring(c,c+4))return[h,c+4];if("f"===f&&"false"===e.substring(c,c+5))return[d,c+5];const p=e.substring(c).match(F);if(null!==p){let e;const[t,n,r,i]=p;return e=r||i?o(n+(r||"")+(i||"")):s(n),[e,c+t.length]}return"N"===f&&"NaN"===e.substring(c,c+3)?[i("NaN"),c+3]:"I"==f&&"Infinity"===e.substring(c,c+8)?[i("Infinity"),c+8]:"-"==f&&"-Infinity"===e.substring(c,c+9)?[i("-Infinity"),c+9]:[void 0,c]};return scan_once}(this)}white(e,t){const n=(0===t?e:e.substring(t)).match(A);return null!==n&&(t+=n[0].length),t}decode(e){e=e.toString();let[t,n]=this.scan_once(e,this.white(e,0));if(void 0===t)throw new j("Expecting value",e,n);if(n=this.white(e,n),n!==e.length)throw new j("Extra data",e,n);return t}}const T=Array(5).fill(null),C=new JSONDecoder(...T);function convertToNullOrFunc(e){return null===e||e===u?null:t=>$(e,[g(t)])}return k("json",E,{loads:{$meth(e,t){O("dumps",e);let n=e[0];if(f(n));else{if(!p(n))throw new i(`the JSON object must be str or bytes, not ${y(n)}`);n=(new TextDecoder).decode(n.valueOf())}const r=S("dumps",["object_hook","parse_float","parse_int","parse_constant","object_pairs_hook"],[],t,T).map(convertToNullOrFunc);return r.every((e=>null===e))?C.decode(n):new JSONDecoder(...r).decode(n)},$doc:"Deserialize ``s`` (a ``str`` or ``bytes`` instance containing a JSON document) to a Python object.",$flags:{FastCall:!0}},dumps:{$meth(e,t){O("dumps",e);const n=e[0];let[r,o,s,l,a,c,u,h]=S("loads",["skipkeys","ensure_ascii","check_circular","allow_nan","indent","separators","default","sort_keys"],[],t,x);if(r=b(r),o=b(o),s=b(s),l=b(l),a=m(a),c=m(c),u=convertToNullOrFunc(u),h=b(h),!r&&o&&s&&l&&null===a&&null===c&&null===u&&!h)return D.encode(n);if(null===c);else if(!Array.isArray(c)||2!==c.length||"string"!=typeof c[0]||"string"!=typeof c[1])throw new i("separators shuld be a list or tuple of strings of length 2");return new JSONEncoder(r,o,s,l,a,c,u,h).encode(n)},$doc:"Serialize ``obj`` to a JSON formatted ``str``",$flags:{FastCall:!0}}}),E}',"src/lib/keyword.js":'function $builtinmodule(){const{ffi:{remapToPy:t},builtin:{frozenset:e,str:s}}=Sk,i=new s("keyword"),n=t(["iskeyword","issoftkeyword","kwlist","softkwlist"]),o=t(["False","None","True","and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"]),a=t(["_","case","match"]);return{__name__:i,__all__:n,kwlist:o,softkwlist:a,iskeyword:new e(o).tp$getattr(s.$contains),issoftkeyword:new e(a).tp$getattr(s.$contains)}}',"src/lib/math.js":'const $builtinmodule=function(e){const{builtin:{str:t,int_:n,float_:i,TypeError:r,pyCheckType:u,checkNumber:l},abstr:{lookupSpecial:o},misceval:{callsimOrSuspendArray:a}}=Sk,s={pi:new Sk.builtin.float_(Math.PI),e:new Sk.builtin.float_(Math.E),tau:new Sk.builtin.float_(2*Math.PI),nan:new Sk.builtin.float_(NaN),inf:new Sk.builtin.float_(1/0)},b=new t("__ceil__");const get_sign=function(e){return e=e?e<0?-1:1:1/e<0?-1:1};const c=18;function factorial(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));let t=Sk.builtin.asnum$(e);if((e=Math.floor(t))!=t)throw new Sk.builtin.ValueError("factorial() only accepts integral values");if(e<0)throw new Sk.builtin.ValueError("factorial() not defined for negative numbers");let n=1;for(let i=2;i<=e&&i<=c;i++)n*=i;if(e<=c)return new Sk.builtin.int_(n);n=JSBI.BigInt(n);for(let i=c+1;i<=e;i++)n=JSBI.multiply(n,JSBI.BigInt(i));return new Sk.builtin.int_(n)}const m=new t("__floor__");function _gcd_internal(e,t){let n;return"number"==typeof e&&"number"==typeof t?(n=function _gcd(e,t){return 0==t?e:_gcd(t,e%t)}(e=Math.abs(e),t=Math.abs(t)),n=n<0?-n:n):(n=function _biggcd(e,t){return JSBI.equal(t,JSBI.__ZERO)?e:_biggcd(t,JSBI.remainder(e,t))}(e=JSBI.BigInt(e),t=JSBI.BigInt(t)),JSBI.lessThan(n,JSBI.__ZERO)&&(n=JSBI.multiply(n,JSBI.BigInt(-1)))),n}return Sk.abstr.setUpModuleMethods("math",s,{acos:{$meth:function acos(e){return Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e)),new Sk.builtin.float_(Math.acos(Sk.builtin.asnum$(e)))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the arc cosine (measured in radians) of x."},acosh:{$meth:function acosh(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=(e=Sk.builtin.asnum$(e))+Math.sqrt(e*e-1);return new Sk.builtin.float_(Math.log(t))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the inverse hyperbolic cosine of x."},asin:{$meth:function asin(e){return Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e)),new Sk.builtin.float_(Math.asin(Sk.builtin.asnum$(e)))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the arc sine (measured in radians) of x."},asinh:{$meth:function asinh(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=(e=Sk.builtin.asnum$(e))+Math.sqrt(e*e+1);return new Sk.builtin.float_(Math.log(t))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the inverse hyperbolic sine of x."},atan:{$meth:function atan(e){return Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e)),new Sk.builtin.float_(Math.atan(Sk.builtin.asnum$(e)))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the arc tangent (measured in radians) of x."},atan2:{$meth:function atan2(e,t){return Sk.builtin.pyCheckType("y","number",Sk.builtin.checkNumber(e)),Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(t)),new Sk.builtin.float_(Math.atan2(Sk.builtin.asnum$(e),Sk.builtin.asnum$(t)))},$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, y, x, /)",$doc:"Return the arc tangent (measured in radians) of y/x.\\n\\nUnlike atan(y/x), the signs of both x and y are considered."},atanh:{$meth:function atanh(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=(1+(e=Sk.builtin.asnum$(e)))/(1-e);return new Sk.builtin.float_(Math.log(t)/2)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the inverse hyperbolic tangent of x."},ceil:{$meth:function ceil(e){let t;if(e.ob$type!==i){const n=o(e,b);if(void 0!==n)return a(n);u("","real number",l(e)),t=Sk.builtin.asnum$(e)}else t=e.v;return new n(Math.ceil(t))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the ceiling of x as an Integral.\\n\\nThis is the smallest integer >= x."},comb:{$meth:function comb(e,t){let n=Sk.misceval.asIndexOrThrow(e),i=Sk.misceval.asIndexOrThrow(t);if(n<0)throw new Sk.builtin.ValueError("n must be an non-negative integer");if(i<0)throw new Sk.builtin.ValueError("k must be a non-negative integer");if(i>e)return new Sk.builtin.int_(0);e=new Sk.builtin.int_(n),t=new Sk.builtin.int_(i);let r=Sk.ffi.remapToJs(e.nb$subtract(t));if(rNumber.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError("min(n - k, k) must not exceed "+Number.MAX_SAFE_INTEGER);const u=new Sk.builtin.int_(1);let l=e;for(let o=1;o n.\\n\\nIf k is not specified or is None, then k defaults to n\\nand the function returns n!.\\n\\nRaises TypeError if either of the arguments are not integers.\\nRaises ValueError if either of the arguments are negative."},copysign:{$meth:function copysign(e,t){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),Sk.builtin.pyCheckType("y","number",Sk.builtin.checkNumber(t));const n=Sk.builtin.asnum$(t),i=Sk.builtin.asnum$(e),r=get_sign(i)*get_sign(n);return new Sk.builtin.float_(i*r)},$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, x, y, /)",$doc:"Return a float with the magnitude (absolute value) of x but the sign of y.\\n\\nOn platforms that support signed zeros, copysign(1.0, -0.0)\\nreturns -1.0.\\n"},cos:{$meth:function cos(e){return Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e)),new Sk.builtin.float_(Math.cos(Sk.builtin.asnum$(e)))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the cosine of x (measured in radians)."},cosh:{$meth:function cosh(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),e=Sk.builtin.asnum$(e);const t=Math.E,n=Math.pow(t,e),i=(n+1/n)/2;return new Sk.builtin.float_(i)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the hyperbolic cosine of x."},degrees:{$meth:function degrees(e){Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e));const t=180/Math.PI*Sk.builtin.asnum$(e);return new Sk.builtin.float_(t)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Convert angle x from radians to degrees."},erf:{$meth:function erf(e){throw new Sk.builtin.NotImplementedError("math.erf() is not yet implemented in Skulpt")},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Error function at x."},erfc:{$meth:function erfc(e){throw new Sk.builtin.NotImplementedError("math.erfc() is not yet implemented in Skulpt")},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Complementary error function at x."},exp:{$meth:function exp(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));let t=e.v;if("number"!=typeof t&&(t=e.nb$float().v),t==1/0||t==-1/0||isNaN(t))return new Sk.builtin.float_(Math.exp(t));const n=Math.exp(t);if(!isFinite(n))throw new Sk.builtin.OverflowError("math range error");return new Sk.builtin.float_(n)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return e raised to the power of x."},expm1:{$meth:function expm1(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=Sk.builtin.asnum$(e);if(Math.abs(t)<.7){const e=Math.exp(t);if(1==e)return new Sk.builtin.float_(t);{const n=(e-1)*t/Math.log(e);return new Sk.builtin.float_(n)}}{const e=Math.exp(t)-1;return new Sk.builtin.float_(e)}},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return exp(x)-1.\\n\\nThis function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x."},fabs:{$meth:function fabs(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));let t=e.v;return JSBI.__isBigInt(t)&&(t=e.nb$float().v),t=Math.abs(t),new Sk.builtin.float_(t)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the absolute value of the float x."},factorial:{$meth:factorial,$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Find x!.\\n\\nRaise a ValueError if x is negative or non-integral."},floor:{$meth:function floor(e){let t;if(e.ob$type===i)t=e.v;else{const n=o(e,m);if(void 0!==n)return a(n);u("x","number",l(e)),t=Sk.builtin.asnum$(e)}return new n(Math.floor(t))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the floor of x as an Integral.\\n\\nThis is the largest integer <= x."},fmod:{$meth:function fmod(e,t){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),Sk.builtin.pyCheckType("y","number",Sk.builtin.checkNumber(t));let n=e.v,i=t.v;if("number"!=typeof n&&(n=e.nb$float().v),"number"!=typeof i&&(i=t.nb$float().v),(i==1/0||i==-1/0)&&isFinite(n))return new Sk.builtin.float_(n);const r=n%i;if(isNaN(r)&&!isNaN(n)&&!isNaN(i))throw new Sk.builtin.ValueError("math domain error");return new Sk.builtin.float_(r)},$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, x, y, /)",$doc:"Return fmod(x, y), according to platform C.\\n\\nx % y may differ."},frexp:{$meth:function frexp(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=Sk.builtin.asnum$(e),n=[t,0];if(0!==t&&Number.isFinite(t)){const e=Math.abs(t);let i=Math.max(-1023,Math.floor(Math.log2(e))+1),r=e*Math.pow(2,-i);for(;r<.5;)r*=2,i--;for(;r>=1;)r*=.5,i++;t<0&&(r=-r),n[0]=r,n[1]=i}return n[0]=new Sk.builtin.float_(n[0]),n[1]=new Sk.builtin.int_(n[1]),new Sk.builtin.tuple(n)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the mantissa and exponent of x, as pair (m, e).\\n\\nm is a float and e is an int, such that x = m * 2.**e.\\nIf x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0."},fsum:{$meth:function fsum(e){if(!Sk.builtin.checkIterable(e))throw new Sk.builtin.TypeError("\'"+Sk.abstr.typeName(e)+"\' object is not iterable");let t,n,i,r=[];for(let l=(e=Sk.abstr.iter(e)).tp$iternext();void 0!==l;l=e.tp$iternext()){Sk.builtin.pyCheckType("","real number",Sk.builtin.checkNumber(l)),t=0;let e=l.v;"number"!=typeof e&&(e=l.nb$float().v),l=e;for(let u=0,o=r.length;u0;){n--;let t=a;a=JSBI.signedRightShift(u,JSBI.BigInt(n));const r=JSBI.subtract(JSBI.subtract(a,t),i),s=JSBI.leftShift(o,r),b=JSBI.add(JSBI.subtract(JSBI.subtract(l,t),a),i),c=JSBI.signedRightShift(e,b);o=JSBI.add(s,JSBI.divide(c,o))}let s=o;return JSBI.greaterThan(JSBI.multiply(s,s),e)&&(s=JSBI.subtract(s,i)),JSBI.lessThanOrEqual(s,JSBI.BigInt(Number.MAX_SAFE_INTEGER))&&(s=Number(s)),new Sk.builtin.int_(s)}(t)},$flags:{OneArg:!0},$textsig:"($module, n, /)",$doc:"Return the integer part of the square root of the input."},lcm:{$meth:function lcm(...e){function abs(e){return"number"==typeof e?new Sk.builtin.int_(Math.abs(e)):JSBI.lessThan(e,JSBI.__ZERO)?new Sk.builtin.int_(JSBI.unaryMinus(e)):new Sk.builtin.int_(e)}const t=e.length;if(0===t)return new Sk.builtin.int_(1);let n;for(n=0;nNumber.MAX_SAFE_INTEGER?JSBI.BigInt(r):e}else r=JSBI.BigInt(r);"number"!=typeof r&&(i=JSBI.BigInt(i),r=JSBI.multiply(JSBI.divide(r,_gcd_internal(r,i)),i))}return abs(r)},$flags:{MinArgs:0},$textsig:"($module, *integers, /)",$doc:"Return the least common multiple of the specified integer arguments. If all arguments are nonzero, then the returned value is the smallest positive integer that is a multiple of all arguments. If any of the arguments is zero, then the returned value is 0. lcm() without arguments returns 1."},ldexp:{$meth:function ldexp(e,t){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),Sk.builtin.pyCheckType("i","integer",Sk.builtin.checkInt(t));let n=e.v;"number"!=typeof n&&(n=e.nb$float().v);const i=Sk.builtin.asnum$(t);if(n==1/0||n==-1/0||0==n||isNaN(n))return new Sk.builtin.float_(n);const r=n*Math.pow(2,i);if(!isFinite(r))throw new Sk.builtin.OverflowError("math range error");return new Sk.builtin.float_(r)},$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, x, i, /)",$doc:"Return x * (2**i).\\n\\nThis is essentially the inverse of frexp()."},lgamma:{$meth:function lgamma(e){throw new Sk.builtin.NotImplementedError("math.lgamma() is not yet implemented in Skulpt")},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Natural logarithm of absolute value of Gamma function at x."},log:{$meth:function log(e,t){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));let n,i,r=Sk.builtin.asnum$(e);if(r<=0)throw new Sk.builtin.ValueError("math domain error");if(void 0===t?n=Math.E:(Sk.builtin.pyCheckType("base","number",Sk.builtin.checkNumber(t)),n=Sk.builtin.asnum$(t)),n<=0)throw new Sk.builtin.ValueError("math domain error");if(Sk.builtin.checkFloat(e)||re)return new Sk.builtin.int_(0);if(0===t)return new Sk.builtin.int_(1);if(t>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError("k must not exceed "+Number.MAX_SAFE_INTEGER);const n=new Sk.builtin.int_(1);let i=e=new Sk.builtin.int_(e);for(let r=1;r n.\\n\\nIf k is not specified or is None, then k defaults to n\\nand the function returns n!.\\n\\nRaises TypeError if either of the arguments are not integers.\\nRaises ValueError if either of the arguments are negative.\'"},prod:{$meth:function prod(e,t){Sk.abstr.checkArgsLen("prod",e,1,1),e=Sk.abstr.copyKeywordsToNamedArgs("prod",[null,"start"],e,t,[new Sk.builtin.int_(1)]);const n=Sk.abstr.iter(e[0]);let i,r=e[1];return i=r.constructor===Sk.builtin.int_?function fastProdInt(){return Sk.misceval.iterFor(n,(e=>{if(e.constructor!==Sk.builtin.int_)return e.constructor===Sk.builtin.float_?(r=r.nb$float().nb$multiply(e),new Sk.misceval.Break("float")):(r=Sk.abstr.numberBinOp(r,e,"Mult"),new Sk.misceval.Break("slow"));r=r.nb$multiply(e)}))}():r.constructor===Sk.builtin.float_?"float":"slow",Sk.misceval.chain(i,(e=>"float"===e?function fastProdFloat(){return Sk.misceval.iterFor(n,(e=>{if(e.constructor!==Sk.builtin.float_&&e.constructor!==Sk.builtin.int_)return r=Sk.abstr.numberBinOp(r,e,"Mult"),new Sk.misceval.Break("slow");r=r.nb$multiply(e)}))}():e),(e=>{if("slow"===e)return function slowProd(){return Sk.misceval.iterFor(n,(e=>{r=Sk.abstr.numberBinOp(r,e,"Mult")}))}()}),(()=>r))},$flags:{FastCall:!0},$textsig:"($module, iterable, /, *, start=1)",$doc:"Calculate the product of all the elements in the input iterable. The default start value for the product is 1.\\n\\nWhen the iterable is empty, return the start value. This function is intended specifically for use with numeric values and may reject non-numeric types."},pow:{$meth:function pow(e,t){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),Sk.builtin.pyCheckType("y","number",Sk.builtin.checkNumber(t));let n=e.v,i=t.v;if("number"!=typeof n&&(n=e.nb$float().v),"number"!=typeof i&&(i=t.nb$float().v),0==n&&i<0)throw new Sk.builtin.ValueError("math domain error");if(1==n)return new Sk.builtin.float_(1);if(Number.isFinite(n)&&Number.isFinite(i)&&n<0&&!Number.isInteger(i))throw new Sk.builtin.ValueError("math domain error");if(-1==n&&(i==-1/0||i==1/0))return new Sk.builtin.float_(1);const r=Math.pow(n,i);if(!Number.isFinite(n)||!Number.isFinite(i))return new Sk.builtin.float_(r);if(r==1/0||r==-1/0)throw new Sk.builtin.OverflowError("math range error");return new Sk.builtin.float_(r)},$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, x, y, /)",$doc:"Return x**y (x to the power of y)."},radians:{$meth:function radians(e){Sk.builtin.pyCheckType("deg","number",Sk.builtin.checkNumber(e));const t=Math.PI/180*Sk.builtin.asnum$(e);return new Sk.builtin.float_(t)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Convert angle x from degrees to radians."},remainder:{$meth:function remainder(e,t){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),Sk.builtin.pyCheckType("y","number",Sk.builtin.checkNumber(t));let n=e.v,i=t.v;if("number"!=typeof n&&(n=e.nb$float().v),"number"!=typeof i&&(i=t.nb$float().v),isFinite(n)&&isFinite(i)){let e,t,r,u,l;if(0==i)throw new Sk.builtin.ValueError("math domain error");if(e=Math.abs(n),t=Math.abs(i),u=e%t,r=t-u,ur)l=-r;else{if(u!=r)throw new Sk.builtin.AssertionError;l=u-.5*(e-u)%t*2}return new Sk.builtin.float_(get_sign(n)*l)}if(isNaN(n))return e;if(isNaN(i))return t;if(n==1/0||n==-1/0)throw new Sk.builtin.ValueError("math domain error");if(i!=1/0&&i!=-1/0)throw new Sk.builtin.AssertionError;return new Sk.builtin.float_(n)},$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, x, y, /)",$doc:"Difference between x and the closest integer multiple of y.\\n\\nReturn x - n*y where n*y is the closest integer multiple of y.\\nIn the case where x is exactly halfway between two multiples of\\ny, the nearest even value of n is used. The result is always exact."},sin:{$meth:function sin(e){return Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e)),new Sk.builtin.float_(Math.sin(Sk.builtin.asnum$(e)))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the sine of x (measured in radians)."},sinh:{$meth:function sinh(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e)),e=Sk.builtin.asnum$(e);const t=Math.E,n=Math.pow(t,e),i=(n-1/n)/2;return new Sk.builtin.float_(i)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the hyperbolic sine of x."},sqrt:{$meth:function sqrt(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=Sk.builtin.asnum$(e);if(t<0)throw new Sk.builtin.ValueError("math domain error");return new Sk.builtin.float_(Math.sqrt(t))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the square root of x."},tan:{$meth:function tan(e){return Sk.builtin.pyCheckType("rad","number",Sk.builtin.checkNumber(e)),new Sk.builtin.float_(Math.tan(Sk.builtin.asnum$(e)))},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the tangent of x (measured in radians)."},tanh:{$meth:function tanh(e){Sk.builtin.pyCheckType("x","number",Sk.builtin.checkNumber(e));const t=Sk.builtin.asnum$(e);if(0===t)return new Sk.builtin.float_(t);const n=Math.E,i=Math.pow(n,t),r=1/i,u=(i-r)/2/((i+r)/2);return new Sk.builtin.float_(u)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the hyperbolic tangent of x."},trunc:{$meth:function trunc(e){if(e.ob$type===i)return e.nb$int();const n=o(e,t.$trunc);if(void 0===n)throw new r(`type ${e.tp$name} doesn\'t define __trunc__ method`);return a(n)},$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Truncates the Real x to the nearest Integral toward 0.\\n\\nUses the __trunc__ magic method."}}),s};',"src/lib/mixiot/__init__.js":'var $builtinmodule=function(i){var n={__name__:new Sk.builtin.str("mixiot")};n.MixIO=Sk.misceval.buildClass(n,(function(i,n){n.__init__=new Sk.builtin.func((function(i,n,e,o,t,c,f){n=Sk.ffi.remapToJs(n),e=Sk.ffi.remapToJs(e),o=Sk.ffi.remapToJs(o),t=Sk.ffi.remapToJs(t),c=Sk.ffi.remapToJs(c),f=Sk.ffi.remapToJs(f),mixio_client=new MixIO(n,e,o,t,c,f)})),n.publish=new Sk.builtin.func((function(i,n,e){var o=Sk.ffi.remapToJs(n),t=Sk.ffi.remapToJs(e);mixio_client.publish(o,t)})),n.subscribe=new Sk.builtin.func((function(i,n,e){var o=Sk.ffi.remapToJs(n);if(!(e instanceof Sk.builtin.func))throw new Sk.builtin.TypeError("Callback given is not a function");var t=function pythonToJavascriptFunction(i,n){return function(){var e=Array.prototype.slice.call(arguments).map((function(i){return Sk.ffi.remapToPy(i)}));return"undefined"!=typeof n&&e.unshift(n),Sk.misceval.applyAsync(void 0,i,void 0,void 0,void 0,e).catch(Sk.uncaughtException)}}(e);mixio_client.subscribeAndSetCallback(o,t)})),n.unsubscribe=new Sk.builtin.func((function(i,n){var e=Sk.ffi.remapToJs(n);mixio_client.unsubscribe(e)})),n.disconnect=new Sk.builtin.func((function(i){mixio_client.disconnect()}))}),"MixIO",[]);n.MixIO_init_by_mixly_key=Sk.misceval.buildClass(n,(function(i,n){n.__init__=new Sk.builtin.func((function(i,n,e,o,t){n=Sk.ffi.remapToJs(n),e=Sk.ffi.remapToJs(e),mixiomixlyKey=Sk.ffi.remapToJs(o),t=Sk.ffi.remapToJs(t),mixio_client=MixIO.fromMixlyKey(n,e,o,t)})),n.publish=new Sk.builtin.func((function(i,n,e){var o=Sk.ffi.remapToJs(n),t=Sk.ffi.remapToJs(e);mixio_client.publish(o,t)})),n.subscribe=new Sk.builtin.func((function(i,n,e){var o=Sk.ffi.remapToJs(n);if(!(e instanceof Sk.builtin.func))throw new Sk.builtin.TypeError("Callback given is not a function");var t=function pythonToJavascriptFunction(i,n){return function(){var e=Array.prototype.slice.call(arguments).map((function(i){return Sk.ffi.remapToPy(i)}));return"undefined"!=typeof n&&e.unshift(n),Sk.misceval.applyAsync(void 0,i,void 0,void 0,void 0,e).catch(Sk.uncaughtException)}}(e);mixio_client.subscribeAndSetCallback(o,t)})),n.unsubscribe=new Sk.builtin.func((function(i,n){var e=Sk.ffi.remapToJs(n);mixio_client.unsubscribe(e)})),n.disconnect=new Sk.builtin.func((function(i){mixio_client.disconnect()}))}),"MixIO_init_by_mixly_key",[]);return n.MixIO_init_by_share_key=Sk.misceval.buildClass(n,(function(i,n){n.__init__=new Sk.builtin.func((function(i,n,e,o,t){n=Sk.ffi.remapToJs(n),e=Sk.ffi.remapToJs(e),mixiomixlyKey=Sk.ffi.remapToJs(o),t=Sk.ffi.remapToJs(t),mixio_client=MixIO.fromShareKey(n,e,o,t).then((i=>{console.log(i),mixio_client_sharekey=i})).catch((i=>{console.error("Failed to create MixIO from share key: ",i),sleep(1)}))})),n.publish=new Sk.builtin.func((function(i,n,e){var o=Sk.ffi.remapToJs(n),t=Sk.ffi.remapToJs(e);mixio_client_sharekey.publish(o,t)})),n.subscribe=new Sk.builtin.func((function(i,n,e){var o=Sk.ffi.remapToJs(n);if(!(e instanceof Sk.builtin.func))throw new Sk.builtin.TypeError("Callback given is not a function");var t=function pythonToJavascriptFunction(i,n){return function(){var e=Array.prototype.slice.call(arguments).map((function(i){return Sk.ffi.remapToPy(i)}));return"undefined"!=typeof n&&e.unshift(n),Sk.misceval.applyAsync(void 0,i,void 0,void 0,void 0,e).catch(Sk.uncaughtException)}}(e);mixio_client_sharekey.subscribeAndSetCallback(o,t)})),n.unsubscribe=new Sk.builtin.func((function(i,n){var e=Sk.ffi.remapToJs(n);mixio_client_sharekey.unsubscribe(e)})),n.disconnect=new Sk.builtin.func((function(i){mixio_client_sharekey.disconnect()}))}),"MixIO_init_by_share_key",[]),n};',"src/lib/operator.js":'function $builtinmodule(e){const{builtin:{str:t,tuple:a,list:r,int_:o,bool:n,TypeError:s,ValueError:i,none:{none$:m},NotImplemented:{NotImplemented$:d},abs:l,len:h,checkString:u,checkInt:c},abstr:{buildNativeClass:M,checkNoKwargs:b,checkArgsLen:g,checkOneArg:f,numberUnaryOp:p,numberBinOp:A,numberInplaceBinOp:k,objectGetItem:$,objectDelItem:_,objectSetItem:w,sequenceConcat:v,sequenceContains:x,sequenceGetCountOf:j,sequenceGetIndexOf:O,sequenceInPlaceConcat:I,typeName:S,lookupSpecial:y,gattr:q,setUpModuleMethods:R},misceval:{richCompareBool:B,asIndexOrThrow:N,chain:E,callsimArray:T,callsimOrSuspendArray:C,objectRepr:D},generic:{getAttr:G}}=Sk,L=["abs","add","and_","concat","contains","delitem","eq","floordiv","ge","getitem","gt","iadd","iand","iconcat","ifloordiv","ilshift","imatmul","imod","imul","index","inv","invert","ior","ipow","irshift","isub","itruediv","ixor","le","lshift","lt","matmul","mod","mul","ne","neg","not_","or_","pos","pow","rshift","setitem","sub","truediv","xor"],F=["attrgetter","countOf","indexOf","is_","is_not","itemgetter","length_hint","methodcaller","truth",...L].sort(),P={__name__:new t("operator"),__doc__:new t("Operator interface.\\n\\nThis module exports a set of functions implemented in javascript corresponding\\nto the intrinsic operators of Python. For example, operator.add(x, y)\\nis equivalent to the expression x+y. The function names are those\\nused for special methods; variants without leading and trailing\\n\'__\' are also provided for convenience."),__all__:new r(F.map((e=>new t(e))))};P.itemgetter=M("operator.itemgetter",{constructor:function itemgetter(e){this.items=e,this.oneitem=1===e.length,this.item=e[0],this.in$repr=!1},slots:{tp$getattr:G,tp$new:(e,t)=>(b("itemgetter",t),g("itemgetter",e,1),new P.itemgetter(e)),tp$call(e,t){f("itemgetter",e,t);const r=e[0];return this.oneitem?$(r,this.item,!0):new a(this.items.map((e=>$(r,e))))},tp$doc:"Return a callable object that fetches the given item(s) from its operand.\\n After f = itemgetter(2), the call f(r) returns r[2].\\n After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3])",$r(){if(this.in$repr)return new t(this.tp$name+"(...)");this.in$repr=!0;const e=this.tp$name+"("+this.items.map((e=>D(e))).join(", ")+")";return this.in$repr=!1,e}}}),P.attrgetter=M("operator.attrgetter",{constructor:function attrgetter(e){this.attrs=e,this.oneattr=1===e.length,this.attr=e[0],this.in$repr=!1},slots:{tp$getattr:G,tp$new(e,a){b("attrgetter",a),g("attrgetter",e,1);const r=[];for(let o=0;onew t(e)))):r.push([a])}return new P.attrgetter(r)},tp$call(e,t){f("attrgetter",e,t);const r=e[0];if(this.oneattr)return this.attr.reduce(((e,t)=>q(e,t)),r);const o=this.attrs.map((e=>e.reduce(((e,t)=>q(e,t)),r)));return new a(o)},tp$doc:"attrgetter(attr, ...) --\\x3e attrgetter object\\n\\nReturn a callable object that fetches the given attribute(s) from its operand.\\nAfter f = attrgetter(\'name\'), the call f(r) returns r.name.\\nAfter g = attrgetter(\'name\', \'date\'), the call g(r) returns (r.name, r.date).\\nAfter h = attrgetter(\'name.first\', \'name.last\'), the call h(r) returns\\n(r.name.first, r.name.last).",$r(){if(this.in$repr)return new t(this.tp$name+"(...)");this.in$repr=!0;const e=this.tp$name+"("+this.items.map((e=>D(e))).join(", ")+")";return this.in$repr=!1,e}}}),P.methodcaller=M("operator.methodcaller",{constructor:function methodcaller(e,t,a){this.$name=e,this.args=t,this.kwargs=a||[],this.in$repr=!1},slots:{tp$getattr:G,tp$new(e,t){g("methodcaller",e,1);const a=e[0];if(!u(a))throw new s("method name must be a string");return new P.methodcaller(a,e.slice(1),t)},tp$call(e,t){f("methodcaller",e,t);const a=e[0];return E(q(a,this.$name,!0),(e=>C(e,this.args,this.kwargs)))},tp$doc:"methodcaller(name, ...) --\\x3e methodcaller object\\n\\nReturn a callable object that calls the given method on its operand.\\nAfter f = methodcaller(\'name\'), the call f(r) returns r.name().\\nAfter g = methodcaller(\'name\', \'date\', foo=1), the call g(r) returns\\nr.name(\'date\', foo=1).",$r(){if(this.in$repr)return new t(this.tp$name+"(...)");this.in$repr=!0;let e=[D(this.$name)];e.push(...this.args.map((e=>D(e))));for(let t=0;tn(B(e,t,"Lt"))),sameAs("a < b")),le:makeModuleMethod(((e,t)=>n(B(e,t,"LtE"))),sameAs("a <= b")),eq:makeModuleMethod(((e,t)=>n(B(e,t,"Eq"))),sameAs("a == b")),ne:makeModuleMethod(((e,t)=>n(B(e,t,"NotEq"))),sameAs("a != b")),ge:makeModuleMethod(((e,t)=>n(B(e,t,"GtE"))),sameAs("a >= b")),gt:makeModuleMethod(((e,t)=>n(B(e,t,"Gt"))),sameAs("a > b")),not_:makeModuleMethod((e=>p(e,"Not")),sameAs("not a")),truth:makeModuleMethod((e=>n(e)),"Return True if a is true, False otherwise."),is_:makeModuleMethod(((e,t)=>n(B(e,t,"Is"))),sameAs("a is b")),is_not:makeModuleMethod(((e,t)=>n(B(e,t,"IsNot"))),sameAs("a is not b")),abs:makeModuleMethod((e=>l(e)),sameAs("abs(a)")),add:makeModuleMethod(((e,t)=>A(e,t,"Add")),sameAs("a + b")),and_:makeModuleMethod(((e,t)=>A(e,t,"BitAnd")),sameAs("a & b")),floordiv:makeModuleMethod(((e,t)=>A(e,t,"FloorDiv")),sameAs("a // b")),index:makeModuleMethod((e=>new o(N(e))),sameAs("a.__index__()")),inv:makeModuleMethod((e=>p(e,"Invert")),sameAs("~a")),invert:makeModuleMethod((e=>p(e,"Invert")),sameAs("~a")),lshift:makeModuleMethod(((e,t)=>A(e,t,"LShift")),sameAs("a << b")),mod:makeModuleMethod(((e,t)=>A(e,t,"Mod")),sameAs("a % b")),mul:makeModuleMethod(((e,t)=>A(e,t,"Mult")),sameAs("a * b")),matmul:makeModuleMethod(((e,t)=>A(e,t,"MatMult")),sameAs("a @ b")),neg:makeModuleMethod((e=>p(e,"USub")),sameAs("-a")),or_:makeModuleMethod(((e,t)=>A(e,t,"BitOr")),sameAs("a | b")),pos:makeModuleMethod((e=>p(e,"UAdd")),sameAs("+a")),pow:makeModuleMethod(((e,t)=>A(e,t,"Pow")),sameAs("a ** b")),rshift:makeModuleMethod(((e,t)=>A(e,t,"RShift")),sameAs("a >> b")),sub:makeModuleMethod(((e,t)=>A(e,t,"Sub")),sameAs("a - b")),truediv:makeModuleMethod(((e,t)=>A(e,t,"Div")),sameAs("a / b")),xor:makeModuleMethod(((e,t)=>A(e,t,"BitXor")),sameAs("a ^ b")),concat:makeModuleMethod(((e,t)=>v(e,t)),sameAs("a + b, for a and b sequences")),contains:makeModuleMethod(((e,t)=>E(x(e,t),n)),sameAs("b in a (note reversed operands)")),countOf:makeModuleMethod(((e,t)=>j(e,t)),"Return thenumber of times b occurs in a."),delitem:makeModuleMethod(((e,t)=>E(_(e,t,!0),(()=>m))),sameAs("del a[b]")),getitem:makeModuleMethod(((e,t)=>$(e,t,!0)),sameAs("a[b]")),indexOf:makeModuleMethod(((e,t)=>O(e,t)),"Return the first index of b in a"),setitem:makeModuleMethod(((e,t,a)=>E(w(e,t,a,!0),(()=>m))),sameAs("a[b] = c")),length_hint:{$meth:function length_hint(e,a){if(void 0===a)a=new o(0);else if(!c(a))throw new s("\'"+S(a)+"\' object cannot be interpreted as an integer");try{return h(e)}catch(m){if(!(m instanceof s))throw m}const r=y(e,t.$length_hint);if(void 0===r)return a;let n;try{n=T(r,[])}catch(m){if(!(m instanceof s))throw m;return a}if(n===d)return a;if(!c(n))throw new s("__length_hint__ must be an integer, not "+S(n));if(n.nb$isnegative())throw new i("__length_hint__() should return >= 0");return n},$flags:{MinArgs:1,MaxArgs:2},$textsig:"($module, obj, default=0, /)",$doc:"Return an estimate of the number of items in obj.\\n\\nThis is useful for presizing containers when building from an iterable.\\n\\nIf the object supports len(), the result will be exact.\\nOtherwise, it may over- or under-estimate by an arbitrary amount.\\nThe result will be an integer >= 0."},iadd:makeModuleMethod(((e,t)=>k(e,t,"Add")),sameAs("a += b")),iand:makeModuleMethod(((e,t)=>k(e,t,"BitAnd")),sameAs("a &= b")),iconcat:makeModuleMethod(((e,t)=>I(e,t)),sameAs("a += b, for a and b sequences")),ifloordiv:makeModuleMethod(((e,t)=>k(e,t,"FloorDiv")),sameAs("a //= b")),ilshift:makeModuleMethod(((e,t)=>k(e,t,"LShift")),sameAs("a <<= b")),imod:makeModuleMethod(((e,t)=>k(e,t,"Mod")),sameAs("a %= b")),imul:makeModuleMethod(((e,t)=>k(e,t,"Mult")),sameAs("a *= b")),imatmul:makeModuleMethod(((e,t)=>k(e,t,"MatMult")),sameAs("a @= b")),ior:makeModuleMethod(((e,t)=>k(e,t,"BitOr")),sameAs("a |= b")),ipow:makeModuleMethod(((e,t)=>k(e,t,"Pow")),sameAs("a **= b")),irshift:makeModuleMethod(((e,t)=>k(e,t,"RShift")),sameAs("a >>= b")),isub:makeModuleMethod(((e,t)=>k(e,t,"Sub")),sameAs("a -= b")),itruediv:makeModuleMethod(((e,t)=>k(e,t,"Div")),sameAs("a /= b")),ixor:makeModuleMethod(((e,t)=>k(e,t,"BitXor")),sameAs("a ^= b"))}),L.forEach((e=>{P[`__${e.replace("_","")}__`]=P[e]})),P.div=P.truediv,P.__div__=P.div,P}',"src/lib/platform.js":'var $builtinmodule=function(n){var e={},i="undefined"!=typeof window&&"undefined"!=typeof window.navigator;return e.python_implementation=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("python_implementation",arguments.length,0,0),new Sk.builtin.str("Skulpt")})),e.node=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("node",arguments.length,0,0),new Sk.builtin.str("")})),e.version=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("version",arguments.length,0,0),new Sk.builtin.str("")})),e.python_version=new Sk.builtin.func((function(){var n;return Sk.builtin.pyCheckArgsLen("python_version",arguments.length,0,0),n=Sk.__future__.python_version?"3.2.0":"2.7.0",new Sk.builtin.str(n)})),e.system=new Sk.builtin.func((function(){var n;return Sk.builtin.pyCheckArgsLen("system",arguments.length,0,0),n=i?window.navigator.appCodeName:"",new Sk.builtin.str(n)})),e.machine=new Sk.builtin.func((function(){var n;return Sk.builtin.pyCheckArgsLen("machine",arguments.length,0,0),n=i?window.navigator.platform:"",new Sk.builtin.str(n)})),e.release=new Sk.builtin.func((function(){var n;return Sk.builtin.pyCheckArgsLen("release",arguments.length,0,0),n=i?window.navigator.appVersion:"",new Sk.builtin.str(n)})),e.architecture=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("architecture",arguments.length,0,0),new Sk.builtin.tuple([new Sk.builtin.str("64bit"),new Sk.builtin.str("")])})),e.processor=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("processor",arguments.length,0,0),new Sk.builtin.str("")})),e};',"src/lib/processing.js":'var $builtinmodule=function(n){var i,e,t,u,o,s,l,c={__name__:new Sk.builtin.str("processing")},r=[],v=!0,f=null;c.processing=null,c.p=null,c.X=new Sk.builtin.int_(0),c.Y=new Sk.builtin.int_(1),c.Z=new Sk.builtin.int_(2),c.R=new Sk.builtin.int_(3),c.G=new Sk.builtin.int_(4),c.B=new Sk.builtin.int_(5),c.A=new Sk.builtin.int_(6),c.U=new Sk.builtin.int_(7),c.V=new Sk.builtin.int_(8),c.NX=new Sk.builtin.int_(9),c.NY=new Sk.builtin.int_(10),c.NZ=new Sk.builtin.int_(11),c.EDGE=new Sk.builtin.int_(12),c.SR=new Sk.builtin.int_(13),c.SG=new Sk.builtin.int_(14),c.SB=new Sk.builtin.int_(15),c.SA=new Sk.builtin.int_(16),c.SW=new Sk.builtin.int_(17),c.TX=new Sk.builtin.int_(18),c.TY=new Sk.builtin.int_(19),c.TZ=new Sk.builtin.int_(20),c.VX=new Sk.builtin.int_(21),c.VY=new Sk.builtin.int_(22),c.VZ=new Sk.builtin.int_(23),c.VW=new Sk.builtin.int_(24),c.AR=new Sk.builtin.int_(25),c.AG=new Sk.builtin.int_(26),c.AB=new Sk.builtin.int_(27),c.DR=new Sk.builtin.int_(3),c.DG=new Sk.builtin.int_(4),c.DB=new Sk.builtin.int_(5),c.DA=new Sk.builtin.int_(6),c.SPR=new Sk.builtin.int_(28),c.SPG=new Sk.builtin.int_(29),c.SPB=new Sk.builtin.int_(30),c.SHINE=new Sk.builtin.int_(31),c.ER=new Sk.builtin.int_(32),c.EG=new Sk.builtin.int_(33),c.EB=new Sk.builtin.int_(34),c.BEEN_LIT=new Sk.builtin.int_(35),c.VERTEX_FIELD_COUNT=new Sk.builtin.int_(36),c.CENTER=new Sk.builtin.int_(3),c.RADIUS=new Sk.builtin.int_(2),c.CORNERS=new Sk.builtin.int_(1),c.CORNER=new Sk.builtin.int_(0),c.DIAMETER=new Sk.builtin.int_(3),c.BASELINE=new Sk.builtin.int_(0),c.TOP=new Sk.builtin.int_(101),c.BOTTOM=new Sk.builtin.int_(102),c.NORMAL=new Sk.builtin.int_(1),c.NORMALIZED=new Sk.builtin.int_(1),c.IMAGE=new Sk.builtin.int_(2),c.MODEL=new Sk.builtin.int_(4),c.SHAPE=new Sk.builtin.int_(5),c.AMBIENT=new Sk.builtin.int_(0),c.DIRECTIONAL=new Sk.builtin.int_(1),c.SPOT=new Sk.builtin.int_(3),c.RGB=new Sk.builtin.int_(1),c.ARGB=new Sk.builtin.int_(2),c.HSB=new Sk.builtin.int_(3),c.ALPHA=new Sk.builtin.int_(4),c.CMYK=new Sk.builtin.int_(5),c.TIFF=new Sk.builtin.int_(0),c.TARGA=new Sk.builtin.int_(1),c.JPEG=new Sk.builtin.int_(2),c.GIF=new Sk.builtin.int_(3),c.MITER=new Sk.builtin.str("miter"),c.BEVEL=new Sk.builtin.str("bevel"),c.ROUND=new Sk.builtin.str("round"),c.SQUARE=new Sk.builtin.str("butt"),c.PROJECT=new Sk.builtin.str("square"),c.P2D=new Sk.builtin.int_(1),c.JAVA2D=new Sk.builtin.int_(1),c.WEBGL=new Sk.builtin.int_(2),c.P3D=new Sk.builtin.int_(2),c.OPENGL=new Sk.builtin.int_(2),c.PDF=new Sk.builtin.int_(0),c.DXF=new Sk.builtin.int_(0),c.OTHER=new Sk.builtin.int_(0),c.WINDOWS=new Sk.builtin.int_(1),c.MAXOSX=new Sk.builtin.int_(2),c.LINUX=new Sk.builtin.int_(3),c.EPSILON=new Sk.builtin.float_(1e-4),c.MAX_FLOAT=new Sk.builtin.float_(34028235e31),c.MIN_FLOAT=new Sk.builtin.float_(-34028235e31),c.MAX_INT=new Sk.builtin.int_(2147483647),c.MIN_INT=new Sk.builtin.int_(-2147483648),c.HALF_PI=new Sk.builtin.float_(Math.PI/2),c.THIRD_PI=new Sk.builtin.float_(Math.PI/3),c.PI=new Sk.builtin.float_(Math.PI),c.TWO_PI=new Sk.builtin.float_(2*Math.PI),c.TAU=new Sk.builtin.float_(2*Math.PI),c.QUARTER_PI=new Sk.builtin.float_(Math.PI/4),c.DEG_TO_RAD=new Sk.builtin.float_(Math.PI/180),c.RAD_TO_DEG=new Sk.builtin.float_(180/Math.PI),c.WHITESPACE=new Sk.builtin.str(" \\t\\n\\r\\f "),c.POINT=new Sk.builtin.int_(2),c.POINTS=new Sk.builtin.int_(2),c.LINE=new Sk.builtin.int_(4),c.LINES=new Sk.builtin.int_(4),c.TRIANGLE=new Sk.builtin.int_(8),c.TRIANGLES=new Sk.builtin.int_(9),c.TRIANGLE_FAN=new Sk.builtin.int_(11),c.TRIANGLE_STRIP=new Sk.builtin.int_(10),c.QUAD=new Sk.builtin.int_(16),c.QUADS=new Sk.builtin.int_(16),c.QUAD_STRIP=new Sk.builtin.int_(17),c.POLYGON=new Sk.builtin.int_(20),c.PATH=new Sk.builtin.int_(21),c.RECT=new Sk.builtin.int_(30),c.ELLIPSE=new Sk.builtin.int_(31),c.ARC=new Sk.builtin.int_(32),c.SPHERE=new Sk.builtin.int_(40),c.BOX=new Sk.builtin.int_(41),c.GROUP=new Sk.builtin.int_(0),c.PRIMITIVE=new Sk.builtin.int_(1),c.GEOMETRY=new Sk.builtin.int_(3),c.VERTEX=new Sk.builtin.int_(0),c.BEZIER_VERTEX=new Sk.builtin.int_(1),c.CURVE_VERTEX=new Sk.builtin.int_(2),c.BREAK=new Sk.builtin.int_(3),c.CLOSESHAPE=new Sk.builtin.int_(4),c.REPLACE=new Sk.builtin.int_(0),c.BLEND=new Sk.builtin.int_(1),c.ADD=new Sk.builtin.int_(2),c.SUBTRACT=new Sk.builtin.int_(4),c.LIGHTEST=new Sk.builtin.int_(8),c.DARKEST=new Sk.builtin.int_(16),c.DIFFERENCE=new Sk.builtin.int_(32),c.EXCLUSION=new Sk.builtin.int_(64),c.MULTIPLY=new Sk.builtin.int_(128),c.SCREEN=new Sk.builtin.int_(256),c.OVERLAY=new Sk.builtin.int_(512),c.HARD_LIGHT=new Sk.builtin.int_(1024),c.SOFT_LIGHT=new Sk.builtin.int_(2048),c.DODGE=new Sk.builtin.int_(4096),c.BURN=new Sk.builtin.int_(8192),c.ALPHA_MASK=new Sk.builtin.int_(4278190080),c.RED_MASK=new Sk.builtin.int_(16711680),c.GREEN_MASK=new Sk.builtin.int_(65280),c.BLUE_MASK=new Sk.builtin.int_(255),c.CUSTOM=new Sk.builtin.int_(0),c.ORTHOGRAPHIC=new Sk.builtin.int_(2),c.PERSPECTIVE=new Sk.builtin.int_(3),c.ARROW=new Sk.builtin.str("default"),c.CROSS=new Sk.builtin.str("crosshair"),c.HAND=new Sk.builtin.str("pointer"),c.MOVE=new Sk.builtin.str("move"),c.TEXT=new Sk.builtin.str("text"),c.WAIT=new Sk.builtin.str("wait"),c.NOCURSOR=Sk.builtin.assk$("url(\'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\'), auto"),c.DISABLE_OPENGL_2X_SMOOTH=new Sk.builtin.int_(1),c.ENABLE_OPENGL_2X_SMOOTH=new Sk.builtin.int_(-1),c.ENABLE_OPENGL_4X_SMOOTH=new Sk.builtin.int_(2),c.ENABLE_NATIVE_FONTS=new Sk.builtin.int_(3),c.DISABLE_DEPTH_TEST=new Sk.builtin.int_(4),c.ENABLE_DEPTH_TEST=new Sk.builtin.int_(-4),c.ENABLE_DEPTH_SORT=new Sk.builtin.int_(5),c.DISABLE_DEPTH_SORT=new Sk.builtin.int_(-5),c.DISABLE_OPENGL_ERROR_REPORT=new Sk.builtin.int_(6),c.ENABLE_OPENGL_ERROR_REPORT=new Sk.builtin.int_(-6),c.ENABLE_ACCURATE_TEXTURES=new Sk.builtin.int_(7),c.DISABLE_ACCURATE_TEXTURES=new Sk.builtin.int_(-7),c.HINT_COUNT=new Sk.builtin.int_(10),c.OPEN=new Sk.builtin.int_(1),c.CLOSE=new Sk.builtin.int_(2),c.BLUR=new Sk.builtin.int_(11),c.GRAY=new Sk.builtin.int_(12),c.INVERT=new Sk.builtin.int_(13),c.OPAQUE=new Sk.builtin.int_(14),c.POSTERIZE=new Sk.builtin.int_(15),c.THRESHOLD=new Sk.builtin.int_(16),c.ERODE=new Sk.builtin.int_(17),c.DILATE=new Sk.builtin.int_(18),c.BACKSPACE=new Sk.builtin.int_(8),c.TAB=new Sk.builtin.int_(9),c.ENTER=new Sk.builtin.int_(10),c.RETURN=new Sk.builtin.int_(13),c.ESC=new Sk.builtin.int_(27),c.DELETE=new Sk.builtin.int_(127),c.CODED=new Sk.builtin.int_(65535),c.SHIFT=new Sk.builtin.int_(16),c.CONTROL=new Sk.builtin.int_(17),c.ALT=new Sk.builtin.int_(18),c.CAPSLK=new Sk.builtin.int_(20),c.PGUP=new Sk.builtin.int_(33),c.PGDN=new Sk.builtin.int_(34),c.END=new Sk.builtin.int_(35),c.HOME=new Sk.builtin.int_(36),c.LEFT=new Sk.builtin.int_(37),c.UP=new Sk.builtin.int_(38),c.RIGHT=new Sk.builtin.int_(39),c.DOWN=new Sk.builtin.int_(40),c.F1=new Sk.builtin.int_(112),c.F2=new Sk.builtin.int_(113),c.F3=new Sk.builtin.int_(114),c.F4=new Sk.builtin.int_(115),c.F5=new Sk.builtin.int_(116),c.F6=new Sk.builtin.int_(117),c.F7=new Sk.builtin.int_(118),c.F8=new Sk.builtin.int_(119),c.F9=new Sk.builtin.int_(120),c.F10=new Sk.builtin.int_(121),c.F11=new Sk.builtin.int_(122),c.F12=new Sk.builtin.int_(123),c.NUMLK=new Sk.builtin.int_(144),c.META=new Sk.builtin.int_(157),c.INSERT=new Sk.builtin.int_(155),c.SINCOS_LENGTH=new Sk.builtin.int_(720),c.PRECISIONB=new Sk.builtin.int_(15),c.PRECISIONF=new Sk.builtin.int_(32768),c.PREC_MAXVAL=new Sk.builtin.int_(32767),c.PREC_ALPHA_SHIFT=new Sk.builtin.int_(9),c.PREC_RED_SHIFT=new Sk.builtin.int_(1),c.NORMAL_MODE_AUTO=new Sk.builtin.int_(0),c.NORMAL_MODE_SHAPE=new Sk.builtin.int_(1),c.NORMAL_MODE_VERTEX=new Sk.builtin.int_(2),c.MAX_LIGHTS=new Sk.builtin.int_(8),c.line=new Sk.builtin.func((function(n,i,e,t){c.processing.line(n.v,i.v,e.v,t.v)})),c.ellipse=new Sk.builtin.func((function(n,i,e,t){c.processing.ellipse(n.v,i.v,e.v,t.v)})),c.circle=new Sk.builtin.func((function(n,i,e){c.processing.ellipse(n.v,i.v,e.v,e.v)})),c.text=new Sk.builtin.func((function(n,i,e){c.processing.text(n.v,i.v,e.v)})),c.point=new Sk.builtin.func((function(n,i){c.processing.point(n.v,i.v)})),c.arc=new Sk.builtin.func((function(n,i,e,t,u,o){c.processing.arc(n.v,i.v,e.v,t.v,u.v,o.v)})),c.quad=new Sk.builtin.func((function(n,i,e,t,u,o,s,l){c.processing.quad(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v)})),c.rect=new Sk.builtin.func((function(n,i,e,t,u){"undefined"==typeof u?c.processing.rect(n.v,i.v,e.v,t.v):c.processing.rect(n.v,i.v,e.v,t.v,u.v)})),c.triangle=new Sk.builtin.func((function(n,i,e,t,u,o){c.processing.triangle(n.v,i.v,e.v,t.v,u.v,o.v)})),c.bezier=new Sk.builtin.func((function(n,i,e,t,u,o,s,l,r,v,f,S){"undefined"==typeof r?c.processing.bezier(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v):c.processing.bezier(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v,v.v,f.v,S.v)})),c.alpha=new Sk.builtin.func((function(n,i,e){return"undefined"==typeof i?new Sk.builtin.float_(c.processing.alpha(n.v)):"undefined"==typeof e?new Sk.builtin.float_(c.processing.alpha(n.v,i.v)):new Sk.builtin.float_(c.processing.alpha(n.v,i.v,e.v))})),c.ambient=new Sk.builtin.func((function(n,i,e){"undefined"==typeof i?c.processing.ambient(n.v):"undefined"==typeof e?c.processing.ambient(n.v,i.v):c.processing.ambient(n.v,i.v,e.v)})),c.ambientLight=new Sk.builtin.func((function(n,i,e,t,u,o){"undefined"==typeof t?c.processing.ambientLight(n.v,i.v,e.v):"undefined"==typeof u?c.processing.ambientLight(n.v,i.v,e.v,t.v):"undefined"==typeof o?c.processing.ambientLight(n.v,i.v,e.v,t.v,u.v):c.processing.ambientLight(n.v,i.v,e.v,t.v,u.v,o.v)})),c.beginCamera=new Sk.builtin.func((function(){c.processing.beginCamera()})),c.beginShape=new Sk.builtin.func((function(n){"undefined"==typeof n&&(n=c.POLYGON),c.processing.beginShape(n.v)})),c.bezierDetail=new Sk.builtin.func((function(n){n="undefined"!=typeof n?n.v:20,c.processing.bezierDetail(n)})),c.bezierPoint=new Sk.builtin.func((function(n,i,e,t,u){c.processing.bezierPoint(n.v,i.v,e.v,t.v,u.v)})),c.bezierTangent=new Sk.builtin.func((function(n,i,e,t,u){c.processing.bezierTangent(n.v,i.v,e.v,t.v,u.v)})),c.bezierVertex=new Sk.builtin.func((function(n,i,e,t,u,o,s,l,r){"undefined"==typeof s?c.processing.bezierVertex(n.v,i.v,e.v,t.v,u.v,o.v):"undefined"==typeof l?c.processing.bezierVertex(n.v,i.v,e.v,t.v,u.v,o.v,s.v):"undefined"==typeof r?c.processing.bezierVertex(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v):c.processing.bezierVertex(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v)})),c.blend=new Sk.builtin.func((function(n,i,e,t,u,o,s,l,r,v){n instanceof Sk.builtin.int_||n instanceof Sk.builtin.float_?c.processing.blend(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v):c.processing.blend(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v,v.v)})),c.blendColor=new Sk.builtin.func((function(n,i,e){var t=Sk.misceval.callsimArray(c.color,[new Sk.builtin.int_(0),new Sk.builtin.int_(0),new Sk.builtin.int_(0)]);return t.v=c.processing.blendColor(n.v,i.v,e.v),t})),c.brightness=new Sk.builtin.func((function(n,i,e){return"undefined"==typeof i?new Sk.builtin.float_(c.processing.brightness(n.v)):"undefined"==typeof e?new Sk.builtin.float_(c.processing.brightness(n.v,i.v)):new Sk.builtin.float_(c.processing.brightness(n.v,i.v,e.v))})),c.camera=new Sk.builtin.func((function(n,i,e,t,u,o,s,l,r){"undefined"==typeof n?c.processing.camera():c.processing.camera(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v)})),c.constrain=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.constrain(n.v,i.v,e.v))})),c.copy=new Sk.builtin.func((function(n,i,e,t,u,o,s,l,r){n instanceof Sk.builtin.int_||n instanceof Sk.builtin.float_?c.processing.copy(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v):c.processing.copy(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v)})),c.createFont=new Sk.builtin.func((function(n,i,e,t){var u=Sk.misceval.callsimArray(c.PFont);return u.v="undefined"==typeof e?c.processing.createFont(n.v,i.v):"undefined"==typeof t?c.processing.createFont(n.v,i.v,e.v):c.processing.createFont(n.v,i.v,e.v,t.v),u})),c.createGraphics=new Sk.builtin.func((function(n,i,e,t){var u=Sk.misceval.callsimArray(c.PGraphics);return u.v="undefined"==typeof t?c.processing.createGraphics(n.v,i.v,e.v):c.processing.createGraphics(n.v,i.v,e.v,t.v),u})),c.createImage=new Sk.builtin.func((function(n,i,e){var t=Sk.misceval.callsimArray(c.PImage);return t.v=c.processing.createImage(n.v,i.v,e.v),t})),c.cursor=new Sk.builtin.func((function(n,i,e){"undefined"==typeof n?c.processing.cursor():"undefined"==typeof i?c.processing.cursor(n.v):"undefined"==typeof e?c.processing.cursor(n.v,i.v):c.processing.cursor(n.v,i.v,e.v)})),c.curve=new Sk.builtin.func((function(n,i,e,t,u,o,s,l,r,v,f,S){"undefined"==typeof r?c.processing.curve(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v):"undefined"==typeof v?c.processing.curve(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v):"undefined"==typeof f?c.processing.curve(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v,v.v):"undefined"==typeof S?c.processing.curve(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v,v.v,f.v):c.processing.curve(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v,r.v,v.v,f.v,S.v)})),c.curveDetail=new Sk.builtin.func((function(n){c.processing.curveDetail(n.v)})),c.curvePoint=new Sk.builtin.func((function(n,i,e,t,u){c.processing.curvePoint(n.v,i.v,e.v,t.v,u.v)})),c.curveTangent=new Sk.builtin.func((function(n,i,e,t,u){c.processing.curveTangent(n.v,i.v,e.v,t.v,u.v)})),c.curveTightness=new Sk.builtin.func((function(n){c.processing.curveTightness(n.v)})),c.curveVertex=new Sk.builtin.func((function(n,i,e){"undefined"==typeof e?c.processing.curveVertex(n.v,i.v):c.processing.curveVertex(n.v,i.v,e.v)})),c.day=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.day())})),c.degrees=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.degrees(n.v))})),c.directionalLight=new Sk.builtin.func((function(n,i,e,t,u,o){c.processing.directionalLight(n.v,i.v,e.v,t.v,u.v,o.v)})),c.dist=new Sk.builtin.func((function(n,i,e,t,u,o){return"undefined"==typeof u?new Sk.builtin.float_(c.processing.dist(n.v,i.v,e.v,t.v)):"undefined"==typeof o?new Sk.builtin.float_(c.processing.dist(n.v,i.v,e.v,t.v,u.v)):new Sk.builtin.float_(c.processing.dist(n.v,i.v,e.v,t.v,u.v,o.v))})),c.emissive=new Sk.builtin.func((function(n,i,e){"undefined"==typeof i?c.processing.emissive(n.v):"undefined"==typeof e?c.processing.emissive(n.v,i.v):c.processing.emissive(n.v,i.v,e.v)})),c.endCamera=new Sk.builtin.func((function(){c.processing.endCamera()})),c.endShape=new Sk.builtin.func((function(n){"undefined"==typeof n?c.processing.endShape():c.processing.endShape(n.v)})),c.filter=new Sk.builtin.func((function(n,i){"undefined"==typeof i?c.processing.filter(n.v):c.processing.filter(n.v,i.v)})),c.frustum=new Sk.builtin.func((function(n,i,e,t,u,o){c.processing.frustum(n,i,e,t,u,o)})),c.hint=new Sk.builtin.func((function(n){c.processing.hint(n)})),c.hour=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.hour())})),c.hue=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.hue(n.v))})),c.imageMode=new Sk.builtin.func((function(n){c.processing.imageMode(n.v)})),c.lerp=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.lerp(n.v,i.v,e.v))})),c.lerpColor=new Sk.builtin.func((function(n,i,e){var t=Sk.misceval.callsimArray(c.color,[new Sk.builtin.int_(0),new Sk.builtin.int_(0),new Sk.builtin.int_(0)]);return t.v=c.processing.lerpColor(n.v,i.v,e.v),t})),c.lightFalloff=new Sk.builtin.func((function(n,i,e){c.processing.lightFalloff(n.v,i.v,e.v)})),c.lights=new Sk.builtin.func((function(){c.processing.lights()})),c.lightSpecular=new Sk.builtin.func((function(n,i,e){c.processing.lightSpecular(n.v,i.v,e.v)})),c.loadBytes=new Sk.builtin.func((function(n){return new Sk.builtin.list(c.processing.loadBytes(n.v))})),c.loadFont=new Sk.builtin.func((function(n){var i=Sk.misceval.callsimArray(c.PFont);return i.v=c.processing.loadFont(n.v),i})),c.loadShape=new Sk.builtin.func((function(n){return Sk.misceval.callsimArray(c.PShapeSVG,[new Sk.builtin.str("string"),n])})),c.loadStrings=new Sk.builtin.func((function(n){return new Sk.builtin.list(c.processing.loadStrings(n.v))})),c.mag=new Sk.builtin.func((function(n,i,e){return"undefined"==typeof e?new Sk.builtin.float_(c.processing.mag(n.v,i.v)):new Sk.builtin.float_(c.processing.mag(n.v,i.v,e.v))})),c.map=new Sk.builtin.func((function(n,i,e,t,u){return new Sk.builtin.float_(c.processing.map(n.v,i.v,e.v,t.v,u.v))})),c.millis=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.millis())})),c.minute=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.minute())})),c.modelX=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.modelX(n.v,i.v,e.v))})),c.modelY=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.modelY(n.v,i.v,e.v))})),c.modelZ=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.modelZ(n.v,i.v,e.v))})),c.month=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.month())})),c.noCursor=new Sk.builtin.func((function(){c.processing.noCursor()})),c.noise=new Sk.builtin.func((function(n,i,e){return"undefined"==typeof i?new Sk.builtin.float_(c.processing.noise(n.v)):"undefined"==typeof e?new Sk.builtin.float_(c.processing.noise(n.v,i.v)):new Sk.builtin.float_(c.processing.noise(n.v,i.v,e.v))})),c.noiseDetail=new Sk.builtin.func((function(n,i){c.processing.noiseDetail(n.v,i.v)})),c.noiseSeed=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.noiseSeed(n.v))})),c.noLights=new Sk.builtin.func((function(){c.processing.noLights()})),c.norm=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.norm(n.v,i.v,e.v))})),c.normal=new Sk.builtin.func((function(n,i,e){c.processing.normal(n.v,i.v,e.v)})),c.noTint=new Sk.builtin.func((function(){c.processing.noTint()})),c.ortho=new Sk.builtin.func((function(n,i,e,t,u,o){c.processing.ortho(n.v,i.v,e.v,t.v,u.v,o.v)})),c.perspective=new Sk.builtin.func((function(n,i,e,t){"undefined"==typeof n?c.processing.perspective():"undefined"==typeof i?c.processing.perspective(n.v):"undefined"==typeof e?c.processing.perspective(n.v,i.v):"undefined"==typeof t?c.processing.perspective(n.v,i.v,e.v):c.processing.perspective(n.v,i.v,e.v,t.v)})),c.pointLight=new Sk.builtin.func((function(n,i,e,t,u,o){c.processing.pointLight(n.v,i.v,e.v,t.v,u.v,o.v)})),c.printCamera=new Sk.builtin.func((function(){c.processing.printCamera()})),c.println=new Sk.builtin.func((function(n){c.processing.println(n.v)})),c.printProjection=new Sk.builtin.func((function(){c.processing.printProjection()})),c.radians=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.radians(n.v))})),c.randomSeed=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.randomSeed(n.v))})),c.random=new Sk.builtin.func((function(n,i){return"undefined"==typeof n?new Sk.builtin.float_(c.processing.random()):"undefined"==typeof i?new Sk.builtin.float_(c.processing.random(n.v)):new Sk.builtin.float_(c.processing.random(n.v,i.v))})),c.requestImage=new Sk.builtin.func((function(n,i){var e=Sk.misceval.callsimArray(c.PImage);return e.v="undefined"==typeof i?c.processing.requestImage(n.v):c.processing.requestImage(n.v,i.v),e})),c.saturation=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.saturation(n.v))})),c.save=new Sk.builtin.func((function(n){c.processing.save(n.v)})),c.saveFrame=new Sk.builtin.func((function(n){"undefined"==typeof n?c.processing.saveFrame():c.processing.saveFrame(n.v)})),c.saveStrings=new Sk.builtin.func((function(n,i){c.processing.saveStrings(n.v,i.v)})),c.screenX=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.screenX(n.v,i.v,e.v))})),c.screenY=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.screenY(n.v,i.v,e.v))})),c.screenZ=new Sk.builtin.func((function(n,i,e){return new Sk.builtin.float_(c.processing.screenZ(n.v,i.v,e.v))})),c.second=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.second())})),c.shape=new Sk.builtin.func((function(n,i,e,t,u){"undefined"==typeof i?c.processing.shape(n.v):"undefined"==typeof e?c.processing.shape(n.v,i.v):"undefined"==typeof t?c.processing.shape(n.v,i.v,e.v):"undefined"==typeof u?c.processing.shape(n.v,i.v,e.v,t.v):c.processing.shape(n.v,i.v,e.v,t.v,u.v)})),c.shapeMode=new Sk.builtin.func((function(n){c.processing.shapeMode(n.v)})),c.shininess=new Sk.builtin.func((function(n){c.processing.shininess(n.v)})),c.specular=new Sk.builtin.func((function(n,i,e){"undefined"==typeof i?c.processing.specular(n.v):"undefined"==typeof e?c.processing.specular(n.v,i.v):c.processing.specular(n.v,i.v,e.v)})),c.spotLight=new Sk.builtin.func((function(n,i,e,t,u,o,s,l){c.processing.spotLight(n.v,i.v,e.v,t.v,u.v,o.v,s.v,l.v)})),c.sq=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.sq(n))})),c.status=new Sk.builtin.func((function(n){c.processing.status(n.v)})),c.textAlign=new Sk.builtin.func((function(n,i){"undefined"==typeof i?c.processing.textAlign(n.v):c.processing.textAlign(n.v,i.v)})),c.textAscent=new Sk.builtin.func((function(){return new Sk.builtin.float_(c.processing.textAscent())})),c.textDescent=new Sk.builtin.func((function(){return new Sk.builtin.float_(c.processing.textDescent())})),c.textFont=new Sk.builtin.func((function(n,i){"undefined"==typeof i?c.processing.textFont(n.v):c.processing.textFont(n.v,i.v)})),c.textLeading=new Sk.builtin.func((function(n){c.processing.textLeading(n.v)})),c.textMode=new Sk.builtin.func((function(n){c.processing.textMode(n.v)})),c.textSize=new Sk.builtin.func((function(n){c.processing.textSize(n.v)})),c.texture=new Sk.builtin.func((function(n){c.processing.texture(n.v)})),c.textureMode=new Sk.builtin.func((function(n){c.processing.textureMode(n.v)})),c.textWidth=new Sk.builtin.func((function(n){return new Sk.builtin.float_(c.processing.textWidth(n.v))})),c.tint=new Sk.builtin.func((function(n,i,e,t){"undefined"==typeof i?c.processing.tint(n.v):"undefined"==typeof e?c.processing.tint(n.v,i.v):"undefined"==typeof t?c.processing.tint(n.v,i.v,e.v):c.processing.tint(n.v,i.v,e.v,t.v)})),c.updatePixels=new Sk.builtin.func((function(){c.processing.updatePixels()})),c.vertex=new Sk.builtin.func((function(n,i,e,t,u){"undefined"==typeof e?c.processing.vertex(n.v,i.v):"undefined"==typeof t?c.processing.vertex(n.v,i.v,e.v):"undefined"==typeof u?c.processing.vertex(n.v,i.v,e.v,t.v):c.processing.vertex(n.v,i.v,e.v,t.v,u.v)})),c.year=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.year())})),c.box=new Sk.builtin.func((function(n){c.processing.box(n.v)})),c.sphere=new Sk.builtin.func((function(n){c.processing.sphere(n.v)})),c.sphereDetail=new Sk.builtin.func((function(n,i){"undefined"==typeof i?c.processing.sphereDetail(n.v):c.processing.sphereDetail(n.v,i.v)})),c.background=new Sk.builtin.func((function(n,i,e){"undefined"!=typeof i&&(i=i.v),"undefined"!=typeof e&&(e=e.v),c.processing.background(n.v,i,e)})),c.fill=new Sk.builtin.func((function(n,i,e,t){"undefined"!=typeof i&&(i=i.v),"undefined"!=typeof e&&(e=e.v),"undefined"!=typeof t&&(t=t.v),c.processing.fill(n.v,i,e,t)})),c.stroke=new Sk.builtin.func((function(n,i,e,t){"undefined"!=typeof i&&(i=i.v),"undefined"!=typeof e&&(e=e.v),"undefined"!=typeof t&&(t=t.v),c.processing.stroke(n.v,i,e,t)})),c.noStroke=new Sk.builtin.func((function(){c.processing.noStroke()})),c.colorMode=new Sk.builtin.func((function(n,i,e,t,u){i="undefined"==typeof i?255:i.v,"undefined"!=typeof e&&(e=e.v),"undefined"!=typeof t&&(t=t.v),"undefined"!=typeof u&&(u=u.v),c.processing.colorMode(n.v,i,e,t,u)})),c.noFill=new Sk.builtin.func((function(){c.processing.noFill()})),c.loop=new Sk.builtin.func((function(){if(null===c.processing)throw new Sk.builtin.Exception("loop() should be called after run()");v=!0,c.processing.loop()})),c.noLoop=new Sk.builtin.func((function(){if(null===c.processing)throw new Sk.builtin.Exception("noLoop() should be called after run()");v=!1,c.processing.noLoop()})),c.frameRate=new Sk.builtin.func((function(n){c.processing.frameRate(n.v)})),c.width=new Sk.builtin.int_(0),c.height=new Sk.builtin.int_(0),c.renderMode=c.P2D,c.size=new Sk.builtin.func((function(n,i,e){"undefined"==typeof e&&(e=c.P2D),c.processing.size(n.v,i.v,e.v),c.width=new Sk.builtin.int_(c.processing.width),c.height=new Sk.builtin.int_(c.processing.height),c.renderMode=e})),c.exitp=new Sk.builtin.func((function(){c.processing.exit()})),c.mouseX=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.mouseX)})),c.mouseY=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.mouseY)})),c.pmouseX=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.pmouseX)})),c.pmouseY=new Sk.builtin.func((function(){return new Sk.builtin.int_(c.processing.pmouseY)})),c.rectMode=new Sk.builtin.func((function(n){c.processing.rectMode(n.v)})),c.strokeWeight=new Sk.builtin.func((function(n){c.processing.strokeWeight(n.v)})),c.smooth=new Sk.builtin.func((function(){c.processing.smooth()})),c.noSmooth=new Sk.builtin.func((function(){c.processing.noSmooth()})),c.ellipseMode=new Sk.builtin.func((function(n){c.processing.ellipseMode(n.v)})),c.strokeCap=new Sk.builtin.func((function(n){c.processing.strokeCap(n.v)})),c.strokeJoin=new Sk.builtin.func((function(n){c.processing.strokeJoin(n.v)})),c.rotate=new Sk.builtin.func((function(n){c.processing.rotate(n.v)})),c.rotateX=new Sk.builtin.func((function(n){c.processing.rotateX(n.v)})),c.rotateY=new Sk.builtin.func((function(n){c.processing.rotateY(n.v)})),c.rotateZ=new Sk.builtin.func((function(n){c.processing.rotateZ(n.v)})),c.scale=new Sk.builtin.func((function(n,i,e){i="undefined"==typeof i?1:i.v,e="undefined"==typeof e?1:e.v,c.processing.scale(n.v,i,e)})),c.translate=new Sk.builtin.func((function(n,i,e){i="undefined"==typeof i?1:i.v,e="undefined"==typeof e?1:e.v,c.processing.translate(n.v,i,e)})),c.popMatrix=new Sk.builtin.func((function(){c.processing.popMatrix()})),c.pushMatrix=new Sk.builtin.func((function(){c.processing.pushMatrix()})),c.applyMatrix=new Sk.builtin.func((function(){var n,i=Array.prototype.slice.call(arguments,0,16);for(n=0;n>>0,this.mti=1;this.mti>>30,this.mt[this.mti]=(1812433253*((4294901760&n)>>>16)<<16)+1812433253*(65535&n)+this.mti,this.mt[this.mti]>>>=0},MersenneTwister.prototype.init_by_array=function(n,t){var i,e,r;for(this.init_genrand(19650218),i=1,e=0,r=this.N>t?this.N:t;r;r--){var u=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(1664525*((4294901760&u)>>>16)<<16)+1664525*(65535&u))+n[e]+e,this.mt[i]>>>=0,e++,++i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1),e>=t&&(e=0)}for(r=this.N-1;r;r--){u=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(1566083941*((4294901760&u)>>>16)<<16)+1566083941*(65535&u))-i,this.mt[i]>>>=0,++i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1)}this.mt[0]=2147483648},MersenneTwister.prototype.genrand_int32=function(){var n,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti==this.N+1&&this.init_genrand(5489),i=0;i>>1^t[1&n];for(;i>>1^t[1&n];n=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^n>>>1^t[1&n],this.mti=0}return n=this.mt[this.mti++],n^=n>>>11,n^=n<<7&2636928640,n^=n<<15&4022730752,(n^=n>>>18)>>>0},MersenneTwister.prototype.genrand_int31=function(){return this.genrand_int32()>>>1},MersenneTwister.prototype.genrand_real1=function(){return this.genrand_int32()*(1/4294967295)},MersenneTwister.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},MersenneTwister.prototype.genrand_real3=function(){return(this.genrand_int32()+.5)*(1/4294967296)},MersenneTwister.prototype.genrand_res53=function(){return(67108864*(this.genrand_int32()>>>5)+(this.genrand_int32()>>>6))*(1/9007199254740992)};var $builtinmodule=function(n){var t={},i=new MersenneTwister,e=void 0;t.seed=new Sk.builtin.func((function(n){return Sk.builtin.pyCheckArgsLen("seed",arguments.length,0,1),n=Sk.builtin.asnum$(n),i=arguments.length>0?new MersenneTwister(n):new MersenneTwister,Sk.builtin.none.none$})),t.random=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("random",arguments.length,0,0),new Sk.builtin.float_(i.genrand_res53())}));var toInt=function(n){return 0|n},randrange=function(n,t,e){var r,u,s;if(!Sk.builtin.checkInt(n))throw new Sk.builtin.ValueError("non-integer first argument for randrange()");if(void 0===t)return s=toInt(i.genrand_res53()*n),new Sk.builtin.int_(s);if(!Sk.builtin.checkInt(t))throw new Sk.builtin.ValueError("non-integer stop for randrange()");if(void 0===e&&(e=1),r=t-n,1==e&&r>0)return s=n+toInt(i.genrand_res53()*r),new Sk.builtin.int_(s);if(1==e)throw new Sk.builtin.ValueError("empty range for randrange() ("+n+", "+t+", "+r+")");if(!Sk.builtin.checkInt(e))throw new Sk.builtin.ValueError("non-integer step for randrange()");if(e>0)u=toInt((r+e-1)/e);else{if(!(e<0))throw new Sk.builtin.ValueError("zero step for randrange()");u=toInt((r+e+1)/e)}if(u<=0)throw new Sk.builtin.ValueError("empty range for randrange()");return s=n+e*toInt(i.genrand_res53()*u),new Sk.builtin.int_(s)};t.randint=new Sk.builtin.func((function(n,t){return Sk.builtin.pyCheckArgsLen("randint",arguments.length,2,2),n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t),randrange(n,t+1)})),t.randrange=new Sk.builtin.func((function(n,t,i){return Sk.builtin.pyCheckArgsLen("randrange",arguments.length,1,3),n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t),i=Sk.builtin.asnum$(i),randrange(n,t,i)})),t.uniform=new Sk.builtin.func((function(n,t){Sk.builtin.pyCheckArgsLen("uniform",arguments.length,2,2),n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t);const e=n+i.genrand_res53()*(t-n);return new Sk.builtin.float_(e)})),t.triangular=new Sk.builtin.func((function(n,t,e){var r,u,s;return Sk.builtin.pyCheckArgsLen("triangular",arguments.length,2,3),Sk.builtin.pyCheckType("low","number",Sk.builtin.checkNumber(n)),Sk.builtin.pyCheckType("high","number",Sk.builtin.checkNumber(t)),(n=Sk.builtin.asnum$(n))>(t=Sk.builtin.asnum$(t))&&(s=n,n=t,t=s),void 0===e||e===Sk.builtin.none.none$?e=(t-n)/2:(Sk.builtin.pyCheckType("mode","number",Sk.builtin.checkNumber(e)),e=Sk.builtin.asnum$(e)),u=(r=i.genrand_res53())<(e-n)/(t-n)?n+Math.sqrt(r*(t-n)*(e-n)):t-Math.sqrt((1-r)*(t-n)*(t-e)),new Sk.builtin.float_(u)}));var normalSample=function(n,t){var r,u,s,h,l;return void 0!==e?(l=e,e=void 0):(r=i.genrand_res53(),u=i.genrand_res53(),s=Math.sqrt(-2*Math.log(r)),h=2*Math.PI*u,l=s*Math.cos(h),e=s*Math.sin(h)),n+t*l};return t.gauss=new Sk.builtin.func((function(n,t){return Sk.builtin.pyCheckArgsLen("gauss",arguments.length,2,2),Sk.builtin.pyCheckType("mu","number",Sk.builtin.checkNumber(n)),Sk.builtin.pyCheckType("sigma","number",Sk.builtin.checkNumber(t)),n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t),new Sk.builtin.float_(normalSample(n,t))})),t.normalvariate=t.gauss,t.lognormvariate=new Sk.builtin.func((function(n,t){return Sk.builtin.pyCheckArgsLen("lognormvariate",arguments.length,2,2),Sk.builtin.pyCheckType("mu","number",Sk.builtin.checkNumber(n)),Sk.builtin.pyCheckType("sigma","number",Sk.builtin.checkNumber(t)),n=Sk.builtin.asnum$(n),t=Sk.builtin.asnum$(t),new Sk.builtin.float_(Math.exp(normalSample(n,t)))})),t.expovariate=new Sk.builtin.func((function(n){Sk.builtin.pyCheckArgsLen("expovariate",arguments.length,1,1),Sk.builtin.pyCheckType("lambd","number",Sk.builtin.checkNumber(n)),n=Sk.builtin.asnum$(n);var t=i.genrand_res53();return new Sk.builtin.float_(-Math.log(t)/n)})),t.choice=new Sk.builtin.func((function(n){if(Sk.builtin.pyCheckArgsLen("choice",arguments.length,1,1),Sk.builtin.pyCheckType("seq","sequence",Sk.builtin.checkSequence(n)),void 0!==n.sq$length){var t=new Sk.builtin.int_(toInt(i.genrand_res53()*n.sq$length()));return n.mp$subscript(t)}throw new Sk.builtin.TypeError("object has no length")})),t.shuffle=new Sk.builtin.func((function(n){if(Sk.builtin.pyCheckArgsLen("shuffle",arguments.length,1,1),Sk.builtin.pyCheckType("x","sequence",Sk.builtin.checkSequence(n)),n.constructor===Sk.builtin.list){const u=n.v;for(var t=u.length-1;t>0;t-=1){var e=u[r=toInt(i.genrand_res53()*(t+1))];u[r]=u[t],u[t]=e}}else{if(void 0===n.sq$length)throw new Sk.builtin.TypeError("object has no length");if(void 0===n.mp$ass_subscript)throw new Sk.builtin.TypeError("object is immutable");for(t=n.sq$length()-1;t>0;t-=1){var r=new Sk.builtin.int_(toInt(i.genrand_res53()*(t+1)));t=new Sk.builtin.int_(t);e=n.mp$subscript(r);n.mp$ass_subscript(r,n.mp$subscript(t)),n.mp$ass_subscript(t,e)}}return Sk.builtin.none.none$})),t.sample=new Sk.builtin.func((function(n,t){var e,r,u,s,h;for(Sk.builtin.pyCheckArgsLen("sample",arguments.length,2,2),Sk.builtin.pyCheckType("population","iterable",Sk.builtin.checkIterable(n)),Sk.builtin.pyCheckType("k","integer",Sk.builtin.checkInt(t)),t=Sk.builtin.asnum$(t),h=[],e=0,s=(u=Sk.abstr.iter(n)).tp$iternext();void 0!==s;e++,s=u.tp$iternext())r=Math.floor(i.genrand_res53()*(e+1)),enew pyStr(e))))},_value2member={},RegexFlagMeta=buildNativeClass("RegexFlagMeta",{constructor:function RegexFlagMeta(){},base:pyType,slots:{tp$iter(){const e=Object.values(_members)[Symbol.iterator]();return new pyIterator((()=>e.next().value))},sq$contains(e){if(!(e instanceof this))throw new TypeError("unsupported operand type(s) for \'in\': \'"+typeName(e)+"\' and \'"+typeName(this)+"\'");return Object.values(_members).includes(e)}}});re.RegexFlag=buildNativeClass("RegexFlag",{meta:RegexFlagMeta,base:pyInt,constructor:function RegexFlag(e){const t=_value2member[e];if(t)return t;this.v=e,_value2member[e]=this},slots:{tp$new(e,t){checkOneArg("RegexFlag",e,t);const r=e[0].valueOf();if(!checkInt(r))throw new ValueError(objectRepr(r)+" is not a valid RegexFlag");return new re.RegexFlag(r)},$r(){let e=this.valueOf();const t=e<0;e=t?~e:e;const r=[];Object.entries(_members).forEach((([t,n])=>{const s=n.valueOf();e&s&&(e&=~s,r.push("re."+t))})),e&&r.push(hex(e).toString());let n=r.join("|");return t&&(n=r.length>1?"~("+n+")":"~"+n),new pyStr(n)},sq$contains(e){if(!(e instanceof re.RegexFlag))throw new TypeError("\'in\' requires a RegexFlag not "+typeName(e));return this.nb$and(e)===e},nb$and:flagBitSlot(((e,t)=>e&t),JSBI.bitwiseAnd),nb$or:flagBitSlot(((e,t)=>e|t),JSBI.bitwiseOr),nb$xor:flagBitSlot(((e,t)=>e^t),JSBI.bitwiseXor),nb$invert:function(){const e=this.v;return"number"==typeof e?new re.RegexFlag(~e):new re.RegexFlag(JSBI.bitwiseNot(e))}},proto:{valueOf(){return this.v}},flags:{sk$acceptable_as_base_class:!1}}),re.TEMPLATE=re.T=new re.RegexFlag(1),re.IGNORECASE=re.I=new re.RegexFlag(2),re.LOCALE=re.L=new re.RegexFlag(4),re.MULTILINE=re.M=new re.RegexFlag(8),re.DOTALL=re.S=new re.RegexFlag(16),re.UNICODE=re.U=new re.RegexFlag(32),re.VERBOSE=re.X=new re.RegexFlag(64),re.DEBUG=new re.RegexFlag(128),re.ASCII=re.A=new re.RegexFlag(256);const _members={ASCII:re.A,IGNORECASE:re.I,LOCALE:re.L,UNICODE:re.U,MULTILINE:re.M,DOTALL:re.S,VERBOSE:re.X,TEMPLATE:re.T,DEBUG:re.DEBUG};function flagBitSlot(e,t){return function(r){if(r instanceof re.RegexFlag||r instanceof pyInt){let n=this.v,s=r.v;if("number"==typeof n&&"number"==typeof s){let t=e(n,s);return t<0&&(t+=4294967296),new re.RegexFlag(t)}return n=JSBI.BigUp(n),s=JSBI.BigUp(s),new re.RegexFlag(JSBI.numberIfSafe(t(n,s)))}return pyNotImplemented}}const jsFlags={i:re.I,m:re.M,s:re.S,u:re.U},jsInlineFlags={i:re.I,a:re.A,s:re.S,L:re.L,m:re.M,u:re.U,x:re.X};RegExp.prototype.hasOwnProperty("sticky")||delete jsFlags.s,RegExp.prototype.hasOwnProperty("unicode")||delete jsFlags.u;const flagFails=Object.entries({"cannot use LOCALE flag with a str pattern":re.L,"ASCII and UNICODE flags are incompatible":new re.RegexFlag(re.A.valueOf()|re.U.valueOf())}),inline_regex=/\\(\\?([isamux]+)\\)/g;function adjustFlags(e,t){let r=e.toString(),n="g",s=0;return r=r.replace(inline_regex,((e,t)=>{for(let r of t){const e=jsInlineFlags[r];s|=e.valueOf()}return""})),flagFails.forEach((([e,t])=>{if((t.valueOf()&s)===t.valueOf())throw new re.error("bad bad inline flags: "+e)})),t=numberBinOp(new re.RegexFlag(s),t,"BitOr"),flagFails.forEach((([e,r])=>{if(numberBinOp(r,t,"BitAnd")===r)throw new ValueError(e)})),numberBinOp(re.A,t,"BitAnd")!==re.A&&(t=numberBinOp(re.U,t,"BitOr")),Object.entries(jsFlags).forEach((([e,r])=>{numberBinOp(r,t,"BitAnd")===r&&(n+=e)})),t=new re.RegexFlag(t.valueOf()),[r,n,t]}let neg_lookbehind_A="(?)(?!(?:\\]|[^\\[]*[^\\\\]\\]))/g,py_to_js_unicode_escape=/\\\\[\\t\\r\\n \\v\\f#&~"\'!:,;`<>]|\\\\-(?!(?:\\]|[^\\[]*[^\\\\]\\]))/g,quantifierErrors=/Incomplete quantifier|Lone quantifier/g,_compiled_patterns=Object.create(null);function compile_pattern(e,t){let r,n;[r,n,t]=adjustFlags(e,t);const s=_compiled_patterns[e.toString()];if(s&&s.$flags===t)return s;const i={};let o,a;r="_"+r,r=r.replace(initialUnescapedBracket,"$1$2\\\\]$3"),r=r.replace(py_to_js_regex,((t,r,n,s,o,a)=>{switch(n){case"\\\\A":return r+neg_lookbehind_A+"^";case"\\\\Z":return r+"$(?!\\\\n)";case"{,":return r+"{0,";case"$":return r+"(?:(?=\\\\n$)|$)";default:if(n.endsWith(">"))return i[o]=!0,r+"(?<"+o+">";if(!i[s])throw new re.error("unknown group name "+s+" at position "+a+1,e,new pyInt(a+1));return r+"\\\\k<"+s+">"}})),r=r.slice(1);let l=r;n.includes("u")&&(l=r.replace(py_to_js_unicode_escape,(e=>{switch(e){case"\\\\ ":return" ";case"\\\\\\t":return"\\\\t";case"\\\\\\n":return"\\\\n";case"\\\\\\v":return"\\\\v";case"\\\\\\f":return"\\\\f";case"\\\\r":return"\\\\r";default:return e.slice(1)}})));try{o=new RegExp(l,n)}catch(g){if(!quantifierErrors.test(g.message))throw a=g.message.substring(g.message.lastIndexOf(":")+2)+" in pattern: "+e.toString(),new re.error(a,e);try{o=new RegExp(r,n.replace("u",""))}catch(g){throw a=g.message.substring(g.message.lastIndexOf(":")+2)+" in pattern: "+e.toString(),new re.error(a,e)}}const p=new re.Pattern(o,e,t);return _compiled_patterns[e.toString()]=p,p}function _compile(e,t){if(e instanceof re.Pattern){if(t!==zero||t.valueOf())throw new ValueError("cannot process flags argument with compiled pattern");return e}if(!checkString(e))throw new TypeError("first argument must be string or compiled pattern");return compile_pattern(e,t)}re.error=buildNativeClass("re.error",{base:Exception,constructor:function error(e,t,r){this.$pattern=t,this.$msg=e,this.$pos=r||pyNone,Exception.call(this,e)},slots:{tp$doc:"Exception raised for invalid regular expressions.\\n\\n Attributes:\\n\\n msg: The unformatted error message\\n pattern: The regular expression pattern\\n",tp$init(e,t){const[r,n,s]=copyKeywordToNamedArgs("re.error",["msg","pattern","pos"],e,t,[pyNone,pyNone]);this.$pattern=n,this.$pos=s,this.$msg=r}},getsets:{msg:{$get(){return this.$msg}},pattern:{$get(){return this.$pattern}},pos:{$get(){return this.$pos}}}});const zero=new pyInt(0),maxsize=Number.MAX_SAFE_INTEGER;re.Pattern=buildNativeClass("re.Pattern",{constructor:function(e,t,r){this.v=e,this.str=t,this.$flags=r,this.$groups=null,this.$groupindex=null},slots:{$r(){const e=objectRepr(this.str).slice(0,200),t=objectRepr(this.$flags.nb$and(re.U.nb$invert()));return new pyStr("re.compile("+e+(t?", "+t:"")+")")},tp$richcompare(e,t){if("Eq"!==t&&"NotEq"!==t||!(e instanceof re.Pattern))return pyNotImplemented;const r=this.str===e.str&&this.$flags===e.$flags;return"Eq"===t?r:!r},tp$hash(){},tp$doc:"Compiled regular expression object."},methods:{match:{$meth:function match(e,t,r){return this.$match(e,t,r)},$flags:{NamedArgs:["string","pos","endpos"],Defaults:[zero,maxsize]},$textsig:"($self, /, string, pos=0, endpos=sys.maxsize)",$doc:"Matches zero or more characters at the beginning of the string."},fullmatch:{$meth:function fullmatch(e,t,r){return this.full$match(e,t,r)},$flags:{NamedArgs:["string","pos","endpos"],Defaults:[zero,maxsize]},$textsig:"($self, /, string, pos=0, endpos=sys.maxsize)",$doc:"Matches against all of the string."},search:{$meth:function search(e,t,r){return this.$search(e,t,r)},$flags:{NamedArgs:["string","pos","endpos"],Defaults:[zero,maxsize]},$textsig:"($self, /, string, pos=0, endpos=sys.maxsize)",$doc:"Scan through string looking for a match, and return a corresponding match object instance.\\n\\nReturn None if no position in the string matches."},sub:{$meth:function sub(e,t,r){return this.$sub(e,t,r)},$flags:{NamedArgs:["repl","string","count"],Defaults:[zero]},$textsig:"($self, /, repl, string, count=0)",$doc:"Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl."},subn:{$meth:function(e,t,r){return this.$subn(e,t,r)},$flags:{NamedArgs:["repl","string","count"],Defaults:[zero]},$textsig:"($self, /, repl, string, count=0)",$doc:"Return the tuple (new_string, number_of_subs_made) found by replacing the leftmost non-overlapping occurrences of pattern with the replacement repl."},findall:{$meth:function findall(e,t,r){return this.find$all(e,t,r)},$flags:{NamedArgs:["string","pos","endpos"],Defaults:[zero,maxsize]},$textsig:"($self, /, string, pos=0, endpos=sys.maxsize)",$doc:"Return a list of all non-overlapping matches of pattern in string."},split:{$meth:function split(e,t){return this.$split(e,t)},$flags:{NamedArgs:["string","maxsplit"],Defaults:[zero]},$textsig:"($self, /, string, maxsplit=0)",$doc:"Split string by the occurrences of pattern."},finditer:{$meth:function finditer(e,t,r){return this.find$iter(e,t,r)},$flags:{NamedArgs:["string","pos","endpos"],Defaults:[zero,maxsize]},$textsig:"($self, /, string, pos=0, endpos=sys.maxsize)",$doc:"Return an iterator over all non-overlapping matches for the RE pattern in string.\\n\\nFor each match, the iterator returns a match object."},scanner:{$meth:function scanner(e,t,r){return this.$scanner(e,t,r)},$flags:{NamedArgs:["string","pos","endpos"],Defaults:[zero,maxsize]},$textsig:"($self, /, string, pos=0, endpos=sys.maxsize)",$doc:null},__copy__:{$meth:function copy(){return this},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:null},__deepcopy__:{$meth:function(){return this},$flags:{OneArg:!0},$textsig:"($self, memo, /)",$doc:null}},getsets:{pattern:{$get(){return this.str},$doc:"The pattern string from which the RE object was compiled."},flags:{$get(){return this.$flags},$doc:"The regex matching flags."},groups:{$get(){if(null===this.$groups){const e=(this.str.v.match(this.group$regex)||[]).length;this.$groups=new pyInt(e)}return this.$groups},$doc:"The number of capturing groups in the pattern."},groupindex:{$get(){if(null===this.$groupindex){const e=this.str.v.matchAll(this.group$regex),t=[];let r=1;for(const n of e)n[1]&&(t.push(new pyStr(n[1])),t.push(new pyInt(r))),r++;this.$groupindex=new pyMappingProxy(new pyDict(t))}return this.$groupindex},$doc:"A dictionary mapping group names to group numbers."}},proto:{group$regex:/\\((?!\\?(?!P<).*)(?:\\?P<([^\\d\\W]\\w*)>)?(?![^\\[]*\\])/g,get$count:e=>(e=asIndexSized(e,OverflowError))||Number.POSITIVE_INFINITY,get$jsstr(e,t,r){if(!checkString(e))throw new TypeError("expected string or bytes-like object");if(t===zero&&r===maxsize||void 0===t&&void 0===r)return{jsstr:e.toString(),pos:zero.valueOf(),endpos:e.sq$length()};const{start:n,end:s}=pySlice.startEnd$wrt(e,t,r);return{jsstr:e.toString().slice(n,s),pos:n,endpos:s}},find$all(e,t,r){let{jsstr:n}=this.get$jsstr(e,t,r);const s=this.v,i=n.matchAll(s),o=[];for(let a of i)o.push(1===a.length?new pyStr(a[0]):2===a.length?new pyStr(a[1]):new pyTuple(a.slice(1).map((e=>new pyStr(e)))));return new pyList(o)},$split(e,t){t=(t=asIndexSized(t))||Number.POSITIVE_INFINITY;let{jsstr:r}=this.get$jsstr(e);const n=this.v,s=[];let i,o=0,a=0;for(;null!==(i=n.exec(r))&&o1&&s.push(...i.slice(1).map((e=>void 0===e?pyNone:new pyStr(e)))),o++,a=n.lastIndex,i.index===n.lastIndex){if(!r)break;r=r.slice(i.index),a=0,n.lastIndex=1}return n.lastIndex=0,s.push(new pyStr(r.slice(a))),new pyList(s)},match$from_repl(e,t,r,n){let s;const i=e[e.length-1];return"object"==typeof i?(s=e.slice(0,e.length-3),Object.assign(s,{groups:i}),s.index=e[e.length-3]):(s=e.slice(0,e.length-2),s.groups=void 0,s.index=e[e.length-2]),new re.Match(s,this.str,t,r,n)},do$sub(e,t,r){const{jsstr:n,pos:s,endpos:i}=this.get$jsstr(t);let o;checkCallable(e)?o=t=>{const r=pyCall(e,[t]);if(!checkString(r))throw new TypeError("expected str instance, "+typeName(r)+" found");return r.toString()}:(e=this.get$jsstr(e).jsstr,o=t=>t.template$repl(e)),r=this.get$count(r);let a=0;const l=n.replace(this.v,((...e)=>{if(a>=r)return e[0];a++;const n=this.match$from_repl(e,t,s,i);return o(n)}));return[new pyStr(l),new pyInt(a)]},$sub(e,t,r){const[n]=this.do$sub(e,t,r);return n},$subn(e,t,r){return new pyTuple(this.do$sub(e,t,r))},do$match(e,t,r,n){let s;({jsstr:s,pos:r,endpos:n}=this.get$jsstr(t,r,n));const i=s.match(e);return null===i?pyNone:new re.Match(i,this,t,r,n)},$search(e,t,r){var n=new RegExp(this.v.source,this.v.flags.replace("g",""));return this.do$match(n,e,t,r)},$match(e,t,r){let n=this.v.source,s=this.v.flags.replace("g","").replace("m","");n="^"+n;var i=new RegExp(n,s);return this.do$match(i,e,t,r)},full$match(e,t,r){let n=this.v.source,s=this.v.flags.replace("g","").replace("m","");n="^(?:"+n+")$";var i=new RegExp(n,s);return this.do$match(i,e,t,r)},find$iter(e,t,r){let n;({jsstr:n,pos:t,endpos:r}=this.get$jsstr(e,t,r));const s=n.matchAll(this.v);return new pyIterator((()=>{const n=s.next().value;if(void 0!==n)return new re.Match(n,this,e,t,r)}))}},flags:{sk$acceptable_as_base_class:!1}}),re.Match=buildNativeClass("re.Match",{constructor:function(e,t,r,n,s){this.v=e,this.$match=new pyStr(this.v[0]),this.str=r,this.$re=t,this.$pos=n,this.$endpos=s,this.$groupdict=null,this.$groups=null,this.$lastindex=null,this.$lastgroup=null,this.$regs=null},slots:{tp$doc:"The result of re.match() and re.search().\\nMatch objects always have a boolean value of True.",$r(){let e="",new pyStr(e)},tp$as_squence_or_mapping:!0,mp$subscript(e){const t=this.get$group(e);return void 0===t?pyNone:new pyStr(t)}},methods:{group:{$meth:function group(...e){let t;return e.length<=1?(t=this.get$group(e[0]),void 0===t?pyNone:new pyStr(t)):(t=[],e.forEach((e=>{e=this.get$group(e),t.push(void 0===e?pyNone:new pyStr(e))})),new pyTuple(t))},$flags:{MinArgs:0},$textsig:null,$doc:"group([group1, ...]) -> str or tuple.\\n Return subgroup(s) of the match by indices or names.\\n For 0 returns the entire match."},start:{$meth:function start(e){const t=this.get$group(e);return new pyInt(void 0===t?-1:this.str.v.indexOf(t,this.v.index+this.$pos))},$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, group=0, /)",$doc:"Return index of the start of the substring matched by group."},end:{$meth:function end(e){const t=this.get$group(e);return new pyInt(void 0===t?-1:this.str.v.indexOf(t,this.v.index+this.$pos)+[...t].length)},$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, group=0, /)",$doc:"Return index of the end of the substring matched by group."},span:{$meth:function span(e){return this.$span(e)},$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, group=0, /)",$doc:"For match object m, return the 2-tuple (m.start(group), m.end(group))."},groups:{$meth:function groups(e){return null!==this.$groups||(this.$groups=Array.from(this.v.slice(1),(t=>void 0===t?e:new pyStr(t))),this.$groups=new pyTuple(this.$groups)),this.$groups},$flags:{NamedArgs:["default"],Defaults:[pyNone]},$textsig:"($self, /, default=None)",$doc:"Return a tuple containing all the subgroups of the match, from 1.\\n\\n default\\n Is used for groups that did not participate in the match."},groupdict:{$meth:function groupdict(e){if(null!==this.$groupdict)return this.$groupdict;if(void 0===this.v.groups)this.$groupdict=new pyDict;else{const t=[];Object.entries(this.v.groups).forEach((([r,n])=>{t.push(new pyStr(r)),t.push(void 0===n?e:new pyStr(n))})),this.$groupdict=new pyDict(t)}return this.$groupdict},$flags:{NamedArgs:["default"],Defaults:[pyNone]},$textsig:"($self, /, default=None)",$doc:"Return a dictionary containing all the named subgroups of the match, keyed by the subgroup name.\\n\\n default\\n Is used for groups that did not participate in the match."},expand:{$meth:function expand(e){if(!checkString(e))throw new TypeError("expected str instance got "+typeName(e));return e=e.toString(),e=this.template$repl(e),new pyStr(e)},$flags:{OneArg:!0},$textsig:"($self, /, template)",$doc:"Return the string obtained by doing backslash substitution on the string template, as done by the sub() method."},__copy__:{$meth:function __copy__(){return this},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:null},__deepcopy__:{$meth:function __deepcopy__(){return this},$flags:{OneArg:!0},$textsig:"($self, memo, /)",$doc:null}},getsets:{lastindex:{$get(){if(null!==this.$lastindex)return this.$lastindex;let e,t=0;return this.v.forEach(((r,n)=>{n&&void 0!==r&&e!==r&&(t=n,e=r)})),this.$lastindex=t?new pyInt(t):pyNone,this.$lastindex},$doc:"The integer index of the last matched capturing group."},lastgroup:{$get(){if(null!==this.$lastgroup)return this.$lastgroup;if(void 0===this.v.groups)this.$lastgroup=pyNone;else{let e;Object.entries(this.v.groups).forEach((([t,r])=>{void 0!==r&&(e=t)})),this.$lastgroup=void 0===e?pyNone:new pyStr(e)}return this.$lastgroup},$doc:"The name of the last matched capturing group."},regs:{$get(){if(null!==this.$regs)return this.$regs;const e=[];return this.v.forEach(((t,r)=>{e.push(this.$span(r))})),this.$regs=new pyTuple(e),this.$regs}},string:{$get(){return this.str},$doc:"The string passed to match() or search()."},re:{$get(){return this.$re},$doc:"The regular expression object."},pos:{$get(){return new pyInt(this.$pos)},$doc:"The index into the string at which the RE engine started looking for a match."},endpos:{$get(){return new pyInt(this.$endpos)},$doc:"The index into the string beyond which the RE engine will not go."}},proto:{get$group(e){if(void 0===e)return this.v[0];if(checkString(e)){if(e=e.toString(),this.v.groups&&Object.prototype.hasOwnProperty.call(this.v.groups,e))return this.v.groups[e]}else if(isIndex(e)&&(e=asIndexSized(e))>=0&&e|\\\\g<([^\\d\\W]\\w*)>|\\\\g?/g,template$repl(e){return e.replace(this.template$regex,((e,t,r,n,s,i)=>{let o;if(void 0!==(t=t||r)?o=t{delete _compiled_patterns[e]})),pyNone},$flags:{NoArgs:!0},$textsig:"($module, / )",$doc:"Clear the regular expression caches"},template:{$meth:function template(e,t){return _compile(e,numberBinOp(re.T,t,"BitOr"))},$flags:{NamedArgs:["pattern","flags"],Defaults:[zero]},$textsig:"($module, / , pattern, flags=0)",$doc:"Compile a template pattern, returning a Pattern object"},escape:{$meth:function(e){if(!checkString(e))throw new TypeError("expected a str instances, got "+typeName(e));return e=(e=e.toString()).replace(escape_chrs,"\\\\$&"),new pyStr(e)},$flags:{NamedArgs:["pattern"],Defaults:[]},$textsig:"($module, / , pattern)",$doc:"\\n Escape special characters in a string.\\n "}});const escape_chrs=/[\\&\\~\\#.*+\\-?^${}()|[\\]\\\\\\t\\r\\v\\f\\n ]/g;return re}',"src/lib/requests/__init__.js":'var $builtinmodule=function(e){var n={__name__:new Sk.builtin.str("requests")};n.Response=Sk.misceval.buildClass(n,(function(e,n){n.__init__=new Sk.builtin.func((function(e,n){e.data$=n,e.lineList=e.data$.split("\\n"),e.lineList=e.lineList.slice(0,-1);for(var t=0;t")})),n.__repr__=n.__str__,n.__iter__=new Sk.builtin.func((function(e){var n=e.lineList;return Sk.builtin.makeGenerator((function(){if(!(this.$index>=this.$lines.length))return new Sk.builtin.str(this.$lines[this.$index++])}),{$obj:e,$index:0,$lines:n})})),n.read=new Sk.builtin.func((function(e,n){if(e.closed)throw new Sk.builtin.ValueError("I/O operation on closed file");var t=e.data$.length;void 0===n&&(n=t);var i=new Sk.builtin.str(e.data$.substr(e.pos$,n));return e.pos$+=n,e.pos$>=t&&(e.pos$=t),i})),n.readline=new Sk.builtin.func((function(e,n){var t="";return e.currentLine{var t="";if(e instanceof String||e instanceof Number||e instanceof Boolean)try{var i=n.toString().replaceAll("=","@");i=i.replaceAll("&","$");var r=e.toString().replaceAll("=","@");r=r.replaceAll("&","$"),t+="&"+i+"="+encodeURIComponent(r)}catch(s){t+="&"+n+"="+encodeURIComponent(e)}else $.each(e,(function(i){t+="&"+jsonToUrl(this,null==n?i:n+(e instanceof Array?"["+i+"]":"."+i))}));return t.substr(1)},requestFunc=function(e,t){e=Sk.ffi.remapToJs(e),t=Sk.ffi.remapToJs(t);const i=["method","url","params","data","headers","cookies","files","auth","timeout","allow_redirects","proxies","hooks","stream","verify","cert","json"];let r={method:"GET",url:"",params:null,data:"",headers:{"Content-type":"application/x-www-form-urlencoded"},cookies:null,files:null,auth:null,timeout:1e3,allow_redirects:null,proxies:null,hooks:null,stream:null,verify:null,cert:null,json:null};for(let n in e)r[i[n]]=e[n];for(let n=0;n=n){r=t.decoder.decode(new Uint8Array(e));break}}else{switch(224&o){case 252:n=6;break;case 248:n=5;break;case 240:n=4;break;case 224:n=3;break;default:n=2}e.push(o)}}return r},t.startReadLine=function(){t.readLineTimer=window.setTimeout((()=>{if(!t.keepReading)return void window.clearTimeout(t.readLineTimer);let e=!1;do{const n=t.readLine();e=n.endWithLF;const{text:r}=n;if(r&&t.output.push((t.output.length?t.output.pop():"")+r),e){t.output.length&&console.log(t.output),t.output.push("")}}while(e);for(;t.output.length>500;)t.output.shift();t.keepReading&&t.startReadLine()}),100)},t.addReadEvent=async function(){for(t.output=[],t.inputBuffer=[],t.outputBuffer=[],t.refreshInputBuffer=!1,t.refreshOutputBuffer=!0,t.startReadLine();t.obj.readable&&t.keepReading;){t.reader=t.obj.readable.getReader();try{for(;;){const{value:e,done:n}=await t.reader.read();if(t.refreshOutputBuffer&&e&&(t.outputBuffer=[...t.outputBuffer,...e]),t.refreshInputBuffer&&e&&(t.inputBuffer=[...t.inputBuffer,...e]),n)break}}catch(e){console.log(e)}finally{t.reader.releaseLock()}}},t.writeString=async function(e){const n=t.encoder.encode(e);await t.writeByteArr(n)},t.writeByteArr=async function(e){const n=t.obj.writable.getWriter();await n.write(new Int8Array(e).buffer),n.releaseLock(),await t.sleep(200)},t.setBaudRate=async function(e){t.keepReading=!1;const n=t.obj;await t.close(),await n.open({baudRate:e-0}),t.obj=n,t.keepReading=!0,t.addReadEvent()},t.setDTR=async function(e){t.dtr=e,await t.obj.setSignals({dataTerminalReady:e})},t.setRTS=async function(e){t.rts=e,await t.obj.setSignals({requestToSend:e})},t.setSignals=async function(e,n){t.dtr=e,t.rts=n,await t.obj.setSignals({dataTerminalReady:e,requestToSend:n})};let n={__name__:new Sk.builtin.str("serial")},r={baudrate:115200,bytesize:8,parity:"N",stopbits:1,timeout:1e3,xonxoff:!1,rtscts:!1,dsrdtr:!1};const serialInitFunc=function(e,n){e=Sk.ffi.remapToJs(e),n=Sk.ffi.remapToJs(n);const o=["baudrate","bytesize","parity","stopbits","timeout","xonxoff","rtscts","dsrdtr"];for(let t in e)e[t]&&(r[o[t]]=e[t]);const i=new Promise(((e,n)=>{t.isConnected()?e(t.obj):navigator.serial.requestPort().then((function(t){e(t)})).catch((function(e){t.obj=null,n(e)}))}));let u,a=new Sk.misceval.Suspension;return a.resume=function(){if(a.data.error)throw a.data.error;return Sk.builtin.none.none$},a.data={type:"Sk.promise",promise:i.then((function(e){return t.obj=e,Sk.builtin.none.none$}),(function(e){return console.log("err3",e),u="",Promise.reject(e)}))},a};serialInitFunc.co_fastcall=1;const serialOpenFunc=function(e,n){const o=new Promise(((e,n)=>{t.isConnected()?t.isOpend()?e():t.obj.open({baudRate:r.baudrate}).then((async function(){t.keepReading=!0,t.addReadEvent(),e()})).catch((function(e){t.obj=null,n(e)})):n("No serial found")}));let i=new Sk.misceval.Suspension;return i.resume=function(){if(i.data.error)throw i.data.error;return Sk.builtin.none.none$},i.data={type:"Sk.promise",promise:o.then((function(e){return Sk.builtin.none.none$}),(function(e){return console.log("err3",e),Promise.reject(e)}))},i},serialReadlineFunc=function(e,n){if(!t.isConnected())return new Sk.builtin.str("");if(console.log("length:",t.output.length),!t.isOpend()||t.output.length<2)return new Sk.builtin.str("");let r=t.output.shift();return console.log(r),new Sk.builtin.str(r)};return n.Serial=Sk.misceval.buildClass(n,(function(e,t){t.__init__=new Sk.builtin.func(serialInitFunc),t.__str__=new Sk.builtin.func((function(e){return Sk.ffi.remapToPy("")})),t.open=new Sk.builtin.func(serialOpenFunc),t.readline=new Sk.builtin.func(serialReadlineFunc)}),"Serial",[]),n};',"src/lib/signal.js":'var $builtinmodule=function(n){var i={};return i.SIG_DFL=new Sk.builtin.int_(0),i.SIG_IGN=new Sk.builtin.int_(1),i.CTRL_C_EVENT=new Sk.builtin.int_(0),i.CTRL_BREAK_EVENT=new Sk.builtin.int_(0),i.NSIG=new Sk.builtin.int_(23),i.SIGHUP=new Sk.builtin.int_(1),i.SIGNINT=new Sk.builtin.int_(2),i.SIGILL=new Sk.builtin.int_(4),i.SIGFPE=new Sk.builtin.int_(8),i.SIGKILL=new Sk.builtin.int_(9),i.SIGSEGV=new Sk.builtin.int_(11),i.SIGTERM=new Sk.builtin.int_(15),i.SIGBREAK=new Sk.builtin.int_(21),i.SIGABRT=new Sk.builtin.int_(22),i.pause=new Sk.builtin.func((function(){Sk.builtin.pyCheckArgsLen("pause",arguments.length,0,0);var n=new Sk.misceval.Suspension;return n.resume=function(){return Sk.builtin.none.none$},n.data={type:"Sk.promise",promise:new Promise((function(n,i){if(null!=Sk.signals&&Sk.signals.addEventListener){Sk.signals.addEventListener((function handleSignal(i){Sk.signals.removeEventListener(handleSignal),n()}))}else console.warn("signal.pause() not supported"),Sk.misceval.print_("signal.pause() not supported"),n()}))},n})),i.signal=new Sk.builtin.func((function(){throw new Sk.builtin.NotImplementedError("signal.signal is not supported.")})),i};',"src/lib/string.js":'var $builtinmodule=function(i){var t={};return t.ascii_lowercase=new Sk.builtin.str("abcdefghijklmnopqrstuvwxyz"),t.ascii_uppercase=new Sk.builtin.str("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.ascii_letters=new Sk.builtin.str(t.ascii_lowercase.v+t.ascii_uppercase.v),t.lowercase=new Sk.builtin.str("abcdefghijklmnopqrstuvwxyz"),t.uppercase=new Sk.builtin.str("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.letters=new Sk.builtin.str(t.lowercase.v+t.uppercase.v),t.digits=new Sk.builtin.str("0123456789"),t.hexdigits=new Sk.builtin.str("0123456789abcdefABCDEF"),t.octdigits=new Sk.builtin.str("01234567"),t.punctuation=new Sk.builtin.str("!\\"#$%&\'()*+,-./:;<=>?@[\\\\]^_`{|}~"),t.whitespace=new Sk.builtin.str("\\t\\n\\v\\f\\r "),t.printable=new Sk.builtin.str(t.digits.v+t.letters.v+t.punctuation.v+" \\t\\n\\r\\v\\f"),t.split=new Sk.builtin.func((function(...i){return Sk.misceval.callsimArray(Sk.builtin.str.prototype.split,i)})),t.capitalize=new Sk.builtin.func((function(i){return Sk.misceval.callsimArray(Sk.builtin.str.prototype.capitalize,[i])})),t.join=new Sk.builtin.func((function(i,t){return void 0===t&&(t=new Sk.builtin.str(" ")),Sk.misceval.callsimArray(Sk.builtin.str.prototype.join,[t,i])})),t.capwords=new Sk.builtin.func((function(i,n){if(Sk.builtin.pyCheckArgsLen("capwords",arguments.length,1,2),!Sk.builtin.checkString(i))throw new Sk.builtin.TypeError("s must be a string");if(void 0===n&&(n=new Sk.builtin.str(" ")),!Sk.builtin.checkString(n))throw new Sk.builtin.TypeError("sep must be a string");for(var e=Sk.misceval.callsimArray(t.split,[i,n]).v,r=[],l=0;l1&&function isLeapYear(t){return 0==(3&t)&&(t%100!=0||t%400==0)}(e?t.getUTCFullYear():t.getFullYear())&&u++,u}function stdTimezoneOffset(){var t=new Date(2002,0,1),e=new Date(2002,6,1);return Math.max(t.getTimezoneOffset(),e.getTimezoneOffset())}function dst(t){return t.getTimezoneOffset()1)return n[1];if(void 0===e)return null;try{return(n=t.toLocaleString(e,{timeZoneName:"short"}).split(" "))[n.length-1]}catch(i){return null}}function from_seconds(t,e){var i=new Date;if(t){Sk.builtin.pyCheckType("secs","number",Sk.builtin.checkNumber(t));var u=Sk.builtin.asnum$(t);i.setTime(1e3*u)}return function date_to_struct_time(t,e){let i;if(e=e||!1)i=[new Sk.builtin.str("UTC"),new Sk.builtin.int_(0)];else{var u=-t.getTimezoneOffset()/60,r=(u<0?"-":"+")+(""+Math.abs(u)).padStart(2,"0");i=[new Sk.builtin.str(r),new Sk.builtin.int_(3600*u)]}return new n([Sk.builtin.assk$(e?t.getUTCFullYear():t.getFullYear()),Sk.builtin.assk$((e?t.getUTCMonth():t.getMonth())+1),Sk.builtin.assk$(e?t.getUTCDate():t.getDate()),Sk.builtin.assk$(e?t.getUTCHours():t.getHours()),Sk.builtin.assk$(e?t.getUTCMinutes():t.getMinutes()),Sk.builtin.assk$(e?t.getUTCSeconds():t.getSeconds()),Sk.builtin.assk$(((e?t.getUTCDay():t.getDay())+6)%7),Sk.builtin.assk$(getDayOfYear(t,e)),Sk.builtin.assk$(e?0:dst(t)?1:0)],i)}(i,e)}e.struct_time=n,e.time=new Sk.builtin.func((function(){return Sk.builtin.pyCheckArgsLen("time",arguments.length,0,0),new Sk.builtin.float_(Date.now()/1e3)})),e.sleep=new Sk.builtin.func((function(t){return Sk.builtin.pyCheckArgsLen("sleep",arguments.length,1,1),Sk.builtin.pyCheckType("delay","float",Sk.builtin.checkNumber(t)),new Sk.misceval.promiseToSuspension(new Promise((function(e){Sk.setTimeout((function(){e(Sk.builtin.none.none$)}),1e3*Sk.ffi.remapToJs(t))})))})),e.localtime=new Sk.builtin.func((function(t){return Sk.builtin.pyCheckArgsLen("localtime",arguments.length,0,1),from_seconds(t,!1)})),e.gmtime=new Sk.builtin.func((function(t){return Sk.builtin.pyCheckArgsLen("gmtime",arguments.length,0,1),from_seconds(t,!0)}));var i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],u=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function asctime_f(t){if(Sk.builtin.pyCheckArgsLen("asctime",arguments.length,0,1),!t||Sk.builtin.checkNone(t)?t=from_seconds():t instanceof n||(t=new n(t)),t instanceof Sk.builtin.tuple&&9==t.v.length){var e=[];return e.push(u[Sk.builtin.asnum$(t.v[6])]),e.push(i[Sk.builtin.asnum$(t.v[1])-1]),e.push(padLeft(Sk.builtin.asnum$(t.v[2]).toString(),2,"0")),e.push(padLeft(Sk.builtin.asnum$(t.v[3]).toString(),2,"0")+":"+padLeft(Sk.builtin.asnum$(t.v[4]).toString(),2,"0")+":"+padLeft(Sk.builtin.asnum$(t.v[5]).toString(),2,"0")),e.push(padLeft(Sk.builtin.asnum$(t.v[0]).toString(),4,"0")),new Sk.builtin.str(e.join(" "))}}function mktime_f(t){if(Sk.builtin.pyCheckArgsLen("mktime",arguments.length,1,1),t instanceof Sk.builtin.tuple&&9==t.v.length){var e=new Date(Sk.builtin.asnum$(t.v[0]),Sk.builtin.asnum$(t.v[1])-1,Sk.builtin.asnum$(t.v[2]),Sk.builtin.asnum$(t.v[3]),Sk.builtin.asnum$(t.v[4]),Sk.builtin.asnum$(t.v[5]));return Sk.builtin.assk$(e.getTime()/1e3,void 0)}throw new Sk.builtin.TypeError("mktime() requires a struct_time or 9-tuple")}e.asctime=new Sk.builtin.func(asctime_f),e.ctime=new Sk.builtin.func((function(t){return Sk.builtin.pyCheckArgsLen("ctime",arguments.length,0,1),asctime_f(from_seconds(t))})),e.mktime=new Sk.builtin.func(mktime_f),e.timezone=new Sk.builtin.int_(60*stdTimezoneOffset()),e.altzone=new Sk.builtin.int_(60*function altTimezoneOffset(){var t=new Date(2002,0,1),e=new Date(2002,6,1);return Math.min(t.getTimezoneOffset(),e.getTimezoneOffset())}()),e.daylight=new Sk.builtin.int_(function daylight_check(){const t=new Date(2002,0,1),e=new Date(2002,6,1);return t.getTimezoneOffset()!=e.getTimezoneOffset()}()?1:0),e.tzname=new Sk.builtin.tuple(function timeZoneNames(){var t=new Date(2002,0,1),e=new Date(2002,6,1);return dst(t)?[new Sk.builtin.str(timeZoneName(e)),new Sk.builtin.str(timeZoneName(t))]:[new Sk.builtin.str(timeZoneName(t)),new Sk.builtin.str(timeZoneName(e))]}()),e.accept2dyear=Sk.builtin.assk$(1),e.clock=new Sk.builtin.func((function(){var t=0;return t=Sk.global.performance&&Sk.global.performance.now?performance.now()/1e3:(new Date).getTime()/1e3,new Sk.builtin.float_(t)})),e.strftime=new Sk.builtin.func((function strftime_f(t,e){var i;if(Sk.builtin.pyCheckArgsLen("strftime",arguments.length,1,2),!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("format must be a string");return e?e instanceof n||(e=new n(e)):e=from_seconds(),function check_struct_time(t){if(!(t instanceof n))throw new Sk.builtin.TypeError("Required argument \'struct_time\' must be of type: \'struct_time\'");var e,i=t.v.length,u=t.v;for(e=0;e(r=e.tp$getattr(new Sk.builtin.str("_strptime_time")),r.tp$call(t)))):r.tp$call(t)})),e};',"src/lib/token.js":'var $builtinmodule=function(n){var e={};e.__file__=new Sk.builtin.str("/src/lib/token.py");const t=[];for(let i in Sk.token.tok_name){const n=Sk.token.tok_name[i].slice(2),k=parseInt(i,10);t.push(Sk.ffi.remapToPy(k)),t.push(Sk.ffi.remapToPy(n)),e[n]=Sk.ffi.remapToPy(k)}return e.tok_name=new Sk.builtin.dict(t),e.ISTERMINAL=new Sk.builtin.func((function(n){return Sk.builtin.pyCheckArgsLen("ISTERMINAL",arguments.length,1,1),Sk.token.ISTERMINAL(Sk.ffi.remapToJs(n))})),e.ISNONTERMINAL=new Sk.builtin.func((function(n){return Sk.builtin.pyCheckArgsLen("ISNONTERMINAL",arguments.length,1,1),Sk.token.ISNONTERMINAL(Sk.ffi.remapToJs(n))})),e.ISEOF=new Sk.builtin.func((function(n){return Sk.builtin.pyCheckArgsLen("ISEOF",arguments.length,1,1),Sk.token.ISEOF(Sk.ffi.remapToJs(n))})),e};',"src/lib/tokenize.js":'var $builtinmodule=function(e){var i={};return i.tokenize=new Sk.builtin.func((function(e){Sk.builtin.pyCheckArgsLen("tokenize",1,1),Sk.builtin.checkFunction(e);const i=[];return Sk._tokenize("",(function jsReadline(){const i=Sk.misceval.callsimArray(e);return Sk.ffi.remapToJs(i)}),"UTF-8",(function receiveToken(e){i.push(new Sk.builtin.tuple([Sk.ffi.remapToPy(e.type),Sk.ffi.remapToPy(e.string),new Sk.builtin.tuple([Sk.ffi.remapToPy(e.start[0]),Sk.ffi.remapToPy(e.start[1])]),new Sk.builtin.tuple([Sk.ffi.remapToPy(e.end[0]),Sk.ffi.remapToPy(e.end[1])]),Sk.ffi.remapToPy(e.line)]))})),new Sk.builtin.list(i)})),i};',"src/lib/turtle.js":'var $builtinmodule=function(e){"use strict";var t=function getConfiguredTarget(){var e,t;for(t="string"==typeof(e=Sk.TurtleGraphics&&Sk.TurtleGraphics.target||"turtle")?document.getElementById(e):e;t.firstChild;)t.removeChild(t.firstChild);return t}();return t.turtleInstance?t.turtleInstance.reset():t.turtleInstance=function generateTurtleModule(e){var t,n,r,i,s,a,o,l,u={__name__:new Sk.builtin.str("turtle")},c=!0,h=1e3/30,d={},f={},_={target:"turtle",width:400,height:400,worldWidth:0,worldHeight:0,animate:!0,bufferSize:0,allowUndo:!0,assets:{}};function getAsset(e){var t=i.assets,n="function"==typeof t?t(e):t[e];return"string"==typeof n?new Promise((function(t,r){var s=new Image;s.onload=function(){i.assets[e]=this,t(s)},s.onerror=function(){r(new Error("Missing asset: "+n))},s.src=n})):new InstantPromise(void 0,n)}function InstantPromise(e,t){this.lastResult=t,this.lastError=e}function FrameManager(){this.reset()}function getFrameManager(){return o||(o=new FrameManager),o}function MouseHandler(){var e=this;for(var t in this._target=getTarget(),this._managers={},this._handlers={mousedown:function(t){e.onEvent("mousedown",t)},mouseup:function(t){e.onEvent("mouseup",t)},mousemove:function(t){e.onEvent("mousemove",t)}},this._handlers)this._target.addEventListener(t,this._handlers[t])}function EventManager(e,t){this._type=e,this._target=t,this._handlers=void 0,function getMouseHandler(){return a||(a=new MouseHandler),a}().addManager(e,this)}function Turtle(e){if(getFrameManager().addTurtle(this),this._screen=getScreen(),this._managers={},this._shape=e.v,!d.hasOwnProperty(this._shape))throw new Sk.builtin.ValueError("Shape:\'"+this._shape+"\' not in default shape, please check shape again!");this.reset()}function Screen(){var e,t;this._frames=1,this._delay=void 0,this._bgcolor="none",this._mode="standard",this._managers={},this._keyLogger={},e=(i.worldWidth||i.width||getWidth())/2,t=(i.worldHeight||i.height||getHeight())/2,this.setUpWorld(-e,-t,e,t)}function ensureAnonymous(){return s||(s=Sk.misceval.callsimArray(u.Turtle)),s.instance}function getTarget(){return e}function getScreen(){return r||(r=new Screen),r}function getWidth(){return 0|(r&&r._width||i.width||getTarget().clientWidth||_.width)}function getHeight(){return 0|(r&&r._height||i.height||getTarget().clientHeight||_.height)}function createLayer(e,t){var n,r=document.createElement("canvas"),i=getWidth(),s=getHeight(),a=getTarget().firstChild?-s+"px":"0";return r.width=i,r.height=s,r.style.position="relative",r.style.display="block",r.style.setProperty("margin-top",a),r.style.setProperty("z-index",e),t&&(r.style.display="none"),getTarget().appendChild(r),(n=r.getContext("2d")).lineCap="round",n.lineJoin="round",applyWorld(getScreen(),n),n}function cancelAnimationFrame(){t&&((window.cancelAnimationFrame||window.mozCancelAnimationFrame)(t),t=void 0),n&&(window.clearTimeout(n),n=void 0)}function applyWorld(e,t){var n=e.llx,r=(e.lly,e.urx,e.ury),i=e.xScale,s=e.yScale;t&&(clearLayer(t),t.restore(),t.save(),t.scale(1/i,1/s),t.translate(-n,-r))}function pushUndo(e){var t,n,r;if(i.allowUndo&&e._bufferSize){for(e._undoBuffer||(e._undoBuffer=[]);e._undoBuffer.length>e._bufferSize;)e._undoBuffer.shift();for(n={},t="x y angle radians color fill down filling shown shape size".split(" "),r=0;r=0;)this._turtles[e].reset();this._turtles=[],this._frames=[],this._frameCount=0,this._buffer=1,this._rate=0,this._animationFrame=animationFrame()},e.addFrame=function(e,t){return t&&(this._frameCount+=1),this.frames().push(e),!i.animate||this._buffer&&this._frameCount===this.frameBuffer()?this.update():new InstantPromise},e.frames=function(){return this._frames},e.frameBuffer=function(e){return"number"==typeof e&&(this._buffer=0|e,e&&e<=this._frameCount)?this.update():this._buffer},e.refreshInterval=function(e){return"number"==typeof e&&(this._rate=0|e,this._animationFrame=animationFrame(e)),this._rate},e.update=function(){return this._frames&&this._frames.length?this.requestAnimationFrame():new InstantPromise},e.requestAnimationFrame=function(){var e,t,n=this._frames,r=this._animationFrame,i=this._turtles,s=getScreen().spriteLayer();return this._frames=[],this._frameCount=0,new Promise((function(a){r((function paint(){for(t=0;t=0;)l[a].test(n,r,i,s)&&l[a].canMove("mousedown"===e);if(o&&o.length)for(computeCoordinates(),a=o.length;--a>=0;)("mousemove"===e&&o[a].canMove()&&o[a].test(n,r,i,s)||"mousedown"===e&&o[a].test(n,r,i,s))&&o[a].trigger([i,s])},l.reset=function(){this._managers={}},l.addManager=function(e,t){this._managers[e]||(this._managers[e]=[]),this._managers[e].push(t)},function(e){e.reset=function(){this._handlers=void 0},e.canMove=function(e){return!(!this._target||!this._target.hitTest)&&(void 0!==e&&(this._target.hitTest.hit=e),this._target.hitTest.hit)},e.test=function(e,t,n,r){return this._target&&this._target.hitTest?this._target.hitTest(e,t,n,r):!!this._target},e.trigger=function(e){var t,n=this._handlers;if(n&&n.length)for(t=0;t.5&&e<10.5?Sk.builtin.asnum$(Sk.builtin.round(Sk.builtin.assk$(e))):0,this._speed=e,this._computed_speed=2*e,this.addUpdate(void 0,!1,{speed:this._computed_speed})},e.$speed.minArgs=0,e.$speed.co_varnames=["speed"],e.$pencolor=function(e,t,n,r){return void 0!==e?(this._color=createColor(this._colorMode,e,t,n,r),this.addUpdate(void 0,this._shown,{color:this._color})):hexToRGB(this._color)},e.$pencolor.co_varnames=["r","g","b","a"],e.$pencolor.minArgs=0,e.$pencolor.returnType=f.COLOR,e.$fillcolor=function(e,t,n,r){return void 0!==e?(this._fill=createColor(this._colorMode,e,t,n,r),this.addUpdate(void 0,this._shown,{fill:this._fill})):hexToRGB(this._fill)},e.$fillcolor.co_varnames=["r","g","b","a"],e.$fillcolor.minArgs=0,e.$fillcolor.returnType=f.COLOR,e.$color=function(e,t,n,r){return void 0!==e?(void 0===t||void 0!==n?(this._color=createColor(this._colorMode,e,t,n,r),this._fill=this._color):(this._color=createColor(this._colorMode,e),this._fill=createColor(this._colorMode,t)),this.addUpdate(void 0,this._shown,{color:this._color,fill:this._fill})):[this.$pencolor(),this.$fillcolor()]},e.$color.minArgs=0,e.$color.co_varnames=["color","fill","b","a"],e.$color.returnType=function(e){return new Sk.builtin.tuple([f.COLOR(e[0]),f.COLOR(e[1])])},e.$fill=function(e){if(void 0!==e){if((e=!!e)===this._filling)return;return this._filling=e,e?(pushUndo(this),this.addUpdate(void 0,!1,{filling:!0,fillBuffer:[{x:this._x,y:this._y}]})):(pushUndo(this),this.addUpdate((function(){this.fillBuffer.push(this),drawFill.call(this)}),!0,{filling:!1,fillBuffer:void 0}))}return this._filling},e.$fill.co_varnames=["flag"],e.$fill.minArgs=0,e.$begin_fill=function(){return this.$fill(!0)},e.$end_fill=function(){return this.$fill(!1)},e.$stamp=function(){return pushUndo(this),this.addUpdate((function(){drawTurtle(this,this.context())}),!0)},e.$dot=function(e,t,n,r,i){return pushUndo(this),e="number"==typeof(e=Sk.builtin.asnum$(e))?Math.max(1,0|Math.abs(e)):Math.max(this._size+4,2*this._size),t=void 0!==t?createColor(this._colorMode,t,n,r,i):this._color,this.addUpdate(drawDot,!0,void 0,e,t)},e.$dot.co_varnames=["size","color","g","b","a"],e.$write=function(e,t,n,r){var i,s,a,o,l,u=this;return pushUndo(this),e=String(e),r&&r.constructor===Array&&(s="string"==typeof r[0]?r[0]:"Arial",a=String(r[1]||"12pt"),o="string"==typeof r[2]?r[2]:"normal",/^\\d+$/.test(a)&&(a+="pt"),r=[o,a,s].join(" ")),n||(n="left"),i=this.addUpdate(drawText,!0,void 0,e,n,r),!t||"left"!==n&&"center"!==n||(l=function measureText(e,t){return t&&(p.font=t),p.measureText(e).width}(e,r),"center"===n&&(l/=2),i=i.then((function(){var e=u.getState();return u.translate(e.x,e.y,l,0,!0)}))),i},e.$write.co_varnames=["message","move","align","font"],e.$write.minArgs=1,e.$pensize=e.$width=function(e){return void 0!==e?(this._size=e,this.addUpdate(void 0,this._shown,{size:e})):this._size},e.$pensize.minArgs=e.$width.minArgs=0,e.$pensize.co_varnames=e.$width.co_varnames=["width"],e.$showturtle=e.$st=function(){return this._shown=!0,this.addUpdate(void 0,!0,{shown:!0})},e.$hideturtle=e.$ht=function(){return this._shown=!1,this.addUpdate(void 0,!0,{shown:!1})},e.$isvisible=function(){return this._shown},e.$shape=function(e){return e&&d[e]?(this._shape=e,this.addUpdate(void 0,this._shown,{shape:e})):this._shape},e.$shape.minArgs=0,e.$shape.co_varnames=["name"],e.$window_width=function(){return this._screen.$window_width()},e.$window_height=function(){return this._screen.$window_height()},e.$tracer=function(e,t){return this._screen.$tracer(e,t)},e.$tracer.minArgs=0,e.$tracer.co_varnames=["n","delay"],e.$update=function(){return this._screen.$update()},e.$delay=function(e){return this._screen.$delay(e)},e.$delay.minArgs=0,e.$delay.co_varnames=["delay"],e.$reset=function(){return this.reset(),this.$clear()},e.$mainloop=e.$done=function(){return this._screen.$mainloop()},e.$clear=function(){return this.addUpdate((function(){clearLayer(this.context())}),!0)},e.$dot.minArgs=0,e.$onclick=function(e,t,n){this.getManager("mousedown").addHandler(e,n)},e.$onclick.minArgs=1,e.$onclick.co_varnames=["method","btn","add"],e.$onrelease=function(e,t,n){this.getManager("mouseup").addHandler(e,n)},e.$onrelease.minArgs=1,e.$onrelease.co_varnames=["method","btn","add"],e.$ondrag=function(e,t,n){this.getManager("mousemove").addHandler(e,n)},e.$ondrag.minArgs=1,e.$ondrag.co_varnames=["method","btn","add"],e.$getscreen=function(){return Sk.misceval.callsimArray(u.Screen)},e.$getscreen.isSk=!0,e.$clone=function(){var e=Sk.misceval.callsimOrSuspendArray(u.Turtle);return e.instance._x=this._x,e.instance._y=this._y,e.instance._angle=this._angle,e.instance._radians=this._radians,e.instance._shape=this._shape,e.instance._color=this._color,e.instance._fill=this._fill,e.instance._filling=this._filling,e.instance._size=this._size,e.instance._computed_speed=this._computed_speed,e.instance._down=this._down,e.instance._shown=this._shown,e.instance._colorMode=this._colorMode,e.instance._isRadians=this._isRadians,e.instance._fullCircle=this._fullCircle,e.instance._bufferSize=this._bufferSize,e.instance._undoBuffer=this._undoBuffer,e._clonedFrom=this,e},e.$clone.returnType=function(e){return e},e.$getturtle=e.$getpen=function(){return this.skInstance},e.$getturtle.isSk=!0}(Turtle.prototype),function(e){e.spriteLayer=function(){return this._sprites||(this._sprites=createLayer(3))},e.bgLayer=function(){return this._background||(this._background=createLayer(1))},e.hitTestLayer=function(){return this._hitTest||(this._hitTest=createLayer(0,!0))},e.getManager=function(e){return this._managers[e]||(this._managers[e]=new EventManager(e,this)),this._managers[e]},e.reset=function(){var e;for(e in this._keyListeners=void 0,this._keyLogger)window.clearInterval(this._keyLogger[e]),window.clearTimeout(this._keyLogger[e]),delete this._keyLogger[e];for(e in this._keyDownListener&&(getTarget().removeEventListener("keydown",this._keyDownListener),this._keyDownListener=void 0),this._keyUpListener&&(getTarget().removeEventListener("keyup",this._keyUpListener),this._keyUpListener=void 0),this._timer&&(window.clearTimeout(this._timer),this._timer=void 0),this._managers)this._managers[e].reset();this._mode="standard",removeLayer(this._sprites),this._sprites=void 0,removeLayer(this._background),this._background=void 0},e.setUpWorld=function(e,t,n,r){var i=this;i.llx=e,i.lly=t,i.urx=n,i.ury=r,i.xScale=(n-e)/getWidth(),i.yScale=-1*(r-t)/getHeight(),i.lineScale=Math.min(Math.abs(i.xScale),Math.abs(i.yScale))},e.$setup=function(e,t,n,r){return isNaN(parseFloat(e))&&(e=getWidth()),isNaN(parseFloat(t))&&(t=getHeight()),e<=1&&(e=getWidth()*e),t<=1&&(t=getHeight()*t),this._width=e,this._height=t,this._xOffset=void 0===n||isNaN(parseInt(n))?0:parseInt(n),this._yOffset=void 0===r||isNaN(parseInt(r))?0:parseInt(r),"world"===this._mode?this._setworldcoordinates(this.llx,this.lly,this.urx,this.ury):this._setworldcoordinates(-e/2,-t/2,e/2,t/2)},e.$setup.minArgs=0,e.$setup.co_varnames=["width","height","startx","starty"],e.$register_shape=e.$addshape=function(e,t){if(!t)return getAsset(e).then((function(t){d[e]=t}));d[e]=t},e.$register_shape.minArgs=1,e.$register_shape.co_varnames=["name","shape"],e.$getshapes=function(){return Object.keys(d)},e.$tracer=function(e,t){return void 0!==e||void 0!==t?("number"==typeof t&&(this._delay=t,getFrameManager().refreshInterval(t)),"number"==typeof e?(this._frames=e,getFrameManager().frameBuffer(e)):void 0):this._frames},e.$tracer.co_varnames=["frames","delay"],e.$tracer.minArgs=0,e.$delay=function(e){return void 0!==e?this.$tracer(void 0,e):void 0===this._delay?h:this._delay},e.$delay.co_varnames=["delay"],e._setworldcoordinates=function(e,t,n,r){return getFrameManager().turtles(),this.setUpWorld(e,t,n,r),this._sprites&&applyWorld(this,this._sprites),this._background&&applyWorld(this,this._background),this.$clear()},e.$setworldcoordinates=function(e,t,n,r){return this._mode="world",this._setworldcoordinates(e,t,n,r)},e.$setworldcoordinates.co_varnames=["llx","lly","urx","ury"],e.minArgs=4,e.$clear=e.$clearscreen=function(){return this.reset(),this.$reset()},e.$update=function(){return getFrameManager().update()},e.$reset=e.$resetscreen=function(){var e=this,t=getFrameManager().turtles();return getFrameManager().addFrame((function(){applyWorld(e,e._sprites),applyWorld(e,e._background);for(var n=0;n1&&t[s]&&t[s].test(r),r===a||i){e._keyListeners[r](),e._createKeyRepeater(r,s),n.preventDefault();break}}},getTarget().addEventListener("keydown",this._keyDownListener))},e._createKeyUpListener=function(){var e=this;this._keyUpListener||(this._keyUpListener=function(t){var n=e._keyLogger[t.charCode||t.keyCode];void 0!==n&&(t.preventDefault(),window.clearInterval(n),window.clearTimeout(n),delete e._keyLogger[t.charCode||t.keyCode])},getTarget().addEventListener("keyup",this._keyUpListener))},e.$title=function(e){document.title=e},e.$title.minArgs=1,e.$title.co_varnames=["title"],e.$listen=function(){this._createKeyUpListener(),this._createKeyDownListener()},e.$onkey=function(e,t){if("function"==typeof t){var n=e;e=t,t=n}t=String(t).toLowerCase(),e&&"function"==typeof e?(this._keyListeners||(this._keyListeners={}),this._keyListeners[t]=e):delete this._keyListeners[t]},e.$onkey.minArgs=2,e.$onkey.co_varnames=["method","keyValue"],e.$onscreenclick=function(e,t,n){this.getManager("mousedown").addHandler(e,n)},e.$onscreenclick.minArgs=1,e.$onscreenclick.co_varnames=["method","btn","add"],e.$ontimer=function(e,t){this._timer&&(window.clearTimeout(this._timer),this._timer=void 0),e&&"number"==typeof t&&(this._timer=window.setTimeout(e,Math.max(0,0|t)))},e.$ontimer.minArgs=0,e.$ontimer.co_varnames=["method","interval"]}(Screen.prototype);var g=new Image;function removeLayer(e){e&&e.canvas&&e.canvas.parentNode&&e.canvas.parentNode.removeChild(e.canvas)}function clearLayer(e,t,n){e&&(e.save(),e.setTransform(1,0,0,1,0,0),t?(e.fillStyle=t,e.fillRect(0,0,e.canvas.width,e.canvas.height)):e.clearRect(0,0,e.canvas.width,e.canvas.height),n&&e.drawImage(n,0,0),e.restore())}function drawTurtle(e,t){var n,r,i,s=d[e.shape],a=getScreen(),o=(getWidth(),getHeight(),a.xScale),l=a.yScale;if(t){if(n=Math.cos(e.radians)/o,r=Math.sin(e.radians)/l,i=Math.atan2(r,n)-Math.PI/2,t.save(),t.translate(e.x,e.y),t.scale(o,l),s.nodeName){var u=s.naturalWidth,c=s.naturalHeight;t.drawImage(s,0,0,u,c,-u/2,-c/2,u,c)}else{t.rotate(i),t.beginPath(),t.lineWidth=1,t.strokeStyle=e.color,t.fillStyle=e.fill,t.moveTo(-s[0][0],s[0][1]);for(var h=1;ho)throw u=l===o?"exactly "+o:"between "+l+" and "+o,new Sk.builtin.TypeError(a+"() takes "+u+" positional argument(s) ("+d.length+" given)");for(e=d.length;--e>=0;)void 0!==d[e]&&(d[e]instanceof Sk.builtin.func?d[e]=pythonToJavascriptFunction(d[e]):d[e]instanceof Sk.builtin.method?d[e]=pythonToJavascriptFunction(d[e].im_func,d[e].im_self):d[e]&&d[e].$d instanceof Sk.builtin.dict&&d[e].instance?d[e]=d[e].instance:d[e]=Sk.ffi.remapToJs(d[e]));var _=d.slice(0);for(d=[],e=_.length;e>=0;--e)null!==_[e]&&(d[e]=_[e]);try{t=f[n].apply(f,d)}catch(g){throw window&&window.console&&(window.console.log("wrapped method failed"),window.console.log(g.stack)),g}return t instanceof InstantPromise&&(t=t.lastResult),t instanceof Promise?(t=t.catch((function(e){throw window&&window.console&&(window.console.log("promise failed"),window.console.log(e.stack)),e})),(i=new Sk.misceval.Suspension).resume=function(){return void 0===s?Sk.builtin.none.none$:Sk.ffi.remapToPy(s)},i.data={type:"Sk.promise",promise:t.then((function(e){return s=e,e}))},i):void 0===t?Sk.builtin.none.none$:h?t:"function"==typeof c?c(t):Sk.ffi.remapToPy(t)},i.co_name=new Sk.builtin.str(a),i.co_varnames=u.slice(),i.$defaults=[];for(var d=l;d")})),e.__iter__=new Sk.builtin.func((function(n){var e=n.lineList;return Sk.builtin.makeGenerator((function(){if(!(this.$index>=this.$lines.length))return new Sk.builtin.str(this.$lines[this.$index++])}),{$obj:n,$index:0,$lines:e})})),e.read=new Sk.builtin.func((function(n,e){if(n.closed)throw new Sk.builtin.ValueError("I/O operation on closed file");var i=n.data$.length;void 0===e&&(e=i);var t=new Sk.builtin.str(n.data$.substr(n.pos$,e));return n.pos$+=e,n.pos$>=i&&(n.pos$=i),t})),e.readline=new Sk.builtin.func((function(n,e){var i="";return n.currentLinee===o)).length)throw new i("one of the hex, bytes, bytes_le, fields, or int arguments must be given");if(u!==o){u=u.toString().replace("urn:","").replace("uuid:","");let e=0,i=u.length-1;for(;"{}".indexOf(u[e])>=0;)e++;for(;"{}".indexOf(u[i])>=0;)i--;if(u=u.slice(e,i+1),u=u.replace(S,""),32!==u.length)throw new s("badly formed hexadecimal UUID string");f=d(n,[new t(u),U])}if(c!==o){if(!(c instanceof e))throw new i("bytes_le should be a bytes instance");if(c=c.valueOf(),16!==c.length)throw new s("bytes_le is not a 16-char string");h=switchBytesBytesLe(c),h=new e(h)}if(h!==o){if(!(h instanceof e))throw new i("bytes_le should be a bytes instance");if(16!==h.valueOf().length)throw new s("bytes is not a 16-char string");f=d(w,[h],["byteorder",v])}if(p!==o)throw new r("fields argument is not yet supported");if(f!==o&&(g(f,_,"Lt")||((e,t)=>g(e,t,"GtE"))(f,y)))throw new s("int is out of range (need a 128-bit value)");this.$int=f,this.$isSafe=I},tp$str(){const e=E.nb$remainder(this.$int).toString();return new t(`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20)}`)},$r(){const e=u(this.ob$type,t.$name),n=c(this.tp$str());return new t(`${e}(${n})`)},tp$hash(){return this.$int.tp$hash()},tp$richcompare(e,t){return e instanceof R?this.$int.tp$richcompare(e.$int,t):l},tp$as_number:!0,nb$int(){return this.$int}},getsets:{int:{$get(){return this.$int}},is_safe:{$get(){return this.$isSafe}},bytes:{$get(){return d(b,[this.$int,U,v])}},bytes_le:{$get(){const n=this.tp$getattr(new t("bytes")).valueOf();return new e(switchBytesBytesLe(n))}},fields:{$get:()=>notImplemented()},time_low:{$get:()=>notImplemented()},time_mid:{$get:()=>notImplemented()},time_hi_version:{$get:()=>notImplemented()},clock_seq_hi_variant:{$get:()=>notImplemented()},clock_seq_low:{$get:()=>notImplemented()},time:{$get:()=>notImplemented()},clock_seq:{$get:()=>notImplemented()},node:{$get:()=>notImplemented()},hex:{$get(){return E.nb$remainder(this.$int)}},urn:{$get(){return new t(`urn:uuid:${this}`)}},variant:{$get:()=>notImplemented()},version:{$get:()=>notImplemented()}}});return h("uuid",p,{uuid1:{$meth(){notImplemented()},$flags:{FastCall:!0}},uuid2:{$meth(){notImplemented()},$flags:{FastCall:!0}},uuid3:{$meth(){notImplemented()},$flags:{FastCall:!0}},uuid4:{$meth(){const t=new e(f.getRandomValues(new Uint8Array(16)));return d(R,[],["bytes",t,"version",I])},$flags:{NoArgs:!0}},uuid5:{$meth(){notImplemented()},$flags:{FastCall:!0}}}),p}',"src/lib/webbrowser.js":'var $builtinmodule=function(n){var e={},t="undefined"!=typeof window&&"undefined"!=typeof window.navigator;function open_tab(n){return Sk.builtin.pyCheckType("url","string",Sk.builtin.checkString(n)),t?(n=n.$jsstr(),window.open(n,"_blank"),Sk.builtin.bool.true$):Sk.builtin.bool.false$}return e.__name__=new Sk.builtin.str("webbrowser"),e.open=new Sk.builtin.func((function open(n){return Sk.builtin.pyCheckArgsLen("open",arguments.length+1,1,3),open_tab(n)})),e.open_new=new Sk.builtin.func((function open_new(n){return Sk.builtin.pyCheckArgsLen("open_new",arguments.length,1,1),open_tab(n)})),e.open_new_tab=new Sk.builtin.func((function open_new_tab(n){return Sk.builtin.pyCheckArgsLen("open_new_tab",arguments.length,1,1),open_tab(n)})),e.DefaultBrowser=Sk.misceval.buildClass(e,(function dflbrowser(n,e){e.__init__=new Sk.builtin.func((function __init__(n){return Sk.builtin.none.none$})),e.open=new Sk.builtin.func((function open(n,e){return Sk.builtin.pyCheckArgsLen("open",arguments.length,2,4),open_tab(e)})),e.open_new=new Sk.builtin.func((function open_new(n,e){return Sk.builtin.pyCheckArgsLen("open_new",arguments.length,2,2),open_tab(e)})),e.open_new_tab=new Sk.builtin.func((function open_new_tab(n,e){return Sk.builtin.pyCheckArgsLen("open_new_tab",arguments.length,2,2),open_tab(e)}))}),"DefaultBrowser",[]),e.get=new Sk.builtin.func((function get(){return Sk.builtin.pyCheckArgsLen("get",arguments.length,0,1),Sk.misceval.callsimArray(e.DefaultBrowser,[])})),e};',"src/lib/webgl/math.js":'var $builtinmodule=function(e){var n={};return n.Mat44=Sk.misceval.buildClass(n,(function(e,t){t.__init__=new Sk.builtin.func((function(e){Sk.misceval.callsimArray(t.loadIdentity,[e]),e.stack=[]})),t.push=new Sk.builtin.func((function(e){e.stack.push(e.elements.slice(0))})),t.pop=new Sk.builtin.func((function(e){e.elements=e.stack.pop()})),t.loadIdentity=new Sk.builtin.func((function(e){e.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]})),t.transform3=new Sk.builtin.func((function(e,t){var l=e.elements;return Sk.misceval.callsimArray(n.Vec3,[l[0]*t.x+l[4]*t.y+l[8]*t.z,l[1]*t.x+l[5]*t.y+l[9]*t.z,l[2]*t.x+l[6]*t.y+l[10]*t.z])})),t.scale=new Sk.builtin.func((function(e,n,t,l){return e.elements[0]*=n,e.elements[1]*=n,e.elements[2]*=n,e.elements[3]*=n,e.elements[4]*=t,e.elements[5]*=t,e.elements[6]*=t,e.elements[7]*=t,e.elements[8]*=l,e.elements[9]*=l,e.elements[10]*=l,e.elements[11]*=l,e})),t.translate=new Sk.builtin.func((function(e,n,t,l){return e.elements[12]+=e.elements[0]*n+e.elements[4]*t+e.elements[8]*l,e.elements[13]+=e.elements[1]*n+e.elements[5]*t+e.elements[9]*l,e.elements[14]+=e.elements[2]*n+e.elements[6]*t+e.elements[10]*l,e.elements[15]+=e.elements[3]*n+e.elements[7]*t+e.elements[11]*l,e})),t.rotate=new Sk.builtin.func((function(e,t,l,s,m){var i,a,c,u,r,f,o,k,S,y,b,v=Math.sqrt(l*l+s*s+m*m),_=Math.sin(t*Math.PI/180),w=Math.cos(t*Math.PI/180);v>0&&(i=(l/=v)*l,a=(s/=v)*s,c=(m/=v)*m,u=l*s,r=s*m,f=m*l,o=l*_,k=s*_,S=m*_,y=1-w,(b=Sk.misceval.callsimArray(n.Mat44)).elements[0]=y*i+w,b.elements[1]=y*u-S,b.elements[2]=y*f+k,b.elements[3]=0,b.elements[4]=y*u+S,b.elements[5]=y*a+w,b.elements[6]=y*r-o,b.elements[7]=0,b.elements[8]=y*f-k,b.elements[9]=y*r+o,b.elements[10]=y*c+w,b.elements[11]=0,b.elements[12]=0,b.elements[13]=0,b.elements[14]=0,b.elements[15]=1,b=b.multiply(e),e.elements=b.elements);return e})),t.multiply=new Sk.builtin.func((function(e,t){for(var l=Sk.misceval.callsimArray(n.Mat44),s=0;s<4;s++)l.elements[4*s+0]=e.elements[4*s+0]*t.elements[0]+e.elements[4*s+1]*t.elements[4]+e.elements[4*s+2]*t.elements[8]+e.elements[4*s+3]*t.elements[12],l.elements[4*s+1]=e.elements[4*s+0]*t.elements[1]+e.elements[4*s+1]*t.elements[5]+e.elements[4*s+2]*t.elements[9]+e.elements[4*s+3]*t.elements[13],l.elements[4*s+2]=e.elements[4*s+0]*t.elements[2]+e.elements[4*s+1]*t.elements[6]+e.elements[4*s+2]*t.elements[10]+e.elements[4*s+3]*t.elements[14],l.elements[4*s+3]=e.elements[4*s+0]*t.elements[3]+e.elements[4*s+1]*t.elements[7]+e.elements[4*s+2]*t.elements[11]+e.elements[4*s+3]*t.elements[15];return e.elements=l.elements,e})),t.lookAt=new Sk.builtin.func((function(e,t,l,s,m,i,a,c,u,r){var f=[t-m,l-i,s-a],o=Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]);o&&(f[0]/=o,f[1]/=o,f[2]/=o);var k=[c,u,r],S=[];S[0]=k[1]*f[2]-k[2]*f[1],S[1]=-k[0]*f[2]+k[2]*f[0],S[2]=k[0]*f[1]-k[1]*f[0],k[0]=f[1]*S[2]-f[2]*S[1],k[1]=-f[0]*S[2]+f[2]*S[0],k[2]=f[0]*S[1]-f[1]*S[0],(o=Math.sqrt(S[0]*S[0]+S[1]*S[1]+S[2]*S[2]))&&(S[0]/=o,S[1]/=o,S[2]/=o),(o=Math.sqrt(k[0]*k[0]+k[1]*k[1]+k[2]*k[2]))&&(k[0]/=o,k[1]/=o,k[2]/=o);var y=Sk.misceval.callsimArray(n.Mat44);return y.elements[0]=S[0],y.elements[4]=S[1],y.elements[8]=S[2],y.elements[12]=0,y.elements[1]=k[0],y.elements[5]=k[1],y.elements[9]=k[2],y.elements[13]=0,y.elements[2]=f[0],y.elements[6]=f[1],y.elements[10]=f[2],y.elements[14]=0,y.elements[3]=0,y.elements[7]=0,y.elements[11]=0,y.elements[15]=1,y=y.multiply(e),e.elements=y.elements,e.translate(-t,-l,-s),e}))}),"Mat44",[]),n.Mat33=Sk.misceval.buildClass(n,(function(e,n){n.__init__=new Sk.builtin.func((function(e){Sk.misceval.callsimArray(n.loadIdentity,[e])})),n.loadIdentity=new Sk.builtin.func((function(e){e.elements=[1,0,0,0,1,0,0,0,1]}))}),"Mat33",[]),n.Vec3=Sk.misceval.buildClass(n,(function(e,t){t.__init__=new Sk.builtin.func((function(e,n,t,l){e.x=n,e.y=t,e.z=l})),t.__sub__=new Sk.builtin.func((function(e,t){return Sk.misceval.callsimArray(n.Vec3,[e.x-t.x,e.y-t.y,e.z-t.z])}))}),"Vec3",[]),n.cross=new Sk.builtin.func((function(e,t){return Sk.asserts.assert(e instanceof n.Vec3&&t instanceof n.Vec3),Sk.misceval.callsimArray(n.Vec3,[e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z,e.x*t.y-e.y*t.x])})),n};',"src/lib/webgl/matrix4.js":"var $builtinmodule=function(n){var r={},t=new Float32Array(3),a=new Float32Array(3),u=new Float32Array(3),e=(new Float32Array(4),new Float32Array(4),new Float32Array(4),new Float32Array(16),new Float32Array(16),new Float32Array(16),function(n,r){for(var t=0,a=r.length,u=0;u1e-5)for(u=0;u{const n=e.$d;var r={},Buffer=function(t,e){var r=e||n.ARRAY_BUFFER,i=n.createBuffer();if(this.target=r,this.buf=i,this.set(t),this.numComponents_=t.numComponents,this.numElements_=t.numElements,this.totalComponents_=this.numComponents_*this.numElements_,t.buffer instanceof Float32Array)this.type_=n.FLOAT;else if(t.buffer instanceof Uint8Array)this.type_=n.UNSIGNED_BYTE;else if(t.buffer instanceof Int8Array)this.type_=n._BYTE;else if(t.buffer instanceof Uint16Array)this.type_=n.UNSIGNED_SHORT;else{if(!(t.buffer instanceof Int16Array))throw"unhandled type:"+typeof t.buffer;this.type_=n.SHORT}};return Buffer.prototype.set=function(t){n.bindBuffer(this.target,this.buf),n.bufferData(this.target,t.buffer,n.STATIC_DRAW)},Buffer.prototype.type=function(){return this.type_},Buffer.prototype.numComponents=function(){return this.numComponents_},Buffer.prototype.numElements=function(){return this.numElements_},Buffer.prototype.totalComponents=function(){return this.totalComponents_},Buffer.prototype.buffer=function(){return this.buf},Buffer.prototype.stride=function(){return 0},Buffer.prototype.offset=function(){return 0},r.Model=Sk.misceval.buildClass(r,(function(e,r){r.__init__=new Sk.builtin.func((function(e,r,i,f){e.buffers={};var setBuffer=function(t,r){var i="indices"==t?n.ELEMENT_ARRAY_BUFFER:n.ARRAY_BUFFER;let f=e.buffers[t];f?f.set(r):f=new Buffer(r,i),e.buffers[t]=f};for(t in i)setBuffer(t,i[t]);var o={},s=0;for(var u in f)o[u]=s++;e.mode=n.TRIANGLES,e.textures=f.v,e.textureUnits=o,e.shader=r})),r.drawPrep=new Sk.builtin.func((function(t,e){var r=t.shader,i=t.buffers,f=t.textures;for(var o in e=Sk.ffi.remapToJs(e),Sk.misceval.callsimArray(r.use,[r]),i){var s=i[o];if("indices"==o)n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,s.buffer());else{var u=r.attrib[o];u&&u(s)}}for(var a in f){var m=t.textureUnits[a];r.setUniform$impl(r,f,m),f[a].bindToUnit(m)}for(var p in e)r.setUniform$impl(r,p,e[p])})),r.draw=new Sk.builtin.func((function(t,e,r){var i=t.shader;e=Sk.ffi.remapToJs(e);for(let n in e)i.setUniform$impl(i,n,e[n]);if(r)for(var f in r){var o=t.textureUnits[f];i.setUniform$impl(i,f,o),r[f].bindToUnit(o)}var s=t.buffers;n.drawElements(t.mode,s.indices.totalComponents(),n.UNSIGNED_SHORT,0)}))}),"Model",[]),r}))};',"src/lib/webgl/primitives.js":'var $builtinmodule=function(t){var n={},AttribBuffer=function(t,n,e){e=e||"Float32Array";var r=window[e];n.length?(this.buffer=new r(n),n=this.buffer.length/t,this.cursor=n):(this.buffer=new r(t*n),this.cursor=0),this.numComponents=t,this.numElements=n,this.type=e};return AttribBuffer.prototype.stride=function(){return 0},AttribBuffer.prototype.offset=function(){return 0},AttribBuffer.prototype.getElement=function(t){for(var n=t*this.numComponents,e=[],r=0;r
\'+n+"
"},e=\'This page requires a browser that supports WebGL.
Click here to upgrade your browser.\';return t.Context=Sk.misceval.buildClass(t,(function(n,t){t.__init__=new Sk.builtin.func((function(n,t){var i=document.getElementById(t.v),r=function(n,t){var i=document.getElementById(n);if(t||(t=i.getElementsByTagName("canvas")[0]),t){var r=function(n){for(var t=["webgl","experimental-webgl","webkit-3d","moz-webgl"],e=null,i=0;i7||7==a.Chrome[0]&&a.Chrome[1]>0||7==a.Chrome[0]&&0==a.Chrome[1]&&a.Chrome[2]>=521)?i.innerHTML=makeFailHTML(\'It doesn\\\'t appear your computer can support WebGL.
Click here for more information.\'):i.innerHTML=makeFailHTML(e)}return r}i.innerHTML=makeFailHTML(e)}(t.v,i);if(!r)throw new Error("Your browser does not appear to support WebGL.");for(var u in n.gl=r,r.__proto__)if("number"==typeof r.__proto__[u])Sk.abstr.objectSetItem(n.$d,new Sk.builtin.str(u),r.__proto__[u]);else if("function"==typeof r.__proto__[u])switch(u){case"bufferData":case"clearColor":case"drawArrays":case"getAttribLocation":case"getUniformLocation":case"shaderSource":case"uniformMatrix4fv":case"vertexAttribPointer":case"viewport":break;default:!function(t){Sk.abstr.objectSetItem(n.$d,new Sk.builtin.str(u),new Sk.builtin.func((function(){return r.__proto__[t].apply(r,arguments)})))}(u)}r.clearColor(100/255,149/255,237/255,1),r.clear(r.COLOR_BUFFER_BIT)})),t.tp$getattr=Sk.generic.getAttr,t.bufferData=new Sk.builtin.func((function(n,t,e,i){n.gl.bufferData(t,e.v,i)})),t.clearColor=new Sk.builtin.func((function(n,t,e,i,r){n.gl.clearColor(Sk.builtin.asnum$(t),Sk.builtin.asnum$(e),Sk.builtin.asnum$(i),Sk.builtin.asnum$(r))})),t.getAttribLocation=new Sk.builtin.func((function(n,t,e){return n.gl.getAttribLocation(t,e.v)})),t.getUniformLocation=new Sk.builtin.func((function(n,t,e){return n.gl.getUniformLocation(t,e.v)})),t.shaderSource=new Sk.builtin.func((function(n,t,e){n.gl.shaderSource(t,e.v)})),t.drawArrays=new Sk.builtin.func((function(n,t,e,i){n.gl.drawArrays(Sk.builtin.asnum$(t),Sk.builtin.asnum$(e),Sk.builtin.asnum$(i))})),t.vertexAttribPointer=new Sk.builtin.func((function(n,t,e,i,r,u,a){n.gl.vertexAttribPointer(t,Sk.builtin.asnum$(e),Sk.builtin.asnum$(i),r,Sk.builtin.asnum$(u),Sk.builtin.asnum$(a))})),t.viewport=new Sk.builtin.func((function(n,t,e,i,r){n.gl.viewport(Sk.builtin.asnum$(t),Sk.builtin.asnum$(e),Sk.builtin.asnum$(i),Sk.builtin.asnum$(r))})),t.uniformMatrix4fv=new Sk.builtin.func((function(n,t,e,i){n.gl.uniformMatrix4fv(Sk.builtin.asnum$(t),e,i.v)})),t.setDrawFunc=new Sk.builtin.func((function(n,t){var e=(new Date).getTime();setInterval((function(){Sk.misceval.callsimArray(t,[n,(new Date).getTime()-e])}),1e3/60)}))}),"Context",[]),t.Float32Array=Sk.misceval.buildClass(t,(function(n,t){t.__init__=new Sk.builtin.func((function(n,t){n.v="number"==typeof t?new Float32Array(t):new Float32Array(Sk.ffi.remapToJs(t))})),t.__repr__=new Sk.builtin.func((function(n){for(var t=[],e=0;e(z=e.$d,O)),(e=>{O=e.$d}));return S(L,(()=>{function _strftime(e){return t=>e.$strftime(t).toString().toLowerCase()}function _strftime_timetuple(e,t){return O.strftime.tp$call([new i(e),t]).toString().toLowerCase()}const l=new i("fromordinal");function _struct_time(t){return O.struct_time.tp$call([new s(t.map((t=>new e(t))))])}function _localized_month(){const e=[()=>""];for(let t=0;t<12;t++){const i=new k(2001,t+1,1);e.push(_strftime(i))}return e}function _localized_day(){const e=[];for(let t=0;t<7;t++){const i=new k(2001,1,t+1);e.push(_strftime(i))}return e}const S={__name__:new i("_strptime")},k=z.date,L=z.timedelta,E=z.timezone;function _getlang(){return[t,t]}class LocaleTime{constructor(){this.lang=_getlang(),this.__calc_weekday(),this.__calc_month(),this.__calc_am_pm(),this.__calc_timezone(),this.__calc_date_time()}__calc_weekday(){this.a_weekday=_localized_day().map((e=>e("%a"))),this.f_weekday=_localized_day().map((e=>e("%A")))}__calc_month(){this.a_month=_localized_month().map((e=>e("%b"))),this.f_month=_localized_month().map((e=>e("%B")))}__calc_am_pm(){const e=[];[1,22].forEach((t=>{const i=_strftime_timetuple("%p",_struct_time([1999,3,17,t,44,55,2,76,0]));e.push(i)})),this.am_pm=e}__calc_date_time(){const e=_struct_time([1999,3,17,22,44,55,2,76,0]),i=[t,t,t];i[0]=_strftime_timetuple("%c",e),i[1]=_strftime_timetuple("%x",e),i[2]=_strftime_timetuple("%X",e);const s=[["%","%%"],[this.f_weekday[2],"%A"],[this.f_month[3],"%B"],[this.a_weekday[2],"%a"],[this.a_month[3],"%b"],[this.am_pm[1],"%p"],["1999","%Y"],["99","%y"],["22","%H"],["44","%M"],["55","%S"],["76","%j"],["17","%d"],["03","%m"],["3","%m"],["2","%w"],["10","%I"]];s.push(...this.timezone.flat().map((e=>[e,"%Z"]))),[[0,"%c"],[1,"%x"],[2,"%X"]].forEach((([e,t])=>{let n=i[e];s.forEach((([e,t])=>{e&&(n=n.replace(e,t))}));let a;a=_strftime_timetuple(t,_struct_time([1999,1,3,1,1,1,6,3,0])).includes("00")?"%W":"%U",i[e]=n.replace("11",a)})),this.LC_date_time=i[0],this.LC_date=i[1],this.LC_time=i[2]}__calc_timezone(){try{O.tzset.tp$call([])}catch{}this.tzname=O.tzname.v.map((e=>e.toString())),this.daylight=w(O.daylight);const e=[this.tzname[0].toLowerCase(),"utc","gmt"];let t;t=this.daylight?[this.tzname[1].toLowerCase()]:[],this.timezone=[e,t]}}class TimeRE{constructor(e=null){this.locale_time=e||new LocaleTime,Object.assign(this,{d:"(?3[0-1]|[1-2]\\\\d|0[1-9]|[1-9]| [1-9])",f:"(?[0-9]{1,6})",H:"(?2[0-3]|[0-1]\\\\d|\\\\d)",I:"(?1[0-2]|0[1-9]|[1-9])",G:"(?\\\\d\\\\d\\\\d\\\\d)",j:"(?36[0-6]|3[0-5]\\\\d|[1-2]\\\\d\\\\d|0[1-9]\\\\d|00[1-9]|[1-9]\\\\d|0[1-9]|[1-9])",m:"(?1[0-2]|0[1-9]|[1-9])",M:"(?[0-5]\\\\d|\\\\d)",S:"(?6[0-1]|[0-5]\\\\d|\\\\d)",U:"(?5[0-3]|[0-4]\\\\d|\\\\d)",w:"(?[0-6])",u:"(?[1-7])",V:"(?5[0-3]|0[1-9]|[1-4]\\\\d|\\\\d)",y:"(?\\\\d\\\\d)",Y:"(?\\\\d\\\\d\\\\d\\\\d)",z:"(?[+-]\\\\d\\\\d:?[0-5]\\\\d(:?[0-5]\\\\d(\\\\.\\\\d{1,6})?)?|Z)",A:this.__seqToRE(this.locale_time.f_weekday,"A"),a:this.__seqToRE(this.locale_time.a_weekday,"a"),B:this.__seqToRE(this.locale_time.f_month.slice(1),"B"),b:this.__seqToRE(this.locale_time.a_month.slice(1),"b"),p:this.__seqToRE(this.locale_time.am_pm,"p"),Z:this.__seqToRE(this.locale_time.timezone.flat(),"Z"),"%":"%"}),this.W=this.U.replace("U","W"),this.x=this.pattern(this.locale_time.LC_date),this.X=this.pattern(this.locale_time.LC_time),this.c=this.pattern(this.locale_time.LC_date_time)}__seqToRE(e,t){if((e=e.slice(0).sort(((e,t)=>t.length-e.length))).every((e=>""===e)))return"";return`(?<${t}>${e.map((e=>e)).join("|")})`}pattern(e){let t="";for(e=(e=e.replace(b,"\\\\$1")).replace(v,"\\\\s+");e.includes("%");){const i=e.indexOf("%")+1,s=this[e[i]];if(void 0===s)throw new h(e[i]);t=`${t}${e.slice(0,i-1)}${s}`,e=e.slice(i+1)}return t+e}compile(e){return new RegExp("^"+this.pattern(e),"i")}}let C=new TimeRE;const T=5;let A={};function _strptime(i,s="%a %b %d %H:%M:%S %Y"){function _checkString(e,t){if("string"!=typeof e&&!u(e))throw new m(`strptime() argument ${t} must be a str, not \'${o(e)}\'`)}_checkString(i,0),_checkString(s,1),i=i.toString(),s=s.toString();let n,_=C.locale_time;if(Object.keys(A).length>T&&(A={}),n=A[s],void 0===n)try{n=C.compile(s)}catch(V){if(V instanceof h){let e=V.args.v[0];throw"\\\\"==e&&(e="%"),new d(`\'${e}\' is a bad directive in format \'${s}\'`)}if(V instanceof f)throw new d("stray %% in format \'"+s+"\'");throw V}const c=i.match(n);if(null===c)throw new d(`time data \'${i}\' does not match format \'${s}\'`);if(i.length!==c[0].length)throw new d(`unconverted data remains: ${i.slice(c[0].length)}`);let w=t,p=t,g=1,$=1,y=0,S=0,b=0,v=0,z=-1,L=t,E=0,I=t,M=t,H=t,Y=t,j=t,U=c.groups||{};if(Object.keys(U).forEach((e=>{if(void 0!==U[e])if("y"===e)p=_as_integer(U.y),p+=p<=68?2e3:1900;else if("Y"===e)p=_as_integer(U.Y);else if("G"===e)w=_as_integer(U.G);else if("m"===e)g=_as_integer(U.m);else if("B"===e)g=_.f_month.indexOf(U.B.toLowerCase());else if("b"===e)g=_.a_month.indexOf(U.b.toLowerCase());else if("d"===e)$=_as_integer(U.d);else if("H"===e)y=_as_integer(U.H);else if("H"===e)y=_as_integer(U.H);else if("I"===e){y=_as_integer(U.I);const e=(U.p||"").toLowerCase();["",_.am_pm[0]].includes(e)?12===y&&(y=0):e===_.am_pm[1]&&12!==y&&(y+=12)}else if("M"===e)S=_as_integer(U.M);else if("S"===e)b=_as_integer(U.S);else if("f"===e){let e=U.f;e+="0".repeat(6-e.length),v=_as_integer(e)}else if("A"===e)Y=_.f_weekday.indexOf(U.A.toLowerCase());else if("a"===e)Y=_.a_weekday.indexOf(U.a.toLowerCase());else if("w"===e)Y=_as_integer(U.w),0===Y?Y=6:Y-=1;else if("u"===e)Y=_as_integer(U.u),Y-=1;else if("j"===e)j=_as_integer(U.j);else if(["U","W"].includes(e))M=_as_integer(U[e]),H="U"===e?6:0;else if("V"===e)I=_as_integer(U.V);else if("z"===e){let e=U.z;if("Z"===e)L=0;else{if(":"===e[3]&&(e=e.slice(0,3)+e.slice(4),e.length>5)){if(":"!==e[5]){const e=`Inconsistent use of : in ${U.z}`;throw new d(e)}e=e.slice(0,5)+e.slice(6)}const t=_as_integer(e.slice(1,3)),i=_as_integer(e.slice(3,5)),s=_as_integer(e.slice(5,7)||0);L=3600*t+60*i+s;const n=e.slice(8),a="0".repeat(6-n.length);E=_as_integer(n+a),e.startsWith("-")&&(L=-L,E=-E)}}else if("Z"===e){let e=U.Z.toLowerCase(),t=0;for(let i of _.timezone){if(i.includes(e)){const i=O.tzname.v;if(r(i[0],i[1],"Eq")&&a(O.daylight)&&!["utc","gmt"].includes(e))break;z=t}t++}}})),p===t&&w!==t){if(I===t||Y===t)throw new d("ISO year directive \'%G\' must be used with the ISO week directive \'%V\' and a weekday directive (\'%A\',\'%a\', \'%w\', or \'%u\').");if(j!==t)throw new d("Day of the year directive \'%j\' is not compatible with ISO year directive \'%G\'.Use \'%Y\' instead.")}else if(M===t&&I!==t)throw new d(Y===t?"ISO week directive \'%V\' must be used with the ISO year directive \'%G\' and a weekday directive (\'%A\', \'%a\', \'%w\', or \'%u\').":"ISO week directive \'%V\' is incompatible with the year directive \'%Y\'. Use the ISO year \'%G\' instead.");let x=!1;if(p===t&&2===g&&29===$?(p=1904,x=!0):p===t&&(p=1900),j===t&&Y!==t){if(M!==t){j=function _calc_julian_from_U_or_W(e,t,i,s){let n=(new k(e,1,1).$toOrdinal()+6)%7;return s||(n=(n+1)%7,i=(i+1)%7),0===t?1+i-n:(7-n)%7+7*(t-1)+1+i}(p,M,Y,0===H)}else w!==t&&I!==t&&([p,j]=function _calc_julian_from_V(e,t,i){let s=7*t+i-((new k(e,1,4).$toOrdinal()%7||7)+3);return s<1&&(s+=new k(e,1,1).$toOrdinal(),s-=new k(e-=1,1,1).$toOrdinal()),[e,s]}(w,I,Y+1));if(j!==t&&j<=0){p-=1;const e=function _is_leap(e){return e%4==0&&(e%100!=0||e%400==0)}(p)?366:365;j+=e}}if(j===t)j=new k(p,g,$).$toOrdinal()-new k(p,1,1).$toOrdinal()+1;else{const t=function _fromordinal(t){return k.tp$getattr(l).tp$call([new e(t)])}(j-1+new k(p,1,1).$toOrdinal());p=t.$year,g=t.$month,$=t.$day}Y===t&&(Y=(new k(p,g,$).$toOrdinal()+6)%7);const R=U.Z||t;return x&&(p=1900),[[p,g,$,y,S,b,Y,j,z,R,L],v,E]}return _("_strptime",S,{_strptime_time:{$meth:function _strptime_time(t,i="%a %b %d %H:%M:%S %Y"){let n=_strptime(t,i)[0].slice(0,11);return n=n.map(((t,i)=>i<9?new e(t):p(t))),O.struct_time.tp$call([new s(n)])},$flags:{NamedArgs:["data_string","format"],Defaults:["%a %b %d %H:%M:%S %Y"]}},_strptime_datetime:{$meth:function _strptime_datetime(s,r,l="%a %b %d %H:%M:%S %Y"){const[o,_,c]=_strptime(r,l),[m,d]=o.slice(-2),h=o.slice(0,6);let f,u;return h.push(_),h.map((t=>new e(t))),d!==t&&(f=new L(0,d,c),u=a(m)?new E(f,new i(m)):new E(f),h.push(u)),n(s,h)},$flags:{NamedArgs:["cls","data_string","format"],Defaults:["%a %b %d %H:%M:%S %Y"]}},_strptime:{$meth(i,n){const a=_strptime(i,n);return a[0]=new s(a[0].map((i=>i===t?i:new e(i)))),a[1]=new e(a[1]),a[2]=new e(a[2]),new s(a)},$flags:{NamedArgs:["data_string","format"],Defaults:["%a %b %d %H:%M:%S %Y"]}},_getlang:{$meth:()=>p(_getlang()),$flags:{NoArgs:!0}}}),S.LocaleTime=c("_strptime.LocaleTime",{constructor:function(){this.v=new LocaleTime},slots:{tp$getattr(e,t){return this.v.hasOwnProperty(e.toString())?p(this.v[e.toString()]):$.call(this,e,t)},tp$setattr(e,t){if(!this.v.hasOwnProperty(e.toString()))return y.call(this,e,t);this.v[e.toString()]=g(t)}}}),S}))}'}}},312:function(t,e,n){(function(){"use strict";var t=t||{};t.scope={},t.ASSUME_ES5=!1,t.ASSUME_NO_NATIVE_MAP=!1,t.ASSUME_NO_NATIVE_SET=!1,t.SIMPLE_FROUND_POLYFILL=!1,t.ISOLATE_POLYFILLS=!1,t.FORCE_POLYFILL_PROMISE=!1,t.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,t.defineProperty=t.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){return t==Array.prototype||t==Object.prototype||(t[e]=n.value),t},t.getGlobal=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof n.g&&n.g];for(var e=0;e(e=e||0)&&(e=Math.max(e+i,0));e{Sk.abstr.setUpSlots(t),Sk.abstr.setUpMethods(t),Sk.abstr.setUpGetSets(t),Sk.abstr.setUpClassMethods(t)})),n(19),n(20),n(21),[Sk.builtin.str,Sk.builtin.none,Sk.builtin.NotImplemented,Sk.builtin.object].forEach((t=>{(t=t.prototype).__doc__=t.hasOwnProperty("tp$doc")?new Sk.builtin.str(t.tp$doc):Sk.builtin.none.none$})),n(22),n(23),n(24),n(25),n(26),n(27),n(28),n(29),n(31),n(32),n(33),n(34),n(35),n(36),n(37),n(38),n(39),n(40),n(41),n(42),n(43),n(44),n(45),n(46),n(47),n(48),n(49),n(50),n(51),n(52),n(53),n(66),n(54),n(55),n(56),n(57),n(58),n(59),n(60),n(61),n(62),n(63),n(64),n(65)},function(t,e,n){(function(t){var e={build:{githash:"1d6da87991edd93117a53858367c32f27d77b396",date:"2023-09-01T06:58:47.589Z"}};e.global=void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e.exportSymbol=function(t,n){t=t.split(".");var i,s=e.global;for(i=0;i=t||0===e||4<=e)return"th";switch(e){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function o(t){"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t)}var a={de_DE:{identifier:"de-DE",days:"Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag".split(" "),shortDays:"So Mo Di Mi Do Fr Sa".split(" "),months:"Januar Februar März April Mai Juni Juli August September Oktober November Dezember".split(" "),shortMonths:"Jan Feb Mär Apr Mai Jun Jul Aug Sep Okt Nov Dez".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d.%m.%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},en_CA:{identifier:"en-CA",days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),ordinalSuffixes:"st nd rd th th th th th th th th th th th th th th th th th st nd rd th th th th th th th st".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},en_US:{identifier:"en-US",days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),ordinalSuffixes:"st nd rd th th th th th th th th th th th th th th th th th st nd rd th th th th th th th st".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%m/%d/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},es_MX:{identifier:"es-MX",days:"domingo lunes martes miércoles jueves viernes sábado".split(" "),shortDays:"dom lun mar mié jue vie sáb".split(" "),months:"enero febrero marzo abril mayo junio julio agosto septiembre octubre noviembre diciembre".split(" "),shortMonths:"ene feb mar abr may jun jul ago sep oct nov dic".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},fr_FR:{identifier:"fr-FR",days:"dimanche lundi mardi mercredi jeudi vendredi samedi".split(" "),shortDays:"dim. lun. mar. mer. jeu. ven. sam.".split(" "),months:"janvier février mars avril mai juin juillet août septembre octobre novembre décembre".split(" "),shortMonths:"janv. févr. mars avril mai juin juil. août sept. oct. nov. déc.".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},it_IT:{identifier:"it-IT",days:"domenica lunedì martedì mercoledì giovedì venerdì sabato".split(" "),shortDays:"dom lun mar mer gio ven sab".split(" "),months:"gennaio febbraio marzo aprile maggio giugno luglio agosto settembre ottobre novembre dicembre".split(" "),shortMonths:"gen feb mar apr mag giu lug ago set ott nov dic".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},nl_NL:{identifier:"nl-NL",days:"zondag maandag dinsdag woensdag donderdag vrijdag zaterdag".split(" "),shortDays:"zo ma di wo do vr za".split(" "),months:"januari februari maart april mei juni juli augustus september oktober november december".split(" "),shortMonths:"jan feb mrt apr mei jun jul aug sep okt nov dec".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},pt_BR:{identifier:"pt-BR",days:"domingo segunda terça quarta quinta sexta sábado".split(" "),shortDays:"Dom Seg Ter Qua Qui Sex Sáb".split(" "),months:"janeiro fevereiro março abril maio junho julho agosto setembro outubro novembro dezembro".split(" "),shortMonths:"Jan Fev Mar Abr Mai Jun Jul Ago Set Out Nov Dez".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},ru_RU:{identifier:"ru-RU",days:"Воскресенье Понедельник Вторник Среда Четверг Пятница Суббота".split(" "),shortDays:"Вс Пн Вт Ср Чт Пт Сб".split(" "),months:"Январь Февраль Март Апрель Май Июнь Июль Август Сентябрь Октябрь Ноябрь Декабрь".split(" "),shortMonths:"янв фев мар апр май июн июл авг сен окт ноя дек".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X",D:"%d.%m.%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},tr_TR:{identifier:"tr-TR",days:"Pazar Pazartesi Salı Çarşamba Perşembe Cuma Cumartesi".split(" "),shortDays:"Paz Pzt Sal Çrş Prş Cum Cts".split(" "),months:"Ocak Şubat Mart Nisan Mayıs Haziran Temmuz Ağustos Eylül Ekim Kasım Aralık".split(" "),shortMonths:"Oca Şub Mar Nis May Haz Tem Ağu Eyl Eki Kas Ara".split(" "),AM:"ÖÖ",PM:"ÖS",am:"ÖÖ",pm:"ÖS",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},zh_CN:{identifier:"zh-CN",days:"星期日 星期一 星期二 星期三 星期四 星期五 星期六".split(" "),shortDays:"日一二三四五六".split(""),months:"一月份 二月份 三月份 四月份 五月份 六月份 七月份 八月份 九月份 十月份 十一月份 十二月份".split(" "),shortMonths:"一月 二月 三月 四月 五月 六月 七月 八月 九月 十月 十一月 十二月".split(" "),AM:"上午",PM:"下午",am:"上午",pm:"下午",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}}},l=a.en_US,u=new function t(u,c,p){function h(t,a,l,u){for(var c="",p=null,_=!1,d=t.length,g=!1,b=0;ba.getHours()?l.am:l.pm;break;case 82:c+=h(l.formats.R,a,l,u);break;case 83:c+=e(a.getSeconds(),p);break;case 84:c+=h(l.formats.T,a,l,u);break;case 85:c+=e(s(a,"sunday"),p);break;case 87:c+=e(s(a,"monday"),p);break;case 88:c+=h(l.formats.X,a,l,u);break;case 89:c+=a.getFullYear();break;case 90:m&&0===f?c+="GMT":c+=(p=(p=(p=a).toString().match(/\(([\w\s]+)\)/))&&p[1])||"";break;case 97:c+=l.shortDays[a.getDay()];break;case 98:case 104:c+=l.shortMonths[a.getMonth()];break;case 99:c+=h(l.formats.c,a,l,u);break;case 100:c+=e(a.getDate(),p);break;case 101:c+=e(a.getDate(),null==p?" ":p);break;case 106:p=new Date(a.getFullYear(),0,1),c+=n(p=Math.ceil((a.getTime()-p.getTime())/864e5));break;case 107:c+=e(a.getHours(),null==p?" ":p);break;case 108:c+=e(i(a.getHours()),null==p?" ":p);break;case 109:c+=e(a.getMonth()+1,p);break;case 110:c+="\n";break;case 111:p=a.getDate(),c=l.ordinalSuffixes?c+(String(p)+(l.ordinalSuffixes[p-1]||r(p))):c+(String(p)+r(p));break;case 112:c+=12>a.getHours()?l.AM:l.PM;break;case 114:c+=h(l.formats.r,a,l,u);break;case 115:c+=Math.floor(u/1e3);break;case 116:c+="\t";break;case 117:c+=0===(p=a.getDay())?7:p;break;case 118:c+=h(l.formats.v,a,l,u);break;case 119:c+=a.getDay();break;case 120:c+=h(l.formats.x,a,l,u);break;case 121:c+=e(_=a.getFullYear()%100,p);break;case 122:m&&0===f?c+=g?"+00:00":"+0000":(p=0!==f?f/6e4:-a.getTimezoneOffset(),_=g?":":"",S=Math.abs(p%60),c+=(0>p?"-":"+")+e(Math.floor(Math.abs(p/60)))+_+e(S));break;default:_&&(c+="%"),c+=t[b]}p=null,_=!1}else 37===S?_=!0:c+=t[b]}return c}var _,d=u||l,f=c||0,m=p||!1,g=0,b=function(t,e){if(e){var n=e.getTime();if(m){var i=6e4*(e.getTimezoneOffset()||0);6e4*((e=new Date(n+i+f)).getTimezoneOffset()||0)!==i&&(e=6e4*(e.getTimezoneOffset()||0),e=new Date(n+e+f))}}else(n=Date.now())>g?(g=n,_=new Date(g),n=g,m&&(_=new Date(g+6e4*(_.getTimezoneOffset()||0)+f))):n=g,e=_;return h(t,e,d,n)};return b.localize=function(e){return new t(e||d,f,m)},b.localizeByIdentifier=function(t){var e=a[t];return e?b.localize(e):(o('[WARNING] No locale found with identifier "'+t+'".'),b)},b.timezone=function(e){var n=f,i=m,s=typeof e;return"number"!==s&&"string"!==s||(i=!0,"string"===s?n=(n="-"===e[0]?-1:1)*(60*(s=parseInt(e.slice(1,3),10))+(e=parseInt(e.slice(3,5),10)))*6e4:"number"===s&&(n=6e4*e)),new t(d,n,i)},b.utc=function(){return new t(d,f,!0)},b}(l,0,!1);if(void 0!==t)t.exports=u;else(function(){return this||(0,eval)("this")}()).strftime=u;"function"!=typeof Date.now&&(Date.now=function(){return+new Date})}()},function(t,e,n){t=n(5);const i=Sk.global.JSBI=void 0!==Sk.global.BigInt?{}:t;void 0===Sk.global.BigInt?(i.__isBigInt||(i.__isBigInt=t=>t instanceof i),i.powermod=(t,e,n)=>{const s=i.BigInt(1);let r=s;for(e=i.greaterThan(e,i.__ZERO)?e:i.unaryMinus(e);i.greaterThan(e,i.__ZERO);)i.bitwiseAnd(e,s)&&(r=i.remainder(i.multiply(r,t),n)),e=i.signedRightShift(e,s),t=i.remainder(i.multiply(t,t),n);return r}):Object.assign(i,{BigInt:Sk.global.BigInt,toNumber:t=>Number(t),toString:t=>t.toString(),__isBigInt:t=>"bigint"==typeof t,unaryMinus:t=>-t,bitwiseNot:t=>~t,bitwiseAnd:(t,e)=>t&e,bitwiseOr:(t,e)=>t|e,bitwiseXor:(t,e)=>t^e,exponentiate:(t,e)=>{const n=i.BigInt(1);let s=n;for(e=e>i.__ZERO?e:-e;e>i.__ZERO;)e&n&&(s*=t),e>>=n,t*=t;return s},powermod:(t,e,n)=>{const s=i.BigInt(1);let r=s;for(e=e>i.__ZERO?e:-e;e>i.__ZERO;)e&s&&(r=r*t%n),e>>=s,t=t*t%n;return r},multiply:(t,e)=>t*e,divide:(t,e)=>t/e,remainder:(t,e)=>t%e,add:(t,e)=>t+e,subtract:(t,e)=>t-e,leftShift:(t,e)=>t<t>>e,unsignedRightShift:(t,e)=>t>>>e,lessThan:(t,e)=>tt<=e,greaterThan:(t,e)=>t>e,greaterThanOrEqual:(t,e)=>t>=e,equal:(t,e)=>t===e,notEqual:(t,e)=>t!==e}),i.__ZERO=i.BigInt(0),i.__MAX_SAFE=i.BigInt(Number.MAX_SAFE_INTEGER),i.__MIN_SAFE=i.BigInt(-Number.MAX_SAFE_INTEGER),i.numberIfSafe=t=>i.lessThan(t,i.__MAX_SAFE)&&i.greaterThan(t,i.__MIN_SAFE)?i.toNumber(t):t,i.BigUp=t=>i.__isBigInt(t)?t:i.BigInt(t)},function(t,e,n){t.exports=function(){var t=Math.imul,e=Math.clz32,n=Math.abs,i=Math.max,s=Math.floor;class r extends Array{constructor(t,e){if(super(t),this.sign=e,t>r.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded")}static BigInt(t){var e=Number.isFinite;if("number"==typeof t){if(0===t)return r.__zero();if(r.__isOneDigitInt(t))return 0>t?r.__oneDigit(-t,!0):r.__oneDigit(t,!1);if(!e(t)||s(t)!==t)throw new RangeError("The number "+t+" cannot be converted to BigInt because it is not an integer");return r.__fromDouble(t)}if("string"==typeof t){if(null===(e=r.__fromString(t)))throw new SyntaxError("Cannot convert "+t+" to a BigInt");return e}if("boolean"==typeof t)return!0===t?r.__oneDigit(1,!1):r.__zero();if("object"==typeof t)return t.constructor===r?t:(t=r.__toPrimitive(t),r.BigInt(t));throw new TypeError("Cannot convert "+t+" to a BigInt")}toDebugString(){const t=["BigInt["];for(const e of this)t.push((e?(e>>>0).toString(16):e)+", ");return t.push("]"),t.join("")}toString(t){if(2>(t=void 0===t?10:t)||36>>12;const l=a-12;for(e=12<=a?0:i<<20+a,a=20+a,0>>30-l,e=i<>>30-a,a-=30;return 1!==(i=r.__decideRounding(t,a,o,i))&&(0!==i||1&~e)||0!=(e=e+1>>>0)||!(0!=++s>>>20&&(s=0,1023<++n))?(t=t.sign?-2147483648:0,n=n+1023<<20,r.__kBitConversionInts[1]=t|n|s,r.__kBitConversionInts[0]=e,r.__kBitConversionDouble[0]):t.sign?-1/0:1/0}static unaryMinus(t){if(0===t.length)return t;const e=t.__copy();return e.sign=!t.sign,e}static bitwiseNot(t){return t.sign?r.__absoluteSubOne(t).__trim():r.__absoluteAddOne(t,!0)}static exponentiate(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return r.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return!t.sign||1&e.__digit(0)?t:r.unaryMinus(t);if(1=r.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(0|e/30);return(t=new r(n,t.sign&&!!(1&e))).__initializeDigits(),t.__setDigit(n-1,1<>=1;0!==e;e>>=1)i=r.multiply(i,i),1&e&&(n=null===n?i:r.multiply(n,i));return n}static multiply(t,e){if(0===t.length)return t;if(0===e.length)return e;var n=t.length+e.length;30<=t.__clzmsd()+e.__clzmsd()&&n--,(n=new r(n,t.sign!==e.sign)).__initializeDigits();for(let i=0;ir.__absoluteCompare(t,e))return r.__zero();const n=t.sign!==e.sign,i=e.__unsignedDigit(0);if(1===e.length&&32767>=i){if(1===i)return n===t.sign?t:r.unaryMinus(t);t=r.__absoluteDivSmall(t,i,null)}else t=r.__absoluteDivLarge(t,e,!0,!1);return t.sign=n,t.__trim()}static remainder(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>r.__absoluteCompare(t,e))return t;const n=e.__unsignedDigit(0);return 1===e.length&&32767>=n?1===n||0===(e=r.__absoluteModSmall(t,n))?r.__zero():r.__oneDigit(e,t.sign):((e=r.__absoluteDivLarge(t,e,!1,!0)).sign=t.sign,e.__trim())}static add(t,e){const n=t.sign;return n===e.sign?r.__absoluteAdd(t,e,n):0<=r.__absoluteCompare(t,e)?r.__absoluteSub(t,e,n):r.__absoluteSub(e,t,!n)}static subtract(t,e){const n=t.sign;return n===e.sign?0<=r.__absoluteCompare(t,e)?r.__absoluteSub(t,e,n):r.__absoluteSub(e,t,!n):r.__absoluteAdd(t,e,n)}static leftShift(t,e){return 0===e.length||0===t.length?t:e.sign?r.__rightShiftByAbsolute(t,e):r.__leftShiftByAbsolute(t,e)}static signedRightShift(t,e){return 0===e.length||0===t.length?t:e.sign?r.__leftShiftByAbsolute(t,e):r.__rightShiftByAbsolute(t,e)}static unsignedRightShift(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}static lessThan(t,e){return 0>r.__compareToBigInt(t,e)}static lessThanOrEqual(t,e){return 0>=r.__compareToBigInt(t,e)}static greaterThan(t,e){return 0(t=s(t)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===t)return r.__zero();if(t>=r.__kMaxLengthBits)return e;const n=0|(t+29)/30;if(e.length(t=s(t)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===t)return r.__zero();if(e.sign){if(t>r.__kMaxLengthBits)throw new RangeError("BigInt too big");return r.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=r.__kMaxLengthBits)return e;const n=0|(t+29)/30;if(e.length>>i?r.__truncateToNBits(t,e):e}static ADD(t,e){if(t=r.__toPrimitive(t),e=r.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=r.__toNumeric(t),e=r.__toNumeric(e),r.__isBigInt(t)&&r.__isBigInt(e))return r.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}static LT(t,e){return r.__compare(t,e,0)}static LE(t,e){return r.__compare(t,e,1)}static GT(t,e){return r.__compare(t,e,2)}static GE(t,e){return r.__compare(t,e,3)}static EQ(t,e){for(;;){if(r.__isBigInt(t))return r.__isBigInt(e)?r.equal(t,e):r.EQ(e,t);if("number"==typeof t){if(r.__isBigInt(e))return r.__equalToNumber(e,t);if("object"!=typeof e)return t==e;e=r.__toPrimitive(e)}else if("string"==typeof t){if(r.__isBigInt(e))return null!==(t=r.__fromString(t))&&r.equal(t,e);if("object"!=typeof e)return t==e;e=r.__toPrimitive(e)}else if("boolean"==typeof t){if(r.__isBigInt(e))return r.__equalToNumber(e,+t);if("object"!=typeof e)return t==e;e=r.__toPrimitive(e)}else if("symbol"==typeof t){if(r.__isBigInt(e))return!1;if("object"!=typeof e)return t==e;e=r.__toPrimitive(e)}else{if("object"!=typeof t)return t==e;if("object"==typeof e&&e.constructor!==r)return t==e;t=r.__toPrimitive(t)}}}static NE(t,e){return!r.EQ(t,e)}static __zero(){return new r(0,!1)}static __oneDigit(t,e){return(e=new r(1,e)).__setDigit(0,t),e}__copy(){const t=new r(this.length,this.sign);for(let e=0;ee)e=-e-1;else{if(0===n)return-1;n--,i=t.__digit(n),e=29}if(!(i&(e=1<>>20)-1023,n=1+(0|e/30);t=new r(n,0>t);let i,s=1048575&r.__kBitConversionInts[1]|1048576,o=r.__kBitConversionInts[0];if(20>(e%=30)){var a=20-e;i=a+32,e=s>>>a,s=s<<32-a|o>>>a,o<<=32-a}else 20===e?(i=32,e=s,s=o):(i=32-(a=e-20),e=s<>>32-a,s=o<>>2,s=s<<30|o>>>2,o<<=30):e=0,t.__setDigit(n,e);return t.__trim()}static __isWhitespace(t){return!!(13>=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}static __fromString(t,e){e=void 0===e?0:e;let n=0;const i=t.length;let s=0;if(s===i)return r.__zero();let o=t.charCodeAt(s);for(;r.__isWhitespace(o);){if(++s===i)return r.__zero();o=t.charCodeAt(s)}if(43===o){if(++s===i)return null;o=t.charCodeAt(s),n=1}else if(45===o){if(++s===i)return null;o=t.charCodeAt(s),n=-1}if(0===e){if(e=10,48===o){if(++s===i)return r.__zero();if(o=t.charCodeAt(s),88===o||120===o){if(e=16,++s===i)return null;o=t.charCodeAt(s)}else if(79===o||111===o){if(e=8,++s===i)return null;o=t.charCodeAt(s)}else if(66===o||98===o){if(e=2,++s===i)return null;o=t.charCodeAt(s)}}}else if(16===e&&48===o){if(++s===i)return r.__zero();if(o=t.charCodeAt(s),88===o||120===o){if(++s===i)return null;o=t.charCodeAt(s)}}if(0!=n&&10!==e)return null;for(;48===o;){if(++s===i)return r.__zero();o=t.charCodeAt(s)}var a=i-s;let l=r.__kMaxBitsPerChar[e];var u=r.__kBitsPerCharTableMultiplier-1;if(a>1073741824/l)return null;a=new r(0|(29+(l*a+u>>>r.__kBitsPerCharTableShift))/30,!1);const c=10>e?e:10,p=10>>0>>0>>r.__kBitsPerCharTableShift)/30)}while(!h)}else{l>>=r.__kBitsPerCharTableShift,e=[];var h=[],_=!1;do{for(var d=0,f=0;;){if(o-48>>>0>>0>>l-r)}if(0!==s){if(i>=t.length)throw Error("implementation bug");t.__setDigit(i++,s)}for(;i>>1)+(85&i))>>>2)+(51&i))>>>4)+(15&i),--e;const s=t.__digit(n-1);var o=r.__clz30(s),a=0|(30*n-o+i-1)/i;if(t.sign&&a++,268435456>>(u=i-u),u=30-u;u>=i;)o[a--]=r.__kConversionChars[l&e],l>>>=i,u-=i}for(o[a--]=r.__kConversionChars[(l|s<>>i-u;0!==l;)o[a--]=r.__kConversionChars[l&e],l>>>=i;if(t.sign&&(o[a--]="-"),-1!=a)throw Error("implementation bug");return o.join("")}static __toStringGeneric(t,e,n){var i=t.length;if(0===i)return"";if(1===i)return e=t.__unsignedDigit(0).toString(e),!1===n&&t.sign&&(e="-"+e),e;var s=30*i-r.__clz30(t.__digit(i-1));i=r.__kMaxBitsPerChar[e]-1,i=1+(0|((s*=r.__kBitsPerCharTableMultiplier)+(i-1))/i)>>1;var o=(s=r.exponentiate(r.__oneDigit(e,!1),r.__oneDigit(i,!1))).__unsignedDigit(0);if(1===s.length&&32767>=o){(s=new r(t.length,!1)).__initializeDigits();var a=0;for(let e=2*t.length-1;0<=e;e--)a=a<<15|t.__halfDigit(e),s.__setHalfDigit(e,0|a/o),a=0|a%o;o=a.toString(e)}else s=(o=r.__absoluteDivLarge(t,s,!0,!0)).quotient,o=o.remainder.__trim(),o=r.__toStringGeneric(o,e,!0);for(s.__trim(),e=r.__toStringGeneric(s,e,!0);o.lengtht?r.__absoluteLess(n):0}static __compareToNumber(t,e){if(r.__isOneDigitInt(e)){const i=t.sign,s=0>e;if(i!==s)return r.__unequalSign(i);if(0===t.length){if(s)throw Error("implementation bug");return 0===e?0:-1}return 1e?r.__absoluteGreater(i):te)return r.__unequalSign(n);if(0===e)throw Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;if(r.__kBitConversionDouble[0]=e,2047==(e=2047&r.__kBitConversionInts[1]>>>20))throw Error("implementation bug: handled elsewhere");var i=e-1023;if(0>i)return r.__absoluteGreater(n);e=t.length;var s=t.__digit(e-1),o=r.__clz30(s),a=30*e-o;if(a<(i+=1))return r.__absoluteLess(n);if(a>i)return r.__absoluteGreater(n);i=1048576|1048575&r.__kBitConversionInts[1];let l=r.__kBitConversionInts[0];if((o=29-o)!=(0|(a-1)%30))throw Error("implementation bug");if(20>o){var u=20-o;o=u+32,a=i>>>u,i=i<<32-u|l>>>u,l<<=32-u}else 20===o?(o=32,a=i,i=l):(o=32-(u=o-20),a=i<>>32-u,i=l<>>=0)>(a>>>=0))return r.__absoluteGreater(n);if(s>>2,i=i<<30|l>>>2,l<<=30):a=0,(s=t.__unsignedDigit(e))>a)return r.__absoluteGreater(n);if(se&&t.__unsignedDigit(0)===n(e):0===r.__compareToDouble(t,e)}static __comparisonResultToBool(t,e){return 0===e?0>t:1===e?0>=t:2===e?0e;case 3:return t>=e}if(r.__isBigInt(t)&&"string"==typeof e)return null!==(e=r.__fromString(e))&&r.__comparisonResultToBool(r.__compareToBigInt(t,e),n);if("string"==typeof t&&r.__isBigInt(e))return null!==(t=r.__fromString(t))&&r.__comparisonResultToBool(r.__compareToBigInt(t,e),n);if(t=r.__toNumeric(t),e=r.__toNumeric(e),r.__isBigInt(t)){if(r.__isBigInt(e))return r.__comparisonResultToBool(r.__compareToBigInt(t,e),n);if("number"!=typeof e)throw Error("implementation bug");return r.__comparisonResultToBool(r.__compareToNumber(t,e),n)}if("number"!=typeof t)throw Error("implementation bug");if(r.__isBigInt(e))return r.__comparisonResultToBool(r.__compareToNumber(e,t),2^n);if("number"!=typeof e)throw Error("implementation bug");return 0===n?te:3===n?t>=e:void 0}__clzmsd(){return r.__clz30(this.__digit(this.length-1))}static __absoluteAdd(t,e,n){if(t.length>>30,n.__setDigit(s,1073741823&r)}for(;s>>30,n.__setDigit(s,1073741823&e);return s>>30,n.__setDigit(s,1073741823&r)}for(;s>>30,n.__setDigit(s,1073741823&e);return n.__trim()}static __absoluteAddOne(t,e,n){n=void 0===n?null:n;const i=t.length;null===n?n=new r(i,e):n.sign=e,e=1;for(let s=0;s>>30,n.__setDigit(s,1073741823&i)}return 0!=e&&n.__setDigitGrow(i,1),n}static __absoluteSubOne(t,e){const n=t.length,i=new r(e=e||n,!1);let s=1;for(let e=0;e>>30,i.__setDigit(e,1073741823&n)}if(0!=s)throw Error("implementation bug");for(t=n;tn?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}static __multiplyAccumulate(t,e,n,i){if(0!==e){var s=32767&e,o=e>>>15,a=e=0;for(let p,h=0;h>>15;l=r.__imul(u,s),u=r.__imul(u,o);const _=r.__imul(c,s);p+=a+l+e,e=p>>>30,p&=1073741823,p+=((32767&u)<<15)+((32767&_)<<15),e+=p>>>30,a=(c=r.__imul(c,o))+(u>>>15)+(_>>>15),n.__setDigit(i,1073741823&p)}for(;0!=e||0!==a;i++)t=n.__digit(i),t+=e+a,a=0,e=t>>>30,n.__setDigit(i,1073741823&t)}}static __internalMultiplyAdd(t,e,n,i,s){let o=0;for(let u=0;u>>15,e)))<<15)+o+n)>>>30,o=a>>>15,s.__setDigit(u,1073741823&l)}if(s.length>i)for(s.__setDigit(i++,n+o);ithis.length&&(n=this.length);const i=32767&t;t>>>=15;let s=0;for(let u=0;u>>15;o=r.__imul(a,i),a=r.__imul(a,t);const n=r.__imul(l,i);s=(o=e+o+s)>>>30,o&=1073741823,s+=(o+=((32767&a)<<15)+((32767&n)<<15))>>>30,e=(l=r.__imul(l,t))+(a>>>15)+(n>>>15),this.__setDigit(u,1073741823&o)}if(0!=s||0!==e)throw Error("implementation bug")}static __absoluteDivSmall(t,e,n){null===(n=void 0===n?null:n)&&(n=new r(t.length,!1));let i=0;for(let s,r=2*t.length-1;0<=r;r-=2){s=(i<<15|t.__halfDigit(r))>>>0;const o=0|s/e;i=0|s%e,s=(i<<15|t.__halfDigit(r-1))>>>0;const a=0|s/e;i=0|s%e,n.__setDigit(r>>>1,o<<15|a)}return n}static __absoluteModSmall(t,e){let n=0;for(let i=2*t.length-1;0<=i;i--)n=0|((n<<15|t.__halfDigit(i))>>>0)%e;return n}static __absoluteDivLarge(t,e,n,i){const s=e.__halfDigitLength(),o=e.length;var a=t.__halfDigitLength()-s;let l=null;n&&(l=new r(a+2>>>1,!1),l.__initializeDigits());const u=new r(s+2>>>1,!1);u.__initializeDigits();const c=r.__clz15(e.__halfDigit(s-1));0>>0)/p,a=0|a%p;const n=e.__halfDigit(s-2),o=t.__halfDigit(c+s-2);for(;r.__imul(i,n)>>>0>(a<<16|o)>>>0&&(i--,!(32767<(a+=p))););}r.__internalMultiplyAdd(e,i,0,o,u),0!==(a=t.__inplaceSub(u,c,s+1))&&(a=t.__inplaceAdd(e,c,s),t.__setHalfDigit(c+s,32767&t.__halfDigit(c+s)+a),i--),n&&(1&c?h=i<<15:l.__setDigit(c>>>1,h|i))}if(i)return t.__inplaceRightShift(c),n?{quotient:l,remainder:t}:t;if(n)return l;throw Error("unreachable")}static __clz15(t){return r.__clz30(t)-15}__inplaceAdd(t,e,n){let i=0;for(let s=0;s>>15,this.__setHalfDigit(e+s,32767&n)}return i}__inplaceSub(t,e,n){let i=0;if(1&e){e>>=1;for(var s=this.__digit(e),r=32767&s,o=0;o>>1;o++){var a=t.__digit(o);i=1&(s=(s>>>15)-(32767&a)-i)>>>15,this.__setDigit(e+o,(32767&s)<<15|32767&r),i=1&(r=(32767&(s=this.__digit(e+o+1)))-(a>>>15)-i)>>>15}const l=(s>>>15)-(32767&(a=t.__digit(o)))-i;if(i=1&l>>>15,this.__setDigit(e+o,(32767&l)<<15|32767&r),e+o+1>=this.length)throw new RangeError("out of bounds");!(1&n)&&(i=1&(r=(32767&(s=this.__digit(e+o+1)))-(a>>>15)-i)>>>15,this.__setDigit(e+t.length,1073709056&s|32767&r))}else{for(e>>=1,r=0;r>>15,i=1&(s=(s>>>15)-(a>>>15)-i)>>>15,this.__setDigit(e+r,(32767&s)<<15|32767&o);i=1&(s=(32767&(o=this.__digit(e+r)))-(32767&(t=t.__digit(r)))-i)>>>15,a=0,!(1&n)&&(i=1&(a=(o>>>15)-(t>>>15)-i)>>>15),this.__setDigit(e+r,(32767&a)<<15|32767&s)}return i}__inplaceRightShift(t){if(0!==t){var e=this.__digit(0)>>>t,n=this.length-1;for(let i=0;i>>t}this.__setDigit(n,e)}}static __specialLeftShift(t,e,n){const i=t.length,s=new r(i+n,!1);if(0===e){for(e=0;e>>30-e}return 0n)throw new RangeError("BigInt too big");e=0|n/30;var i=n%30;const s=t.length,o=0!==i&&0!=t.__digit(s-1)>>>30-i;var a=s+e+(o?1:0);if(n=new r(a,t.sign),0===i){for(i=0;i>>30-i}if(o)n.__setDigit(s+e,a);else if(0!==a)throw Error("implementation bug")}return n.__trim()}static __rightShiftByAbsolute(t,e){var n=t.length,i=t.sign,s=r.__toShiftAmount(e);if(0>s)return r.__rightShiftByMaximum(i);var o=s%30,a=n-(e=0|s/30);if(0>=a)return r.__rightShiftByMaximum(i);if(s=!1,i)if(t.__digit(e)&(1<>>o,n=n-e-1,l=0;l>>o}i.__setDigit(n,a)}return s&&(i=r.__absoluteAddOne(i,!0,i)),i.__trim()}static __rightShiftByMaximum(t){return t?r.__oneDigit(1,!0):r.__zero()}static __toShiftAmount(t){return 1r.__kMaxLengthBits?-1:t}static __toPrimitive(t,e){if(e=void 0===e?"default":e,"object"!=typeof t||t.constructor===r)return t;if("undefined"!=typeof Symbol&&"symbol"==typeof Symbol.toPrimitive){const n=t[Symbol.toPrimitive];if(n){if("object"!=typeof(t=n(e)))return t;throw new TypeError("Cannot convert object to primitive value")}}if((e=t.valueOf)&&"object"!=typeof(e=e.call(t)))return e;if((e=t.toString)&&"object"!=typeof(t=e.call(t)))return t;throw new TypeError("Cannot convert object to primitive value")}static __toNumeric(t){return r.__isBigInt(t)?t:+t}static __isBigInt(t){return"object"==typeof t&&null!==t&&t.constructor===r}static __truncateToNBits(t,e){var n=0|(t+29)/30;const i=new r(n,e.sign);--n;for(let t=0;t>>t),i.__setDigit(n,e),i.__trim()}static __truncateAndSubFromPowerOfTwo(t,e,n){var i=Math.min,s=0|(t+29)/30;n=new r(s,n);let o=0;var a=0;for(i=i(--s,e.length);o>>30,n.__setDigit(o,1073741823&t)}for(;o>>t,a=(t=1<<32-t)-e-a,a&=t-1),n.__setDigit(s,a),n.__trim()}__digit(t){return this[t]}__unsignedDigit(t){return this[t]>>>0}__setDigit(t,e){this[t]=0|e}__setDigitGrow(t,e){this[t]=0|e}__halfDigitLength(){const t=this.length;return 32767>=this.__unsignedDigit(t-1)?2*t-1:2*t}__halfDigit(t){return 32767&this[t>>>1]>>>15*(1&t)}__setHalfDigit(t,e){const n=t>>>1,i=this.__digit(n);this.__setDigit(n,1&t?32767&i|e<<15:1073709056&i|32767&e)}static __digitPow(t,e){let n=1;for(;0>>=1,t*=t;return n}static __isOneDigitInt(t){return(1073741823&t)===t}}return r.__kMaxLength=33554432,r.__kMaxLengthBits=r.__kMaxLength<<5,r.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],r.__kBitsPerCharTableShift=5,r.__kBitsPerCharTableMultiplier=1<>>0)/e)},r.__imul=t||function(t,e){return 0|t*e},r}()},function(t,e){[..."abc"].flat(),"a".matchAll(/a/g)},function(t,e,n){(function(t,e){!function(t,n){function i(t){delete a[t]}function s(t){if(l)setTimeout(s,0,t);else{var e=a[t];if(e){l=!0;try{var r=e.callback,o=e.args;switch(o.length){case 0:r();break;case 1:r(o[0]);break;case 2:r(o[0],o[1]);break;case 3:r(o[0],o[1],o[2]);break;default:r.apply(n,o)}}finally{i(t),l=!1}}}}if(!t.setImmediate){var r,o=1,a={},l=!1,u=t.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(t);c=c&&c.setTimeout?c:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){s(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(p="setImmediate$"+Math.random()+"$",h=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(p)&&s(+e.data.slice(p.length))},t.addEventListener?t.addEventListener("message",h,!1):t.attachEvent("onmessage",h),r=function(e){t.postMessage(p+e,"*")}):t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){s(t.data)},r=function(e){t.port2.postMessage(e)}}():u&&"onreadystatechange"in u.createElement("script")?function(){var t=u.documentElement;r=function(e){var n=u.createElement("script");n.onreadystatechange=function(){s(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():r=function(t){setTimeout(s,0,t)},c.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=Array(arguments.length-1),n=0;n the object's type\ntype(name, bases, dict) -> a new type",tp$call:function(t,e){if(this===Sk.builtin.type){if(1===t.length&&(void 0===e||!e.length))return t[0].ob$type;if(3!==t.length)throw new Sk.builtin.TypeError("type() takes 1 or 3 arguments")}let n=this.prototype.tp$new(t,e);if(n.$isSuspension)return Sk.misceval.chain(n,(i=>{if(n=i,n.ob$type.$isSubType(this))return n.tp$init(t,e)}),(()=>n));if(n.ob$type.$isSubType(this)){const i=n.tp$init(t,e);return void 0!==i&&i.$isSuspension?Sk.misceval.chain(i,(()=>n)):n}return n},tp$new:function(t,e){if(3!==t.length){if(1===t.length&&(void 0===e||!e.length))return t[0].ob$type;throw new Sk.builtin.TypeError("type() takes 1 or 3 arguments")}const i=t[0];var s=t[1];const o=t[2];if("dict"!==o.tp$name)throw new Sk.builtin.TypeError("type() argument 3 must be dict, not "+Sk.abstr.typeName(o));if(!Sk.builtin.checkString(i))throw new Sk.builtin.TypeError("type() argument 1 must be str, not "+Sk.abstr.typeName(i));const a=i.$jsstr();if("tuple"!==s.tp$name)throw new Sk.builtin.TypeError("type() argument 2 must be tuple, not "+Sk.abstr.typeName(s));r(a,t=function(){this.sk$hasDict&&(this.$d=new Sk.builtin.dict),this.$s=[]},s=s.sk$asarray(),this.constructor);const u=t.prototype;Sk.globals&&(u.__module__=Sk.globals.__name__),u.__doc__=Sk.builtin.none.none$;let c,p=void 0===(s=o.quick$lookup(Sk.builtin.str.$slots)),h=void 0!==t.$typeLookup(Sk.builtin.str.$dict);if(void 0!==s&&(c=new Set,(s=Sk.builtin.checkString(s)?[s]:Sk.misceval.arrayFromIterable(s)).forEach((t=>{if(!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("__slots__ items must be strings, not '"+Sk.abstr.typeName(t)+"'");if(!t.$isIdentifier())throw new Sk.builtin.TypeError("__slots__ must be identifiers");if(t===Sk.builtin.str.$dict){if(h)throw new Sk.builtin.TypeError("__dict__ slot disallowed: we already got one");p=!0}else c.add(Sk.mangleName(i,t))})),function(t,e){const n=e.prototype,i=n.sk$nslots||0;Object.defineProperty(n,"sk$nslots",{value:i+t.length,writable:!0}),t.length&&Object.defineProperty(e,"sk$solidSlotBase",{value:!0,writable:!0}),t.forEach(((t,s)=>{s+=i,n[t.$mangled]=new Sk.builtin.getset_descriptor(e,{$get(){const e=this.$s[s];if(void 0===e)throw new Sk.builtin.AttributeError(t);return e},$set(t){this.$s[s]=t}})}))}(s=[...c].sort(((t,e)=>t.toString().localeCompare(e.toString()))),t)),p&&!h&&(u.__dict__=new Sk.builtin.getset_descriptor(t,l),h=!0),Object.defineProperties(u,{ht$slots:{value:s||null,writable:!0},sk$hasDict:{value:h,writable:!0}}),o.$items().forEach((t=>{var[e,n]=t;if(c&&c.has(e))throw new Sk.builtin.ValueError("'"+e.toString()+"' in __slots__ conflicts with class variable");u[e.$mangled]=n})),u.hasOwnProperty("__qualname__")){if(s=u.__qualname__,!Sk.builtin.checkString(s))throw new Sk.builtin.TypeError("type __qualname__ must be a str, not '"+Sk.abstr.typeName(s)+"'");u.ht$qualname=s}return n(s=t.prototype,"__init_subclass__","classmethod"),n(s,"__new__","staticmethod"),n(s,"__class_getitem__","classmethod"),t.$allocateSlots(),function(t){const e=t.prototype;Object.keys(e).forEach((n=>{const i=Sk.abstr.lookupSpecial(e[n],Sk.builtin.str.$setname);if(void 0!==i)try{Sk.misceval.callsimArray(i,[t,new Sk.builtin.str(n)])}catch(i){throw(n=new Sk.builtin.RuntimeError("Error calling __set_name__ on '"+Sk.abstr.typeName(e[n])+"' instance '"+n+"' in '"+t.prototype.tp$name+"'")).$cause=i,n}}))}(t),function(t,e){t=new Sk.builtin.super_(t,t).tp$getattr(Sk.builtin.str.$initsubclass),Sk.misceval.callsimArray(t,[],e)}(t,e),t},tp$init:function(t,e){if(t&&1==t.length&&e&&e.length)throw new Sk.builtin.TypeError("type.__init__() takes no keyword arguments");if(3!=t.length&&1!=t.length)throw new Sk.builtin.TypeError("type.__init__() takes 1 or 3 arguments");return Sk.builtin.object.prototype.tp$init.call(this,[])},tp$getattr:function(t,e){var n=this.ob$type;const i=n.$typeLookup(t);let s;return void 0!==i&&(s=i.tp$descr_get,void 0!==s&&void 0!==i.tp$descr_set)?s.call(i,this,n,e):void 0!==(t=this.$typeLookup(t))?void 0!==(n=t.tp$descr_get)?e=n.call(t,null,this,e):t:void 0!==s?s.call(i,this,n,e):void 0!==i?i:void 0},tp$setattr:function(t,e,n){if(!this.sk$klass){if(void 0!==e)throw new Sk.builtin.TypeError("can't set attributes of built-in/extension type '"+this.prototype.tp$name+"'");throw new Sk.builtin.TypeError("can't delete attributes on type object '"+this.prototype.tp$name+"'")}const i=this.ob$type.$typeLookup(t);if(void 0!==i){const t=i.tp$descr_set;if(t)return t.call(i,this,e,n)}if(n=t.$mangled,void 0===e){if(!(e=this.prototype).hasOwnProperty(n))throw new Sk.builtin.AttributeError("type object '"+this.prototype.tp$name+"' has no attribute '"+t.$jsstr()+"'");delete e[n],void 0!==(t=Sk.dunderToSkulpt[n])&&(delete this.prototype[t],e.sk$prototypical||this.$allocateGetterSlot(n))}else this.prototype[n]=e,n in Sk.dunderToSkulpt&&this.$allocateSlot(n,e)},$r:function(){let t=this.prototype.__module__,e="",n="class";return t&&Sk.builtin.checkString(t)?e=t.v+".":t=null,t||this.sk$klass||Sk.__future__.class_repr||(n="type"),new Sk.builtin.str("<"+n+" '"+e+this.prototype.tp$name+"'>")}},writable:!0},tp$methods:{value:null,writable:!0},tp$classmethods:{value:null,writable:!0},tp$getsets:{value:null,writable:!0},sk$type:{value:!0},$isSubType:{value:function(t){return this===t||this.prototype instanceof t||!this.prototype.sk$prototypical&&this.prototype.tp$mro.includes(t)}},$allocateSlot:{value:function(t,e){const n=(t=Sk.slots[t]).$slot_name,i=this.prototype;i.hasOwnProperty(n)&&delete i[n],Object.defineProperty(i,n,{value:t.$slot_func(e),writable:!0,configurable:!0})}},$allocateSlots:{value:function(){const t=this.prototype;this.prototype.sk$prototypical?Object.keys(t).forEach((e=>{e in Sk.slots&&this.$allocateSlot(e,t[e])})):Object.keys(Sk.slots).forEach((e=>{t.hasOwnProperty(e)?this.$allocateSlot(e,t[e]):this.$allocateGetterSlot(e)})),t.hasOwnProperty("__eq__")&&!t.hasOwnProperty("__hash__")&&(t.tp$hash=t.__hash__=Sk.builtin.none.none$)}},$allocateGetterSlot:{value:function(t){const e=Sk.slots[t].$slot_name,n=this.prototype;n.hasOwnProperty(e)||Object.defineProperty(n,e,{configurable:!0,get(){const t=n.tp$mro;for(let n=1;nnew Sk.builtin.dict([]),$flags:{FastCall:!0}}};const l={$get(){const t=o(this.ob$type);return void 0!==t?t.tp$descr_get(this,this.ob$type):Sk.generic.getSetDict.$get.call(this)},$set(t){const e=o(this.ob$type);return void 0!==e?e.tp$descr_set(this,t):void 0!==t?Sk.generic.getSetDict.$set.call(this,t):void(this.$d=new Sk.builtin.dict([]))},$doc:"dictionary for instance variables (if defined)",$name:"__dict__"}},function(t,e){Sk.generic={},Sk.generic.getAttr=function(t,e){let n;const i=this.ob$type,s=i.$typeLookup(t);if(void 0!==s&&(n=s.tp$descr_get,void 0!==n&&void 0!==s.tp$descr_set))return n.call(s,this,i,e);const r=this.$d;return void 0!==r&&void 0!==(t=r.quick$lookup(t))?t:void 0!==n?n.call(s,this,i,e):void 0!==s?s:void 0},Sk.exportSymbol("Sk.generic.getAttr",Sk.generic.getAttr),Sk.generic.setAttr=function(t,e,n){var i=this.ob$type.$typeLookup(t);if(null!=i){const t=i.tp$descr_set;if(t)return t.call(i,this,e,n)}if(void 0!==(n=this.$d))if(n.mp$ass_subscript){if(void 0!==e)return n.mp$ass_subscript(t,e);try{return n.mp$ass_subscript(t)}catch(e){if(e instanceof Sk.builtin.KeyError)throw new Sk.builtin.AttributeError("'"+Sk.abstr.typeName(this)+"' object has no attribute '"+t.$jsstr()+"'");throw e}}else if("object"==typeof n){if(i=t.$mangled,void 0!==e)return void(n[i]=e);if(void 0!==n[i])return void delete n[i]}throw new Sk.builtin.AttributeError(this.sk$attrError()+" has no attribute '"+t.$jsstr()+"'")},Sk.exportSymbol("Sk.generic.setAttr",Sk.generic.setAttr),Sk.generic.new=function(t){return function(e,n){return this.constructor===t?new this.constructor:(e=new this.constructor,t.call(e),e)}},Sk.generic.newMethodDef={$meth(t,e){const n=this.prototype;if(1>t.length)throw t=n.tp$name,new Sk.builtin.TypeError(t+".__new__(): not enough arguments");var i=t.shift();if(void 0===i.sk$type)throw t=n.tp$name,new Sk.builtin.TypeError(t+"__new__(X): X is not a type object ("+Sk.abstr.typeName(i)+")");if(!i.$isSubType(this))throw t=n.tp$name,i=i.prototype.tp$name,new Sk.builtin.TypeError(t+".__new__("+i+"): "+i+" is not a subtype of "+t);const s=i.prototype.sk$staticNew.prototype;if(s.tp$new!==n.tp$new)throw t=n.tp$name,i=i.prototype.tp$name,new Sk.builtin.TypeError(t+".__new__("+i+") is not safe, use "+s.tp$name+".__new__()");return n.tp$new.call(i.prototype,t,e)},$flags:{FastCall:!0},$textsig:"($type, *args, **kwargs)",$name:"__new__"},Sk.generic.selfIter=function(){return this},Sk.generic.iterNextWithArrayCheckSize=function(){if(this.$seq.length!==this.$orig.get$size()){const t=this.tp$name.split("_")[0];throw new Sk.builtin.RuntimeError(t+" changed size during iteration")}if(!(this.$index>=this.$seq.length))return this.$seq[this.$index++]},Sk.generic.iterNextWithArray=function(){const t=this.$seq[this.$index++];return void 0===t&&(this.tp$iternext=()=>{}),t},Sk.generic.iterLengthHintWithArrayMethodDef={$meth:function(){return new Sk.builtin.int_(this.$seq.length-this.$index)},$flags:{NoArgs:!0}},Sk.generic.iterReverseLengthHintMethodDef={$meth:function(){return new Sk.builtin.int_(this.$index)},$flags:{NoArgs:!0}},Sk.generic.getSetDict={$get(){return this.$d},$set(t){if(void 0===t)throw new Sk.builtin.TypeError("cannot delete __dict__");if(!(t instanceof Sk.builtin.dict))throw new Sk.builtin.TypeError("__dict__ must be set to a dictionary, not a '"+Sk.abstr.typeName(t)+"'");this.$d=t},$doc:"dictionary for instance variables (if defined)",$name:"__dict__"},Sk.generic.seqCompare=function(t,e){if(this===t&&Sk.misceval.opAllowsEquality(e))return!0;if(!(t instanceof this.sk$builtinBase))return Sk.builtin.NotImplemented.NotImplemented$;const n=this.v;let i;if(t=t.v,n.length!==t.length&&("Eq"===e||"NotEq"===e))return"Eq"!==e;for(i=0;i=s||i>=r)switch(e){case"Lt":return sr;case"GtE":return s>=r;default:Sk.asserts.fail()}return"Eq"!==e&&("NotEq"===e||Sk.misceval.richCompareBool(n[i],t[i],e))},Sk.generic.classGetItem={__class_getitem__:{$meth(t){return new Sk.builtin.GenericAlias(this,t)},$flags:{OneArg:!0}}}},function(t,e){Sk.builtin.pyCheckArgs=function(t,e,n,i,s,r){if(e=e.length,void 0===i&&(i=1/0),s&&--e,r&&--e,ei)throw new Sk.builtin.TypeError((n===i?t+"() takes exactly "+n+" arguments":ei)throw new Sk.builtin.TypeError((n===i?t+"() takes exactly "+n+" arguments":e"};const r={Add:"+",Sub:"-",Mult:"*",MatMult:"@",Div:"/",FloorDiv:"//",Mod:"%",DivMod:"divmod()",Pow:"** or pow()",LShift:"<<",RShift:">>",BitAnd:"&",BitXor:"^",BitOr:"|"},o={UAdd:"+",USub:"-",Invert:"~"};Sk.abstr.numberBinOp=function(t,e,n){var s;if(!(s=i(t,e,n)))throw t=Sk.abstr.typeName(t),e=Sk.abstr.typeName(e),new Sk.builtin.TypeError("unsupported operand type(s) for "+r[n]+": '"+t+"' and '"+e+"'");return s},Sk.exportSymbol("Sk.abstr.numberBinOp",Sk.abstr.numberBinOp),Sk.abstr.numberInplaceBinOp=function(t,e,n){var i;if(!(i=s(t,e,n)))throw t=Sk.abstr.typeName(t),e=Sk.abstr.typeName(e),new Sk.builtin.TypeError("unsupported operand type(s) for "+r[n]+"=: '"+t+"' and '"+e+"'");return i},Sk.exportSymbol("Sk.abstr.numberInplaceBinOp",Sk.abstr.numberInplaceBinOp),Sk.abstr.numberUnaryOp=function(t,e){if("Not"===e)return Sk.misceval.isTrue(t)?Sk.builtin.bool.false$:Sk.builtin.bool.true$;t:{switch(e){case"USub":var n=t.nb$negative;break t;case"UAdd":n=t.nb$positive;break t;case"Invert":n=t.nb$invert;break t}n=void 0}if(!(n=void 0!==n?n.call(t):void 0))throw t=Sk.abstr.typeName(t),new Sk.builtin.TypeError("bad operand type for unary "+o[e]+": '"+t+"'");return n},Sk.exportSymbol("Sk.abstr.numberUnaryOp",Sk.abstr.numberUnaryOp),Sk.abstr.fixSeqIndex_=function(t,e){return 0>(e=Sk.builtin.asnum$(e))&&t.sq$length&&(e+=t.sq$length()),e},Sk.abstr.sequenceContains=function(t,e,n){return t.sq$contains?t.sq$contains(e,n):(t=Sk.misceval.iterFor(Sk.abstr.iter(t),(function(t){return!(t!==e&&!Sk.misceval.richCompareBool(t,e,"Eq"))&&new Sk.misceval.Break(!0)}),!1),n?t:Sk.misceval.retryOptionalSuspensionOrThrow(t))},Sk.abstr.sequenceConcat=function(t,e){if(t.sq$concat)return t.sq$concat(e);if(Sk.builtin.checkSequence(t)&&Sk.builtin.checkSequence(e)&&void 0!==(e=i(t,e,"Add")))return e;throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object can't be concatenated")},Sk.abstr.sequenceInPlaceConcat=function(t,e){if(t.sq$inplace_concat)return t.sq$inplace_concat(e);if(t.sq$concat)return t.sq$concat(e);if(Sk.builtin.checkSequence(t)&&Sk.builtin.checkSequence(e)&&void 0!==(e=s(t,e,"Add")))return e;throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object can't be concatenated")},Sk.abstr.sequenceGetIndexOf=function(t,e){if(t.index)return Sk.misceval.callsimArray(t.index,[t,e]);let n=0;for(let i=Sk.abstr.iter(t),s=i.tp$iternext();void 0!==s;s=i.tp$iternext()){if(Sk.misceval.richCompareBool(e,s,"Eq"))return new Sk.builtin.int_(n);n+=1}throw new Sk.builtin.ValueError("sequence.index(x): x not in sequence")},Sk.abstr.sequenceGetCountOf=function(t,e){if(t.count)return Sk.misceval.callsimArray(t.count,[t,e]);let n=0;for(let i=Sk.abstr.iter(t),s=i.tp$iternext();void 0!==s;s=i.tp$iternext())Sk.misceval.richCompareBool(e,s,"Eq")&&(n+=1);return new Sk.builtin.int_(n)},Sk.abstr.sequenceGetItem=function(t,e,n){return"number"==typeof e&&(e=new Sk.builtin.int_(e)),Sk.abstr.objectGetItem(t,e,n)},Sk.abstr.sequenceSetItem=function(t,e,n,i){return"number"==typeof e&&(e=new Sk.builtin.int_(e)),Sk.abstr.objectSetItem(t,e,n,i)},Sk.abstr.sequenceDelItem=function(t,e,n){return Sk.abstr.objectDelItem(t,e,n)},Sk.abstr.sequenceGetSlice=function(t,e,n){return Sk.abstr.objectGetItem(t,new Sk.builtin.slice(e,n))},Sk.abstr.sequenceDelSlice=function(t,e,n){return Sk.abstr.objectDelItem(t,new Sk.builtin.slice(e,n))},Sk.abstr.sequenceSetSlice=function(t,e,n,i){return Sk.abstr.objectSetItem(t,new Sk.builtin.slice(e,n))},Sk.abstr.sequenceUnpack=function(t,e,n,i){if(!Sk.builtin.checkIterable(t))throw new Sk.builtin.TypeError("cannot unpack non-iterable "+Sk.abstr.typeName(t)+" object");const s=Sk.abstr.iter(t),r=[];let o,a=0;return 0{if(r.push(t),++a===e)return new Sk.misceval.Break}))),Sk.misceval.chain(o,(()=>{if(r.length{if(void 0!==t)throw new Sk.builtin.ValueError("too many values to unpack (expected "+e+")");return r}));const t=[];return Sk.misceval.chain(Sk.misceval.iterFor(s,(e=>{t.push(e)})),(()=>{const i=t.length+e-n;if(0>i)throw new Sk.builtin.ValueError("not enough values to unpack (expected at least "+n+", got "+(n+i)+")");return r.push(new Sk.builtin.list(t.slice(0,i))),r.push(...t.slice(i)),r}))}))},Sk.abstr.mappingUnpackIntoKeywordArray=function(t,e,n){if(!(e instanceof Sk.builtin.dict)){var i=Sk.abstr.lookupSpecial(e,Sk.builtin.str.$keys);if(void 0===i)throw new Sk.builtin.TypeError("Object is not a mapping");return Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(i),(i=>Sk.misceval.iterFor(Sk.abstr.iter(i),(i=>{if(!Sk.builtin.checkString(i))throw new Sk.builtin.TypeError((n.$qualname?n.$qualname+"() ":"")+"keywords must be strings");return Sk.misceval.chain(e.mp$subscript(i,!0),(e=>{t.push(i.v),t.push(e)}))}))))}e.$items().forEach((e=>{var[i,s]=e;if(!Sk.builtin.checkString(i))throw new Sk.builtin.TypeError((n.$qualname?n.$qualname+"() ":"")+"keywords must be strings");t.push(i.v),t.push(s)}))},Sk.abstr.keywordArrayFromPyDict=function(t){const e=[];return t.$items().forEach((t=>{var[n,i]=t;if(!Sk.builtin.checkString(n))throw new Sk.builtin.TypeError("keywords must be strings");e.push(n.toString()),e.push(i)})),e},Sk.abstr.keywordArrayToPyDict=function(t){const e=new Sk.builtin.dict;for(let n=0;ne.length)throw new Sk.builtin.TypeError(t+"() expected at most "+e.length+" arguments ("+r+" given)");if(!i.length&&void 0===s)return n;if(r===e.length&&!i.length)return n;if(0===r&&e.length===(s&&s.length))return s;for(n=n.slice(0),r=0;rvoid 0===n[e]))).length)throw new Sk.builtin.TypeError(t+"() missing "+e.length+" required positional arguments: "+e.join(", "))}return n},Sk.exportSymbol("Sk.abstr.copyKeywordsToNamedArgs",Sk.abstr.copyKeywordsToNamedArgs),Sk.abstr.checkNoKwargs=function(t,e){if(e&&e.length)throw new Sk.builtin.TypeError(t+"() takes no keyword arguments")},Sk.exportSymbol("Sk.abstr.checkNoKwargs",Sk.abstr.checkNoKwargs),Sk.abstr.checkNoArgs=function(t,e,n){if(e=e.length+(n?n.length:0))throw new Sk.builtin.TypeError(t+"() takes no arguments ("+e+" given)")},Sk.exportSymbol("Sk.abstr.checkNoArgs",Sk.abstr.checkNoArgs),Sk.abstr.checkOneArg=function(t,e,n){if(Sk.abstr.checkNoKwargs(t,n),1!==e.length)throw new Sk.builtin.TypeError(t+"() takes exactly one argument ("+e.length+" given)")},Sk.exportSymbol("Sk.abstr.checkOneArg",Sk.abstr.checkOneArg),Sk.abstr.checkArgsLen=function(t,e,n,i){if(void 0===i&&(i=1/0),(e=e.length)i)throw new Sk.builtin.TypeError((n===i?t+"() takes exactly "+n+" arguments":eSk.builtin.str&&Sk.builtin.str.$fixReserved?(a=Sk.builtin.str.$fixReserved,Sk.builtin.str.$fixReserved(t)):t;Sk.abstr.setUpGetSets=function(t,e){if(void 0!==Sk.builtin.getset_descriptor){var n=t.prototype;e=e||n.tp$getsets||{},Object.entries(e).forEach((e=>{var[i,s]=e;s.$name=i,n[a(i)]=new Sk.builtin.getset_descriptor(t,s)})),Object.defineProperty(n,"tp$getsets",{value:null,writable:!0})}},Sk.abstr.setUpMethods=function(t,e){if(void 0!==Sk.builtin.method_descriptor){var n=t.prototype;e=e||n.tp$methods||{},Object.entries(e).forEach((e=>{var[i,s]=e;s.$name=i,n[a(i)]=new Sk.builtin.method_descriptor(t,s)})),Object.defineProperty(n,"tp$methods",{value:null,writable:!0})}},Sk.abstr.setUpClassMethods=function(t,e){if(void 0!==Sk.builtin.classmethod_descriptor){var n=t.prototype;e=e||n.tp$classmethods||{},Object.entries(e).forEach((e=>{var[i,s]=e;s.$name=i,n[a(i)]=new Sk.builtin.classmethod_descriptor(t,s)})),Object.defineProperty(n,"tp$classmethods",{value:null,writable:!0})}};const l={Eq:"ob$eq",NotEq:"ob$ne",Gt:"ob$gt",GtE:"ob$ge",Lt:"ob$lt",LtE:"ob$le"},u=Object.entries(l);Sk.abstr.setUpSlots=function(t,e){function n(e,n){s[e]=new Sk.builtin.wrapper_descriptor(t,Sk.slots[e],n)}function i(t,e){"string"==typeof t?n(t,e):t.forEach((t=>{n(t,e)}))}if(void 0!==Sk.builtin.wrapper_descriptor){var s=t.prototype;(e=e||s.tp$slots||{}).tp$new===Sk.generic.new&&(e.tp$new=Sk.generic.new(t)),e.tp$richcompare?function(t){u.forEach((e=>{var[n,i]=e;t[i]=function(t){return this.tp$richcompare(t,n)}}))}(e):e.ob$eq&&(e.tp$richcompare=function(t,e){return this[l[e]].call(this,t)}),e.tp$as_number&&function(t){const e=Sk.reflectedNumberSlots;Object.keys(e).forEach((n=>{if(void 0!==t[n]){const i=e[n],s=i.reflected,r=t[s];void 0!==r?null===r&&delete t[s]:t[s]=i.slot||t[n]}}))}(e),e.tp$as_sequence_or_mapping&&function(t){const e=Sk.sequenceAndMappingSlots;Object.keys(e).forEach((n=>{void 0!==t[n]&&e[n].forEach((e=>{t[e]=t[n]}))}))}(e),Object.entries(e).forEach((t=>{var[e,n]=t;Object.defineProperty(s,e,{value:n,writable:!0})})),e.tp$new&&(s.__new__=new Sk.builtin.sk_method(Sk.generic.newMethodDef,t),Object.defineProperty(s,"sk$staticNew",{value:t,writable:!0})),Sk.subSlots.main_slots.forEach((t=>{var[n,s]=t;void 0!==(t=e[n])&&i(s,t)}));var r=e.tp$hash;void 0!==r&&("function"==typeof r?n("__hash__",r):r===Sk.builtin.none.none$?s.__hash__=r:Sk.asserts.fail("invalid tp$hash")),e.tp$as_number&&Sk.subSlots.number_slots.forEach((t=>{var[n,s]=t;void 0!==(t=e[n])&&i(s,t)})),e.tp$as_sequence_or_mapping&&Sk.subSlots.sequence_and_mapping_slots.forEach((t=>{var[n,s]=t;void 0!==(t=e[n])&&i(s,t)})),Object.defineProperty(s,"tp$slots",{value:null,writable:!0})}},Sk.abstr.buildNativeClass=function(t,e){e=e||{},Sk.asserts.assert(e.hasOwnProperty("constructor"),"A constructor is required to build a native class");let n=e.constructor;Sk.abstr.setUpInheritance(t,n,e.base,e.meta),Sk.abstr.setUpBuiltinMro(n);const i=n.prototype;return Object.defineProperties(i,{tp$slots:{value:e.slots,writable:!0},tp$getsets:{value:e.getsets,writable:!0},tp$methods:{value:e.methods,writable:!0},tp$classmethods:{value:e.classmethods,writable:!0}}),Sk.abstr.setUpSlots(n,e.slots||{}),Sk.abstr.setUpMethods(n,e.methods),Sk.abstr.setUpGetSets(n,e.getsets),Sk.abstr.setUpClassMethods(n,e.classmethods),Object.entries(e.proto||{}).forEach((t=>{var[e,n]=t;Object.defineProperty(i,e,{value:n,writable:!0,enumerable:!(e.includes("$")||e in Object.prototype)})})),Object.entries(e.flags||{}).forEach((t=>{var[e,i]=t;Object.defineProperty(n,e,{value:i,writable:!0})})),i.hasOwnProperty("tp$iter")&&(i[Symbol.iterator]=function(){return this.tp$iter()[Symbol.iterator]()}),void 0!==Sk.builtin.str&&i.hasOwnProperty("tp$doc")&&!i.hasOwnProperty("__doc__")&&(t=i.tp$doc||null,i.__doc__="string"==typeof t?new Sk.builtin.str(t):Sk.builtin.none.none$),n},Sk.abstr.buildIteratorClass=function(t,e){return Sk.asserts.assert(e.hasOwnProperty("constructor"),"must provide a constructor"),e.slots=e.slots||{},e.slots.tp$iter=Sk.generic.selfIter,e.slots.tp$iternext=e.slots.tp$iternext||e.iternext,e.slots.tp$getattr=e.slots.tp$getattr||Sk.generic.getAttr,t=Sk.abstr.buildNativeClass(t,e),Sk.abstr.built$iterators.push(t),t.prototype[Symbol.iterator]=function(){return{next:()=>{const t=this.tp$iternext();return{value:t,done:void 0===t}}}},t},Sk.abstr.built$iterators=[],Sk.abstr.setUpModuleMethods=function(t,e,n){return Object.entries(n).forEach((n=>{var[i,s]=n;s.$name=s.$name||i,e[i]=new Sk.builtin.sk_method(s,null,t)})),e},Sk.abstr.superConstructor=function(t,e,n){var i=Array.prototype.slice.call(arguments,2);t.prototype.tp$base.apply(e,i)}},function(t,e){function n(t){const e=t.prototype,n=e.tp$base;if(null==n)return!1;const i=n.prototype;return!(n.sk$solidSlotBase||t.sk$solidSlotBase||i.sk$hasDict!==e.sk$hasDict||n.sk$solidBase&&n!==Sk.builtin.module)}const i=new WeakMap;Sk.builtin.object=Sk.abstr.buildNativeClass("object",{constructor:function(){Sk.asserts.assert(this instanceof Sk.builtin.object,"bad call to object, use 'new'")},base:null,slots:{tp$new(t,e){if(t.length||e&&e.length){if(this.tp$new!==Sk.builtin.object.prototype.tp$new)throw new Sk.builtin.TypeError("object.__new__() takes exactly one argument (the type to instantiate)");if(this.tp$init===Sk.builtin.object.prototype.tp$init)throw new Sk.builtin.TypeError(Sk.abstr.typeName(this)+"() takes no arguments")}return new this.constructor},tp$init(t,e){if(t.length||e&&e.length){if(this.tp$init!==Sk.builtin.object.prototype.tp$init)throw new Sk.builtin.TypeError("object.__init__() takes exactly one argument (the instance to initialize)");if(this.tp$new===Sk.builtin.object.prototype.tp$new)throw new Sk.builtin.TypeError(Sk.abstr.typeName(this)+".__init__() takes exactly one argument (the instance to initialize)")}},tp$getattr:Sk.generic.getAttr,tp$setattr:Sk.generic.setAttr,$r(){const t=Sk.abstr.lookupSpecial(this,Sk.builtin.str.$module);let e="";return t&&Sk.builtin.checkString(t)&&(e=t.v+"."),new Sk.builtin.str("<"+e+Sk.abstr.typeName(this)+" object>")},tp$str(){return this.$r()},tp$hash(){let t=i.get(this);return void 0!==t||(t=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER-Number.MAX_SAFE_INTEGER/2),i.set(this,t)),t},tp$richcompare(t,e){switch(e){case"Eq":t=this===t||Sk.builtin.NotImplemented.NotImplemented$;break;case"NotEq":(t=this.ob$eq(t,"Eq"))!==Sk.builtin.NotImplemented.NotImplemented$&&(t=!Sk.misceval.isTrue(t));break;default:t=Sk.builtin.NotImplemented.NotImplemented$}return t},tp$doc:"The most base type"},getsets:{__class__:{$get(){return this.ob$type},$set(t){if(void 0===t)throw new Sk.builtin.TypeError("can't delete __class__ attribute");if(!Sk.builtin.checkClass(t))throw new Sk.builtin.TypeError("__class__ must be set to a class, not '"+Sk.abstr.typeName(t)+"' object");const e=this.ob$type;if(!(e.$isSubType(Sk.builtin.module)&&t.$isSubType(Sk.builtin.module)||void 0!==e.prototype.ht$type&&void 0!==t.prototype.ht$type))throw new Sk.builtin.TypeError(" __class__ assignment only supported for heap types or ModuleType subclasses");{let i=e,s=t;for(;n(i);)i=i.prototype.tp$base;for(;n(s);)s=s.prototype.tp$base;if(i!==s&&(i.prototype.tp$base!==s.prototype.tp$base||!function(t,e){t=t.prototype,e=e.prototype;const n=t.ht$slots,i=e.ht$slots;return t.sk$hasDict===e.sk$hasDict&&(n===i||(n&&i?n.length===i.length&&n.every(((t,e)=>t===i[e])):(n&&(n.length||null))===(i&&(i.length||null))))}(i,s)))throw new Sk.builtin.TypeError("__class__ assignment: '"+t.prototype.tp$name+"' object layout differs from '"+e.prototype.tp$name+"'")}Object.setPrototypeOf(this,t.prototype)},$doc:"the object's class"}},methods:{__dir__:{$meth:function(){let t=Sk.abstr.lookupAttr(this,Sk.builtin.str.$dict);t=void 0===t?new Sk.builtin.dict([]):t instanceof Sk.builtin.dict?t.dict$copy():new Sk.builtin.dict([]);const e=Sk.abstr.lookupAttr(this,Sk.builtin.str.$class);return void 0!==e&&e.$mergeClassDict(t),new Sk.builtin.list(t.sk$asarray())},$flags:{NoArgs:!0},$doc:"Default dir() implementation."},__format__:{$meth(t){if(!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("__format__() argument must be str, not "+Sk.abstr.typeName(t));if(t!==Sk.builtin.str.$empty)throw new Sk.builtin.TypeError(`unsupported format string passed to ${Sk.abstr.typeName(this)}.__format__`);return this.tp$str()},$flags:{OneArg:!0},$doc:"Default object formatter."}},classmethods:{__init_subclass__:{$meth:t=>Sk.builtin.none.none$,$flags:{FastCall:!0,NoKwargs:!0}}},proto:{valueOf:Object.prototype.valueOf,toString(){return this.tp$str().v},hasOwnProperty:Object.prototype.hasOwnProperty,ht$type:void 0,sk$attrError(){return"'"+this.tp$name+"' object"},$mergeClassDict(t){var e=Sk.abstr.lookupAttr(this,Sk.builtin.str.$dict);if(void 0!==e&&t.dict$merge(e),void 0!==(e=Sk.abstr.lookupAttr(this,Sk.builtin.str.$bases))){var n=Sk.builtin.len(e).valueOf();for(let i=0;ivoid 0===t?Sk.builtin.none.none$:t))}function r(t,e,n){return Sk.abstr.checkNoKwargs(this.$name,n),Sk.abstr.checkArgsLen(this.$name,e,1,2),void 0===(t=this.call(t,...e))?Sk.builtin.none.none$:t}function o(t,e,n){return Sk.abstr.checkNoKwargs(this.$name,n),Sk.abstr.checkArgsLen(this.$name,e,2,2),Sk.misceval.chain(this.call(t,e[0],e[1],!0),(()=>Sk.builtin.none.none$))}function a(t,e,n){return Sk.abstr.checkOneArg(this.$name,e,n),t=this.call(t,e[0],void 0,!0),Sk.misceval.chain(t,(t=>void 0===t?Sk.builtin.none.none$:t))}function l(t,e,n){return(t=i.call(this,t,e,n))===Sk.builtin.NotImplemented.NotImplemented$?t:new Sk.builtin.bool(t)}function u(t,e,n){return function(i,s,r){return i=t.call(this,i,s,r),n?Sk.misceval.chain(i,e):e(Sk.misceval.retryOptionalSuspensionOrThrow(i))}}function c(t){return function(){const e=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return Sk.misceval.callsimArray(e,[])}}function p(t,e,n,i){return function(s){return function(){var r=s.tp$descr_get?s.tp$descr_get(this,this.ob$type):s;if(r=Sk.misceval.callsimArray(r,[]),!e(r))throw new Sk.builtin.TypeError(t+" should return "+n+" (returned "+Sk.abstr.typeName(r)+")");return void 0!==i?i(r):r}}}function h(t){return function(e){const n=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return Sk.misceval.callsimArray(n,[e])}}function _(t,e){let n=this.ob$type.$typeLookup(Sk.builtin.str.$getattribute);if(n instanceof Sk.builtin.wrapper_descriptor)return n.d$wrapped.call(this,t,e);n.tp$descr_get&&(n=n.tp$descr_get(this,this.ob$type));const i=Sk.misceval.tryCatch((()=>Sk.misceval.callsimOrSuspendArray(n,[t])),(t=>{if(!(t instanceof Sk.builtin.AttributeError))throw t}));return e?i:Sk.misceval.retryOptionalSuspensionOrThrow(i)}function d(t,e,n){return function(i){return function(i,s,r){let o;void 0===s?(o=e,n=null):o=t;let a=this.ob$type.$typeLookup(new Sk.builtin.str(o));if(a instanceof Sk.builtin.wrapper_descriptor)return a.d$wrapped.call(this,i,s);if(a.tp$descr_get&&(a=a.tp$descr_get(this,this.ob$type,r)),void 0===a){if(n)throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(this)+"' object "+n);throw new Sk.builtin.AttributeError(o)}return i=Sk.misceval.callsimOrSuspendArray(a,void 0===s?[i]:[i,s]),r?i:Sk.misceval.retryOptionalSuspensionOrThrow(i)}}}function f(t,e){let n=t.ob$type;for(;n&&void 0!==n.sk$klass;)n=n.prototype.tp$base;if(n&&n.prototype.tp$setattr!==e)throw new Sk.builtin.TypeError("can't apply this "+e.$name+" to "+Sk.abstr.typeName(t)+" object")}Sk.slots=Object.create(null),t=Sk.slots,Sk.slots.__init__={$name:"__init__",$slot_name:"tp$init",$slot_func:function(t){return function(e,n){const i=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return e=Sk.misceval.callsimOrSuspendArray(i,e,n),Sk.misceval.chain(e,(t=>{if(!Sk.builtin.checkNone(t)&&void 0!==t)throw new Sk.builtin.TypeError("__init__() should return None, not "+Sk.abstr.typeName(t))}))}},$wrapper:function(t,e,n){return this.call(t,e,n),Sk.builtin.none.none$},$textsig:"($self, /, *args, **kwargs)",$flags:{FastCall:!0},$doc:"Initialize self. See help(type(self)) for accurate signature."},t.__new__={$name:"__new__",$slot_name:"tp$new",$slot_func:function(t){const e=function(e,n){let i=t;return t.tp$descr_get&&(i=t.tp$descr_get(null,this.constructor)),Sk.misceval.callsimOrSuspendArray(i,[this.constructor,...e],n)};return e.sk$static_new=!1,e},$wrapper:null,$textsig:"($self, /, *args, **kwargs)",$flags:{FastCall:!0},$doc:"Create and return a new object."},t.__call__={$name:"__call__",$slot_name:"tp$call",$slot_func:function(t){return function(e,n){const i=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return Sk.misceval.callsimOrSuspendArray(i,e,n)}},$wrapper:function(t,e,n){return void 0===(t=t.tp$call(e,n))?Sk.builtin.none.none$:t},$textsig:"($self, /, *args, **kwargs)",$flags:{FastCall:!0},$doc:"Call self as a function."},t.__repr__={$name:"__repr__",$slot_name:"$r",$slot_func:p("__repr__",Sk.builtin.checkString,"str"),$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Return repr(self)."},t.__str__={$name:"__str__",$slot_name:"tp$str",$slot_func:p("__str__",Sk.builtin.checkString,"str"),$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Return str(self)."};var m=p("__hash__",Sk.builtin.checkInt,"int",(t=>"number"==typeof t.v?t.v:t.tp$hash()));t.__hash__={$name:"__hash__",$slot_name:"tp$hash",$slot_func:function(t){return t===Sk.builtin.none.none$?Sk.builtin.none.none$:m(t)},$wrapper:u(n,(t=>new Sk.builtin.int_(t))),$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Return hash(self)."},t.__getattribute__={$name:"__getattribute__",$slot_name:"tp$getattr",$slot_func:function(t){return function(t,e){let n=this.ob$type.$typeLookup(Sk.builtin.str.$getattr);if(void 0===n)return _.call(this,t,e);const i=Sk.misceval.chain(_.call(this,t,e),(e=>Sk.misceval.tryCatch((()=>void 0!==e?e:(n.tp$descr_get&&(n=n.tp$descr_get(this,this.ob$type)),Sk.misceval.callsimOrSuspendArray(n,[t]))),(function(t){if(!(t instanceof Sk.builtin.AttributeError))throw t}))));return e?i:Sk.misceval.retryOptionalSuspensionOrThrow(i)}},$wrapper:function(t,e,n){Sk.abstr.checkOneArg(this.$name,e,n);const i=e[0];if(!Sk.builtin.checkString(i))throw new Sk.builtin.TypeError("attribute name must be string, not '"+Sk.abstr.typeName(i)+"'");return e=this.call(t,i,!0),Sk.misceval.chain(e,(e=>{if(void 0===e)throw new Sk.builtin.AttributeError(Sk.abstr.typeName(t)+" has no attribute "+i.$jsstr());return e}))},$textsig:"($self, name, /)",$flags:{OneArg:!0},$doc:"Return getattr(self, name)."},t.__getattr__={$name:"__getattr__",$slot_name:"tp$getattr",$slot_func:t.__getattribute__.$slot_func,$wrapper:null,$textsig:"($self, name, /)",$flags:{OneArg:!0},$doc:"Return getattr(self, name)."},t.__setattr__={$name:"__setattr__",$slot_name:"tp$setattr",$slot_func:d("__setattr__","__delattr__"),$wrapper:function(t,e,n){return Sk.abstr.checkNoKwargs(this.$name,n),Sk.abstr.checkArgsLen(this.$name,e,2,2),f(t,this),Sk.misceval.chain(this.call(t,e[0],e[1],!0),(()=>Sk.builtin.none.none$))},$textsig:"($self, name, value, /)",$flags:{MinArgs:2,MaxArgs:2},$doc:"Implement setattr(self, name, value)."},t.__delattr__={$name:"__delattr__",$slot_name:"tp$setattr",$slot_func:t.__setattr__.$slot_func,$wrapper:function(t,e,n){return Sk.abstr.checkOneArg(this.$name,e,n),f(t,this),this.call(t,e[0]),Sk.builtin.none.none$},$textsig:"($self, name, /)",$flags:{OneArg:!0},$doc:"Implement delattr(self, name)."},t.__get__={$name:"__get__",$slot_name:"tp$descr_get",$slot_func:function(t){return function(e,n,i){null===e&&(e=Sk.builtin.none.none$),null==n&&(n=Sk.builtin.none.none$);const s=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return e=Sk.misceval.callsimOrSuspendArray(s,[e,n]),i?e:Sk.misceval.retryOptionalSuspensionOrThrow(e)}},$wrapper:function(t,e,n){if(Sk.abstr.checkNoKwargs(this.$name,n),Sk.abstr.checkArgsLen(this.$name,e,1,2),n=e[0],e=e[1],n===Sk.builtin.none.none$&&(n=null),e===Sk.builtin.none.none$&&(e=null),null===e&&null===n)throw new Sk.builtin.TypeError("__get__(None, None) is invalid");return this.call(t,n,e,!0)},$textsig:"($self, instance, owner, /)",$flags:{MinArgs:2,MaxArgs:2},$doc:"Return an attribute of instance, which is of type owner."},t.__set__={$name:"__set__",$slot_name:"tp$descr_set",$slot_func:d("__set__","__delete__"),$wrapper:o,$textsig:"($self, instance, value, /)",$flags:{MinArgs:2,MaxArgs:2},$doc:"Set an attribute of instance to value."},t.__delete__={$name:"__delete__",$slot_name:"tp$descr_set",$slot_func:t.__set__.$slot_func,$wrapper:a,$textsig:"($self, instance, /)",$flags:{OneArg:!0},$doc:"Delete an attribute of instance."},t.__eq__={$name:"__eq__",$slot_name:"ob$eq",$slot_func:h,$wrapper:l,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self==value."},t.__ge__={$name:"__ge__",$slot_name:"ob$ge",$slot_func:h,$wrapper:l,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self>=value."},t.__gt__={$name:"__gt__",$slot_name:"ob$gt",$slot_func:h,$wrapper:l,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self>value."},t.__le__={$name:"__le__",$slot_name:"ob$le",$slot_func:h,$wrapper:l,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self<=value."},t.__lt__={$name:"__lt__",$slot_name:"ob$lt",$slot_func:h,$wrapper:l,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return selfSk.misceval.callsimOrSuspendArray(n,[])),(t=>{if(!(t instanceof Sk.builtin.StopIteration))throw t;this.gi$ret=t.$value}));return e?i:Sk.misceval.retryOptionalSuspensionOrThrow(i)}},$wrapper:function(t,e,n){return Sk.abstr.checkNoArgs(this.$name,e,n),Sk.misceval.chain(t.tp$iternext(!0),(t=>{if(void 0===t)throw new Sk.builtin.StopIteration;return t}))},$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Implement next(self)."},t.__len__={$name:"__len__",$slot_name:"sq$length",$slot_func:function(t){return function(e){const n=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return e?(e=Sk.misceval.callsimOrSuspendArray(n,[]),Sk.misceval.chain(e,(t=>Sk.misceval.asIndexOrThrow(t)))):(e=Sk.misceval.callsimArray(n,[]),Sk.misceval.asIndexOrThrow(e))}},$wrapper:u((function(t,e,n){return Sk.abstr.checkNoArgs(this.$name,e,n),t=this.call(t,!0),Sk.misceval.chain(t,(t=>void 0===t?Sk.builtin.none.none$:t))}),(t=>new Sk.builtin.int_(t)),!0),$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return len(self)."},t.__contains__={$name:"__contains__",$slot_name:"sq$contains",$slot_func:function(t){return function(e,n){const i=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return e=Sk.misceval.callsimOrSuspendArray(i,[e]),(e=Sk.misceval.chain(e,(t=>Sk.misceval.isTrue(t)))).$isSuspension?n?e:Sk.misceval.retryOptionalSuspensionOrThrow(e):e}},$wrapper:u(s,(t=>new Sk.builtin.bool(t)),!0),$textsig:"($self, key, /)",$flags:{OneArg:!0},$doc:"Return key in self."},t.__getitem__={$name:"__getitem__",$slot_name:"mp$subscript",$slot_func:function(t){return function(e,n){const i=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return e=Sk.misceval.callsimOrSuspendArray(i,[e]),n?e:Sk.misceval.retryOptionalSuspensionOrThrow(e)}},$wrapper:s,$textsig:"($self, key, /)",$flags:{OneArg:!0},$doc:"Return self[key]."},t.__setitem__={$name:"__setitem__",$slot_name:"mp$ass_subscript",$slot_func:d("__setitem__","__delitem__","does not support item assignment"),$wrapper:o,$textsig:"($self, key, value, /)",$flags:{MinArgs:2,MaxArgs:2},$doc:"Set self[key] to value."},t.__delitem__={$name:"__delitem__",$slot_name:"mp$ass_subscript",$slot_func:t.__setitem__.$slot_func,$wrapper:a,$textsig:"($self, key, /)",$flags:{OneArg:!0},$doc:"Delete self[key]."},t.__add__={$name:"__add__",$slot_name:"nb$add",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self+value."},t.__radd__={$name:"__radd__",$slot_name:"nb$reflected_add",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value+self."},t.__iadd__={$name:"__iadd__",$slot_name:"nb$inplace_add",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self+=value."},t.__sub__={$name:"__sub__",$slot_name:"nb$subtract",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self-value."},t.__rsub__={$name:"__rsub__",$slot_name:"nb$reflected_subtract",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value-self."},t.__imul__={$name:"__imul__",$slot_name:"nb$inplace_multiply",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self*=value."},t.__mul__={$name:"__mul__",$slot_name:"nb$multiply",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self*value."},t.__rmul__={$name:"__rmul__",$slot_name:"nb$reflected_multiply",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value*self."},t.__isub__={$name:"__isub__",$slot_name:"nb$inplace_subtract",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self-=value."},t.__mod__={$name:"__mod__",$slot_name:"nb$remainder",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self%value."},t.__rmod__={$name:"__rmod__",$slot_name:"nb$reflected_remainder",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value%self."},t.__imod__={$name:"__imod__",$slot_name:"nb$inplace_remainder",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement value%=self."},t.__divmod__={$name:"__divmod__",$slot_name:"nb$divmod",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return divmod(self, value)."},t.__rdivmod__={$name:"__rdivmod__",$slot_name:"nb$reflected_divmod",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return divmod(value, self)"},t.__pos__={$name:"__pos__",$slot_name:"nb$positive",$slot_func:c,$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"+self"},t.__neg__={$name:"__neg__",$slot_name:"nb$negative",$slot_func:c,$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"-self"},t.__abs__={$name:"__abs__",$slot_name:"nb$abs",$slot_func:c,$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"abs(self)"},t.__bool__={$name:"__bool__",$slot_name:"nb$bool",$slot_func:p("__bool__",Sk.builtin.checkBool,"bool",(t=>0!==t.v)),$wrapper:u(n,(t=>new Sk.builtin.bool(t))),$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"self != 0"},t.__invert__={$name:"__invert__",$slot_name:"nb$invert",$slot_func:c,$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"~self"},t.__lshift__={$name:"__lshift__",$slot_name:"nb$lshift",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self<>value."},t.__rrshift__={$name:"__rrshift__",$slot_name:"nb$reflected_rshift",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value>>self."},t.__ilshift__={$name:"__ilshift__",$slot_name:"nb$inplace_lshift",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self<<=value."},t.__irshift__={$name:"__irshift__",$slot_name:"nb$inplace_rshift",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self=>>value."},t.__and__={$name:"__and__",$slot_name:"nb$and",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self&value."},t.__rand__={$name:"__rand__",$slot_name:"nb$refelcted_and",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value&self."},t.__iand__={$name:"__iand__",$slot_name:"nb$and",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self&=value."},t.__xor__={$name:"__xor__",$slot_name:"nb$xor",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self^value."},t.__rxor__={$name:"__rxor__",$slot_name:"nb$reflected_xor",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value^self."},t.__ixor__={$name:"__ixor__",$slot_name:"nb$inplace_xor",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self^=value."},t.__or__={$name:"__or__",$slot_name:"nb$or",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self|value."},t.__ror__={$name:"__ror__",$slot_name:"nb$reflected_or",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value|self."},t.__ior__={$name:"__ior__",$slot_name:"nb$inplace_or",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self|=value."},t.__int__={$name:"__int__",$slot_name:"nb$int",$slot_func:p("__int__",Sk.builtin.checkInt,"int"),$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"int(self)"},t.__float__={$name:"__float__",$slot_name:"nb$float",$slot_func:p("__float__",Sk.builtin.checkFloat,"float"),$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"float(self)"},t.__floordiv__={$name:"__floordiv__",$slot_name:"nb$floor_divide",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self//value."},t.__rfloordiv__={$name:"__rfloordiv__",$slot_name:"nb$reflected_floor_divide",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value//self."},t.__ifloordiv__={$name:"__ifloordiv__",$slot_name:"nb$inplace_floor_divide",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self//=value."},t.__truediv__={$name:"__truediv__",$slot_name:"nb$divide",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self/value."},t.__rtruediv__={$name:"__rtruediv__",$slot_name:"nb$reflected_divide",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value/self."},t.__itruediv__={$name:"__itruediv__",$slot_name:"nb$inplace_divide",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self/=value."},t.__index__={$name:"__index__",$slot_name:"nb$index",$slot_func:p("__index__",Sk.builtin.checkInt,"int",(t=>t.v)),$wrapper:u(n,(t=>new Sk.builtin.int_(t))),$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"Return self converted to an integer, if self is suitable for use as an index into a list."},t.__pow__={$name:"__pow__",$slot_name:"nb$power",$slot_func:function(t){return function(e,n){const i=t.tp$descr_get?t.tp$descr_get(this,this.ob$type):t;return null==n?Sk.misceval.callsimArray(i,[e]):Sk.misceval.callsimArray(i,[e,n])}},$wrapper:r,$textsig:"($self, value, mod=None, /)",$flags:{MinArgs:1,MaxArgs:2},$doc:"Return pow(self, value, mod)."},t.__rpow__={$name:"__rpow__",$slot_name:"nb$reflected_power",$slot_func:t.__pow__.$slot_func,$wrapper:r,$textsig:"($self, value, mod=None, /)",$flags:{MinArgs:1,MaxArgs:2},$doc:"Return pow(value, self, mod)."},t.__ipow__={$name:"__ipow__",$slot_name:"nb$inplace_power",$slot_func:t.__pow__.$slot_func,$wrapper:r,$textsig:"($self, value, mod=None, /)",$flags:{MinArgs:1,MaxArgs:2},$doc:"Implement **="},t.__matmul__={$name:"__matmul__",$slot_name:"nb$matrix_multiply",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return self@value."},t.__rmatmul__={$name:"__rmatmul__",$slot_name:"nb$reflected_matrix_multiply",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Return value@self."},t.__imatmul__={$name:"__imatmul__",$slot_name:"nb$inplace_matrix_multiply",$slot_func:h,$wrapper:i,$textsig:"($self, value, /)",$flags:{OneArg:!0},$doc:"Implement self@=value."},t.__long__={$name:"__long__",$slot_name:"nb$long",$slot_func:p("__long__",Sk.builtin.checkInt,"int"),$wrapper:n,$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"int(self)"};var g,b={next:{$name:"next",$slot_name:"tp$iternext",$slot_func:t.__next__.$slot_func,$wrapper:t.__next__.$wrapper,$textsig:t.__next__.$textsig,$flags:t.__next__.$flags},__nonzero__:{$name:"__nonzero__",$slot_name:"nb$bool",$slot_func:p("__nonzero__",Sk.builtin.checkInt,"int",(t=>0!==t.v)),$wrapper:u(n,(t=>new Sk.builtin.bool(t))),$textsig:"($self, /)",$flags:{NoArgs:!0},$doc:"x.__nonzero__() <==> x != 0"},__div__:{$name:"__div__",$slot_name:"nb$divide",$slot_func:h,$wrapper:i,$textsig:"($self, other/)",$flags:{OneArg:!0},$doc:"x.__div__(y) <==> x/y"},__rdiv__:{$name:"__rdiv__",$slot_name:"nb$reflected_divide",$slot_func:h,$wrapper:i,$textsig:"($self, other/)",$flags:{OneArg:!0},$doc:"x.__rdiv__(y) <==> x/y"},__idiv__:{$name:"__idiv__",$slot_name:"nb$inplace_divide",$slot_func:h,$wrapper:i,$textsig:"($self, other/)",$flags:{OneArg:!0},$doc:"implement self /= other"}};Sk.subSlots={main_slots:Object.entries({tp$init:"__init__",tp$call:"__call__",$r:"__repr__",tp$str:"__str__",tp$getattr:"__getattribute__",tp$setattr:["__setattr__","__delattr__"],ob$eq:"__eq__",ob$ne:"__ne__",ob$lt:"__lt__",ob$le:"__le__",ob$gt:"__gt__",ob$ge:"__ge__",tp$descr_get:"__get__",tp$descr_set:["__set__","__delete__"],tp$iter:"__iter__",tp$iternext:"__next__"}),number_slots:Object.entries({nb$abs:"__abs__",nb$negative:"__neg__",nb$positive:"__pos__",nb$int:"__int__",nb$long:"__long__",nb$float:"__float__",nb$index:"__index__",nb$add:"__add__",nb$reflected_add:"__radd__",nb$inplace_add:"__iadd__",nb$subtract:"__sub__",nb$reflected_subtract:"__rsub__",nb$inplace_subtract:"__isub__",nb$multiply:"__mul__",nb$reflected_multiply:"__rmul__",nb$inplace_multiply:"__imul__",nb$floor_divide:"__floordiv__",nb$reflected_floor_divide:"__rfloordiv__",nb$inplace_floor_divide:"__ifloordiv__",nb$invert:"__invert__",nb$remainder:"__mod__",nb$reflected_remainder:"__rmod__",nb$inplace_remainder:"__imod__",nb$divmod:"__divmod__",nb$reflected_divmod:"__rdivmod__",nb$power:"__pow__",nb$reflected_power:"__rpow__",nb$inplace_power:"__ipow__",nb$divide:"__truediv__",nb$reflected_divide:"__rtruediv__",nb$inplace_divide:"__itruediv__",nb$bool:"__bool__",nb$and:"__and__",nb$reflected_and:"__rand__",nb$inplace_and:"__iand__",nb$or:"__or__",nb$reflected_or:"__ror__",nb$inplace_or:"__ior__",nb$xor:"__xor__",nb$reflected_xor:"__rxor__",nb$inplace_xor:"__ixor__",nb$lshift:"__lshift__",nb$reflected_lshift:"__rlshift__",nb$rshift:"__rshift__",nb$reflected_rshift:"__rrshift__",nb$inplace_lshift:"__ilshift__",nb$inplace_rshift:"__irshift__",nb$matrix_multiply:"__matmul__",nb$reflected_matrix_multiply:"__rmatmul__",nb$inplace_matrix_multiply:"__imatmul__"}),sequence_and_mapping_slots:Object.entries({sq$length:"__len__",sq$contains:"__contains__",mp$subscript:"__getitem__",mp$ass_subscript:["__setitem__","__delitem__"],nb$add:"__add__",nb$multiply:"__mul__",nb$reflected_multiply:"__rmul__",nb$inplace_add:"__iadd__",nb$inplace_multiply:"__imul__"})},Sk.reflectedNumberSlots={nb$add:{reflected:"nb$reflected_add"},nb$subtract:{reflected:"nb$reflected_subtract",slot:function(t){return t instanceof this.constructor?t.nb$subtract(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$multiply:{reflected:"nb$reflected_multiply"},nb$divide:{reflected:"nb$reflected_divide",slot:function(t){return t instanceof this.constructor?t.nb$divide(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$floor_divide:{reflected:"nb$reflected_floor_divide",slot:function(t){return t instanceof this.constructor?t.nb$floor_divide(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$remainder:{reflected:"nb$reflected_remainder",slot:function(t){return t instanceof this.constructor?t.nb$remainder(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$divmod:{reflected:"nb$reflected_divmod",slot:function(t){return t instanceof this.constructor?t.nb$divmod(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$power:{reflected:"nb$reflected_power",slot:function(t,e){return t instanceof this.constructor?t.nb$power(this,e):Sk.builtin.NotImplemented.NotImplemented$}},nb$and:{reflected:"nb$reflected_and"},nb$or:{reflected:"nb$reflected_or"},nb$xor:{reflected:"nb$reflected_xor"},nb$lshift:{reflected:"nb$reflected_lshift",slot:function(t){return t instanceof this.constructor?t.nb$lshift(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$rshift:{reflected:"nb$reflected_rshift",slot:function(t){return t instanceof this.constructor?t.nb$rshift(this):Sk.builtin.NotImplemented.NotImplemented$}},nb$matrix_multiply:{reflected:"nb$reflexted_matrix_multiply",slot:function(t){return t instanceof this.constructor?t.nb$matrix_multiply(this):Sk.builtin.NotImplemented.NotImplemented$}}},Sk.sequenceAndMappingSlots={sq$concat:["nb$add"],sq$repeat:["nb$multiply","nb$reflected_multiply"],mp$length:["sq$length"],sq$inplace_repeat:["nb$inplace_multiply"],sq$inplace_concat:["nb$inplace_add"]},Sk.dunderToSkulpt={__repr__:"$r",__str__:"tp$str",__init__:"tp$init",__new__:"tp$new",__hash__:"tp$hash",__call__:"tp$call",__iter__:"tp$iter",__next__:"tp$iternext",__eq__:"ob$eq",__ne__:"ob$ne",__lt__:"ob$lt",__le__:"ob$le",__gt__:"ob$gt",__ge__:"ob$ge",__abs__:"nb$abs",__neg__:"nb$negative",__pos__:"nb$positive",__int__:"nb$int",__float__:"nb$float",__index__:"nb$index",__add__:"nb$add",__radd__:"nb$reflected_add",__iadd__:"nb$inplace_add",__sub__:"nb$subtract",__rsub__:"nb$reflected_subtract",__isub__:"nb$inplace_subtract",__mul__:"nb$multiply",__rmul__:"nb$reflected_multiply",__imul__:"nb$inplace_multiply",__truediv__:"nb$divide",__rtruediv__:"nb$reflected_divide",__itruediv__:"nb$inplace_divide",__floordiv__:"nb$floor_divide",__rfloordiv__:"nb$reflected_floor_divide",__ifloordiv__:"nb$inplace_floor_divide",__invert__:"nb$invert",__mod__:"nb$remainder",__rmod__:"nb$reflected_remainder",__imod__:"nb$inplace_remainder",__divmod__:"nb$divmod",__rdivmod__:"nb$reflected_divmod",__pow__:"nb$power",__rpow__:"nb$reflected_power",__ipow__:"nb$inplace_power",__bool__:"nb$bool",__long__:"nb$long",__lshift__:"nb$lshift",__rlshift__:"nb$reflected_lshift",__ilshift__:"nb$inplace_lshift",__rshift__:"nb$rshift",__rrshift__:"nb$reflected_rshift",__irshift__:"nb$inplace_rshift",__and__:"nb$and",__rand__:"nb$reflected_and",__iand__:"nb$inplace_and",__or__:"nb$or",__ror__:"nb$reflected_or",__ior__:"nb$inplace_or",__xor__:"nb$xor",__rxor__:"nb$reflected_xor",__ixor__:"nb$inplace_xor",__matmul__:"nb$matrix_multiply",__rmatmul__:"nb$reflected_matrix_multiply",__imatmul__:"nb$inplace_matrix_multiply",__get__:"tp$descr_get",__set__:"tp$descr_set",__delete__:"tp$descr_set",__getattribute__:"tp$getattr",__getattr__:"tp$getattr",__setattr__:"tp$setattr",__delattr__:"tp$setattr",__len__:"sq$length",__contains__:"sq$contains",__getitem__:"mp$subscript",__setitem__:"mp$ass_subscript",__delitem__:"mp$ass_subscript"},Sk.exportSymbol("Sk.setupDunderMethods",Sk.setupDunderMethods),Sk.setupDunderMethods=function(t){function e(t,e,n){for(let i=0;i"tp$iternext"===t[0])),l=r.findIndex((t=>"nb$bool"===t[0])),u=Sk.dunderToSkulpt;if(t){u.__bool__="nb$bool",u.__next__="tp$iternext",delete u.__nonzero__,delete u.__div__,delete u.__rdiv__,delete u.__idiv__,delete u.next;for(let t in g)n[t]=g[t];for(let t in b)delete n[t];for(t=0;t")}const o={__doc__:{$get(){return this.d$def.$doc?new Sk.builtin.str(this.d$def.$doc):Sk.builtin.none.none$}},__objclass__:{$get(){return this.d$type}},__name__:{$get(){return new Sk.builtin.str(this.d$name)}}};t={__text_signature__:{$get(){return this.d$def.$textsig?new Sk.builtin.str(this.d$def.$textsig):Sk.builtin.none.none$}}},Sk.builtin.getset_descriptor=n("getset_descriptor",void 0,{constructor:function(t,e){this.d$def=e,this.$get=e.$get,this.$set=e.$set,this.d$type=t,this.d$name=e.$name},slots:{tp$descr_get(t,e,n){if(e=this.d$check(t))return e;if(void 0!==this.$get)return t=this.$get.call(t),n?t:Sk.misceval.retryOptionalSuspensionOrThrow(t);throw new Sk.builtin.AttributeError("getset_descriptor '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' objects is not readable")},tp$descr_set(t,e,n){if(this.d$set_check(t),void 0!==this.$set)return t=this.$set.call(t,e),n?t:Sk.misceval.retryOptionalSuspensionOrThrow(t);throw new Sk.builtin.AttributeError("attribute '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' objects is readonly")}}}),Sk.builtin.method_descriptor=n("method_descriptor","method",{constructor:function(t,e){this.d$def=e,this.$meth=e.$meth,this.d$type=t,this.d$name=e.$name||"",this.$flags=t=e.$flags||{},t.FastCall&&t.NoKwargs?this.tp$call=this.$methodFastCallNoKwargs:t.FastCall?this.tp$call=this.$methodFastCall:t.NoArgs?this.tp$call=this.$methodCallNoArgs:t.OneArg?this.tp$call=this.$methodCallOneArg:t.NamedArgs?this.tp$call=this.$methodCallNamedArgs:void 0!==t.MinArgs?this.tp$call=this.$methodCallMinArgs:(this.func_code=e.$meth,this.tp$call=this.$defaultCall,this.$memoiseFlags=Sk.builtin.func.prototype.$memoiseFlags,this.$resolveArgs=Sk.builtin.func.prototype.$resolveArgs)},slots:{tp$call(t,e){return this.tp$call(t,e)},tp$descr_get(t,e){let n;return(n=this.d$check(t))?n:new Sk.builtin.sk_method(this.d$def,t)}},getsets:t,proto:{$methodFastCall(t,e){const n=t.shift();return this.m$checkself(n),this.$meth.call(n,t,e)},$methodFastCallNoKwargs(t,e){const n=t.shift();return this.m$checkself(n),Sk.abstr.checkNoKwargs(this.d$name,e),this.$meth.call(n,t)},$methodCallNoArgs(t,e){const n=t.shift();return this.m$checkself(n),Sk.abstr.checkNoArgs(this.d$name,t,e),this.$meth.call(n)},$methodCallOneArg(t,e){const n=t.shift();return this.m$checkself(n),Sk.abstr.checkOneArg(this.d$name,t,e),this.$meth.call(n,t[0])},$methodCallNamedArgs(t,e){const n=t.shift();return this.m$checkself(n),t=Sk.abstr.copyKeywordsToNamedArgs(this.d$name,this.$flags.NamedArgs,t,e,this.$flags.Defaults),this.$meth.call(n,...t)},$methodCallMinArgs(t,e){const n=t.shift();return this.m$checkself(n),Sk.abstr.checkNoKwargs(this.d$name,e),Sk.abstr.checkArgsLen(this.d$name,t,this.$flags.MinArgs,this.$flags.MaxArgs),this.$meth.call(n,...t)},$defaultCall(t,e){return this.m$checkself(t[0]),Sk.builtin.func.prototype.tp$call.call(this,t,e)},m$checkself(t){if(void 0===t)throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' object needs an argument");this.d$check(t)}}}),Sk.builtin.wrapper_descriptor=n("wrapper_descriptor","slot wrapper",{constructor:function(t,e,n){this.d$def=e,this.d$type=t,this.d$name=n.$name=e.$name,this.d$wrapped=n},slots:{tp$descr_get(t,e){let n;return(n=this.d$check(t))?n:new Sk.builtin.method_wrapper(this,t)},tp$call(t,e){if(1>t.length)throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' object needs an argument");const n=t.shift();if(!n.ob$type.$isSubType(this.d$type))throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' requires a '"+this.d$type.prototype.tp$name+"' object but received a '"+Sk.abstr.typeName(n)+"'");return this.raw$call(n,t,e)}},proto:{raw$call(t,e,n){return this.d$wrapped.$name=this.d$name,this.d$def.$wrapper.call(this.d$wrapped,t,e,n)}}}),Sk.builtin.method_wrapper=n("method_wrapper",void 0,{constructor:function(t,e){this.m$descr=t,this.m$self=e,this.d$def=t.d$def,this.d$name=t.d$name,this.d$type=t.d$type},slots:{tp$call(t,e){return this.m$descr.raw$call(this.m$self,t,e)},tp$richcompare(t,e){return("Eq"===e||"NotEq"===e)&&t instanceof Sk.builtin.method_wrapper?(t=this.m$self===t.m$self&&this.m$descr===t.m$descr,"Eq"===e?t:!t):Sk.builtin.NotImplemented.NotImplemented$},$r(){return new Sk.builtin.str("")}},getsets:{__self__:{$get(){return this.m$self}}}}),Sk.builtin.classmethod_descriptor=n("classmethod_descriptor","method",{constructor:function(t,e){this.d$def=e,this.$meth=e.$meth,this.d$type=t,this.d$name=e.$name||""},slots:{tp$call(t,e){if(1>t.length)throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' of '"+this.d$type.prototype.tp$name+"' object needs an argument");const n=t.shift();return this.tp$descr_get(null,n).tp$call(t,e)},tp$descr_get(t,e,n){if(void 0===e){if(null===t)throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' for type '"+this.d$type.prototype.tp$name+"' needs an object or a type");e=e||t.ob$type}if(!e.ob$type.$isSubType(Sk.builtin.type))throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' for type '"+this.d$type.prototype.tp$name+"' needs a type not a '"+Sk.abstr.typeName(e)+"' as arg 2");if(!e.$isSubType(this.d$type))throw new Sk.builtin.TypeError("descriptor '"+this.d$name+"' requires a '"+this.d$type.prototype.tp$name+"' object but received a '"+Sk.abstr.typeName(e)+"' object");return new Sk.builtin.sk_method(this.d$def,e)}},getsets:t}),[Sk.builtin.method_descriptor,Sk.builtin.getset_descriptor,Sk.builtin.wrapper_descriptor,Sk.builtin.method_wrapper,Sk.builtin.classmethod_descriptor].forEach((t=>{Sk.abstr.setUpSlots(t),Sk.abstr.setUpMethods(t),Sk.abstr.setUpGetSets(t)}))},function(t,e){Sk.builtin.sk_method=Sk.abstr.buildNativeClass("builtin_function_or_method",{constructor:function(t,e,n){this.$meth=t.$meth.bind(e),this.$doc=t.$doc,this.$self=e||null,this.$module=n?new Sk.builtin.str(n):null,this.$name=t.$name||t.$meth.name||"",this.m$def=t,this.$textsig=t.$textsig,this.$flags=t=t.$flags||{},t.FastCall&&t.NoKwargs?this.tp$call=this.$fastCallNoKwargs:t.FastCall?this.tp$call=this.$meth:t.NoArgs?this.tp$call=this.$callNoArgs:t.OneArg?this.tp$call=this.$callOneArg:t.NamedArgs?this.tp$call=this.$callNamedArgs:void 0!==t.MinArgs?this.tp$call=this.$callMinArgs:(this.func_code=this.$meth,this.tp$call=this.$defaultCallMethod)},proto:{$fastCallNoKwargs(t,e){return Sk.abstr.checkNoKwargs(this.$name,e),this.$meth(t)},$callNoArgs(t,e){return Sk.abstr.checkNoArgs(this.$name,t,e),this.$meth()},$callOneArg(t,e){return Sk.abstr.checkOneArg(this.$name,t,e),this.$meth(t[0])},$callNamedArgs(t,e){return t=Sk.abstr.copyKeywordsToNamedArgs(this.$name,this.$flags.NamedArgs,t,e,this.$flags.Defaults),this.$meth(...t)},$callMinArgs(t,e){return Sk.abstr.checkNoKwargs(this.$name,e),Sk.abstr.checkArgsLen(this.$name,t,this.$flags.MinArgs,this.$flags.MaxArgs),this.$meth(...t)},$defaultCallMethod(t,e){return null!==this.$self?Sk.builtin.func.prototype.tp$call.call(this,[this.$self,...t],e):Sk.builtin.func.prototype.tp$call.call(this,t,e)},$memoiseFlags(){return Sk.builtin.func.prototype.$memoiseFlags.call(this)},$resolveArgs(){return Sk.builtin.func.prototype.$resolveArgs.call(this)}},flags:{sk$unacceptableBase:!0},slots:{tp$getattr:Sk.generic.getAttr,$r(){return null===this.$self?new Sk.builtin.str(""):new Sk.builtin.str("")},tp$call(t,e){return this.tp$call(t,e)},tp$richcompare(t,e){return("Eq"===e||"NotEq"===e)&&t instanceof Sk.builtin.sk_method?(t=this.$self===t.$self&&this.m$def.$meth===t.m$def.$meth,"Eq"===e?t:!t):Sk.builtin.NotImplemented.NotImplemented$}},getsets:{__module__:{$get(){return this.$module||Sk.builtin.none.none$},$set(t){this.$module=t=t||Sk.builtin.none.none$}},__doc__:{$get(){return this.$doc?new Sk.builtin.str(this.$doc):Sk.builtin.none.none$}},__name__:{$get(){return new Sk.builtin.str(this.$name)}},__text_signature__:{$get(){return new Sk.builtin.str(this.$textsig)}},__self__:{$get(){return this.$self||Sk.sysModules.mp$lookup(this.$module)||Sk.builtin.none.none$}}}})},function(t,e){Sk.builtin.none=Sk.abstr.buildNativeClass("NoneType",{constructor:function(){return Sk.builtin.none.none$},slots:{tp$new:(t,e)=>(Sk.abstr.checkNoArgs("NoneType",t,e),Sk.builtin.none.none$),$r:()=>new Sk.builtin.str("None"),tp$as_number:!0,nb$bool:()=>!1},proto:{valueOf:()=>null},flags:{sk$unacceptableBase:!0}}),Sk.builtin.none.none$=Object.create(Sk.builtin.none.prototype,{v:{value:null,enumerable:!0}}),Sk.builtin.NotImplemented=Sk.abstr.buildNativeClass("NotImplementedType",{constructor:function(){return Sk.builtin.NotImplemented.NotImplemented$},slots:{$r:()=>new Sk.builtin.str("NotImplemented"),tp$new:(t,e)=>(Sk.abstr.checkNoArgs("NotImplementedType",t,e),Sk.builtin.NotImplemented.NotImplemented$)},flags:{sk$unacceptableBase:!0}}),Sk.builtin.NotImplemented.NotImplemented$=Object.create(Sk.builtin.NotImplemented.prototype,{v:{value:null,enumerable:!0}}),t=Sk.abstr.buildNativeClass("ellipsis",{constructor:function(){return Sk.builtin.Ellipsis},slots:{tp$new:(t,e)=>(Sk.abstr.checkNoArgs("ellipsis",t,e),Sk.builtin.Ellipsis),$r:()=>new Sk.builtin.str("Ellipsis")},flags:{sk$unacceptableBase:!0}}),Sk.builtin.Ellipsis=Object.create(t.prototype,{v:{value:"..."}})},function(t,e){const n=/^(?:(.)?([<>=\^]))?([\+\-\s])?(#)?(0)?(\d+)?(,|_)?(?:\.(\d+))?([bcdeEfFgGnosxX%])?$/;Sk.formatting={};let i=function(t,e,n,i){if(Sk.asserts.assert("string"==typeof e),t[6]){var s=parseInt(t[6],10);i=t[2]||(t[5]?"=":i?">":"<");let r=s-(e.length+(n?n.length:0));if(0>=r)return n+e;switch(s=(t[1]||(t[5]?"0":" ")).repeat(r),i){case"=":if("s"===t[9])throw new Sk.builtin.ValueError("'=' alignment not allowed in string format specifier");return n+s+e;case">":return s+n+e;case"<":return n+e+s;case"^":return t=Math.floor(r/2),s.substring(0,t)+n+e+s.substring(t)}}return n+e},s=function(t,e){return e?"-":"+"===t[3]?"+":" "===t[3]?" ":""};const r=/\B(?=(\d{3})+(?!\d))/g,o=/\B(?=([A-Za-z0-9]{4})+(?![A-Za-z0-9]))/g;let a=function(t,e,n){if(Sk.asserts.assert(e instanceof Sk.builtin.int_||e instanceof Sk.builtin.lng),t[8])throw new Sk.builtin.ValueError("Precision not allowed in integer format");var a=e.str$(n,!1);e=e.nb$isnegative(),e=s(t,e),t[4]&&(16===n?e+="0x":8===n?e+="0o":2===n&&(e+="0b"));const l=t[9];if("X"===l&&(a=a.toUpperCase()),"n"===t[9])a=(+a).toLocaleString();else if(t[7]){a=a.split(".");const e=t[7];if(","===e&&10!==n)throw new Sk.builtin.ValueError(`Cannot specify ',' with '${l}'`);a[0]=a[0].replace(10===n?r:o,e),a=a.join(".")}return i(t,a,e,!0)};Sk.formatting.mkNumber__format__=t=>function(e){if(!Sk.builtin.checkString(e))throw new Sk.builtin.TypeError("format() argument 2 must be str, not "+Sk.abstr.typeName(e));return new Sk.builtin.str(function(t,e,r){if(!e)return t.str$(10,!0);if(!(e=e.match(n)))throw new Sk.builtin.ValueError("Invalid format specifier");var o=e[9];if(o||(o=r?"g":"d"),-1==(r?"fFeEgG%":"bcdoxXnfFeEgG%").indexOf(o))throw new Sk.builtin.ValueError("Unknown format code '"+e[9]+"' for object of type '"+Sk.abstr.typeName(t)+"'");switch(o){case"d":case"n":return a(e,t,10);case"x":case"X":return a(e,t,16);case"o":return a(e,t,8);case"b":return a(e,t,2);case"c":if(e[3])throw new Sk.builtin.ValueError("Sign not allowed with integer format specifier 'c'");if(e[4])throw new Sk.builtin.ValueError("Alternate form not allowed with integer format specifier 'c'");if(e[7])throw new Sk.builtin.ValueError("Cannot specify ',' with 'c'");if(e[8])throw new Sk.builtin.ValueError("Cannot specify ',' with 'c'");return i(e,String.fromCodePoint(Sk.builtin.asnum$(t)),"",!0);case"f":case"F":case"e":case"E":case"g":case"G":{if(e[4])throw new Sk.builtin.ValueError("Alternate form (#) not allowed in float format specifier");if("string"==typeof(r=Sk.builtin.asnum$(t))&&(r=Number(r)),1/0===r)return i(e,"inf","",!0);if(-1/0===r)return i(e,"inf","-",!0);if(isNaN(r))return i(e,"nan","",!0);t=!1,0>r&&(r=-r,t=!0);var l=["toExponential","toFixed","toPrecision"]["efg".indexOf(o.toLowerCase())];let n=e[8]?parseInt(e[8],10):6;if(r=r[l](n),-1!=="EFG".indexOf(o)&&(r=r.toUpperCase()),"g"===o.toLowerCase()||!e[9]){if(l=r.match(/\.(\d*[1-9])?(0+)$/)){let[,t,e]=l;r=r.slice(0,t?-e.length:-(e.length+1))}-1!=r.indexOf(".")||e[9]||(r+=".0")}return"e"===o.toLowerCase()&&(r=r.replace(/^([-+]?[0-9]*\.?[0-9]+[eE][-+]?)([0-9])?$/,"$10$2")),e[7]&&((o=r.toString().split("."))[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r=o.join(".")),i(e,r,s(e,t),!0)}case"%":if(e[4])throw new Sk.builtin.ValueError("Alternate form (#) not allowed with format specifier '%'");return"string"==typeof(t=Sk.builtin.asnum$(t))&&(t=Number(t)),1/0===t?i(e,"inf%","",!0):-1/0===t?i(e,"inf%","-",!0):isNaN(t)?i(e,"nan%","",!0):(o=!1,0>t&&(t=-t,o=!0),r=e[8]?parseInt(e[8],10):6,t=(100*t).toFixed(r)+"%",i(e,t,s(e,o),!0));default:throw new Sk.builtin.ValueError("Unknown format code '"+e[9]+"'")}}(this,e.$jsstr(),t))},Sk.formatting.format=function(t,e){e=e||[];const n={};for(let t=0;tn?1/0:n;null!=(o=s.exec(t))&&li)return new Sk.builtin.tuple([new Sk.builtin.str(""),new Sk.builtin.str(""),new Sk.builtin.str(n)])}else if(i=n.indexOf(e),0>i)return new Sk.builtin.tuple([new Sk.builtin.str(n),new Sk.builtin.str(""),new Sk.builtin.str("")]);return new Sk.builtin.tuple([new Sk.builtin.str(n.substring(0,i)),new Sk.builtin.str(e),new Sk.builtin.str(n.substring(i+e.length))])}}function o(t,e){return function(n,i){if(n=Sk.misceval.asIndexSized(n,Sk.builtin.OverflowError),void 0===i)i=" ";else{if(!(i instanceof Sk.builtin.str&&1===i.sq$length()))throw new Sk.builtin.TypeError("the fill character must be a str of length 1");i=i.v}var s=this.sq$length();return s>=n?new Sk.builtin.str(this.v):e?(s=n-s,n=Math.floor(s/2)+(s&n&1),i=i.repeat(n)+this.v+i.repeat(s-n),new Sk.builtin.str(i)):(i=i.repeat(n-s),new Sk.builtin.str(t?i+this.v:this.v+i))}}function a(t,e,n){if(({start:e,end:n}=Sk.builtin.slice.startEnd$wrt(t,e,n)),t.$hasAstralCodePoints()){const i=t.codepoints[e];e=void 0===i?e+t.v.length-t.codepoints.length:i,n=void 0===(n=t.codepoints[n])?t.v.length:n}return{start:e,end:n}}function l(t){return function(e,n,i){if(e=this.get$tgt(e),({start:n,end:i}=a(this,n,i)),i=n&&e<=i?e:-1,this.codepoints){i=this.sq$length(),n=-1;for(let t=0;ts)return Sk.builtin.bool.false$;if(i=this.v.slice(i,s),n instanceof Sk.builtin.tuple){for(let s=Sk.abstr.iter(n),r=s.tp$iternext();void 0!==r;r=s.tp$iternext()){if(!(r instanceof Sk.builtin.str))throw new Sk.builtin.TypeError("tuple for "+t+" must only contain str, not "+Sk.abstr.typeName(r));if(e(i,r.v))return Sk.builtin.bool.true$}return Sk.builtin.bool.false$}return new Sk.builtin.bool(e(i,n.v))}}function c(t){return void 0===g[t]?t:t+"_$rw$"}var p=/^[0-9!#_]/,h=Object.create(null);Sk.builtin.str=Sk.abstr.buildNativeClass("str",{constructor:function(t){if(Sk.asserts.assert(this instanceof Sk.builtin.str,"bad call to str - use 'new'"),"string"!=typeof t)if(void 0===t)t="";else if(null===t)t="None";else{if(void 0!==t.tp$str)return t.tp$str();if("number"!=typeof t)throw new Sk.builtin.TypeError("could not convert object of type '"+Sk.abstr.typeName(t)+"' to str");t=Number.isFinite(t)?String(t):String(t).replace("Infinity","inf").replace("NaN","nan")}const e=h[t];if(void 0!==e)return e;h[t]=this,this.$mangled=c(t),this.$savedKeyHash=t.replace(p,"!$&"),this.v=t},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$doc:"str(object='') -> str\nstr(bytes_or_buffer[, encoding[, errors]]) -> str\n\nCreate a new string object from the given object. If encoding or\nerrors is specified, then the object must expose a data buffer\nthat will be decoded using the given encoding and error handler.\nOtherwise, returns the result of object.__str__() (if defined)\nor repr(object).\nencoding defaults to sys.getdefaultencoding().\nerrors defaults to 'strict'.",tp$new(t,e){if(e=e||[],this!==Sk.builtin.str.prototype)return this.$subtype_new(t,e);if(1>=t.length&&!e.length)return new Sk.builtin.str(t[0]);if(Sk.__future__.python3){const[n,i,s]=Sk.abstr.copyKeywordsToNamedArgs("str",["object","encoding","errors"],t,e);if(void 0===n||void 0===i&&void 0===s)return new Sk.builtin.str(n);if(Sk.builtin.bytes.check$encodeArgs("str",i,s),!Sk.builtin.checkBytes(n))throw new Sk.builtin.TypeError("decoding to str: need a bytes-like object, "+Sk.abstr.typeName(n)+" found");return Sk.builtin.bytes.$decode.call(n,i,s)}throw new Sk.builtin.TypeError("str takes at most one argument ("+(t.length+e.length)+" given)")},$r(){let t="'";-1!==this.v.indexOf("'")&&-1===this.v.indexOf('"')&&(t='"');const e=this.v.length;let n=t;for(let r=0;rs||57344<=s)&&!Sk.__future__.python3?n+="\\u"+("000"+s.toString(16)).slice(-4):55296<=s&&!Sk.__future__.python3?(i=this.v.codePointAt(r),r++,s="0000000"+(i=i.toString(16)).toString(16),n=4i||127<=s&&!Sk.__future__.python3?(2>(i=i.charCodeAt(0).toString(16)).length&&(i="0"+i),n+="\\x"+i):n+=i}return new Sk.builtin.str(n+t)},tp$str(){return this.constructor===Sk.builtin.str?this:new Sk.builtin.str(this.v)},tp$iter(){return new m(this)},tp$richcompare(t,e){if(!(t instanceof Sk.builtin.str))return Sk.builtin.NotImplemented.NotImplemented$;switch(e){case"Lt":return this.vt.v;case"GtE":return this.v>=t.v}},mp$subscript(t){let e;if(Sk.misceval.isIndex(t)){if(t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError),e=this.sq$length(),0>t&&(t+=e),0>t||t>=e)throw new Sk.builtin.IndexError("string index out of range");return this.codepoints?new Sk.builtin.str(this.v.substring(this.codepoints[t],this.codepoints[t+1])):new Sk.builtin.str(this.v.charAt(t))}if(t instanceof Sk.builtin.slice){let n="";return e=this.sq$length(),this.codepoints?t.sssiter$(e,(t=>{n+=this.v.substring(this.codepoints[t],this.codepoints[t+1])})):t.sssiter$(e,(t=>{n+=this.v.charAt(t)})),new Sk.builtin.str(n)}throw new Sk.builtin.TypeError("string indices must be integers, not "+Sk.abstr.typeName(t))},sq$length(){return this.$hasAstralCodePoints()?this.codepoints.length:this.v.length},sq$concat(t){if(!(t instanceof Sk.builtin.str))throw new Sk.builtin.TypeError("cannot concatenate 'str' and '"+Sk.abstr.typeName(t)+"' objects");return new Sk.builtin.str(this.v+t.v)},sq$repeat(t){if(!Sk.misceval.isIndex(t))throw new Sk.builtin.TypeError("can't multiply sequence by non-int of type '"+Sk.abstr.typeName(t)+"'");if((t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError))*this.v.length>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError;let e="";for(let n=0;n' requires string as left operand not "+Sk.abstr.typeName(t));return-1!==this.v.indexOf(t.v)},tp$as_number:!0,nb$remainder:function(t){const e=this.sk$builtinBase;t.constructor===Sk.builtin.tuple||t instanceof Sk.builtin.dict||t instanceof Sk.builtin.mappingproxy||(t=new Sk.builtin.tuple([t]));var n=0,i=this.$jsstr().replace(/%(\([a-zA-Z0-9]+\))?([#0 +\-]+)?(\*|[0-9]+)?(\.(\*|[0-9]+))?[hlL]?([diouxXeEfFgGcrsb%])/g,(function(i,s,r,o,a,l,u){var c,p,h,_,d;o=Sk.builtin.asnum$(o),a=Sk.builtin.asnum$(a),void 0!==s&&""!==s||"%"==u||(c=n++),""===a&&(a=void 0);var f=p=h=_=d=!1;if(r&&(-1!==r.indexOf("-")?_=!0:-1!==r.indexOf("0")&&(d=!0),-1!==r.indexOf("+")?p=!0:-1!==r.indexOf(" ")&&(h=!0),f=-1!==r.indexOf("#")),a&&(a=parseInt(a.substr(1),10)),r=function(t,e){var n;e=Sk.builtin.asnum$(e);var i=!1;if("number"==typeof t){0>t&&(t=-t,i=!0);var s=t.toString(e)}else t instanceof Sk.builtin.float_?(2<(s=t.str$(e,!1)).length&&".0"===s.substr(-2)&&(s=s.substr(0,s.length-2)),i=t.nb$isnegative()):(t instanceof Sk.builtin.int_||t instanceof Sk.builtin.lng)&&(s=t.str$(e,!1),i=t.nb$isnegative());if(Sk.asserts.assert(void 0!==s,"unhandled number format"),t=!1,a)for(n=s.length;ne){for(this.codepoints=[],t=0;te&&t++;return!0}}return this.codepoints=null,!1},sk$asarray(){const t=[];if(this.$hasAstralCodePoints()){var e=this.codepoints;for(let n=0;ni)return new Sk.builtin.str(this.v.replace(t,e));let s=0;return t=this.v.replace(t,(t=>s++e?0:2*(t.length/2-e);for(e=[],0>=n?n=0:e.push(new Sk.builtin.str(this.v.slice(0,t[n-1])));n{if(!(t instanceof Sk.builtin.str))throw new Sk.builtin.TypeError("sequence item "+e.length+": expected str, "+Sk.abstr.typeName(t)+" found");e.push(t.v)})),(()=>new Sk.builtin.str(e.join(this.v))))},$flags:{OneArg:!0},$textsig:"($self, iterable, /)",$doc:"Concatenate any number of strings.\n\nThe string whose method is called is inserted in between each given string.\nThe result is returned as a new string.\n\nExample: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'"},capitalize:{$meth:function(){return new Sk.builtin.str(this.v.charAt(0).toUpperCase()+this.v.slice(1).toLowerCase())},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return a capitalized version of the string.\n\nMore specifically, make the first character have upper case and the rest lower\ncase."},title:{$meth:function(){const t=this.v.replace(/[a-z][a-z]*/gi,(t=>t[0].toUpperCase()+t.substr(1).toLowerCase()));return new Sk.builtin.str(t)},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return a version of the string where each word is titlecased.\n\nMore specifically, words start with uppercased characters and all remaining\ncased characters have lower case."},center:{$meth:o(!1,!0),$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, width, fillchar=' ', /)",$doc:"Return a centered string of length width.\n\nPadding is done using the specified fill character (default is a space)."},count:{$meth:function(t,e,n){return t=this.get$tgt(t),({start:e,end:n}=a(this,e,n)),n int\n\nReturn the number of non-overlapping occurrences of substring sub in\nstring S[start:end]. Optional arguments start and end are\ninterpreted as in slice notation."},expandtabs:{$meth:function(t){if(!Sk.builtin.checkInt(t))throw new Sk.builtin.TypeError("an integer is required, got type"+Sk.abstr.typeName(t));t=Sk.builtin.asnum$(t);const e=Array(t+1).join(" "),n=this.v.replace(/([^\r\n\t]*)\t/g,((n,i)=>i+e.slice(i.length%t)));return new Sk.builtin.str(n)},$flags:{NamedArgs:["tabsize"],Defaults:[8]},$textsig:"($self, /, tabsize=8)",$doc:"Return a copy where all tab characters are expanded using spaces.\n\nIf tabsize is not given, a tab size of 8 characters is assumed."},find:{$meth:function(t,e,n){return new Sk.builtin.int_(this.find$left(t,e,n))},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."},partition:{$meth:r(!1),$flags:{OneArg:!0},$textsig:"($self, sep, /)",$doc:"Partition the string into three parts using the given separator.\n\nThis will search for the separator in the string. If the separator is found,\nreturns a 3-tuple containing the part before the separator, the separator\nitself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing the original string\nand two empty strings."},index:{$meth:function(t,e,n){if(-1===(t=this.find$left(t,e,n)))throw new Sk.builtin.ValueError("substring not found");return new Sk.builtin.int_(t)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in S where substring sub is found, \nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the substring is not found."},ljust:{$meth:o(!1,!1),$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, width, fillchar=' ', /)",$doc:"Return a left-justified string of length width.\n\nPadding is done using the specified fill character (default is a space)."},lower:{$meth(){return new Sk.builtin.str(this.v.toLowerCase())},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return a copy of the string converted to lowercase."},lstrip:{$meth:s(/^\s+/g,(t=>"^["+t+"]+")),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, chars=None, /)",$doc:"Return a copy of the string with leading whitespace removed.\n\nIf chars is given and not None, remove characters in chars instead."},rfind:{$meth(t,e,n){return new Sk.builtin.int_(this.find$right(t,e,n))},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.rfind(sub[, start[, end]]) -> int\n\nReturn the highest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."},rindex:{$meth:function(t,e,n){if(-1===(t=this.find$right(t,e,n)))throw new Sk.builtin.ValueError("substring not found");return new Sk.builtin.int_(t)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the substring is not found."},rjust:{$meth:o(!0,!1),$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, width, fillchar=' ', /)",$doc:"Return a right-justified string of length width.\n\nPadding is done using the specified fill character (default is a space)."},rstrip:{$meth:s(/\s+$/g,(t=>"["+t+"]+$")),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, chars=None, /)",$doc:"Return a copy of the string with trailing whitespace removed.\n\nIf chars is given and not None, remove characters in chars instead."},rpartition:{$meth:r(!0),$flags:{OneArg:!0},$textsig:"($self, sep, /)",$doc:"Partition the string into three parts using the given separator.\n\nThis will search for the separator in the string, starting at the end. If\nthe separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing two empty strings\nand the original string."},splitlines:{$meth:function(t){t=Sk.misceval.isTrue(t);const e=this.v,n=[],i=e.length;var s=0;for(let o=0;o"^["+t+"]+|["+t+"]+$")),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, chars=None, /)",$doc:"Return a copy of the string with leading and trailing whitespace remove.\n\nIf chars is given and not None, remove characters in chars instead."},swapcase:{$meth(){const t=this.v.replace(/[a-z]/gi,(t=>{const e=t.toLowerCase();return e===t?t.toUpperCase():e}));return new Sk.builtin.str(t)},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Convert uppercase characters to lowercase and lowercase characters to uppercase."},upper:{$meth(){return new Sk.builtin.str(this.v.toUpperCase())},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return a copy of the string converted to uppercase."},startswith:{$meth:u("startswith",((t,e)=>0===t.indexOf(e))),$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if S starts with the specified prefix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nprefix can also be a tuple of strings to try."},endswith:{$meth:u("endswith",((t,e)=>-1!==t.indexOf(e,t.length-e.length))),$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"S.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if S ends with the specified suffix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nsuffix can also be a tuple of strings to try."},isascii:{$meth(){return new Sk.builtin.bool(/^[\x00-\x7F]*$/.test(this.v))},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return True if all characters in the string are ASCII, False otherwise.\n\nASCII characters have code points in the range U+0000-U+007F.\nEmpty string is ASCII too."},islower:{$meth:function(){return new Sk.builtin.bool(this.v.length&&/[a-z]/.test(this.v)&&!/[A-Z]/.test(this.v))},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return True if the string is a lowercase string, False otherwise.\n\nA string is lowercase if all cased characters in the string are lowercase and\nthere is at least one cased character in the string."},isupper:{$meth:function(){return new Sk.builtin.bool(this.v.length&&!/[a-z]/.test(this.v)&&/[A-Z]/.test(this.v))},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return True if the string is an uppercase string, False otherwise.\n\nA string is uppercase if all cased characters in the string are uppercase and\nthere is at least one cased character in the string."},istitle:{$meth:function(){const t=this.v;let e,n=!1,i=!1;for(let s=0;s str\n\nReturn a formatted version of S, using substitutions from args and kwargs.\nThe substitutions are identified by braces ('{' and '}')."},__format__:{$meth:Sk.formatting.formatString,$flags:{OneArg:!0},$textsig:"($self, format_spec, /)",$doc:"Return a formatted version of the string as described by format_spec."},__getnewargs__:{$meth(){return new Sk.builtin.tuple(new Sk.builtin.str(this.v))},$flags:{NoArgs:!0},$textsig:null,$doc:null}}}),Sk.exportSymbol("Sk.builtin.str",Sk.builtin.str);var _=/^[A-Za-z0-9]+$/,d=/([.*+?=|\\\/()\[\]\{\}^$])/g,f=/^[\s\xa0]+/;Sk.builtin.str.$py2decode=new Sk.builtin.method_descriptor(Sk.builtin.str,{$name:"decode",$meth(t,e){const n=new Sk.builtin.bytes(this.v);return Sk.builtin.bytes.$decode.call(n,t,e)},$flags:{NamedArgs:["encoding","errors"]}});var m=Sk.abstr.buildIteratorClass("str_iterator",{constructor:function(t){this.$index=0,t.$hasAstralCodePoints()?(this.$seq=t.codepoints,this.tp$iternext=()=>{const e=this.$seq[this.$index];if(void 0!==e)return new Sk.builtin.str(t.v.substring(e,this.$seq[++this.$index]))}):(this.$seq=t.v,this.tp$iternext=()=>{const t=this.$seq[this.$index++];if(void 0!==t)return new Sk.builtin.str(t)})},iternext(){return this.tp$iternext()},methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$unacceptableBase:!0}}),g={abstract:!0,as:!0,boolean:!0,break:!0,byte:!0,case:!0,catch:!0,char:!0,class:!0,continue:!0,const:!0,debugger:!0,default:!0,delete:!0,do:!0,double:!0,else:!0,enum:!0,export:!0,extends:!0,false:!0,final:!0,finally:!0,float:!0,for:!0,function:!0,goto:!0,if:!0,implements:!0,import:!0,in:!0,instanceof:!0,int:!0,interface:!0,is:!0,long:!0,namespace:!0,native:!0,new:!0,null:!0,package:!0,private:!0,protected:!0,public:!0,return:!0,short:!0,static:!0,super:!0,switch:!0,synchronized:!0,this:!0,throw:!0,throws:!0,transient:!0,true:!0,try:!0,typeof:!0,use:!0,var:!0,void:!0,volatile:!0,while:!0,with:!0,constructor:!0,__defineGetter__:!0,__defineSetter__:!0,apply:!0,arguments:!0,call:!0,caller:!0,eval:!0,hasOwnProperty:!0,isPrototypeOf:!0,__lookupGetter__:!0,__lookupSetter__:!0,__noSuchMethod__:!0,propertyIsEnumerable:!0,prototype:!0,toSource:!0,toLocaleString:!0,toString:!0,unwatch:!0,valueOf:!0,watch:!0,length:!0,name:!0};Sk.builtin.str.reservedWords_=g,Sk.builtin.str.$fixReserved=c},function(t,e){Sk.builtin.func=Sk.abstr.buildNativeClass("function",{constructor:function(t,e,n,i){if(Sk.asserts.assert(this instanceof Sk.builtin.func,"builtin func should be called as a class with `new`"),this.func_code=t,this.func_globals=e||null,this.$name=t.co_name&&t.co_name.v||t.name||"",this.$d=Sk.builtin.dict?new Sk.builtin.dict:void 0,this.$doc=t.co_docstring||Sk.builtin.none.none$,this.$module=Sk.globals&&Sk.globals.__name__||Sk.builtin.none.none$,this.$qualname=t.co_qualname&&t.co_qualname.v||this.$name,void 0!==i)for(let t in i)n[t]=i[t];this.func_closure=n,this.func_annotations=null,this.$memoiseFlags(),this.memoised=t.co_fastcall||null,this.tp$call=t.co_fastcall?t.bind(this):Sk.builtin.func.prototype.tp$call.bind(this)},slots:{tp$getattr:Sk.generic.getAttr,tp$descr_get(t,e){return null===t?this:new Sk.builtin.method(this,t)},$r(){return new Sk.builtin.str("")},tp$call(t,e){if(this.memoised||(this.$memoiseFlags(),this.memoised=!0),void 0===this.co_argcount&&void 0===this.co_varnames&&!this.co_kwargs&&!this.func_closure){if(e&&0!==e.length)throw new Sk.builtin.TypeError(this.$name+"() takes no keyword arguments");return this.func_code.apply(this.func_globals,t)}return t=this.$resolveArgs(t,e),this.func_closure&&t.push(this.func_closure),this.func_code.apply(this.func_globals,t)}},getsets:{__name__:{$get(){return new Sk.builtin.str(this.$name)},$set(t){if(!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("__name__ must be set to a string object");this.$name=t.$jsstr()}},__qualname__:{$get(){return new Sk.builtin.str(this.$qualname)},$set(t){if(!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("__qualname__ must be set to a string object");this.$qualname=t.$jsstr()}},__dict__:Sk.generic.getSetDict,__annotations__:{$get(){return null===this.func_annotations?this.func_annotations=new Sk.builtin.dict([]):Array.isArray(this.func_annotations)&&(this.func_annotations=Sk.abstr.keywordArrayToPyDict(this.func_annotations)),this.func_annotations},$set(t){if(void 0===t||Sk.builtin.checkNone(t))this.func_annotations=new Sk.builtin.dict([]);else{if(!(t instanceof Sk.builtin.dict))throw new Sk.builtin.TypeError("__annotations__ must be set to a dict object");this.func_annotations=t}}},__defaults__:{$get(){return null==this.$defaults?Sk.builtin.none.none$:new Sk.builtin.tuple(this.$defaults)},$set(t){if(void 0===t||Sk.builtin.checkNone(t))this.$defaults=null;else{if(!(t instanceof Sk.builtin.tuple))throw new Sk.builtin.TypeError("__defaults__ must be set to a tuple object");this.$defaults=t.valueOf()}}},__doc__:{$get(){return this.$doc},$set(t){this.$doc=t||Sk.builtin.none.none$}},__module__:{$get(){return this.$module},$set(t){this.$module=t||Sk.builtin.none.none$}}},proto:{$memoiseFlags(){this.co_varnames=this.func_code.co_varnames,this.co_argcount=this.func_code.co_argcount,void 0===this.co_argcount&&this.co_varnames&&(this.co_argcount=this.co_varnames.length),this.co_kwonlyargcount=this.func_code.co_kwonlyargcount||0,this.co_varargs=this.func_code.co_varargs,this.co_kwargs=this.func_code.co_kwargs,this.$defaults=this.func_code.$defaults,this.$kwdefs=this.func_code.$kwdefs||[]},$resolveArgs:function(t,e){var n=this.co_argcount;void 0===n&&(n=this.co_varnames?this.co_varnames.length:t.length);var i=this.co_varnames||[],s=this.co_kwonlyargcount||0;let r,o=n+s;if(!(0!==s||this.co_kwargs||e&&0!==e.length||this.co_varargs)){if(t.length==n)return t;if(0===t.length&&this.$defaults&&this.$defaults.length===n){for(i=0;i!=this.$defaults.length;i++)t[i]=this.$defaults[i];return t}}this.co_kwargs&&(r=[]);var a=t.length;let l=t.length<=n?t:t.slice(0,n);if(this.co_varargs)t=t.length>l.length?t.slice(l.length):[],l[o]=new Sk.builtin.tuple(t);else if(a>n)throw new Sk.builtin.TypeError(`${this.$name}"() takes ${n} positional ${1==n?"argument":"arguments"} but ${a} ${1==a?"was":"were"} given`);if(e){if(this.func_code.no_kw)throw new Sk.builtin.TypeError(this.$name+"() takes no keyword arguments");for(t=0;t"'"+t+"'")).join(", ")));for(;tt.indexOf(".")&&0>t.indexOf("e")&&0>t.indexOf("E"))return t;var e=0;if(0<=t.indexOf("e")){var n=t.substr(0,t.indexOf("e"));e=t.substr(t.indexOf("e")+1)}else 0<=t.indexOf("E")?(n=t.substr(0,t.indexOf("e")),e=t.substr(t.indexOf("E")+1)):n=t;if(e=parseInt(e,10),0>(t=n.indexOf("."))){if(0<=e){for(;0-e?n.substr(0,n.length+e):0}for(n=0===t?n.substr(1):tn.length;)n+="0";return 0>=t?0:n.substr(0,t)},Sk.exportSymbol("Sk.builtin.asnum$nofloat",Sk.builtin.asnum$nofloat),Sk.builtin.round=function(t,e){if(void 0===t)throw new Sk.builtin.TypeError("a float is required");if(!Sk.__future__.dunder_round){if(!Sk.builtin.checkNumber(t))throw new Sk.builtin.TypeError("a float is required");if(t.round$)return t.round$(e);throw new Sk.builtin.AttributeError(Sk.abstr.typeName(t)+" instance has no attribute '__float__'")}if(void 0!==e&&!Sk.builtin.checkNone(e)&&!Sk.misceval.isIndex(e))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(e)+"' object cannot be interpreted as an index");if(void 0!==(t=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$round)))return void 0!==e?Sk.misceval.callsimArray(t,[e]):Sk.misceval.callsimArray(t,[]);throw new Sk.builtin.TypeError("a float is required")},Sk.builtin.len=function(t){if(!t.sq$length)throw new Sk.builtin.TypeError("object of type '"+Sk.abstr.typeName(t)+"' has no len()");return t=t.sq$length(!0),Sk.misceval.chain(t,(t=>new Sk.builtin.int_(t)))},Sk.builtin.min=function(t,e){let n;const i=t.length;if(!i)throw new Sk.builtin.TypeError("min expected 1 argument, got 0");const[s,r]=Sk.abstr.copyKeywordsToNamedArgs("min",["default","key"],[],e,[null,Sk.builtin.none.none$]);if(1{if(o=t,void 0!==o)return Sk.builtin.checkNone(r)?Sk.misceval.iterFor(n,(t=>{Sk.misceval.richCompareBool(t,o,"Lt")&&(o=t)})):Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(r,[o]),(t=>Sk.misceval.iterFor(n,(e=>Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(r,[e]),(n=>{Sk.misceval.richCompareBool(n,t,"Lt")&&(o=e,t=n)}))))))}),(()=>{if(void 0===o){if(null===s)throw new Sk.builtin.ValueError("min() arg is an empty sequence");o=s}return o}))},Sk.builtin.max=function(t,e){let n;const i=t.length;if(!i)throw new Sk.builtin.TypeError("max expected 1 argument, got 0");const[s,r]=Sk.abstr.copyKeywordsToNamedArgs("max",["default","key"],[],e,[null,Sk.builtin.none.none$]);if(1{if(o=t,void 0!==o)return Sk.builtin.checkNone(r)?Sk.misceval.iterFor(n,(t=>{Sk.misceval.richCompareBool(t,o,"Gt")&&(o=t)})):Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(r,[o]),(t=>Sk.misceval.iterFor(n,(e=>Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(r,[e]),(n=>{Sk.misceval.richCompareBool(n,t,"Gt")&&(o=e,t=n)}))))))}),(()=>{if(void 0===o){if(null===s)throw new Sk.builtin.ValueError("max() arg is an empty sequence");o=s}return o}))},Sk.builtin.min.co_fastcall=Sk.builtin.max.co_fastcall=1,Sk.builtin.any=function(t){return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(function(t){if(Sk.misceval.isTrue(t))return new Sk.misceval.Break(Sk.builtin.bool.true$)})),(t=>t||Sk.builtin.bool.false$))},Sk.builtin.all=function(t){return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(function(t){if(!Sk.misceval.isTrue(t))return new Sk.misceval.Break(Sk.builtin.bool.false$)})),(t=>t||Sk.builtin.bool.true$))},Sk.builtin.sum=function(t,e){const n=Sk.abstr.iter(t);if(void 0===e)var i=new Sk.builtin.int_(0);else{if(Sk.builtin.checkString(e))throw new Sk.builtin.TypeError("sum() can't sum strings [use ''.join(seq) instead]");i=e}return t=void 0===e||e.constructor===Sk.builtin.int_?Sk.misceval.iterFor(n,(t=>{if(t.constructor!==Sk.builtin.int_)return t.constructor===Sk.builtin.float_?(i=i.nb$float().nb$add(t),new Sk.misceval.Break("float")):(i=Sk.abstr.numberBinOp(i,t,"Add"),new Sk.misceval.Break("slow"));i=i.nb$add(t)})):e.constructor===Sk.builtin.float_?"float":"slow",Sk.misceval.chain(t,(t=>"float"===t?Sk.misceval.iterFor(n,(t=>{if(t.constructor!==Sk.builtin.float_&&t.constructor!==Sk.builtin.int_)return i=Sk.abstr.numberBinOp(i,t,"Add"),new Sk.misceval.Break("slow");i=i.nb$add(t)})):t),(t=>{if("slow"===t)return Sk.misceval.iterFor(n,(t=>{i=Sk.abstr.numberBinOp(i,t,"Add")}))}),(()=>i))},Sk.builtin.zip=function(){var t,e;if(0===arguments.length)return new Sk.builtin.list([]);var n=[];for(e=0;et||1114112<=t)throw new Sk.builtin.ValueError("chr() arg not in range(0x110000)")}else if(0>t||256<=t)throw new Sk.builtin.ValueError("chr() arg not in range(256)");return new Sk.builtin.str(String.fromCodePoint(t))},Sk.builtin.unichr=function(t){if(Sk.builtin.pyCheckArgsLen("unichr",arguments.length,1,1),!Sk.builtin.checkInt(t))throw new Sk.builtin.TypeError("an integer is required");t=Sk.builtin.asnum$(t);try{return new Sk.builtin.str(String.fromCodePoint(t))}catch(t){if(t instanceof RangeError)throw new Sk.builtin.ValueError(t.message);throw t}},Sk.builtin.int2str_=function(t,e,n){let i=Sk.misceval.asIndexOrThrow(t),s=i.toString(e);return s=0>i?"-"+n+s.slice(1):n+s,2!==e&&!Sk.__future__.python3&&(t instanceof Sk.builtin.lng||JSBI.__isBigInt(i))&&(s+="L"),new Sk.builtin.str(s)},Sk.builtin.hex=function(t){if(!Sk.misceval.isIndex(t))throw new Sk.builtin.TypeError("hex() argument can't be converted to hex");return Sk.builtin.int2str_(t,16,"0x")},Sk.builtin.oct=function(t){if(!Sk.misceval.isIndex(t))throw new Sk.builtin.TypeError("oct() argument can't be converted to hex");return Sk.__future__.octal_number_literal?Sk.builtin.int2str_(t,8,"0o"):Sk.builtin.int2str_(t,8,"0")},Sk.builtin.bin=function(t){if(!Sk.misceval.isIndex(t))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object can't be interpreted as an index");return Sk.builtin.int2str_(t,2,"0b")},Sk.builtin.dir=function(t){if(void 0!==t)return t=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$dir),Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(t,[]),(t=>Sk.builtin.sorted(t)));throw new Sk.builtin.NotImplementedError("skulpt does not yet support dir with no args")},Sk.builtin.repr=function(t){return t.$r()},Sk.builtin.ascii=function(t){return Sk.misceval.chain(t.$r(),(t=>{let e,n;for(n=0;n=s?(2>(i=s.toString(16)).length&&(i="0"+i),e+="\\x"+i):127s||57344<=s?e+="\\u"+("000"+s.toString(16)).slice(-4):55296<=s?(i=t.v.codePointAt(n),n++,s="0000000"+(i=i.toString(16)).toString(16),e=4t.tp$getattr(e,!0)),(t=>{if(!(t instanceof Sk.builtin.AttributeError))throw t}));return Sk.misceval.chain(i,(i=>{if(void 0===i){if(void 0!==n)return n;throw new Sk.builtin.AttributeError(t.sk$attrError()+" has no attribute "+Sk.misceval.objectRepr(e))}return i}))},Sk.builtin.setattr=function(t,e,n){if(!Sk.builtin.checkString(e))throw new Sk.builtin.TypeError("attribute name must be string");return Sk.misceval.chain(t.tp$setattr(e,n,!0),(()=>Sk.builtin.none.none$))},Sk.builtin.raw_input=function(t){var e=t||"";return Sk.misceval.chain(Sk.importModule("sys",!1,!0),(function(t){return Sk.inputfunTakesPrompt?Sk.builtin.file.$readline(t.$d.stdin,null,e):Sk.misceval.chain(void 0,(function(){return Sk.misceval.callsimOrSuspendArray(t.$d.stdout.write,[t.$d.stdout,new Sk.builtin.str(e)])}),(function(){return Sk.misceval.callsimOrSuspendArray(t.$d.stdin.readline,[t.$d.stdin])}))}))},Sk.builtin.input=Sk.builtin.raw_input,Sk.builtin.jseval=function(t){return t=Sk.global.eval(Sk.ffi.remapToJs(t)),Sk.ffi.remapToPy(t)},Sk.builtin.jsmillis=function(){return console.warn("jsmillis is deprecated"),(new Date).valueOf()};const n=Sk.abstr.buildNativeClass("code",{constructor:function(t,e){this.compiled=e,this.code=e.code,this.filename=t},slots:{tp$new(t,e){throw new Sk.builtin.NotImplementedError("cannot construct a code object in skulpt")},$r(){return new Sk.builtin.str(", file "+this.filename+">")}}});Sk.builtin.compile=function(t,e,i,s,r,o){return Sk.builtin.pyCheckType("source","str",Sk.builtin.checkString(t)),Sk.builtin.pyCheckType("filename","str",Sk.builtin.checkString(e)),Sk.builtin.pyCheckType("mode","str",Sk.builtin.checkString(i)),t=t.$jsstr(),e=e.$jsstr(),i=i.$jsstr(),Sk.misceval.chain(Sk.compile(t,e,i,!0),(t=>new n(e,t)))},Sk.builtin.exec=function(t,e,i){let s=e&&e.__file__;if(s=void 0!==s&&Sk.builtin.checkString(s)?s.toString():"",Sk.builtin.checkString(t))t=Sk.compile(t.$jsstr(),s,"exec",!0);else if("string"==typeof t)t=Sk.compile(t,s,"exec",!0);else if(!(t instanceof n))throw new Sk.builtin.TypeError("exec() arg 1 must be a string, bytes or code object");Sk.asserts.assert(void 0===e||e.constructor===Object,"internal calls to exec should be called with a javascript object for globals"),Sk.asserts.assert(void 0===i||i.constructor===Object,"internal calls to exec should be called with a javascript object for locals");const r=Sk.globals;return e=e||r,Sk.misceval.chain(t,(t=>Sk.global.eval(t.code)(e,i)),(t=>(Sk.globals=r,t)))},Sk.builtin.eval=function(t,e,i){if(Sk.builtin.checkString(t))t=t.$jsstr();else if(Sk.builtin.checkBytes(t))throw new Sk.builtin.NotImplementedError("bytes for eval is not yet implemented in skulpt");if("string"==typeof t){t=t.trim();var s=Sk.parse("?",t);if(1<(s=Sk.astFromParse(s.cst,"?",s.flags)).body.length||!(s.body[0]instanceof Sk.astnodes.Expr))throw new Sk.builtin.SyntaxError("invalid syntax");t="__final_res__ = "+t}else if(!(t instanceof n))throw new Sk.builtin.TypeError("eval() arg 1 must be a string, bytes or code object");return Sk.misceval.chain(Sk.builtin.exec(t,e,i),(t=>{const e=t.__final_res__||Sk.builtin.none.none$;return delete t.__final_res__,e}))},Sk.builtin.map=function(t,e){var n,i,s=[];if(Sk.builtin.pyCheckArgsLen("map",arguments.length,2),2((t=new Sk.builtin.list(t)).list$sort(e,n,i),t)))},Sk.builtin.filter=function(t,e){var n;if(Sk.builtin.pyCheckArgsLen("filter",arguments.length,2,2),!Sk.builtin.checkIterable(e))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(e)+"' object is not iterable");var i=function(){return[]},s=function(t,e){return t.push(e),t},r=function(t){return new Sk.builtin.list(t)};e.ob$type===Sk.builtin.str?(i=function(){return new Sk.builtin.str("")},s=function(t,e){return t.sq$concat(e)},r=function(t){return t}):e.ob$type===Sk.builtin.tuple&&(r=function(t){return new Sk.builtin.tuple(t)});var o=i(),a=Sk.abstr.iter(e);for(n=a.tp$iternext();void 0!==n;n=a.tp$iternext())i=t===Sk.builtin.none.none$?new Sk.builtin.bool(n):Sk.misceval.callsimArray(t,[n]),Sk.misceval.isTrue(i)&&(o=s(o,n));return r(o)},Sk.builtin.hasattr=function(t,e){if(!Sk.builtin.checkString(e))throw new Sk.builtin.TypeError("hasattr(): attribute name must be string");const n=Sk.misceval.tryCatch((()=>t.tp$getattr(e,!0)),(t=>{if(!(t instanceof Sk.builtin.AttributeError))throw t}));return Sk.misceval.chain(n,(t=>void 0===t?Sk.builtin.bool.false$:Sk.builtin.bool.true$))},Sk.builtin.pow=function(t,e,n){if(void 0===n||Sk.builtin.checkNone(n))return Sk.abstr.numberBinOp(t,e,"Pow");if(!(Sk.builtin.checkInt(t)&&Sk.builtin.checkInt(e)&&Sk.builtin.checkInt(n))){if(Sk.builtin.checkFloat(t)||Sk.builtin.checkComplex(t))return t.nb$power(e,n);throw new Sk.builtin.TypeError("unsupported operand type(s) for ** or pow(): '"+Sk.abstr.typeName(t)+"', '"+Sk.abstr.typeName(e)+"', '"+Sk.abstr.typeName(n)+"'")}return t.nb$power(e,n)},Sk.builtin.quit=function(t){throw t=new Sk.builtin.str(t).v,new Sk.builtin.SystemExit(t)},Sk.builtin.issubclass=function(t,e){if(!Sk.builtin.checkClass(t))throw new Sk.builtin.TypeError("issubclass() arg 1 must be a class");var n=Sk.builtin.checkClass(e);if(!(n||e instanceof Sk.builtin.tuple))throw new Sk.builtin.TypeError("issubclass() arg 2 must be a class or tuple of classes");if(n)return t.$isSubType(e)?Sk.builtin.bool.true$:Sk.builtin.bool.false$;for(n=0;n{if(void 0===n){if(e)return e;if(void 0!==(n=t.gi$ret)&&n!==Sk.builtin.none.none$)throw new Sk.builtin.StopIteration(n);throw new Sk.builtin.StopIteration}return n}))},Sk.builtin.reload=function(){throw new Sk.builtin.NotImplementedError("reload is not yet implemented")},Sk.builtin.vars=function(){throw new Sk.builtin.NotImplementedError("vars is not yet implemented")},Sk.builtin.apply_=function(){throw new Sk.builtin.NotImplementedError("apply is not yet implemented")},Sk.builtin.buffer=function(){throw new Sk.builtin.NotImplementedError("buffer is not yet implemented")},Sk.builtin.coerce=function(){throw new Sk.builtin.NotImplementedError("coerce is not yet implemented")},Sk.builtin.intern=function(){throw new Sk.builtin.NotImplementedError("intern is not yet implemented")}},function(t,e){function n(t,e){return e=new this.constructor,this.ht$type&&a.call(e),e.args=new Sk.builtin.tuple(t.slice(0)),e}function i(t,e){Sk.abstr.checkNoKwargs(Sk.abstr.typeName(this),e),this.args=new Sk.builtin.tuple(t.slice(0))}function s(){return 1>=this.args.v.length?new Sk.builtin.str(this.args.v[0]):this.args.$r()}function r(t,e,n,s,r,o){r||(r=[]);const a=s?{}:{sk$solidBase:!1};return n={tp$init:s||i,tp$doc:n},o&&(n.tp$str=o),Sk.abstr.buildNativeClass(e,{base:t,constructor:function(...e){t.apply(this,e),r.forEach(((t,n)=>{this["$"+t]=Sk.ffi.remapToPy(e[n])}))},slots:n,getsets:Object.fromEntries(r.map((t=>[t,{$get(){return this["$"+t]||Sk.builtin.none.none$},$set(e){this["$"+t]=e||Sk.builtin.none.none$}}]))),flags:a})}function o(t,e,s){const r=t.prototype.tp$init;return s={tp$doc:s,tp$init:r},r===i&&(s.tp$new=n),Sk.abstr.buildNativeClass(e,{base:t,constructor:function(...e){t.apply(this,e)},slots:s,flags:{sk$solidBase:!1}})}const a=Sk.abstr.buildNativeClass("BaseException",{constructor:function t(e,...n){Sk.asserts.assert(this instanceof t,"bad call to exception constructor, use 'new'"),"string"==typeof e&&(e=new Sk.builtin.str(e)),this.args=new Sk.builtin.tuple(e?[e]:[]),this.traceback=2<=n.length?[{filename:n[0]||"",lineno:n[1]}]:[],this.context=this.cause=null,this.$d=new Sk.builtin.dict},slots:{tp$getattr:Sk.generic.getAttr,tp$doc:"Common base class for all exceptions",tp$new:n,tp$init:i,$r(){let t=this.tp$name;return t+="("+this.args.v.map((t=>Sk.misceval.objectRepr(t))).join(", ")+")",new Sk.builtin.str(t)},tp$str:s},getsets:{args:{$get(){return this.args},$set(t){if(void 0===t)throw new Sk.builtin.TypeError("args may not be deleted");this.args=new Sk.builtin.tuple(t)}},__cause__:{$get(){return this.$cause||Sk.builtin.none.none$},$set(t){if(!(Sk.builtin.checkNone(t)||t instanceof Sk.builtin.BaseException))throw new B("exception cause must be None or derive from BaseException");this.$cause=t}},__dict__:Sk.generic.getSetDict},proto:{toString(){let t=this.tp$name;return t+=": "+this.tp$str().v,0!==this.traceback.length?t+" on line "+this.traceback[0].lineno:t+" at "}}});t=o(a,"SystemExit","Request to exit from the interpreter."),e=o(a,"KeyboardInterrupt","Program interrupted by user.");const l=o(a,"GeneratorExit","Request that a generator exit."),u=o(a,"Exception","Common base class for all non-exit exceptions."),c=r(u,"StopIteration","Signal the end from iterator.__next__().",(function(t,e){i.call(this,t,e),this.$value=t[0]||Sk.builtin.none.none$}),["value"]),p=o(u,"StopAsyncIteration","Signal the end from iterator.__anext__()."),h=o(u,"ArithmeticError","Base class for arithmetic errors."),_=o(h,"FloatingPointError","Floating point operation failed."),d=o(h,"OverflowError","Result too large to be represented."),f=o(h,"ZeroDivisionError","Second argument to a division or modulo operation was zero."),m=o(u,"AssertionError","Assertion failed."),g=o(u,"AttributeError","Attribute not found."),b=o(u,"BufferError","Buffer error."),S=o(u,"EOFError","Read beyond end of file."),k=r(u,"ImportError","Import can't find module, or can't find name in module.",(function(t,e){i.call(this,t);const[n,s]=Sk.abstr.copyKeywordsToNamedArgs("ImportError",["name","path"],[],e);this.$name=n,this.$path=s,1===t.length&&(this.$msg=t[0])}),["msg","name","path"],(function(){return Sk.builtin.checkString(this.$msg)?this.$msg:s.call(this)})),y=o(k,"ModuleNotFoundError","Module not found."),T=o(u,"LookupError","Base class for lookup errors."),v=o(T,"IndexError","Sequence index out of range."),$=r(T,"KeyError","Mapping key not found.",null,null,(function(){return 1===this.args.v.length?this.args.v[0].$r():s.call(this)})),w=o(u,"MemoryError","Out of memory."),E=o(u,"NameError","Name not found globally."),I=o(E,"UnboundLocalError","Local name referenced but not bound to a value."),A=r(u,"OSError","Base class for I/O related errors.",(function(t,e){i.call(this,t,e)})),O=o(A,"FileNotFoundError","File not found."),M=o(A,"TimeoutError","Timeout expired."),C=o(u,"ReferenceError","Weak ref proxy used after referent went away."),R=o(u,"RuntimeError","Unspecified run-time error."),x=o(R,"NotImplementedError","Method or function hasn't been implemented yet."),N=o(R,"RecursionError","Recursion limit exceeded."),L=r(u,"SyntaxError","Invalid syntax.",(function(t,e){i.call(this,t,e),1<=t.length&&(this.$msg=t[0]),2===t.length&&(t=new Sk.builtin.tuple(t[1]).v,this.$filename=t[0],this.$lineno=t[1],this.$offset=t[2],this.$text=t[3])}),["msg","filename","lineno","offset","text"],(function(){return s.call(this)})),D=o(L,"IndentationError","Improper indentation."),F=o(D,"TabError","Improper mixture of spaces and tabs."),P=o(u,"SystemError","Internal error in the Skulpt interpreter."),B=o(u,"TypeError","Inappropriate argument type."),V=o(u,"ValueError","Inappropriate argument value (of correct type)."),U=o(V,"UnicodeError","Unicode related error."),Y=o(U,"UnicodeDecodeError","Unicode decoding error."),j=o(U,"UnicodeEncodeError","Unicode encoding error.");Object.assign(Sk.builtin,{BaseException:a,SystemExit:t,KeyboardInterrupt:e,GeneratorExit:l,Exception:u,StopIteration:c,StopAsyncIteration:p,ArithmeticError:h,FloatingPointError:_,OverflowError:d,ZeroDivisionError:f,AssertionError:m,AttributeError:g,BufferError:b,EOFError:S,ImportError:k,ModuleNotFoundError:y,LookupError:T,IndexError:v,KeyError:$,MemoryError:w,NameError:E,UnboundLocalError:I,OSError:A,IOError:A,FileNotFoundError:O,TimeoutError:M,ReferenceError:C,RuntimeError:R,NotImplementedError:x,RecursionError:N,SyntaxError:L,IndentationError:D,TabError:F,SystemError:P,TypeError:B,ValueError:V,UnicodeError:U,UnicodeDecodeError:Y,UnicodeEncodeError:j}),Sk.builtin.SuspensionError=o(u,"SuspensionError","Unsupported Suspension in code."),Sk.builtin.ExternalError=Sk.abstr.buildNativeClass("ExternalError",{constructor:function(...t){if(this.nativeError=t[0],!Sk.builtin.checkString(this.nativeError)&&(t[0]=this.nativeError.toString(),t[0].startsWith("RangeError: Maximum call")))return t[0]="Maximum call stack size exceeded",new N(...t);u.apply(this,t)},base:u}),Sk.builtin.getExcInfo=function(t){return new Sk.builtin.tuple([t.ob$type||Sk.builtin.none.none$,t,Sk.builtin.none.none$])}},function(t,e){Sk.builtin.method=Sk.abstr.buildNativeClass("method",{constructor:function(t,e){Sk.asserts.assert(this instanceof Sk.builtin.method,"bad call to method constructor, use 'new'"),this.im_func=t,this.im_self=e,this.im_call=t.tp$call},slots:{$r(){let t=this.im_func.tp$getattr(Sk.builtin.str.$qualname)||this.im_func.tp$getattr(Sk.builtin.str.$name);return t=t&&t.v||"?",new Sk.builtin.str("")},tp$hash(){return Sk.abstr.objectHash(this.im_self)+Sk.abstr.objectHash(this.im_func)},tp$call(t,e){var n=this.im_call;if(void 0===n)throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(this.im_func)+"' object is not callable");return t=[this.im_self,...t],n.call(this.im_func,t,e)},tp$new(t,e){if(Sk.abstr.checkNoKwargs("method",e),Sk.abstr.checkArgsLen("method",t,2,2),e=t[0],t=t[1],!Sk.builtin.checkCallable(e))throw new Sk.builtin.TypeError("first argument must be callable");if(Sk.builtin.checkNone(t))throw new Sk.builtin.TypeError("self must not be None");return new Sk.builtin.method(e,t)},tp$richcompare(t,e){if("Eq"!=e&&"NotEq"!=e||!(t instanceof Sk.builtin.method))return Sk.builtin.NotImplemented.NotImplemented$;let n;try{n=Sk.misceval.richCompareBool(this.im_self,t.im_self,"Eq",!1)&&this.im_func==t.im_func}catch(t){n=!1}return"Eq"==e?n:!n},tp$descr_get(t,e){return this},tp$getattr(t,e){const n=Sk.abstr.lookupSpecial(this,t);return void 0!==n?n:this.im_func.tp$getattr(t,e)}},getsets:{__func__:{$get(){return this.im_func}},__self__:{$get(){return this.im_self}},__doc__:{$get(){return this.im_func.tp$getattr(Sk.builtin.str.$doc)}}},flags:{sk$unacceptableBase:!0}})},function(t,e){function n(t){if(null!=t){if(!0===t.sk$int)return t.v;if(void 0!==t.nb$index)return t.nb$index();if("number"==typeof t&&Number.isInteger(t))return t}}function i(t,e){const i=n(t);if(void 0!==i)return i;throw e=(e||"'{tp$name}' object cannot be interpreted as an integer").replace("{tp$name}",Sk.abstr.typeName(t)),new Sk.builtin.TypeError(e)}Sk.misceval={},Sk.misceval.Suspension=function(t,e,n){this.$isSuspension=!0,void 0!==t&&void 0!==e&&(this.resume=function(){return t(e.resume())}),this.child=e,this.optional=void 0!==e&&e.optional,this.data=void 0===n&&void 0!==e?e.data:n},Sk.exportSymbol("Sk.misceval.Suspension",Sk.misceval.Suspension),Sk.misceval.retryOptionalSuspensionOrThrow=function(t,e){for(;t instanceof Sk.misceval.Suspension;){if(!t.optional){e=new Sk.builtin.SuspensionError(e||"Cannot call a function that blocks or suspends here");const n=[];for(;null!=t;)t.$lineno&&n.push({filename:t.$filename,lineno:t.$lineno,colno:t.$colno}),t=t.child;throw n.reverse(),e.traceback.push(...n),e}t=t.resume()}return t},Sk.exportSymbol("Sk.misceval.retryOptionalSuspensionOrThrow",Sk.misceval.retryOptionalSuspensionOrThrow),Sk.misceval.isIndex=function(t){return null!=t&&(void 0!==t.nb$index||"number"==typeof t&&Number.isInteger(t))},Sk.exportSymbol("Sk.misceval.isIndex",Sk.misceval.isIndex),Sk.misceval.asIndex=n,Sk.misceval.asIndexSized=function(t,e,n){if("number"==typeof(n=i(t,n)))return n;if(null==e)return JSBI.lessThan(n,JSBI.__ZERO)?-Number.MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;throw new e("cannot fit '"+Sk.abstr.typeName(t)+"' into an index-sized integer")},Sk.misceval.asIndexOrThrow=i,Sk.misceval.applySlice=function(t,e,n,i){return Sk.abstr.objectGetItem(t,new Sk.builtin.slice(e,n,null),i)},Sk.exportSymbol("Sk.misceval.applySlice",Sk.misceval.applySlice),Sk.misceval.assignSlice=function(t,e,n,i,s){return e=new Sk.builtin.slice(e,n),null===i?Sk.abstr.objectDelItem(t,e):Sk.abstr.objectSetItem(t,e,i,s)},Sk.exportSymbol("Sk.misceval.assignSlice",Sk.misceval.assignSlice),Sk.misceval.arrayFromArguments=function(t){var e;if(1!=t.length)return t;var n=t[0];if(n instanceof Sk.builtin.set?n=n.tp$iter().$obj:n instanceof Sk.builtin.dict&&(n=Sk.builtin.dict.prototype.keys.func_code(n)),n instanceof Sk.builtin.list||n instanceof Sk.builtin.tuple)return n.v;if(Sk.builtin.checkIterable(n)){for(t=[],e=(n=Sk.abstr.iter(n)).tp$iternext();void 0!==e;e=n.tp$iternext())t.push(e);return t}throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(n)+"' object is not iterable")},Sk.exportSymbol("Sk.misceval.arrayFromArguments",Sk.misceval.arrayFromArguments),Sk.misceval.iterator=Sk.abstr.buildIteratorClass("iterator",{constructor:function(t,e){this.tp$iternext=e?t:function(e){let n=t();return e||void 0===n||!n.$isSuspension?n:Sk.misceval.retryOptionalSuspensionOrThrow(n)}},iternext:function(t){return this.tp$iternext(t)},flags:{sk$unacceptableBase:!0}}),Sk.misceval.swappedOp_={Eq:"Eq",NotEq:"NotEq",Lt:"Gt",LtE:"GtE",Gt:"Lt",GtE:"LtE"},Sk.misceval.opSymbols={Eq:"==",NotEq:"!=",Lt:"<",LtE:"<=",Gt:">",GtE:">=",Is:"is",IsNot:"is not",In_:"in",NotIn:"not in"},Sk.misceval.richCompareBool=function(t,e,n,i){Sk.asserts.assert(t.sk$object&&e.sk$object,"JS object passed to richCompareBool");var s=t.ob$type,r=e.ob$type,o=r!==s&&void 0===r.sk$baseClass&&r.$isSubType(s);if(!Sk.__future__.python3&&s!==r&&("GtE"===n||"Gt"===n||"LtE"===n||"Lt"===n)){var a=[Sk.builtin.float_,Sk.builtin.int_,Sk.builtin.lng,Sk.builtin.bool];const i=[Sk.builtin.dict,Sk.builtin.enumerate,Sk.builtin.filter_,Sk.builtin.list,Sk.builtin.map_,Sk.builtin.str,Sk.builtin.tuple,Sk.builtin.zip_];var l=a.indexOf(s);if(s=i.indexOf(s),a=a.indexOf(r),r=i.indexOf(r),t===Sk.builtin.none.none$)switch(n){case"Lt":case"LtE":return!0;case"Gt":case"GtE":return!1}if(e===Sk.builtin.none.none$)switch(n){case"Lt":case"LtE":return!1;case"Gt":case"GtE":return!0}if(-1!==l&&-1!==r)switch(n){case"Lt":case"LtE":return!0;case"Gt":case"GtE":return!1}if(-1!==s&&-1!==a)switch(n){case"Lt":case"LtE":return!1;case"Gt":case"GtE":return!0}if(-1!==s&&-1!==r)switch(n){case"Lt":return sr;case"GtE":return s>=r}}if("Is"===n)return t===e;if("IsNot"===n)return t!==e;if("In"===n)return Sk.misceval.chain(Sk.abstr.sequenceContains(e,t,i),Sk.misceval.isTrue);if("NotIn"===n)return Sk.misceval.chain(Sk.abstr.sequenceContains(e,t,i),(function(t){return!Sk.misceval.isTrue(t)}));if(l=(r={Eq:"ob$eq",NotEq:"ob$ne",Gt:"ob$gt",GtE:"ob$ge",Lt:"ob$lt",LtE:"ob$le"})[n],o&&(i=e[i=r[Sk.misceval.swappedOp_[n]]](t))!==Sk.builtin.NotImplemented.NotImplemented$||(i=t[l](e))!==Sk.builtin.NotImplemented.NotImplemented$||!o&&(i=e[i=r[Sk.misceval.swappedOp_[n]]](t))!==Sk.builtin.NotImplemented.NotImplemented$)return Sk.misceval.isTrue(i);if(!Sk.__future__.python3){if(o=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$cmp))try{if(i=Sk.misceval.callsimArray(o,[e]),Sk.builtin.checkNumber(i)){if(i=Sk.builtin.asnum$(i),"Eq"===n)return 0===i;if("NotEq"===n)return 0!==i;if("Lt"===n)return 0>i;if("Gt"===n)return 0=i;if("GtE"===n)return 0<=i}if(i!==Sk.builtin.NotImplemented.NotImplemented$)throw new Sk.builtin.TypeError("comparison did not return an int")}catch(t){throw new Sk.builtin.TypeError("comparison did not return an int")}if(o=Sk.abstr.lookupSpecial(e,Sk.builtin.str.$cmp))try{if(i=Sk.misceval.callsimArray(o,[t]),Sk.builtin.checkNumber(i)){if(i=Sk.builtin.asnum$(i),"Eq"===n)return 0===i;if("NotEq"===n)return 0!==i;if("Lt"===n)return 0i;if("LtE"===n)return 0<=i;if("GtE"===n)return 0>=i}if(i!==Sk.builtin.NotImplemented.NotImplemented$)throw new Sk.builtin.TypeError("comparison did not return an int")}catch(t){throw new Sk.builtin.TypeError("comparison did not return an int")}if(t===Sk.builtin.none.none$&&e===Sk.builtin.none.none$){if("Eq"===n)return t.v===e.v;if("NotEq"===n)return t.v!==e.v;if("Gt"===n)return t.v>e.v;if("GtE"===n)return t.v>=e.v;if("Lt"===n)return t.v";throw t}},Sk.exportSymbol("Sk.misceval.objectRepr",Sk.misceval.objectRepr),Sk.misceval.opAllowsEquality=function(t){switch(t){case"LtE":case"Eq":case"GtE":return!0}return!1},Sk.exportSymbol("Sk.misceval.opAllowsEquality",Sk.misceval.opAllowsEquality),Sk.misceval.isTrue=function(t){return!0===t||t===Sk.builtin.bool.true$||!1!==t&&t!==Sk.builtin.bool.false$&&null!=t&&(t.nb$bool?t.nb$bool():t.sq$length?0!==t.sq$length():!!t)},Sk.exportSymbol("Sk.misceval.isTrue",Sk.misceval.isTrue),Sk.misceval.softspace_=!1,Sk.misceval.print_=function(t){Sk.misceval.softspace_&&("\n"!==t&&Sk.output(" "),Sk.misceval.softspace_=!1);var e=new Sk.builtin.str(t);return Sk.misceval.chain(Sk.importModule("sys",!1,!0),(function(t){return Sk.misceval.apply(t.$d.stdout.write,void 0,void 0,void 0,[t.$d.stdout,e])}),(function(){var t;(t=0===e.v.length)||(t=!("\n"===(t=e.v[e.v.length-1])||"\t"===t||"\r"===t)),(t||" "===e.v[e.v.length-1])&&(Sk.misceval.softspace_=!0)}))},Sk.exportSymbol("Sk.misceval.print_",Sk.misceval.print_),Sk.misceval.loadname=function(t,e){if(void 0!==(e=e[t]))return e;if(void 0!==(e=Sk.builtins[t]))return e;throw new Sk.builtin.NameError("name '"+Sk.unfixReserved(t)+"' is not defined")},Sk.exportSymbol("Sk.misceval.loadname",Sk.misceval.loadname),Sk.misceval.call=function(t,e,n,i,s){return s=Array.prototype.slice.call(arguments,4),Sk.misceval.apply(t,e,n,i,s)},Sk.exportSymbol("Sk.misceval.call",Sk.misceval.call),Sk.misceval.callAsync=function(t,e,n,i,s,r){return r=Array.prototype.slice.call(arguments,5),Sk.misceval.applyAsync(t,e,n,i,s,r)},Sk.exportSymbol("Sk.misceval.callAsync",Sk.misceval.callAsync),Sk.misceval.callOrSuspend=function(t,e,n,i,s){return s=Array.prototype.slice.call(arguments,4),Sk.misceval.applyOrSuspend(t,e,n,i,s)},Sk.exportSymbol("Sk.misceval.callOrSuspend",Sk.misceval.callOrSuspend),Sk.misceval.callsim=function(t,e){return e=Array.prototype.slice.call(arguments,1),Sk.misceval.apply(t,void 0,void 0,void 0,e)},Sk.exportSymbol("Sk.misceval.callsim",Sk.misceval.callsim),Sk.misceval.callsimArray=function(t,e,n){return e=e||[],Sk.misceval.retryOptionalSuspensionOrThrow(Sk.misceval.callsimOrSuspendArray(t,e,n))},Sk.exportSymbol("Sk.misceval.callsimArray",Sk.misceval.callsimArray),Sk.misceval.callsimAsync=function(t,e,n){return n=Array.prototype.slice.call(arguments,2),Sk.misceval.applyAsync(t,e,void 0,void 0,void 0,n)},Sk.exportSymbol("Sk.misceval.callsimAsync",Sk.misceval.callsimAsync),Sk.misceval.callsimOrSuspend=function(t,e){return e=Array.prototype.slice.call(arguments,1),Sk.misceval.applyOrSuspend(t,void 0,void 0,void 0,e)},Sk.exportSymbol("Sk.misceval.callsimOrSuspend",Sk.misceval.callsimOrSuspend),Sk.misceval.callsimOrSuspendArray=function(t,e,n){return e=e||[],void 0!==t&&t.tp$call?t.tp$call(e,n):Sk.misceval.applyOrSuspend(t,void 0,void 0,n,e)},Sk.exportSymbol("Sk.misceval.callsimOrSuspendArray",Sk.misceval.callsimOrSuspendArray),Sk.misceval.apply=function(t,e,n,i,s){return(t=Sk.misceval.applyOrSuspend(t,e,n,i,s))instanceof Sk.misceval.Suspension?Sk.misceval.retryOptionalSuspensionOrThrow(t):t},Sk.exportSymbol("Sk.misceval.apply",Sk.misceval.apply),Sk.misceval.asyncToPromise=function(t,e){return new Promise((function(n,i){try{!function t(s){try{for(var r=function(){try{t(s.resume())}catch(t){i(t)}},o=function(t){try{s.data.result=t,r()}catch(t){i(t)}},a=function(t){try{s.data.error=t,r()}catch(t){i(t)}};s instanceof Sk.misceval.Suspension;){var l=e&&(e[s.data.type]||e["*"]);if(l){var u=l(s);if(u)return void u.then(t,i)}if("Sk.promise"==s.data.type)return void s.data.promise.then(o,a);if("Sk.yield"==s.data.type)return void Sk.global.setImmediate(r);if("Sk.delay"==s.data.type)return void Sk.global.setImmediate(r);if(!s.optional)throw new Sk.builtin.SuspensionError("Unhandled non-optional suspension of type '"+s.data.type+"'");s=s.resume()}n(s)}catch(t){i(t)}}(t())}catch(t){i(t)}}))},Sk.exportSymbol("Sk.misceval.asyncToPromise",Sk.misceval.asyncToPromise),Sk.misceval.applyAsync=function(t,e,n,i,s,r){return Sk.misceval.asyncToPromise((function(){return Sk.misceval.applyOrSuspend(e,n,i,s,r)}),t)},Sk.exportSymbol("Sk.misceval.applyAsync",Sk.misceval.applyAsync),Sk.misceval.chain=function(t,e){for(var n,i,s=1,r=t;;){if(s==arguments.length)return r;if(r&&r.$isSuspension)break;r=arguments[s](r),s++}for(i=Array(arguments.length-s),n=0;nt[i++]},e,n)},Sk.misceval.arrayFromIterable=function(t,e){if(void 0===t)return[];if(void 0===t.ht$type&&void 0!==t.sk$asarray)return t.sk$asarray();const n=[];return t=Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{n.push(t)})),(()=>n)),e?t:Sk.misceval.retryOptionalSuspensionOrThrow(t)},Sk.misceval.Break=function(t){if(!(this instanceof Sk.misceval.Break))return new Sk.misceval.Break(t);this.brValue=t},Sk.exportSymbol("Sk.misceval.Break",Sk.misceval.Break),Sk.misceval.applyOrSuspend=function(t,e,n,i,s){var r;if(null==t||t===Sk.builtin.none.none$)throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object is not callable");"function"==typeof t&&void 0===t.tp$call&&(t=new Sk.builtin.func(t));var o=t.tp$call;if(void 0!==o){if(n)for(r=(n=n.tp$iter()).tp$iternext();void 0!==r;r=n.tp$iternext())s.push(r);if(e)for(r=(n=Sk.abstr.iter(e)).tp$iternext();void 0!==r;r=n.tp$iternext()){if(!Sk.builtin.checkString(r))throw new Sk.builtin.TypeError("Function keywords must be strings");i.push(r.v),i.push(Sk.abstr.objectGetItem(e,r,!1))}return o.call(t,s,i,e)}if(void 0!==(o=t.__call__))return s.unshift(t),Sk.misceval.apply(o,e,n,i,s);throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object is not callable")},Sk.exportSymbol("Sk.misceval.applyOrSuspend",Sk.misceval.applyOrSuspend),Sk.misceval.promiseToSuspension=function(t){var e=new Sk.misceval.Suspension;return e.resume=function(){if(e.data.error)throw e.data.error;return e.data.result},e.data={type:"Sk.promise",promise:t},e},Sk.exportSymbol("Sk.misceval.promiseToSuspension",Sk.misceval.promiseToSuspension),Sk.misceval.buildClass=function(t,e,n,i,s,r){n=new Sk.builtin.str(n);const o=new Sk.builtin.tuple(i);let a;i=i||[];var l=!0;const u=(r=r||[]).indexOf("metaclass");-1{if(t=t.ob$type,!n.$isSubType(t)){if(!t.$isSubType(n))throw new Sk.builtin.TypeError("metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases");n=t}})),n}(a,i));let c=null;a!==Sk.builtin.type&&([c,h]=function(t,e,n,i,s){const r=t.tp$getattr(Sk.builtin.str.$prepare);let o,a=null;if(void 0===r)return[a,o];if(a=Sk.misceval.callsimArray(r,[e,n],i),!Sk.builtin.checkMapping(a))throw new Sk.builtin.TypeError(s?t.prototype.tp$name:".__prepare__() must return a mapping not '"+Sk.abstr.typeName(a)+"'");return o={get(t,e){try{return Sk.abstr.objectGetItem(t,new Sk.builtin.str(Sk.unfixReserved(e)))}catch(t){if(!(t instanceof Sk.builtin.KeyError))throw t}},set:(t,e,n)=>(Sk.abstr.objectSetItem(t,new Sk.builtin.str(Sk.unfixReserved(e)),n),!0)},[a,o]}(a,n,o,r,l)),i=!1;let p={};if(null===c)c=new Sk.builtin.dict([]);else if(c.constructor===Sk.builtin.dict||function(){const t=(Sk.global.navigator||{}).userAgent||"";return-1{Sk.abstr.objectSetItem(c,new Sk.builtin.str(t),p[t])})),Sk.misceval.callsimOrSuspendArray(a,[n,o,c],r)},Sk.exportSymbol("Sk.misceval.buildClass",Sk.misceval.buildClass)},function(t,e){Sk.builtin.callable_iter_=Sk.abstr.buildIteratorClass("callable_iterator",{constructor:function(t,e){if(!Sk.builtin.checkCallable(t))throw new Sk.builtin.TypeError("iter(v, w): v must be callable");this.$callable=t,this.$sentinel=e,this.$flag=!1},iternext(t){if(!0!==this.$flag){if(t)return t=Sk.misceval.callsimOrSuspendArray(this.$callable,[]),Sk.misceval.chain(t,(t=>{if(!Sk.misceval.richCompareBool(t,this.$sentinel,"Eq",!0))return t;this.$flag=!0}));if(t=Sk.misceval.callsimArray(this.$callable,[]),!Sk.misceval.richCompareBool(t,this.$sentinel,"Eq",!1))return t;this.$flag=!0}},flags:{sk$unacceptableBase:!0}}),Sk.builtin.seq_iter_=Sk.abstr.buildIteratorClass("iterator",{constructor:function(t){this.$index=0,this.$seq=t},iternext(t){let e;return e=Sk.misceval.tryCatch((()=>this.$seq.mp$subscript(new Sk.builtin.int_(this.$index++),t)),(t=>{if(!(t instanceof Sk.builtin.IndexError||t instanceof Sk.builtin.StopIteration))throw t;this.gi$ret=t.$value||Sk.builtin.none.none$})),t?e:Sk.misceval.retryOptionalSuspensionOrThrow(e)},methods:{__length_hint__:{$flags:{NoArgs:!0},$meth(){if(this.$seq.sq$length)return this.$seq.sq$length()-this.$index;throw new Sk.builtin.NotImplementedError("len is not implemented for "+Sk.abstr.typeName(this.$seq))}}},flags:{sk$unacceptableBase:!0}}),Sk.exportSymbol("Sk.builtin.callable_iter_",Sk.builtin.callable_iter_)},function(t,e){Sk.builtin.list=Sk.abstr.buildNativeClass("list",{constructor:function(t){void 0===t?t=[]:Array.isArray(t)||(t=Sk.misceval.arrayFromIterable(t)),Sk.asserts.assert(this instanceof Sk.builtin.list,"bad call to list, use 'new' with an Array of python objects"),this.v=t,this.in$repr=!1},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$hash:Sk.builtin.none.none$,tp$doc:"Built-in mutable sequence.\n\nIf no argument is given, the constructor creates a new empty list.\nThe argument must be an iterable if specified.",tp$new:Sk.generic.new,tp$init(t,e){return Sk.abstr.checkNoKwargs("list",e),Sk.abstr.checkArgsLen("list",t,0,1),Sk.misceval.chain(Sk.misceval.arrayFromIterable(t[0],!0),(t=>{this.v=t}))},$r(){if(this.in$repr)return new Sk.builtin.str("[...]");this.in$repr=!0;const t=this.v.map((t=>Sk.misceval.objectRepr(t)));return this.in$repr=!1,new Sk.builtin.str("["+t.join(", ")+"]")},tp$richcompare:Sk.generic.seqCompare,tp$iter(){return new n(this)},sq$length(){return this.v.length},sq$concat(t){if(!(t instanceof Sk.builtin.list))throw new Sk.builtin.TypeError("can only concatenate list to list");return new Sk.builtin.list(this.v.concat(t.v))},sq$contains(t){for(let e=this.tp$iter(),n=e.tp$iternext();void 0!==n;n=e.tp$iternext())if(n===t||Sk.misceval.richCompareBool(n,t,"Eq"))return!0;return!1},sq$repeat(t){if(!Sk.misceval.isIndex(t))throw new Sk.builtin.TypeError("can't multiply sequence by non-int of type '"+Sk.abstr.typeName(t)+"'");if((t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError))*this.v.length>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError;const e=[];for(let n=0;n{e.push(this.v[t])})),new Sk.builtin.list(e)}throw new Sk.builtin.TypeError("list indices must be integers or slices, not "+Sk.abstr.typeName(t))},mp$ass_subscript(t,e){void 0===e?this.del$subscript(t):this.ass$subscript(t,e)},sq$inplace_concat(t){return t===this?(this.v.push(...this.v),this):Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{this.v.push(t)})),(()=>this))},sq$inplace_repeat(t){if(!Sk.misceval.isIndex(t))throw new Sk.builtin.TypeError("can't multiply sequence by non-int of type '"+Sk.abstr.typeName(t)+"'");t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError);const e=this.v.length;if(0>=t)this.v.length=0;else if(t*e>Number.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError;for(let n=1;n{this.v.push(t)})),(()=>Sk.builtin.none.none$))},$flags:{OneArg:!0},$textsig:"($self, iterable, /)",$doc:"Extend list by appending elements from the iterable."},pop:{$meth(t){t=void 0===t?this.v.length-1:Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError),t=this.list$inRange(t,"pop index out of range");const e=this.v[t];return this.v.splice(t,1),e},$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, index=-1, /)",$doc:"Remove and return item at index (default last).\n\nRaises IndexError if list is empty or index is out of range."},remove:{$meth(t){if(-1===(t=this.list$indexOf(t)))throw new Sk.builtin.ValueError("list.remove(x): x not in list");return this.v.splice(t,1),Sk.builtin.none.none$},$flags:{OneArg:!0},$textsig:"($self, value, /)",$doc:"Remove first occurrence of value.\n\nRaises ValueError if the value is not present."},sort:{$meth(t,e){if(t.length)throw new Sk.builtin.TypeError("sort() takes no positional arguments");const[n,i]=Sk.abstr.copyKeywordsToNamedArgs("sort",["key","reverse"],t,e,[Sk.builtin.none.none$,Sk.builtin.bool.false$]);return this.list$sort(void 0,n,i)},$flags:{FastCall:!0},$textsig:"($self, /, *, key=None, reverse=False)",$doc:"Stable sort *IN PLACE*."},index:{$meth(t,e,n){if(void 0!==e&&!Sk.misceval.isIndex(e)||void 0!==n&&!Sk.misceval.isIndex(n))throw new Sk.builtin.TypeError("slice indices must be integers or have an __index__ method");if(-1===(e=this.list$indexOf(t,e,n)))throw new Sk.builtin.ValueError(Sk.misceval.objectRepr(t)+" is not in list");return new Sk.builtin.int_(e)},$flags:{MinArgs:1,MaxArgs:3},$textsig:"($self, value, start=0, stop=sys.maxsize, /)",$doc:"Return first index of value.\n\nRaises ValueError if the value is not present."},count:{$meth(t){let e=0;const n=this.v.length;for(let i=0;it&&(t+=this.v.length),0<=t&&t{n.push(t)})),!Sk.builtin.checkIterable(e))throw new Sk.builtin.TypeError("must assign iterable to extended slice");if(t=Sk.misceval.arrayFromIterable(e),n.length!==t.length)throw new Sk.builtin.ValueError("attempt to assign sequence of size "+t.length+" to extended slice of size "+n.length);for(e=0;e{this.v.splice(t-n,1),n+=e}))},valueOf(){return this.v}}}),Sk.exportSymbol("Sk.builtin.list",Sk.builtin.list),Sk.builtin.list.py2$methods={sort:{$name:"sort",$meth(t,e){const[n,i,s]=Sk.abstr.copyKeywordsToNamedArgs("sort",["cmp","key","reverse"],t,e,[Sk.builtin.none.none$,Sk.builtin.none.none$,Sk.builtin.bool.false$]);return this.list$sort(n,i,s)},$flags:{FastCall:!0},$textsig:"($self, cmp=None, key=None, reverse=False)",$doc:"Stable sort *IN PLACE*."}};var n=Sk.abstr.buildIteratorClass("list_iterator",{constructor:function(t){this.$index=0,this.$seq=t.v},iternext:Sk.generic.iterNextWithArray,methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$unacceptableBase:!0}}),i=Sk.abstr.buildIteratorClass("list_reverseiterator",{constructor:function(t){this.$index=t.v.length-1,this.$seq=t.v},iternext(){const t=this.$seq[this.$index--];if(void 0!==t)return t;this.tp$iternext=()=>{}},methods:{__length_hint__:Sk.generic.iterReverseLengthHintMethodDef},flags:{sk$unacceptableBase:!0}})},function(t,e,n){function i(t){var e=t.replace(y,"").replace(T,"_").toLowerCase();return void 0===(e=k[e])?t:e}function s(t,e,n){if(void 0===e)e="utf-8";else{if(!Sk.builtin.checkString(e))throw new Sk.builtin.TypeError(t+"() argument "+("bytesstr".includes(t)?2:1)+" must be str not "+Sk.abstr.typeName(e));e=e.$jsstr()}if(void 0===n)n="strict";else{if(!Sk.builtin.checkString(n))throw new Sk.builtin.TypeError(t+"() argument "+("bytesstr".includes(t)?3:2)+" must be str not "+Sk.abstr.typeName(n));n=n.$jsstr()}return{encoding:e,errors:n}}function r(t,e,n){if(t=t.$jsstr(),e=i(e),"strict"!==n&&"ignore"!==n&&"replace"!==n)throw new Sk.builtin.NotImplementedError("'"+n+"' error handling not implemented in Skulpt");if("ascii"===e){for(s in e=[],t){const i=t.charCodeAt(s);if(127=t?"\\x":"\\u";return 3===(t=t.toString(16)).length&&(t=t.slice(1,3)),1===t.length?e+"0"+t:e+t}function a(t,e){if(({encoding:t,errors:e}=s("decode",t,e)),t=i(t),"strict"!==e&&"ignore"!==e&&"replace"!==e)throw new Sk.builtin.NotImplementedError("'"+e+"' error handling not implemented in Skulpt");if("ascii"===t){t=this.v;var n="";for(let i=0;i=n&&en)return new Sk.builtin.tuple([new Sk.builtin.bytes,new Sk.builtin.bytes,this])}else if(n=this.find$subleft(e,0,this.v.length),0>n)return new Sk.builtin.tuple([this,new Sk.builtin.bytes,new Sk.builtin.bytes]);return new Sk.builtin.tuple([new Sk.builtin.bytes(this.v.subarray(0,n)),new Sk.builtin.bytes(e),new Sk.builtin.bytes(this.v.subarray(n+e.length))])}}function p(t,e){return function(n){var i=void 0===n||n===Sk.builtin.none.none$?new Uint8Array([9,10,11,12,13,32,133]):this.get$raw(n);n=0;var s=this.v.length;if(t)for(;nn&&i.includes(this.v[s-1]);)s--;for(i=new Uint8Array(s-n),s=0;s=t||32===t}function d(t){return 97<=t&&122>=t}function f(t){return 65<=t&&90>=t}function m(t){return 48<=t&&57>=t}function g(t,e){return function(){return 0===this.v.length?e?Sk.builtin.bool.true$:Sk.builtin.bool.false$:this.v.every((e=>t(e)))?Sk.builtin.bool.true$:Sk.builtin.bool.false$}}function b(t,e){return function(){let n=!1;for(let i=0;i0<=t&&255>=t)),"bad internal call to bytes with array"),this.v=new Uint8Array(t);else if("string"==typeof t){let e;const n=new Uint8Array(t.length),i=t.length;for(let s=0;s bytes\nbytes(string, encoding[, errors]) -> bytes\nbytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\nbytes(int) -> bytes object of size given by the parameter initialized with null bytes\nbytes() -> empty bytes object\n\nConstruct an immutable array of bytes from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - any object implementing the buffer API.\n - an integer",tp$new(t,e){if(this!==Sk.builtin.bytes.prototype)return this.$subtype_new(t,e);let n;if(e=e||[],!(1>=t.length&&0==+e.length)){if([t,e,n]=Sk.abstr.copyKeywordsToNamedArgs("bytes",[null,"pySource","errors"],t,e),({encoding:e,errors:n}=s("bytes",e,n)),!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("encoding or errors without a string argument");return r(t,e,n)}if(void 0===(t=t[0]))return new Sk.builtin.bytes;if(void 0!==(e=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$bytes)))return t=Sk.misceval.callsimOrSuspendArray(e,[]),Sk.misceval.chain(t,(t=>{if(!Sk.builtin.checkBytes(t))throw new Sk.builtin.TypeError("__bytes__ returned non-bytes (type "+Sk.abstr.typeName(t)+")");return t}));if(Sk.misceval.isIndex(t)){if(0>(t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError)))throw new Sk.builtin.ValueError("negative count");return new Sk.builtin.bytes(t)}if(Sk.builtin.checkBytes(t))return new Sk.builtin.bytes(t.v);if(Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("string argument without an encoding");if(Sk.builtin.checkIterable(t)){let e=[];return t=Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{if(0>(t=Sk.misceval.asIndexSized(t))||255new Sk.builtin.bytes(e)))}throw new Sk.builtin.TypeError("cannot convert '"+Sk.abstr.typeName(t)+"' object into bytes")},$r(){let t,e="'";const n=-1!==this.v.indexOf(34);let i="";for(let s=0;st||10t||13t||126t.length||n[i]>t[i];case"GtE":return i===s&&n.length>=t.length||n[i]>=t[i]}},tp$hash(){return new Sk.builtin.str(this.$jsstr()).tp$hash()},tp$as_sequence_or_mapping:!0,mp$subscript(t){if(Sk.misceval.isIndex(t)){let e=Sk.misceval.asIndexSized(t,Sk.builtin.IndexError);if(void 0!==e){if(0>e&&(e=this.v.length+e),0>e||e>=this.v.length)throw new Sk.builtin.IndexError("index out of range");return new Sk.builtin.int_(this.v[e])}}else if(t instanceof Sk.builtin.slice){const e=[];return t.sssiter$(this.v.length,(t=>{e.push(this.v[t])})),new Sk.builtin.bytes(new Uint8Array(e))}throw new Sk.builtin.TypeError("byte indices must be integers or slices, not "+Sk.abstr.typeName(t))},sq$length(){return this.v.length},sq$concat(t){if(!(t instanceof Sk.builtin.bytes))throw new Sk.builtin.TypeError("can't concat "+Sk.abstr.typeName(t)+" to bytes");const e=new Uint8Array(this.v.length+t.v.length);let n;for(n=0;nNumber.MAX_SAFE_INTEGER)throw new Sk.builtin.OverflowError;if(0>=t)return new Sk.builtin.bytes;t=new Uint8Array(e);let n=0;for(;n(t=Sk.misceval.asIndexOrThrow(t,"argument should be integer or bytes-like object, not {tp$name}"))||255(e=Sk.misceval.asIndexSized(e,Sk.builtin.OverflowError))?1/0:e,null!==(t=Sk.builtin.checkNone(t)?null:this.get$raw(t))&&!t.length)throw new Sk.builtin.ValueError("empty separator");return{sep:t,maxsplit:e}},find$left:u(!1),find$right:u(!0),find$subleft:function(t,e,n){n=n-t.length+1;let i=e;for(;it===this.v[i+e])))return i;i++}return-1},find$subright(t,e,n){let i=n-t.length;for(;i>=e;){if(t.every(((t,e)=>t===this.v[i+e])))return i;i--}return-1},$subtype_new(t,e){const n=new this.constructor;return t=Sk.builtin.bytes.prototype.tp$new(t,e),n.v=t.v,n},sk$asarray(){const t=[];return this.v.forEach((e=>{t.push(new Sk.builtin.int_(e))})),t},valueOf(){return this.v}},flags:{str$encode:r,$decode:a,check$encodeArgs:s},methods:{__getnewargs__:{$meth(){return new Sk.builtin.tuple(new Sk.builtin.bytes(this.v))},$flags:{NoArgs:!0},$textsig:null,$doc:null},capitalize:{$meth(){const t=this.v.length;if(0===t)return new Sk.builtin.bytes(this.v);const e=new Uint8Array(t);let n=this.v[0];e[0]=d(n)?n-32:n;for(let i=1;i copy of B\n\nReturn a copy of B with only its first character capitalized (ASCII)\nand the rest lower-cased."},center:{$meth:h("center",!1,!0),$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"B.center(width[, fillchar]) -> copy of B\n\nReturn B centered in a string of length width. Padding is\ndone using the specified fill character (default is a space)."},count:{$meth(t,e,n){t=this.get$tgt(t),({start:e,end:n}=Sk.builtin.slice.startEnd$wrt(this,e,n));let i=0;if("number"==typeof t)for(;et===this.v[s+e]))&&(i++,s+=t.length-1)}return new Sk.builtin.int_(i)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.count(sub[, start[, end]]) -> int\n\nReturn the number of non-overlapping occurrences of subsection sub in\nbytes B[start:end]. Optional arguments start and end are interpreted\nas in slice notation."},decode:{$meth:a,$flags:{NamedArgs:["encoding","errors"]},$textsig:"($self, /, encoding='utf-8', errors='strict')",$doc:"Decode the bytes using the codec registered for encoding.\n\n encoding\n The encoding with which to decode the bytes.\n errors\n The error handling scheme to use for the handling of decoding errors.\n The default is 'strict' meaning that decoding errors raise a\n UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n as well as any other name registered with codecs.register_error that\n can handle UnicodeDecodeErrors."},endswith:{$meth:l("endswith",((t,e)=>{const n=t.length-e.length;return 0<=n&&e.every(((e,i)=>e===t[n+i]))})),$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if B ends with the specified suffix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nsuffix can also be a tuple of bytes to try."},expandtabs:{$meth(t){t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError,"an integer is required (got type {tp$nam})");const e=[];let n=0;for(let s=0;s copy of B\n\nReturn a copy of B where all tab characters are expanded using spaces.\nIf tabsize is not given, a tab size of 8 characters is assumed."},find:{$meth:function(t,e,n){return new Sk.builtin.int_(this.find$left(t,e,n))},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."},hex:{$meth(){let t="";for(let e=0;e string\n\nCreate a string of hexadecimal numbers from a bytes object.\nExample: b'\\xb9\\x01\\xef'.hex() -> 'b901ef'."},index:{$meth:function(t,e,n){if(-1===(t=this.find$left(t,e,n)))throw new Sk.builtin.ValueError("subsection not found");return new Sk.builtin.int_(t)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the subsection is not found."},isalnum:{$meth:g((t=>m(t)||d(t)||f(t))),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isalnum() -> bool\n\nReturn True if all characters in B are alphanumeric\nand there is at least one character in B, False otherwise."},isalpha:{$meth:g((t=>65<=t&&90>=t||97<=t&&122>=t)),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isalpha() -> bool\n\nReturn True if all characters in B are alphabetic\nand there is at least one character in B, False otherwise."},isascii:{$meth:g((t=>0<=t&&127>=t),!0),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isascii() -> bool\n\nReturn True if B is empty or all characters in B are ASCII,\nFalse otherwise."},isdigit:{$meth:g(m),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isdigit() -> bool\n\nReturn True if all characters in B are digits\nand there is at least one character in B, False otherwise."},islower:{$meth:b(d,f),$flags:{NoArgs:!0},$textsig:null,$doc:"B.islower() -> bool\n\nReturn True if all cased characters in B are lowercase and there is\nat least one cased character in B, False otherwise."},isspace:{$meth:g(_),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isspace() -> bool\n\nReturn True if all characters in B are whitespace\nand there is at least one character in B, False otherwise."},istitle:{$meth:function(){let t=!1,e=!1;for(let n=0;n bool\n\nReturn True if B is a titlecased string and there is at least one\ncharacter in B, i.e. uppercase characters may only follow uncased\ncharacters and lowercase characters only cased ones. Return False\notherwise."},isupper:{$meth:b(f,d),$flags:{NoArgs:!0},$textsig:null,$doc:"B.isupper() -> bool\n\nReturn True if all cased characters in B are uppercase and there is\nat least one cased character in B, False otherwise."},join:{$meth(t){const e=[];let n=0;return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{if(!(t instanceof Sk.builtin.bytes))throw new Sk.builtin.TypeError("sequence item "+n+": expected a bytes-like object, "+Sk.abstr.typeName(t)+" found");n++,e.length&&e.push(...this.v),e.push(...t.v)})),(()=>new Sk.builtin.bytes(new Uint8Array(e))))},$flags:{OneArg:!0},$textsig:"($self, iterable_of_bytes, /)",$doc:"Concatenate any number of bytes objects.\n\nThe bytes whose method is called is inserted in between each pair.\n\nThe result is returned as a new bytes object.\n\nExample: b'.'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'."},ljust:{$meth:h("ljust",!1,!1),$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"B.ljust(width[, fillchar]) -> copy of B\n\nReturn B left justified in a string of length width. Padding is\ndone using the specified fill character (default is a space)."},lower:{$meth:S((t=>f(t)?t+32:t)),$flags:{NoArgs:!0},$textsig:null,$doc:"B.lower() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to lowercase."},lstrip:{$meth:p(!0,!1),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, bytes=None, /)",$doc:"Strip leading bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading ASCII whitespace."},partition:{$meth:c(!1),$flags:{OneArg:!0},$textsig:"($self, sep, /)",$doc:"Partition the bytes into three parts using the given separator.\n\nThis will search for the separator sep in the bytes. If the separator is found,\nreturns a 3-tuple containing the part before the separator, the separator\nitself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing the original bytes\nobject and two empty bytes objects."},replace:{$meth(t,e,n){t=this.get$raw(t),e=this.get$raw(e),n=0>(n=void 0===n?-1:Sk.misceval.asIndexSized(n,Sk.builtin.OverflowError))?1/0:n;const i=[];let s=0;for(var r=0;r int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure."},rindex:{$meth:function(t,e,n){if(-1===(t=this.find$right(t,e,n)))throw new Sk.builtin.ValueError("subsection not found");return new Sk.builtin.int_(t)},$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaise ValueError when the subsection is not found."},rjust:{$meth:h("rjust",!0,!1),$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"B.rjust(width[, fillchar]) -> copy of B\n\nReturn B right justified in a string of length width. Padding is\ndone using the specified fill character (default is a space)"},rpartition:{$meth:c(!0),$flags:{OneArg:!0},$textsig:"($self, sep, /)",$doc:"Partition the bytes into three parts using the given separator.\n\nThis will search for the separator sep in the bytes, starting at the end. If\nthe separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing two empty bytes\nobjects and the original bytes object."},rsplit:{$meth:function(t,e){({sep:t,maxsplit:e}=this.get$splitArgs(t,e));const n=[];let i=0,s=this.v.length;if(null!==t){for(;0<=s&&is)break;for(t=s+1,s--;0<=s&&!_(this.v[s]);)s--;n.push(new Sk.builtin.bytes(this.v.subarray(s+1,t))),i++}if(0<=s){for(;_(this.v[s]);)s--;0<=s&&n.push(new Sk.builtin.bytes(this.v.subarray(0,s+1)))}}return new Sk.builtin.list(n.reverse())},$flags:{NamedArgs:["sep","maxsplit"],Defaults:[Sk.builtin.none.none$,-1]},$textsig:"($self, /, sep=None, maxsplit=-1)",$doc:"Return a list of the sections in the bytes, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytes.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.\n\nSplitting is done starting at the end of the bytes and working to the front."},rstrip:{$meth:p(!1,!0),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, bytes=None, /)",$doc:"Strip trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip trailing ASCII whitespace."},split:{$meth:function(t,e){({sep:t,maxsplit:e}=this.get$splitArgs(t,e));const n=[],i=this.v.length;let s=0,r=0;if(null!==t){for(;re.length<=t.length&&e.every(((e,n)=>e===t[n])))),$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"B.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if B starts with the specified prefix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nprefix can also be a tuple of bytes to try."},strip:{$meth:p(!0,!0),$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, bytes=None, /)",$doc:"Strip leading and trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading and trailing ASCII whitespace."},swapcase:{$meth:S((t=>f(t)?t+32:d(t)?t-32:t)),$flags:{NoArgs:!0},$textsig:null,$doc:"B.swapcase() -> copy of B\n\nReturn a copy of B with uppercase ASCII characters converted\nto lowercase ASCII and vice versa."},title:{$meth(){const t=this.v.length,e=new Uint8Array(t);let n=!1;for(let i=0;i copy of B\n\nReturn a titlecased version of B, i.e. ASCII words start with uppercase\ncharacters, all remaining cased characters have lowercase."},upper:{$meth:S((t=>d(t)?t-32:t)),$flags:{NoArgs:!0},$textsig:null,$doc:"B.upper() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to uppercase."},zfill:{$meth(t){const e=(t=Sk.misceval.asIndexSized(t,Sk.builtin.IndexError))-this.v.length;if(0>=e)return new Sk.builtin.bytes(this.v);const n=new Uint8Array(t);let i,s=0;for(43!==this.v[0]&&45!==this.v[0]||(n[0]=this.v[0],s++),n.fill(48,s,s+e),i=s,s+=e;s copy of B\n\nPad a numeric string B with zeros on the left, to fill a field\nof the specified width. B is never truncated."}},classmethods:{fromhex:{$meth:function(t){function e(e){for(let n=o;n b'\\\\xb9\\\\x01\\\\xef'."}}});var w=Sk.abstr.buildIteratorClass("bytes_iterator",{constructor:function(t){this.$index=0,this.$seq=t.v},iternext(){const t=this.$seq[this.$index++];if(void 0!==t)return new Sk.builtin.int_(t)},methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$unacceptableBase:!0}});Sk.exportSymbol("Sk.builtin.bytes",Sk.builtin.bytes)},function(t,e,n){(function(t){!function(t){function e(){}function n(){}var i=String.fromCharCode,s={}.toString,r=s.call(t.SharedArrayBuffer),o=s(),a=t.Uint8Array,l=a||Array,u=a?ArrayBuffer:l,c=u.isView||function(t){return t&&"length"in t},p=s.call(u.prototype);u=n.prototype;var h=t.TextEncoder,_=new(a?Uint16Array:l)(32);e.prototype.decode=function(t){if(!c(t)){var e=s.call(t);if(e!==p&&e!==r&&e!==o)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");t=a?new l(t):t||[]}for(var n,u,h,d=e="",f=0,m=0|t.length,g=m-32|0,b=0,S=0,k=0,y=-1;f>4){case 15:if(2!=(h=255&t[f=f+1|0])>>6||247>6?S+4|0:24,u=u+256&768;case 13:case 12:b<<=6,b|=(31&u)<<6|63&(h=255&t[f=f+1|0]),S=S+7|0,f>6&&b>>S&&1114112>b?(u=b,0<=(b=b-65536|0)&&(y=55296+(b>>10)|0,u=56320+(1023&b)|0,31>k?(_[k]=y,k=k+1|0,y=-1):(h=y,y=u,u=h))):(f=f-(u>>=8)-1|0,u=65533),b=S=0,n=f<=g?32:m-f|0;default:_[k]=u;continue;case 11:case 10:case 9:case 8:}_[k]=65533}if(d+=i(_[0],_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10],_[11],_[12],_[13],_[14],_[15],_[16],_[17],_[18],_[19],_[20],_[21],_[22],_[23],_[24],_[25],_[26],_[27],_[28],_[29],_[30],_[31]),32>k&&(d=d.slice(0,k-32|0)),f>>31,y=-1,d.length=o)i[s]=o;else{if(2047>=o)i[s]=192|o>>6;else{t:{if(55296<=o)if(56319>=o){var u=0|t.charCodeAt(e=e+1|0);if(56320<=u&&57343>=u){if(65535<(o=(o<<10)+u-56613888|0)){i[s]=240|o>>18,i[s=s+1|0]=128|o>>12&63,i[s=s+1|0]=128|o>>6&63,i[s=s+1|0]=128|63&o;continue}break t}o=65533}else 57343>=o&&(o=65533);!r&&e<<1>12,i[s=s+1|0]=128|o>>6&63}i[s=s+1|0]=128|63&o}}return a?i.subarray(0,s):i.slice(0,s)},h||(t.TextDecoder=e,t.TextEncoder=n)}(void 0===t?"undefined"==typeof self?this:self:t)}).call(this,n(0))},function(t,e){Sk.builtin.tuple=Sk.abstr.buildNativeClass("tuple",{constructor:function(t){void 0===t?t=[]:Array.isArray(t)||(t=Sk.misceval.arrayFromIterable(t)),Sk.asserts.assert(this instanceof Sk.builtin.tuple,"bad call to tuple, use 'new' with an Array of python objects"),this.v=t,this.in$repr=!1},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$doc:"Built-in immutable sequence.\n\nIf no argument is given, the constructor returns an empty tuple.\nIf iterable is specified the tuple is initialized from iterable's items.\n\nIf the argument is a tuple, the return value is the same object.",$r(){if(this.in$repr)return new Sk.builtin.str("(...)");this.in$repr=!0;let t=this.v.map((t=>Sk.misceval.objectRepr(t)));return this.in$repr=!1,t=t.join(", "),1===this.v.length&&(t+=","),new Sk.builtin.str("("+t+")")},tp$new(t,e){return this!==Sk.builtin.tuple.prototype?this.$subtype_new(t,e):(Sk.abstr.checkNoKwargs("tuple",e),Sk.abstr.checkArgsLen("tuple",t,0,1),void 0===(t=t[0])?new Sk.builtin.tuple([]):t.constructor===Sk.builtin.tuple?t:Sk.misceval.chain(Sk.misceval.arrayFromIterable(t,!0),(t=>new Sk.builtin.tuple(t))))},tp$hash(){let t,e=3430008,n=1000003;const i=this.v.length;for(let s=0;s(t=Sk.misceval.asIndexSized(t,Sk.builtin.IndexError))&&(t=this.v.length+t),0>t||t>=this.v.length)throw new Sk.builtin.IndexError("tuple index out of range");return this.v[t]}if(t instanceof Sk.builtin.slice){const e=[];return t.sssiter$(this.v.length,(t=>{e.push(this.v[t])})),new Sk.builtin.tuple(e)}throw new Sk.builtin.TypeError("tuple indices must be integers or slices, not "+Sk.abstr.typeName(t))},sq$length(){return this.v.length},sq$repeat(t){if(1===(t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError))&&this.constructor===Sk.builtin.tuple)return this;const e=[];for(let n=0;n(this.$seq=t.$items(),this.$version=t.$version,n&&(this.$seq=this.$seq.reverse()),this.tp$iternext=this.constructor.prototype.tp$iternext,this.tp$iternext())},iternext:e,methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$unacceptableBase:!0},proto:{next$item:a}})}function a(){if(this.$version!==this.$orig.$version){if(this.$seq.length!==this.$orig.get$size())throw new Sk.builtin.RuntimeError("dict changed size during iteration");throw new Sk.builtin.RuntimeError("dictionary keys changed during iteration")}return this.$seq[this.$index++]}Sk.builtin.dict=Sk.abstr.buildNativeClass("dict",{constructor:function(t){void 0===t&&(t=[]),Sk.asserts.assert(Array.isArray(t)&&0==t.length%2&&this instanceof Sk.builtin.dict,"bad call to dict constructor"),this.size=0,this.entries=Object.create(null),this.buckets={};for(let e=0;e new empty dictionary\ndict(mapping) -> new dictionary initialized from a mapping object's\n (key, value) pairs\ndict(iterable) -> new dictionary initialized as if via:\n d = {}\n for k, v in iterable:\n d[k] = v\ndict(**kwargs) -> new dictionary initialized with the name=value pairs\n in the keyword argument list. For example: dict(one=1, two=2)",$r(){if(this.in$repr)return new Sk.builtin.str("{...}");this.in$repr=!0;const t=this.$items().map((t=>{var[e,n]=t;return Sk.misceval.objectRepr(e)+": "+Sk.misceval.objectRepr(n)}));return this.in$repr=!1,new Sk.builtin.str("{"+t.join(", ")+"}")},tp$new:Sk.generic.new,tp$init(t,e){return this.update$common(t,e,"dict")},tp$iter(){return new h(this)},tp$richcompare(t,e){let n;if(!(t instanceof Sk.builtin.dict)||"Eq"!==e&&"NotEq"!==e)return Sk.builtin.NotImplemented.NotImplemented$;if(t===this)n=!0;else if(this.size!==t.size)n=!1;else{let e;n=this.$items().every((n=>{var[i,s]=n;return e=t.mp$lookup(i),void 0!==e&&(e===s||Sk.misceval.richCompareBool(s,e,"Eq"))}))}return"Eq"===e?n:!n},nb$or(t){if(!(t instanceof Sk.builtin.dict))return Sk.builtin.NotImplemented.NotImplemented$;const e=this.dict$copy();return e.dict$merge(t),e},nb$reflected_or(t){return t instanceof Sk.builtin.dict?((t=t.dict$copy()).dict$merge(this),t):Sk.builtin.NotImplemented.NotImplemented$},nb$inplace_or(t){return Sk.misceval.chain(this.update$onearg(t),(()=>this))},sq$length(){return this.get$size()},sq$contains(t){return void 0!==this.mp$lookup(t)},mp$subscript(t,e){var n=this.mp$lookup(t);if(void 0!==n)return n;if(void 0!==(n=Sk.abstr.lookupSpecial(this,Sk.builtin.str.$missing)))return t=Sk.misceval.callsimOrSuspendArray(n,[t]),e?t:Sk.misceval.retryOptionalSuspensionOrThrow(t);throw new Sk.builtin.KeyError(t)},mp$ass_subscript(t,e){if(void 0===e){if(void 0===this.pop$item(t))throw new Sk.builtin.KeyError(t)}else this.set$item(t,e)}},methods:{__reversed__:{$meth(){return new f(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"Return a reverse iterator over the dict keys."},get:{$meth(t,e){return this.mp$lookup(t)||e||Sk.builtin.none.none$},$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, key, default=None, /)",$doc:"Return the value for key if key is in the dictionary, else default."},setdefault:{$meth(t,e){let i;const s=n(t);return i="string"==typeof s?this.entries[s]:this.get$bucket_item(t,s),void 0!==i?i[1]:(e=e||Sk.builtin.none.none$,"string"==typeof s?this.entries[s]=[t,e]:this.set$bucket_item(t,e,s),this.size++,this.$version++,e)},$flags:{MinArgs:1,MaxArgs:2},$textsig:"($self, key, default=None, /)",$doc:"Insert key with a value of default if key is not in the dictionary.\n\nReturn the value for key if key is in the dictionary, else default."},pop:{$meth(t,e){const n=this.pop$item(t);if(void 0!==n)return n[1];if(void 0!==e)return e;throw new Sk.builtin.KeyError(t)},$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\nIf key is not found, d is returned if given, otherwise KeyError is raised"},popitem:{$meth(){const t=this.get$size();if(0===t)throw new Sk.builtin.KeyError("popitem(): dictionary is empty");const[e,n]=this.$items()[t-1];return this.pop$item(e),new Sk.builtin.tuple([e,n])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.popitem() -> (k, v), remove and return some (key, value) pair as a\n2-tuple; but raise KeyError if D is empty."},keys:{$meth(){return new u(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"D.keys() -> a set-like object providing a view on D's keys"},items:{$meth(){return new p(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"D.items() -> a set-like object providing a view on D's items"},values:{$meth(){return new c(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"D.values() -> an object providing a view on D's values"},update:{$meth(t,e){return Sk.misceval.chain(this.update$common(t,e,"update"),(()=>Sk.builtin.none.none$))},$flags:{FastCall:!0},$textsig:null,$doc:"D.update([E, ]**F) -> None. Update D from dict/iterable E and F.\nIf E is present and has a .keys() method, then does: for k in E: D[k] = E[k]\nIf E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v\nIn either case, this is followed by: for k in F: D[k] = F[k]"},clear:{$meth(){this.size=0,this.$version++,this.entries=Object.create(null),this.buckets={}},$flags:{NoArgs:!0},$textsig:null,$doc:"D.clear() -> None. Remove all items from D."},copy:{$meth(){return this.dict$copy()},$flags:{NoArgs:!0},$textsig:null,$doc:"D.copy() -> a shallow copy of D"}},classmethods:Object.assign({fromkeys:{$meth:function(t,e){e=e||Sk.builtin.none.none$;let n=this===Sk.builtin.dict?new this:this.tp$call([],[]);return Sk.misceval.chain(n,(i=>(n=i,Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>n.mp$ass_subscript(t,e,!0))))),(()=>n))},$flags:{MinArgs:1,MaxArgs:2},$textsig:"($type, iterable, value=None, /)",$doc:"Create a new dictionary with keys from iterable and values set to value."}},Sk.generic.classGetItem),proto:{quick$lookup:function(t){if(void 0!==(t=this.entries[t.$savedKeyHash]))return t[1]},mp$lookup:function(t){const e=n(t);if(void 0!==(t="string"==typeof e?this.entries[e]:this.get$bucket_item(t,e)))return t[1]},get$size(){return this.size},sk$asarray(){return Object.values(this.entries).map((t=>t[0]))},update$common:function(t,e,n){let i;return Sk.abstr.checkArgsLen(n,t,0,1),void 0!==(t=t[0])&&(i=this.update$onearg(t)),Sk.misceval.chain(i,(()=>{if(e)for(let t=0;tvoid 0===t))&&delete this.buckets[e],i},set$bucket_item:function(t,e,n){let i=this.buckets[n];t=[t,e],void 0===i?(this.buckets[n]=[t],n="#"+n+"_0"):-1!==(e=i.indexOf(void 0))?(n="#"+n+"_"+e,i[e]=t):(n="#"+n+"_"+i.length,i.push(t)),this.entries[n]=t},pop$item:function(t){const e=n(t);if("string"==typeof e?(t=this.entries[e],delete this.entries[e]):t=this.pop$bucket_item(t,e),void 0!==t)return this.size--,this.$version++,t},dict$merge:function(t){if(t.tp$iter!==Sk.builtin.dict.prototype.tp$iter){if(void 0===(e=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$keys)))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object is not a mapping");return Sk.misceval.chain(Sk.misceval.callsimOrSuspendArray(e),(e=>Sk.misceval.iterFor(Sk.abstr.iter(e),(e=>Sk.misceval.chain(Sk.abstr.objectGetItem(t,e,!0),(t=>{this.set$item(e,t)}))))))}var e=t.tp$iter();for(let n=e.tp$iternext();void 0!==n;n=e.tp$iternext()){const e=t.mp$subscript(n);this.set$item(n,e)}},dict$merge_seq:function(t){let e=0;return Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{if(!Sk.builtin.checkIterable(t))throw new Sk.builtin.TypeError("cannot convert dictionary update sequence element #"+e+" to a sequence");if(2!==(t=Sk.misceval.arrayFromIterable(t)).length)throw new Sk.builtin.ValueError("dictionary update sequence element #"+e+" has length "+t.length+"; 2 is required");this.set$item(t[0],t[1]),e++}))}}});const l={tp$getattr:Sk.generic.getAttr,tp$as_number:!0,tp$as_sequence_or_mapping:!0,tp$hash:Sk.builtin.none.none$,$r(){if(this.in$repr)return new Sk.builtin.str("...");this.in$repr=!0;let t=Sk.misceval.arrayFromIterable(this);return t=t.map((t=>Sk.misceval.objectRepr(t))),this.in$repr=!1,new Sk.builtin.str(Sk.abstr.typeName(this)+"(["+t.join(", ")+"])")},tp$richcompare(t,e){if(!(Sk.builtin.checkAnySet(t)||t instanceof u||t instanceof p))return Sk.builtin.NotImplemented.NotImplemented$;const n=this.sq$length(),i=t.sq$length();switch(e){case"NotEq":case"Eq":let r;return this===t?r=!0:n===i&&(r=s(this,t)),"NotEq"===e?!r:r;case"Lt":return ni&&s(t,this);case"GtE":return n>=i&&s(t,this)}},nb$subtract(t){const e=i(this);return e.difference.$meth.call(e,t)},nb$and(t){const e=i(this);return e.intersection.$meth.call(e,t)},nb$or(t){const e=i(this);return e.union.$meth.call(e,t)},nb$xor(t){const e=i(this);return e.symmetric_difference.$meth.call(e,t)},sq$length(){return this.dict.get$size()}};var u=r("dict_keys",{sq$contains(t){return void 0!==this.dict.mp$lookup(t)},tp$iter(){return new h(this.dict)}},(function(){return new f(this.dict)})),c=r("dict_values",{tp$iter(){return new d(this.dict)}},(function(){return new g(this.dict)})),p=r("dict_items",{sq$contains(t){if(!(t instanceof Sk.builtin.tuple&&2===t.sq$length()))return!1;var e=t.mp$subscript(new Sk.builtin.int_(0));return t=t.mp$subscript(new Sk.builtin.int_(1)),void 0!==(e=this.dict.mp$lookup(e))&&(e===t||Sk.misceval.richCompareBool(e,t,"Eq"))},tp$iter(){return new _(this.dict)}},(function(){return new m(this.dict)})),h=o("dict_keyiterator",(function(){const t=this.next$item();return t&&t[0]})),_=o("dict_itemiterator",(function(){const t=this.next$item();return t&&new Sk.builtin.tuple([t[0],t[1]])})),d=o("dict_valueiterator",(function(){const t=this.next$item();return t&&t[1]})),f=o("dict_reversekeyiterator",h.prototype.tp$iternext,!0),m=o("dict_reverseitemiterator",_.prototype.tp$iternext,!0),g=o("dict_reversevalueiterator",d.prototype.tp$iternext,!0);Sk.builtin.dict.py2$methods={has_key:{$name:"has_key",$flags:{OneArg:!0},$meth(t){return new Sk.builtin.bool(this.sq$contains(t))},$doc:"D.has_key(k) -> True if D has a key k, else False"},keys:{$name:"keys",$meth(){return new Sk.builtin.list(this.sk$asarray())},$flags:{NoArgs:!0},$textsig:null,$doc:"D.keys() -> a set-like object providing a view on D's keys"},items:{$name:"items",$meth(){return new Sk.builtin.list(this.$items().map((t=>{var[e,n]=t;return new Sk.builtin.tuple([e,n])})))},$flags:{NoArgs:!0},$textsig:null,$doc:"D.items() -> a set-like object providing a view on D's items"},values:{$name:"values",$meth(){return new Sk.builtin.list(this.$items().map((t=>([,t]=t,t))))},$flags:{NoArgs:!0},$textsig:null,$doc:"D.values() -> an object providing a view on D's values"}}},function(t,e){Sk.builtin.mappingproxy=Sk.abstr.buildNativeClass("mappingproxy",{constructor:function(t){if(Sk.asserts.assert(this instanceof Sk.builtin.mappingproxy,"bad call to mapping proxy, use 'new'"),void 0!==t){const e=t.constructor;e===Object||null===e||t.hasOwnProperty("sk$object")?(this.mapping=new Sk.builtin.dict([]),function(t,e){Object.defineProperties(t,{entries:{get:()=>{const t=Object.create(null);return Object.entries(e).forEach((e=>{var[n,i]=e;(n=Sk.unfixReserved(n)).includes("$")||(n=new Sk.builtin.str(n),t[n.$savedKeyHash]=[n,i])})),t},configurable:!0},size:{get:()=>Object.keys(e).map((t=>Sk.unfixReserved(t))).filter((t=>!t.includes("$"))).length,configurable:!0}})}(this.mapping,t)):Sk.builtin.checkMapping(t)?this.mapping=t:Sk.asserts.fail("unhandled case for mappingproxy")}},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$hash:Sk.builtin.none.none$,tp$new(t,e){if(Sk.abstr.checkNoKwargs("mappingproxy",e),Sk.abstr.checkOneArg("mappingproxy",t,e),t=t[0],!Sk.builtin.checkMapping(t))throw new Sk.builtin.TypeError("mappingproxy() argument must be a mapping, not "+Sk.abstr.typeName(t));return(e=new Sk.builtin.mappingproxy).mapping=t,e},tp$richcompare(t,e){return Sk.misceval.richCompareBool(this.mapping,t,e)},tp$str(){return this.mapping.tp$str()},$r(){return new Sk.builtin.str("mappingproxy("+Sk.misceval.objectRepr(this.mapping)+")")},mp$subscript(t,e){return this.mapping.mp$subscript(t,e)},sq$contains(t){return this.mapping.sq$contains(t)},sq$length(){return this.mapping.sq$length()},tp$iter(){return this.mapping.tp$iter()},tp$as_number:!0,nb$or(t){return t instanceof Sk.builtin.mappingproxy&&(t=t.mapping),Sk.abstr.numberBinOp(this.mapping,t,"BitOr")},nb$reflected_or(t){return t instanceof Sk.builtin.mappingproxy&&(t=t.mapping),Sk.abstr.numberBinOp(t,this.mapping,"BitOr")},nb$inplace_or(t){throw new Sk.builtin.TypeError("'|=' is not supported by "+Sk.abstr.typeName(this)+"; use '|' instead")}},methods:{get:{$meth(t,e){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$get),t,e)},$flags:{FastCall:!0},$textsig:null,$doc:"D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None."},keys:{$meth(){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$keys),[])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.keys() -> a set-like object providing a view on D's keys"},items:{$meth(){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$items),[])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.items() -> a set-like object providing a view on D's items"},values:{$meth(){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$values),[])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.values() -> a set-like object providing a view on D's values"},copy:{$meth(){return Sk.misceval.callsimArray(this.mapping.tp$getattr(this.str$copy),[])},$flags:{NoArgs:!0},$textsig:null,$doc:"D.copy() -> a shallow copy of D"}},classmethods:Sk.generic.classGetItem,proto:{str$get:new Sk.builtin.str("get"),str$copy:new Sk.builtin.str("copy"),str$keys:new Sk.builtin.str("keys"),str$items:new Sk.builtin.str("items"),str$values:new Sk.builtin.str("values"),mp$lookup(t){return this.mapping.mp$lookup(t)}},flags:{sk$unacceptableBase:!0}})},function(t,e){Sk.builtin.property=Sk.abstr.buildNativeClass("property",{constructor:function(t,e,n,i){this.prop$get=t||Sk.builtin.none.none$,this.prop$set=e||Sk.builtin.none.none$,this.prop$del=n||Sk.builtin.none.none$,this.prop$doc=i||t&&t.$doc||Sk.builtin.none.none$},slots:{tp$getattr:Sk.generic.getAttr,tp$new:Sk.generic.new,tp$init(t,e){t=Sk.abstr.copyKeywordsToNamedArgs("property",["fget","fset","fdel","doc"],t,e,Array(4).fill(Sk.builtin.none.none$)),this.prop$get=t[0],this.prop$set=t[1],this.prop$del=t[2],Sk.builtin.checkNone(t[3])?Sk.builtin.checkNone(t[0])||(this.prop$doc=t[0].$doc||t[3]):this.prop$doc=t[3]},tp$doc:"Property attribute.\n\n fget\n function to be used for getting an attribute value\n fset\n function to be used for setting an attribute value\n fdel\n function to be used for del'ing an attribute\n doc\n docstring\n\nTypical use is to define a managed attribute x:\n\nclass C(object):\n def getx(self): return self._x\n def setx(self, value): self._x = value\n def delx(self): del self._x\n x = property(getx, setx, delx, 'I'm the 'x' property.')\n\nDecorators make defining new properties or modifying existing ones easy:\n\nclass C(object):\n @property\n def x(self):\n 'I am the 'x' property.'\n return self._x\n @x.setter\n def x(self, value):\n self._x = value\n @x.deleter\n def x(self):\n del self._x",tp$descr_get(t,e,n){if(null===t)return this;if(void 0===this.prop$get)throw new Sk.builtin.AttributeError("unreadable attribute");return t=Sk.misceval.callsimOrSuspendArray(this.prop$get,[t]),n?t:Sk.misceval.retryOptionalSuspensionOrThrow(t)},tp$descr_set(t,e,n){let i;if(i=null==e?this.prop$del:this.prop$set,Sk.builtin.checkNone(i))throw new Sk.builtin.AttributeError("can't "+(null==e?"delete":"set")+" attribute");if(!i.tp$call)throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(i)+"' is not callable");return t=null==e?i.tp$call([t]):i.tp$call([t,e]),n?t:Sk.misceval.retryOptionalSuspensionOrThrow(t)}},methods:{getter:{$meth(t){return new Sk.builtin.property(t,this.prop$set,this.prop$del,this.prop$doc)},$flags:{OneArg:!0}},setter:{$meth(t){return new Sk.builtin.property(this.prop$get,t,this.prop$del,this.prop$doc)},$flags:{OneArg:!0}},deleter:{$meth(t){return new Sk.builtin.property(this.prop$get,this.prop$set,t,this.prop$doc)},$flags:{OneArg:!0}}},getsets:{fget:{$get(){return this.prop$get}},fset:{$get(){return this.prop$set}},fdel:{$get(){return this.prop$del}},__doc__:{$get(){return this.prop$doc},$set(t){this.prop$doc=t=t||Sk.builtin.none.none$}}}}),Sk.builtin.classmethod=Sk.abstr.buildNativeClass("classmethod",{constructor:function(t){this.cm$callable=t,this.$d=new Sk.builtin.dict},slots:{tp$getattr:Sk.generic.getAttr,tp$new:Sk.generic.new,tp$init(t,e){Sk.abstr.checkNoKwargs("classmethod",e),Sk.abstr.checkArgsLen("classmethod",t,1,1),this.cm$callable=t[0]},tp$doc:"classmethod(function) -> method\n\nConvert a function to be a class method.\n\nA class method receives the class as implicit first argument,\njust like an instance method receives the instance.\nTo declare a class method, use this idiom:\n\n class C:\n @classmethod\n def f(cls, arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\nIf a class method is called for a derived class, the derived class\nobject is passed as the implied first argument.\n\nClass methods are different than C++ or Java static methods.\nIf you want those, see the staticmethod builtin.",tp$descr_get(t,e,n){const i=this.cm$callable;if(void 0===i)throw new Sk.builtin.RuntimeError("uninitialized classmethod object");return void 0===e&&(e=t.ob$type),(t=i.tp$descr_get)?t.call(i,e,n):new Sk.builtin.method(i,e)}},getsets:{__func__:{$get(){return this.cm$callable}},__dict__:Sk.generic.getSetDict}}),Sk.builtin.staticmethod=Sk.abstr.buildNativeClass("staticmethod",{constructor:function(t){this.sm$callable=t,this.$d=new Sk.builtin.dict},slots:{tp$getattr:Sk.generic.getAttr,tp$new:Sk.generic.new,tp$init(t,e){Sk.abstr.checkNoKwargs("staticmethod",e),Sk.abstr.checkArgsLen("staticmethod",t,1,1),this.sm$callable=t[0]},tp$doc:"staticmethod(function) -> method\n\nConvert a function to be a static method.\n\nA static method does not receive an implicit first argument.\nTo declare a static method, use this idiom:\n\n class C:\n @staticmethod\n def f(arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\n\nStatic methods in Python are similar to those found in Java or C++.\nFor a more advanced concept, see the classmethod builtin.",tp$descr_get(t,e){if(void 0===this.sm$callable)throw new Sk.builtin.RuntimeError("uninitialized staticmethod object");return this.sm$callable}},getsets:{__func__:{$get(){return this.sm$callable}},__dict__:Sk.generic.getSetDict}})},function(t,e){function n(t,e){return function(n){if(!(n instanceof Sk.builtin.int_))return Sk.builtin.NotImplemented.NotImplemented$;let i=this.v;if(n=n.v,"number"==typeof i&&"number"==typeof n){const e=t(i,n);if(p(e))return new Sk.builtin.int_(e)}return i=_(i),n=_(n),new Sk.builtin.int_(e(i,n))}}function i(t,e){return function(n){if(!(n instanceof Sk.builtin.int_))return Sk.builtin.NotImplemented.NotImplemented$;let i=this.v;return n=n.v,"number"==typeof i&&"number"==typeof n?t(i,n):(i=_(i),n=_(n),e(i,n))}}function s(t,e){return function(){let n=this.v;if("number"==typeof n){const e=t(n);if(void 0!==e)return new Sk.builtin.int_(e);n=_(n)}return new Sk.builtin.int_(e(n))}}function r(){return new Sk.builtin.int_(this.v)}function o(t,e){return function(n){if(!(n instanceof Sk.builtin.int_))return Sk.builtin.NotImplemented.NotImplemented$;let i=this.v;if(0===(n=n.v))throw new Sk.builtin.ZeroDivisionError("integer division or modulo by zero");return"number"==typeof i&&"number"==typeof n?new Sk.builtin.int_(t(i,n)):(i=_(i),n=_(n),new Sk.builtin.int_(JSBI.numberIfSafe(e(i,n))))}}function a(t,e){return function(n){if(!(n instanceof Sk.builtin.int_))return Sk.builtin.NotImplemented.NotImplemented$;if(n.nb$isnegative())throw new Sk.builtin.ValueError("negative shift count");let i=this.v;if(0===i)return new Sk.builtin.int_(0);if(n=n.v,"number"==typeof i&&"number"==typeof n&&53>n){const e=t(i,n);if(void 0!==e)return new Sk.builtin.int_(e)}return i=_(i),n=_(n),new Sk.builtin.int_(e(i,n))}}function l(t,e){return function(n){if(!(n instanceof Sk.builtin.int_))return Sk.builtin.NotImplemented.NotImplemented$;let i=this.v;return n=n.v,"number"==typeof i&&"number"==typeof n&&Math.abs(i)=-Number.MAX_SAFE_INTEGER}function h(t){return t<=Number.MAX_SAFE_INTEGER&&t>=-Number.MAX_SAFE_INTEGER?+t:JSBI.BigInt(t)}function _(t){return"number"==typeof t?JSBI.BigInt(t):t}function d(t){if(!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("'byteorder' must be str, not "+Sk.abstr.typeName(t));if("little"===(t=t.toString()))return 1;if("big"===t)return 0;throw new Sk.builtin.ValueError("byteorder must be either 'little' or 'big'")}Sk.builtin.int_=Sk.abstr.buildNativeClass("int",{constructor:function(t){let e;if(Sk.asserts.assert(this instanceof Sk.builtin.int_,"bad call to int use 'new'"),"number"==typeof t){if(-6t)return $[t];e=t}else if(JSBI.__isBigInt(t))e=t;else{if(void 0===t)return w;if("string"==typeof t)e=h(t);else{if(t.nb$int)return t.nb$int();Sk.asserts.fail("bad argument to int constructor")}}this.v=e},slots:{tp$as_number:!0,tp$doc:"int(x=0) -> integer\nint(x, base=10) -> integer\n\nConvert a number or string to an integer, or return 0 if no arguments\nare given. If x is a number, return x.__int__(). For floating point\nnumbers, this truncates towards zero.\n\nIf x is not a number or if base is given, then x must be a string,\nbytes, or bytearray instance representing an integer literal in the\ngiven base. The literal can be preceded by '+' or '-' and be surrounded\nby whitespace. The base defaults to 10. Valid bases are 0 and 2-36.\nBase 0 means to interpret the base from the string as an integer literal.\n>>> int('0b100', base=0)\n4",$r(){return new Sk.builtin.str(this.v.toString())},tp$hash(){var t=this.v;if("number"==typeof t){if(-1===t)return-2;if(536870911>t&&-536870911t==e),JSBI.equal),ob$ne:i(((t,e)=>t!=e),JSBI.notEqual),ob$gt:i(((t,e)=>t>e),JSBI.greaterThan),ob$ge:i(((t,e)=>t>=e),JSBI.greaterThanOrEqual),ob$lt:i(((t,e)=>tt<=e),JSBI.lessThanOrEqual),nb$int:r,nb$index(){return this.v},nb$float(){var t=this.v;if("number"==typeof t)return new Sk.builtin.float_(t);if(1/0===(t=parseFloat(JSBI.toNumber(t)))||-1/0===t)throw new Sk.builtin.OverflowError("int too large to convert to float");return new Sk.builtin.float_(t)},nb$isnegative(){const t=this.v;return"number"==typeof t?0>t:JSBI.lessThan(t,JSBI.__ZERO)},nb$ispositive(){const t=this.v;return"number"==typeof t?0<=t:JSBI.greaterThanOrEqual(t,JSBI.__ZERO)},nb$bool(){return 0!==this.v},nb$positive:r,nb$negative:s((t=>-t),JSBI.unaryMinus),nb$add:n(((t,e)=>t+e),((t,e)=>JSBI.numberIfSafe(JSBI.add(t,e)))),nb$subtract:n(((t,e)=>t-e),((t,e)=>JSBI.numberIfSafe(JSBI.subtract(t,e)))),nb$multiply:n(((t,e)=>t*e),((t,e)=>t===JSBI.__ZERO||e===JSBI.__ZERO?0:JSBI.multiply(t,e))),nb$divide:function(t){if(!Sk.__future__.python3)return this.nb$floor_divide(t);if(!(t instanceof Sk.builtin.int_))return Sk.builtin.NotImplemented.NotImplemented$;var e=this.v,n=t.v;if(0===n)throw new Sk.builtin.ZeroDivisionError("division by zero");if("number"==typeof e&&"number"==typeof n)return new Sk.builtin.float_(e/n);if(e=_(e),n=_(n),t=JSBI.lessThan(JSBI.bitwiseXor(e,n),JSBI.__ZERO),JSBI.equal(e,JSBI.__ZERO))return new Sk.builtin.float_(t?-0:0);if(e=u(e),n=u(n),JSBI.greaterThanOrEqual(e,JSBI.multiply(k,n)))throw new Sk.builtin.OverflowError("int/int too large to represent as a float");var i=e.toString(2).length-n.toString(2).length,s=JSBI.BigInt(0>i?-i:i);if((0<=i&&JSBI.greaterThanOrEqual(e,JSBI.multiply(JSBI.exponentiate(b,s),n))||0>i&&JSBI.greaterThanOrEqual(JSBI.multiply(e,JSBI.exponentiate(b,s)),n))&&(i+=1),i=Math.max(i,g)-m,e=JSBI.leftShift(e,JSBI.BigInt(Math.max(-i,0))),n=JSBI.leftShift(n,JSBI.BigInt(Math.max(i,0))),s=JSBI.divide(e,n),e=JSBI.remainder(e,n),e=JSBI.multiply(b,e),(JSBI.greaterThan(e,n)||JSBI.equal(e,n)&&JSBI.equal(JSBI.remainder(s,b),S))&&(s=JSBI.add(s,S)),1/0===(s=JSBI.toNumber(s))||-1/0===s)throw new Sk.builtin.OverflowError("int/int too large to represent as a float");return n=s*Math.pow(2,i),new Sk.builtin.float_(t?-n:n)},nb$floor_divide:o(((t,e)=>Math.floor(t/e)),c),nb$remainder:o(((t,e)=>t-Math.floor(t/e)*e),((t,e)=>JSBI.subtract(t,JSBI.multiply(e,c(t,e))))),nb$divmod(t){const e=this.nb$floor_divide(t);return t=this.nb$remainder(t),e===Sk.builtin.NotImplemented.NotImplemented$||t===Sk.builtin.NotImplemented.NotImplemented$?Sk.builtin.NotImplemented.NotImplemented$:new Sk.builtin.tuple([e,t])},nb$and:l(((t,e)=>t&e),JSBI.bitwiseAnd),nb$or:l(((t,e)=>t|e),JSBI.bitwiseOr),nb$xor:l(((t,e)=>t^e),JSBI.bitwiseXor),nb$abs:s(Math.abs,u),nb$lshift:a(((t,e)=>{if(p(t=2*t*T[e]))return t}),JSBI.leftShift),nb$rshift:a(((t,e)=>{Math.floor(t/T[e+1])}),((t,e)=>JSBI.numberIfSafe(JSBI.signedRightShift(t,e)))),nb$invert:s((t=>Math.abs(t)JSBI.numberIfSafe(JSBI.bitwiseNot(t)))),nb$power(t,e){let n;if(void 0!==e&&Sk.builtin.checkNone(e)&&(e=void 0),!(t instanceof Sk.builtin.int_&&(void 0===e||e instanceof Sk.builtin.int_)))return Sk.builtin.NotImplemented.NotImplemented$;const i=t.nb$isnegative();if(i&&void 0===e)return this.nb$float().nb$power(t.nb$float());let s=this.v;if(t=t.v,"number"==typeof s&&"number"==typeof t){const i=Math.pow(s,t);if(p(i)&&(n=new Sk.builtin.int_(i),void 0===e))return n}if(void 0!==e){if(i)throw new Sk.builtin.ValueError("pow() 2nd argument cannot be negative when 3rd argument specified");if(0===e.v)throw new Sk.builtin.ValueError("pow() 3rd argument cannot be 0");return void 0!==n?n.nb$remainder(e):new Sk.builtin.int_(JSBI.numberIfSafe(JSBI.powermod(_(s),_(t),_(e.v))))}return new Sk.builtin.int_(JSBI.exponentiate(_(s),_(t)))},nb$long(){return new Sk.builtin.lng(this.v)}},getsets:{real:{$get:r,$doc:"the real part of a complex number"},imag:{$get:()=>w,$doc:"the imaginary part of a complex number"},numerator:{$get:r},denominator:{$get:()=>E}},classmethods:{from_bytes:{$meth(t,e){Sk.abstr.checkArgsLen("from_bytes",t,0,2);let[n,i,s]=Sk.abstr.copyKeywordsToNamedArgs("from_bytes",["bytes","byteorder","signed"],t,e,[Sk.builtin.bool.false$]);if(t=d(i),n instanceof Sk.builtin.bytes||(n=Sk.misceval.callsimArray(Sk.builtin.bytes,[n])),Sk.misceval.isTrue(s))throw new Sk.builtin.NotImplementedError("from_bytes with signed=True is not yet implemented in Skulpt");const r=[];return n.valueOf().forEach((t=>{r.push(t.toString(16).padStart(2,"0"))})),t&&r.reverse(),t=new Sk.builtin.int_(JSBI.numberIfSafe(JSBI.BigInt("0x"+(r.join("")||"0")))),this===Sk.builtin.int_?t:Sk.misceval.callsimArray(this,[t])},$flags:{FastCall:!0}}},methods:{conjugate:{$meth:r,$flags:{NoArgs:!0},$textsig:null,$doc:"Returns self, the complex conjugate of any int."},bit_length:{$meth(){let t=this.v;return 0===t?new Sk.builtin.int_(0):(t="number"==typeof t?Math.abs(t):u(t),new Sk.builtin.int_(t.toString(2).length))},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Number of bits necessary to represent self in binary.\n\n>>> bin(37)\n'0b100101'\n>>> (37).bit_length()\n6"},to_bytes:{$meth(t,e){Sk.abstr.checkArgsLen("to_bytes",t,0,2);let[n,i,s]=Sk.abstr.copyKeywordsToNamedArgs("to_bytes",["length","byteorder","signed"],t,e,[Sk.builtin.bool.false$]);if(t=d(i),n=Sk.misceval.asIndexSized(n,Sk.builtin.OverflowError),0>n)throw new Sk.builtin.ValueError("length argument must be non-negative");if(Sk.misceval.isTrue(s))throw new Sk.builtin.NotImplementedError("to_bytes with signed=True is not yet implemented in Skulpt");if(this.nb$isnegative())throw new Sk.builtin.OverflowError("can't convert negative int to unsigned");(e=JSBI.BigInt(this.v).toString(16)).length%2&&(e="0"+e);var r=e.length/2;if(r>n){if(0===n&&"00"===e)return new Sk.builtin.bytes;throw new Sk.builtin.OverflowError("int too big to convert")}const o=Array(n).fill(0);r=n-r;let a=0;for(;rMath.abs(e)?new Sk.builtin.int_(0):Sk.__future__.bankers_rounding?(e/=t,n=Math.round(e),new Sk.builtin.int_((.5==(0e||36= 2 and <= 36");if("string"==typeof e&&(e=Number(e)),"0x"===t.substring(0,2).toLowerCase()){if(16===e||0===e)t=t.substring(2),e=16;else if(34>e)throw new Sk.builtin.ValueError("invalid literal for int() with base "+e+": '"+i+"'")}else if("0b"===t.substring(0,2).toLowerCase()){if(2===e||0===e)t=t.substring(2),e=2;else if(12>e)throw new Sk.builtin.ValueError("invalid literal for int() with base "+e+": '"+i+"'")}else if("0o"===t.substring(0,2).toLowerCase()){if(8===e||0===e)t=t.substring(2),e=8;else if(25>e)throw new Sk.builtin.ValueError("invalid literal for int() with base "+e+": '"+i+"'")}else if("0"===t.charAt(0)){if("0"===t)return 0;8!==e&&0!==e||(e=8)}if(0===e&&(e=10),-1!==t.indexOf("_")){if(-1!==t.indexOf("__"))throw new Sk.builtin.ValueError("invalid literal for int() with base "+e+": '"+i+"'");t=10!==e?t.replace(y,""):t.charAt(0)+t.substring(1).replace(y,"")}if(0===t.length)throw new Sk.builtin.ValueError("invalid literal for int() with base "+e+": '"+i+"'");for(n=0;n=r?o=r-48:65<=r&&90>=r?o=r-65+10:97<=r&&122>=r&&(o=r-97+10),o>=e)throw new Sk.builtin.ValueError("invalid literal for int() with base "+e+": '"+i+"'")}if(s&&(t="-"+t),p(o=parseInt(t,e)))return o;for(i=!1,"-"===t[0]&&(i=!0,t=t.substring(1)),e=JSBI.BigInt(e),s=S,n=JSBI.__ZERO,r=t.length-1;0<=r;r--)48<=(o=t.charCodeAt(r))&&57>=o?o-=48:65<=o&&90>=o?o=o-65+10:97<=o&&122>=o&&(o=o-97+10),o=JSBI.multiply(JSBI.BigInt(o),s),n=JSBI.add(n,o),s=JSBI.multiply(s,e);return i&&(n=JSBI.multiply(n,JSBI.BigInt(-1))),n},Sk.builtin.int_.py2$methods={},Sk.longFromStr=function(t,e){return Sk.__future__.python3?new Sk.builtin.int_(h(t)):(t=Sk.str2number(t,e),new Sk.builtin.lng(t))},Sk.exportSymbol("Sk.longFromStr",Sk.longFromStr),Sk.builtin.int_.withinThreshold=p,Sk.builtin.int_.stringToNumberOrBig=h;const T=[.5,1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824,2147483648,4294967296,8589934592,17179869184,34359738368,68719476736,137438953472,274877906944,549755813888,1099511627776,2199023255552,4398046511104,8796093022208,17592186044416,35184372088832,70368744177664,0x800000000000,281474976710656,562949953421312,0x4000000000000,0x8000000000000,4503599627370496,9007199254740992];Sk.builtin.lng=Sk.abstr.buildNativeClass("long",{base:Sk.builtin.int_,constructor:function(t){void 0!==(t=Sk.builtin.int_.call(this,t))&&(this.v=t.v)},slots:{$r(){return new Sk.builtin.str(this.v.toString()+"L")},tp$as_number:!0,nb$negative(){return new Sk.builtin.lng(v.nb$negative.call(this).v)},nb$positive(){return new Sk.builtin.lng(v.nb$positive.call(this).v)}}});const v=Sk.builtin.int_.prototype,$=[];for(t=-5;257>t;t++)$[t]=Object.create(Sk.builtin.int_.prototype,{v:{value:t}});const w=$[0],E=$[1]},function(t,e){const n=Sk.builtin.int_.prototype;Sk.builtin.bool=Sk.abstr.buildNativeClass("bool",{constructor:function(t){return Sk.misceval.isTrue(t)?Sk.builtin.bool.true$:Sk.builtin.bool.false$},base:Sk.builtin.int_,slots:{tp$doc:"bool(x) -> bool\n\nReturns True when the argument x is true, False otherwise.\nThe builtins True and False are the only two instances of the class bool.\nThe class bool is a subclass of the class int, and cannot be subclassed.",tp$new:(t,e)=>(Sk.abstr.checkNoKwargs("bool",e),Sk.abstr.checkArgsLen("bool",t,0,1),new Sk.builtin.bool(t[0])),$r(){return this.v?this.str$True:this.str$False},tp$as_number:!0,nb$and(t){return t.ob$type===Sk.builtin.bool?new Sk.builtin.bool(this.v&t.v):n.nb$and.call(this,t)},nb$or(t){return t.ob$type===Sk.builtin.bool?new Sk.builtin.bool(this.v|t.v):n.nb$or.call(this,t)},nb$xor(t){return t.ob$type===Sk.builtin.bool?new Sk.builtin.bool(this.v^t.v):n.nb$xor.call(this,t)}},flags:{sk$unacceptableBase:!0},methods:{__format__:{$meth(){return this.$r()},$flags:{OneArg:!0}}},proto:{str$False:new Sk.builtin.str("False"),str$True:new Sk.builtin.str("True"),valueOf(){return!!this.v}}}),Sk.exportSymbol("Sk.builtin.bool",Sk.builtin.bool),Sk.builtin.bool.true$=Object.create(Sk.builtin.bool.prototype,{v:{value:1,enumerable:!0}}),Sk.builtin.bool.false$=Object.create(Sk.builtin.bool.prototype,{v:{value:0,enumerable:!0}})},function(t,e){function n(t){const e=[t,0];if(0===t)return e;var n=Math.abs(t);let i=Math.max(-1023,Math.floor(Math.log2(n))+1);for(n*=Math.pow(2,-i);.5>n;)n*=2,i--;for(;1<=n;)n*=.5,i++;return 0>t&&(n=-n),e[0]=n,e[1]=i,e}function i(){return new Sk.builtin.float_(this.v)}function s(t){return function(e){const n=this.v;if("number"!=typeof(e=e.v)){if(!JSBI.__isBigInt(e))return Sk.builtin.NotImplemented.NotImplemented$;if(1/0==(e=parseFloat(JSBI.toNumber(e)))||-1/0==e)throw new Sk.builtin.OverflowError("int too large to convert to float")}return t(n,e)}}function r(t,e){return function(n){const i=this.v;if("number"!=typeof(n=n.v)){if(!JSBI.__isBigInt(n))return Sk.builtin.NotImplemented.NotImplemented$;if(void 0!==e)return e(i,n)}return t(i,n)}}function o(t){const e=s(t);return function(t,n){if(void 0!==n&&!Sk.builtin.checkNone(n))throw new Sk.builtin.TypeError("pow() 3rd argument not allowed unless all arguments are integers");return e.call(this,t)}}function a(t,e){if(0===e)throw new Sk.builtin.ZeroDivisionError("integer division or modulo by zero");return 1/0===t?1/0===e||-1/0===t?new Sk.builtin.float_(NaN):0>e?new Sk.builtin.float_(-1/0):new Sk.builtin.float_(1/0):-1/0===t?1/0===e||-1/0===t?new Sk.builtin.float_(NaN):0>e?new Sk.builtin.float_(1/0):new Sk.builtin.float_(-1/0):new Sk.builtin.float_(t/e)}function l(t,e){if(1/0===t||-1/0===t)return new Sk.builtin.float_(NaN);if(0===e)throw new Sk.builtin.ZeroDivisionError("integer division or modulo by zero");return 1/0===e?0>t?new Sk.builtin.float_(-1):new Sk.builtin.float_(0):-1/0===e?0>t||0!==t?new Sk.builtin.float_(0):new Sk.builtin.float_(-1):new Sk.builtin.float_(Math.floor(t/e))}function u(t,e){if(0===e)throw new Sk.builtin.ZeroDivisionError("integer division or modulo by zero");if(0===t)return new Sk.builtin.float_(0);if(1/0===e)return 1/0===t||-1/0===t?new Sk.builtin.float_(NaN):0t?0n&&(n+=e):0>e&&0!==n&&(n+=e),0===n&&(0>e?n=-0:-1/0==1/0/n&&(n=0)),new Sk.builtin.float_(n)}function c(t,e){if(0>t&&0!=e%1)return new Sk.builtin.complex(t,0).nb$power(new Sk.builtin.complex(e,0));if(0===t&&0>e)throw new Sk.builtin.ZeroDivisionError("0.0 cannot be raised to a negative power");const n=Math.pow(t,e);if(1/0===Math.abs(n)&&1/0!==Math.abs(t)&&1/0!==Math.abs(e))throw new Sk.builtin.OverflowError("Numerical result out of range");return new Sk.builtin.float_(n)}Sk.builtin.float_=Sk.abstr.buildNativeClass("float",{constructor:function(t){if(Sk.asserts.assert(this instanceof Sk.builtin.float_,"bad call to float use 'new'"),"number"==typeof t)this.v=t;else if(void 0===t)this.v=0;else if("string"==typeof t)this.v=parseFloat(t);else{if(t.nb$float)return t.nb$float();Sk.asserts.fail("bad argument to float constructor")}},slots:{tp$getattr:Sk.generic.getAttr,tp$as_number:!0,tp$doc:"Convert a string or number to a floating point number, if possible.",tp$hash(){var t=this.v;if(!Number.isFinite(t))return Number.isNaN(t)?0:0e&&(t=-1,e=-e);let s,r=0;for(;e;)r=r<<28&536870911|r>>1,e*=268435456,i-=28,s=Math.trunc(e),e-=s,r+=s,536870911<=r&&(r-=536870911);return i=0<=i?i%29:28-(-1-i)%29,r=(r<>29-i)*t,-1===r?-2:r},$r(){return new Sk.builtin.str(this.str$(10,!0))},tp$new(t,e){if(e&&e.length)throw new Sk.builtin.TypeError("float() takes no keyword arguments");if(t&&1t?Math.ceil(t):Math.floor(t),Sk.builtin.int_.withinThreshold(t)?new Sk.builtin.int_(t):new Sk.builtin.int_(JSBI.BigInt(t))},nb$float:i,nb$long(){return new Sk.builtin.lng(this.nb$int().v)},nb$add:s(((t,e)=>new Sk.builtin.float_(t+e))),nb$subtract:s(((t,e)=>new Sk.builtin.float_(t-e))),nb$reflected_subtract:s(((t,e)=>new Sk.builtin.float_(e-t))),nb$multiply:s(((t,e)=>new Sk.builtin.float_(t*e))),nb$divide:s(a),nb$reflected_divide:s(((t,e)=>a(e,t))),nb$floor_divide:s(l),nb$reflected_floor_divide:s(((t,e)=>l(e,t))),nb$remainder:s(u),nb$reflected_remainder:s(((t,e)=>u(e,t))),nb$divmod:s(((t,e)=>new Sk.builtin.tuple([l(t,e),u(t,e)]))),nb$reflected_divmod:s(((t,e)=>new Sk.builtin.tuple([l(e,t),u(e,t)]))),nb$power:o(c),nb$reflected_power:o(((t,e)=>c(e,t))),nb$abs(){return new Sk.builtin.float_(Math.abs(this.v))},nb$negative(){return new Sk.builtin.float_(-this.v)},nb$positive(){return new Sk.builtin.float_(this.v)},nb$bool(){return 0!==this.v},nb$isnegative(){return 0>this.v},nb$ispositive(){return 0<=this.v},ob$eq:r(((t,e)=>t==e),JSBI.EQ),ob$ne:r(((t,e)=>t!=e),JSBI.NE),ob$gt:r(((t,e)=>t>e),JSBI.GT),ob$ge:r(((t,e)=>t>=e),JSBI.GE),ob$lt:r(((t,e)=>tt<=e),JSBI.LE)},getsets:{real:{$get:i,$doc:"the real part of a complex number"},imag:{$get:()=>new Sk.builtin.float_(0),$doc:"the imaginary part of a complex number"}},methods:{conjugate:{$meth:i,$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return self, the complex conjugate of any float."},__trunc__:{$meth(){return this.nb$int()},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return the Integral closest to x between 0 and x."},__round__:{$meth(t){return this.round$(t)},$flags:{MinArgs:0,MaxArgs:1},$textsig:"($self, ndigits=None, /)",$doc:"Return the Integral closest to x, rounding half toward even.\n\nWhen an argument is passed, work like built-in round(x, ndigits)."},as_integer_ratio:{$meth(){if(!Number.isFinite(this.v)){if(Number.isNaN(this.v))throw new Sk.builtin.ValueError("cannot convert NaN to integer ratio");throw new Sk.builtin.OverflowError("cannot convert Infinity to integer ratio")}let[t,e]=n(this.v);for(var i=0;300>i&&t!=Math.floor(t);i++)t*=2,e--;i=new Sk.builtin.int_(Math.abs(e));let s=new Sk.builtin.int_(t),r=new Sk.builtin.int_(1);return 0>> (10.0).as_integer_ratio()\n(10, 1)\n>>> (0.0).as_integer_ratio()\n(0, 1)\n>>> (-.25).as_integer_ratio()\n(-1, 4)"},is_integer:{$meth(){return new Sk.builtin.bool(Number.isInteger(this.v))},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:"Return True if the float is an integer."},__getnewargs__:{$meth(){return new Sk.builtin.tuple([this])},$flags:{NoArgs:!0},$textsig:"($self, /)",$doc:Sk.builtin.none.none$},__format__:{$meth:Sk.formatting.mkNumber__format__(!0),$flags:{OneArg:!0},$textsig:"($self, format_spec, /)",$doc:Sk.builtin.none.none$}},proto:{valueOf(){return this.v}}});const p=/_[eE]|[eE]_|\._|_\.|[+-]_|__/,h=/_(?=[^_])/g;Sk.builtin.float_.PyFloat_Check=function(t){return void 0!==t&&!!(Sk.builtin.checkNumber(t)||Sk.builtin.checkFloat(t)||t.ob$type.$isSubType(Sk.builtin.float_))},Sk.builtin.float_.prototype.toFixed=function(t){return t=Sk.builtin.asnum$(t),this.v.toFixed(t)},Sk.builtin.float_.prototype.round$=function(t){var e=Sk.builtin.asnum$(this),n=void 0===t?0:Sk.misceval.asIndexSized(t);if(Sk.__future__.bankers_rounding){e*=Math.pow(10,n);var i=Math.round(e);return n=(.5==(0n.length?e.toExponential():e.toExponential(11)),0>n.indexOf("e")&&0<=n.indexOf(".")){for(;"0"==n.charAt(n.length-1);)n=n.substring(0,n.length-1);"."==n.charAt(n.length-1)&&(n+="0")}n=(n=(n=n.replace(/\.0+e/,"e","i")).replace(/(e[-+])([1-9])$/,"$10$2")).replace(/0+(e.*)/,"$1")}else n=e.toString(t);return 0===this.v&&-1/0==1/this.v&&(n="-"+n),0>n.indexOf(".")&&0>n.indexOf("E")&&0>n.indexOf("e")&&(n+=".0"),n},Sk.builtin.float_.py2$methods={}},function(t,e){function n(t){let e=t.v;if("number"==typeof e)return e;if(t.nb$float&&(e=t.nb$float()),void 0===e)throw new Sk.builtin.TypeError("a float is required");return e.v}function i(t,e,n){return n===Sk.builtin.complex.prototype?new Sk.builtin.complex(t,e):(n=new n.constructor,Sk.builtin.complex.call(n,t,e),n)}function s(t,e){return function(n){const i=this.real,s=this.imag;var r=n.real;const o=n.v;if("number"==typeof r)n=n.imag;else if("number"==typeof o)r=o,n=0;else{if(!JSBI.__isBigInt(o))return Sk.builtin.NotImplemented.NotImplemented$;if(void 0===e){if(1/0==(r=parseFloat(JSBI.toNumber(o)))||-1/0==r)throw new Sk.builtin.OverflowError("int too large to convert to float")}else r=o.toString();n=0}return t(i,s,r,n)}}function r(t,e,n,i){var s=Math.abs(n);const r=Math.abs(i);if(s>=r){if(0===s)throw new Sk.builtin.ZeroDivisionError("complex division by zero");i=(t+e*(s=i/n))/(n+=i*s),t=(e-t*s)/n}else r>=s?(n=n*(s=n/i)+i,Sk.asserts.assert(0!==i),i=(t*s+e)/n,t=(e*s-t)/n):t=i=NaN;return new Sk.builtin.complex(i,t)}function o(t,e,n,i){if(0===n&&0===i){i=1;var s=0}else if(0===t&&0===e){if(0!==i||0>n)throw new Sk.builtin.ZeroDivisionError("complex division by zero");s=i=0}else{const r=Math.hypot(t,e);s=Math.pow(r,n),n*=t=Math.atan2(e,t),0!==i&&(s/=Math.exp(t*i),n+=i*Math.log(r)),i=s*Math.cos(n),s*=Math.sin(n)}return new Sk.builtin.complex(i,s)}function a(t,e,n){let i=1;var s=new Sk.builtin.complex(1,0);for(t=new Sk.builtin.complex(t,e);0=i;)n&i&&(s=new Sk.builtin.complex(s.real*t.real-s.imag*t.imag,s.real*t.imag+t.real*s.imag)),i<<=1,t=new Sk.builtin.complex(t.real*t.real-t.imag*t.imag,2*t.real*t.imag);return s}function l(t,e,n,i,s){switch(s=!1,e){case"e":case"f":case"g":break;case"E":s=!0,e="e";break;case"F":s=!0,e="f";break;case"r":if(0!==n)throw Error("Bad internall call");n=17,e="g";break;default:throw Error("Bad internall call")}if(isNaN(t))t="nan";else if(1/0===t)t="inf";else if(-1/0===t)t="-inf";else{i&l.Py_DTSF_ADD_DOT_0&&(e="g");var r="%"+(i&l.Py_DTSF_ALT?"#":"");null!=n&&(r=r+"."+n),t=(t=(r=new Sk.builtin.str(r+e)).nb$remainder(new Sk.builtin.float_(t))).v}return i&l.Py_DTSF_SIGN&&"-"!==t[0]&&(t="+"+t),s&&(t=t.toUpperCase()),t}Sk.builtin.complex=Sk.abstr.buildNativeClass("complex",{constructor:function(t,e){Sk.asserts.assert(this instanceof Sk.builtin.complex,"bad call to complex constructor, use 'new'"),this.real=t,this.imag=e},slots:{tp$as_number:!0,tp$doc:"Create a complex number from a real part and an optional imaginary part.\n\nThis is equivalent to (real + imag*1j) where imag defaults to 0.",tp$hash(){var t=new Sk.builtin.float_(this.real).tp$hash();return t=1003*new Sk.builtin.float_(this.imag).tp$hash()+t,Sk.builtin.int_.withinThreshold(t)?t:new Sk.builtin.int_(JSBI.BigInt(t)).tp$hash()},tp$getattr:Sk.generic.getAttr,tp$new(t,e){{var s,r=(t=Sk.abstr.copyKeywordsToNamedArgs("complex",["real","imag"],t,e,[null,null]))[1];let a=e=!1;var o=t[0];if(null!=o&&o.constructor===Sk.builtin.complex&&null==r)e=o;else if(Sk.builtin.checkString(o)){if(null!=r)throw new Sk.builtin.TypeError("complex() can't take second arg if first is a string");e=Sk.builtin.complex.complex_subtype_from_string(o,this)}else{if(null!=r&&Sk.builtin.checkString(r))throw new Sk.builtin.TypeError("complex() second arg can't be a string");if(null==o?t=null:t=void 0!==(t=Sk.abstr.lookupSpecial(o,Sk.builtin.str.$complex))?Sk.misceval.callsimArray(t,[]):null,null!=t&&t!==Sk.builtin.NotImplemented.NotImplemented$){if(!u(t))throw new Sk.builtin.TypeError("__complex__ should return a complex object");o=t}if(null!=o&&void 0===o.nb$float)throw new Sk.builtin.TypeError("complex() first argument must be a string or a number, not '"+Sk.abstr.typeName(o)+"'");if(null!=r&&void 0===r.nb$float)throw new Sk.builtin.TypeError("complex() second argument must be a number, not '"+Sk.abstr.typeName(o)+"'");null==o?o=t=0:u(o)?(t=o.real,o=o.imag,e=!0):(t=n(o),o=0),null==r?r=s=0:u(r)?(s=r.real,r=r.imag,a=!0):(s=n(r),r=0),!0===a&&(t-=r),!0===e&&(s+=o),e=i(t,s,this)}}return e},tp$richcompare(t,e){if("Eq"!==e&&"NotEq"!==e){if(Sk.builtin.checkNumber(t)||u(t))throw new Sk.builtin.TypeError("no ordering relation is defined for complex numbers");return Sk.builtin.NotImplemented.NotImplemented$}return s((function(t,n,i,s){return t=t==i&&n==s,"Eq"===e?t:!t}),!0).call(this,t)},$r(){{var t,e;let s=t="";var n=this.real,i=this.imag;(e=0===n)&&(e=1==(n?0>n?-1:1:0>1/n?-1:1)),e?(n="",e=l(i,"g",null,0,null)):(n=t=l(n,"g",null,0,null),e=l(i,"g",null,l.Py_DTSF_SIGN,null),0===i&&-1/0==1/i&&e&&"-"!==e[0]&&(e="-"+e),t="(",s=")"),i=new Sk.builtin.str(""+t+n+e+"j"+s)}return i},nb$int(){throw new Sk.builtin.TypeError("can't convert complex to int")},nb$long(){throw new Sk.builtin.TypeError("can't convert complex to long")},nb$float(){throw new Sk.builtin.TypeError("can't convert complex to float")},nb$positive(){return new Sk.builtin.complex(this.real,this.imag)},nb$negative(){return new Sk.builtin.complex(-this.real,-this.imag)},nb$bool(){return this.real||this.imag},nb$add:s(((t,e,n,i)=>new Sk.builtin.complex(t+n,e+i))),nb$subtract:s(((t,e,n,i)=>new Sk.builtin.complex(t-n,e-i))),nb$reflected_subtract:s(((t,e,n,i)=>new Sk.builtin.complex(n-t,i-e))),nb$multiply:s(((t,e,n,i)=>new Sk.builtin.complex(n*t-i*e,t*i+e*n))),nb$divide:s(r),nb$reflected_divide:s(((t,e,n,i)=>r(n,i,t,e))),nb$floor_divide(t){throw new Sk.builtin.TypeError("can't take floor of complex number.")},nb$reflected_floor_divide(t){throw new Sk.builtin.TypeError("can't take floor of complex number.")},nb$remainder(t){throw new Sk.builtin.TypeError("can't mod complex numbers.")},nb$reflected_remainder(t){throw new Sk.builtin.TypeError("can't mod complex numbers.")},nb$divmod(t){throw new Sk.builtin.TypeError("can't take floor or mod of complex number.")},nb$power(t,e){if(null!=e&&!Sk.builtin.checkNone(e))throw new Sk.builtin.ValueError("complex modulo");return _.call(this,t)},nb$reflected_power(t,e){if(null!=e&&!Sk.builtin.checkNone(e))throw new Sk.builtin.ValueError("complex modulo");return d.call(this,t)},nb$abs(){var t=this.real;const e=this.imag;if(!Number.isFinite(t)||!Number.isFinite(e))return 1/0===t||-1/0===t?new Sk.builtin.float_(Math.abs(t)):1/0===e||-1/0===e?new Sk.builtin.float_(Math.abs(e)):new Sk.builtin.float_(NaN);if(t=Math.hypot(t,e),!Number.isFinite(t))throw new Sk.builtin.OverflowError("absolute value too large");return new Sk.builtin.float_(t)}},getsets:{real:{$get(){return new Sk.builtin.float_(this.real)},$doc:"the real part of a complex number"},imag:{$get(){return new Sk.builtin.float_(this.imag)},$doc:"the imaginary part of a complex number"}},methods:{conjugate:{$meth(){return new Sk.builtin.complex(this.real,-this.imag)},$flags:{NoArgs:!0},$textsig:null,$doc:"complex.conjugate() -> complex\n\nReturn the complex conjugate of its argument. (3-4j).conjugate() == 3+4j."},__getnewargs__:{$meth(){return new Sk.builtin.tuple([new Sk.builtin.float_(this.real),new Sk.builtin.float_(this.imag)])},$flags:{NoArgs:!0},$textsig:null,$doc:Sk.builtin.none.none$},__format__:{$meth(t){if(Sk.builtin.checkString(t))throw new Sk.builtin.NotImplementedError("__format__ is not implemented for complex type.");throw new Sk.builtin.TypeError("__format__ requires str")},$flags:{OneArg:!0},$textsig:null,$doc:"complex.__format__() -> str\n\nConvert to a string according to format_spec."}}}),Sk.exportSymbol("Sk.builtin.complex",Sk.builtin.complex);const u=Sk.builtin.checkComplex,c=/_[eE]|[eE]_|\._|_\.|[+-]_|_j|j_/,p=/_(?=[^_])/g;Sk.builtin.complex.complex_subtype_from_string=function(t,e){e=e||Sk.builtin.complex.prototype;var n=0,s=0,r=!1;if(Sk.builtin.checkString(t))t=Sk.ffi.remapToJs(t);else if("string"!=typeof t)throw new TypeError("provided unsupported string-alike argument");if(-1!==t.indexOf("\0")||0===t.length||""===t)throw new Sk.builtin.ValueError("complex() arg is a malformed string");var o=0;for(t=(t=t.replace(/inf|infinity/gi,"Infinity")).replace(/nan/gi,"NaN");" "===t[o];)o++;if("("===t[o])for(r=!0,o++;" "===t[o];)o++;if(-1!==t.indexOf("_")){if(c.test(t))throw new Sk.builtin.ValueError("could not convert string to complex: '"+t+"'");t=t.charAt(0)+t.substring(1).replace(p,"")}var a=/^(?:[+-]?(?:(?:(?:\d*\.\d+)|(?:\d+\.?))(?:[eE][+-]?\d+)?|NaN|Infinity))/,l=t.substr(o),u=l.match(a);if(null!==u)if("j"===t[o+=u[0].length]||"J"===t[o])s=parseFloat(u[0]),o++;else if("+"===t[o]||"-"===t[o]){if(n=parseFloat(u[0]),null!==(u=t.substr(o).match(a))?(s=parseFloat(u[0]),o+=u[0].length):(s="+"===t[o]?1:-1,o++),"j"!==t[o]&&"J"!==t[o])throw new Sk.builtin.ValueError("complex() arg is malformed string");o++}else n=parseFloat(u[0]);else null!==(u=u=l.match(/^([+-]?[jJ])/))&&(s=1===u[0].length||"+"===u[0][0]?1:-1,o+=u[0].length);for(;" "===t[o];)o++;if(r){if(")"!==t[o])throw new Sk.builtin.ValueError("complex() arg is malformed string");for(o++;" "===t[o];)o++}if(t.length!==o)throw new Sk.builtin.ValueError("complex() arg is malformed string");return i(n,s,e)};const h=(t,e,n,i)=>{const s=0|n;return 0===i&&n===s?(100s?t=o(t,e,s,0):0h(n,i,t,e)));l.Py_DTSF_SIGN=1,l.Py_DTSF_ADD_DOT_0=2,l.Py_DTSF_ALT=4,l.Py_DTST_FINITE=0,l.Py_DTST_INFINITE=1,l.Py_DTST_NAN=2},function(t,e){Sk.builtin.slice=Sk.abstr.buildNativeClass("slice",{constructor:function(t,e,n){void 0===e&&void 0===n&&(e=t,t=Sk.builtin.none.none$),void 0===e&&(e=Sk.builtin.none.none$),void 0===n&&(n=Sk.builtin.none.none$),this.start=t,this.stop=e,this.step=n},slots:{tp$getattr:Sk.generic.getAttr,tp$doc:"slice(stop)\nslice(start, stop[, step])\n\nCreate a slice object. This is used for extended slicing (e.g. a[0:10:2]).",tp$hash:Sk.builtin.none.none$,tp$new:(t,e)=>(Sk.abstr.checkNoKwargs("slice",e),Sk.abstr.checkArgsLen("slice",t,1,3),new Sk.builtin.slice(...t)),$r(){const t=Sk.misceval.objectRepr(this.start),e=Sk.misceval.objectRepr(this.stop),n=Sk.misceval.objectRepr(this.step);return new Sk.builtin.str("slice("+t+", "+e+", "+n+")")},tp$richcompare(t,e){if(t.ob$type!==Sk.builtin.slice)return Sk.builtin.NotImplemented.NotImplemented$;const n=new Sk.builtin.tuple([this.start,this.stop,this.step]);return t=new Sk.builtin.tuple([t.start,t.stop,t.step]),n.tp$richcompare(t,e)}},getsets:{start:{$get(){return this.start}},step:{$get(){return this.step}},stop:{$get(){return this.stop}}},methods:{indices:{$meth:function(t){if(0>(t=Sk.misceval.asIndexSized(t,Sk.builtin.OverflowError)))throw new Sk.builtin.TypeError("length should not be negative");const{start:e,stop:n,step:i}=this.slice$indices(t);return new Sk.builtin.tuple([new Sk.builtin.int_(e),new Sk.builtin.int_(n),new Sk.builtin.int_(i)])},$doc:"S.indices(len) -> (start, stop, stride)\n\nAssuming a sequence of length len, calculate the start and stop\nindices, and the stride length of the extended slice described by\nS. Out of bounds indices are clipped in a manner consistent with the\nhandling of normal slices.",$textsig:null,$flags:{OneArg:!0}}},proto:{slice$as_indices(t){let e;var n=t?t=>Sk.misceval.asIndexSized(t,null,"slice indices must be integers or None or have an __index__ method"):t=>Sk.misceval.asIndexOrThrow(t,"slice indices must be integers or None or have an __index__ method");if(Sk.builtin.checkNone(this.step))e=1;else if(e=n(this.step),0===e)throw new Sk.builtin.ValueError("slice step cannot be zero");return{start:t=Sk.builtin.checkNone(this.start)?null:n(this.start),stop:n=Sk.builtin.checkNone(this.stop)?null:n(this.stop),step:e}},$wrt:(t,e,n,i,s)=>(s=s?e=>JSBI.__isBigInt(e)?JSBI.add(e,JSBI.BigInt(t)):e+t:e=>e+t,0e&&(0>(e=s(e))&&(e=0)),null===n||n>t?n=t:0>n&&(n=s(n))):(null===e||e>=t?e=t-1:0>e&&(e=s(e)),null===n?n=-1:0>n&&(0>(n=s(n))&&(n=-1))),{start:e,stop:n,step:i}),slice$indices(t,e){let{start:n,stop:i,step:s}=this.slice$as_indices(!0,e);return this.$wrt(t,n,i,s,e)},sssiter$(t,e){let{start:n,stop:i,step:s}=this.slice$indices(t,!0);if(0i;t+=s)e(t)}},flags:{sk$unacceptableBase:!0}}),Sk.builtin.slice.startEnd$wrt=function(t,e,n){return t=t.sq$length(),void 0===e||Sk.builtin.checkNone(e)?e=0:0>(e=Sk.misceval.asIndexSized(e,null,"slice indices must be integers or have an __index__ method"))&&(0>(e+=t)&&(e=0)),void 0===n||Sk.builtin.checkNone(n)?n=t:0>(n=Sk.misceval.asIndexSized(n,null,"slice indices must be integers or have an __index__ method"))?0>(n+=t)&&(n=0):n>t&&(n=t),{start:e,end:n}}},function(t,e){function n(t){return function(e){return Sk.builtin.checkAnySet(e)?t.call(this,e):Sk.builtin.NotImplemented.NotImplemented$}}function i(t){return t instanceof Sk.builtin.set&&t.tp$hash===Sk.builtin.none.none$&&(t=new Sk.builtin.frozenset(Sk.misceval.arrayFromIterable(t))),t}t={},Sk.builtin.set=Sk.abstr.buildNativeClass("set",{constructor:function(t){void 0===t?t=[]:Array.isArray(t)||(t=Sk.misceval.arrayFromIterable(t)),Sk.asserts.assert(this instanceof Sk.builtin.set,"Bad call to set - must be called with an Array and 'new'");const e=[];for(let n=0;n new empty set object\nset(iterable) -> new set object\n\nBuild an unordered collection of unique elements.",tp$init(t,e){return Sk.abstr.checkNoKwargs("set",e),Sk.abstr.checkArgsLen("set",t,0,1),this.set$clear(),(t=t[0])&&this.set$update(t)},tp$new:Sk.generic.new,$r(){if(this.in$repr)return new Sk.builtin.str(Sk.abstr.typeName(this)+"(...)");this.in$repr=!0;const t=this.sk$asarray().map((t=>Sk.misceval.objectRepr(t)));return this.in$repr=!1,Sk.__future__.python3?0===t.length?new Sk.builtin.str(Sk.abstr.typeName(this)+"()"):this.ob$type!==Sk.builtin.set?new Sk.builtin.str(Sk.abstr.typeName(this)+"({"+t.join(", ")+"})"):new Sk.builtin.str("{"+t.join(", ")+"}"):new Sk.builtin.str(Sk.abstr.typeName(this)+"(["+t.join(", ")+"])")},tp$iter(){return new s(this)},tp$richcompare(t,e){if(!Sk.builtin.checkAnySet(t))return Sk.builtin.NotImplemented.NotImplemented$;switch(e){case"NotEq":case"Eq":return t=this===t||this.get$size()===t.get$size()&&Sk.misceval.isTrue(this.set$issubset(t)),"Eq"===e?t:!t;case"LtE":return this===t||Sk.misceval.isTrue(this.set$issubset(t));case"GtE":return this===t||Sk.misceval.isTrue(t.set$issubset(this));case"Lt":return this.get$size()t.get$size()&&Sk.misceval.isTrue(t.set$issubset(this))}},nb$subtract:n((function(t){return this.difference.$meth.call(this,t)})),nb$and:n((function(t){return this.intersection.$meth.call(this,t)})),nb$or:n((function(t){return this.union.$meth.call(this,t)})),nb$xor:n((function(t){return this.symmetric_difference.$meth.call(this,t)})),nb$inplace_subtract:n((function(t){return t===this&&(t=t.set$copy()),Sk.misceval.chain(this.difference_update.$meth.call(this,t),(()=>this))})),nb$inplace_and:n((function(t){return Sk.misceval.chain(this.intersection_update.$meth.call(this,t),(()=>this))})),nb$inplace_or:n((function(t){return Sk.misceval.chain(this.update.$meth.call(this,t),(()=>this))})),nb$inplace_xor:n((function(t){return t===this&&(t=t.set$copy()),Sk.misceval.chain(this.symmetric_difference_update.$meth.call(this,t),(()=>this))})),sq$length(){return this.get$size()},sq$contains(t){return t=i(t),this.v.sq$contains(t)}},methods:{add:{$meth(t){return this.set$add(t),Sk.builtin.none.none$},$flags:{OneArg:!0},$textsig:null,$doc:"Add an element to a set.\n\nThis has no effect if the element is already present."},clear:{$meth(){return this.set$clear(),Sk.builtin.none.none$},$flags:{NoArgs:!0},$textsig:null,$doc:"Remove all elements from this set."},copy:{$meth(){return this.set$copy()},$flags:{NoArgs:!0},$textsig:null,$doc:"Return a shallow copy of a set."},discard:{$meth(t){return t=i(t),this.set$discard(t),Sk.builtin.none.none$},$flags:{OneArg:!0},$textsig:null,$doc:"Remove an element from a set if it is a member.\n\nIf the element is not a member, do nothing."},difference:{$meth(...t){const e=this.set$copy();return Sk.misceval.chain(Sk.misceval.iterArray(t,(t=>e.set$difference_update(t))),(()=>e))},$flags:{MinArgs:0},$textsig:null,$doc:"Return the difference of two or more sets as a new set.\n\n(i.e. all elements that are in this set but not the others.)"},difference_update:{$meth(...t){return Sk.misceval.chain(Sk.misceval.iterArray(t,(t=>this.set$difference_update(t))),(()=>Sk.builtin.none.none$))},$flags:{MinArgs:0},$textsig:null,$doc:"Remove all elements of another set from this set."},intersection:{$meth(...t){return this.set$intersection_multi(...t)},$flags:{MinArgs:0},$textsig:null,$doc:"Return the intersection of two sets as a new set.\n\n(i.e. all elements that are in both sets.)"},intersection_update:{$meth(...t){return Sk.misceval.chain(this.set$intersection_multi(...t),(t=>(this.swap$bodies(t),Sk.builtin.none.none$)))},$flags:{MinArgs:0},$textsig:null,$doc:"Update a set with the intersection of itself and another."},isdisjoint:{$meth(t){return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{if(this.sq$contains(t))return new Sk.misceval.Break(Sk.builtin.bool.false$)})),(t=>t||Sk.builtin.bool.true$))},$flags:{OneArg:!0},$textsig:null,$doc:"Return True if two sets have a null intersection."},issubset:{$meth(t){return Sk.builtin.checkAnySet(t)||(t=this.set$make_basetype(t)),Sk.misceval.chain(t,(t=>this.set$issubset(t)))},$flags:{OneArg:!0},$textsig:null,$doc:"Report whether another set contains this set."},issuperset:{$meth(t){return Sk.builtin.checkAnySet(t)||(t=this.set$make_basetype(t)),Sk.misceval.chain(t,(t=>t.set$issubset(this)))},$flags:{OneArg:!0},$textsig:null,$doc:"Report whether this set contains another set."},pop:{$meth(){if(0===this.get$size())throw new Sk.builtin.KeyError("pop from an empty set");return Sk.misceval.callsimArray(this.v.popitem,[this.v]).v[0]},$flags:{NoArgs:!0},$textsig:null,$doc:"Remove and return an arbitrary set element.\nRaises KeyError if the set is empty."},remove:{$meth(t){const e=i(t);if(this.v.mp$lookup(e))return this.v.mp$ass_subscript(e),Sk.builtin.none.none$;throw new Sk.builtin.KeyError(t)},$flags:{OneArg:!0},$textsig:null,$doc:"Remove an element from a set; it must be a member.\n\nIf the element is not a member, raise a KeyError."},symmetric_difference:{$meth(t){let e;return Sk.misceval.chain(this.set$make_basetype(t),(t=>(e=t,e.set$symmetric_diff_update(this))),(()=>e))},$flags:{OneArg:!0},$textsig:null,$doc:"Return the symmetric difference of two sets as a new set.\n\n(i.e. all elements that are in exactly one of the sets.)"},symmetric_difference_update:{$meth(t){return Sk.builtin.checkAnySet(t)||(t=this.set$make_basetype(t)),Sk.misceval.chain(t,(t=>this.set$symmetric_diff_update(t)),(()=>Sk.builtin.none.none$))},$flags:{OneArg:!0},$textsig:null,$doc:"Update a set with the symmetric difference of itself and another."},union:{$meth(...t){const e=this.set$copy();return Sk.misceval.chain(Sk.misceval.iterArray(t,(t=>e.set$update(t))),(()=>e))},$flags:{MinArgs:0},$textsig:null,$doc:"Return the union of sets as a new set.\n\n(i.e. all elements that are in either set.)"},update:{$meth(...t){return Sk.misceval.chain(Sk.misceval.iterArray(t,(t=>this.set$update(t))),(()=>Sk.builtin.none.none$))},$flags:{MinArgs:0},$textsig:null,$doc:"Update a set with the union of itself and others."}},classmethods:Sk.generic.classGetItem,proto:Object.assign(t,{sk$asarray(){return this.v.sk$asarray()},get$size(){return this.v.sq$length()},set$add(t){this.v.mp$ass_subscript(t,!0)},set$make_basetype(t){return Sk.misceval.chain(Sk.misceval.arrayFromIterable(t,!0),(t=>new this.sk$builtinBase(t)))},set$discard(t){return this.v.pop$item(t)},set$clear(){this.v=new Sk.builtin.dict([])},set$copy(){const t=new this.sk$builtinBase;return t.v=this.v.dict$copy(),t},set$difference_update(t){return Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{this.set$discard(t)}))},set$intersection(t){const e=new this.sk$builtinBase;return Sk.misceval.chain(Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{this.sq$contains(t)&&e.set$add(t)})),(()=>e))},set$intersection_multi(...t){if(!t.length)return this.set$copy();let e=this;return Sk.misceval.chain(Sk.misceval.iterArray(t,(t=>Sk.misceval.chain(e.set$intersection(t),(t=>{e=t})))),(()=>e))},set$issubset(t){if(this.get$size()>t.get$size())return Sk.builtin.bool.false$;for(let e=this.tp$iter(),n=e.tp$iternext();void 0!==n;n=e.tp$iternext())if(!t.sq$contains(n))return Sk.builtin.bool.false$;return Sk.builtin.bool.true$},set$symmetric_diff_update(t){return Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{void 0===this.set$discard(t)&&this.set$add(t)}))},set$update(t){return Sk.misceval.iterFor(Sk.abstr.iter(t),(t=>{this.set$add(t)}))},swap$bodies(t){this.v=t.v}})}),Sk.exportSymbol("Sk.builtin.set",Sk.builtin.set),e=Sk.builtin.set.prototype,Sk.builtin.frozenset=Sk.abstr.buildNativeClass("frozenset",{constructor:function(t){void 0===t?t=[]:Array.isArray(t)||(t=Sk.misceval.arrayFromIterable(t)),Sk.asserts.assert(this instanceof Sk.builtin.frozenset,"bad call to frozen set - must be called with 'new'");const e=[];for(let n=0;n empty frozenset object\nfrozenset(iterable) -> frozenset object\n\nBuild an immutable unordered collection of unique elements.",tp$hash(){let t=1927868237;const e=this.sk$asarray();t*=e.length+1;for(let n=0;nt.length?new Sk.builtin.frozenset(t):Sk.builtin.frozenset.$emptyset)))},$r:e.$r,tp$iter:e.tp$iter,tp$richcompare:e.tp$richcompare,nb$subtract:e.nb$subtract,nb$and:e.nb$and,nb$or:e.nb$or,nb$xor:e.nb$xor,sq$length:e.sq$length,sq$contains:e.sq$contains},methods:{copy:Object.assign({},e.copy.d$def,{$meth(){return this.constructor===this.sk$builtinBase?this:new Sk.builtin.frozenset(this.sk$asarray())}}),difference:e.difference.d$def,intersection:e.intersection.d$def,isdisjoint:e.isdisjoint.d$def,issubset:e.issubset.d$def,issuperset:e.issuperset.d$def,symmetric_difference:e.symmetric_difference.d$def,union:e.union.d$def},classmethods:Sk.generic.classGetItem,proto:Object.assign({$subtype_new(t,e){const n=new this.constructor;return Sk.misceval.chain(Sk.builtin.frozenset.prototype.tp$new(t),(t=>(n.v=t.v,n)))}},t)}),Sk.builtin.frozenset.$emptyset=new Sk.builtin.frozenset([]),Sk.exportSymbol("Sk.builtin.frozenset",Sk.builtin.frozenset);var s=Sk.abstr.buildIteratorClass("set_iterator",{constructor:function(t){this.$index=0,this.$seq=t.sk$asarray(),this.$orig=t},iternext:Sk.generic.iterNextWithArrayCheckSize,methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$unacceptableBase:!0}})},function(t,e){Sk.builtin.print=function(t,e){let n,[i,s,r]=Sk.abstr.copyKeywordsToNamedArgs("print",["sep","end","file","flush"],[],e);if(void 0===i||Sk.builtin.checkNone(i))i=" ";else{if(!Sk.builtin.checkString(i))throw new Sk.builtin.TypeError("sep must be None or a string, not "+Sk.abstr.typeName(i));i=i.$jsstr()}if(void 0===s||Sk.builtin.checkNone(s))s="\n";else{if(!Sk.builtin.checkString(s))throw new Sk.builtin.TypeError("end must be None or a string, not "+Sk.abstr.typeName(s));s=s.$jsstr()}if(void 0!==r&&!Sk.builtin.checkNone(r)&&(n=Sk.abstr.lookupSpecial(r,Sk.builtin.str.$write),void 0===n))throw new Sk.builtin.AttributeError("'"+Sk.abstr.typeName(r)+"' object has no attribute 'write'");const o=new Sk.builtin.str(t.map((t=>new Sk.builtin.str(t).toString())).join(i)+s);if(void 0===n)return Sk.misceval.chain(Sk.importModule("sys",!1,!0),(t=>(n=Sk.abstr.lookupSpecial(t.$d.stdout,Sk.builtin.str.$write))&&Sk.misceval.callsimOrSuspendArray(n,[o])));Sk.misceval.callsimArray(n,[o])},Sk.builtin.print.co_fastcall=1},function(t,e){Sk.builtin.module=Sk.abstr.buildNativeClass("module",{constructor:function(){this.$d={}},slots:{tp$doc:"Create a module object.\n\nThe name must be a string; the optional doc argument can have any type.",tp$getattr(t,e){var n=this.$d[t.$mangled];if(void 0!==n)return n;if(void 0!==(n=this.ob$type.$typeLookup(t))){const t=n.tp$descr_get;return t?t.call(n,this,this.ob$type,e):n}const i=this.$d.__getattr__;return void 0!==i?(n=Sk.misceval.tryCatch((()=>Sk.misceval.callsimOrSuspendArray(i,[t])),(t=>{if(!(t instanceof Sk.builtin.AttributeError))throw t})),e?n:Sk.misceval.retryOptionalSuspensionOrThrow(n)):void 0},tp$setattr:Sk.generic.setAttr,tp$new:Sk.generic.new,tp$init(t,e){const[n,i]=Sk.abstr.copyKeywordsToNamedArgs("module",["name","doc"],t,e,[Sk.builtin.none.none$]);Sk.builtin.pyCheckType("module","string",n),this.init$dict(n,i)},$r(){let t=this.get$name();if(void 0!==t){var e=this.get$mod_reprf();if(void 0!==e)return Sk.misceval.callsimOrSuspendArray(e,[this])}return t=void 0===t?"'?'":t,e=void 0===(e=this.from$file())?this.empty_or$loader():e,new Sk.builtin.str("")}},getsets:{__dict__:{$get(){return new Sk.builtin.mappingproxy(this.$d)}}},methods:{__dir__:{$meth(){const t=this.tp$getattr(Sk.builtin.str.$dict);if(!Sk.builtin.checkMapping(t))throw new Sk.builtin.TypeError("__dict__ is not a dictionary");const e=t.mp$lookup(Sk.builtin.str.$dir);return void 0!==e?Sk.misceval.callsimOrSuspendArray(e,[]):new Sk.builtin.list(Sk.misceval.arrayFromIterable(t))},$flags:{NoArgs:!0},$doc:"__dir__() -> list\nspecialized dir() implementation"}},proto:{sk$hasDict:!0,init$dict(t,e){this.$d.__name__=t,this.$d.__doc__=e,this.$d.__package__=Sk.builtin.none.none$,this.$d.__spec__=Sk.builtin.none.none$,this.$d.__loader__=Sk.builtin.none.none$},sk$attrError(){let t=this.get$name();return t=void 0===t?"module":"module "+t,this.$initializing&&(t="(most likely due to a circular import) partially initialized "+t),t},get$name(){const t=this.tp$getattr(Sk.builtin.str.$name);return t&&Sk.misceval.objectRepr(t)},from$file(){const t=this.tp$getattr(Sk.builtin.str.$file);return t&&" from "+Sk.misceval.objectRepr(t)},empty_or$loader(){if(this.$js&&this.$js.includes("$builtinmodule"))return" (built-in)";const t=this.tp$getattr(Sk.builtin.str.$loader);return void 0===t||Sk.builtin.checkNone(t)?"":" ("+Sk.misceval.objectRepr(t)+")"},get$mod_reprf(){const t=this.tp$getattr(Sk.builtin.str.$loader);return t&&t.tp$getattr(this.str$mod_repr)},str$mod_repr:new Sk.builtin.str("module_repr")}}),Sk.exportSymbol("Sk.builtin.module",Sk.builtin.module)},function(t,e){Sk.builtin.structseq_types={},Sk.builtin.make_structseq=function(t,e,n,i,s){i=void 0===i?{}:i,s=void 0===s?null:s;const r=t+"."+e,o=[],a={};Object.keys(n).forEach(((t,e)=>{o.push(t),a[t]={$get(){return this.v[e]},$doc:n[t]}}));const l=o.length;let u=l;Object.keys(i).forEach(((t,e)=>{a[t]={$get(){return this.$hidden[e]||Sk.builtin.none.none$},$doc:i[t]},u++}));var c=Sk.abstr.buildNativeClass(r,{constructor:function(t,e){Sk.asserts.assert(this instanceof c),Sk.builtin.tuple.call(this,t),this.$hidden=e||[]},base:Sk.builtin.tuple,slots:{tp$new(t,e){if(Sk.abstr.checkOneArg(r,t,e),(t=Sk.misceval.arrayFromIterable(t[0])).lengthu)throw new Sk.builtin.TypeError(r+"() takes an at most "+u+"-sequence ("+t.length+"-sequence given)");return new c(t.slice(0,l),t.slice(l))},tp$doc:s||Sk.builtin.none.none$,$r(){var t;if(0===this.v.length)return new Sk.builtin.str(r+"()");var e=[];for(t=0;t")}},iternext(t,e){var n=this;if(this.gi$running)throw new Sk.builtin.ValueError("generator already executing");return this.gi$running=!0,void 0===e&&(e=Sk.builtin.none.none$),this.gi$sentvalue=e,e=[this],this.func_closure&&e.push(this.func_closure),function e(i){if(i instanceof Sk.misceval.Suspension){if(t)return new Sk.misceval.Suspension(e,i);i=Sk.misceval.retryOptionalSuspensionOrThrow(i)}if(n.gi$running=!1,Sk.asserts.assert(void 0!==i),Array.isArray(i))return n.gi$resumeat=i[0],i[1];n.gi$ret=i}(this.func_code.apply(this.func_globals,e))},methods:{send:{$meth(t){return Sk.misceval.chain(this.tp$iternext(!0,t),(t=>{if(void 0===t)throw void 0!==(t=this.gi$ret)&&t!==Sk.builtin.none.none$?new Sk.builtin.StopIteration(t):new Sk.builtin.StopIteration;return t}))},$flags:{OneArg:!0},$doc:"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration."}}}),Sk.exportSymbol("Sk.builtin.generator",Sk.builtin.generator),Sk.builtin.makeGenerator=function(t,e){var n,i=new Sk.builtin.generator(null,null,null);for(n in i.tp$iternext=t,e)e.hasOwnProperty(n)&&(i[n]=e[n]);return i},Sk.exportSymbol("Sk.builtin.makeGenerator",Sk.builtin.makeGenerator)},function(t,e){Sk.builtin.file=function(t,e,n){var i;if(!(this instanceof Sk.builtin.file))return new Sk.builtin.file(t,e,n);if(this.mode=e,this.name=Sk.ffi.remapToJs(t),this.closed=!1,"/dev/stdout"===this.name)this.data$=Sk.builtin.none.none$,this.fileno=1;else if("/dev/stdin"===this.name)this.fileno=0;else if("/dev/stderr"===this.name)this.fileno=2;else{if(Sk.inBrowser)if(this.fileno=10,null==(n=document.getElementById(t.v))){if("w"!=e.v&&"a"!=e.v)throw new Sk.builtin.IOError("[Errno 2] No such file or directory: '"+t.v+"'");this.data$=""}else"textarea"==n.nodeName.toLowerCase()?this.data$=n.value:this.data$=n.textContent;else this.fileno=11,this.data$=Sk.read(t.v);for(i in this.lineList=this.data$.split("\n"),this.lineList=this.lineList.slice(0,-1),this.lineList)this.lineList[i]+="\n";this.currentLine=0}return this.pos$=0,Sk.fileopen&&10<=this.fileno&&Sk.fileopen(this),this},Sk.abstr.setUpInheritance("file",Sk.builtin.file,Sk.builtin.object),Sk.abstr.setUpBuiltinMro(Sk.builtin.file),Sk.builtin.file.prototype.$r=function(){return new Sk.builtin.str("<"+(this.closed?"closed":"open")+"file '"+this.name+"', mode '"+Sk.ffi.remapToJs(this.mode)+"'>")},Sk.builtin.file.prototype.tp$iter=function(){var t={tp$iter:function(){return t},$obj:this,$index:this.currentLine,$lines:this.lineList,tp$iternext:function(){if(!(t.$index>=t.$lines.length))return new Sk.builtin.str(t.$lines[t.$index++])}};return t},Sk.abstr.setUpSlots(Sk.builtin.file),Sk.builtin.file.prototype.__enter__=new Sk.builtin.func((function(t){return t})),Sk.builtin.file.prototype.__exit__=new Sk.builtin.func((function(t){return Sk.misceval.callsimArray(Sk.builtin.file.prototype.close,[t])})),Sk.builtin.file.prototype.close=new Sk.builtin.func((function(t){return t.closed=!0,Sk.builtin.none.none$})),Sk.builtin.file.prototype.flush=new Sk.builtin.func((function(t){})),Sk.builtin.file.prototype.fileno=new Sk.builtin.func((function(t){return this.fileno})),Sk.builtin.file.prototype.isatty=new Sk.builtin.func((function(t){return!1})),Sk.builtin.file.prototype.read=new Sk.builtin.func((function(t,e){var n=t.data$.length;if(t.closed)throw new Sk.builtin.ValueError("I/O operation on closed file");var i=void 0===e?n:Sk.ffi.remapToJs(e);return i=new Sk.builtin.str(t.data$.substr(t.pos$,i)),t.pos$=void 0===e?n:t.pos$+Sk.ffi.remapToJs(e),t.pos$>=n&&(t.pos$=n),i})),Sk.builtin.file.$readline=function(t,e,n){if(0===t.fileno){if(t=Sk.ffi.remapToJs(n),(t=Sk.inputfun(t||""))instanceof Promise||t&&"function"==typeof t.then){var i=new Sk.misceval.Suspension;return i.resume=function(){if(i.data.error)throw i.data.error;return new Sk.builtin.str(i.data.result)},i.data={type:"Sk.promise",promise:t},i}return new Sk.builtin.str(t)}return e="",t.currentLinen(t,e))));if("object"===i){if((i=t.constructor)===Object&&Object.getPrototypeOf(t)===c||void 0===i)return e.dictHook?e.dictHook(t):l(t,e);if(i===Uint8Array)return new Sk.builtin.bytes(t);if(i===Set)return a(t,e);if(i===Map){const i=new Sk.builtin.dict;return t.forEach(((t,s)=>{i.mp$ass_subscript(n(s,e),n(t,e))})),i}return i===Sk.misceval.Suspension?t:e.proxyHook?e.proxyHook(t):u(t)}if(e.unhandledHook)return e.unhandledHook(t);Sk.asserts.fail("unhandled remap case of type "+i)}function i(t,e){if(null==t)return t;const n=t.valueOf();if(null===n)return n;const o=typeof n;return e=e||{},"string"===o?e.stringHook?e.stringHook(n):n:"boolean"===o?n:"number"===o?e.numberHook?e.numberHook(n,t):n:JSBI.__isBigInt(n)?e.bigintHook?e.bigintHook(n,t):n:Array.isArray(n)?e.arrayHook?e.arrayHook(n,t):n.map((t=>i(t,e))):n.sk$object?t instanceof Sk.builtin.dict?e.dictHook?e.dictHook(t):r(t,e):t instanceof Sk.builtin.set?e.setHook?e.setHook(t):new Set(s(t,e)):e.unhandledHook?e.unhandledHook(t):void 0:"object"===o?e.objectHook?e.objectHook(n,t):n:"function"===o?e.funcHook?e.funcHook(n,t):n:void Sk.asserts.fail("unhandled type "+o)}function s(t,e){return Array.from(t,(t=>i(t,e)))}function r(t,e){const n={};return t.$items().forEach((t=>{var[s,r]=t;n[s.valueOf()]=i(r,e)})),n}function o(t){return Number.isInteger(t)?Math.abs(t)n(t,e))))}function l(t,e){const i=new Sk.builtin.dict;return Object.entries(t).forEach((t=>{var[s,r]=t;i.mp$ass_subscript(new Sk.builtin.str(s),n(r,e))})),i}function u(t,e){if(null==t)return Sk.builtin.none.none$;var i=typeof t;if("object"!==i&&"function"!==i)return n(t);if(e=e||{},i=_.get(t)){if(e.bound===i.$bound)return i;e.name||(e.name=i.$name)}return e=new g(t,e),_.set(t,e),e}Sk.ffi={remapToPy:n,remapToJs:i,toPy:n,toJs:i,isTrue:function(t){return null!=t&&t.nb$bool?t.nb$bool():t.sq$length?0!==t.sq$length():!!t},toJsString:function(t){return String(t)},toJsNumber:function(t){return Number(t)},toJsArray:s,toJsHashMap:r,toPyDict:l,toPyFloat:function(t){return new Sk.builtin.float_(Number(t))},toPyInt:function(t){if("number"==typeof t)return t=Math.trunc(t),Math.abs(t)n(t,e))))},toPyTuple:function(t,e){return new Sk.builtin.tuple(Array.from(t,(t=>n(t,e))))},toPySet:a,numberToPy:o,proxy:u};const c=Object.prototype,p=Function.prototype,h=/^-?\d+$/,_=new WeakMap,d={dictHook:t=>u(t),unhandledHook:t=>String(t)},f=(t,e)=>({dictHook:t=>u(t),funcHook:n=>u(n,{bound:t,name:e}),unhandledHook:t=>String(t)}),m={unhandledHook:t=>{var e=_.get(t);if(e)return e;if(e={v:t,$isPyWrapped:!0,unwrap:()=>t},void 0===t.tp$call)return _.set(t,e),e;const s=(...e)=>{e=e.map((t=>n(t,d)));let s=Sk.misceval.tryCatch((()=>Sk.misceval.chain(t.tp$call(e),(t=>i(t,m)))),(t=>{if(!Sk.uncaughtException)throw t;Sk.uncaughtException(t)}));for(;s instanceof Sk.misceval.Suspension;){if(!s.optional)return Sk.misceval.asyncToPromise((()=>s));s=s.resume()}return s};return _.set(t,Object.assign(s,e)),s}},g=Sk.abstr.buildNativeClass("Proxy",{constructor:function(t,e){if(void 0===t)throw new Sk.builtin.TypeError("Proxy cannot be called from python");this.js$wrapped=t,this.$module=null,this.$methods=Object.create(null),this.in$repr=!1,e||(e={}),Object.defineProperties(this,this.memoized$slots),"function"==typeof t?(this.is$callable=!0,this.$bound=e.bound,this.$name=e.name||t.name||"(native JS)",2>=this.$name.length&&(this.$name+=" (native JS)")):(this.is$callable=!1,delete this.is$type,this.is$type=!1,this.$name=e.name)},slots:{tp$doc:"proxy for a javascript object",tp$hash(){return Sk.builtin.object.prototype.tp$hash.call(this.js$wrapped)},tp$getattr(t){return this.$lookup(t)||Sk.generic.getAttr.call(this,t)},tp$setattr(t,e){t=t.toString(),void 0===e?delete this.js$wrapped[t]:this.js$wrapped[t]=i(e,m)},$r(){if(this.is$callable){if(this.is$type||!this.$bound)return new Sk.builtin.str("<"+this.tp$name+" '"+this.$name+"'>");var t=Sk.misceval.objectRepr(u(this.$bound));return new Sk.builtin.str("")}return this.js$proto===c?this.in$repr?new Sk.builtin.str("{...}"):(this.in$repr=!0,t=Object.entries(this.js$wrapped).map((t=>{var[e,i]=t;return i=n(i,f(this.js$wrapped,e)),"'"+e+"': "+Sk.misceval.objectRepr(i)})),t=new Sk.builtin.str("proxyobject({"+t.join(", ")+"})"),this.in$repr=!1,t):new Sk.builtin.str("<"+this.tp$name+" "+("proxyobject"===this.tp$name?"object":"proxyobject")+">")},tp$as_sequence_or_mapping:!0,mp$subscript(t){const e=this.$lookup(t);if(void 0===e)throw new Sk.builtin.LookupError(t);return e},mp$ass_subscript(t,e){return this.tp$setattr(t,e)},sq$contains(t){return i(t)in this.js$wrapped},ob$eq(t){return this.js$wrapped===t.js$wrapped},ob$ne(t){return this.js$wrapped!==t.js$wrapped},tp$as_number:!0,nb$bool(){return this.js$proto===c?0new Sk.builtin.str(t)))))},$flags:{NoArgs:!0}},__new__:{$meth(t,...e){if(!(t instanceof g))throw new Sk.builtin.TypeError("expected a proxy object as the first argument not "+Sk.abstr.typeName(t));try{return t.$new(e)}catch(e){if(e instanceof TypeError&&e.message.includes("not a constructor"))throw new Sk.builtin.TypeError(Sk.misceval.objectRepr(t)+" is not a constructor");throw e}},$flags:{MinArgs:1}},__call__:{$meth(t,e){if("function"!=typeof this.js$wrapped)throw new Sk.builtin.TypeError("'"+this.tp$name+"' object is not callable");return this.$call(t,e)},$flags:{FastCall:!0}},keys:{$meth(){return new Sk.builtin.list(Object.keys(this.js$wrapped).map((t=>new Sk.builtin.str(t))))},$flags:{NoArgs:!0}},get:{$meth(t,e){return this.$lookup(t)||e||Sk.builtin.none.none$},$flags:{MinArgs:1,MaxArgs:2}}},getsets:{__class__:{$get(){return n(this.js$wrapped.constructor,d)},$set(){throw new Sk.builtin.TypeError("not writable")}},__name__:{$get(){return new Sk.builtin.str(this.$name)}},__module__:{$get(){return this.$module||Sk.builtin.none.none$},$set(t){this.$module=t}}},proto:{valueOf(){return this.js$wrapped},$new(t,e){return Sk.abstr.checkNoKwargs("__new__",e),n(new this.js$wrapped(...t.map((t=>i(t,m)))),{dictHook:t=>u(t),proxyHook:t=>u(t,{name:this.$name})})},$call(t,e){return Sk.abstr.checkNoKwargs("__call__",e),Sk.misceval.chain(this.js$wrapped.apply(this.$bound,t.map((t=>i(t,m)))),(t=>t instanceof Promise?Sk.misceval.promiseToSuspension(t):t),(t=>n(t,d)))},$lookup(t){t=t.toString();const e=this.js$wrapped[t];return void 0!==e?n(e,f(this.js$wrapped,t)):t in this.js$wrapped?Sk.builtin.none.none$:void 0},memoized$slots:{js$proto:{configurable:!0,get(){return delete this.js$proto,this.js$proto=Object.getPrototypeOf(this.js$wrapped)}},$dir:{configurable:!0,get(){const t=[];let e=this.js$wrapped;for(;null!=e&&e!==c&&e!==p;)t.push(...Object.getOwnPropertyNames(e)),e=Object.getPrototypeOf(e);return new Set(t)}},tp$iter:{configurable:!0,get(){return delete this.tp$iter,void 0!==this.js$wrapped[Symbol.iterator]?this.tp$iter=()=>u(this.js$wrapped[Symbol.iterator]()):this.tp$iter=()=>{throw new Sk.builtin.TypeError(Sk.misceval.objectRepr(this)+" is not iterable")}}},tp$iternext:{configurable:!0,get(){if(delete this.tp$iternext,void 0!==this.js$wrapped.next)return this.tp$iternext=()=>{const t=this.js$wrapped.next().value;return t&&n(t,d)}}},sq$length:{configurable:!0,get(){if(delete this.sq$length,!this.is$callable&&void 0!==this.js$wrapped.length)return this.sq$length=()=>this.js$wrapped.length}},tp$call:{configurable:!0,get(){if(delete this.tp$call,this.is$callable)return this.tp$call=this.is$type?this.$new:this.$call}},tp$name:{configurable:!0,get(){if(delete this.tp$name,this.is$callable)return this.tp$name=this.is$type?"proxyclass":this.$bound?"proxymethod":"proxyfunction";{const t=this.js$wrapped;let e=t[Symbol.toStringTag]||this.$name||t.constructor&&t.constructor.name||"proxyobject";return"Object"===e?e="proxyobject":2>=e.length&&(e=u(t.constructor).$name),this.tp$name=e}}},is$type:{configurable:!0,get(){delete this.is$type;var t=this.js$wrapped;const e=t.prototype;if(void 0===e)return this.is$type=t===Sk.global.Proxy;{const e=S.call(t).match(b);t=null===e?null:"class"===e[0]||!k.has(t)}return!0===t?this.is$type=!0:!1===t?this.is$type=!1:1e;r+=n)s.push(new Sk.builtin.int_(r));else{if(t=r=JSBI.BigInt(t),n=JSBI.BigInt(n),e=JSBI.BigInt(e),JSBI.greaterThan(n,JSBI.__ZERO))for(;JSBI.lessThan(r,e);)s.push(new Sk.builtin.int_(i(r))),r=JSBI.add(r,n);else for(;JSBI.greaterThan(r,e);)s.push(new Sk.builtin.int_(i(r))),r=JSBI.add(r,n);t=i(t),n=i(n),e=i(e)}return new Sk.builtin.range_(t,e,n,s)}function i(t){return JSBI.lessThan(t,JSBI.__MAX_SAFE)&&JSBI.greaterThan(t,JSBI.__MIN_SAFE)?JSBI.toNumber(t):t}Sk.builtin.range_=Sk.abstr.buildNativeClass("range",{constructor:function(t,e,n,i){this.start=t,this.stop=e,this.step=n,this.v=i},slots:{tp$getattr:Sk.generic.getAttr,tp$as_sequence_or_mapping:!0,tp$doc:"range(stop) -> range object\nrange(start, stop[, step]) -> range object\n\nReturn an object that produces a sequence of integers from start (inclusive)\nto stop (exclusive) by step. range(i, j) produces i, i+1, i+2, ..., j-1.\nstart defaults to 0, and stop is omitted! range(4) produces 0, 1, 2, 3.\nThese are exactly the valid indices for a list of 4 elements.\nWhen step is given, it specifies the increment (or decrement).",tp$new:(t,e)=>(Sk.abstr.checkNoKwargs("range",e),Sk.abstr.checkArgsLen("range",t,1,3),n(t[0],t[1],t[2])),$r(){let t="range("+this.start+", "+this.stop;return 1!=this.step&&(t+=", "+this.step),new Sk.builtin.str(t+")")},tp$richcompare(t,e){return"Eq"!==e&&"NotEq"!==e||t.ob$type!==Sk.builtin.range_?Sk.builtin.NotImplemented.NotImplemented$:(t=new Sk.builtin.list(t.v),new Sk.builtin.list(this.v).tp$richcompare(t,e))},tp$iter(){return new s(this)},nb$bool(){return 0!==this.v.length},sq$contains(t){const e=this.v;for(let n=0;n(t=Sk.misceval.asIndexSized(t))&&(t=this.v.length+t),0>t||t>=this.v.length)throw new Sk.builtin.IndexError("range object index out of range");return this.v[t]}if(t.constructor===Sk.builtin.slice){const e=[],n=this.v;t.sssiter$(n.length,(t=>{e.push(n[t])}));let{start:i,stop:s,step:r}=t.slice$indices(n.length);return i=Sk.misceval.asIndex(n[i])||this.start,s=Sk.misceval.asIndex(n[s])||this.stop,r="number"==typeof this.step?r*this.step:JSBI.multiply(this.step,JSBI.BigInt(r)),new Sk.builtin.range_(i,s,r,e)}throw new Sk.builtin.TypeError("range indices must be integers or slices, not "+Sk.abstr.typeName(t))}},getsets:{start:{$get(){return new Sk.builtin.int_(this.start)}},step:{$get(){return new Sk.builtin.int_(this.step)}},stop:{$get(){return new Sk.builtin.int_(this.stop)}}},methods:{__reversed__:{$meth(){return new r(this)},$flags:{NoArgs:!0},$textsig:null,$doc:"Return a reverse iterator."},count:{$meth(t){let e=0;for(let n=0;n integer -- return number of occurrences of value"},index:{$meth(t){for(let e=0;e integer -- return index of value.\nRaise ValueError if the value is not present."}},proto:{sk$asarray(){return this.v.slice(0)}},flags:{sk$unacceptableBase:!0}});var s=Sk.abstr.buildIteratorClass("range_iterator",{constructor:function(t){this.$index=0,this.$seq=t.v},iternext(){return this.$seq[this.$index++]},methods:{__length_hint__:Sk.generic.iterLengthHintWithArrayMethodDef},flags:{sk$unacceptableBase:!0}}),r=Sk.abstr.buildIteratorClass("range_reverseiterator",{constructor:function(t){this.$seq=t.v,this.$index=this.$seq.length-1},iternext(){return this.$seq[this.$index--]},methods:{__length_hint__:Sk.generic.iterReverseLengthHintMethodDef},flags:{sk$unacceptableBase:!0}});Sk.builtin.range=Sk.builtin.xrange=function(t,e,i){return t=n(t,e,i),new Sk.builtin.list(t.v)}},function(t,e){Sk.builtin.enumerate=Sk.abstr.buildIteratorClass("enumerate",{constructor:function(t,e){if(!(this instanceof Sk.builtin.enumerate))throw TypeError("Failed to construct 'enumerate': Please use the 'new' operator");return this.$iterable=t,this.$index=e,this},iternext(t){const e=Sk.misceval.chain(this.$iterable.tp$iternext(t),(t=>{if(void 0!==t)return new Sk.builtin.tuple([new Sk.builtin.int_(this.$index++),t])}));return t?e:Sk.misceval.retryOptionalSuspensionOrThrow(e)},slots:{tp$doc:"Return an enumerate object.\n\n iterable\n an object supporting iteration\n\nThe enumerate object yields pairs containing a count (from start, which\ndefaults to zero) and a value yielded by the iterable argument.\n\nenumerate is useful for obtaining an indexed list:\n (0, seq[0]), (1, seq[1]), (2, seq[2]), ...",tp$new(t,e){let[n,i]=Sk.abstr.copyKeywordsToNamedArgs("enumerate",["iterable","start"],t,e,[new Sk.builtin.int_(0)]);return n=Sk.abstr.iter(n),i=Sk.misceval.asIndexOrThrow(i),this===Sk.builtin.enumerate.prototype?new Sk.builtin.enumerate(n,i):(t=new this.constructor,Sk.builtin.enumerate.call(t,n,i),t)}},classmethods:Sk.generic.classGetItem}),Sk.exportSymbol("Sk.builtin.enumerate",Sk.builtin.enumerate)},function(t,e){Sk.builtin.filter_=Sk.abstr.buildIteratorClass("filter",{constructor:function(t,e){this.$func=t,this.$iterable=e},iternext(t){const e=Sk.misceval.iterFor(this.$iterable,(t=>Sk.misceval.chain(this.check$filter(t),(t=>t?new Sk.misceval.Break(t):void 0))));return t?e:Sk.misceval.retryOptionalSuspensionOrThrow(e)},slots:{tp$doc:"Return an iterator yielding those items of iterable for which function(item)\nis true. If function is None, return the items that are true.",tp$new(t,e){let[n,i]=Sk.abstr.copyKeywordsToNamedArgs("filter",["predicate","iterable"],t,e,[]);return n=Sk.builtin.checkNone(n)?null:n,i=Sk.abstr.iter(i),this===Sk.builtin.filter_.prototype?new Sk.builtin.filter_(n,i):(t=new this.constructor,Sk.builtin.filter_.call(t,n,i),t)}},proto:{check$filter(t){let e;return e=null===this.$func?t:Sk.misceval.callsimOrSuspendArray(this.$func,[t]),Sk.misceval.chain(e,(e=>Sk.misceval.isTrue(e)?t:void 0))}}}),Sk.exportSymbol("Sk.builtin.filter_",Sk.builtin.filter_)},function(t,e){Sk.builtin.map_=Sk.abstr.buildIteratorClass("map",{constructor:function(t,e){this.$func=t,this.$iters=e},iternext(t){const e=[],n=Sk.misceval.chain(Sk.misceval.iterArray(this.$iters,(n=>Sk.misceval.chain(n.tp$iternext(t),(t=>{if(void 0===t)return new Sk.misceval.Break(!0);e.push(t)})))),(t=>t?void 0:Sk.misceval.callsimOrSuspendArray(this.$func,e)));return t?n:Sk.misceval.retryOptionalSuspensionOrThrow(n)},slots:{tp$doc:"map(func, *iterables) --\x3e map object\n\nMake an iterator that computes the function using arguments from\neach of the iterables. Stops when the shortest iterable is exhausted.",tp$new(t,e){this===Sk.builtin.map_.prototype&&Sk.abstr.checkNoKwargs("map",e),Sk.abstr.checkArgsLen("map",t,2),e=t[0];const n=[];for(let e=1;ethis.$idx)){var e=Sk.misceval.tryCatch((()=>Sk.abstr.objectGetItem(this.$seq,new Sk.builtin.int_(this.$idx--),t)),(t=>{if(!(t instanceof Sk.builtin.IndexError))throw t;this.$idx=-1}));return t?e:Sk.misceval.retryOptionalSuspensionOrThrow(e)}},slots:{tp$doc:"Return a reverse iterator over the values of the given sequence.",tp$new(t,e){if(this===Sk.builtin.reversed.prototype&&Sk.abstr.checkNoKwargs("reversed",e),Sk.abstr.checkArgsLen("reversed",t,1,1),t=t[0],void 0!==(e=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$reversed)))return Sk.misceval.callsimArray(e,[]);if(!Sk.builtin.checkSequence(t)||void 0===Sk.abstr.lookupSpecial(t,Sk.builtin.str.$len))throw new Sk.builtin.TypeError("'"+Sk.abstr.typeName(t)+"' object is not a sequence");return this===Sk.builtin.reversed.prototype?new Sk.builtin.reversed(t):(e=new this.constructor,Sk.builtin.reversed.call(e,t),e)}},methods:{__length_hint__:{$meth:function(){return 0<=this.$idx?new Sk.builtin.int_(this.$idx):new Sk.builtin.int_(0)},$flags:{NoArgs:!0}}}})},function(t,e){Sk.builtin.zip_=Sk.abstr.buildIteratorClass("zip",{constructor:function(t){this.$iters=t,0===t.length&&(this.tp$iternext=()=>{})},iternext(t){const e=[],n=Sk.misceval.chain(Sk.misceval.iterArray(this.$iters,(n=>Sk.misceval.chain(n.tp$iternext(t),(t=>{if(void 0===t)return new Sk.misceval.Break(!0);e.push(t)})))),(t=>t?void 0:new Sk.builtin.tuple(e)));return t?n:Sk.misceval.retryOptionalSuspensionOrThrow(n)},slots:{tp$doc:"zip(iter1 [,iter2 [...]]) --\x3e zip object\n\nReturn a zip object whose .__next__() method returns a tuple where\nthe i-th element comes from the i-th iterable argument. The .__next__()\nmethod continues until the shortest iterable in the argument sequence\nis exhausted and then it raises StopIteration.",tp$new(t,e){this===Sk.builtin.zip_.prototype&&Sk.abstr.checkNoKwargs("zip",e),e=[];for(let n=0;n":n.T_RARROW,".":n.T_DOT,"...":n.T_ELLIPSIS,"/":n.T_SLASH,"//":n.T_DOUBLESLASH,"//=":n.T_DOUBLESLASHEQUAL,"/=":n.T_SLASHEQUAL,":":n.T_COLON,";":n.T_SEMI,"<":n.T_LESS,"<<":n.T_LEFTSHIFT,"<<=":n.T_LEFTSHIFTEQUAL,"<=":n.T_LESSEQUAL,"=":n.T_EQUAL,"==":n.T_EQEQUAL,">":n.T_GREATER,">=":n.T_GREATEREQUAL,">>":n.T_RIGHTSHIFT,">>=":n.T_RIGHTSHIFTEQUAL,"@":n.T_AT,"@=":n.T_ATEQUAL,"[":n.T_LSQB,"]":n.T_RSQB,"^":n.T_CIRCUMFLEX,"^=":n.T_CIRCUMFLEXEQUAL,"{":n.T_LBRACE,"|":n.T_VBAR,"|=":n.T_VBAREQUAL,"}":n.T_RBRACE,"~":n.T_TILDE};var i={};!function(){for(var t in n)i[n[t]]=t}(),["tok_name","ISTERMINAL","ISNONTERMINAL","ISEOF"].concat(Object.keys(i).map((function(t){return i[t]}))),Sk.token={},Sk.token.tokens=n,Sk.token.tok_name=i,Sk.token.EXACT_TOKEN_TYPES=t,Sk.token.ISTERMINAL=function(t){return t=n.T_NT_OFFSET},Sk.token.ISEOF=function(t){return t==n.T_ENDMARKER},Sk.exportSymbol("Sk.token",Sk.token),Sk.exportSymbol("Sk.token.tokens",Sk.token.tokens),Sk.exportSymbol("Sk.token.tok_name",Sk.token.tok_name),Sk.exportSymbol("Sk.token.EXACT_TOKEN_TYPES"),Sk.exportSymbol("Sk.token.ISTERMINAL",Sk.token.ISTERMINAL),Sk.exportSymbol("Sk.token.ISNONTERMINAL",Sk.token.ISNONTERMINAL),Sk.exportSymbol("Sk.token.ISEOF",Sk.token.ISEOF)},function(t,e){Sk.OpMap={"(":Sk.token.tokens.T_LPAR,")":Sk.token.tokens.T_RPAR,"[":Sk.token.tokens.T_LSQB,"]":Sk.token.tokens.T_RSQB,":":Sk.token.tokens.T_COLON,",":Sk.token.tokens.T_COMMA,";":Sk.token.tokens.T_SEMI,"+":Sk.token.tokens.T_PLUS,"-":Sk.token.tokens.T_MINUS,"*":Sk.token.tokens.T_STAR,"/":Sk.token.tokens.T_SLASH,"|":Sk.token.tokens.T_VBAR,"&":Sk.token.tokens.T_AMPER,"<":Sk.token.tokens.T_LESS,">":Sk.token.tokens.T_GREATER,"=":Sk.token.tokens.T_EQUAL,".":Sk.token.tokens.T_DOT,"%":Sk.token.tokens.T_PERCENT,"`":Sk.token.tokens.T_BACKQUOTE,"{":Sk.token.tokens.T_LBRACE,"}":Sk.token.tokens.T_RBRACE,"@":Sk.token.tokens.T_AT,"@=":Sk.token.tokens.T_ATEQUAL,"==":Sk.token.tokens.T_EQEQUAL,"!=":Sk.token.tokens.T_NOTEQUAL,"<>":Sk.token.tokens.T_NOTEQUAL,"<=":Sk.token.tokens.T_LESSEQUAL,">=":Sk.token.tokens.T_GREATEREQUAL,"~":Sk.token.tokens.T_TILDE,"^":Sk.token.tokens.T_CIRCUMFLEX,"<<":Sk.token.tokens.T_LEFTSHIFT,">>":Sk.token.tokens.T_RIGHTSHIFT,"**":Sk.token.tokens.T_DOUBLESTAR,"+=":Sk.token.tokens.T_PLUSEQUAL,"-=":Sk.token.tokens.T_MINEQUAL,"*=":Sk.token.tokens.T_STAREQUAL,"/=":Sk.token.tokens.T_SLASHEQUAL,"%=":Sk.token.tokens.T_PERCENTEQUAL,"&=":Sk.token.tokens.T_AMPEREQUAL,"|=":Sk.token.tokens.T_VBAREQUAL,"^=":Sk.token.tokens.T_CIRCUMFLEXEQUAL,"<<=":Sk.token.tokens.T_LEFTSHIFTEQUAL,">>=":Sk.token.tokens.T_RIGHTSHIFTEQUAL,"**=":Sk.token.tokens.T_DOUBLESTAREQUAL,"//":Sk.token.tokens.T_DOUBLESLASH,"//=":Sk.token.tokens.T_DOUBLESLASHEQUAL,"->":Sk.token.tokens.T_RARROW,"...":Sk.token.tokens.T_ELLIPSIS},Sk.ParseTables={sym:{and_expr:257,and_test:258,annassign:259,arglist:260,argument:261,arith_expr:262,assert_stmt:263,async_funcdef:264,async_stmt:265,atom:266,atom_expr:267,augassign:268,break_stmt:269,classdef:270,comp_for:271,comp_if:272,comp_iter:273,comp_op:274,comparison:275,compound_stmt:276,continue_stmt:277,debugger_stmt:278,decorated:279,decorator:280,decorators:281,del_stmt:282,dictorsetmaker:283,dotted_as_name:284,dotted_as_names:285,dotted_name:286,encoding_decl:287,eval_input:288,except_clause:289,expr:290,expr_stmt:291,exprlist:292,factor:293,file_input:294,flow_stmt:295,for_stmt:296,funcdef:297,global_stmt:298,if_stmt:299,import_as_name:300,import_as_names:301,import_from:302,import_name:303,import_stmt:304,lambdef:305,lambdef_nocond:306,nonlocal_stmt:307,not_test:308,or_test:309,parameters:310,pass_stmt:311,power:312,print_stmt:313,raise_stmt:314,return_stmt:315,shift_expr:316,simple_stmt:317,single_input:256,sliceop:318,small_stmt:319,star_expr:320,stmt:321,subscript:322,subscriptlist:323,suite:324,term:325,test:326,test_nocond:327,testlist:328,testlist_comp:329,testlist_star_expr:330,tfpdef:331,trailer:332,try_stmt:333,typedargslist:334,varargslist:335,vfpdef:336,while_stmt:337,with_item:338,with_stmt:339,xor_expr:340,yield_arg:341,yield_expr:342,yield_stmt:343},number2symbol:{256:"single_input",257:"and_expr",258:"and_test",259:"annassign",260:"arglist",261:"argument",262:"arith_expr",263:"assert_stmt",264:"async_funcdef",265:"async_stmt",266:"atom",267:"atom_expr",268:"augassign",269:"break_stmt",270:"classdef",271:"comp_for",272:"comp_if",273:"comp_iter",274:"comp_op",275:"comparison",276:"compound_stmt",277:"continue_stmt",278:"debugger_stmt",279:"decorated",280:"decorator",281:"decorators",282:"del_stmt",283:"dictorsetmaker",284:"dotted_as_name",285:"dotted_as_names",286:"dotted_name",287:"encoding_decl",288:"eval_input",289:"except_clause",290:"expr",291:"expr_stmt",292:"exprlist",293:"factor",294:"file_input",295:"flow_stmt",296:"for_stmt",297:"funcdef",298:"global_stmt",299:"if_stmt",300:"import_as_name",301:"import_as_names",302:"import_from",303:"import_name",304:"import_stmt",305:"lambdef",306:"lambdef_nocond",307:"nonlocal_stmt",308:"not_test",309:"or_test",310:"parameters",311:"pass_stmt",312:"power",313:"print_stmt",314:"raise_stmt",315:"return_stmt",316:"shift_expr",317:"simple_stmt",318:"sliceop",319:"small_stmt",320:"star_expr",321:"stmt",322:"subscript",323:"subscriptlist",324:"suite",325:"term",326:"test",327:"test_nocond",328:"testlist",329:"testlist_comp",330:"testlist_star_expr",331:"tfpdef",332:"trailer",333:"try_stmt",334:"typedargslist",335:"varargslist",336:"vfpdef",337:"while_stmt",338:"with_item",339:"with_stmt",340:"xor_expr",341:"yield_arg",342:"yield_expr",343:"yield_stmt"},dfas:{256:[[[[1,1],[2,1],[3,2]],[[0,1]],[[2,1]]],{2:1,4:1,5:1,6:1,7:1,8:1,9:1,10:1,11:1,12:1,13:1,14:1,15:1,16:1,17:1,18:1,19:1,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,34:1,35:1,36:1,37:1,38:1,39:1,40:1,41:1,42:1,43:1}],257:[[[[44,1]],[[45,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],258:[[[[46,1]],[[47,0],[0,1]]],{6:1,7:1,8:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],259:[[[[48,1]],[[49,2]],[[50,3],[0,2]],[[49,4]],[[0,4]]],{48:1}],260:[[[[51,1]],[[52,2],[0,1]],[[51,1],[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,53:1}],261:[[[[49,1],[15,2],[53,2]],[[50,2],[54,3],[0,1]],[[49,3]],[[0,3]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,53:1}],262:[[[[55,1]],[[30,0],[43,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],263:[[[[24,1]],[[49,2]],[[52,3],[0,2]],[[49,4]],[[0,4]]],{24:1}],264:[[[[10,1]],[[56,2]],[[0,2]]],{10:1}],265:[[[[10,1]],[[57,2],[56,2],[58,2]],[[0,2]]],{10:1}],266:[[[[6,1],[25,1],[33,1],[9,1],[11,1],[12,2],[35,3],[38,4],[19,1],[7,5]],[[0,1]],[[59,1],[60,6]],[[61,1],[62,7],[63,7]],[[64,1],[63,8]],[[7,5],[0,5]],[[59,1]],[[61,1]],[[64,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,25:1,33:1,35:1,38:1}],267:[[[[29,1],[65,2]],[[65,2]],[[66,2],[0,2]]],{6:1,7:1,9:1,11:1,12:1,19:1,25:1,29:1,33:1,35:1,38:1}],268:[[[[67,1],[68,1],[69,1],[70,1],[71,1],[72,1],[73,1],[74,1],[75,1],[76,1],[77,1],[78,1],[79,1]],[[0,1]]],{67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:1,75:1,76:1,77:1,78:1,79:1}],269:[[[[39,1]],[[0,1]]],{39:1}],270:[[[[13,1]],[[25,2]],[[48,3],[35,4]],[[80,5]],[[61,6],[81,7]],[[0,5]],[[48,3]],[[61,6]]],{13:1}],271:[[[[10,1],[34,2]],[[34,2]],[[82,3]],[[83,4]],[[84,5]],[[85,6],[0,5]],[[0,6]]],{10:1,34:1}],272:[[[[37,1]],[[86,2]],[[85,3],[0,2]],[[0,3]]],{37:1}],273:[[[[87,1],[54,1]],[[0,1]]],{10:1,34:1,37:1}],274:[[[[88,1],[89,1],[8,2],[90,1],[88,1],[83,1],[91,1],[92,3],[93,1],[94,1]],[[0,1]],[[83,1]],[[8,1],[0,3]]],{8:1,83:1,88:1,89:1,90:1,91:1,92:1,93:1,94:1}],275:[[[[95,1]],[[96,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],276:[[[[97,1],[98,1],[58,1],[99,1],[57,1],[100,1],[56,1],[101,1],[102,1]],[[0,1]]],{4:1,10:1,13:1,20:1,21:1,34:1,37:1,41:1,42:1}],277:[[[[40,1]],[[0,1]]],{40:1}],278:[[[[17,1]],[[0,1]]],{17:1}],279:[[[[103,1]],[[56,2],[104,2],[99,2]],[[0,2]]],{41:1}],280:[[[[41,1]],[[105,2]],[[2,4],[35,3]],[[61,5],[81,6]],[[0,4]],[[2,4]],[[61,5]]],{41:1}],281:[[[[106,1]],[[106,1],[0,1]]],{41:1}],282:[[[[27,1]],[[82,2]],[[0,2]]],{27:1}],283:[[[[49,1],[107,2],[53,3]],[[48,4],[54,5],[52,6],[0,1]],[[54,5],[52,6],[0,2]],[[95,7]],[[49,7]],[[0,5]],[[49,8],[107,8],[0,6]],[[54,5],[52,9],[0,7]],[[52,6],[0,8]],[[49,10],[53,11],[0,9]],[[48,12]],[[95,13]],[[49,13]],[[52,9],[0,13]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,53:1}],284:[[[[105,1]],[[108,2],[0,1]],[[25,3]],[[0,3]]],{25:1}],285:[[[[109,1]],[[52,0],[0,1]]],{25:1}],286:[[[[25,1]],[[110,0],[0,1]]],{25:1}],287:[[[[25,1]],[[0,1]]],{25:1}],288:[[[[111,1]],[[2,1],[112,2]],[[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],289:[[[[113,1]],[[49,2],[0,1]],[[108,3],[52,3],[0,2]],[[49,4]],[[0,4]]],{113:1}],290:[[[[114,1]],[[115,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],291:[[[[116,1]],[[117,2],[50,3],[118,4],[0,1]],[[111,4],[62,4]],[[116,5],[62,5]],[[0,4]],[[50,3],[0,5]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],292:[[[[95,1],[107,1]],[[52,2],[0,1]],[[95,1],[107,1],[0,2]]],{6:1,7:1,9:1,11:1,12:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],293:[[[[119,2],[30,1],[22,1],[43,1]],[[120,2]],[[0,2]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],294:[[[[2,0],[112,1],[121,0]],[[0,1]]],{2:1,4:1,5:1,6:1,7:1,8:1,9:1,10:1,11:1,12:1,13:1,14:1,15:1,16:1,17:1,18:1,19:1,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,34:1,35:1,36:1,37:1,38:1,39:1,40:1,41:1,42:1,43:1,112:1}],295:[[[[122,1],[123,1],[124,1],[125,1],[126,1]],[[0,1]]],{5:1,23:1,31:1,39:1,40:1}],296:[[[[34,1]],[[82,2]],[[83,3]],[[111,4]],[[48,5]],[[80,6]],[[127,7],[0,6]],[[48,8]],[[80,9]],[[0,9]]],{34:1}],297:[[[[4,1]],[[25,2]],[[128,3]],[[48,4],[129,5]],[[80,6]],[[49,7]],[[0,6]],[[48,4]]],{4:1}],298:[[[[26,1]],[[25,2]],[[52,1],[0,2]]],{26:1}],299:[[[[37,1]],[[49,2]],[[48,3]],[[80,4]],[[127,5],[130,1],[0,4]],[[48,6]],[[80,7]],[[0,7]]],{37:1}],300:[[[[25,1]],[[108,2],[0,1]],[[25,3]],[[0,3]]],{25:1}],301:[[[[131,1]],[[52,2],[0,1]],[[131,1],[0,2]]],{25:1}],302:[[[[36,1]],[[105,2],[19,3],[110,3]],[[32,4]],[[105,2],[19,3],[32,4],[110,3]],[[132,5],[15,5],[35,6]],[[0,5]],[[132,7]],[[61,5]]],{36:1}],303:[[[[32,1]],[[133,2]],[[0,2]]],{32:1}],304:[[[[134,1],[135,1]],[[0,1]]],{32:1,36:1}],305:[[[[14,1]],[[48,2],[136,3]],[[49,4]],[[48,2]],[[0,4]]],{14:1}],306:[[[[14,1]],[[48,2],[136,3]],[[86,4]],[[48,2]],[[0,4]]],{14:1}],307:[[[[18,1]],[[25,2]],[[52,1],[0,2]]],{18:1}],308:[[[[8,1],[137,2]],[[46,2]],[[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],309:[[[[138,1]],[[139,0],[0,1]]],{6:1,7:1,8:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],310:[[[[35,1]],[[61,2],[140,3]],[[0,2]],[[61,2]]],{35:1}],311:[[[[28,1]],[[0,1]]],{28:1}],312:[[[[141,1]],[[53,2],[0,1]],[[120,3]],[[0,3]]],{6:1,7:1,9:1,11:1,12:1,19:1,25:1,29:1,33:1,35:1,38:1}],313:[[[[16,1]],[[49,2],[142,3],[0,1]],[[52,4],[0,2]],[[49,5]],[[49,2],[0,4]],[[52,6],[0,5]],[[49,7]],[[52,8],[0,7]],[[49,7],[0,8]]],{16:1}],314:[[[[5,1]],[[49,2],[0,1]],[[36,3],[52,3],[0,2]],[[49,4]],[[52,5],[0,4]],[[49,6]],[[0,6]]],{5:1}],315:[[[[23,1]],[[111,2],[0,1]],[[0,2]]],{23:1}],316:[[[[143,1]],[[144,0],[142,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],317:[[[[145,1]],[[2,2],[146,3]],[[0,2]],[[145,1],[2,2]]],{5:1,6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,16:1,17:1,18:1,19:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,35:1,36:1,38:1,39:1,40:1,43:1}],318:[[[[48,1]],[[49,2],[0,1]],[[0,2]]],{48:1}],319:[[[[147,1],[148,1],[149,1],[150,1],[151,1],[152,1],[153,1],[154,1],[155,1],[156,1]],[[0,1]]],{5:1,6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,16:1,17:1,18:1,19:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,35:1,36:1,38:1,39:1,40:1,43:1}],320:[[[[15,1]],[[95,2]],[[0,2]]],{15:1}],321:[[[[1,1],[3,1]],[[0,1]]],{4:1,5:1,6:1,7:1,8:1,9:1,10:1,11:1,12:1,13:1,14:1,15:1,16:1,17:1,18:1,19:1,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,34:1,35:1,36:1,37:1,38:1,39:1,40:1,41:1,42:1,43:1}],322:[[[[49,1],[48,2]],[[48,2],[0,1]],[[49,3],[157,4],[0,2]],[[157,4],[0,3]],[[0,4]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,48:1}],323:[[[[158,1]],[[52,2],[0,1]],[[158,1],[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1,48:1}],324:[[[[1,1],[2,2]],[[0,1]],[[159,3]],[[121,4]],[[160,1],[121,4]]],{2:1,5:1,6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,16:1,17:1,18:1,19:1,22:1,23:1,24:1,25:1,26:1,27:1,28:1,29:1,30:1,31:1,32:1,33:1,35:1,36:1,38:1,39:1,40:1,43:1}],325:[[[[120,1]],[[161,0],[15,0],[162,0],[41,0],[163,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],326:[[[[84,1],[164,2]],[[37,3],[0,1]],[[0,2]],[[84,4]],[[127,5]],[[49,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],327:[[[[165,1],[84,1]],[[0,1]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],328:[[[[49,1]],[[52,2],[0,1]],[[49,1],[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],329:[[[[49,1],[107,1]],[[54,2],[52,3],[0,1]],[[0,2]],[[49,4],[107,4],[0,3]],[[52,3],[0,4]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],330:[[[[49,1],[107,1]],[[52,2],[0,1]],[[49,1],[107,1],[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,15:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],331:[[[[25,1]],[[48,2],[0,1]],[[49,3]],[[0,3]]],{25:1}],332:[[[[35,1],[110,2],[38,3]],[[61,4],[81,5]],[[25,4]],[[166,6]],[[0,4]],[[61,4]],[[64,4]]],{35:1,38:1,110:1}],333:[[[[20,1]],[[48,2]],[[80,3]],[[167,4],[168,5]],[[48,6]],[[48,7]],[[80,8]],[[80,9]],[[167,4],[127,10],[168,5],[0,8]],[[0,9]],[[48,11]],[[80,12]],[[168,5],[0,12]]],{20:1}],334:[[[[15,1],[169,2],[53,3]],[[169,4],[52,5],[0,1]],[[50,6],[52,7],[0,2]],[[169,8]],[[52,5],[0,4]],[[169,9],[53,3],[0,5]],[[49,10]],[[15,11],[169,2],[53,3],[0,7]],[[52,12],[0,8]],[[50,13],[52,5],[0,9]],[[52,7],[0,10]],[[169,14],[52,15],[0,11]],[[0,12]],[[49,4]],[[52,15],[0,14]],[[169,16],[53,3],[0,15]],[[50,17],[52,15],[0,16]],[[49,14]]],{15:1,25:1,53:1}],335:[[[[15,1],[53,2],[170,3]],[[170,5],[52,4],[0,1]],[[170,6]],[[50,7],[52,8],[0,3]],[[53,2],[170,9],[0,4]],[[52,4],[0,5]],[[52,10],[0,6]],[[49,11]],[[15,12],[53,2],[170,3],[0,8]],[[50,13],[52,4],[0,9]],[[0,10]],[[52,8],[0,11]],[[52,15],[170,14],[0,12]],[[49,5]],[[52,15],[0,14]],[[53,2],[170,16],[0,15]],[[50,17],[52,15],[0,16]],[[49,14]]],{15:1,25:1,53:1}],336:[[[[25,1]],[[0,1]]],{25:1}],337:[[[[21,1]],[[49,2]],[[48,3]],[[80,4]],[[127,5],[0,4]],[[48,6]],[[80,7]],[[0,7]]],{21:1}],338:[[[[49,1]],[[108,2],[0,1]],[[95,3]],[[0,3]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],339:[[[[42,1]],[[171,2]],[[48,3],[52,1]],[[80,4]],[[0,4]]],{42:1}],340:[[[[172,1]],[[173,0],[0,1]]],{6:1,7:1,9:1,11:1,12:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,38:1,43:1}],341:[[[[111,2],[36,1]],[[49,2]],[[0,2]]],{6:1,7:1,8:1,9:1,11:1,12:1,14:1,19:1,22:1,25:1,29:1,30:1,33:1,35:1,36:1,38:1,43:1}],342:[[[[31,1]],[[174,2],[0,1]],[[0,2]]],{31:1}],343:[[[[62,1]],[[0,1]]],{31:1}]},states:[[[[1,1],[2,1],[3,2]],[[0,1]],[[2,1]]],[[[44,1]],[[45,0],[0,1]]],[[[46,1]],[[47,0],[0,1]]],[[[48,1]],[[49,2]],[[50,3],[0,2]],[[49,4]],[[0,4]]],[[[51,1]],[[52,2],[0,1]],[[51,1],[0,2]]],[[[49,1],[15,2],[53,2]],[[50,2],[54,3],[0,1]],[[49,3]],[[0,3]]],[[[55,1]],[[30,0],[43,0],[0,1]]],[[[24,1]],[[49,2]],[[52,3],[0,2]],[[49,4]],[[0,4]]],[[[10,1]],[[56,2]],[[0,2]]],[[[10,1]],[[57,2],[56,2],[58,2]],[[0,2]]],[[[6,1],[25,1],[33,1],[9,1],[11,1],[12,2],[35,3],[38,4],[19,1],[7,5]],[[0,1]],[[59,1],[60,6]],[[61,1],[62,7],[63,7]],[[64,1],[63,8]],[[7,5],[0,5]],[[59,1]],[[61,1]],[[64,1]]],[[[29,1],[65,2]],[[65,2]],[[66,2],[0,2]]],[[[67,1],[68,1],[69,1],[70,1],[71,1],[72,1],[73,1],[74,1],[75,1],[76,1],[77,1],[78,1],[79,1]],[[0,1]]],[[[39,1]],[[0,1]]],[[[13,1]],[[25,2]],[[48,3],[35,4]],[[80,5]],[[61,6],[81,7]],[[0,5]],[[48,3]],[[61,6]]],[[[10,1],[34,2]],[[34,2]],[[82,3]],[[83,4]],[[84,5]],[[85,6],[0,5]],[[0,6]]],[[[37,1]],[[86,2]],[[85,3],[0,2]],[[0,3]]],[[[87,1],[54,1]],[[0,1]]],[[[88,1],[89,1],[8,2],[90,1],[88,1],[83,1],[91,1],[92,3],[93,1],[94,1]],[[0,1]],[[83,1]],[[8,1],[0,3]]],[[[95,1]],[[96,0],[0,1]]],[[[97,1],[98,1],[58,1],[99,1],[57,1],[100,1],[56,1],[101,1],[102,1]],[[0,1]]],[[[40,1]],[[0,1]]],[[[17,1]],[[0,1]]],[[[103,1]],[[56,2],[104,2],[99,2]],[[0,2]]],[[[41,1]],[[105,2]],[[2,4],[35,3]],[[61,5],[81,6]],[[0,4]],[[2,4]],[[61,5]]],[[[106,1]],[[106,1],[0,1]]],[[[27,1]],[[82,2]],[[0,2]]],[[[49,1],[107,2],[53,3]],[[48,4],[54,5],[52,6],[0,1]],[[54,5],[52,6],[0,2]],[[95,7]],[[49,7]],[[0,5]],[[49,8],[107,8],[0,6]],[[54,5],[52,9],[0,7]],[[52,6],[0,8]],[[49,10],[53,11],[0,9]],[[48,12]],[[95,13]],[[49,13]],[[52,9],[0,13]]],[[[105,1]],[[108,2],[0,1]],[[25,3]],[[0,3]]],[[[109,1]],[[52,0],[0,1]]],[[[25,1]],[[110,0],[0,1]]],[[[25,1]],[[0,1]]],[[[111,1]],[[2,1],[112,2]],[[0,2]]],[[[113,1]],[[49,2],[0,1]],[[108,3],[52,3],[0,2]],[[49,4]],[[0,4]]],[[[114,1]],[[115,0],[0,1]]],[[[116,1]],[[117,2],[50,3],[118,4],[0,1]],[[111,4],[62,4]],[[116,5],[62,5]],[[0,4]],[[50,3],[0,5]]],[[[95,1],[107,1]],[[52,2],[0,1]],[[95,1],[107,1],[0,2]]],[[[119,2],[30,1],[22,1],[43,1]],[[120,2]],[[0,2]]],[[[2,0],[112,1],[121,0]],[[0,1]]],[[[122,1],[123,1],[124,1],[125,1],[126,1]],[[0,1]]],[[[34,1]],[[82,2]],[[83,3]],[[111,4]],[[48,5]],[[80,6]],[[127,7],[0,6]],[[48,8]],[[80,9]],[[0,9]]],[[[4,1]],[[25,2]],[[128,3]],[[48,4],[129,5]],[[80,6]],[[49,7]],[[0,6]],[[48,4]]],[[[26,1]],[[25,2]],[[52,1],[0,2]]],[[[37,1]],[[49,2]],[[48,3]],[[80,4]],[[127,5],[130,1],[0,4]],[[48,6]],[[80,7]],[[0,7]]],[[[25,1]],[[108,2],[0,1]],[[25,3]],[[0,3]]],[[[131,1]],[[52,2],[0,1]],[[131,1],[0,2]]],[[[36,1]],[[105,2],[19,3],[110,3]],[[32,4]],[[105,2],[19,3],[32,4],[110,3]],[[132,5],[15,5],[35,6]],[[0,5]],[[132,7]],[[61,5]]],[[[32,1]],[[133,2]],[[0,2]]],[[[134,1],[135,1]],[[0,1]]],[[[14,1]],[[48,2],[136,3]],[[49,4]],[[48,2]],[[0,4]]],[[[14,1]],[[48,2],[136,3]],[[86,4]],[[48,2]],[[0,4]]],[[[18,1]],[[25,2]],[[52,1],[0,2]]],[[[8,1],[137,2]],[[46,2]],[[0,2]]],[[[138,1]],[[139,0],[0,1]]],[[[35,1]],[[61,2],[140,3]],[[0,2]],[[61,2]]],[[[28,1]],[[0,1]]],[[[141,1]],[[53,2],[0,1]],[[120,3]],[[0,3]]],[[[16,1]],[[49,2],[142,3],[0,1]],[[52,4],[0,2]],[[49,5]],[[49,2],[0,4]],[[52,6],[0,5]],[[49,7]],[[52,8],[0,7]],[[49,7],[0,8]]],[[[5,1]],[[49,2],[0,1]],[[36,3],[52,3],[0,2]],[[49,4]],[[52,5],[0,4]],[[49,6]],[[0,6]]],[[[23,1]],[[111,2],[0,1]],[[0,2]]],[[[143,1]],[[144,0],[142,0],[0,1]]],[[[145,1]],[[2,2],[146,3]],[[0,2]],[[145,1],[2,2]]],[[[48,1]],[[49,2],[0,1]],[[0,2]]],[[[147,1],[148,1],[149,1],[150,1],[151,1],[152,1],[153,1],[154,1],[155,1],[156,1]],[[0,1]]],[[[15,1]],[[95,2]],[[0,2]]],[[[1,1],[3,1]],[[0,1]]],[[[49,1],[48,2]],[[48,2],[0,1]],[[49,3],[157,4],[0,2]],[[157,4],[0,3]],[[0,4]]],[[[158,1]],[[52,2],[0,1]],[[158,1],[0,2]]],[[[1,1],[2,2]],[[0,1]],[[159,3]],[[121,4]],[[160,1],[121,4]]],[[[120,1]],[[161,0],[15,0],[162,0],[41,0],[163,0],[0,1]]],[[[84,1],[164,2]],[[37,3],[0,1]],[[0,2]],[[84,4]],[[127,5]],[[49,2]]],[[[165,1],[84,1]],[[0,1]]],[[[49,1]],[[52,2],[0,1]],[[49,1],[0,2]]],[[[49,1],[107,1]],[[54,2],[52,3],[0,1]],[[0,2]],[[49,4],[107,4],[0,3]],[[52,3],[0,4]]],[[[49,1],[107,1]],[[52,2],[0,1]],[[49,1],[107,1],[0,2]]],[[[25,1]],[[48,2],[0,1]],[[49,3]],[[0,3]]],[[[35,1],[110,2],[38,3]],[[61,4],[81,5]],[[25,4]],[[166,6]],[[0,4]],[[61,4]],[[64,4]]],[[[20,1]],[[48,2]],[[80,3]],[[167,4],[168,5]],[[48,6]],[[48,7]],[[80,8]],[[80,9]],[[167,4],[127,10],[168,5],[0,8]],[[0,9]],[[48,11]],[[80,12]],[[168,5],[0,12]]],[[[15,1],[169,2],[53,3]],[[169,4],[52,5],[0,1]],[[50,6],[52,7],[0,2]],[[169,8]],[[52,5],[0,4]],[[169,9],[53,3],[0,5]],[[49,10]],[[15,11],[169,2],[53,3],[0,7]],[[52,12],[0,8]],[[50,13],[52,5],[0,9]],[[52,7],[0,10]],[[169,14],[52,15],[0,11]],[[0,12]],[[49,4]],[[52,15],[0,14]],[[169,16],[53,3],[0,15]],[[50,17],[52,15],[0,16]],[[49,14]]],[[[15,1],[53,2],[170,3]],[[170,5],[52,4],[0,1]],[[170,6]],[[50,7],[52,8],[0,3]],[[53,2],[170,9],[0,4]],[[52,4],[0,5]],[[52,10],[0,6]],[[49,11]],[[15,12],[53,2],[170,3],[0,8]],[[50,13],[52,4],[0,9]],[[0,10]],[[52,8],[0,11]],[[52,15],[170,14],[0,12]],[[49,5]],[[52,15],[0,14]],[[53,2],[170,16],[0,15]],[[50,17],[52,15],[0,16]],[[49,14]]],[[[25,1]],[[0,1]]],[[[21,1]],[[49,2]],[[48,3]],[[80,4]],[[127,5],[0,4]],[[48,6]],[[80,7]],[[0,7]]],[[[49,1]],[[108,2],[0,1]],[[95,3]],[[0,3]]],[[[42,1]],[[171,2]],[[48,3],[52,1]],[[80,4]],[[0,4]]],[[[172,1]],[[173,0],[0,1]]],[[[111,2],[36,1]],[[49,2]],[[0,2]]],[[[31,1]],[[174,2],[0,1]],[[0,2]]],[[[62,1]],[[0,1]]]],labels:[[0,"EMPTY"],[317,null],[4,null],[276,null],[1,"def"],[1,"raise"],[1,"True"],[3,null],[1,"not"],[1,"None"],[55,null],[2,null],[25,null],[1,"class"],[1,"lambda"],[16,null],[1,"print"],[1,"debugger"],[1,"nonlocal"],[52,null],[1,"try"],[1,"while"],[31,null],[1,"return"],[1,"assert"],[1,null],[1,"global"],[1,"del"],[1,"pass"],[54,null],[15,null],[1,"yield"],[1,"import"],[1,"False"],[1,"for"],[7,null],[1,"from"],[1,"if"],[9,null],[1,"break"],[1,"continue"],[49,null],[1,"with"],[14,null],[316,null],[19,null],[308,null],[1,"and"],[11,null],[326,null],[22,null],[261,null],[12,null],[35,null],[271,null],[325,null],[297,null],[339,null],[296,null],[26,null],[283,null],[8,null],[342,null],[329,null],[10,null],[266,null],[332,null],[45,null],[38,null],[40,null],[50,null],[46,null],[41,null],[42,null],[36,null],[43,null],[48,null],[44,null],[37,null],[39,null],[324,null],[260,null],[292,null],[1,"in"],[309,null],[273,null],[327,null],[272,null],[28,null],[21,null],[27,null],[29,null],[1,"is"],[30,null],[20,null],[290,null],[274,null],[333,null],[299,null],[270,null],[337,null],[279,null],[265,null],[281,null],[264,null],[286,null],[280,null],[320,null],[1,"as"],[284,null],[23,null],[328,null],[0,null],[1,"except"],[340,null],[18,null],[330,null],[268,null],[259,null],[312,null],[293,null],[321,null],[269,null],[277,null],[314,null],[315,null],[343,null],[1,"else"],[310,null],[51,null],[1,"elif"],[300,null],[301,null],[285,null],[303,null],[302,null],[335,null],[275,null],[258,null],[1,"or"],[334,null],[267,null],[34,null],[262,null],[33,null],[319,null],[13,null],[295,null],[263,null],[291,null],[311,null],[307,null],[313,null],[282,null],[298,null],[304,null],[278,null],[318,null],[322,null],[5,null],[6,null],[47,null],[17,null],[24,null],[305,null],[306,null],[323,null],[289,null],[1,"finally"],[331,null],[336,null],[338,null],[257,null],[32,null],[341,null]],keywords:{False:33,None:9,True:6,and:47,as:108,assert:24,break:39,class:13,continue:40,debugger:17,def:4,del:27,elif:130,else:127,except:113,finally:168,for:34,from:36,global:26,if:37,import:32,in:83,is:92,lambda:14,nonlocal:18,not:8,or:139,pass:28,print:16,raise:5,return:23,try:20,while:21,with:42,yield:31},tokens:{0:112,1:25,2:11,3:7,4:2,5:159,6:160,7:35,8:61,9:38,10:64,11:48,12:52,13:146,14:43,15:30,16:15,17:162,18:115,19:45,20:94,21:89,22:50,23:110,24:163,25:12,26:59,27:90,28:88,29:91,30:93,31:22,32:173,33:144,34:142,35:53,36:74,37:78,38:68,39:79,40:69,41:72,42:73,43:75,44:77,45:67,46:71,47:161,48:76,49:41,50:70,51:129,52:19,54:29,55:10},start:256}},function(t,e){function n(t,e){return this.filename=t,this.grammar=e,this.p_flags=0,this}n.FUTURE_PRINT_FUNCTION="print_function",n.FUTURE_UNICODE_LITERALS="unicode_literals",n.FUTURE_DIVISION="division",n.FUTURE_ABSOLUTE_IMPORT="absolute_import",n.FUTURE_WITH_STATEMENT="with_statement",n.FUTURE_NESTED_SCOPES="nested_scopes",n.FUTURE_GENERATORS="generators",n.CO_FUTURE_PRINT_FUNCTION=65536,n.CO_FUTURE_UNICODE_LITERALS=131072,n.CO_FUTURE_DIVISON=8192,n.CO_FUTURE_ABSOLUTE_IMPORT=16384,n.CO_FUTURE_WITH_STATEMENT=32768,n.prototype.setup=function(t){t=t||this.grammar.start,this.stack=[{dfa:this.grammar.dfas[t],state:0,node:{type:t,value:null,context:null,children:[]}}],this.used_names={}},n.prototype.addtoken=function(t,e,n){var i,s=this.classify(t,e,n);t:for(;;){var r=this.stack[this.stack.length-1],o=r.dfa[0],a=o[r.state];for(i=0;ic),this.shift(t,e,u,n),n=u;1===o[n].length&&0===o[n][0][0]&&o[n][0][1]===n;){if(this.pop(),0===this.stack.length)return!0;n=(r=this.stack[this.stack.length-1]).state,o=r.dfa[0]}return!1}if(256<=c&&(l=(l=this.grammar.dfas[c])[1]).hasOwnProperty(s)){this.push(c,this.grammar.dfas[c],u,n);continue t}}e:{for(o=[0,r.state],r=a.length;r--;)if(a[r][0]===o[0]&&a[r][1]===o[1]){a=!0;break e}a=!1}if(!a)throw t=n[0][0],new Sk.builtin.SyntaxError("bad input",this.filename,t,n);if(this.pop(),0===this.stack.length)throw new Sk.builtin.SyntaxError("too much input",this.filename)}},n.prototype.classify=function(t,e,i){if(t===Sk.token.tokens.T_NAME){this.used_names[e]=!0;var s=this.grammar.keywords.hasOwnProperty(e)&&this.grammar.keywords[e];if("print"===e&&(this.p_flags&n.CO_FUTURE_PRINT_FUNCTION||!0===Sk.__future__.print_function)&&(s=!1),s)return s}if(!(s=this.grammar.tokens.hasOwnProperty(t)&&this.grammar.tokens[t])){e="#"+t;for(let n in Sk.token.tokens)if(Sk.token.tokens[n]==t){e=n;break}throw new Sk.builtin.SyntaxError("bad token "+e,this.filename,i[0][0],i)}return s},n.prototype.shift=function(t,e,n,i){var s=this.stack[this.stack.length-1].dfa,r=this.stack[this.stack.length-1].node;r.children.push({type:t,value:e,lineno:i[0][0],col_offset:i[0][1],children:null}),this.stack[this.stack.length-1]={dfa:s,state:n,node:r}},n.prototype.push=function(t,e,n,i){t={type:t,value:null,lineno:i[0][0],col_offset:i[0][1],children:[]},this.stack[this.stack.length-1]={dfa:this.stack[this.stack.length-1].dfa,state:n,node:this.stack[this.stack.length-1].node},this.stack.push({dfa:e,state:0,node:t})},n.prototype.pop=function(){var t=this.stack.pop().node;if(t)if(0!==this.stack.length){this.stack[this.stack.length-1].node.children.push(t)}else this.rootnode=t,this.rootnode.used_names=this.used_names},Sk.parse=function(t,e){var i,s=Sk.token.tokens.T_COMMENT,r=Sk.token.tokens.T_NL,o=Sk.token.tokens.T_OP,a=Sk.token.tokens.T_ENDMARKER,l=Sk.token.tokens.T_ENCODING,u=!1,c=function(t,e){return void 0===e&&(e="file_input"),t=new n(t,Sk.ParseTables),"file_input"===e?t.setup(Sk.ParseTables.sym.file_input):Sk.asserts.fail("todo;"),t}(t);if(Sk._tokenize(t,(i=e.split("\n").reverse().map((function(t){return t+"\n"})),function(){if(0===i.length)throw new Sk.builtin.Exception("EOF");return i.pop()}),"utf-8",(function(t){var e=null;t.type!==s&&t.type!==r&&t.type!==l&&(t.type===o&&(e=Sk.OpMap[t.string]),c.addtoken(e||t.type,t.string,[t.start,t.end,t.line]),t.type===a&&(u=!0))})),!u)throw new Sk.builtin.SyntaxError("incomplete input",this.filename);return{cst:c.rootnode,flags:c.p_flags}},Sk.parseTreeDump=function(t,e){var n,i=""+(e=e||"");if(256<=t.type)for(i+=Sk.ParseTables.number2symbol[t.type]+"\n",n=0;n=i(e)||o+2==i(e)&&s(e,o+1).type==V.T_COMMA)throw new Sk.builtin.SyntaxError("named arguments must follow bare *",t.c_filename,e.lineno);(_=s(e,o+1)).type==V.T_COMMA?o=$(t,e,o+=2,u,c):(p=v(t,_),(o+=3)t.c_feature_version)return o(t,l,"Async functions are only supported in Python 3.5 and greater"),null;r(l,B.funcdef);var d=h(s(l,p));if(u(t,0,s(l,p),0))return null;var f=w(t,s(l,p+1));if(!f)return null;if(s(l,p+2).type==V.T_RARROW){if(!(c=F(t,s(l,p+3))))return null;p+=2}if(s(l,p+3).type==V.T_TYPE_COMMENT){if(!(_=V.T_NEW_TYPE_COMMENT(s(l,p+3))))return null;p+=1}var g=m(t,s(l,p+3));if(!g)return null;if(1":return Sk.astnodes.RShift;case"&":return Sk.astnodes.BitAnd;case"^":return Sk.astnodes.BitXor;case"|":return Sk.astnodes.BitOr;case"*":return"*"===e.value.charAt(1)?Sk.astnodes.Pow:Sk.astnodes.Mult;case"@":if(Sk.__future__.python3)return Sk.astnodes.MatMult;default:Sk.asserts.fail("invalid augassign")}}(0,s(e,1)),a,e.lineno,e.col_offset)}if(s(e,1).type===B.annassign){if(!Sk.__future__.python3)throw new Sk.builtin.SyntaxError("Annotated assignment is not supported in Python 2",t.c_filename,e.lineno);n=s(e,0);var l=s(e,1),p=1;for(o=n;1==i(o);)o=s(o,0);switch(0o(r,a,"f-string: expecting '}'");for(Sk.asserts.assert(e<=n);e=e),Sk.asserts.assert("{"==t.charAt(e-1)),Sk.asserts.assert("}"==t.charAt(n)||"!"==t.charAt(n)||":"==t.charAt(n)),t=t.substring(e,n),/^\s*$/.test(t)&&o(i,s,"f-string: empty expression not allowed");try{let e=Sk.parse("","("+t+")");var r=Sk.astFromParse(e.cst,"",e.flags)}catch(t){throw t.traceback&&t.traceback[0]&&((r=t.traceback[0]).lineno=(r.lineno||1)-1+s.lineno,r.filename=i.c_filename),t}return Sk.asserts.assert(1==r.body.length&&r.body[0].constructor===Sk.astnodes.Expr),r.body[0].value}(t,l,e,r,a),"!"==t.charAt(e)&&(++e>=n&&d(),c=t.charAt(e),e++,"s"!=c&&"r"!=c&&"a"!=c&&o(r,a,"f-string: invalid conversion character: expected 's', 'r', or 'a'")),e>=n&&d(),":"==t.charAt(e)&&(++e>=n&&d(),[u,e]=x(t,e,n,i,s+1,r,a)),(e>=n||"}"!=t.charAt(e))&&d(),e++,[new Sk.astnodes.FormattedValue(l,c,u,a.lineno,a.col_offset),e]}function x(t,e,n,i,s,r,o){let a=[],l=t=>{if(-1!==t.indexOf("}")){if(/(^|[^}])}(}})*($|[^}])/.test(t))throw new Sk.builtin.SyntaxError("f-string: single '}' is not allowed",r.c_filename,o.lineno,o.col_offset);t=t.replace(/}}/g,"}")}a.push(new Sk.astnodes.Str(new Sk.builtin.str(t),o.lineno,o.col_offset,r.end_lineno,o.end_col_offset))};for(;ei&&(u=-1,n=i))}if(-1===u){l(t.substring(e,n)),e=n;break}if(u+1=l.length){if("None"===l)return new Sk.astnodes.NameConstant(Sk.builtin.none.none$,e.lineno,e.col_offset);if("True"===l)return new Sk.astnodes.NameConstant(Sk.builtin.bool.true$,e.lineno,e.col_offset);if("False"===l)return new Sk.astnodes.NameConstant(Sk.builtin.bool.false$,e.lineno,e.col_offset)}return t=h(l),new Sk.astnodes.Name(t,Sk.astnodes.Load,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);case V.T_STRING:n=[];for(var u=0;u=y&&o(p,_,"Truncated \\xNN escape"),T+=String.fromCharCode(parseInt(b.substr(m+1,2),16)),m+=2):k||"u"!==g?k||"U"!==g?T+="\\"+g:(m+8>=y&&o(p,_,"Truncated \\UXXXXXXXX escape"),T+=String.fromCodePoint(parseInt(b.substr(m+1,8),16)),m+=8):(m+4>=y&&o(p,_,"Truncated \\uXXXX escape"),T+=String.fromCharCode(parseInt(b.substr(m+1,4),16)),m+=4))):k&&127l.charCodeAt(1)&&(l="0o"+l.substring(1)),n=!0,"l"!==u&&"L"!==u||(l=l.slice(0,-1),n=!1),l=(u=Number(l))>Number.MAX_SAFE_INTEGER?n?new Sk.builtin.int_(JSBI.BigInt(l)):new Sk.builtin.lng(JSBI.BigInt(l)):n?new Sk.builtin.int_(u):new Sk.builtin.lng(u)),new t(l,e.lineno,e.col_offset);case V.T_ELLIPSIS:return new Sk.astnodes.Ellipsis(e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);case V.T_LPAR:return(n=s(e,1)).type==V.T_RPAR?new Sk.astnodes.Tuple([],Sk.astnodes.Load,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset):n.type==B.yield_expr?F(t,n):1==i(n)?M(t,n):s(n,1).type==B.comp_for?d(S(t,n),e):d(M(t,n),e);case V.T_LSQB:return(n=s(e,1)).type==V.T_RSQB?new Sk.astnodes.List([],Sk.astnodes.Load,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset):(r(n,B.testlist_comp),1==i(n)||s(n,1).type==V.T_COMMA?(t=f(t,n))?new Sk.astnodes.List(t,Sk.astnodes.Load,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset):null:(l=n,Sk.asserts.assert(l.type==B.testlist_comp),d(t=O(t,l,1),e)));case V.T_LBRACE:if((n=s(e,1)).type==V.T_RBRACE)return new Sk.astnodes.Dict(null,null,e.lineno,e.col_offset,e.end_lineno,e.end_col_offset);if(l=s(n,0).type==V.T_DOUBLESTAR,1==i(n)||13-l&&s(n,3-l).type==B.comp_for){if(l)return o(t,e,"dict unpacking cannot be used in dict comprehension"),null;l=n,Sk.asserts.assert(3>11&7,this.__namespaces=n||[]}function i(t,e,n,i,s){this.symFlags={},this.name=e,this.varnames=[],this.children=[],this.blockType=n,this.returnsValue=this.varkeywords=this.varargs=this.generator=this.childHasFree=this.hasFree=this.isNested=!1,this.lineno=s,this.table=t,t.cur&&(t.cur.nested||"function"===t.cur.blockType)&&(this.isNested=!0),i.scopeId=a++,t.stss[i.scopeId]=this,this.symbols={}}function s(t){this.filename=t,this.top=this.cur=null,this.stack=[],this.curClass=this.global=null,this.tmpname=0,this.stss={}}function r(t,e){var n;for(n=0;n>11&7)||2==t}))),this._funcGlobals},i.prototype.get_frees=function(){return Sk.asserts.assert("function"==this.get_type(),"get_frees only valid for function scopes"),this._funcFrees||(this._funcFrees=this._identsMatching((function(t){return 4==(t>>11&7)}))),this._funcFrees},i.prototype.get_methods=function(){var t;if(Sk.asserts.assert("class"==this.get_type(),"get_methods only valid for class scopes"),!this._classMethods){var e=[];for(t=0;t>11&7},s.prototype.getStsForAst=function(t){return Sk.asserts.assert(void 0!==t.scopeId,"ast wasn't added to st?"),t=this.stss[t.scopeId],Sk.asserts.assert(void 0!==t,"unknown sym tab entry"),t},s.prototype.SEQStmt=function(t){var e,n;if(null!==t){Sk.asserts.assert(Sk.isArrayLike(t),"SEQ: nodes isn't array? got "+t.toString());var i=t.length;for(n=0;n","").replace(" ","_"))};var a=Sk.builtin.str.reservedWords_;n.prototype.makeConstant=function(t){var e,n="";for(e=0;e Sk.execLimit) {throw new Sk.builtin.TimeoutError(Sk.timeoutMsg())}"),null!==Sk.yieldLimit&&this.u.canSuspend&&(t=t+"if (!$waking && ($dateNow - Sk.lastYield > Sk.yieldLimit)) {var $susp = $saveSuspension({data: {type: 'Sk.yield'}, resume: function() {}}, '"+this.filename+"',$currLineNo,$currColNo);",t+="$susp.$blk = $blk;$susp.optional = true;return $susp;}$waking = false;",this.u.doesSuspend=!0)),t},n.prototype._jumpfalse=function(t,e){t=this._gr("jfalse","(",t,"===false||!Sk.misceval.isTrue(",t,"))"),o("if(",t,"){/*test failed */$blk=",e,";continue;}")},n.prototype._jumpundef=function(t,e){o("if(",t,"===undefined){$blk=",e,";continue;}")},n.prototype._jumpnotundef=function(t,e){o("if(",t,"!==undefined){$blk=",e,";continue;}")},n.prototype._jumptrue=function(t,e){t=this._gr("jtrue","(",t,"===true||Sk.misceval.isTrue(",t,"))"),o("if(",t,"){/*test passed */$blk=",e,";continue;}")},n.prototype._jump=function(t){null===this.u.blocks[this.u.curblock]._next&&(o("$blk=",t,";"),this.u.blocks[this.u.curblock]._next=t)},n.prototype._checkSuspension=function(t){if(this.u.canSuspend){var e=this.newBlock("function return or resume suspension");this._jump(e),this.setBlock(e),t=t||{lineno:"$currLineNo",col_offset:"$currColNo"},o("if ($ret && $ret.$isSuspension) { return $saveSuspension($ret,'"+this.filename+"',"+t.lineno+","+t.col_offset+"); }"),this.u.doesSuspend=!0,this.u.tempsToSave=this.u.tempsToSave.concat(this.u.localtemps)}else o("if ($ret && $ret.$isSuspension) { $ret = Sk.misceval.retryOptionalSuspensionOrThrow($ret); }")},n.prototype.cunpackstarstoarray=function(t,e){if(!t||0==t.length)return"[]";let n=!1;for(let i of t){if(e&&n)throw new Sk.builtin.SyntaxError("Extended argument unpacking is not permitted in Python 2");i.constructor===Sk.astnodes.Starred&&(n=!0)}if(n){e=this._gr("unpack","[]");for(let n of t)n.constructor!==Sk.astnodes.Starred?o(e,".push(",this.vexpr(n),");"):(o("$ret = Sk.misceval.iterFor(Sk.abstr.iter(",this.vexpr(n.value),"), function(e) { ",e,".push(e); });"),this._checkSuspension());return e}return"["+t.map((t=>this.vexpr(t))).join(",")+"]"},n.prototype.cunpackkwstoarray=function(t,e){var n="undefined";if(t&&0=n.length&&(n=this.vexpr(s),"dict"===t?(t=this.vexpr(r),o(e,".mp$ass_subscript(",t,",",n,");")):"list"===t?o(e,".v.push(",n,");"):"set"===t&&o(e,".v.mp$ass_subscript(",n,", true);"),this._jump(c),this.setBlock(c)),this._jump(u),this.setBlock(p),e},n.prototype.cyield=function(t){if(this.u.ste.blockType!==Sk.SYMTAB_CONSTS.FunctionBlock)throw new Sk.builtin.SyntaxError("'yield' outside function",this.filename,t.lineno);var e="Sk.builtin.none.none$";return t.value&&(e=this.vexpr(t.value)),t=this.newBlock("after yield"),o("return [/*resume*/",t,",/*ret*/",e,"];"),this.setBlock(t),"$gen.gi$sentvalue"},n.prototype.cyieldfrom=function(t){if(this.u.ste.blockType!==Sk.SYMTAB_CONSTS.FunctionBlock)throw new Sk.builtin.SyntaxError("'yield' outside function",this.filename,t.lineno);var e=this.vexpr(t.value);e=this._gr("iter","Sk.abstr.iter(",e,")"),o("$gen."+e+"=",e,";");var n=this.newBlock("after iter"),i=this.newBlock("after yield from");this._jump(n),this.setBlock(n);var s=this.gensym("retval");o(e,"=$gen.",e,";"),o("var ",s,";"),o("if ($gen.gi$sentvalue === Sk.builtin.none.none$ || "+e+".constructor === Sk.builtin.generator) {"),o("$ret=",e,".tp$iternext(true, $gen.gi$sentvalue);"),o("} else {");var r=this.makeConstant("new Sk.builtin.str('send');");return o("$ret=Sk.misceval.tryCatch("),o("function(){"),o("return Sk.misceval.callsimOrSuspendArray(Sk.abstr.gattr(",e,",",r,"), [$gen.gi$sentvalue]);},"),o("function (e) { "),o("if (e instanceof Sk.builtin.StopIteration) { "),o(e,".gi$ret = e.$value;"),o("return undefined;"),o("} else { throw e; }"),o("}"),o(");"),o("}"),this._checkSuspension(t),o(s,"=$ret;"),o("if(",s,"===undefined) {"),o("$gen.gi$sentvalue=$gen."+e+".gi$ret;"),o("$blk=",i,";continue;"),o("}"),o("return [/*resume*/",n,",/*ret*/",s,"];"),this.setBlock(i),"$gen.gi$sentvalue"},n.prototype.ccompare=function(t){var e;Sk.asserts.assert(t.ops.length===t.comparators.length);var n=this.vexpr(t.left),i=t.ops.length,s=this.newBlock("done"),r=this._gr("compareres","null");for(e=0;ethis.u.lineno&&(this.u.lineno=t.lineno,this.u.linenoSet=!1),t.constructor){case Sk.astnodes.BoolOp:return this.cboolop(t);case Sk.astnodes.BinOp:return this._gr("binop","Sk.abstr.numberBinOp(",this.vexpr(t.left),",",this.vexpr(t.right),",'",t.op.prototype._astname,"')");case Sk.astnodes.UnaryOp:return this._gr("unaryop","Sk.abstr.numberUnaryOp(",this.vexpr(t.operand),",'",t.op.prototype._astname,"')");case Sk.astnodes.Lambda:return this.clambda(t);case Sk.astnodes.IfExp:return this.cifexp(t);case Sk.astnodes.Dict:return this.cdict(t);case Sk.astnodes.ListComp:return this.clistcomp(t);case Sk.astnodes.DictComp:return this.cdictcomp(t);case Sk.astnodes.SetComp:return this.csetcomp(t);case Sk.astnodes.GeneratorExp:return this.cgenexp(t);case Sk.astnodes.Yield:return this.cyield(t);case Sk.astnodes.YieldFrom:return this.cyieldfrom(t);case Sk.astnodes.Compare:return this.ccompare(t);case Sk.astnodes.Call:return e=this.ccall(t),this.annotateSource(t),e;case Sk.astnodes.Num:if("number"==typeof t.n)return t.n;if(t.n instanceof Sk.builtin.lng)return this.makeConstant("new Sk.builtin.lng('"+t.n.v.toString()+"')");if(t.n instanceof Sk.builtin.int_)return"number"==typeof t.n.v?this.makeConstant("new Sk.builtin.int_("+t.n.v+")"):this.makeConstant("new Sk.builtin.int_('"+t.n.v.toString()+"')");if(t.n instanceof Sk.builtin.float_)return t=0===t.n.v&&-1/0==1/t.n.v?"-0":t.n.v,this.makeConstant("new Sk.builtin.float_("+t+")");if(t.n instanceof Sk.builtin.complex)return this.makeConstant("new Sk.builtin.complex("+(0===t.n.real&&-1/0==1/t.n.real?"-0":t.n.real)+", "+(0===t.n.imag&&-1/0==1/t.n.imag?"-0":t.n.imag)+")");Sk.asserts.fail("unhandled Num type");case Sk.astnodes.Bytes:if(Sk.__future__.python3){for(e=[],t=t.s.$jsstr(),n=0;ni||127<=i&&256>i?n+"\\x"+("0"+i.toString(16)).substr(-2):256<=i?n+"\\u"+("000"+i.toString(16)).substr(-4):n+t.charAt(s);return t=n+'"',e.call(this,"new Sk.builtin.str(",t,")");case Sk.astnodes.Attribute:switch(t.ctx!==Sk.astnodes.AugLoad&&t.ctx!==Sk.astnodes.AugStore&&(s=this.vexpr(t.value)),i=(i=t.attr.$r().v).substring(1,i.length-1),i=r(this.u.private_,new Sk.builtin.str(i)).v,i=this.makeConstant("new Sk.builtin.str('"+i+"')"),t.ctx){case Sk.astnodes.AugLoad:return o("$ret = ",n,".tp$getattr(",i,", true);"),this._checkSuspension(t),o("\nif ($ret === undefined) {"),o("\nthrow new Sk.builtin.AttributeError(",n,'.sk$attrError() + " has no attribute \'" + ',i,'.$jsstr() + "\'");'),o("\n};"),this._gr("lattr","$ret");case Sk.astnodes.Load:return o("$ret = ",s,".tp$getattr(",i,", true);"),this._checkSuspension(t),o("\nif ($ret === undefined) {"),o("\nthrow new Sk.builtin.AttributeError(",s,'.sk$attrError() + " has no attribute \'" + ',i,'.$jsstr() + "\'");'),o("\n};"),this._gr("lattr","$ret");case Sk.astnodes.AugStore:o("$ret = undefined;"),o("if(",e,"!==undefined){"),o("$ret = ",n,".tp$setattr(",i,",",e,", true);"),o("}"),this._checkSuspension(t);break;case Sk.astnodes.Store:o("$ret = ",s,".tp$setattr(",i,",",e,", true);"),this._checkSuspension(t);break;case Sk.astnodes.Del:o("$ret = ",s,".tp$setattr(",i,", undefined, true);"),this._checkSuspension(t);break;default:Sk.asserts.fail("invalid attribute expression")}break;case Sk.astnodes.Subscript:switch(t.ctx){case Sk.astnodes.AugLoad:return o("$ret = Sk.abstr.objectGetItem(",n,",",i,", true);"),this._checkSuspension(t),this._gr("gitem","$ret");case Sk.astnodes.Load:case Sk.astnodes.Store:case Sk.astnodes.Del:return this.vslice(t.slice,t.ctx,this.vexpr(t.value),e);case Sk.astnodes.AugStore:o("$ret=undefined;"),o("if(",e,"!==undefined){"),o("$ret=Sk.abstr.objectSetItem(",n,",",i,",",e,", true)"),o("}"),this._checkSuspension(t);break;default:Sk.asserts.fail("invalid subscript expression")}break;case Sk.astnodes.Name:return this.nameop(t.id,t.ctx,e);case Sk.astnodes.NameConstant:if(t.ctx===Sk.astnodes.Store||t.ctx===Sk.astnodes.AugStore||t.ctx===Sk.astnodes.Del)throw new Sk.builtin.SyntaxError("can not assign to a constant name");switch(t.value){case Sk.builtin.none.none$:return"Sk.builtin.none.none$";case Sk.builtin.bool.true$:return"Sk.builtin.bool.true$";case Sk.builtin.bool.false$:return"Sk.builtin.bool.false$";default:Sk.asserts.fail("invalid named constant")}break;case Sk.astnodes.List:return this.ctuplelistorset(t,e,"list");case Sk.astnodes.Tuple:return this.ctuplelistorset(t,e,"tuple");case Sk.astnodes.Set:return this.ctuplelistorset(t,e,"set");case Sk.astnodes.Starred:if(t.ctx===Sk.astnodes.Store)throw new Sk.builtin.SyntaxError("starred assignment target must be in a list or tuple",this.filename,t.lineno);throw new Sk.builtin.SyntaxError("can't use starred expression here",this.filename,t.lineno);case Sk.astnodes.JoinedStr:return this.cjoinedstr(t);case Sk.astnodes.FormattedValue:return this.cformattedvalue(t);case Sk.astnodes.Ellipsis:return this.makeConstant("Sk.builtin.Ellipsis");default:Sk.asserts.fail("unhandled case "+t.constructor.name+" vexpr")}},n.prototype.vseqexpr=function(t,e){var n;Sk.asserts.assert(void 0===e||t.length===e.length);var i=[];for(n=0;n",this.u.blocks[e]._next=null,e},n.prototype.setBlock=function(t){Sk.asserts.assert(0<=t&&t0) { $err=err; $blk=$exc.pop(); } else { throw err; } }};",o+="var $saveSuspension = function($child, $filename, $lineno, $colno) {var susp = new Sk.misceval.Suspension(); susp.child=$child;susp.resume=function(){"+t.scopename+".$wakingSuspension=susp; return "+t.scopename+"("+(t.ste.generator?"$gen":"")+"); };susp.data=susp.child.data;susp.$blk=$blk;susp.$loc=$loc;susp.$gbl=$gbl;susp.$exc=$exc;susp.$err=$err;susp.$postfinally=$postfinally;susp.$filename=$filename;susp.$lineno=$lineno;susp.$colno=$colno;susp.optional=susp.child.optional;"+(r?"susp.$cell=$cell;":""),s={},e=0;et?this.vexpr(t):"undefined"))),i&&i.vararg&&(d=i.vararg),i&&i.kwarg&&(f=i.kwarg),!Sk.__future__.python3&&i&&i.kwonlyargs&&0!=i.kwonlyargs.length)throw new Sk.builtin.SyntaxError("Keyword-only arguments are not supported in Python 2");var m=this.enterScope(e,t,t.lineno,this.canSuspend),g=this.u.ste.generator,b=this.u.ste.hasFree,S=this.u.ste.childHasFree,k=this.newBlock("codeobj entry");this.u.prefixCode="var "+m+"=(function "+this.niceName(e.v)+"$(";var y=[];if(g){if(f)throw new Sk.builtin.SyntaxError(e.v+"(): keyword arguments in generators not supported",this.filename,t.lineno);if(d)throw new Sk.builtin.SyntaxError(e.v+"(): variable number of arguments in generators not supported",this.filename,t.lineno);y.push("$gen")}else{for(f&&(y.push("$kwa"),this.u.tempsToSave.push("$kwa")),u=0;i&&u0) { $err = err; $blk=$exc.pop(); continue; } else { throw err; }} }});",a.call(this,m),i){for(let t of i.args)c.push(t.arg.v);for(let t of i.kwonlyargs||[])c.push(t.arg.v);this.u.argnames=c}if(this.exitScope(),0"),null,t.args,(function(e){e=this.vexpr(t.body),o("return ",e,";")}))},n.prototype.cifexp=function(t){var e=this.newBlock("next of ifexp"),n=this.newBlock("end of ifexp"),i=this._gr("res","null"),s=this.vexpr(t.test);return this._jumpfalse(s,e),o(i,"=",this.vexpr(t.body),";"),this._jump(n),this.setBlock(e),o(i,"=",this.vexpr(t.orelse),";"),this._jump(n),this.setBlock(n),i},n.prototype.cgenexpgen=function(t,e,n){var i=this.newBlock("start for "+e),s=this.newBlock("skip for "+e);this.newBlock("if cleanup for "+e);var r=this.newBlock("end for "+e),a=t[e];if(0===e)var l="$loc.$iter0";else{var u=this.vexpr(a.iter);l="$loc."+this.gensym("iter"),o(l,"=","Sk.abstr.iter(",u,");")}this._jump(i),this.setBlock(i),this.annotateSource(n),o("$ret = Sk.abstr.iternext(",l,this.u.canSuspend?", true":", false",");"),this._checkSuspension(n),u=this._gr("next","$ret"),this._jumpundef(u,r),this.vexpr(a.target,u);var c=a.ifs?a.ifs.length:0;for(l=0;l=t.length&&(this.annotateSource(n),t=this.vexpr(n),o("return [",s,"/*resume*/,",t,"/*ret*/];"),this.setBlock(s)),this._jump(i),this.setBlock(r),1===e&&o("return Sk.builtin.none.none$;")},n.prototype.cgenexp=function(t){var e=this.buildcodeobj(t,new Sk.builtin.str(""),null,null,(function(e){this.cgenexpgen(t.generators,0,t.elt)}));return e=this._gr("gener","Sk.misceval.callsimArray(",e,");"),o(e,".gi$locals.$iter0=Sk.abstr.iter(",this.vexpr(t.generators[0].iter),");"),e},n.prototype.cclass=function(t){Sk.asserts.assert(t instanceof Sk.astnodes.ClassDef);var e=this.vseqexpr(t.decorator_list),n=this.vseqexpr(t.bases);let i=this.cunpackkwstoarray(t.keywords);var s=this.enterScope(t.name,t,t.lineno),r=this.newBlock("class entry");this.u.prefixCode="var "+s+"=(function $"+t.name.v+"$class_outer($globals,$locals,$cell){var $gbl=$globals,$loc=$locals,$free=$globals;",this.u.switchCode+="(function $"+t.name.v+"$_closure($cell){",this.u.switchCode+="var $blk="+r+",$exc=[],$ret=undefined,$postfinally=undefined,$currLineNo=undefined,$currColNo=undefined;",null!==Sk.execLimit&&(this.u.switchCode+="if (typeof Sk.execStart === 'undefined') {Sk.execStart = Date.now()}"),null!==Sk.yieldLimit&&this.u.canSuspend&&(this.u.switchCode+="if (typeof Sk.lastYield === 'undefined') {Sk.lastYield = Date.now()}"),this.u.switchCode+="while(true){try{",this.u.switchCode+=this.outputInterruptTest(),this.u.switchCode+="switch($blk){",this.u.suffixCode="}}catch(err){ if (!(err instanceof Sk.builtin.BaseException)) { err = new Sk.builtin.ExternalError(err); } err.traceback.push({lineno: $currLineNo, colno: $currColNo, filename: '"+this.filename+"'}); if ($exc.length>0) { $err = err; $blk=$exc.pop(); continue; } else { throw err; }}}",this.u.suffixCode+="}).call(null, $cell);});",this.u.private_=t.name,this.cbody(t.body,t.name),o("return;"),this.exitScope(),o("$ret = Sk.misceval.buildClass($gbl,",s,",",t.name.$r().v,",[",n,"], $cell, ",i,");"),this._checkSuspension();for(let t of e.reverse())o("$ret = Sk.misceval.callsimOrSuspendArray(",t,", [$ret]);"),this._checkSuspension();this.nameop(t.name,Sk.astnodes.Store,"$ret")},n.prototype.ccontinue=function(t){var e=this.peekFinallyBlock();if(0==this.u.continueBlocks.length)throw new Sk.builtin.SyntaxError("'continue' outside loop",this.filename,t.lineno);t=this.u.continueBlocks[this.u.continueBlocks.length-1],Sk.asserts.assert(this.u.breakBlocks.length===this.u.continueBlocks.length),e&&e.breakDepth==this.u.continueBlocks.length?o("$postfinally={isBreak:true,gotoBlock:",t,"};"):this._jump(t)},n.prototype.cbreak=function(t){var e=this.peekFinallyBlock();if(0===this.u.breakBlocks.length)throw new Sk.builtin.SyntaxError("'break' outside loop",this.filename,t.lineno);t=this.u.breakBlocks[this.u.breakBlocks.length-1],e&&e.breakDepth==this.u.breakBlocks.length?o("$postfinally={isBreak:true,gotoBlock:",t,"};"):this._jump(t)},n.prototype.vstmt=function(t,e){if(this.u.lineno=t.lineno,this.u.linenoSet=!1,this.u.localtemps=[],Sk.debugging&&this.u.canSuspend){var n=this.newBlock("debug breakpoint for line "+t.lineno);o("if (Sk.breakpoints('"+this.filename+"',"+t.lineno+","+t.col_offset+")) {","var $susp = $saveSuspension({data: {type: 'Sk.debug'}, resume: function() {}}, '"+this.filename+"',"+t.lineno+","+t.col_offset+");","$susp.$blk = "+n+";","$susp.optional = true;","return $susp;","}"),this._jump(n),this.setBlock(n),this.u.doesSuspend=!0}switch(this.annotateSource(t),t.constructor){case Sk.astnodes.FunctionDef:this.cfunction(t,e);break;case Sk.astnodes.ClassDef:this.cclass(t);break;case Sk.astnodes.Return:if(this.u.ste.blockType!==Sk.SYMTAB_CONSTS.FunctionBlock)throw new Sk.builtin.SyntaxError("'return' outside function",this.filename,t.lineno);n=t.value?this.vexpr(t.value):"Sk.builtin.none.none$",0==this.u.finallyBlocks.length?o("return ",n,";"):(o("$postfinally={returning:",n,"};"),this._jump(this.peekFinallyBlock().blk));break;case Sk.astnodes.Delete:this.vseqexpr(t.targets);break;case Sk.astnodes.Assign:var i=t.targets.length;for(n=this.vexpr(t.value),e=0;e"!==t.name.v){var e=t.name.$r().v;e=e.substring(1,e.length-1),o(t.scopename,".co_name=new Sk.builtins['str']('",e,"');"),this.stack.length&&"class"==this.u.ste.blockType&&o(t.scopename,".co_qualname=new Sk.builtins['str']('"+this.u.name.v+"."+e+"');")}for(var n in t.consts)t.consts.hasOwnProperty(n)&&(t.suffixCode+=n+" = "+t.consts[n]+";")},n.prototype.cbody=function(t,e){var n=0;const i=this.maybeCDocstringOfBody(t);for(null!==i&&(o("$loc.__doc__ = ",i,";"),n=1);n"),t,0,this.canSuspend),n=this.newBlock("module entry");if(this.u.prefixCode="var "+e+"=(function($forcegbl, $forceloc){",this.u.varDeclsCode="var $gbl = $forcegbl || {}, $blk="+n+",$exc=[],$loc=$forceloc || $gbl,$cell={},$err=undefined;var $ret=undefined,$postfinally=undefined,$currLineNo=undefined,$currColNo=undefined;",null!==Sk.execLimit&&(this.u.varDeclsCode+="if (typeof Sk.execStart === 'undefined') {Sk.execStart = Date.now()}"),null!==Sk.yieldLimit&&this.u.canSuspend&&(this.u.varDeclsCode+="if (typeof Sk.lastYield === 'undefined') {Sk.lastYield = Date.now()}"),this.u.varDeclsCode+="var $waking=false; if ("+e+".$wakingSuspension!==undefined) { $wakeFromSuspension(); $waking=true; }if (Sk.retainGlobals) { if (Sk.globals) { $gbl = Sk.globals; Sk.globals = $gbl; $loc = $gbl; } else { Sk.globals = $gbl; }} else { Sk.globals = $gbl; }",this.u.switchCode="while(true){try{",this.u.switchCode+=this.outputInterruptTest(),this.u.switchCode+="switch($blk){",this.u.suffixCode="}",this.u.suffixCode+="}catch(err){ if (!(err instanceof Sk.builtin.BaseException)) { err = new Sk.builtin.ExternalError(err); } err.traceback.push({lineno: $currLineNo, colno: $currColNo, filename: '"+this.filename+"'}); if ($exc.length>0) { $err = err; $blk=$exc.pop(); continue; } else { throw err; }} } });",t.constructor===Sk.astnodes.Module)this.cbody(t.body),o("return $loc;");else Sk.asserts.fail("todo; unhandled case in compilerMod");return this.exitScope(),this.result.push(this.outputAllUnits()),e},Sk.compile=function(t,e,i,s){i=Sk.__future__,Sk.__future__=Object.create(Sk.__future__);var r=Sk.parse(e,t),o=Sk.astFromParse(r.cst,e,r.flags);return r=r.flags,s=(t=new n(e,Sk.symboltable(o,e),r,s,t)).cmod(o),Sk.__future__=i,{funcname:"$compiledmod",code:`var $compiledmod = function() {${t.result.join("")}\nreturn ${s};}();\n$compiledmod;`,filename:e}},Sk.exportSymbol("Sk.compile",Sk.compile),Sk.resetCompiler=function(){Sk.gensymcount=0},Sk.exportSymbol("Sk.resetCompiler",Sk.resetCompiler),Sk.fixReserved=s,Sk.exportSymbol("Sk.fixReserved",Sk.fixReserved),Sk.unfixReserved=function(t){return t.replace(/_\$rw\$$/,"")},Sk.exportSymbol("Sk.unfixReserved",Sk.unfixReserved),Sk.mangleName=r,Sk.exportSymbol("Sk.mangleName",Sk.mangleName),Sk.reservedWords_=a,Sk.exportSymbol("Sk.reservedWords_",Sk.reservedWords_)},function(t,e){Sk.sysmodules=new Sk.builtin.dict([]),Sk.realsyspath=void 0,Sk.importSearchPathForName=function(t,e,n){var i=t.replace(/\./g,"/"),s=function(t,e){return Sk.misceval.chain(Sk.misceval.tryCatch((function(){return Sk.read(t)}),(function(t){})),(function(n){if(void 0!==n)return new Sk.misceval.Break({filename:t,code:n,packagePath:e})}))};return void 0===n&&(n=Sk.realsyspath),Sk.misceval.iterFor(n.tp$iter(),(function(t){return Sk.misceval.chain(s(t.v+"/"+i+e,!1),(function(n){return n||s(t.v+"/"+i+"/__init__"+e,t.v+"/"+i)}))}))},Sk.importSetUpPath=function(t){if(!Sk.realsyspath){var e=[new Sk.builtin.str("src/builtin"),new Sk.builtin.str("src/lib"),new Sk.builtin.str(".")];for(t=0;ti;++i)t+=" ";n[e-1]="/* "+t+e+" */ "+n[e-1]}return n.join("\n")}(r),Sk.debugout(r)}"$compiledmod"!==i.funcname&&(r+="\n"+i.funcname+";");var o=new Sk.builtin.str(n),l=new Sk.builtin.str(t);Sk.sysmodules.mp$ass_subscript(o,c),s&&s.tp$setattr(l,c);var u=Sk.global.eval(r);c.init$dict(o,Sk.builtin.none.none$),c.$d.__package__=i.packagePath?o:m?new Sk.builtin.str(_+m):h||Sk.builtin.none.none$,i.packagePath&&(c.$d.__path__=new Sk.builtin.tuple([new Sk.builtin.str(i.packagePath)])),i.filename&&"$builtinmodule"!==i.funcname&&(c.$d.__file__=new Sk.builtin.str(i.filename));var p=s&&s.$initializing;return c.$initializing=!0,s&&!p&&(s.$initializing=!0),Sk.misceval.tryCatch((()=>Sk.misceval.chain(u(c.$d),(t=>(c.$initializing=!1,s&&!p&&(s.$initializing=!1),t)))),(t=>{try{Sk.abstr.objectDelItem(Sk.sysmodules,o)}catch(t){}if(s)try{s.tp$setattr(l,void 0)}catch(t){}throw c.$initializing=!1,s&&!p&&(s.$initializing=!1),t}))}}),(function(e){var n;if(void 0===e){if(r&&!p)return;throw new Sk.builtin.ModuleNotFoundError("No module named "+Sk.misceval.objectRepr(new Sk.builtin.str(t)))}if(e!==c.$d){for(n in c.$d)e[n]||(e[n]=c.$d[n]);c.$d=e}if(Sk.onAfterImport&&"function"==typeof Sk.onAfterImport)try{Sk.onAfterImport(t)}catch(t){}return p?(u.tp$setattr(new Sk.builtin.str(f[f.length-1]),c),p):c}))}));return o?g:Sk.misceval.retryOptionalSuspensionOrThrow(g)},Sk.importModule=function(t,e,n){return Sk.importModuleInternal_(t,e,void 0,void 0,void 0,!1,n)},Sk.importMain=function(t,e,n){return Sk.dateSet=!1,Sk.filesLoaded=!1,Sk.sysmodules=new Sk.builtin.dict([]),Sk.realsyspath=void 0,Sk.resetCompiler(),Sk.importModuleInternal_(t,e,"__main__",void 0,void 0,!1,n)},Sk.importMainWithBody=function(t,e,n,i){return Sk.dateSet=!1,Sk.filesLoaded=!1,Sk.sysmodules=new Sk.builtin.dict([]),Sk.realsyspath=void 0,Sk.resetCompiler(),Sk.importModuleInternal_(t,e,"__main__",n,void 0,!1,i)},Sk.importBuiltinWithBody=function(t,e,n,i){return Sk.importModuleInternal_(t,e,"__builtin__."+t,n,void 0,!1,i)},Sk.builtin.__import__=function(t,e,n,i,s){t=t.toString();var r,o=Sk.globals;if(null==s&&(s=Sk.__future__.absolute_import?0:-1),0!==s&&e.__package__&&e.__package__!==Sk.builtin.none.none$){if((r=e.__package__.v)&&0=e.length)throw new Sk.builtin.ImportError("Attempted relative import beyond toplevel package");e.length-=s-1,r=e.join(".")}var a=Sk.sysmodules.quick$lookup(new Sk.builtin.str(r))}if(0Sk.importModuleInternal_(s,void 0,void 0,void 0,n,!0,!0)))}return Sk.misceval.chain(...e,(function(){return Sk.asserts.assert(n),n}))}return e}),(function(t){return o!==Sk.globals&&(Sk.globals=o),t}))},Sk.importStar=function(t,e,n){if(n=t.tp$getattr(new Sk.builtin.str("__all__")))for(let i=Sk.abstr.iter(n),s=i.tp$iternext();void 0!==s;s=i.tp$iternext())e[s.v]=Sk.abstr.gattr(t,s);else{n=Object.getOwnPropertyNames(t.$d);for(let i in n)"_"!=n[i].charAt(0)&&(e[n[i]]=t.$d[n[i]])}},Sk.exportSymbol("Sk.importMain",Sk.importMain),Sk.exportSymbol("Sk.importMainWithBody",Sk.importMainWithBody),Sk.exportSymbol("Sk.importBuiltinWithBody",Sk.importBuiltinWithBody),Sk.exportSymbol("Sk.builtin.__import__",Sk.builtin.__import__),Sk.exportSymbol("Sk.importStar",Sk.importStar)},function(t,e){Sk.builtin.timSort=function(t,e){this.list=new Sk.builtin.list(t.v),this.MIN_GALLOP=7,this.listlength=e||t.sq$length()},Sk.builtin.timSort.prototype.lt=function(t,e){return Sk.misceval.richCompareBool(t,e,"Lt")},Sk.builtin.timSort.prototype.le=function(t,e){return!this.lt(e,t)},Sk.builtin.timSort.prototype.setitem=function(t,e){this.list.v[t]=e},Sk.builtin.timSort.prototype.binary_sort=function(t,e){var n;for(n=t.base+e;n>1);this.lt(e,t.getitem(r))?s=r:i=r+1}for(Sk.asserts.assert(i===s),r=n;r>i;r--)t.setitem(r,t.getitem(r-1));t.setitem(i,e)}},Sk.builtin.timSort.prototype.count_run=function(t){var e;if(1>=t.len)var n=t.len,i=!1;else if(n=2,this.lt(t.getitem(t.base+1),t.getitem(t.base)))for(i=!0,e=t.base+2;ee.len)){for(this.merge_init(),t=this.merge_compute_minrun(e.len);0s&&(l=s),a+=n,l+=n}else{for(s=n+1;ls&&(l=s),o=n-a,a=n-l,l=o}for(Sk.asserts.assert(-1<=a>1),i(e.getitem(e.base+n),t)?a=n+1:l=n;return Sk.asserts.assert(a==l),l},Sk.builtin.timSort.prototype.merge_init=function(){this.min_gallop=this.MIN_GALLOP,this.pending=[]},Sk.builtin.timSort.prototype.merge_lo=function(t,e){var n,i,s;Sk.asserts.assert(0=r)break}else{if(this.setitem(o,t.popleft()),o++,1==t.len)return;if(i=0,++n>=r)break}for(r+=1;;){for(this.min_gallop=r-=1=t.len)return;if(this.setitem(o,e.popleft()),o++,0===e.len)return;for(i=this.gallop(t.getitem(t.base),e,0,!1),s=e.base;s=r)break}else{if(o--,this.setitem(o,l),e.len--,1==e.len)return;if(n=0,++i>=r)break}}for(r+=1;;){this.min_gallop=r-=1t.base+u-1;s--)o--,this.setitem(o,t.getitem(s));if(t.len-=n,0===t.len)return;if(o--,this.setitem(o,e.popright()),1==e.len)return;for(a=t.getitem(t.base+t.len-1),u=this.gallop(a,e,e.len-1,!1),i=e.len-u,s=e.base+e.len-1;s>e.base+u-1;s--)o--,this.setitem(o,e.getitem(s));if(e.len-=i,1>=e.len)return;if(o--,this.setitem(o,t.popright()),0===t.len)return;if(nt.base-1;s--)o--,this.setitem(o,t.getitem(s));for(s=e.base+e.len-1;s>e.base-1;s--)o--,this.setitem(o,e.getitem(s))}},Sk.builtin.timSort.prototype.merge_at=function(t){0>t&&(t=this.pending.length+t);var e=this.pending[t],n=this.pending[t+1];Sk.asserts.assert(0>=1;return t+e},Sk.builtin.listSlice=function(t,e,n){this.list=t,this.base=e,this.len=n},Sk.builtin.listSlice.prototype.copyitems=function(){var t=this.base,e=this.base+this.len;return Sk.asserts.assert(0<=t<=e),new Sk.builtin.listSlice(new Sk.builtin.list(this.list.v.slice(t,e)),0,this.len)},Sk.builtin.listSlice.prototype.advance=function(t){this.base+=t,this.len-=t,Sk.asserts.assert(this.base<=this.list.sq$length())},Sk.builtin.listSlice.prototype.getitem=function(t){return this.list.v[t]},Sk.builtin.listSlice.prototype.setitem=function(t,e){this.list.v[t]=e},Sk.builtin.listSlice.prototype.popleft=function(){var t=this.list.v[this.base];return this.base++,this.len--,t},Sk.builtin.listSlice.prototype.popright=function(){return this.len--,this.list.v[this.base+this.len]},Sk.builtin.listSlice.prototype.reverse=function(){for(var t,e,n=this.list,i=this.base,s=i+this.len-1;i same as super(__class__, )\nsuper(type) -> unbound super object\nsuper(type, obj) -> bound super object; requires isinstance(obj, type)\nsuper(type, type2) -> bound super object; requires issubclass(type2, type)\nTypical use to call a cooperative superclass method:\nclass C(B):\n def meth(self, arg):\n super().meth(arg)\nThis works for class methods too:\nclass C(B):\n @classmethod\n def cmeth(cls, arg):\n super().cmeth(arg)\n",tp$new:Sk.generic.new,tp$init(t,e){if(Sk.abstr.checkNoKwargs("super",e),Sk.abstr.checkArgsLen("super",t,1,2),e=t[0],t=t[1],!Sk.builtin.checkClass(e))throw new Sk.builtin.TypeError("must be type, not "+Sk.abstr.typeName(e));this.obj=t,this.type=e,null!=this.obj&&(this.obj_type=this.$supercheck(e,this.obj))},$r(){return this.obj?new Sk.builtin.str(", <"+Sk.abstr.typeName(this.obj)+" object>>"):new Sk.builtin.str(", NULL>")},tp$getattr(t,e){let n=this.obj_type;if(null==n)return Sk.generic.getAttr.call(this,t,e);var i=n.prototype.tp$mro;const s=i.length;if(t===Sk.builtin.str.$class)return Sk.generic.getAttr.call(this,t,e);let r,o;for(r=0;r+1=s)return Sk.generic.getAttr.call(this,t,e);for(t=t.$mangled;r(Sk.abstr.checkNoKwargs("GenericAlias",e),Sk.abstr.checkArgsLen("GenericAlias",t,2,2),new Sk.builtin.GenericAlias(t[0],t[1])),tp$getattr(t,e){return Sk.builtin.checkString(t)&&!this.attr$exc.includes(t)?this.$origin.tp$getattr(t,e):Sk.generic.getAttr.call(this,t,e)},$r(){const t=this.ga$repr(this.$origin);let e="";return this.$args.v.forEach(((t,n)=>{e+=0{this.is$typevar(e)&&0>this.tuple$index(t,e)&&t.push(e)})),this.$params=new Sk.builtin.tuple(t)},tuple$index:(t,e)=>t.indexOf(e),is$typevar(t){if("TypeVar"!==t.tp$name)return!1;if(void 0===(t=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$module)))throw Sk.builtin.RuntimeError("found object withought a __module__");return"typing"===t.toString()},ga$repr(t){if(t===Sk.builtin.Ellipsis)return"...";if(Sk.abstr.lookupSpecial(t,this.str$orig)&&Sk.abstr.lookupSpecial(t,this.str$args))return Sk.misceval.objectRepr(t);const e=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$qualname);if(void 0===e)return Sk.misceval.objectRepr(t);const n=Sk.abstr.lookupSpecial(t,Sk.builtin.str.$module);return void 0===n||Sk.builtin.checkNone(n)?Sk.misceval.objectRepr(t):"builtins"===n.toString()?e.toString():n.toString()+"."+e.toString()},str$orig:new Sk.builtin.str("__origin__"),str$args:new Sk.builtin.str("__args__"),attr$exc:"__origin__ __args__ __parameters__ __mro_entries__ __reduce_ex__ __reduce__".split(" ").map((t=>new Sk.builtin.str(t)))}})},function(t,e){function n(t,e){let n;if(void 0===t||Sk.builtin.checkNone(t))t=void 0;else{if(!(t instanceof Sk.builtin.dict))throw new Sk.builtin.TypeError(e+" must be a dict or None, not "+Sk.abstr.typeName(t));n={},t.$items().forEach((t=>{var[e,i]=t;Sk.builtin.checkString(e)&&(n[e.$mangled]=i)}))}return n}function i(t,e){if(void 0!==t&&!Sk.builtin.checkNone(t))for(let n in e)t.mp$ass_subscript(new Sk.builtin.str(Sk.unfixReserved(n)),e[n])}Sk.builtins={round:null,len:null,min:null,max:null,sum:null,abs:null,fabs:null,ord:null,chr:null,hex:null,oct:null,bin:null,dir:null,repr:null,open:null,isinstance:null,hash:null,getattr:null,hasattr:null,id:null,sorted:null,any:null,all:null,enumerate:Sk.builtin.enumerate,filter:Sk.builtin.filter_,map:Sk.builtin.map_,range:Sk.builtin.range_,reversed:Sk.builtin.reversed,zip:Sk.builtin.zip_,BaseException:Sk.builtin.BaseException,AttributeError:Sk.builtin.AttributeError,ValueError:Sk.builtin.ValueError,Exception:Sk.builtin.Exception,ZeroDivisionError:Sk.builtin.ZeroDivisionError,AssertionError:Sk.builtin.AssertionError,ImportError:Sk.builtin.ImportError,ModuleNotFoundError:Sk.builtin.ModuleNotFoundError,IndentationError:Sk.builtin.IndentationError,IndexError:Sk.builtin.IndexError,LookupError:Sk.builtin.LookupError,KeyError:Sk.builtin.KeyError,TypeError:Sk.builtin.TypeError,UnicodeDecodeError:Sk.builtin.UnicodeDecodeError,UnicodeEncodeError:Sk.builtin.UnicodeEncodeError,NameError:Sk.builtin.NameError,UnboundLocalError:Sk.builtin.UnboundLocalError,IOError:Sk.builtin.IOError,NotImplementedError:Sk.builtin.NotImplementedError,SystemExit:Sk.builtin.SystemExit,OverflowError:Sk.builtin.OverflowError,OperationError:Sk.builtin.OperationError,NegativePowerError:Sk.builtin.NegativePowerError,RuntimeError:Sk.builtin.RuntimeError,RecursionError:Sk.builtin.RecursionError,StopIteration:Sk.builtin.StopIteration,SyntaxError:Sk.builtin.SyntaxError,SystemError:Sk.builtin.SystemError,KeyboardInterrupt:Sk.builtin.KeyboardInterrupt,float_$rw$:Sk.builtin.float_,int_$rw$:Sk.builtin.int_,bool:Sk.builtin.bool,complex:Sk.builtin.complex,dict:Sk.builtin.dict,file:Sk.builtin.file,frozenset:Sk.builtin.frozenset,function:Sk.builtin.func,generator:Sk.builtin.generator,list:Sk.builtin.list,long_$rw$:Sk.builtin.lng,method:Sk.builtin.method,object:Sk.builtin.object,slice:Sk.builtin.slice,str:Sk.builtin.str,set:Sk.builtin.set,tuple:Sk.builtin.tuple,type:Sk.builtin.type,input:null,raw_input:new Sk.builtin.func(Sk.builtin.raw_input),setattr:null,jseval:Sk.builtin.jseval,jsmillis:Sk.builtin.jsmillis,quit:new Sk.builtin.func(Sk.builtin.quit),exit:new Sk.builtin.func(Sk.builtin.quit),print:null,divmod:null,format:null,globals:null,issubclass:null,iter:null,execfile:Sk.builtin.execfile,help:Sk.builtin.help,memoryview:Sk.builtin.memoryview,reload:Sk.builtin.reload,super_$rw$:Sk.builtin.super_,unichr:new Sk.builtin.func(Sk.builtin.unichr),vars:Sk.builtin.vars,apply_$rw$:Sk.builtin.apply_,buffer:Sk.builtin.buffer,coerce:Sk.builtin.coerce,intern:Sk.builtin.intern,property:Sk.builtin.property,classmethod:Sk.builtin.classmethod,staticmethod:Sk.builtin.staticmethod,Ellipsis:Sk.builtin.Ellipsis},t=Sk.builtin.none.none$,e=new Sk.builtin.tuple;const s=new Sk.builtin.int_(0);Sk.abstr.setUpModuleMethods("builtins",Sk.builtins,{__import__:{$meth(t,e,i,s,r){if(!Sk.builtin.checkString(t))throw new Sk.builtin.TypeError("__import__() argument 1 must be str, not "+t.tp$name);if(t===Sk.builtin.str.$empty&&0===r.v)throw new Sk.builtin.ValueError("Empty module name");return e=n(e,"globals")||{},s=Sk.ffi.remapToJs(s),r=Sk.ffi.remapToJs(r),Sk.builtin.__import__(t,e,void 0,s,r)},$flags:{NamedArgs:["name","globals","locals","fromlist","level"],Defaults:[t,t,e,s]},$textsig:null,$doc:"__import__(name, globals=None, locals=None, fromlist=(), level=0) -> module\n\nImport a module. Because this function is meant for use by the Python\ninterpreter and not for general use, it is better to use\nimportlib.import_module() to programmatically import a module.\n\nThe globals argument is only used to determine the context;\nthey are not modified. The locals argument is unused. The fromlist\nshould be a list of names to emulate ``from name import ...'', or an\nempty list to emulate ``import name''.\nWhen importing a module from a package, note that __import__('A.B', ...)\nreturns package A when fromlist is empty, but its submodule B when\nfromlist is not empty. The level argument is used to determine whether to\nperform absolute or relative imports: 0 is absolute, while a positive number\nis the number of parent directories to search relative to the current module."},abs:{$meth:Sk.builtin.abs,$flags:{OneArg:!0},$textsig:"($module, x, /)",$doc:"Return the absolute value of the argument."},all:{$meth:Sk.builtin.all,$flags:{OneArg:!0},$textsig:"($module, iterable, /)",$doc:"Return True if bool(x) is True for all values x in the iterable.\n\nIf the iterable is empty, return True."},any:{$meth:Sk.builtin.any,$flags:{OneArg:!0},$textsig:"($module, iterable, /)",$doc:"Return True if bool(x) is True for any x in the iterable.\n\nIf the iterable is empty, return False."},ascii:{$meth:Sk.builtin.ascii,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return an ASCII-only representation of an object.\n\nAs repr(), return a string containing a printable representation of an\nobject, but escape the non-ASCII characters in the string returned by\nrepr() using \\\\x, \\\\u or \\\\U escapes. This generates a string similar\nto that returned by repr() in Python 2."},bin:{$meth:Sk.builtin.bin,$flags:{OneArg:!0},$textsig:"($module, number, /)",$doc:"Return the binary representation of an integer.\n\n >>> bin(2796202)\n '0b1010101010101010101010'"},callable:{$meth:Sk.builtin.callable,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return whether the object is callable (i.e., some kind of function).\n\nNote that classes are callable, as are instances of classes with a\n__call__() method."},chr:{$meth:Sk.builtin.chr,$flags:{OneArg:!0},$textsig:"($module, i, /)",$doc:"Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."},compile:{$meth:Sk.builtin.compile,$flags:{MinArgs:3,MaxArgs:6},$textsig:"($module, /, source, filename, mode, flags=0,\n dont_inherit=False, optimize=-1)",$doc:"Compile source into a code object that can be executed by exec() or eval().\n\nThe source code may represent a Python module, statement or expression.\nThe filename will be used for run-time error messages.\nThe mode must be 'exec' to compile a module, 'single' to compile a\nsingle (interactive) statement, or 'eval' to compile an expression.\nThe flags argument, if present, controls which future statements influence\nthe compilation of the code.\nThe dont_inherit argument, if true, stops the compilation inheriting\nthe effects of any future statements in effect in the code calling\ncompile; if absent or false these statements do influence the compilation,\nin addition to any features explicitly specified."},delattr:{$meth:Sk.builtin.delattr,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, obj, name, /)",$doc:"Deletes the named attribute from the given object.\n\ndelattr(x, 'y') is equivalent to ``del x.y''"},dir:{$meth:Sk.builtin.dir,$flags:{MinArgs:0,MaxArgs:1},$textsig:null,$doc:"dir([object]) -> list of strings\n\nIf called without an argument, return the names in the current scope.\nElse, return an alphabetized list of names comprising (some of) the attributes\nof the given object, and of attributes reachable from it.\nIf the object supplies a method named __dir__, it will be used; otherwise\nthe default dir() logic is used and returns:\n for a module object: the module's attributes.\n for a class object: its attributes, and recursively the attributes\n of its bases.\n for any other object: its attributes, its class's attributes, and\n recursively the attributes of its class's base classes."},divmod:{$meth:Sk.builtin.divmod,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, x, y, /)",$doc:"Return the tuple (x//y, x%y). Invariant: div*y + mod == x."},eval_$rw$:{$name:"eval",$meth:function(t,e,s){const r=n(e,"globals"),o=n(s,"locals");return Sk.misceval.chain(Sk.builtin.eval(t,r,o),(t=>(i(e,r),i(s,o),t)))},$flags:{MinArgs:1,MaxArgs:3},$textsig:"($module, source, globals=None, locals=None, /)",$doc:"Evaluate the given source in the context of globals and locals.\n\nThe source may be a string representing a Python expression\nor a code object as returned by compile().\nThe globals must be a dictionary and locals can be any mapping,\ndefaulting to the current globals and locals.\nIf only globals is given, locals defaults to it."},exec:{$meth:function(t,e,s){const r=n(e,"globals"),o=n(s,"locals");return Sk.misceval.chain(Sk.builtin.exec(t,r,o),(t=>(i(e,r),i(s,o),Sk.builtin.none.none$)))},$flags:{MinArgs:1,MaxArgs:3},$textsig:"($module, source, globals=None, locals=None, /)",$doc:"Execute the given source in the context of globals and locals.\n\nThe source may be a string representing one or more Python statements\nor a code object as returned by compile().\nThe globals must be a dictionary and locals can be any mapping,\ndefaulting to the current globals and locals.\nIf only globals is given, locals defaults to it."},format:{$meth:Sk.builtin.format,$flags:{MinArgs:1,MaxArgs:2},$textsig:"($module, value, format_spec='', /)",$doc:"Return value.__format__(format_spec)\n\nformat_spec defaults to the empty string.\nSee the Format Specification Mini-Language section of help('FORMATTING') for\ndetails."},getattr:{$meth:Sk.builtin.getattr,$flags:{MinArgs:2,MaxArgs:3},$textsig:null,$doc:"getattr(object, name[, default]) -> value\n\nGet a named attribute from an object; getattr(x, 'y') is equivalent to x.y.\nWhen a default argument is given, it is returned when the attribute doesn't\nexist; without it, an exception is raised in that case."},globals:{$meth:Sk.builtin.globals,$flags:{NoArgs:!0},$textsig:"($module, /)",$doc:"Return the dictionary containing the current scope's global variables.\n\nNOTE: Updates to this dictionary *will* affect name lookups in the current\nglobal scope and vice-versa."},hasattr:{$meth:Sk.builtin.hasattr,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, obj, name, /)",$doc:"Return whether the object has an attribute with the given name.\n\nThis is done by calling getattr(obj, name) and catching AttributeError."},hash:{$meth:Sk.builtin.hash,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return the hash value for the given object.\n\nTwo objects that compare equal must also have the same hash value, but the\nreverse is not necessarily true."},hex:{$meth:Sk.builtin.hex,$flags:{OneArg:!0},$textsig:"($module, number, /)",$doc:"Return the hexadecimal representation of an integer.\n\n >>> hex(12648430)\n '0xc0ffee'"},id:{$meth:Sk.builtin.id,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return the identity of an object.\n\nThis is guaranteed to be unique among simultaneously existing objects.\n(CPython uses the object's memory address.)"},input:{$meth:Sk.builtin.input,$flags:{MinArgs:0,MaxArgs:1},$textsig:"($module, prompt=None, /)",$doc:"Read a string from standard input. The trailing newline is stripped.\n\nThe prompt string, if given, is printed to standard output without a\ntrailing newline before reading input.\n\nIf the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError.\nOn *nix systems, readline is used if available."},isinstance:{$meth:Sk.builtin.isinstance,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, obj, class_or_tuple, /)",$doc:"Return whether an object is an instance of a class or of a subclass thereof.\n\nA tuple, as in ``isinstance(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``isinstance(x, A) or isinstance(x, B)\nor ...`` etc."},issubclass:{$meth:Sk.builtin.issubclass,$flags:{MinArgs:2,MaxArgs:2},$textsig:"($module, cls, class_or_tuple, /)",$doc:"Return whether 'cls' is a derived from another class or is the same class.\n\nA tuple, as in ``issubclass(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``issubclass(x, A) or issubclass(x, B)\nor ...`` etc."},iter:{$meth:Sk.builtin.iter,$flags:{MinArgs:1,MaxArgs:2},$textsig:"($module, iterable /)",$doc:"iter(iterable) -> iterator\niter(callable, sentinel) -> iterator\n\nGet an iterator from an object. In the first form, the argument must\nsupply its own iterator, or be a sequence.\nIn the second form, the callable is called until it returns the sentinel."},len:{$meth:Sk.builtin.len,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return the number of items in a container."},locals:{$meth:Sk.builtin.locals,$flags:{NoArgs:!0},$textsig:"($module, /)",$doc:"Return a dictionary containing the current scope's local variables.\n\nNOTE: Whether or not updates to this dictionary will affect name lookups in\nthe local scope and vice-versa is *implementation dependent* and not\ncovered by any backwards compatibility guarantees."},max:{$meth:Sk.builtin.max,$flags:{FastCall:!0},$textsig:null,$doc:"max(iterable, *[, default=obj, key=func]) -> value\nmax(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its biggest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the largest argument."},min:{$meth:Sk.builtin.min,$flags:{FastCall:!0},$textsig:null,$doc:"min(iterable, *[, default=obj, key=func]) -> value\nmin(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its smallest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the smallest argument."},next:{$name:"next",$meth:Sk.builtin.next_,$flags:{MinArgs:1,MaxArgs:2},$textsig:null,$doc:"next(iterator[, default])\n\nReturn the next item from the iterator. If default is given and the iterator\nis exhausted, it is returned instead of raising StopIteration."},oct:{$meth:Sk.builtin.oct,$flags:{OneArg:!0},$textsig:"($module, number, /)",$doc:"Return the octal representation of an integer.\n\n >>> oct(342391)\n '0o1234567'"},open:{$meth:Sk.builtin.open,$flags:{MinArgs:1,MaxArgs:3},$textsig:null,$doc:"open(name[, mode[, buffering]]) -> file object\n\nOpen a file using the file() type, returns a file object. This is the\npreferred way to open a file. See file.__doc__ for further information."},ord:{$meth:Sk.builtin.ord,$flags:{OneArg:!0},$textsig:"($module, c, /)",$doc:"Return the Unicode code point for a one-character string."},pow:{$meth:Sk.builtin.pow,$flags:{MinArgs:2,MaxArgs:3},$textsig:"($module, x, y, z=None, /)",$doc:"Equivalent to x**y (with two arguments) or x**y % z (with three arguments)\n\nSome types, such as ints, are able to use a more efficient algorithm when\ninvoked using the three argument form."},print:{$meth:Sk.builtin.print,$flags:{FastCall:!0},$textsig:null,$doc:"print(value, ..., sep=' ', end='\\n', file=sys.stdout, flush=False)\n\nPrints the values to a stream, or to sys.stdout by default.\nOptional keyword arguments:\nfile: a file-like object (stream); defaults to the current sys.stdout.\nsep: string inserted between values, default a space.\nend: string appended after the last value, default a newline.\nflush: whether to forcibly flush the stream."},repr:{$meth:Sk.builtin.repr,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return the canonical string representation of the object.\n\nFor many object types, including most builtins, eval(repr(obj)) == obj."},round:{$meth:Sk.builtin.round,$flags:{NamedArgs:["number","ndigits"]},$textsig:"($module, /, number, ndigits=None)",$doc:"Round a number to a given precision in decimal digits.\n\nThe return value is an integer if ndigits is omitted or None. Otherwise\nthe return value has the same type as the number. ndigits may be negative."},setattr:{$meth:Sk.builtin.setattr,$flags:{MinArgs:3,MaxArgs:3},$textsig:"($module, obj, name, value, /)",$doc:"Sets the named attribute on the given object to the specified value.\n\nsetattr(x, 'y', v) is equivalent to ``x.y = v''"},sorted:{$meth:Sk.builtin.sorted,$flags:{NamedArgs:[null,"cmp","key","reverse"],Defaults:[Sk.builtin.none.none$,Sk.builtin.none.none$,Sk.builtin.bool.false$]},$textsig:"($module, iterable, /, *, key=None, reverse=False)",$doc:"Return a new list containing all items from the iterable in ascending order.\n\nA custom key function can be supplied to customize the sort order, and the\nreverse flag can be set to request the result in descending order."},sum:{$meth:Sk.builtin.sum,$flags:{NamedArgs:[null,"start"],Defaults:[new Sk.builtin.int_(0)]},$textsig:"($module, iterable, /, start=0)",$doc:"Return the sum of a 'start' value (default: 0) plus an iterable of numbers\n\nWhen the iterable is empty, return the start value.\nThis function is intended specifically for use with numeric values and may\nreject non-numeric types."},vars:{$meth:Sk.builtin.vars,$flags:{MinArgs:0,MaxArgs:1},$textsig:null,$doc:"vars([object]) -> dictionary\n\nWithout arguments, equivalent to locals().\nWith an argument, equivalent to object.__dict__."}}),Sk.setupObjects=function(t){t?(Sk.builtins.filter=Sk.builtin.filter_,Sk.builtins.map=Sk.builtin.map_,Sk.builtins.zip=Sk.builtin.zip_,Sk.builtins.range=Sk.builtin.range_,delete Sk.builtins.reduce,delete Sk.builtins.xrange,delete Sk.builtins.StandardError,delete Sk.builtins.unicode,delete Sk.builtins.basestring,delete Sk.builtins.long_$rw$,Sk.builtin.int_.prototype.$r=function(){return new Sk.builtin.str(this.v.toString())},delete Sk.builtin.int_.prototype.tp$str,delete Sk.builtin.bool.prototype.tp$str,delete Sk.builtins.raw_input,delete Sk.builtins.unichr,delete Sk.builtin.str.prototype.decode,Sk.builtins.bytes=Sk.builtin.bytes,Sk.builtins.ascii=new Sk.builtin.sk_method({$meth:Sk.builtin.ascii,$flags:{OneArg:!0},$textsig:"($module, obj, /)",$doc:"Return an ASCII-only representation of an object.\n\nAs repr(), return a string containing a printable representation of an\nobject, but escape the non-ASCII characters in the string returned by\nrepr() using \\\\x, \\\\u or \\\\U escapes. This generates a string similar\nto that returned by repr() in Python 2."},null,"builtins")):(Sk.builtins.range=new Sk.builtin.sk_method({$meth:Sk.builtin.range,$name:"range",$flags:{MinArgs:1,MaxArgs:3}},void 0,"builtins"),Sk.builtins.xrange=new Sk.builtin.sk_method({$meth:Sk.builtin.xrange,$name:"xrange",$flags:{MinArgs:1,MaxArgs:3}},null,"builtins"),Sk.builtins.reduce=new Sk.builtin.sk_method({$meth:Sk.builtin.reduce,$name:"reduce",$flags:{MinArgs:2,MaxArgs:3}},null,"builtins"),Sk.builtins.filter=new Sk.builtin.func(Sk.builtin.filter),Sk.builtins.map=new Sk.builtin.func(Sk.builtin.map),Sk.builtins.zip=new Sk.builtin.func(Sk.builtin.zip),Sk.builtins.StandardError=Sk.builtin.Exception,Sk.builtins.unicode=Sk.builtin.str,Sk.builtins.basestring=Sk.builtin.str,Sk.builtins.long_$rw$=Sk.builtin.lng,Sk.builtin.int_.prototype.$r=function(){const t=this.v;return"number"==typeof t?new Sk.builtin.str(t.toString()):new Sk.builtin.str(t.toString()+"L")},Sk.builtin.int_.prototype.tp$str=function(){return new Sk.builtin.str(this.v.toString())},Sk.builtin.bool.prototype.tp$str=function(){return this.$r()},Sk.builtins.raw_input=new Sk.builtin.func(Sk.builtin.raw_input),Sk.builtins.unichr=new Sk.builtin.func(Sk.builtin.unichr),Sk.builtin.str.prototype.decode=Sk.builtin.str.$py2decode,delete Sk.builtins.bytes,delete Sk.builtins.ascii)},Sk.exportSymbol("Sk.setupObjects",Sk.setupObjects),Sk.exportSymbol("Sk.builtins",Sk.builtins)},function(t,e){Sk.builtin.str.$empty=new Sk.builtin.str(""),Sk.builtin.str.$emptystr=Sk.builtin.str.$empty,Sk.builtin.str.$utf8=new Sk.builtin.str("utf-8"),Sk.builtin.str.$ascii=new Sk.builtin.str("ascii"),Sk.builtin.str.$default_factory=new Sk.builtin.str("default_factory"),Sk.builtin.str.$imag=new Sk.builtin.str("imag"),Sk.builtin.str.$real=new Sk.builtin.str("real"),Sk.builtin.str.$abs=new Sk.builtin.str("__abs__"),Sk.builtin.str.$bases=new Sk.builtin.str("__bases__"),Sk.builtin.str.$bytes=new Sk.builtin.str("__bytes__"),Sk.builtin.str.$call=new Sk.builtin.str("__call__"),Sk.builtin.str.$class=new Sk.builtin.str("__class__"),Sk.builtin.str.$class_getitem=new Sk.builtin.str("__class_getitem__"),Sk.builtin.str.$cmp=new Sk.builtin.str("__cmp__"),Sk.builtin.str.$complex=new Sk.builtin.str("__complex__"),Sk.builtin.str.$contains=new Sk.builtin.str("__contains__"),Sk.builtin.str.$copy=new Sk.builtin.str("__copy__"),Sk.builtin.str.$dict=new Sk.builtin.str("__dict__"),Sk.builtin.str.$dir=new Sk.builtin.str("__dir__"),Sk.builtin.str.$doc=new Sk.builtin.str("__doc__"),Sk.builtin.str.$enter=new Sk.builtin.str("__enter__"),Sk.builtin.str.$eq=new Sk.builtin.str("__eq__"),Sk.builtin.str.$exit=new Sk.builtin.str("__exit__"),Sk.builtin.str.$index=new Sk.builtin.str("__index__"),Sk.builtin.str.$init=new Sk.builtin.str("__init__"),Sk.builtin.str.$initsubclass=new Sk.builtin.str("__init_subclass__"),Sk.builtin.str.$int_=new Sk.builtin.str("__int__"),Sk.builtin.str.$iter=new Sk.builtin.str("__iter__"),Sk.builtin.str.$file=new Sk.builtin.str("__file__"),Sk.builtin.str.$float_=new Sk.builtin.str("__float__"),Sk.builtin.str.$format=new Sk.builtin.str("__format__"),Sk.builtin.str.$ge=new Sk.builtin.str("__ge__"),Sk.builtin.str.$getattr=new Sk.builtin.str("__getattr__"),Sk.builtin.str.$getattribute=new Sk.builtin.str("__getattribute__"),Sk.builtin.str.$getitem=new Sk.builtin.str("__getitem__"),Sk.builtin.str.$gt=new Sk.builtin.str("__gt__"),Sk.builtin.str.$keys=new Sk.builtin.str("keys"),Sk.builtin.str.$le=new Sk.builtin.str("__le__"),Sk.builtin.str.$len=new Sk.builtin.str("__len__"),Sk.builtin.str.$length_hint=new Sk.builtin.str("__length_hint__"),Sk.builtin.str.$loader=new Sk.builtin.str("__loader__"),Sk.builtin.str.$lt=new Sk.builtin.str("__lt__"),Sk.builtin.str.$module=new Sk.builtin.str("__module__"),Sk.builtin.str.$missing=new Sk.builtin.str("__missing__"),Sk.builtin.str.$name=new Sk.builtin.str("__name__"),Sk.builtin.str.$ne=new Sk.builtin.str("__ne__"),Sk.builtin.str.$new=new Sk.builtin.str("__new__"),Sk.builtin.str.$next=new Sk.builtin.str("__next__"),Sk.builtin.str.$path=new Sk.builtin.str("__path__"),Sk.builtin.str.$prepare=new Sk.builtin.str("__prepare__"),Sk.builtin.str.$qualname=new Sk.builtin.str("__qualname__"),Sk.builtin.str.$repr=new Sk.builtin.str("__repr__"),Sk.builtin.str.$reversed=new Sk.builtin.str("__reversed__"),Sk.builtin.str.$round=new Sk.builtin.str("__round__"),Sk.builtin.str.$setattr=new Sk.builtin.str("__setattr__"),Sk.builtin.str.$setitem=new Sk.builtin.str("__setitem__"),Sk.builtin.str.$slots=new Sk.builtin.str("__slots__"),Sk.builtin.str.$str=new Sk.builtin.str("__str__"),Sk.builtin.str.$setname=new Sk.builtin.str("__set_name__"),Sk.builtin.str.$trunc=new Sk.builtin.str("__trunc__"),Sk.builtin.str.$write=new Sk.builtin.str("write"),Sk.misceval.op2method_={Eq:Sk.builtin.str.$eq,NotEq:Sk.builtin.str.$ne,Gt:Sk.builtin.str.$gt,GtE:Sk.builtin.str.$ge,Lt:Sk.builtin.str.$lt,LtE:Sk.builtin.str.$le}},function(t,e,n){function i(t,e,n,i,s){this.type=t,this.string=e,this.start=n,this.end=i,this.line=s}function s(t){return"("+Array.prototype.slice.call(arguments).join("|")+")"}function r(t){return s.apply(null,arguments)+"?"}function o(t,e){for(var n=t.length;n--;)if(t[n]===e)return!0;return!1}function a(t){return t=t.normalize("NFKC"),E.test(t)}function l(){return" FR RF Br BR Fr r B R b bR f rb rB F Rf U rF u RB br fR fr rf Rb".split(" ")}function u(t){t?delete Sk.token.EXACT_TOKEN_TYPES["<>"]:Sk.token.EXACT_TOKEN_TYPES["<>"]=Sk.token.tokens.T_NOTEQUAL,I=Object.keys(Sk.token.EXACT_TOKEN_TYPES).sort(),A=s.apply(this,I.reverse().map((function(t){return t&&d.test(t)?t.replace(_,"\\$&"):t}))),O=s("\\r?\\n",A)}n.r(e),(t={Cc:"\\0-\\x1F\\x7F-\\x9F",Cf:"\\xAD\\u0600-\\u0605\\u061C\\u06DD\\u070F\\u08E2\\u180E\\u200B-\\u200F\\u202A-\\u202E\\u2060-\\u2064\\u2066-\\u206F\\uFEFF\\uFFF9-\\uFFFB",Co:"\\uE000-\\uF8FF",Cs:"\\uD800-\\uDFFF",Ll:"a-z\\xB5\\xDF-\\xF6\\xF8-\\xFF\\u0101\\u0103\\u0105\\u0107\\u0109\\u010B\\u010D\\u010F\\u0111\\u0113\\u0115\\u0117\\u0119\\u011B\\u011D\\u011F\\u0121\\u0123\\u0125\\u0127\\u0129\\u012B\\u012D\\u012F\\u0131\\u0133\\u0135\\u0137\\u0138\\u013A\\u013C\\u013E\\u0140\\u0142\\u0144\\u0146\\u0148\\u0149\\u014B\\u014D\\u014F\\u0151\\u0153\\u0155\\u0157\\u0159\\u015B\\u015D\\u015F\\u0161\\u0163\\u0165\\u0167\\u0169\\u016B\\u016D\\u016F\\u0171\\u0173\\u0175\\u0177\\u017A\\u017C\\u017E-\\u0180\\u0183\\u0185\\u0188\\u018C\\u018D\\u0192\\u0195\\u0199-\\u019B\\u019E\\u01A1\\u01A3\\u01A5\\u01A8\\u01AA\\u01AB\\u01AD\\u01B0\\u01B4\\u01B6\\u01B9\\u01BA\\u01BD-\\u01BF\\u01C6\\u01C9\\u01CC\\u01CE\\u01D0\\u01D2\\u01D4\\u01D6\\u01D8\\u01DA\\u01DC\\u01DD\\u01DF\\u01E1\\u01E3\\u01E5\\u01E7\\u01E9\\u01EB\\u01ED\\u01EF\\u01F0\\u01F3\\u01F5\\u01F9\\u01FB\\u01FD\\u01FF\\u0201\\u0203\\u0205\\u0207\\u0209\\u020B\\u020D\\u020F\\u0211\\u0213\\u0215\\u0217\\u0219\\u021B\\u021D\\u021F\\u0221\\u0223\\u0225\\u0227\\u0229\\u022B\\u022D\\u022F\\u0231\\u0233-\\u0239\\u023C\\u023F\\u0240\\u0242\\u0247\\u0249\\u024B\\u024D\\u024F-\\u0293\\u0295-\\u02AF\\u0371\\u0373\\u0377\\u037B-\\u037D\\u0390\\u03AC-\\u03CE\\u03D0\\u03D1\\u03D5-\\u03D7\\u03D9\\u03DB\\u03DD\\u03DF\\u03E1\\u03E3\\u03E5\\u03E7\\u03E9\\u03EB\\u03ED\\u03EF-\\u03F3\\u03F5\\u03F8\\u03FB\\u03FC\\u0430-\\u045F\\u0461\\u0463\\u0465\\u0467\\u0469\\u046B\\u046D\\u046F\\u0471\\u0473\\u0475\\u0477\\u0479\\u047B\\u047D\\u047F\\u0481\\u048B\\u048D\\u048F\\u0491\\u0493\\u0495\\u0497\\u0499\\u049B\\u049D\\u049F\\u04A1\\u04A3\\u04A5\\u04A7\\u04A9\\u04AB\\u04AD\\u04AF\\u04B1\\u04B3\\u04B5\\u04B7\\u04B9\\u04BB\\u04BD\\u04BF\\u04C2\\u04C4\\u04C6\\u04C8\\u04CA\\u04CC\\u04CE\\u04CF\\u04D1\\u04D3\\u04D5\\u04D7\\u04D9\\u04DB\\u04DD\\u04DF\\u04E1\\u04E3\\u04E5\\u04E7\\u04E9\\u04EB\\u04ED\\u04EF\\u04F1\\u04F3\\u04F5\\u04F7\\u04F9\\u04FB\\u04FD\\u04FF\\u0501\\u0503\\u0505\\u0507\\u0509\\u050B\\u050D\\u050F\\u0511\\u0513\\u0515\\u0517\\u0519\\u051B\\u051D\\u051F\\u0521\\u0523\\u0525\\u0527\\u0529\\u052B\\u052D\\u052F\\u0560-\\u0588\\u10D0-\\u10FA\\u10FD-\\u10FF\\u13F8-\\u13FD\\u1C80-\\u1C88\\u1D00-\\u1D2B\\u1D6B-\\u1D77\\u1D79-\\u1D9A\\u1E01\\u1E03\\u1E05\\u1E07\\u1E09\\u1E0B\\u1E0D\\u1E0F\\u1E11\\u1E13\\u1E15\\u1E17\\u1E19\\u1E1B\\u1E1D\\u1E1F\\u1E21\\u1E23\\u1E25\\u1E27\\u1E29\\u1E2B\\u1E2D\\u1E2F\\u1E31\\u1E33\\u1E35\\u1E37\\u1E39\\u1E3B\\u1E3D\\u1E3F\\u1E41\\u1E43\\u1E45\\u1E47\\u1E49\\u1E4B\\u1E4D\\u1E4F\\u1E51\\u1E53\\u1E55\\u1E57\\u1E59\\u1E5B\\u1E5D\\u1E5F\\u1E61\\u1E63\\u1E65\\u1E67\\u1E69\\u1E6B\\u1E6D\\u1E6F\\u1E71\\u1E73\\u1E75\\u1E77\\u1E79\\u1E7B\\u1E7D\\u1E7F\\u1E81\\u1E83\\u1E85\\u1E87\\u1E89\\u1E8B\\u1E8D\\u1E8F\\u1E91\\u1E93\\u1E95-\\u1E9D\\u1E9F\\u1EA1\\u1EA3\\u1EA5\\u1EA7\\u1EA9\\u1EAB\\u1EAD\\u1EAF\\u1EB1\\u1EB3\\u1EB5\\u1EB7\\u1EB9\\u1EBB\\u1EBD\\u1EBF\\u1EC1\\u1EC3\\u1EC5\\u1EC7\\u1EC9\\u1ECB\\u1ECD\\u1ECF\\u1ED1\\u1ED3\\u1ED5\\u1ED7\\u1ED9\\u1EDB\\u1EDD\\u1EDF\\u1EE1\\u1EE3\\u1EE5\\u1EE7\\u1EE9\\u1EEB\\u1EED\\u1EEF\\u1EF1\\u1EF3\\u1EF5\\u1EF7\\u1EF9\\u1EFB\\u1EFD\\u1EFF-\\u1F07\\u1F10-\\u1F15\\u1F20-\\u1F27\\u1F30-\\u1F37\\u1F40-\\u1F45\\u1F50-\\u1F57\\u1F60-\\u1F67\\u1F70-\\u1F7D\\u1F80-\\u1F87\\u1F90-\\u1F97\\u1FA0-\\u1FA7\\u1FB0-\\u1FB4\\u1FB6\\u1FB7\\u1FBE\\u1FC2-\\u1FC4\\u1FC6\\u1FC7\\u1FD0-\\u1FD3\\u1FD6\\u1FD7\\u1FE0-\\u1FE7\\u1FF2-\\u1FF4\\u1FF6\\u1FF7\\u210A\\u210E\\u210F\\u2113\\u212F\\u2134\\u2139\\u213C\\u213D\\u2146-\\u2149\\u214E\\u2184\\u2C30-\\u2C5E\\u2C61\\u2C65\\u2C66\\u2C68\\u2C6A\\u2C6C\\u2C71\\u2C73\\u2C74\\u2C76-\\u2C7B\\u2C81\\u2C83\\u2C85\\u2C87\\u2C89\\u2C8B\\u2C8D\\u2C8F\\u2C91\\u2C93\\u2C95\\u2C97\\u2C99\\u2C9B\\u2C9D\\u2C9F\\u2CA1\\u2CA3\\u2CA5\\u2CA7\\u2CA9\\u2CAB\\u2CAD\\u2CAF\\u2CB1\\u2CB3\\u2CB5\\u2CB7\\u2CB9\\u2CBB\\u2CBD\\u2CBF\\u2CC1\\u2CC3\\u2CC5\\u2CC7\\u2CC9\\u2CCB\\u2CCD\\u2CCF\\u2CD1\\u2CD3\\u2CD5\\u2CD7\\u2CD9\\u2CDB\\u2CDD\\u2CDF\\u2CE1\\u2CE3\\u2CE4\\u2CEC\\u2CEE\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\uA641\\uA643\\uA645\\uA647\\uA649\\uA64B\\uA64D\\uA64F\\uA651\\uA653\\uA655\\uA657\\uA659\\uA65B\\uA65D\\uA65F\\uA661\\uA663\\uA665\\uA667\\uA669\\uA66B\\uA66D\\uA681\\uA683\\uA685\\uA687\\uA689\\uA68B\\uA68D\\uA68F\\uA691\\uA693\\uA695\\uA697\\uA699\\uA69B\\uA723\\uA725\\uA727\\uA729\\uA72B\\uA72D\\uA72F-\\uA731\\uA733\\uA735\\uA737\\uA739\\uA73B\\uA73D\\uA73F\\uA741\\uA743\\uA745\\uA747\\uA749\\uA74B\\uA74D\\uA74F\\uA751\\uA753\\uA755\\uA757\\uA759\\uA75B\\uA75D\\uA75F\\uA761\\uA763\\uA765\\uA767\\uA769\\uA76B\\uA76D\\uA76F\\uA771-\\uA778\\uA77A\\uA77C\\uA77F\\uA781\\uA783\\uA785\\uA787\\uA78C\\uA78E\\uA791\\uA793-\\uA795\\uA797\\uA799\\uA79B\\uA79D\\uA79F\\uA7A1\\uA7A3\\uA7A5\\uA7A7\\uA7A9\\uA7AF\\uA7B5\\uA7B7\\uA7B9\\uA7BB\\uA7BD\\uA7BF\\uA7C3\\uA7C8\\uA7CA\\uA7F6\\uA7FA\\uAB30-\\uAB5A\\uAB60-\\uAB68\\uAB70-\\uABBF\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFF41-\\uFF5A",Lm:"\\u02B0-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0374\\u037A\\u0559\\u0640\\u06E5\\u06E6\\u07F4\\u07F5\\u07FA\\u081A\\u0824\\u0828\\u0971\\u0E46\\u0EC6\\u10FC\\u17D7\\u1843\\u1AA7\\u1C78-\\u1C7D\\u1D2C-\\u1D6A\\u1D78\\u1D9B-\\u1DBF\\u2071\\u207F\\u2090-\\u209C\\u2C7C\\u2C7D\\u2D6F\\u2E2F\\u3005\\u3031-\\u3035\\u303B\\u309D\\u309E\\u30FC-\\u30FE\\uA015\\uA4F8-\\uA4FD\\uA60C\\uA67F\\uA69C\\uA69D\\uA717-\\uA71F\\uA770\\uA788\\uA7F8\\uA7F9\\uA9CF\\uA9E6\\uAA70\\uAADD\\uAAF3\\uAAF4\\uAB5C-\\uAB5F\\uAB69\\uFF70\\uFF9E\\uFF9F",Lo:"\\xAA\\xBA\\u01BB\\u01C0-\\u01C3\\u0294\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u063F\\u0641-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u0800-\\u0815\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08C7\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0972-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E45\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u1100-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17DC\\u1820-\\u1842\\u1844-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C77\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u2135-\\u2138\\u2D30-\\u2D67\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3006\\u303C\\u3041-\\u3096\\u309F\\u30A1-\\u30FA\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\u9FFC\\uA000-\\uA014\\uA016-\\uA48C\\uA4D0-\\uA4F7\\uA500-\\uA60B\\uA610-\\uA61F\\uA62A\\uA62B\\uA66E\\uA6A0-\\uA6E5\\uA78F\\uA7F7\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9E0-\\uA9E4\\uA9E7-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA6F\\uAA71-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB\\uAADC\\uAAE0-\\uAAEA\\uAAF2\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF66-\\uFF6F\\uFF71-\\uFF9D\\uFFA0-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC",Lt:"\\u01C5\\u01C8\\u01CB\\u01F2\\u1F88-\\u1F8F\\u1F98-\\u1F9F\\u1FA8-\\u1FAF\\u1FBC\\u1FCC\\u1FFC",Lu:"A-Z\\xC0-\\xD6\\xD8-\\xDE\\u0100\\u0102\\u0104\\u0106\\u0108\\u010A\\u010C\\u010E\\u0110\\u0112\\u0114\\u0116\\u0118\\u011A\\u011C\\u011E\\u0120\\u0122\\u0124\\u0126\\u0128\\u012A\\u012C\\u012E\\u0130\\u0132\\u0134\\u0136\\u0139\\u013B\\u013D\\u013F\\u0141\\u0143\\u0145\\u0147\\u014A\\u014C\\u014E\\u0150\\u0152\\u0154\\u0156\\u0158\\u015A\\u015C\\u015E\\u0160\\u0162\\u0164\\u0166\\u0168\\u016A\\u016C\\u016E\\u0170\\u0172\\u0174\\u0176\\u0178\\u0179\\u017B\\u017D\\u0181\\u0182\\u0184\\u0186\\u0187\\u0189-\\u018B\\u018E-\\u0191\\u0193\\u0194\\u0196-\\u0198\\u019C\\u019D\\u019F\\u01A0\\u01A2\\u01A4\\u01A6\\u01A7\\u01A9\\u01AC\\u01AE\\u01AF\\u01B1-\\u01B3\\u01B5\\u01B7\\u01B8\\u01BC\\u01C4\\u01C7\\u01CA\\u01CD\\u01CF\\u01D1\\u01D3\\u01D5\\u01D7\\u01D9\\u01DB\\u01DE\\u01E0\\u01E2\\u01E4\\u01E6\\u01E8\\u01EA\\u01EC\\u01EE\\u01F1\\u01F4\\u01F6-\\u01F8\\u01FA\\u01FC\\u01FE\\u0200\\u0202\\u0204\\u0206\\u0208\\u020A\\u020C\\u020E\\u0210\\u0212\\u0214\\u0216\\u0218\\u021A\\u021C\\u021E\\u0220\\u0222\\u0224\\u0226\\u0228\\u022A\\u022C\\u022E\\u0230\\u0232\\u023A\\u023B\\u023D\\u023E\\u0241\\u0243-\\u0246\\u0248\\u024A\\u024C\\u024E\\u0370\\u0372\\u0376\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E\\u038F\\u0391-\\u03A1\\u03A3-\\u03AB\\u03CF\\u03D2-\\u03D4\\u03D8\\u03DA\\u03DC\\u03DE\\u03E0\\u03E2\\u03E4\\u03E6\\u03E8\\u03EA\\u03EC\\u03EE\\u03F4\\u03F7\\u03F9\\u03FA\\u03FD-\\u042F\\u0460\\u0462\\u0464\\u0466\\u0468\\u046A\\u046C\\u046E\\u0470\\u0472\\u0474\\u0476\\u0478\\u047A\\u047C\\u047E\\u0480\\u048A\\u048C\\u048E\\u0490\\u0492\\u0494\\u0496\\u0498\\u049A\\u049C\\u049E\\u04A0\\u04A2\\u04A4\\u04A6\\u04A8\\u04AA\\u04AC\\u04AE\\u04B0\\u04B2\\u04B4\\u04B6\\u04B8\\u04BA\\u04BC\\u04BE\\u04C0\\u04C1\\u04C3\\u04C5\\u04C7\\u04C9\\u04CB\\u04CD\\u04D0\\u04D2\\u04D4\\u04D6\\u04D8\\u04DA\\u04DC\\u04DE\\u04E0\\u04E2\\u04E4\\u04E6\\u04E8\\u04EA\\u04EC\\u04EE\\u04F0\\u04F2\\u04F4\\u04F6\\u04F8\\u04FA\\u04FC\\u04FE\\u0500\\u0502\\u0504\\u0506\\u0508\\u050A\\u050C\\u050E\\u0510\\u0512\\u0514\\u0516\\u0518\\u051A\\u051C\\u051E\\u0520\\u0522\\u0524\\u0526\\u0528\\u052A\\u052C\\u052E\\u0531-\\u0556\\u10A0-\\u10C5\\u10C7\\u10CD\\u13A0-\\u13F5\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1E00\\u1E02\\u1E04\\u1E06\\u1E08\\u1E0A\\u1E0C\\u1E0E\\u1E10\\u1E12\\u1E14\\u1E16\\u1E18\\u1E1A\\u1E1C\\u1E1E\\u1E20\\u1E22\\u1E24\\u1E26\\u1E28\\u1E2A\\u1E2C\\u1E2E\\u1E30\\u1E32\\u1E34\\u1E36\\u1E38\\u1E3A\\u1E3C\\u1E3E\\u1E40\\u1E42\\u1E44\\u1E46\\u1E48\\u1E4A\\u1E4C\\u1E4E\\u1E50\\u1E52\\u1E54\\u1E56\\u1E58\\u1E5A\\u1E5C\\u1E5E\\u1E60\\u1E62\\u1E64\\u1E66\\u1E68\\u1E6A\\u1E6C\\u1E6E\\u1E70\\u1E72\\u1E74\\u1E76\\u1E78\\u1E7A\\u1E7C\\u1E7E\\u1E80\\u1E82\\u1E84\\u1E86\\u1E88\\u1E8A\\u1E8C\\u1E8E\\u1E90\\u1E92\\u1E94\\u1E9E\\u1EA0\\u1EA2\\u1EA4\\u1EA6\\u1EA8\\u1EAA\\u1EAC\\u1EAE\\u1EB0\\u1EB2\\u1EB4\\u1EB6\\u1EB8\\u1EBA\\u1EBC\\u1EBE\\u1EC0\\u1EC2\\u1EC4\\u1EC6\\u1EC8\\u1ECA\\u1ECC\\u1ECE\\u1ED0\\u1ED2\\u1ED4\\u1ED6\\u1ED8\\u1EDA\\u1EDC\\u1EDE\\u1EE0\\u1EE2\\u1EE4\\u1EE6\\u1EE8\\u1EEA\\u1EEC\\u1EEE\\u1EF0\\u1EF2\\u1EF4\\u1EF6\\u1EF8\\u1EFA\\u1EFC\\u1EFE\\u1F08-\\u1F0F\\u1F18-\\u1F1D\\u1F28-\\u1F2F\\u1F38-\\u1F3F\\u1F48-\\u1F4D\\u1F59\\u1F5B\\u1F5D\\u1F5F\\u1F68-\\u1F6F\\u1FB8-\\u1FBB\\u1FC8-\\u1FCB\\u1FD8-\\u1FDB\\u1FE8-\\u1FEC\\u1FF8-\\u1FFB\\u2102\\u2107\\u210B-\\u210D\\u2110-\\u2112\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u2130-\\u2133\\u213E\\u213F\\u2145\\u2183\\u2C00-\\u2C2E\\u2C60\\u2C62-\\u2C64\\u2C67\\u2C69\\u2C6B\\u2C6D-\\u2C70\\u2C72\\u2C75\\u2C7E-\\u2C80\\u2C82\\u2C84\\u2C86\\u2C88\\u2C8A\\u2C8C\\u2C8E\\u2C90\\u2C92\\u2C94\\u2C96\\u2C98\\u2C9A\\u2C9C\\u2C9E\\u2CA0\\u2CA2\\u2CA4\\u2CA6\\u2CA8\\u2CAA\\u2CAC\\u2CAE\\u2CB0\\u2CB2\\u2CB4\\u2CB6\\u2CB8\\u2CBA\\u2CBC\\u2CBE\\u2CC0\\u2CC2\\u2CC4\\u2CC6\\u2CC8\\u2CCA\\u2CCC\\u2CCE\\u2CD0\\u2CD2\\u2CD4\\u2CD6\\u2CD8\\u2CDA\\u2CDC\\u2CDE\\u2CE0\\u2CE2\\u2CEB\\u2CED\\u2CF2\\uA640\\uA642\\uA644\\uA646\\uA648\\uA64A\\uA64C\\uA64E\\uA650\\uA652\\uA654\\uA656\\uA658\\uA65A\\uA65C\\uA65E\\uA660\\uA662\\uA664\\uA666\\uA668\\uA66A\\uA66C\\uA680\\uA682\\uA684\\uA686\\uA688\\uA68A\\uA68C\\uA68E\\uA690\\uA692\\uA694\\uA696\\uA698\\uA69A\\uA722\\uA724\\uA726\\uA728\\uA72A\\uA72C\\uA72E\\uA732\\uA734\\uA736\\uA738\\uA73A\\uA73C\\uA73E\\uA740\\uA742\\uA744\\uA746\\uA748\\uA74A\\uA74C\\uA74E\\uA750\\uA752\\uA754\\uA756\\uA758\\uA75A\\uA75C\\uA75E\\uA760\\uA762\\uA764\\uA766\\uA768\\uA76A\\uA76C\\uA76E\\uA779\\uA77B\\uA77D\\uA77E\\uA780\\uA782\\uA784\\uA786\\uA78B\\uA78D\\uA790\\uA792\\uA796\\uA798\\uA79A\\uA79C\\uA79E\\uA7A0\\uA7A2\\uA7A4\\uA7A6\\uA7A8\\uA7AA-\\uA7AE\\uA7B0-\\uA7B4\\uA7B6\\uA7B8\\uA7BA\\uA7BC\\uA7BE\\uA7C2\\uA7C4-\\uA7C7\\uA7C9\\uA7F5\\uFF21-\\uFF3A",M:"\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1AC0\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F",Mc:"\\u0903\\u093B\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u094F\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u1A19\\u1A1A\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1BE7\\u1BEA-\\u1BEC\\u1BEE\\u1BF2\\u1BF3\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF7\\u302E\\u302F\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BE-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uAA7D\\uAAEB\\uAAEE\\uAAEF\\uAAF5\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC",Me:"\\u0488\\u0489\\u1ABE\\u20DD-\\u20E0\\u20E2-\\u20E4\\uA670-\\uA672",Mn:"\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0902\\u093A\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0957\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u09FE\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B55\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C00\\u0C04\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D00\\u0D01\\u0D3B\\u0D3C\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0D81\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4\\u17B5\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u1885\\u1886\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A1B\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1AB0-\\u1ABD\\u1ABF\\u1AC0\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1BAB-\\u1BAD\\u1BE6\\u1BE8\\u1BE9\\u1BED\\u1BEF-\\u1BF1\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1CF4\\u1CF8\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302D\\u3099\\u309A\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA82C\\uA8C4\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uA9BD\\uA9E5\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAA7C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEC\\uAAED\\uAAF6\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F",Nd:"0-9\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0DE6-\\u0DEF\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uA9F0-\\uA9F9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19",Nl:"\\u16EE-\\u16F0\\u2160-\\u2182\\u2185-\\u2188\\u3007\\u3021-\\u3029\\u3038-\\u303A\\uA6E6-\\uA6EF",No:"\\xB2\\xB3\\xB9\\xBC-\\xBE\\u09F4-\\u09F9\\u0B72-\\u0B77\\u0BF0-\\u0BF2\\u0C78-\\u0C7E\\u0D58-\\u0D5E\\u0D70-\\u0D78\\u0F2A-\\u0F33\\u1369-\\u137C\\u17F0-\\u17F9\\u19DA\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u215F\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA830-\\uA835",Pc:"_\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F",Pd:"\\-\\u058A\\u05BE\\u1400\\u1806\\u2010-\\u2015\\u2E17\\u2E1A\\u2E3A\\u2E3B\\u2E40\\u301C\\u3030\\u30A0\\uFE31\\uFE32\\uFE58\\uFE63\\uFF0D",Pe:"\\)\\]\\}\\u0F3B\\u0F3D\\u169C\\u2046\\u207E\\u208E\\u2309\\u230B\\u232A\\u2769\\u276B\\u276D\\u276F\\u2771\\u2773\\u2775\\u27C6\\u27E7\\u27E9\\u27EB\\u27ED\\u27EF\\u2984\\u2986\\u2988\\u298A\\u298C\\u298E\\u2990\\u2992\\u2994\\u2996\\u2998\\u29D9\\u29DB\\u29FD\\u2E23\\u2E25\\u2E27\\u2E29\\u3009\\u300B\\u300D\\u300F\\u3011\\u3015\\u3017\\u3019\\u301B\\u301E\\u301F\\uFD3E\\uFE18\\uFE36\\uFE38\\uFE3A\\uFE3C\\uFE3E\\uFE40\\uFE42\\uFE44\\uFE48\\uFE5A\\uFE5C\\uFE5E\\uFF09\\uFF3D\\uFF5D\\uFF60\\uFF63",Pf:"\\xBB\\u2019\\u201D\\u203A\\u2E03\\u2E05\\u2E0A\\u2E0D\\u2E1D\\u2E21",Pi:"\\xAB\\u2018\\u201B\\u201C\\u201F\\u2039\\u2E02\\u2E04\\u2E09\\u2E0C\\u2E1C\\u2E20",Po:"!-#%-'\\*,\\.\\/:;\\?@\\xA1\\xA7\\xB6\\xB7\\xBF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061E\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u166E\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u1805\\u1807-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2016\\u2017\\u2020-\\u2027\\u2030-\\u2038\\u203B-\\u203E\\u2041-\\u2043\\u2047-\\u2051\\u2053\\u2055-\\u205E\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00\\u2E01\\u2E06-\\u2E08\\u2E0B\\u2E0E-\\u2E16\\u2E18\\u2E19\\u2E1B\\u2E1E\\u2E1F\\u2E2A-\\u2E2E\\u2E30-\\u2E39\\u2E3C-\\u2E3F\\u2E41\\u2E43-\\u2E4F\\u2E52\\u3001-\\u3003\\u303D\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uAAF0\\uAAF1\\uABEB\\uFE10-\\uFE16\\uFE19\\uFE30\\uFE45\\uFE46\\uFE49-\\uFE4C\\uFE50-\\uFE52\\uFE54-\\uFE57\\uFE5F-\\uFE61\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF07\\uFF0A\\uFF0C\\uFF0E\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3C\\uFF61\\uFF64\\uFF65",Ps:"\\(\\[\\{\\u0F3A\\u0F3C\\u169B\\u201A\\u201E\\u2045\\u207D\\u208D\\u2308\\u230A\\u2329\\u2768\\u276A\\u276C\\u276E\\u2770\\u2772\\u2774\\u27C5\\u27E6\\u27E8\\u27EA\\u27EC\\u27EE\\u2983\\u2985\\u2987\\u2989\\u298B\\u298D\\u298F\\u2991\\u2993\\u2995\\u2997\\u29D8\\u29DA\\u29FC\\u2E22\\u2E24\\u2E26\\u2E28\\u2E42\\u3008\\u300A\\u300C\\u300E\\u3010\\u3014\\u3016\\u3018\\u301A\\u301D\\uFD3F\\uFE17\\uFE35\\uFE37\\uFE39\\uFE3B\\uFE3D\\uFE3F\\uFE41\\uFE43\\uFE47\\uFE59\\uFE5B\\uFE5D\\uFF08\\uFF3B\\uFF5B\\uFF5F\\uFF62",Sc:"\\$\\xA2-\\xA5\\u058F\\u060B\\u07FE\\u07FF\\u09F2\\u09F3\\u09FB\\u0AF1\\u0BF9\\u0E3F\\u17DB\\u20A0-\\u20BF\\uA838\\uFDFC\\uFE69\\uFF04\\uFFE0\\uFFE1\\uFFE5\\uFFE6",Sk:"\\^`\\xA8\\xAF\\xB4\\xB8\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384\\u0385\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD\\u1FFE\\u309B\\u309C\\uA700-\\uA716\\uA720\\uA721\\uA789\\uA78A\\uAB5B\\uAB6A\\uAB6B\\uFBB2-\\uFBC1\\uFF3E\\uFF40\\uFFE3",Sm:"\\+<->\\|~\\xAC\\xB1\\xD7\\xF7\\u03F6\\u0606-\\u0608\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u2118\\u2140-\\u2144\\u214B\\u2190-\\u2194\\u219A\\u219B\\u21A0\\u21A3\\u21A6\\u21AE\\u21CE\\u21CF\\u21D2\\u21D4\\u21F4-\\u22FF\\u2320\\u2321\\u237C\\u239B-\\u23B3\\u23DC-\\u23E1\\u25B7\\u25C1\\u25F8-\\u25FF\\u266F\\u27C0-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u27FF\\u2900-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2AFF\\u2B30-\\u2B44\\u2B47-\\u2B4C\\uFB29\\uFE62\\uFE64-\\uFE66\\uFF0B\\uFF1C-\\uFF1E\\uFF5C\\uFF5E\\uFFE2\\uFFE9-\\uFFEC",So:"\\xA6\\xA9\\xAE\\xB0\\u0482\\u058D\\u058E\\u060E\\u060F\\u06DE\\u06E9\\u06FD\\u06FE\\u07F6\\u09FA\\u0B70\\u0BF3-\\u0BF8\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE\\u0FCF\\u0FD5-\\u0FD8\\u109E\\u109F\\u1390-\\u1399\\u166D\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u2100\\u2101\\u2103-\\u2106\\u2108\\u2109\\u2114\\u2116\\u2117\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A\\u213B\\u214A\\u214C\\u214D\\u214F\\u218A\\u218B\\u2195-\\u2199\\u219C-\\u219F\\u21A1\\u21A2\\u21A4\\u21A5\\u21A7-\\u21AD\\u21AF-\\u21CD\\u21D0\\u21D1\\u21D3\\u21D5-\\u21F3\\u2300-\\u2307\\u230C-\\u231F\\u2322-\\u2328\\u232B-\\u237B\\u237D-\\u239A\\u23B4-\\u23DB\\u23E2-\\u2426\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u25B6\\u25B8-\\u25C0\\u25C2-\\u25F7\\u2600-\\u266E\\u2670-\\u2767\\u2794-\\u27BF\\u2800-\\u28FF\\u2B00-\\u2B2F\\u2B45\\u2B46\\u2B4D-\\u2B73\\u2B76-\\u2B95\\u2B97-\\u2BFF\\u2CE5-\\u2CEA\\u2E50\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFB\\u3004\\u3012\\u3013\\u3020\\u3036\\u3037\\u303E\\u303F\\u3190\\u3191\\u3196-\\u319F\\u31C0-\\u31E3\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA828-\\uA82B\\uA836\\uA837\\uA839\\uAA77-\\uAA79\\uFDFD\\uFFE4\\uFFE8\\uFFED\\uFFEE\\uFFFC\\uFFFD",Zl:"\\u2028",Zp:"\\u2029",Zs:" \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000"}).C=t.Cc+t.Cf+t.Cs+t.Co,t.L=t.Lu+t.Ll+t.Lt+t.Lm+t.Mn+t.Lo,t.LC=t.Lu+t.Ll+t.Lt,t.M=t.Mn+t.Mc+t.Me,t.N=t.Nd+t.Nl+t.No,t.P=t.Pc+t.Pd+t.Ps+t.Pe+t.Pi+t.Pf+t.Po,t.S=t.Sm+t.Sc+t.Sk+t.So,t.Z=t.Zs+t.Zl+t.Zp,t.w="_"+t.L+t.N,t.b="(?:["+t.w+"](?:[^"+t.w+"]|$)|(?:^|[^"+t.w+"])["+t.w+"])",t.bOut="(?=[^"+t.w+"]|$)",t.bIn="(?:^|[^"+t.w+"])",t.bInCapture="(?:^|([^"+t.w+"]))",t.B="(?:["+t.w+"]["+t.w+"]|[^"+t.w+"][^"+t.w+"])",t.d=t.N;var c=Sk.token.tokens;const p=Sk.builtin.SyntaxError,h=Sk.builtin.SyntaxError;i.prototype.exact_type=function(){return this.type==c.T_OP&&this.string in Sk.token.EXACT_TOKEN_TYPES?Sk.token.EXACT_TOKEN_TYPES[this.string]:this.type};var _=/[\\^$.*+?()[\]{}|]/g,d=RegExp(_.source);const{Lu:f,Ll:m,Lt:g,Lm:b,Lo:S,Nl:k,Mn:y,Mc:T,Nd:v,Pc:$}=t,w="["+(t=f+m+g+b+S+k+"_\\u1885-\\u1886\\u2118\\u212E\\u309B-\\u309C")+"]+["+(t+y+T+v+$)+"\\u00B7\\u0387\\u1369-\\u1371\\u19DA]*",E=new RegExp("^"+w+"$");Sk.token.isIdentifier=a,function(t){s.apply(null,arguments)}("\\\\\\r?\\n[ \\f\\t]*"),r("#[^\\r\\n]*"),t=s("[0-9](?:_?[0-9])*\\.(?:[0-9](?:_?[0-9])*)?","\\.[0-9](?:_?[0-9])*")+r("[eE][-+]?[0-9](?:_?[0-9])*");var I,A,O,M=s(t,"[0-9](?:_?[0-9])*[eE][-+]?[0-9](?:_?[0-9])*"),C=s("[0-9](?:_?[0-9])*[jJ]",M+"[jJ]");t=s.apply(null,l()),e=s(t+"'''",t+'"""'),s(t+"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*'",t+'"[^\\n"\\\\]*(?:\\\\.[^\\n"\\\\]*)*"'),u(!0),Sk.token.setupTokens=u;var R=s(t+"'[^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*"+s("'","\\\\\\r?\\n"),t+'"[^\\n"\\\\]*(?:\\\\.[^\\n"\\\\]*)*'+s('"',"\\\\\\r?\\n")),x=s("\\\\\\r?\\n|$","#[^\\r\\n]*",e),N={};t=l();for(let e of t)N[e+"'"]="^[^'\\\\]*(?:\\\\.[^'\\\\]*)*'",N[e+'"']='^[^"\\\\]*(?:\\\\.[^"\\\\]*)*"',N[e+"'''"]="^[^'\\\\]*(?:(?:\\\\.|'(?!''))[^'\\\\]*)*'''",N[e+'"""']='^[^"\\\\]*(?:(?:\\\\.|"(?!""))[^"\\\\]*)*"""';let L=[],D=[];for(let e of t)L.push(e+'"'),L.push(e+"'"),D.push(e+'"""'),D.push(e+"'''");Sk._tokenize=function(t,e,n,r){var l=Sk.__future__.python3?"":"(?:L?)";l=s("0[xX](?:_?[0-9a-fA-F])+"+l,"0[bB](?:_?[01])+"+l,Sk.__future__.silent_octal_literal?"0([oO]?)(?:_?[0-7])+"+l:"0([oO])(?:_?[0-7])+"+l,"(?:0(?:_?0)*|[1-9](?:_?[0-9])*)"+l),l=s(C,M,l),l="[ \\f\\t]*"+s(x,l,O,R,w),l=new RegExp(l);var u,_,d,f=0,m=0,g=0,b="",S=0,k=null,y=[0],T=void 0,v=void 0;void 0!==n&&("utf-8-sig"==n&&(n="utf-8"),r(new i(c.T_ENCODING,n,[0,0],[0,0],"")));for(var $=n="";;){try{n=$,$=e()}catch(t){$=""}f+=1;var E=0,I=$.length;if(b){if(!$)throw new p("EOF in multi-line string",t,v[0],v[1]);T.lastIndex=0;var A=T.exec($);if(!A){S&&"\\\n"!==$.substring($.length-2)&&"\\\r\n"!==$.substring($.length-3)?(r(new i(c.T_ERRORTOKEN,b+$,v,[f,$.length],k)),b="",k=null):(b+=$,k+=$);continue}E=_=A[0].length,r(new i(c.T_STRING,b+$.substring(0,_),v,[f,_],k+$)),b="",S=0,k=null}else if(0!=m||g){if(!$)throw new p("EOF in multi-line statement",t,f,0);g=0}else{if(!$)break;for(u=0;Ey[y.length-1]&&(y.push(u),r(new i(c.T_INDENT,$.substring(E),[f,0],[f,E],$)));u{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";var t={};n.r(t),n.d(t,{controls_type:()=>nt,controls_typeLists:()=>it,variables_change:()=>tt,variables_get:()=>Q,variables_global:()=>et,variables_set:()=>Z});var e={};n.r(e),n.d(e,{base_setup:()=>ot,controls_delay:()=>at,controls_end_program:()=>lt,controls_except:()=>yt,controls_finally:()=>Tt,controls_flow_statements:()=>dt,controls_for:()=>ft,controls_forEach:()=>pt,controls_for_range:()=>mt,controls_if:()=>ut,controls_if_else:()=>St,controls_if_elseif:()=>bt,controls_if_if:()=>gt,controls_lambda:()=>$t,controls_main:()=>rt,controls_pass:()=>wt,controls_range:()=>ct,controls_repeat_ext:()=>vt,controls_thread:()=>Et,controls_try:()=>kt,controls_try_finally:()=>_t,controls_whileUntil:()=>ht,do_while:()=>It,garbage_collection:()=>At,get_mem_alloc:()=>Ot,get_mem_free:()=>Mt,get_unique_identifier:()=>Ct});var i={};n.r(i),n.d(i,{base_map:()=>Qt,math_arithmetic:()=>Dt,math_bit:()=>Pt,math_constant:()=>Nt,math_constant_mp:()=>Lt,math_constrain:()=>Xt,math_dec:()=>Vt,math_indexer_number:()=>qt,math_map:()=>Ht,math_max_min:()=>Yt,math_number:()=>xt,math_number_base_conversion:()=>jt,math_random:()=>Gt,math_random_seed:()=>zt,math_round:()=>Wt,math_selfcalcu:()=>Ft,math_to_int:()=>Ut,math_trig:()=>Bt,text_to_number:()=>Jt,text_to_number_skulpt:()=>Kt});var s={};n.r(s),n.d(s,{ascii_to_char:()=>se,char_to_ascii:()=>re,number_to_text:()=>oe,os_system:()=>Ce,text:()=>te,text_capital:()=>fe,text_center:()=>me,text_char:()=>ne,text_char_at:()=>ue,text_char_at2:()=>le,text_char_at3:()=>Ie,text_compareTo:()=>Ee,text_compare_to:()=>de,text_create_with_container:()=>ve,text_create_with_item:()=>$e,text_encode:()=>Oe,text_equals_starts_ends:()=>_e,text_eval:()=>Me,text_find:()=>ge,text_format:()=>Te,text_format_noreturn:()=>Ae,text_join:()=>ie,text_join_seq:()=>be,text_length:()=>ae,text_random_char:()=>ce,text_replace:()=>Se,text_split:()=>ke,text_strip:()=>ye,text_substring:()=>he,text_substring2:()=>pe,text_substring3:()=>we,text_textarea:()=>ee});var r={};n.r(r),n.d(r,{list_many_input:()=>tn,list_tolist:()=>ln,list_tolist2:()=>mn,list_trig:()=>Ke,lists_2d_get_col_row_data:()=>De,lists_2d_get_data_with_col_row:()=>Le,lists_append_extend:()=>Ye,lists_change_to:()=>Ze,lists_change_to_general:()=>nn,lists_clear:()=>qe,lists_create_with:()=>Fe,lists_create_with2:()=>un,lists_create_with_container:()=>Be,lists_create_with_item:()=>Ve,lists_create_with_noreturn:()=>en,lists_create_with_text:()=>Pe,lists_create_with_text2:()=>cn,lists_del_general:()=>sn,lists_find:()=>Je,lists_getIndex3:()=>pn,lists_getSublist3:()=>hn,lists_get_index:()=>xe,lists_get_random_item:()=>je,lists_get_random_sublist:()=>Ge,lists_get_sublist:()=>Ne,lists_insert_value:()=>Xe,lists_insert_value2:()=>dn,lists_pop:()=>We,lists_remove_at:()=>ze,lists_remove_at2:()=>fn,lists_reverse:()=>He,lists_setIndex3:()=>_n,lists_set_index:()=>Ue,lists_sort:()=>Qe,lists_zip:()=>rn,lists_zip_container:()=>on,lists_zip_item:()=>an});var o={};n.r(o),n.d(o,{dicts_add_change_del:()=>Rn,dicts_add_or_change:()=>$n,dicts_clear:()=>In,dicts_create_with:()=>bn,dicts_create_with_container:()=>Sn,dicts_create_with_item:()=>kn,dicts_create_with_noreturn:()=>Ln,dicts_deldict:()=>Cn,dicts_delete:()=>wn,dicts_get:()=>Tn,dicts_get_default:()=>vn,dicts_items:()=>An,dicts_keys:()=>yn,dicts_length:()=>Mn,dicts_pop:()=>xn,dicts_setdefault:()=>Nn,dicts_to_json:()=>Fn,dicts_todict:()=>Dn,dicts_update:()=>En,dicts_values:()=>On,json_to_dicts:()=>Pn});var a={};n.r(a),n.d(a,{logic_boolean:()=>Gn,logic_compare:()=>Vn,logic_compare_continous:()=>Un,logic_is:()=>zn,logic_is_in:()=>qn,logic_negate:()=>jn,logic_null:()=>Xn,logic_operation:()=>Yn,logic_tobool:()=>Wn,logic_true_or_false:()=>Hn});var l={};n.r(l),n.d(l,{sdcard_mount:()=>bi,sdcard_use_spi_init:()=>gi,storage_can_write_ornot:()=>si,storage_change_dir:()=>fi,storage_close_file:()=>oi,storage_delete_file:()=>li,storage_file_seek:()=>pi,storage_file_tell:()=>ci,storage_file_write:()=>ti,storage_fileopen:()=>Kn,storage_fileopen_new:()=>Qn,storage_fileopen_new_encoding:()=>Zn,storage_get_a_line:()=>ii,storage_get_contents:()=>ni,storage_get_contents_without_para:()=>ei,storage_get_current_dir:()=>hi,storage_get_file_size:()=>ui,storage_get_filename:()=>ri,storage_is_file:()=>mi,storage_list_all_files:()=>ai,storage_make_dir:()=>_i,storage_open_file_with_os:()=>Jn,storage_rename:()=>di});var u={};n.r(u),n.d(u,{procedures_callnoreturn:()=>vi,procedures_callreturn:()=>$i,procedures_defnoreturn:()=>Si,procedures_defreturn:()=>ki,procedures_ifreturn:()=>wi,procedures_mutatorarg:()=>Ti,procedures_mutatorcontainer:()=>yi,procedures_return:()=>Ei});var c={};n.r(c),n.d(c,{tuple_change_to:()=>Pi,tuple_create_with:()=>Ai,tuple_create_with_container:()=>Oi,tuple_create_with_item:()=>Mi,tuple_create_with_noreturn:()=>Yi,tuple_create_with_text2:()=>Ci,tuple_create_with_text_return:()=>Ri,tuple_del:()=>Li,tuple_find:()=>Bi,tuple_getIndex:()=>xi,tuple_getSublist:()=>Ui,tuple_get_random_item:()=>Gi,tuple_get_sublist:()=>ji,tuple_join:()=>Di,tuple_length:()=>Ni,tuple_max:()=>Fi,tuple_totuple:()=>Xi,tuple_trig:()=>Vi});var p={};n.r(p),n.d(p,{set_add_discard:()=>es,set_clear:()=>Qi,set_create_with:()=>qi,set_create_with_container:()=>zi,set_create_with_item:()=>Wi,set_create_with_text_return:()=>ss,set_length:()=>Ji,set_operate:()=>Zi,set_operate_update:()=>ts,set_pop:()=>Ki,set_sub:()=>ns,set_toset:()=>rs,set_update:()=>is});var h={};n.r(h),n.d(h,{html_content:()=>cs,html_content_more:()=>ps,html_document:()=>as,html_form:()=>_s,html_head_body:()=>us,html_style:()=>hs,html_style_color:()=>fs,html_style_content:()=>ds,html_text:()=>ms,html_title:()=>ls});var _={};n.r(_),n.d(_,{attribute_access:()=>Ms,function_call:()=>Is,function_call_container:()=>As,function_call_item:()=>Os,raw_block:()=>Ss,raw_empty:()=>ys,raw_expression:()=>ks,raw_table:()=>bs,text_comment:()=>Ts,text_print_multiple:()=>$s,text_print_multiple_container:()=>ws,text_print_multiple_item:()=>Es,type_check:()=>vs});var d={};n.r(d),n.d(d,{algorithm_add_path:()=>Fs,algorithm_add_school:()=>xs,algorithm_all_books:()=>Zs,algorithm_all_books_sequence:()=>tr,algorithm_book_scale:()=>hr,algorithm_check_feet:()=>vr,algorithm_chick_calculate:()=>Tr,algorithm_color_seclet:()=>Ur,algorithm_current_school:()=>js,algorithm_del_path:()=>Ps,algorithm_delete_book:()=>lr,algorithm_delete_books:()=>ur,algorithm_delete_books2:()=>cr,algorithm_divide_books:()=>or,algorithm_find_path:()=>Ns,algorithm_first_book:()=>er,algorithm_fz_calc:()=>Ir,algorithm_fz_calc_first_min:()=>Ar,algorithm_fz_compare:()=>Or,algorithm_fz_move:()=>Cr,algorithm_fz_set_min:()=>Mr,algorithm_get_book_num:()=>mr,algorithm_get_current_location:()=>Br,algorithm_get_half_books:()=>ar,algorithm_hxdb_add:()=>Dr,algorithm_hxdb_init_soldier:()=>xr,algorithm_hxdb_last_line:()=>Lr,algorithm_hxdb_result:()=>Fr,algorithm_hxdb_stand_in_line:()=>Nr,algorithm_init_fzsf:()=>Er,algorithm_init_hxdb:()=>Rr,algorithm_init_jttl:()=>Sr,algorithm_move_recent:()=>qs,algorithm_new_path:()=>Ls,algorithm_next_book:()=>sr,algorithm_no_left:()=>Vs,algorithm_no_path:()=>Gs,algorithm_no_ring2:()=>nr,algorithm_not_home:()=>zs,algorithm_not_school:()=>Ws,algorithm_number_add:()=>dr,algorithm_number_zero:()=>_r,algorithm_prepare:()=>Rs,algorithm_prepare2:()=>Ys,algorithm_prepare_2_1:()=>Xs,algorithm_prepare_2_2:()=>Hs,algorithm_print_book2:()=>pr,algorithm_print_divide:()=>br,algorithm_print_jttl_answer:()=>$r,algorithm_print_number:()=>fr,algorithm_print_path:()=>Us,algorithm_print_path2:()=>Js,algorithm_print_sequence:()=>gr,algorithm_rabbit_add:()=>wr,algorithm_rabbit_number_in_range:()=>yr,algorithm_rabbit_zero:()=>kr,algorithm_return_path:()=>Bs,algorithm_set_path:()=>Ds,algorithm_two_left:()=>rr,algorithm_void_path:()=>Vr,algorithm_yes_ring2:()=>ir,hanoi_init:()=>Ks,hanoi_init_offline:()=>Pr,hanoi_move:()=>Qs});var f={};n.r(f),n.d(f,{factory_block:()=>Qr,factory_block_return:()=>Zr,factory_block_return_with_textarea:()=>eo,factory_block_with_textarea:()=>to,factory_callMethod_noreturn:()=>Jr,factory_callMethod_return:()=>Kr,factory_create_with_container:()=>Hr,factory_create_with_item:()=>qr,factory_declare:()=>Wr,factory_from_import:()=>jr,factory_function_noreturn:()=>Xr,factory_function_return:()=>zr,factory_import:()=>Gr});var m={};n.r(m),n.d(m,{array_create:()=>So,array_toarray:()=>xo,dataframe_create:()=>ro,dataframe_create_from_index:()=>ao,dataframe_create_from_one_index:()=>oo,dataframe_get:()=>Mo,numpy_trig:()=>Io,pandas_readcsv:()=>Oo,pl_axes:()=>fo,pl_bar:()=>vo,pl_hist:()=>wo,pl_label:()=>bo,pl_legend:()=>mo,pl_pie:()=>$o,pl_plot:()=>ho,pl_plot_bar:()=>ko,pl_plot_easy:()=>po,pl_plot_scatter:()=>yo,pl_plot_xy:()=>To,pl_savefig:()=>Co,pl_show:()=>_o,pl_subplot:()=>Ao,pl_text:()=>Ro,pl_ticks:()=>Eo,pl_title:()=>go,plot_axes:()=>Fo,plot_bar:()=>Go,plot_hist:()=>Ho,plot_label:()=>Vo,plot_legend:()=>Po,plot_pie:()=>Xo,plot_plot:()=>Lo,plot_plot_bar:()=>Uo,plot_plot_easy:()=>No,plot_plot_scatter:()=>Yo,plot_plot_xy:()=>jo,plot_savefig:()=>Wo,plot_show:()=>Do,plot_subplot:()=>zo,plot_text:()=>Jo,plot_ticks:()=>qo,plot_title:()=>Bo,series_create:()=>io,series_create_from_index:()=>so,series_create_from_text:()=>lo,series_get_num:()=>co,series_index_value:()=>uo});var g={};n.r(g),n.d(g,{inout_input:()=>Qo,inout_print:()=>Zo,inout_print_container:()=>sa,inout_print_end:()=>ea,inout_print_inline:()=>ta,inout_print_item:()=>ra,inout_print_many:()=>ia,inout_type_input:()=>na});var b={};n.r(b),n.d(b,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>ya,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>ka,IOT_EMQX_PING:()=>ba,IOT_FORMATTING:()=>ma,IOT_FORMAT_STRING:()=>ga,IOT_MIXIO_NTP:()=>Sa,IOT_MIXIO_PUBLISH:()=>la,IOT_MIXIO_SUBSCRIBE:()=>ua,IOT_MIXIO_UNSUBSCRIBE:()=>ca,iot_mixio_check:()=>_a,iot_mixio_connect:()=>aa,iot_mixio_connect_only:()=>ha,iot_mixio_disconnect:()=>pa,iot_mixio_format_msg:()=>fa,iot_mixio_format_topic:()=>da,iot_mixly_key:()=>Ta,iot_mixly_key_py:()=>va});var S={};n.r(S),n.d(S,{Panic_with_status_code:()=>Aa,base_delay:()=>wa,controls_millis:()=>Ea,controls_mstimer2:()=>Ma,controls_mstimer2_start:()=>Ca,controls_mstimer2_stop:()=>Ra,reset:()=>Oa,time_localtime:()=>Ia,time_sleep:()=>xa});var k={};n.r(k),n.d(k,{turtle_bgcolor:()=>tl,turtle_bgcolor_hex:()=>ul,turtle_bgcolor_hex_new:()=>sl,turtle_circle:()=>Ka,turtle_circle_advanced:()=>Qa,turtle_clear:()=>Xa,turtle_clone:()=>il,turtle_color:()=>al,turtle_color_hex:()=>ll,turtle_color_seclet:()=>Sl,turtle_create:()=>La,turtle_done:()=>Da,turtle_exitonclick:()=>Fa,turtle_fill:()=>qa,turtle_fillcolor:()=>nl,turtle_fillcolor_hex:()=>pl,turtle_fillcolor_hex_new:()=>ol,turtle_getscreen:()=>kl,turtle_goto:()=>Ya,turtle_listen:()=>$l,turtle_move:()=>Pa,turtle_numinput:()=>dl,turtle_onclick:()=>Tl,turtle_onkey:()=>yl,turtle_ontimer:()=>vl,turtle_pencolor:()=>el,turtle_pencolor_hex:()=>cl,turtle_pencolor_hex_new:()=>rl,turtle_penup:()=>Ha,turtle_pos_shape:()=>Ga,turtle_rotate:()=>Ba,turtle_screen_delay:()=>Ua,turtle_screen_savefig:()=>wl,turtle_setheading:()=>Va,turtle_setxy:()=>ja,turtle_shape:()=>hl,turtle_shapesize:()=>_l,turtle_size:()=>Wa,turtle_size_speed:()=>za,turtle_speed:()=>Ja,turtle_textinput:()=>fl,turtle_visible:()=>Za,turtle_write:()=>ml,turtle_write_format:()=>gl,turtle_write_format_skulpt:()=>bl});var y={};n.r(y),n.d(y,{controls_type:()=>Ml,controls_typeLists:()=>Cl,variables_change:()=>Al,variables_get:()=>El,variables_global:()=>Ol,variables_set:()=>Il});var T={};n.r(T),n.d(T,{Panic_with_status_code:()=>Ul,base_setup:()=>xl,controls_delay:()=>Vl,controls_flow_statements:()=>Bl,controls_for:()=>Dl,controls_forEach:()=>Hl,controls_for_range:()=>Fl,controls_if:()=>Nl,controls_interrupts:()=>Gl,controls_lambda:()=>zl,controls_main:()=>Rl,controls_millis:()=>Yl,controls_nointerrupts:()=>Xl,controls_pass:()=>Jl,controls_range:()=>ql,controls_repeat:()=>su,controls_repeat_ext:()=>Zl,controls_thread:()=>Kl,controls_try_finally:()=>Ll,controls_whileUntil:()=>Pl,do_while:()=>Ql,garbage_collection:()=>tu,get_mem_alloc:()=>eu,get_mem_free:()=>nu,get_unique_identifier:()=>iu,reset:()=>jl,time_sleep:()=>Wl});var v={};n.r(v),n.d(v,{base_map:()=>wu,math_arithmetic:()=>uu,math_bit:()=>lu,math_constant:()=>ou,math_constant_mp:()=>au,math_constrain:()=>bu,math_dec:()=>_u,math_indexer_number:()=>yu,math_map:()=>gu,math_max_min:()=>fu,math_number:()=>ru,math_number_base_conversion:()=>Su,math_random:()=>mu,math_random_seed:()=>ku,math_round:()=>Tu,math_selfcalcu:()=>cu,math_single:()=>pu,math_to_int:()=>du,math_trig:()=>hu,text_to_number:()=>vu,text_to_number_skulpt:()=>$u});var w={};n.r(w),n.d(w,{ascii_to_char:()=>Mu,char_to_ascii:()=>Cu,number_to_text:()=>Ru,os_system:()=>ec,text:()=>Eu,text_capital:()=>Uu,text_center:()=>Yu,text_char:()=>Au,text_char_at:()=>Lu,text_char_at2:()=>Nu,text_char_at3:()=>Qu,text_compareTo:()=>Ku,text_compare_to:()=>Pu,text_encode:()=>Zu,text_equals_starts_ends:()=>Fu,text_eval:()=>tc,text_find:()=>ju,text_format:()=>zu,text_format_noreturn:()=>Wu,text_join:()=>Ou,text_join_seq:()=>Gu,text_length:()=>xu,text_random_char:()=>Du,text_replace:()=>Xu,text_split:()=>Hu,text_strip:()=>qu,text_substring:()=>Vu,text_substring2:()=>Bu,text_substring3:()=>Ju,text_textarea:()=>Iu});var E={};n.r(E),n.d(E,{list_many_input:()=>yc,list_tolist:()=>xc,list_tolist2:()=>Nc,list_trig:()=>bc,lists_2d_get_col_row_data:()=>sc,lists_2d_get_data_with_col_row:()=>ic,lists_append_extend:()=>uc,lists_change_to:()=>kc,lists_change_to_general:()=>vc,lists_clear:()=>dc,lists_create_with:()=>rc,lists_create_with2:()=>wc,lists_create_with_noreturn:()=>Tc,lists_create_with_text:()=>oc,lists_create_with_text2:()=>Ec,lists_del_general:()=>$c,lists_find:()=>fc,lists_getIndex3:()=>Ic,lists_getSublist3:()=>Ac,lists_get_index:()=>ac,lists_get_random_item:()=>cc,lists_get_random_sublist:()=>pc,lists_get_sublist:()=>nc,lists_insert_value:()=>hc,lists_insert_value2:()=>Mc,lists_pop:()=>gc,lists_remove_at:()=>mc,lists_remove_at2:()=>Cc,lists_reverse:()=>_c,lists_setIndex3:()=>Oc,lists_set_index:()=>lc,lists_sort:()=>Sc,lists_zip:()=>Rc});var I={};n.r(I),n.d(I,{dicts_add_change_del:()=>qc,dicts_add_or_change:()=>Bc,dicts_clear:()=>Yc,dicts_create_with:()=>Lc,dicts_create_with_noreturn:()=>Jc,dicts_deldict:()=>Hc,dicts_delete:()=>Vc,dicts_get:()=>Fc,dicts_get_default:()=>Pc,dicts_items:()=>jc,dicts_keys:()=>Dc,dicts_length:()=>Xc,dicts_pop:()=>zc,dicts_setdefault:()=>Wc,dicts_to_json:()=>Qc,dicts_todict:()=>Kc,dicts_update:()=>Uc,dicts_values:()=>Gc,json_to_dicts:()=>Zc});var A={};n.r(A),n.d(A,{logic_boolean:()=>sp,logic_compare:()=>tp,logic_compare_continous:()=>ep,logic_is:()=>lp,logic_is_in:()=>ap,logic_negate:()=>ip,logic_null:()=>rp,logic_operation:()=>np,logic_tobool:()=>up,logic_true_or_false:()=>op});var O={};n.r(O),n.d(O,{sdcard_mount:()=>Rp,sdcard_use_spi_init:()=>Cp,storage_can_write_ornot:()=>bp,storage_change_dir:()=>Ep,storage_close_file:()=>kp,storage_delete_file:()=>Tp,storage_file_seek:()=>wp,storage_file_tell:()=>$p,storage_file_write:()=>dp,storage_fileopen:()=>pp,storage_fileopen_new:()=>hp,storage_fileopen_new_encoding:()=>_p,storage_get_a_line:()=>gp,storage_get_contents:()=>mp,storage_get_contents_without_para:()=>fp,storage_get_current_dir:()=>Ip,storage_get_file_size:()=>vp,storage_get_filename:()=>Sp,storage_is_file:()=>Mp,storage_list_all_files:()=>yp,storage_make_dir:()=>Ap,storage_open_file_with_os:()=>cp,storage_rename:()=>Op});var M={};n.r(M),n.d(M,{procedures_callnoreturn:()=>Dp,procedures_callreturn:()=>Lp,procedures_defnoreturn:()=>Np,procedures_defreturn:()=>xp,procedures_ifreturn:()=>Fp,procedures_return:()=>Pp});var C={};n.r(C),n.d(C,{tuple_change_to:()=>qp,tuple_create_with:()=>Bp,tuple_create_with_noreturn:()=>Kp,tuple_create_with_text2:()=>Vp,tuple_create_with_text_return:()=>Up,tuple_del:()=>Gp,tuple_find:()=>zp,tuple_getIndex:()=>Yp,tuple_getSublist:()=>Jp,tuple_get_random_item:()=>Zp,tuple_get_sublist:()=>Qp,tuple_join:()=>Xp,tuple_length:()=>jp,tuple_max:()=>Hp,tuple_totuple:()=>th,tuple_trig:()=>Wp});var R={};n.r(R),n.d(R,{set_add_discard:()=>ah,set_clear:()=>sh,set_create_with:()=>eh,set_create_with_text_return:()=>ch,set_length:()=>nh,set_operate:()=>rh,set_operate_update:()=>oh,set_pop:()=>ih,set_sub:()=>lh,set_toset:()=>ph,set_update:()=>uh});var x={};n.r(x),n.d(x,{html_content:()=>fh,html_content_more:()=>mh,html_document:()=>hh,html_form:()=>bh,html_head_body:()=>dh,html_style:()=>gh,html_style_content:()=>Sh,html_text:()=>kh,html_title:()=>_h});var N={};n.r(N),n.d(N,{attribute_access:()=>Ih,function_call:()=>Eh,raw_block:()=>yh,raw_empty:()=>vh,raw_expression:()=>Th,raw_table:()=>$h,type_check:()=>wh});var L={};n.r(L),n.d(L,{algorithm_add_path:()=>xh,algorithm_add_school:()=>Oh,algorithm_all_books:()=>Jh,algorithm_all_books_sequence:()=>Wh,algorithm_book_scale:()=>o_,algorithm_check_feet:()=>d_,algorithm_chick_calculate:()=>__,algorithm_color_seclet:()=>C_,algorithm_current_school:()=>Bh,algorithm_del_path:()=>Nh,algorithm_delete_book:()=>s_,algorithm_divide_books:()=>n_,algorithm_find_path:()=>Mh,algorithm_first_book:()=>Kh,algorithm_fz_calc:()=>b_,algorithm_fz_compare:()=>S_,algorithm_fz_move:()=>y_,algorithm_fz_set_min:()=>k_,algorithm_get_current_location:()=>O_,algorithm_get_half_books:()=>i_,algorithm_hxdb_add:()=>E_,algorithm_hxdb_init_soldier:()=>v_,algorithm_hxdb_last_line:()=>w_,algorithm_hxdb_result:()=>I_,algorithm_hxdb_stand_in_line:()=>$_,algorithm_init_fzsf:()=>g_,algorithm_init_hxdb:()=>T_,algorithm_init_jttl:()=>c_,algorithm_move_recent:()=>jh,algorithm_new_path:()=>Ch,algorithm_next_book:()=>t_,algorithm_no_left:()=>Dh,algorithm_no_path:()=>Vh,algorithm_no_ring2:()=>Qh,algorithm_not_home:()=>Gh,algorithm_not_school:()=>Xh,algorithm_number_add:()=>l_,algorithm_number_zero:()=>a_,algorithm_prepare:()=>Ah,algorithm_prepare2:()=>Ph,algorithm_prepare_2_1:()=>Uh,algorithm_prepare_2_2:()=>Yh,algorithm_print_book2:()=>r_,algorithm_print_jttl_answer:()=>f_,algorithm_print_number:()=>u_,algorithm_print_path:()=>Fh,algorithm_print_path2:()=>Hh,algorithm_rabbit_add:()=>m_,algorithm_rabbit_number_in_range:()=>h_,algorithm_rabbit_zero:()=>p_,algorithm_return_path:()=>Lh,algorithm_set_path:()=>Rh,algorithm_two_left:()=>e_,algorithm_void_path:()=>M_,algorithm_yes_ring2:()=>Zh,hanoi_init:()=>qh,hanoi_init_offline:()=>A_,hanoi_move:()=>zh});var D={};n.r(D),n.d(D,{factory_block:()=>B_,factory_block_return:()=>V_,factory_block_return_with_textarea:()=>Y_,factory_block_with_textarea:()=>U_,factory_callMethod_noreturn:()=>F_,factory_callMethod_return:()=>P_,factory_declare:()=>D_,factory_from_import:()=>R_,factory_function_noreturn:()=>N_,factory_function_return:()=>L_,factory_import:()=>x_});var F={};n.r(F),n.d(F,{array_create:()=>sd,array_toarray:()=>bd,dataframe_create:()=>X_,dataframe_create_from_index:()=>H_,dataframe_create_from_one_index:()=>q_,dataframe_get:()=>fd,numpy_trig:()=>hd,pandas_readcsv:()=>dd,pl_axes:()=>Q_,pl_bar:()=>ld,pl_hist:()=>cd,pl_label:()=>id,pl_legend:()=>ed,pl_pie:()=>ud,pl_plot:()=>td,pl_plot_bar:()=>rd,pl_plot_easy:()=>Z_,pl_plot_scatter:()=>od,pl_plot_xy:()=>ad,pl_savefig:()=>md,pl_show:()=>K_,pl_subplot:()=>_d,pl_text:()=>gd,pl_ticks:()=>pd,pl_title:()=>nd,plot_axes:()=>kd,plot_bar:()=>Od,plot_hist:()=>Cd,plot_label:()=>wd,plot_legend:()=>vd,plot_pie:()=>Md,plot_plot:()=>Td,plot_plot_bar:()=>Ed,plot_plot_easy:()=>yd,plot_plot_scatter:()=>Id,plot_plot_xy:()=>Ad,plot_savefig:()=>Nd,plot_show:()=>Sd,plot_subplot:()=>xd,plot_text:()=>Ld,plot_ticks:()=>Rd,plot_title:()=>$d,series_create:()=>j_,series_create_from_index:()=>G_,series_create_from_text:()=>z_,series_get_num:()=>J_,series_index_value:()=>W_});var P={};n.r(P),n.d(P,{inout_input:()=>Dd,inout_print:()=>Fd,inout_print_end:()=>Bd,inout_print_inline:()=>Pd,inout_print_many:()=>Ud,inout_type_input:()=>Vd});var B={};n.r(B),n.d(B,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>Zd,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>ef,IOT_EMQX_PING:()=>nf,IOT_FORMATTING:()=>Kd,IOT_FORMAT_STRING:()=>Qd,IOT_MIXIO_PUBLISH:()=>jd,IOT_MIXIO_SUBSCRIBE:()=>Gd,IOT_MIXIO_UNSUBSCRIBE:()=>Xd,iot_mixio_check:()=>zd,iot_mixio_connect:()=>Yd,iot_mixio_connect_only:()=>qd,iot_mixio_disconnect:()=>Hd,iot_mixio_format_msg:()=>Jd,iot_mixio_format_topic:()=>Wd,iot_mixly_key:()=>tf,iot_mixly_key_py:()=>sf});var V={};n.r(V),n.d(V,{controls_end_program:()=>of,controls_millis:()=>rf,time_localtime:()=>af});var U={};n.r(U),n.d(U,{turtle_bgcolor:()=>If,turtle_bgcolor_hex:()=>Cf,turtle_bgcolor_hex_new:()=>Nf,turtle_circle:()=>vf,turtle_circle_advanced:()=>wf,turtle_clear:()=>gf,turtle_clone:()=>Mf,turtle_color:()=>Pf,turtle_color_hex:()=>Ff,turtle_color_seclet:()=>Hf,turtle_create:()=>lf,turtle_done:()=>uf,turtle_exitonclick:()=>cf,turtle_fill:()=>Sf,turtle_fillcolor:()=>Of,turtle_fillcolor_hex:()=>xf,turtle_fillcolor_hex_new:()=>Df,turtle_getscreen:()=>qf,turtle_goto:()=>ff,turtle_listen:()=>Kf,turtle_move:()=>pf,turtle_numinput:()=>Yf,turtle_onclick:()=>Wf,turtle_onkey:()=>zf,turtle_ontimer:()=>Jf,turtle_pencolor:()=>Af,turtle_pencolor_hex:()=>Rf,turtle_pencolor_hex_new:()=>Lf,turtle_penup:()=>bf,turtle_pos_shape:()=>mf,turtle_rotate:()=>hf,turtle_screen_delay:()=>df,turtle_screen_savefig:()=>Qf,turtle_setheading:()=>_f,turtle_setxy:()=>$f,turtle_shape:()=>Bf,turtle_shapesize:()=>Vf,turtle_size:()=>yf,turtle_size_speed:()=>kf,turtle_speed:()=>Tf,turtle_textinput:()=>Uf,turtle_visible:()=>Ef,turtle_write:()=>jf,turtle_write_format:()=>Gf,turtle_write_format_skulpt:()=>Xf});const Y=Blockly,j=Mixly,G={NAME_TYPE:"VARIABLE",allVariables:function(t){var e;if(t.getDescendants)e=t.getDescendants();else{if(!t.getAllBlocks)throw"Not Block or Workspace: "+t;e=t.getAllBlocks()}for(var n=Object.create(null),i=0;i1&&(o+=i)):n=o}else n="i";return n}},X=G,H={};H.NAME_TYPE=Y.PROCEDURE_CATEGORY_NAME,H.allProcedures=function(t){for(var e=t.getAllBlocks(!1),n=[],i=[],s=0;s0?e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+r.join("")+o.join("\n"):e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+o.join("\n")},J.scrubNakedValue=function(t){return t+"\n"},J.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},J.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},J.scrub_=function(t,e,n){var i="";if(!t.outputConnection||!t.outputConnection.targetConnection){(r=t.getCommentText())&&(r=Y.utils.string.wrap(r,J.COMMENT_WRAP-3),i+=J.prefixLines(r+"\n","# "));for(var s=0;s0?"int("+a+" + "+s+")":s<0?"int("+a+" - "+-s+")":"int("+a+")",i&&(a="-"+a)),a};const K=330,Q={init:function(){this.setColour(K),this.appendDummyInput().appendField(new Y.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(Y.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},Z={init:function(){this.setColour(K),this.appendValueInput("VALUE").appendField(new Y.FieldTextInput(""),"VAR").appendField(Y.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){W.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},tt={init:function(){this.setColour(K);var t=[[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.LANG_MATH_FLOAT,"float"],[Y.Msg.LANG_MATH_BOOLEAN,"bool"],[Y.Msg.LANG_MATH_STRING,"str"],[Y.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[Y.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[Y.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[Y.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[Y.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new Y.FieldDropdown(t),"OP"),this.setOutput(!0)}},et={init:function(){this.setColour(K),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Y.Msg.TEXT_PRINT_TOOLTIP)}},nt={init:function(){this.setColour(K),this.appendValueInput("DATA").appendField(Y.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(Y.Msg.MICROBIT_PYTHON_TYPE)}},it={init:function(){this.setColour(K),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new Y.FieldDropdown([[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[Y.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[Y.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[Y.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[Y.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[Y.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[Y.Msg.LANG_MATH_BYTE,"bytes"],[Y.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return Y.Msg.MICROBIT_controls_TypeLists+{int:Y.Msg.LANG_MATH_INT,float:Y.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:Y.Msg.MIXLY_MICROBIT_TYPE_STRING,list:Y.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:Y.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:Y.Msg.MIXLY_MICROBIT_TYPE_DICT,set:Y.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:Y.Msg.MIXLY_MICROBIT_IMAGE,bytes:Y.Msg.LANG_MATH_BYTE,NoneType:Y.Msg.LOGIC_NULL}[e]}))}},st=120,rt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_NAME_MAIN),this.appendStatementInput("DO").appendField(""),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},ot={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_SETUP),this.appendStatementInput("DO").appendField(""),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},at={init:function(){var t=[[Y.Msg.MIXLY_mSecond,"delay"],[Y.Msg.MIXLY_uSecond,"delayMicroseconds"]];this.setColour(st),this.appendValueInput("DELAY_TIME",Number).appendField(Y.Msg.MIXLY_DELAY).appendField(new Y.FieldDropdown(t),"UNIT").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_CONTROL_DELAY),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#id9"),this.wiki={"zh-hans":{page:["Arduino AVR","控制","延时"]}}}},lt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_CONTROL_END_PROGRAM),this.setPreviousStatement(!0),this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_END_TOOLTIP)}},ut={init:function(){this.setColour(st),this.appendValueInput("IF0").setCheck([Boolean,Number]).appendField(Y.Msg.CONTROLS_IF_MSG_IF),this.appendStatementInput("DO0").appendField(Y.Msg.CONTROLS_IF_MSG_THEN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#if"),this.setMutator(new Y.icons.MutatorIcon(["controls_if_elseif","controls_if_else"],this));var t=this;this.setTooltip((function(){return t.elseifCount_||t.elseCount_?!t.elseifCount_&&t.elseCount_?Y.Msg.CONTROLS_IF_TOOLTIP_2:t.elseifCount_&&!t.elseCount_?Y.Msg.CONTROLS_IF_TOOLTIP_3:t.elseifCount_&&t.elseCount_?Y.Msg.CONTROLS_IF_TOOLTIP_4:"":Y.Msg.CONTROLS_IF_TOOLTIP_1})),this.elseifCount_=0,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Y.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(Y.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.CONTROLS_IF_MSG_ELSE);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_if_elseif");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var r=t.newBlock("controls_if_else");r.initSvg(),n.connect(r.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],r=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,r=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,r)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_if_elseif":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),r=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(r.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Y.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(Y.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},ct={init:function(){this.setColour(st),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.PYTHON_RANGE).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pt={init:function(){this.setColour(st),this.appendValueInput("LIST").setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(Y.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return Y.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ht={init:function(){this.setColour(st),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Y.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new Y.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Y.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:Y.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Y.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},_t={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Y.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.MIXLY_PYTHON_FINALLY);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_except");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var r=t.newBlock("controls_finally");r.initSvg(),n.connect(r.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],r=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,r=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,r)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_except":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),r=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(r.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},dt={init:function(){this.setColour(st);var t=new Y.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:Y.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Y.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},ft={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Y.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Y.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},mt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Y.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Y.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};ht.OPERATORS=[[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],dt.OPERATORS=[[Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const gt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(Y.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},bt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},St={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(Y.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},kt={init:function(){this.setColour(st),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},yt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Tt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},vt={init:function(){this.jsonInit({message0:Y.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:st,tooltip:Y.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Y.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},$t={init:function(){this.setColour(st),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_STAT),this.setOutput(!0)}},wt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Et={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(Y.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},It={init:function(){this.appendDummyInput().appendField(Y.Msg.CONTROLS_REPEAT_TITLE_REPEAT+Y.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(Y.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new Y.FieldDropdown([[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(st),this.setTooltip("do-while loop"),this.setHelpUrl("")}},At={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ot={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Mt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},Ct=230;Y.FieldTextInput.math_number_validator=function(t){return String(t)},Y.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Rt={init:function(){this.setColour(Ct),this.appendDummyInput().appendField(new Y.FieldTextInput("0",Y.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MATH_NUMBER_TOOLTIP)}},xt={init:function(){this.setColour(Ct);this.appendDummyInput("").appendField(Y.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Y.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},Nt={init:function(){this.setColour(Ct);this.appendDummyInput("").appendField(Y.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Y.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Lt={init:function(){this.setColour(Ct),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Y.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Y.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Y.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Dt={init:function(){this.setColour(Ct),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Y.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Y.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Y.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Ft={init:function(){this.setColour(Ct),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Y.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Pt={init:function(){this.setColour(Ct),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Y.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:Y.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Y.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Y.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Y.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Y.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Y.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Y.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Bt={init:function(){var t=[[Y.Msg.MATH_BIN,"bin"],[Y.Msg.MATH_OCT,"oct"],[Y.Msg.MATH_HEX,"hex"]];this.setColour(Ct),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new Y.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:Y.Msg.MATH_DEC_TOOLTIP_BIN,oct:Y.Msg.MATH_DEC_TOOLTIP_OCT,hex:Y.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Vt={init:function(){var t=[[Y.Msg.LANG_MATH_TO_ROUND,"round"],[Y.Msg.LANG_MATH_TO_CEIL,"ceil"],[Y.Msg.LANG_MATH_TO_FLOOR,"floor"],[Y.Msg.MATH_ABS,"fabs"],[Y.Msg.MATH_SQRT,"sqrt"]];this.setColour(Ct),this.appendValueInput("A").setCheck(Number).appendField(new Y.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:Y.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Y.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Y.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Y.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Y.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Y.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Ut={init:function(){var t=[[Y.Msg.MIXLY_MAX,"max"],[Y.Msg.MIXLY_MIN,"min"]];this.setColour(Ct),this.appendValueInput("A").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(new Y.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Y.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Y.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Y.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Yt={init:function(){var t=[[Y.Msg.MATH_TWO,"two"],[Y.Msg.MATH_EIGHT,"eight"],[Y.Msg.MATH_TEN,"ten"],[Y.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Ct),this.appendDummyInput("").appendField(Y.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Y.FieldDropdown(t),"OP").appendField(Y.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Y.Msg.MATH_ZHW).appendField(new Y.FieldDropdown(t),"OP2").appendField(Y.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),n={two:Y.Msg.MATH_Before_two,eight:Y.Msg.MATH_Before_eight,ten:Y.Msg.MATH_Before_ten,sixteen:Y.Msg.MATH_Before_sixteen},i=e.getFieldValue("OP2"),s={two:Y.Msg.MATH_Behind_two,eight:Y.Msg.MATH_Behind_eight,ten:Y.Msg.MATH_Behind_ten,sixteen:Y.Msg.MATH_Behind_sixteen};return n[t]+s[i]}))}},jt={init:function(){var t=[[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Ct),this.setOutput(!0,Number),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Y.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),n={int:Y.Msg.LANG_MATH_INT,float:Y.Msg.LANG_MATH_FLOAT_RANDOM};return Y.Msg.MATH_RANDOM_INT_TOOLTIP+n[t]}))}},Gt={init:function(){this.setColour(Ct),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Y.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Y.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Y.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Y.Msg.MATH_CONSTRAIN_TOOLTIP)}},Xt={init:function(){this.setColour(Ct),this.appendValueInput("NUM",Number).appendField(Y.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Y.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Y.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Ht={init:function(){this.setColour(Ct),this.appendDummyInput().appendField(new Y.FieldTextInput("0",Y.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Y.Msg.MATH_NUMBER_TOOLTIP)}},qt={init:function(){this.setColour(Ct),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},zt={init:function(){this.setColour(Ct),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(Y.Msg.MATH_ROUND).appendField(Y.Msg.TEXT_KEEP),this.appendDummyInput().appendField(Y.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(Y.Msg.MATH_ROUND_NEW_TOOLTIP)}},Wt={init:function(){var t=[[Y.Msg.MIXLY_TO_INT,"int"],[Y.Msg.MIXLY_TO_FLOAT,"float"],[Y.Msg.MIXLY_TO_BITES,"b"]];this.setColour(Ct),this.appendValueInput("VAR").appendField(new Y.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Y.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:Y.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:Y.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Jt={init:function(){var t=[[Y.Msg.MIXLY_TO_INT,"int"],[Y.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Ct),this.appendValueInput("VAR").appendField(new Y.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Y.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:Y.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},Kt=Xt,Qt=160,Zt={init:function(){this.setColour(Qt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Y.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(Y.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new Y.FieldImage(e,12,12,'"')}},te={init:function(){this.setColour(Qt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Y.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(Y.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new Y.FieldImage(e,12,12,'"')}};Y.FieldTextInput.char_validator=function(t){if(t.length>1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const ee={init:function(){this.setColour(Qt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Y.FieldTextInput("",Y.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(Y.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new Y.FieldImage(e,7,12,'"')}},ne={init:function(){this.setColour(Qt),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(Y.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},ie={init:function(){this.setColour(Qt),this.appendValueInput("VAR").setCheck(Number).appendField(Y.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},se={init:function(){this.setColour(Qt),this.appendValueInput("VAR").setCheck(String).appendField(Y.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},re={init:function(){this.setColour(Qt),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},oe={init:function(){this.setColour(Qt),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},ae={init:function(){this.WHERE_OPTIONS=[[Y.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Y.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Y.Msg.TEXT_GET_INDEX_RANDOM+1+Y.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(Y.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Qt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(Y.Msg.LISTS_GET_INDEX_GET,"MODE"),Y.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Y.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=t.getFieldValue("WHERE"),i="";switch(e+" "+n){case"GET FROM_START":case"GET FROM_END":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(i+=" "+Y.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",Y.Msg.ONE_BASED_INDEXING?"#1":"#0")),i}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),n={FROM_START:Y.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:Y.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:Y.Msg.TEXT_GET_INDEX_RANDOM};return Y.Msg.PROCEDURES_DEFRETURN_RETURN+Y.Msg.MIXLY_MICROBIT_TYPE_STRING+n[t]+"n"+Y.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==Y.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),Y.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(Y.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new Y.FieldDropdown(this.WHERE_OPTIONS,(function(e){var n="FROM_START"==e||"FROM_END"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),Y.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},le={init:function(){this.setHelpUrl(Y.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Qt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(Y.Msg.LISTS_GET_INDEX_GET+" "+Y.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(Y.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(Y.Msg.PROCEDURES_DEFRETURN_RETURN+Y.Msg.MIXLY_MICROBIT_TYPE_STRING+Y.Msg.LISTS_GET_INDEX_FROM_START+"n"+Y.Msg.TEXT_CHARAT2)}},ue={init:function(){this.setHelpUrl(Y.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Qt),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(Y.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(Y.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},ce={init:function(){this.WHERE_OPTIONS_1=[[Y.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Y.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Y.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Y.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Y.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Y.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Y.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Qt),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(Y.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==Y.INPUT_VALUE;t.setAttribute("at1",e);var n=this.getInput("AT2").type==Y.INPUT_VALUE;return t.setAttribute("at2",n),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),n="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,n)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),Y.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(Y.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var n=new Y.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(n){var i="FROM_START"==n||"FROM_END"==n;if(i!=e){var s=this.sourceBlock_;return s.updateAt_(t,i),s.setFieldValue(n,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(n,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},pe={init:function(){this.setHelpUrl(Y.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Qt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(Y.Msg.LISTS_GET_INDEX_GET+" "+Y.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Y.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Y.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(Y.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},he={init:function(){var t=[[Y.Msg.MIXLY_EQUALS,"==="],[Y.Msg.MIXLY_STARTSWITH,"startswith"],[Y.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(Qt),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new Y.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},_e={init:function(){this.setColour(Qt),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(Y.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_COMPARETO_HELP)}},de={init:function(){var t=[[Y.Msg.TEXT_UPPER,"upper"],[Y.Msg.TEXT_TITLE,"title"],[Y.Msg.TEXT_CAPITALIZE,"capitalize"],[Y.Msg.TEXT_SWAPCASE,"swapcase"],[Y.Msg.TEXT_LOWER,"lower"]];this.setColour(Qt),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Y.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:Y.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:Y.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:Y.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:Y.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:Y.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},fe={init:function(){var t=[[Y.Msg.TEXT_LJUST,"ljust"],[Y.Msg.TEXT_CENTER,"center"],[Y.Msg.TEXT_RJUST,"rjust"]];this.setColour(Qt),this.appendValueInput("VAR").appendField(new Y.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(Y.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(Y.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},me={init:function(){this.setColour(Qt),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(Y.Msg.MIXLY_MID+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(Y.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},ge={init:function(){this.setColour(Qt),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},be={init:function(){this.setColour(Qt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(Y.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(Y.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Se={init:function(){this.setColour(Qt),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(Y.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(Y.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ke={init:function(){var t=[[Y.Msg.TEXT_TRIM_BOTH,"strip"],[Y.Msg.TEXT_TRIM_LEFT,"lstrip"],[Y.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(Qt),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Y.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new Y.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(Y.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:Y.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:Y.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:Y.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},ye={init:function(){this.setColour(Qt),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new Y.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Y.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},bn={init:function(){this.setColour(mn),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Y.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Sn={init:function(){this.setColour(mn),this.appendDummyInput().appendField(Y.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},kn={init:function(){this.setColour(mn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_KEYS),this.setTooltip(Y.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},yn={init:function(){this.setColour(mn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Y.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(Y.Msg.DICTS_GET_TOOLTIP)}},Tn={init:function(){this.setColour(mn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Y.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(Y.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(Y.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},vn={init:function(){this.setColour(mn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(Y.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},$n={init:function(){this.setColour(mn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(Y.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_DELETE_TOOLTIP)}},wn={init:function(){this.setColour(mn),this.appendValueInput("DICT2").setCheck("Dict").appendField(Y.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(Y.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MID),this.setTooltip(Y.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},En={init:function(){this.setColour(mn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_CLEAR),this.setTooltip(Y.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},In={init:function(){this.setColour(mn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_ITEMS),this.setTooltip(Y.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},An={init:function(){this.setColour(mn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_VALUES),this.setTooltip(Y.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},On={init:function(){this.setColour(mn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_LENGTH),this.setTooltip(Y.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Mn={init:function(){this.setColour(mn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_DELDICT),this.setTooltip(Y.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cn={init:function(){this.MODE=[[Y.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[Y.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(Y.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(mn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(Y.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=Y.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=Y.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==Y.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new Y.FieldDropdown(this.MODE,(function(e){var n="INSERT"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Rn={init:function(){this.setColour(mn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Y.Msg.DICTS_ADD_VALUE),this.setTooltip(Y.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},xn={init:function(){this.setColour(mn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(Y.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_SETDEFAULT_TOOLTIP)}},Nn={init:function(){this.setColour(mn),this.appendDummyInput("").appendField(new Y.FieldLabel(Y.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new Y.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(Y.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ln={init:function(){this.setColour(mn),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},Dn={init:function(){this.setColour(mn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_TO_JSON),this.setTooltip(Y.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},Fn={init:function(){this.setColour(mn),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(Y.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},Pn=210,Bn={init:function(){var t=Y.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Pn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:Y.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Y.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Y.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Y.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Y.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Y.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Vn={init:function(){var t=Y.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=Y.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Pn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new Y.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},Un={init:function(){var t=[[Y.Msg.LOGIC_OPERATION_AND,"AND"],[Y.Msg.LOGIC_OPERATION_OR,"OR"],[Y.Msg.LOGIC_OPERATION_NOR,"NOR"],[Y.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Pn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new Y.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:Y.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:Y.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:Y.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:Y.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},Yn={init:function(){this.setColour(Pn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(Y.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(Y.Msg.LOGIC_NEGATE_TOOLTIP)}},jn={init:function(){var t=[[Y.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Y.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Pn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new Y.FieldDropdown(t),"BOOL"),this.setTooltip(Y.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Gn={init:function(){this.setColour(Pn),this.setOutput(!0),this.appendDummyInput().appendField(Y.Msg.LOGIC_NULL),this.setTooltip(Y.Msg.LOGIC_NULL_TOOLTIP)}},Xn={init:function(){this.setColour(Pn),this.appendValueInput("A"),this.appendValueInput("B").appendField(Y.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(Y.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Hn={init:function(){var t=[[Y.Msg.TEXT_APPEND_TO,"in"],[Y.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Pn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new Y.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(Y.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Y.Msg.IN)}},qn={init:function(){var t=[[Y.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[Y.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Pn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},zn={init:function(){this.setColour(Pn),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Wn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(Y.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Jn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_USE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=Y.Msg.MIXLY_BELONG;return n+{r:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+i+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Kn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_USE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=Y.Msg.MIXLY_BELONG,o=Y.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+i+s+o}))}},Qn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(Y.Msg.MIXPY_TEXT_ENCODE).appendField(new Y.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_USE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=Y.Msg.MIXLY_BELONG,o=Y.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+i+s+o}))}},Zn={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+Y.Msg.MIXLY_MICROBIT_TYPE_STRING+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},ti={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},ei={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+i}))}},ni={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Y.Msg.MICROBIT_PYTHON_TYPE)}},ii={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.HTML_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},si={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},ri={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},oi={init:function(){this.setColour(0),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const ai={init:function(){this.setColour(0),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},li={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},ui={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},ci={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+i}))}},pi={init:function(){this.setColour(0),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},hi={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(Y.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Y.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+Y.Msg.MIXLY_ESP32_SET+{mkdir:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},_i={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(Y.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},di={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},fi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.HTML_FILE,"isfile"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Y.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},mi={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(Y.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_SETUP+Y.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(Y.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},gi={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(Y.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},bi={init:function(){var t=q.findLegalName("",this),e=new Y.FieldTextInput(t,q.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new Y.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Y.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(Y.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(Y.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(Y.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(Y.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=Y.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),Y.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{Y.Events.enable()}},mutationToDom:function(t){var e=Y.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var n=0;n"),this.appendValueInput("style").appendField(Y.Msg.MIXLY_AIP_ATTR).setAlign(Y.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ps={init:function(){this.setColour(rs),this.appendDummyInput().appendField(Y.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},hs={init:function(){this.setColour(rs),this.appendDummyInput().appendField(Y.Msg.HTML_FORM_CONTENT).appendField(new Y.FieldDropdown([[Y.Msg.HTML_TEXT,"text"],[Y.Msg.HTML_EMAIL,"email"],[Y.Msg.HTML_NUMBER,"number"],[Y.Msg.HTML_PASSWORD,"password"],[Y.Msg.HTML_CHECKBOX,"checkbox"],[Y.Msg.HTML_RADIOBUTTON,"radiobutton"],[Y.Msg.HTML_BUTTON,"button"],[Y.Msg.HTML_COLOUR,"colour"],[Y.Msg.HTML_DATE,"date"],[Y.Msg.HTML_LOCALTIME,"local time"],[Y.Msg.HTML_FILE,"file"],[Y.Msg.HTML_HIDDEN,"hidden"],[Y.Msg.HTML_IMAGE,"image"],[Y.Msg.HTML_MONTH,"month"],[Y.Msg.HTML_RANGE,"range"],[Y.Msg.HTML_RESET,"reset"],[Y.Msg.HTML_SEARCH,"search"],[Y.Msg.HTML_SUBMIT,"submit"],[Y.Msg.HTML_TELEPHONENUMBER,"telephone number"],[Y.Msg.HTML_TIME,"time"],[Y.Msg.HTML_URL,"url"],[Y.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(Y.Msg.HTML_NAME).appendField(new Y.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(Y.Msg.HTML_VALUE).appendField(new Y.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(Y.Msg.MIXLY_AIP_ATTR).setAlign(Y.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_s={init:function(){this.setColour(rs),this.appendDummyInput().appendField(new Y.FieldTextInput("property"),"KEY").appendField(":").appendField(new Y.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ds={init:function(){this.setColour(rs),this.appendDummyInput().appendField(new Y.FieldTextInput("property"),"KEY").appendField(":").appendField(new Y.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fs={init:function(){this.setColour(rs),this.appendDummyInput().appendField(Y.Msg.HTML_TEXT).appendField(new Y.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ms=160,gs={init:function(){this.setColour(ms),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new Y.FieldTable(""),"TEXT")}},bs={init:function(){this.setColour(ms),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new Y.FieldMultilineInput(""),"TEXT")}},Ss={init:function(){this.setColour(ms),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new Y.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},ks={init:function(){this.setColour(ms),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},ys={init:function(){this.setColour(ms),this.appendDummyInput().appendTitle("Comment:").appendTitle(new Y.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Ts={init:function(){this.setColour(ms),this.appendValueInput("VALUE").appendField(Y.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},vs={init:function(){this.setColour(ms),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Y.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(Y.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=Y.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ho={init:function(){this.setColour(eo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_o={init:function(){this.setColour(eo),this.appendDummyInput().appendField(Y.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fo={init:function(){this.setColour(eo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mo={init:function(){this.setColour(eo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},go={init:function(){this.setColour(eo);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(Y.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bo={init:function(){this.setColour(eo),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_SPLITBYDOU).appendField(Y.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},So={init:function(){this.setColour(eo);var t=[[Y.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Y.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_DISPLAY_DRAW).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Y.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},ko={init:function(){this.setColour(eo);var t=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],e=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_SCATTER).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Y.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},yo={init:function(){this.setColour(eo);var t=[[Y.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Y.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Y.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],n=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_XY).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},To={init:function(){this.setColour(eo);var t=[[Y.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Y.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_BAR).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Y.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Y.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},vo={init:function(){this.setColour(eo);var t=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Y.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PIE).appendField(Y.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Y.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Y.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Y.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},$o={init:function(){this.setColour(eo),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_HIST).appendField(Y.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Y.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wo={init:function(){this.setColour(eo);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_SETTING).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_TICKS).appendField(Y.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Eo={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[Y.Msg.LANG_MATH_TO_ROUND,"round"],[Y.Msg.LANG_MATH_TO_CEIL,"ceil"],[Y.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(eo),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(Y.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new Y.FieldDropdown(t),"OP"),this.setTooltip(Y.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},Io={init:function(){this.setColour(eo),this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT).appendField(Y.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Ao={init:function(){this.setColour(eo),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[Y.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(Y.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Oo={init:function(){this.setColour(eo),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(Y.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new Y.FieldDropdown([[Y.Msg.DATAFRAME_COLUMN,"column"],[Y.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(Y.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},Mo={init:function(){this.setColour(eo),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Co={init:function(){this.setColour(eo);var t=[[Y.Msg.TEXT_TRIM_LEFT,"right"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[Y.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.MIXLY_SETTING).appendField(Y.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_HOR).appendField(new Y.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_VER).appendField(new Y.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Y.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PL_TEXT_TOOLTIP)}},Ro={init:function(){this.setColour(eo),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},xo={init:function(){this.setColour(eo),this.appendValueInput("SER").setCheck("Series").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},No={init:function(){this.setColour(eo);var t=[[Y.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Y.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Y.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],n=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("SER").setCheck("Series").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lo={init:function(){this.setColour(eo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Do={init:function(){this.setColour(eo),this.appendDummyInput().appendField(Y.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fo={init:function(){this.setColour(eo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Po={init:function(){this.setColour(eo),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bo={init:function(){this.setColour(eo);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(Y.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vo={init:function(){this.setColour(eo);var t=[[Y.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Y.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_DISPLAY_DRAW).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Y.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},Uo={init:function(){this.setColour(eo);var t=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_SCATTER).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Y.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(t),"DOT"),this.appendDummyInput().appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Yo={init:function(){this.setColour(eo);var t=[[Y.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Y.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Y.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],n=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_XY).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},jo={init:function(){this.setColour(eo);var t=[[Y.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Y.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_BAR).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Y.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Y.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Go={init:function(){this.setColour(eo);var t=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Y.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PIE).appendField(Y.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Y.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Y.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Y.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Xo={init:function(){this.setColour(eo),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_HIST).appendField(Y.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Y.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ho={init:function(){this.setColour(eo);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_SETTING).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_TICKS).appendField(Y.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},qo={init:function(){this.setColour(eo),this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT).appendField(Y.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},zo={init:function(){this.setColour(eo),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Wo={init:function(){this.setColour(eo);var t=[[Y.Msg.TEXT_TRIM_LEFT,"right"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[Y.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.MIXLY_SETTING).appendField(Y.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_HOR).appendField(new Y.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_VER).appendField(new Y.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Y.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PL_TEXT_TOOLTIP)}},Jo=20,Ko={init:function(){this.setColour(Jo),this.appendValueInput("VAR").appendField(Y.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(Y.Msg.INOUT_input_TOOLTIP)}},Qo={init:function(){this.setColour(Jo),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Y.Msg.BLOCKPY_PRINT_TOOLTIP)}},Zo={init:function(){this.setColour(Jo),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Y.Msg.TEXT_PRINT_TOOLTIP)}},ta={init:function(){this.setColour(Jo),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(Y.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},ea={init:function(){var t=[[Y.Msg.LANG_MATH_STRING,"str"],[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Jo),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(Y.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:Y.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:Y.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:Y.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},na={init:function(){this.setColour(Jo),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Y.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,n){return"("+t+" <= "+e+") and "+l()+"("+t+", "+e+", "+n+") or "+u()+"("+t+", "+e+", "+n+")"},Y.isNumber(i)&&Y.isNumber(s)&&Y.isNumber(r))i=parseFloat(i),s=parseFloat(s),r=Math.abs(parseFloat(r)),0==i%1&&0==s%1&&0==r%1?(i<=s?(s++,t=0==i&&1==r?s:i+", "+s,1!=r&&(t+=", "+r)):t=i+", "+--s+", -"+r,t="range("+t+")"):(t=i",GTE:">="};const tp=function(t,e){var n=this.getFieldValue("OP"),i="&&"==n?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",i)||"False",r=e.valueToCode(this,"B",i)||"False";if("AND"==n)var o=s+" and "+r;else if("OR"==n)o=s+" or "+r;else if("NOR"==n)o="not("+s+"^"+r+")";else o=s+"^"+r;return[o,i]},ep=function(t,e){var n=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",n)||"False"),n]},np=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},ip=function(t,e){return["None",e.ORDER_ATOMIC]},sp=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+n+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},rp=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},op=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},ap=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},lp=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},up=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},cp=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},pp=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},hp=function(t,e){var n=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+n+")\n"},_p=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"()",e.ORDER_ATOMIC]},dp=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},fp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},mp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},gp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},bp=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},Sp=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},kp=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},yp=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Tp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},vp=function(t,e){var n=this.getFieldValue("MODE"),i=0;return i="start"==n?0:"current"==n?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+i+")\n"},$p=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},wp=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Ep=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Ip=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Ap=function(t,e){e.definitions_.import_os="import os";var n=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",e.ORDER_ATOMIC]},Op=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Mp=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Cp=function(t,e){var n=e.variableDB_.getName(this.getFieldValue("NAME"),Y.Procedures.NAME_TYPE),i=e.statementToCode(this,"STACK")||" pass\n";e.INFINITE_LOOP_TRAP&&(i=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+i);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var r=[],o=0;o\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},ph=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"\n"+n+"\n"},hh=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");if("head"==i)var s="<"+i+'>\n\t\n'+n+"\n";else s="<"+i+">\n"+n+"\n";return s},_h=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"<"+i+">\n"+n+"\n"},dh=function(t,e){var n=e.statementToCode(this,"DO"),i=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+i+" >\n"+n+"\n"},fh=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},mh=function(t,e){return'"},gh=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},bh=function(){return this.getFieldValue("TEXT")+"\n"},Sh=function(t){return t.getFieldValue("TEXT")+"\n"},kh=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},yh=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},Th=function(){return""},vh=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},$h=function(t,e){for(var n=t.getFieldValue("NAME"),i=t.hasReturn_,s=new Array(t.itemCount_),r=0;r6:\n print("路线错乱!程序有误!")\n exit()\n'},Yh=function(t,e){return["name[now] != '小科家'",e.ORDER_ATOMIC]},jh=function(t,e){return["name[now] != '学校'",e.ORDER_ATOMIC]},Gh=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},Xh=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var i="print('层数过高!不得高于6层!')\nexit()\n";else i="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return i},Hh=function(t,e){var n=e.valueToCode(this,"FROM_NUM",e.ORDER_ATOMIC)||"0",i=e.valueToCode(this,"TO_NUM",e.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${i}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${i}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${i}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${i}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${i}*200+200, 400-len(_Hanoi[${i}])*27, 0.2)\n _Hanoi[${i}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},qh=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},zh=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},Wh=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},Jh=function(t,e){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",e.ORDER_ATOMIC]},Kh=function(t,e){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",e.ORDER_ATOMIC]},Qh=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},Zh=function(t,e){return["len(list)>=2",e.ORDER_ATOMIC]},t_=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},e_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},n_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},i_=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},s_=function(t,e){var n=this.getFieldValue("NUM");return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},r_=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},o_=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},a_=function(t,e){e.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},l_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},u_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},c_=function(t,e){return["_rabbit < _head",e.ORDER_ATOMIC]},p_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},h_=function(t,e){return["_rabbit*4 + _chick*2 == _foot",e.ORDER_ATOMIC]},__=function(t,e){e.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},d_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},f_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},m_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const i=[0,[1,3],[2,4],[5,7],[6]];var s="";return s+=`_S${n}.show()\ntime.sleep(1)\n`,s+=4!=n?`_Slen[${n}] = _Llen[${i[n][0]}] + _Llen[${i[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},g_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,e.ORDER_ATOMIC]},b_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),i="";return i+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},S_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},k_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},y_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},T_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},v_=function(t,e){return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,e.ORDER_ATOMIC]},$_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},w_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},E_=function(t,e){e.definitions_.import_turtle="import turtle",e.definitions_.import_time="import time",e.definitions_.import_math="import math";var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),i=this.getFieldValue("NUM");return e.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",e.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",e.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if athis.#t.on("display",t)[0],Qf.configure({output:t=>{this.#t.run("output",{content:t})},read:this.readFile.bind(this),inputfun:this.skInput.bind(this),inputfunTakesPrompt:!0,execLimit:Number.POSITIVE_INFINITY,fileread:this.fileread.bind(this),filewrite:this.filewrite.bind(this),__future__:Qf.python3}),Qf.builtins.value=new Qf.builtin.func((function(){return Qf.ffi.remapToPy(void 0===tm?5:tm)})),Qf.builtins.set_value=new Qf.builtin.func((function(t){tm=t.v})),Qf.builtinFiles.files["./mixpy.py"]='import math\r\n\r\ndef math_map(v, al, ah, bl, bh):\r\n return bl + (bh - bl) * (v - al) / (ah - al)\r\n\r\ndef math_mean(myList):\r\n localList = [e for e in myList if type(e) == int or type(e) == float]\r\n if not localList: return\r\n return float(sum(localList)) / len(localList)\r\n\r\ndef math_median(myList):\r\n localList = sorted([e for e in myList if type(e) == int or type(e) == float])\r\n if not localList: return\r\n if len(localList) % 2 == 0:\r\n return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0\r\n else:\r\n return localList[(len(localList) - 1) // 2]\r\n\r\ndef math_modes(some_list):\r\n modes = []\r\n # Using a lists of [item, count] to keep count rather than dict\r\n # to avoid "unhashable" errors when the counted item is itself a list or dict.\r\n counts = []\r\n maxCount = 1\r\n for item in some_list:\r\n found = False\r\n for count in counts:\r\n if count[0] == item:\r\n count[1] += 1\r\n maxCount = max(maxCount, count[1])\r\n found = True\r\n if not found:\r\n counts.append([item, 1])\r\n for counted_item, item_count in counts:\r\n if item_count == maxCount:\r\n modes.append(counted_item)\r\n return modes\r\n\r\ndef math_standard_deviation(numbers):\r\n n = len(numbers)\r\n if n == 0: return\r\n mean = float(sum(numbers)) / n\r\n variance = sum((x - mean) ** 2 for x in numbers) / n\r\n return math.sqrt(variance)\r\n\r\ndef lists_sort(my_list, type, reverse):\r\n def try_float(s):\r\n try:\r\n return float(s)\r\n except:\r\n return 0\r\n key_funcs = {\r\n "NUMERIC": try_float,\r\n "TEXT": str,\r\n "IGNORE_CASE": lambda s: str(s).lower()\r\n }\r\n key_func = key_funcs[type]\r\n list_cpy = list(my_list)\r\n return sorted(list_cpy, key=key_func, reverse=reverse)'}readFile(t){if(void 0!==Zf[t])return Qf.misceval.promiseToSuspension(fetch(Zf[t]).then((t=>t.text())));if(void 0===Qf.builtinFiles||void 0===Qf.builtinFiles.files[t])throw"File not found: '"+t+"'";return Qf.builtinFiles.files[t]}fileread(t,e){return this.mixpyProject.exist(t)?this.mixpyProject.getFileContent(t):-1!==e.indexOf("w")?(this.mixpyProject.add(t,"",1),""):null}filewrite(t,e){var n=t.name;this.mixpyProject.modify(n,e),this.mixpyProject.select(n)}skInput(t){return new Promise(((e,n)=>{this.#t.run("input",{content:{prompt:t},resolve:e,reject:n})}))}reset(){Qf.execLimit=Number.POSITIVE_INFINITY,Qf.TurtleGraphics.reset&&Qf.TurtleGraphics.reset()}kill(){window.SPRITE.kill(),Qf.execLimit=0,this.executionEnd_()}step(t,e,n,i){if(".py"==i){var s=this.executionBuffer.step,r=this.parseGlobals(t);this.executionBuffer.trace.push({step:s,filename:i,line:e,column:n,properties:r.properties,modules:r.modules}),this.executionBuffer.step=s+1,this.executionBuffer.last_step=s+1,this.executionBuffer.line_number=e}}analyzeVariables(){if(""==this.main.model.programs.__main__().trim())return{}}analyze(){return this.main.model.execution.status("analyzing"),""!=this.main.model.programs.__main__().trim()||(this.main.components.feedback.emptyProgram("You haven't written any code yet!"),!1)}run(t){this.reset(),-1===t.indexOf("import sprite")&&-1===t.indexOf("from sprite import")||window.SPRITE.runit(Qf.TurtleGraphics.target),this.programStatus.running=!0,Qf.misceval.asyncToPromise((()=>Qf.importMainWithBody("",!1,t,!0))).then((()=>{window.SPRITE.running=!1,this.programStatus.running=!1,this.#t.run("finished")})).catch((t=>{j.Debug.error(t),window.SPRITE.running=!1,this.programStatus.running=!1,this.#t.run("error",t);var e=function(t){return"string"==typeof t?t:void 0!==t.tp$str?t.tp$str().v:t.name+": "+t.message}(t);this.#t.run("finished"),-1===e.indexOf("TimeLimitError")&&this.executionEnd_()}))}setupEnvironment(t,e,n,i,s){var r=this.main.model;this._backup_execution=Qf.afterSingleExecution,Qf.afterSingleExecution=void 0,Qf.builtins.get_output=new Qf.builtin.func((function(){return Qf.builtin.pyCheckArgs("get_output",arguments,0,0),Qf.ffi.remapToPy(r.execution.output())})),Qf.builtins.reset_output=new Qf.builtin.func((function(){Qf.builtin.pyCheckArgs("reset_output",arguments,0,0),r.execution.output.removeAll()})),Qf.builtins.log=new Qf.builtin.func((function(t){Qf.builtin.pyCheckArgs("log",arguments,1,1),console.log(t)})),Qf.builtins._trace=e,Qf.builtins._final_values=s,Qf.builtins.code=Qf.ffi.remapToPy(t),Qf.builtins.set_success=this.instructor_module.set_success,Qf.builtins.set_feedback=this.instructor_module.set_feedback,Qf.builtins.set_finished=this.instructor_module.set_finished,Qf.builtins.count_components=this.instructor_module.count_components,Qf.builtins.no_nonlist_nums=this.instructor_module.no_nonlist_nums,Qf.builtins.only_printing_properties=this.instructor_module.only_printing_properties,Qf.builtins.calls_function=this.instructor_module.calls_function,Qf.builtins.get_property=this.instructor_module.get_property,Qf.builtins.get_value_by_name=this.instructor_module.get_value_by_name,Qf.builtins.get_value_by_type=this.instructor_module.get_value_by_type,Qf.builtins.parse_json=this.instructor_module.parse_json,Qf.skip_drawing=!0,r.settings.mute_printer(!0)}disposeEnvironment(){Qf.afterSingleExecution=this._backup_execution,Qf.builtins.get_output=void 0,Qf.builtins.reset_output=void 0,Qf.builtins.log=void 0,Qf.builtins._trace=void 0,Qf.builtins.trace=void 0,Qf.builtins.code=void 0,Qf.builtins.set_success=void 0,Qf.builtins.set_feedback=void 0,Qf.builtins.set_finished=void 0,Qf.builtins.count_components=void 0,Qf.builtins.calls_function=void 0,Qf.builtins.get_property=void 0,Qf.builtins.get_value_by_name=void 0,Qf.builtins.get_value_by_type=void 0,Qf.builtins.no_nonlist_nums=void 0,Qf.builtins.only_printing_properties=void 0,Qf.builtins.parse_json=void 0,Qf.skip_drawing=!1,tm=void 0,this.main.model.settings.mute_printer(!1)}parseGlobals(t){var e=Array(),n=Array();for(var i in t){var s=t[i];if("__name__"!==i&&"__doc__"!==i){i=i.replace("_$rw$","").replace("_$rn$","");var r=this.parseValue(i,s);null!==r?e.push(r):s.constructor==Qf.builtin.module&&n.push(s.$d.__name__.v)}}return{properties:e,modules:n}}parseValue(t,e){if(null==e)return{name:t,type:"Unknown",value:"Undefined"};switch(e.constructor){case Qf.builtin.func:return{name:t,type:"Function",value:void 0!==e.func_code.co_varnames?" Arguments: "+e.func_code.co_varnames.join(", "):" No arguments"};case Qf.builtin.module:return null;case Qf.builtin.str:return{name:t,type:"String",value:e.$r().v};case Qf.builtin.none:return{name:t,type:"None",value:"None"};case Qf.builtin.bool:return{name:t,type:"Boolean",value:e.$r().v};case Qf.builtin.nmber:return{name:t,type:"int"==e.skType?"Integer":"Float",value:e.$r().v};case Qf.builtin.int_:return{name:t,type:"Integer",value:e.$r().v};case Qf.builtin.float_:return{name:t,type:"Float",value:e.$r().v};case Qf.builtin.tuple:return{name:t,type:"Tuple",value:e.$r().v};case Qf.builtin.list:return e.v.length<=20?{name:t,type:"List",value:e.$r().v,exact_value:e}:{name:t,type:"List",value:"[... "+e.v.length+" elements ...]",exact_value:e};case Qf.builtin.dict:return{name:t,type:"Dictionary",value:e.$r().v};case Number:return{name:t,type:e%1==0?"Integer":"Float",value:e};case String:return{name:t,type:"String",value:e};case Boolean:return{name:t,type:"Boolean",value:e?"True":"False"};default:return{name:t,type:null==e.tp$name?e:e.tp$name,value:null==e.$r?e:e.$r().v}}}}const nm=$;var im=n.n(nm);class sm extends j.PageBase{static{j.HTMLTemplate.add("html/statusbar/statusbar-image.html",new j.HTMLTemplate('\r\n
\r\n
\r\n
')),this.init=function(){j.StatusBarsManager.typesRegistry.register(["images"],sm);const t=j.Workspace.getMain().getStatusBarsManager();t.add("images","images","图像"),t.changeTo("output")}}constructor(){super();const t=im()(j.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(t)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(t){const e=this.getContent(),n=function(t){t.style.width="auto",t.style.height="auto",t.style.maxWidth="100%",t.style.maxHeight="100%"};this.clean();let i=t.content,s=null,r=null;switch(t.display_type){case"p5":i.style.width="100%",i.style.height="100%",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",new MutationObserver((function(t){t.forEach((t=>t.addedNodes.forEach((t=>{const e=t;null!=e.tagName&&["canvas","video"].includes(e.tagName.toLowerCase())&&n(e)}))))})).observe(i,{childList:!0}),i.querySelectorAll("canvas,video").forEach(n),e.append(i);break;case"matplotlib":s=i.querySelector("canvas"),s&&(i=s),i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"ocaml-canvas":i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"turtle":i.setAttribute("width","100%"),i.setAttribute("height","100%"),e.append(i.outerHTML);break;case"sympy":e.append(t.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let t=document.createElement("script");t.type="text/javascript",t.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(t)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in t.content){let i=t.content[n];"image/png"===n&&(i=''),e.append(i);break}break;case"tutor":if(e.append(im()(t.content.replace("overflow-y%3A%20hidden%3B",""))),r=this.getContent()[0].getElementsByTagName("iframe")[0],null==r)return;r.style.maxHeight=r.style.minHeight="100%",new IntersectionObserver(((t,e)=>{const n=t[0];n&&!n.isIntersecting||(r.contentWindow?.postMessage({type:"redraw"},"*"),e.disconnect())})).observe(r);break;default:console.error(`Not supported node type '${t.display_type}' in eval.display result processing.`)}}}const rm=sm;class om{static{this.pythonShell=null,this.init=async function(){rm.init(),this.pythonShell=new om},this.run=function(){const t=j.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(t)},this.stop=function(){return this.pythonShell.stop()}}#e=null;#n=null;#i=null;#s={row:0,column:0};#r="";#o=null;#a=null;#l=!1;#u=!1;#c=null;#p=()=>this.#h();#_=[{name:"REPL-Enter",bindKey:"Enter",exec:t=>{if(t.getSession().selection.getCursor().row===this.#s.row){const t=this.#e.getEndPos();let e=this.#e.getValueRange(this.#s,t);return e=e.replace(this.#r,""),this.#o?.(e),this.#o=null,this.#a=null,this.#e.addValue("\n"),this.#d(),!0}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:t=>{const e=t.getSession().selection.getCursor();return e.row{this.#u=!1,this.#e.addValue(`\n==${j.Msg.Lang["shell.finish"]}==`)})),t.bind("output",(t=>{this.#e.addValue(t.content)})),t.bind("error",(t=>{this.#u=!1,this.#e.addValue(`\n${t.toString()}\n`)})),t.bind("input",(t=>{const e=String(t?.content?.prompt);this.#e.addValue(`>>> ${e}`),this.#r=e,this.#o=t.resolve,this.#a=t.reject,this.#m()})),t.bind("display",(t=>{this.#i.changeTo("images"),this.#n.display(t)}))}#h(){const t=this.#e.getEditor(),e=t.getSession().selection.getCursor();t.setReadOnly(e.rowsetTimeout(e,t)))}}const am=om,lm={init:function(){am.init();const t=j.app.getNav();t.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:Y.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{am.run().catch(j.Debug.error)},scopeType:j.Nav.Scope.LEFT,weight:4}),t.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:Y.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{am.stop().catch(j.Debug.error)},scopeType:j.Nav.Scope.LEFT,weight:5})}};lm.init(),Object.assign(Y.Variables,X),Object.assign(Y.Procedures,q),Y.Python=J,Y.generator=J,j.Profile.default={},Object.assign(Y.Blocks,t,e,i,s,r,o,a,l,u,c,p,h,_,d,f,m,g,b,S,k),Object.assign(Y.Python.forBlock,y,T,v,w,E,I,A,O,M,C,R,x,N,L,D,F,P,B,V,U)})()})(); \ No newline at end of file +class z{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var n=t.split(","),i=0;i0?e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+r.join("")+o.join("\n"):e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+o.join("\n")},J.scrubNakedValue=function(t){return t+"\n"},J.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},J.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},J.scrub_=function(t,e,n){var i="";if(!t.outputConnection||!t.outputConnection.targetConnection){(r=t.getCommentText())&&(r=Y.utils.string.wrap(r,J.COMMENT_WRAP-3),i+=J.prefixLines(r+"\n","# "));for(var s=0;s0?"int("+a+" + "+s+")":s<0?"int("+a+" - "+-s+")":"int("+a+")",i&&(a="-"+a)),a};const K=330,Q={init:function(){this.setColour(K),this.appendDummyInput().appendField(new Y.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(Y.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){W.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},Z={init:function(){this.setColour(K),this.appendValueInput("VALUE").appendField(new Y.FieldTextInput(""),"VAR").appendField(Y.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){W.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},tt={init:function(){this.setColour(K);var t=[[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.LANG_MATH_FLOAT,"float"],[Y.Msg.LANG_MATH_BOOLEAN,"bool"],[Y.Msg.LANG_MATH_STRING,"str"],[Y.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[Y.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[Y.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[Y.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[Y.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new Y.FieldDropdown(t),"OP"),this.setOutput(!0)}},et={init:function(){this.setColour(K),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Y.Msg.TEXT_PRINT_TOOLTIP)}},nt={init:function(){this.setColour(K),this.appendValueInput("DATA").appendField(Y.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(Y.Msg.MICROBIT_PYTHON_TYPE)}},it={init:function(){this.setColour(K),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new Y.FieldDropdown([[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[Y.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[Y.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[Y.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[Y.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[Y.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[Y.Msg.LANG_MATH_BYTE,"bytes"],[Y.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return Y.Msg.MICROBIT_controls_TypeLists+{int:Y.Msg.LANG_MATH_INT,float:Y.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:Y.Msg.MIXLY_MICROBIT_TYPE_STRING,list:Y.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:Y.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:Y.Msg.MIXLY_MICROBIT_TYPE_DICT,set:Y.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:Y.Msg.MIXLY_MICROBIT_IMAGE,bytes:Y.Msg.LANG_MATH_BYTE,NoneType:Y.Msg.LOGIC_NULL}[e]}))}},st=120,rt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_NAME_MAIN),this.appendStatementInput("DO").appendField(""),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},ot={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_SETUP),this.appendStatementInput("DO").appendField(""),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},at={init:function(){var t=[[Y.Msg.MIXLY_mSecond,"delay"],[Y.Msg.MIXLY_uSecond,"delayMicroseconds"]];this.setColour(st),this.appendValueInput("DELAY_TIME",Number).appendField(Y.Msg.MIXLY_DELAY).appendField(new Y.FieldDropdown(t),"UNIT").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_CONTROL_DELAY),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#id9"),this.wiki={"zh-hans":{page:["Arduino AVR","控制","延时"]}}}},lt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_CONTROL_END_PROGRAM),this.setPreviousStatement(!0),this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_END_TOOLTIP)}},ut={init:function(){this.setColour(st),this.appendValueInput("IF0").setCheck([Boolean,Number]).appendField(Y.Msg.CONTROLS_IF_MSG_IF),this.appendStatementInput("DO0").appendField(Y.Msg.CONTROLS_IF_MSG_THEN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#if"),this.setMutator(new Y.icons.MutatorIcon(["controls_if_elseif","controls_if_else"],this));var t=this;this.setTooltip((function(){return t.elseifCount_||t.elseCount_?!t.elseifCount_&&t.elseCount_?Y.Msg.CONTROLS_IF_TOOLTIP_2:t.elseifCount_&&!t.elseCount_?Y.Msg.CONTROLS_IF_TOOLTIP_3:t.elseifCount_&&t.elseCount_?Y.Msg.CONTROLS_IF_TOOLTIP_4:"":Y.Msg.CONTROLS_IF_TOOLTIP_1})),this.elseifCount_=0,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Y.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(Y.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.CONTROLS_IF_MSG_ELSE);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_if_elseif");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var r=t.newBlock("controls_if_else");r.initSvg(),n.connect(r.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],r=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,r=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,r)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_if_elseif":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),r=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(r.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Y.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(Y.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},ct={init:function(){this.setColour(st),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.PYTHON_RANGE).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},pt={init:function(){this.setColour(st),this.appendValueInput("LIST").setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(Y.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return Y.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ht={init:function(){this.setColour(st),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Y.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new Y.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Y.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:Y.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Y.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},_t={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Y.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.MIXLY_PYTHON_FINALLY);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_except");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var r=t.newBlock("controls_finally");r.initSvg(),n.connect(r.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],r=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,r=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,r)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_except":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),r=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(r.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Y.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},dt={init:function(){this.setColour(st);var t=new Y.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:Y.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Y.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},ft={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Y.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Y.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},mt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Y.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return Y.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};ht.OPERATORS=[[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],dt.OPERATORS=[[Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Y.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const gt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(Y.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},bt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},St={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(Y.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},kt={init:function(){this.setColour(st),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},yt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Tt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(Y.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},vt={init:function(){this.jsonInit({message0:Y.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:st,tooltip:Y.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Y.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},$t={init:function(){this.setColour(st),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(Y.Msg.MIXLY_STAT),this.setOutput(!0)}},wt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Et={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(Y.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},It={init:function(){this.appendDummyInput().appendField(Y.Msg.CONTROLS_REPEAT_TITLE_REPEAT+Y.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(Y.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new Y.FieldDropdown([[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[Y.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(st),this.setTooltip("do-while loop"),this.setHelpUrl("")}},At={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ot={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Mt={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},Ct={init:function(){this.setColour(st),this.appendDummyInput().appendField(Y.Msg.MIXLY_GET+Y.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.PROCEDURES_DEFRETURN_RETURN+Y.Msg.MIXLY_GET_UNIQUE_IDEN)}},Rt=230;Y.FieldTextInput.math_number_validator=function(t){return String(t)},Y.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const xt={init:function(){this.setColour(Rt),this.appendDummyInput().appendField(new Y.FieldTextInput("0",Y.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MATH_NUMBER_TOOLTIP)}},Nt={init:function(){this.setColour(Rt);this.appendDummyInput("").appendField(Y.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Y.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},Lt={init:function(){this.setColour(Rt);this.appendDummyInput("").appendField(Y.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Y.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:Y.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Dt={init:function(){this.setColour(Rt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Y.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Y.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Y.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Ft={init:function(){this.setColour(Rt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:Y.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Y.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Y.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Y.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Y.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Pt={init:function(){this.setColour(Rt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Y.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Bt={init:function(){this.setColour(Rt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Y.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:Y.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Y.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Y.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Y.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Y.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Y.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Y.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Vt={init:function(){var t=[[Y.Msg.MATH_BIN,"bin"],[Y.Msg.MATH_OCT,"oct"],[Y.Msg.MATH_HEX,"hex"]];this.setColour(Rt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new Y.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:Y.Msg.MATH_DEC_TOOLTIP_BIN,oct:Y.Msg.MATH_DEC_TOOLTIP_OCT,hex:Y.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},Ut={init:function(){var t=[[Y.Msg.LANG_MATH_TO_ROUND,"round"],[Y.Msg.LANG_MATH_TO_CEIL,"ceil"],[Y.Msg.LANG_MATH_TO_FLOOR,"floor"],[Y.Msg.MATH_ABS,"fabs"],[Y.Msg.MATH_SQRT,"sqrt"]];this.setColour(Rt),this.appendValueInput("A").setCheck(Number).appendField(new Y.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:Y.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Y.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Y.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Y.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Y.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Y.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},Yt={init:function(){var t=[[Y.Msg.MIXLY_MAX,"max"],[Y.Msg.MIXLY_MIN,"min"]];this.setColour(Rt),this.appendValueInput("A").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(new Y.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Y.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:Y.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Y.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},jt={init:function(){var t=[[Y.Msg.MATH_TWO,"two"],[Y.Msg.MATH_EIGHT,"eight"],[Y.Msg.MATH_TEN,"ten"],[Y.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Rt),this.appendDummyInput("").appendField(Y.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Y.FieldDropdown(t),"OP").appendField(Y.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Y.Msg.MATH_ZHW).appendField(new Y.FieldDropdown(t),"OP2").appendField(Y.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),n={two:Y.Msg.MATH_Before_two,eight:Y.Msg.MATH_Before_eight,ten:Y.Msg.MATH_Before_ten,sixteen:Y.Msg.MATH_Before_sixteen},i=e.getFieldValue("OP2"),s={two:Y.Msg.MATH_Behind_two,eight:Y.Msg.MATH_Behind_eight,ten:Y.Msg.MATH_Behind_ten,sixteen:Y.Msg.MATH_Behind_sixteen};return n[t]+s[i]}))}},Gt={init:function(){var t=[[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Rt),this.setOutput(!0,Number),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Y.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Y.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),n={int:Y.Msg.LANG_MATH_INT,float:Y.Msg.LANG_MATH_FLOAT_RANDOM};return Y.Msg.MATH_RANDOM_INT_TOOLTIP+n[t]}))}},Xt={init:function(){this.setColour(Rt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Y.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Y.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Y.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Y.Msg.MATH_CONSTRAIN_TOOLTIP)}},Ht={init:function(){this.setColour(Rt),this.appendValueInput("NUM",Number).appendField(Y.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Y.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Y.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_MATH_MAP)}},qt={init:function(){this.setColour(Rt),this.appendDummyInput().appendField(new Y.FieldTextInput("0",Y.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Y.Msg.MATH_NUMBER_TOOLTIP)}},zt={init:function(){this.setColour(Rt),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Wt={init:function(){this.setColour(Rt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(Y.Msg.MATH_ROUND).appendField(Y.Msg.TEXT_KEEP),this.appendDummyInput().appendField(Y.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(Y.Msg.MATH_ROUND_NEW_TOOLTIP)}},Jt={init:function(){var t=[[Y.Msg.MIXLY_TO_INT,"int"],[Y.Msg.MIXLY_TO_FLOAT,"float"],[Y.Msg.MIXLY_TO_BITES,"b"]];this.setColour(Rt),this.appendValueInput("VAR").appendField(new Y.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Y.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:Y.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:Y.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Kt={init:function(){var t=[[Y.Msg.MIXLY_TO_INT,"int"],[Y.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Rt),this.appendValueInput("VAR").appendField(new Y.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:Y.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:Y.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},Qt=Ht,Zt=160,te={init:function(){this.setColour(Zt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Y.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(Y.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new Y.FieldImage(e,12,12,'"')}},ee={init:function(){this.setColour(Zt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Y.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(Y.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new Y.FieldImage(e,12,12,'"')}};Y.FieldTextInput.char_validator=function(t){if(t.length>1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const ne={init:function(){this.setColour(Zt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Y.FieldTextInput("",Y.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(Y.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new Y.FieldImage(e,7,12,'"')}},ie={init:function(){this.setColour(Zt),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(Y.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},se={init:function(){this.setColour(Zt),this.appendValueInput("VAR").setCheck(Number).appendField(Y.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},re={init:function(){this.setColour(Zt),this.appendValueInput("VAR").setCheck(String).appendField(Y.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},oe={init:function(){this.setColour(Zt),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ae={init:function(){this.setColour(Zt),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},le={init:function(){this.WHERE_OPTIONS=[[Y.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Y.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Y.Msg.TEXT_GET_INDEX_RANDOM+1+Y.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(Y.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Zt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(Y.Msg.LISTS_GET_INDEX_GET,"MODE"),Y.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Y.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=t.getFieldValue("WHERE"),i="";switch(e+" "+n){case"GET FROM_START":case"GET FROM_END":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":i=Y.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(i+=" "+Y.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",Y.Msg.ONE_BASED_INDEXING?"#1":"#0")),i}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),n={FROM_START:Y.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:Y.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:Y.Msg.TEXT_GET_INDEX_RANDOM};return Y.Msg.PROCEDURES_DEFRETURN_RETURN+Y.Msg.MIXLY_MICROBIT_TYPE_STRING+n[t]+"n"+Y.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==Y.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),Y.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(Y.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new Y.FieldDropdown(this.WHERE_OPTIONS,(function(e){var n="FROM_START"==e||"FROM_END"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),Y.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},ue={init:function(){this.setHelpUrl(Y.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Zt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(Y.Msg.LISTS_GET_INDEX_GET+" "+Y.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(Y.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(Y.Msg.PROCEDURES_DEFRETURN_RETURN+Y.Msg.MIXLY_MICROBIT_TYPE_STRING+Y.Msg.LISTS_GET_INDEX_FROM_START+"n"+Y.Msg.TEXT_CHARAT2)}},ce={init:function(){this.setHelpUrl(Y.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Zt),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(Y.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(Y.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},pe={init:function(){this.WHERE_OPTIONS_1=[[Y.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Y.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Y.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Y.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Y.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Y.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Y.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Zt),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(Y.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==Y.INPUT_VALUE;t.setAttribute("at1",e);var n=this.getInput("AT2").type==Y.INPUT_VALUE;return t.setAttribute("at2",n),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),n="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,n)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),Y.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(Y.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var n=new Y.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(n){var i="FROM_START"==n||"FROM_END"==n;if(i!=e){var s=this.sourceBlock_;return s.updateAt_(t,i),s.setFieldValue(n,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(n,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},he={init:function(){this.setHelpUrl(Y.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Zt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(Y.Msg.LISTS_GET_INDEX_GET+" "+Y.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Y.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Y.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(Y.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},_e={init:function(){var t=[[Y.Msg.MIXLY_EQUALS,"==="],[Y.Msg.MIXLY_STARTSWITH,"startswith"],[Y.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(Zt),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new Y.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},de={init:function(){this.setColour(Zt),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(Y.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_COMPARETO_HELP)}},fe={init:function(){var t=[[Y.Msg.TEXT_UPPER,"upper"],[Y.Msg.TEXT_TITLE,"title"],[Y.Msg.TEXT_CAPITALIZE,"capitalize"],[Y.Msg.TEXT_SWAPCASE,"swapcase"],[Y.Msg.TEXT_LOWER,"lower"]];this.setColour(Zt),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Y.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:Y.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:Y.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:Y.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:Y.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:Y.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},me={init:function(){var t=[[Y.Msg.TEXT_LJUST,"ljust"],[Y.Msg.TEXT_CENTER,"center"],[Y.Msg.TEXT_RJUST,"rjust"]];this.setColour(Zt),this.appendValueInput("VAR").appendField(new Y.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(Y.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(Y.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},ge={init:function(){this.setColour(Zt),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(Y.Msg.MIXLY_MID+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(Y.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},be={init:function(){this.setColour(Zt),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Se={init:function(){this.setColour(Zt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(Y.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(Y.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},ke={init:function(){this.setColour(Zt),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(Y.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(Y.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},ye={init:function(){var t=[[Y.Msg.TEXT_TRIM_BOTH,"strip"],[Y.Msg.TEXT_TRIM_LEFT,"lstrip"],[Y.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(Zt),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Y.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new Y.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(Y.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:Y.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:Y.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:Y.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Te={init:function(){this.setColour(Zt),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new Y.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Y.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Sn={init:function(){this.setColour(gn),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Y.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},kn={init:function(){this.setColour(gn),this.appendDummyInput().appendField(Y.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},yn={init:function(){this.setColour(gn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_KEYS),this.setTooltip(Y.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Tn={init:function(){this.setColour(gn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Y.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(Y.Msg.DICTS_GET_TOOLTIP)}},vn={init:function(){this.setColour(gn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Y.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(Y.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(Y.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},$n={init:function(){this.setColour(gn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(Y.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},wn={init:function(){this.setColour(gn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(Y.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_DELETE_TOOLTIP)}},En={init:function(){this.setColour(gn),this.appendValueInput("DICT2").setCheck("Dict").appendField(Y.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(Y.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MID),this.setTooltip(Y.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},In={init:function(){this.setColour(gn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_CLEAR),this.setTooltip(Y.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},An={init:function(){this.setColour(gn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_ITEMS),this.setTooltip(Y.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},On={init:function(){this.setColour(gn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_VALUES),this.setTooltip(Y.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},Mn={init:function(){this.setColour(gn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_LENGTH),this.setTooltip(Y.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Cn={init:function(){this.setColour(gn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.DICT_DELDICT),this.setTooltip(Y.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Rn={init:function(){this.MODE=[[Y.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[Y.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(Y.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(gn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(Y.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=Y.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=Y.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==Y.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new Y.FieldDropdown(this.MODE,(function(e){var n="INSERT"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},xn={init:function(){this.setColour(gn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Y.Msg.DICTS_ADD_VALUE),this.setTooltip(Y.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Nn={init:function(){this.setColour(gn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(Y.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.DICTS_SETDEFAULT_TOOLTIP)}},Ln={init:function(){this.setColour(gn),this.appendDummyInput("").appendField(new Y.FieldLabel(Y.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new Y.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(Y.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Dn={init:function(){this.setColour(gn),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},Fn={init:function(){this.setColour(gn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_TO_JSON),this.setTooltip(Y.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},Pn={init:function(){this.setColour(gn),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(Y.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},Bn=210,Vn={init:function(){var t=Y.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Bn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:Y.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Y.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Y.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Y.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Y.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Y.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Un={init:function(){var t=Y.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=Y.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Bn),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new Y.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},Yn={init:function(){var t=[[Y.Msg.LOGIC_OPERATION_AND,"AND"],[Y.Msg.LOGIC_OPERATION_OR,"OR"],[Y.Msg.LOGIC_OPERATION_NOR,"NOR"],[Y.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Bn),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new Y.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:Y.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:Y.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:Y.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:Y.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},jn={init:function(){this.setColour(Bn),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(Y.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(Y.Msg.LOGIC_NEGATE_TOOLTIP)}},Gn={init:function(){var t=[[Y.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Y.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Bn),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new Y.FieldDropdown(t),"BOOL"),this.setTooltip(Y.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Xn={init:function(){this.setColour(Bn),this.setOutput(!0),this.appendDummyInput().appendField(Y.Msg.LOGIC_NULL),this.setTooltip(Y.Msg.LOGIC_NULL_TOOLTIP)}},Hn={init:function(){this.setColour(Bn),this.appendValueInput("A"),this.appendValueInput("B").appendField(Y.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(Y.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},qn={init:function(){var t=[[Y.Msg.TEXT_APPEND_TO,"in"],[Y.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Bn),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new Y.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(Y.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Y.Msg.IN)}},zn={init:function(){var t=[[Y.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[Y.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Bn),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Y.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Wn={init:function(){this.setColour(Bn),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Jn={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(Y.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Kn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_USE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=Y.Msg.MIXLY_BELONG;return n+{r:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+i+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Qn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_USE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=Y.Msg.MIXLY_BELONG,o=Y.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+i+s+o}))}},Zn={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(Y.Msg.MIXPY_TEXT_ENCODE).appendField(new Y.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_USE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,r=Y.Msg.MIXLY_BELONG,o=Y.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+r+i+s+o}))}},ti={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+Y.Msg.MIXLY_MICROBIT_TYPE_STRING+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},ei={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},ni={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+i}))}},ii={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Y.Msg.MICROBIT_PYTHON_TYPE)}},si={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.HTML_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},ri={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},oi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},ai={init:function(){this.setColour(0),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const li={init:function(){this.setColour(0),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},ui={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},ci={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},pi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,i=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+i}))}},hi={init:function(){this.setColour(0),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},_i={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(Y.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Y.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+Y.Msg.MIXLY_ESP32_SET+{mkdir:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},di={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(Y.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},fi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},mi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.HTML_FILE,"isfile"],[Y.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return Y.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+Y.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:Y.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},gi={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(Y.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Y.Msg.MIXLY_SETUP+Y.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(Y.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},bi={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(Y.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Si={init:function(){var t=q.findLegalName("",this),e=new Y.FieldTextInput(t,q.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new Y.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Y.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(Y.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(Y.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(Y.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(Y.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=Y.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),Y.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{Y.Events.enable()}},mutationToDom:function(t){var e=Y.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var n=0;n"),this.appendValueInput("style").appendField(Y.Msg.MIXLY_AIP_ATTR).setAlign(Y.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hs={init:function(){this.setColour(os),this.appendDummyInput().appendField(Y.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},_s={init:function(){this.setColour(os),this.appendDummyInput().appendField(Y.Msg.HTML_FORM_CONTENT).appendField(new Y.FieldDropdown([[Y.Msg.HTML_TEXT,"text"],[Y.Msg.HTML_EMAIL,"email"],[Y.Msg.HTML_NUMBER,"number"],[Y.Msg.HTML_PASSWORD,"password"],[Y.Msg.HTML_CHECKBOX,"checkbox"],[Y.Msg.HTML_RADIOBUTTON,"radiobutton"],[Y.Msg.HTML_BUTTON,"button"],[Y.Msg.HTML_COLOUR,"colour"],[Y.Msg.HTML_DATE,"date"],[Y.Msg.HTML_LOCALTIME,"local time"],[Y.Msg.HTML_FILE,"file"],[Y.Msg.HTML_HIDDEN,"hidden"],[Y.Msg.HTML_IMAGE,"image"],[Y.Msg.HTML_MONTH,"month"],[Y.Msg.HTML_RANGE,"range"],[Y.Msg.HTML_RESET,"reset"],[Y.Msg.HTML_SEARCH,"search"],[Y.Msg.HTML_SUBMIT,"submit"],[Y.Msg.HTML_TELEPHONENUMBER,"telephone number"],[Y.Msg.HTML_TIME,"time"],[Y.Msg.HTML_URL,"url"],[Y.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(Y.Msg.HTML_NAME).appendField(new Y.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(Y.Msg.HTML_VALUE).appendField(new Y.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(Y.Msg.MIXLY_AIP_ATTR).setAlign(Y.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ds={init:function(){this.setColour(os),this.appendDummyInput().appendField(new Y.FieldTextInput("property"),"KEY").appendField(":").appendField(new Y.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fs={init:function(){this.setColour(os),this.appendDummyInput().appendField(new Y.FieldTextInput("property"),"KEY").appendField(":").appendField(new Y.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ms={init:function(){this.setColour(os),this.appendDummyInput().appendField(Y.Msg.HTML_TEXT).appendField(new Y.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gs=160,bs={init:function(){this.setColour(gs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new Y.FieldTable(""),"TEXT")}},Ss={init:function(){this.setColour(gs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new Y.FieldMultilineInput(""),"TEXT")}},ks={init:function(){this.setColour(gs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new Y.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},ys={init:function(){this.setColour(gs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Ts={init:function(){this.setColour(gs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new Y.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},vs={init:function(){this.setColour(gs),this.appendValueInput("VALUE").appendField(Y.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},$s={init:function(){this.setColour(gs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Y.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(Y.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=Y.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_o={init:function(){this.setColour(no),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fo={init:function(){this.setColour(no),this.appendDummyInput().appendField(Y.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mo={init:function(){this.setColour(no),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},go={init:function(){this.setColour(no),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bo={init:function(){this.setColour(no);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(Y.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},So={init:function(){this.setColour(no),this.appendValueInput("FROM").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_SPLITBYDOU).appendField(Y.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Y.inputs.Align.RIGHT).appendField(Y.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},ko={init:function(){this.setColour(no);var t=[[Y.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Y.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_DISPLAY_DRAW).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Y.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},yo={init:function(){this.setColour(no);var t=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],e=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_SCATTER).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Y.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},To={init:function(){this.setColour(no);var t=[[Y.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Y.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Y.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],n=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Y.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_XY).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},vo={init:function(){this.setColour(no);var t=[[Y.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Y.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_BAR).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Y.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Y.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},$o={init:function(){this.setColour(no);var t=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Y.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PIE).appendField(Y.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Y.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Y.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Y.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},wo={init:function(){this.setColour(no),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_HIST).appendField(Y.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Y.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Eo={init:function(){this.setColour(no);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_SETTING).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_TICKS).appendField(Y.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Io={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[Y.Msg.LANG_MATH_TO_ROUND,"round"],[Y.Msg.LANG_MATH_TO_CEIL,"ceil"],[Y.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(no),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(Y.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new Y.FieldDropdown(t),"OP"),this.setTooltip(Y.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},Ao={init:function(){this.setColour(no),this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT).appendField(Y.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Oo={init:function(){this.setColour(no),this.appendValueInput("FILENAME").appendField(Y.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new Y.FieldDropdown([[Y.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[Y.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(Y.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Y.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){Y.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Mo={init:function(){this.setColour(no),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Y.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(Y.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new Y.FieldDropdown([[Y.Msg.DATAFRAME_COLUMN,"column"],[Y.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(Y.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},Co={init:function(){this.setColour(no),this.appendValueInput("FILE").setCheck(String).appendField(Y.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Ro={init:function(){this.setColour(no);var t=[[Y.Msg.TEXT_TRIM_LEFT,"right"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[Y.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.MIXLY_SETTING).appendField(Y.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_HOR).appendField(new Y.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_VER).appendField(new Y.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Y.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PL_TEXT_TOOLTIP)}},xo={init:function(){this.setColour(no),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(Y.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},No={init:function(){this.setColour(no),this.appendValueInput("SER").setCheck("Series").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lo={init:function(){this.setColour(no);var t=[[Y.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Y.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Y.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],n=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("SER").setCheck("Series").appendField(Y.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Do={init:function(){this.setColour(no),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fo={init:function(){this.setColour(no),this.appendDummyInput().appendField(Y.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Po={init:function(){this.setColour(no),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bo={init:function(){this.setColour(no),this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vo={init:function(){this.setColour(no);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(Y.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Uo={init:function(){this.setColour(no);var t=[[Y.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Y.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_DISPLAY_DRAW).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Y.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},Yo={init:function(){this.setColour(no);var t=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_SCATTER).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Y.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(t),"DOT"),this.appendDummyInput().appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},jo={init:function(){this.setColour(no);var t=[[Y.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Y.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Y.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Y.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[Y.Msg.COLOUR_RGB_BLUE,"b"],[Y.Msg.COLOUR_RGB_GREEN,"g"],[Y.Msg.COLOUR_RGB_RED,"r"],[Y.Msg.COLOUR_CYAN,"c"],[Y.Msg.COLOUR_MAGENTA,"m"],[Y.Msg.COLOUR_YELLOW,"y"],[Y.Msg.COLOUR_BLACK,"k"],[Y.Msg.COLOUR_WHITE,"w"]],n=[[Y.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Y.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Y.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PLOT_XY).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Y.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Y.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Y.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Go={init:function(){this.setColour(no);var t=[[Y.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Y.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_BAR).appendField(Y.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Y.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Y.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(Y.Msg.HTML_COLOUR).appendField(new Y.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Xo={init:function(){this.setColour(no);var t=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Y.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[Y.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Y.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_PIE).appendField(Y.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Y.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Y.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Y.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ho={init:function(){this.setColour(no),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_HIST).appendField(Y.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Y.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qo={init:function(){this.setColour(no);var t=[[Y.Msg.PYLAB_LABEL_X,"x"],[Y.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Y.Msg.MIXLY_SETTING).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(Y.Msg.mixpy_PYLAB_TICKS).appendField(Y.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Y.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},zo={init:function(){this.setColour(no),this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT).appendField(Y.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Wo={init:function(){this.setColour(no),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Y.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Jo={init:function(){this.setColour(no);var t=[[Y.Msg.TEXT_TRIM_LEFT,"right"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[Y.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Y.Msg.mixpy_PL_TEXT_CENTER,"center"],[Y.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Y.Msg.MIXLY_SETTING).appendField(Y.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Y.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_HOR).appendField(new Y.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(Y.Msg.mixpy_PL_TEXT_VER).appendField(new Y.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Y.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.mixpy_PL_TEXT_TOOLTIP)}},Ko=20,Qo={init:function(){this.setColour(Ko),this.appendValueInput("VAR").appendField(Y.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(Y.Msg.INOUT_input_TOOLTIP)}},Zo={init:function(){this.setColour(Ko),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Y.Msg.BLOCKPY_PRINT_TOOLTIP)}},ta={init:function(){this.setColour(Ko),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Y.Msg.TEXT_PRINT_TOOLTIP)}},ea={init:function(){this.setColour(Ko),this.appendValueInput("VAR").appendField(Y.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(Y.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Y.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},na={init:function(){var t=[[Y.Msg.LANG_MATH_STRING,"str"],[Y.Msg.LANG_MATH_INT,"int"],[Y.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Ko),this.appendDummyInput("").appendField(Y.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Y.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(Y.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:Y.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:Y.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:Y.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},ia={init:function(){this.setColour(Ko),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Y.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Y.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,n){return"("+t+" <= "+e+") and "+l()+"("+t+", "+e+", "+n+") or "+u()+"("+t+", "+e+", "+n+")"},Y.isNumber(i)&&Y.isNumber(s)&&Y.isNumber(r))i=parseFloat(i),s=parseFloat(s),r=Math.abs(parseFloat(r)),0==i%1&&0==s%1&&0==r%1?(i<=s?(s++,t=0==i&&1==r?s:i+", "+s,1!=r&&(t+=", "+r)):t=i+", "+--s+", -"+r,t="range("+t+")"):(t=i",GTE:">="};const np=function(t,e){var n=this.getFieldValue("OP"),i="&&"==n?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",i)||"False",r=e.valueToCode(this,"B",i)||"False";if("AND"==n)var o=s+" and "+r;else if("OR"==n)o=s+" or "+r;else if("NOR"==n)o="not("+s+"^"+r+")";else o=s+"^"+r;return[o,i]},ip=function(t,e){var n=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",n)||"False"),n]},sp=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},rp=function(t,e){return["None",e.ORDER_ATOMIC]},op=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+n+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},ap=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},lp=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},up=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},cp=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},pp=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},hp=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},_p=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},dp=function(t,e){var n=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+n+")\n"},fp=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"()",e.ORDER_ATOMIC]},mp=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},gp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},bp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},Sp=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},kp=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},yp=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},Tp=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},vp=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},$p=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},wp=function(t,e){var n=this.getFieldValue("MODE"),i=0;return i="start"==n?0:"current"==n?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+i+")\n"},Ep=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},Ip=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},Ap=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Op=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Mp=function(t,e){e.definitions_.import_os="import os";var n=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",e.ORDER_ATOMIC]},Cp=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Rp=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},xp=function(t,e){var n=e.variableDB_.getName(this.getFieldValue("NAME"),Y.Procedures.NAME_TYPE),i=e.statementToCode(this,"STACK")||" pass\n";e.INFINITE_LOOP_TRAP&&(i=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+i);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var r=[],o=0;o\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},_h=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"\n"+n+"\n"},dh=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");if("head"==i)var s="<"+i+'>\n\t\n'+n+"\n";else s="<"+i+">\n"+n+"\n";return s},fh=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"<"+i+">\n"+n+"\n"},mh=function(t,e){var n=e.statementToCode(this,"DO"),i=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+i+" >\n"+n+"\n"},gh=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},bh=function(t,e){return'"},Sh=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},kh=function(){return this.getFieldValue("TEXT")+"\n"},yh=function(t){return t.getFieldValue("TEXT")+"\n"},Th=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},vh=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},$h=function(){return""},wh=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},Eh=function(t,e){for(var n=t.getFieldValue("NAME"),i=t.hasReturn_,s=new Array(t.itemCount_),r=0;r6:\n print("路线错乱!程序有误!")\n exit()\n'},Gh=function(t,e){return["name[now] != '小科家'",e.ORDER_ATOMIC]},Xh=function(t,e){return["name[now] != '学校'",e.ORDER_ATOMIC]},Hh=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},qh=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var i="print('层数过高!不得高于6层!')\nexit()\n";else i="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return i},zh=function(t,e){var n=e.valueToCode(this,"FROM_NUM",e.ORDER_ATOMIC)||"0",i=e.valueToCode(this,"TO_NUM",e.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${i}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${i}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${i}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${i}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${i}*200+200, 400-len(_Hanoi[${i}])*27, 0.2)\n _Hanoi[${i}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},Wh=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},Jh=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},Kh=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},Qh=function(t,e){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",e.ORDER_ATOMIC]},Zh=function(t,e){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",e.ORDER_ATOMIC]},t_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},e_=function(t,e){return["len(list)>=2",e.ORDER_ATOMIC]},n_=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},i_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},s_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},r_=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},o_=function(t,e){var n=this.getFieldValue("NUM");return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},a_=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},l_=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},u_=function(t,e){e.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},c_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},p_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},h_=function(t,e){return["_rabbit < _head",e.ORDER_ATOMIC]},__=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},d_=function(t,e){return["_rabbit*4 + _chick*2 == _foot",e.ORDER_ATOMIC]},f_=function(t,e){e.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},m_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},g_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},b_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const i=[0,[1,3],[2,4],[5,7],[6]];var s="";return s+=`_S${n}.show()\ntime.sleep(1)\n`,s+=4!=n?`_Slen[${n}] = _Llen[${i[n][0]}] + _Llen[${i[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},S_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,e.ORDER_ATOMIC]},k_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),i="";return i+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},y_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},T_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},v_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},$_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},w_=function(t,e){return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,e.ORDER_ATOMIC]},E_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},I_=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},A_=function(t,e){e.definitions_.import_turtle="import turtle",e.definitions_.import_time="import time",e.definitions_.import_math="import math";var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),i=this.getFieldValue("NUM");return e.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",e.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",e.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if athis.#t.on("display",t)[0],tm.configure({output:t=>{this.#t.run("output",{content:t})},read:this.readFile.bind(this),inputfun:this.skInput.bind(this),inputfunTakesPrompt:!0,execLimit:Number.POSITIVE_INFINITY,fileread:this.fileread.bind(this),filewrite:this.filewrite.bind(this),__future__:tm.python3}),tm.builtins.value=new tm.builtin.func((function(){return tm.ffi.remapToPy(void 0===nm?5:nm)})),tm.builtins.set_value=new tm.builtin.func((function(t){nm=t.v})),tm.builtinFiles.files["./mixpy.py"]='import math\r\n\r\ndef math_map(v, al, ah, bl, bh):\r\n return bl + (bh - bl) * (v - al) / (ah - al)\r\n\r\ndef math_mean(myList):\r\n localList = [e for e in myList if type(e) == int or type(e) == float]\r\n if not localList: return\r\n return float(sum(localList)) / len(localList)\r\n\r\ndef math_median(myList):\r\n localList = sorted([e for e in myList if type(e) == int or type(e) == float])\r\n if not localList: return\r\n if len(localList) % 2 == 0:\r\n return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0\r\n else:\r\n return localList[(len(localList) - 1) // 2]\r\n\r\ndef math_modes(some_list):\r\n modes = []\r\n # Using a lists of [item, count] to keep count rather than dict\r\n # to avoid "unhashable" errors when the counted item is itself a list or dict.\r\n counts = []\r\n maxCount = 1\r\n for item in some_list:\r\n found = False\r\n for count in counts:\r\n if count[0] == item:\r\n count[1] += 1\r\n maxCount = max(maxCount, count[1])\r\n found = True\r\n if not found:\r\n counts.append([item, 1])\r\n for counted_item, item_count in counts:\r\n if item_count == maxCount:\r\n modes.append(counted_item)\r\n return modes\r\n\r\ndef math_standard_deviation(numbers):\r\n n = len(numbers)\r\n if n == 0: return\r\n mean = float(sum(numbers)) / n\r\n variance = sum((x - mean) ** 2 for x in numbers) / n\r\n return math.sqrt(variance)\r\n\r\ndef lists_sort(my_list, type, reverse):\r\n def try_float(s):\r\n try:\r\n return float(s)\r\n except:\r\n return 0\r\n key_funcs = {\r\n "NUMERIC": try_float,\r\n "TEXT": str,\r\n "IGNORE_CASE": lambda s: str(s).lower()\r\n }\r\n key_func = key_funcs[type]\r\n list_cpy = list(my_list)\r\n return sorted(list_cpy, key=key_func, reverse=reverse)'}readFile(t){if(void 0!==em[t])return tm.misceval.promiseToSuspension(fetch(em[t]).then((t=>t.text())));if(void 0===tm.builtinFiles||void 0===tm.builtinFiles.files[t])throw"File not found: '"+t+"'";return tm.builtinFiles.files[t]}fileread(t,e){return this.mixpyProject.exist(t)?this.mixpyProject.getFileContent(t):-1!==e.indexOf("w")?(this.mixpyProject.add(t,"",1),""):null}filewrite(t,e){var n=t.name;this.mixpyProject.modify(n,e),this.mixpyProject.select(n)}skInput(t){return new Promise(((e,n)=>{this.#t.run("input",{content:{prompt:t},resolve:e,reject:n})}))}reset(){tm.execLimit=Number.POSITIVE_INFINITY,tm.TurtleGraphics.reset&&tm.TurtleGraphics.reset()}kill(){window.SPRITE.kill(),tm.execLimit=0,this.executionEnd_()}step(t,e,n,i){if(".py"==i){var s=this.executionBuffer.step,r=this.parseGlobals(t);this.executionBuffer.trace.push({step:s,filename:i,line:e,column:n,properties:r.properties,modules:r.modules}),this.executionBuffer.step=s+1,this.executionBuffer.last_step=s+1,this.executionBuffer.line_number=e}}analyzeVariables(){if(""==this.main.model.programs.__main__().trim())return{}}analyze(){return this.main.model.execution.status("analyzing"),""!=this.main.model.programs.__main__().trim()||(this.main.components.feedback.emptyProgram("You haven't written any code yet!"),!1)}run(t){this.reset(),-1===t.indexOf("import sprite")&&-1===t.indexOf("from sprite import")||window.SPRITE.runit(tm.TurtleGraphics.target),this.programStatus.running=!0,tm.misceval.asyncToPromise((()=>tm.importMainWithBody("",!1,t,!0))).then((()=>{window.SPRITE.running=!1,this.programStatus.running=!1,this.#t.run("finished")})).catch((t=>{j.Debug.error(t),window.SPRITE.running=!1,this.programStatus.running=!1,this.#t.run("error",t);var e=function(t){return"string"==typeof t?t:void 0!==t.tp$str?t.tp$str().v:t.name+": "+t.message}(t);this.#t.run("finished"),-1===e.indexOf("TimeLimitError")&&this.executionEnd_()}))}setupEnvironment(t,e,n,i,s){var r=this.main.model;this._backup_execution=tm.afterSingleExecution,tm.afterSingleExecution=void 0,tm.builtins.get_output=new tm.builtin.func((function(){return tm.builtin.pyCheckArgs("get_output",arguments,0,0),tm.ffi.remapToPy(r.execution.output())})),tm.builtins.reset_output=new tm.builtin.func((function(){tm.builtin.pyCheckArgs("reset_output",arguments,0,0),r.execution.output.removeAll()})),tm.builtins.log=new tm.builtin.func((function(t){tm.builtin.pyCheckArgs("log",arguments,1,1),console.log(t)})),tm.builtins._trace=e,tm.builtins._final_values=s,tm.builtins.code=tm.ffi.remapToPy(t),tm.builtins.set_success=this.instructor_module.set_success,tm.builtins.set_feedback=this.instructor_module.set_feedback,tm.builtins.set_finished=this.instructor_module.set_finished,tm.builtins.count_components=this.instructor_module.count_components,tm.builtins.no_nonlist_nums=this.instructor_module.no_nonlist_nums,tm.builtins.only_printing_properties=this.instructor_module.only_printing_properties,tm.builtins.calls_function=this.instructor_module.calls_function,tm.builtins.get_property=this.instructor_module.get_property,tm.builtins.get_value_by_name=this.instructor_module.get_value_by_name,tm.builtins.get_value_by_type=this.instructor_module.get_value_by_type,tm.builtins.parse_json=this.instructor_module.parse_json,tm.skip_drawing=!0,r.settings.mute_printer(!0)}disposeEnvironment(){tm.afterSingleExecution=this._backup_execution,tm.builtins.get_output=void 0,tm.builtins.reset_output=void 0,tm.builtins.log=void 0,tm.builtins._trace=void 0,tm.builtins.trace=void 0,tm.builtins.code=void 0,tm.builtins.set_success=void 0,tm.builtins.set_feedback=void 0,tm.builtins.set_finished=void 0,tm.builtins.count_components=void 0,tm.builtins.calls_function=void 0,tm.builtins.get_property=void 0,tm.builtins.get_value_by_name=void 0,tm.builtins.get_value_by_type=void 0,tm.builtins.no_nonlist_nums=void 0,tm.builtins.only_printing_properties=void 0,tm.builtins.parse_json=void 0,tm.skip_drawing=!1,nm=void 0,this.main.model.settings.mute_printer(!1)}parseGlobals(t){var e=Array(),n=Array();for(var i in t){var s=t[i];if("__name__"!==i&&"__doc__"!==i){i=i.replace("_$rw$","").replace("_$rn$","");var r=this.parseValue(i,s);null!==r?e.push(r):s.constructor==tm.builtin.module&&n.push(s.$d.__name__.v)}}return{properties:e,modules:n}}parseValue(t,e){if(null==e)return{name:t,type:"Unknown",value:"Undefined"};switch(e.constructor){case tm.builtin.func:return{name:t,type:"Function",value:void 0!==e.func_code.co_varnames?" Arguments: "+e.func_code.co_varnames.join(", "):" No arguments"};case tm.builtin.module:return null;case tm.builtin.str:return{name:t,type:"String",value:e.$r().v};case tm.builtin.none:return{name:t,type:"None",value:"None"};case tm.builtin.bool:return{name:t,type:"Boolean",value:e.$r().v};case tm.builtin.nmber:return{name:t,type:"int"==e.skType?"Integer":"Float",value:e.$r().v};case tm.builtin.int_:return{name:t,type:"Integer",value:e.$r().v};case tm.builtin.float_:return{name:t,type:"Float",value:e.$r().v};case tm.builtin.tuple:return{name:t,type:"Tuple",value:e.$r().v};case tm.builtin.list:return e.v.length<=20?{name:t,type:"List",value:e.$r().v,exact_value:e}:{name:t,type:"List",value:"[... "+e.v.length+" elements ...]",exact_value:e};case tm.builtin.dict:return{name:t,type:"Dictionary",value:e.$r().v};case Number:return{name:t,type:e%1==0?"Integer":"Float",value:e};case String:return{name:t,type:"String",value:e};case Boolean:return{name:t,type:"Boolean",value:e?"True":"False"};default:return{name:t,type:null==e.tp$name?e:e.tp$name,value:null==e.$r?e:e.$r().v}}}}const sm=$;var rm=n.n(sm);class om extends j.PageBase{static{j.HTMLTemplate.add("html/statusbar/statusbar-image.html",new j.HTMLTemplate('\r\n
\r\n
\r\n
')),this.init=function(){j.StatusBarsManager.typesRegistry.register(["images"],om);const t=j.Workspace.getMain().getStatusBarsManager();t.add("images","images","图像"),t.changeTo("output")}}constructor(){super();const t=rm()(j.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(t)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(t){const e=this.getContent(),n=function(t){t.style.width="auto",t.style.height="auto",t.style.maxWidth="100%",t.style.maxHeight="100%"};this.clean();let i=t.content,s=null,r=null;switch(t.display_type){case"p5":i.style.width="100%",i.style.height="100%",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",new MutationObserver((function(t){t.forEach((t=>t.addedNodes.forEach((t=>{const e=t;null!=e.tagName&&["canvas","video"].includes(e.tagName.toLowerCase())&&n(e)}))))})).observe(i,{childList:!0}),i.querySelectorAll("canvas,video").forEach(n),e.append(i);break;case"matplotlib":s=i.querySelector("canvas"),s&&(i=s),i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"ocaml-canvas":i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"turtle":i.setAttribute("width","100%"),i.setAttribute("height","100%"),e.append(i.outerHTML);break;case"sympy":e.append(t.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let t=document.createElement("script");t.type="text/javascript",t.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(t)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in t.content){let i=t.content[n];"image/png"===n&&(i=''),e.append(i);break}break;case"tutor":if(e.append(rm()(t.content.replace("overflow-y%3A%20hidden%3B",""))),r=this.getContent()[0].getElementsByTagName("iframe")[0],null==r)return;r.style.maxHeight=r.style.minHeight="100%",new IntersectionObserver(((t,e)=>{const n=t[0];n&&!n.isIntersecting||(r.contentWindow?.postMessage({type:"redraw"},"*"),e.disconnect())})).observe(r);break;default:console.error(`Not supported node type '${t.display_type}' in eval.display result processing.`)}}}const am=om;class lm{static{this.pythonShell=null,this.init=async function(){am.init(),this.pythonShell=new lm},this.run=function(){const t=j.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(t)},this.stop=function(){return this.pythonShell.stop()}}#e=null;#n=null;#i=null;#s={row:0,column:0};#r="";#o=null;#a=null;#l=!1;#u=!1;#c=null;#p=()=>this.#h();#_=[{name:"REPL-Enter",bindKey:"Enter",exec:t=>{if(t.getSession().selection.getCursor().row===this.#s.row){const t=this.#e.getEndPos();let e=this.#e.getValueRange(this.#s,t);return e=e.replace(this.#r,""),this.#o?.(e),this.#o=null,this.#a=null,this.#e.addValue("\n"),this.#d(),!0}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:t=>{const e=t.getSession().selection.getCursor();return e.row{this.#u=!1,this.#e.addValue(`\n==${j.Msg.Lang["shell.finish"]}==`)})),t.bind("output",(t=>{this.#e.addValue(t.content)})),t.bind("error",(t=>{this.#u=!1,this.#e.addValue(`\n${t.toString()}\n`)})),t.bind("input",(t=>{const e=String(t?.content?.prompt);this.#e.addValue(`>>> ${e}`),this.#r=e,this.#o=t.resolve,this.#a=t.reject,this.#m()})),t.bind("display",(t=>{this.#i.changeTo("images"),this.#n.display(t)}))}#h(){const t=this.#e.getEditor(),e=t.getSession().selection.getCursor();t.setReadOnly(e.rowsetTimeout(e,t)))}}const um=lm,cm={init:function(){um.init();const t=j.app.getNav();t.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:Y.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{um.run().catch(j.Debug.error)},scopeType:j.Nav.Scope.LEFT,weight:4}),t.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:Y.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{um.stop().catch(j.Debug.error)},scopeType:j.Nav.Scope.LEFT,weight:5})}};cm.init(),Object.assign(Y.Variables,X),Object.assign(Y.Procedures,q),Y.Python=J,Y.generator=J,j.Profile.default={},Object.assign(Y.Blocks,t,e,i,s,r,o,a,l,u,c,p,h,_,d,f,m,g,b,S,k),Object.assign(Y.Python.forBlock,y,T,v,w,E,I,A,O,M,C,R,x,N,L,D,F,P,B,V,U)})()})(); \ No newline at end of file diff --git a/boards/default/python_skulpt/styles/main.9b186880.css b/boards/default/python_skulpt/styles/main.2d9c79ea.css similarity index 100% rename from boards/default/python_skulpt/styles/main.9b186880.css rename to boards/default/python_skulpt/styles/main.2d9c79ea.css diff --git a/boards/default/python_skulpt_car/index.xml b/boards/default/python_skulpt_car/index.xml index 88702257..f8b0de9d 100644 --- a/boards/default/python_skulpt_car/index.xml +++ b/boards/default/python_skulpt_car/index.xml @@ -1 +1 @@ -promptHelloHelloHello,HelloMixly2100,1,2,3051i90x151100a10.998124.821100101010001100501100110000x2x0,1,2,30,1,2,30,1,2,3xMixlyHelloMixly65axMixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixpyI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')dirmylist1,2,3,4,5mylist0mylist02mylist00mylist0101mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistx0,1,2,30,1,2,3mytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}s11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2x0 \ No newline at end of file +promptHelloHelloHello,HelloMixly2100,1,2,3051i90x151100a10.998124.821100101010001100501100110000x2x0,1,2,30,1,2,30,1,2,3xMixlyHelloMixly65axMixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixpyI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')dirmylist1,2,3,4,5mylist0mylist02mylist00mylist0101mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistx0,1,2,30,1,2,3mytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}s11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2x0 \ No newline at end of file diff --git a/boards/default/python_skulpt_car/main.bundle.js b/boards/default/python_skulpt_car/main.bundle.js index 8ca64ca0..85721a7c 100644 --- a/boards/default/python_skulpt_car/main.bundle.js +++ b/boards/default/python_skulpt_car/main.bundle.js @@ -1,4 +1,4 @@ -(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{controls_type:()=>Z,controls_typeLists:()=>z,variables_change:()=>Q,variables_get:()=>j,variables_global:()=>J,variables_set:()=>q});var i={};t.r(i),t.d(i,{base_setup:()=>et,controls_delay:()=>it,controls_end_program:()=>nt,controls_except:()=>Ot,controls_finally:()=>Et,controls_flow_statements:()=>ut,controls_for:()=>lt,controls_forEach:()=>_t,controls_for_range:()=>rt,controls_if:()=>st,controls_if_else:()=>It,controls_if_elseif:()=>dt,controls_if_if:()=>Tt,controls_lambda:()=>ct,controls_main:()=>tt,controls_pass:()=>Rt,controls_range:()=>ot,controls_repeat_ext:()=>Mt,controls_thread:()=>mt,controls_try:()=>ht,controls_try_finally:()=>at,controls_whileUntil:()=>pt,do_while:()=>gt,garbage_collection:()=>At,get_mem_alloc:()=>Lt,get_mem_free:()=>Ct});var n={};t.r(n),t.d(n,{base_map:()=>Kt,math_arithmetic:()=>ft,math_bit:()=>vt,math_constant:()=>Nt,math_constant_mp:()=>Pt,math_constrain:()=>Xt,math_dec:()=>Yt,math_indexer_number:()=>xt,math_map:()=>Bt,math_max_min:()=>bt,math_number:()=>Dt,math_number_base_conversion:()=>kt,math_random:()=>Ut,math_random_seed:()=>Gt,math_round:()=>wt,math_selfcalcu:()=>Ft,math_to_int:()=>yt,math_trig:()=>Vt,text_to_number:()=>Ht,text_to_number_skulpt:()=>Wt});var s={};t.r(s),t.d(s,{ascii_to_char:()=>zt,char_to_ascii:()=>$t,number_to_text:()=>te,os_system:()=>Ce,text:()=>qt,text_capital:()=>ue,text_center:()=>le,text_char:()=>Jt,text_char_at:()=>ne,text_char_at2:()=>ie,text_char_at3:()=>me,text_compareTo:()=>Re,text_compare_to:()=>ae,text_create_with_container:()=>Ee,text_create_with_item:()=>Me,text_encode:()=>Ae,text_equals_starts_ends:()=>pe,text_eval:()=>Le,text_find:()=>re,text_format:()=>Oe,text_format_noreturn:()=>ge,text_join:()=>Zt,text_join_seq:()=>Te,text_length:()=>ee,text_random_char:()=>se,text_replace:()=>de,text_split:()=>Ie,text_strip:()=>he,text_substring:()=>_e,text_substring2:()=>oe,text_substring3:()=>ce,text_textarea:()=>Qt});var o={};t.r(o),t.d(o,{list_many_input:()=>qe,list_tolist:()=>ei,list_tolist2:()=>ui,list_trig:()=>We,lists_2d_get_col_row_data:()=>fe,lists_2d_get_data_with_col_row:()=>Pe,lists_append_extend:()=>be,lists_change_to:()=>je,lists_change_to_general:()=>Je,lists_clear:()=>xe,lists_create_with:()=>Fe,lists_create_with2:()=>ii,lists_create_with_container:()=>Ve,lists_create_with_item:()=>Ye,lists_create_with_noreturn:()=>Qe,lists_create_with_text:()=>ve,lists_create_with_text2:()=>ni,lists_del_general:()=>Ze,lists_find:()=>He,lists_getIndex3:()=>si,lists_getSublist3:()=>oi,lists_get_index:()=>De,lists_get_random_item:()=>ke,lists_get_random_sublist:()=>Ue,lists_get_sublist:()=>Ne,lists_insert_value:()=>Xe,lists_insert_value2:()=>pi,lists_pop:()=>we,lists_remove_at:()=>Ge,lists_remove_at2:()=>ai,lists_reverse:()=>Be,lists_setIndex3:()=>_i,lists_set_index:()=>ye,lists_sort:()=>Ke,lists_zip:()=>ze,lists_zip_container:()=>$e,lists_zip_item:()=>ti});var _={};t.r(_),t.d(_,{dicts_add_change_del:()=>Ci,dicts_add_or_change:()=>Ei,dicts_clear:()=>Ri,dicts_create_with:()=>ri,dicts_create_with_container:()=>Ti,dicts_create_with_item:()=>di,dicts_create_with_noreturn:()=>Ni,dicts_deldict:()=>Li,dicts_delete:()=>Mi,dicts_get:()=>hi,dicts_get_default:()=>Oi,dicts_items:()=>mi,dicts_keys:()=>Ii,dicts_length:()=>Ai,dicts_pop:()=>Si,dicts_setdefault:()=>Di,dicts_to_json:()=>fi,dicts_todict:()=>Pi,dicts_update:()=>ci,dicts_values:()=>gi,json_to_dicts:()=>Fi});var p={};t.r(p),t.d(p,{logic_boolean:()=>ki,logic_compare:()=>Vi,logic_compare_continous:()=>Yi,logic_is:()=>xi,logic_is_in:()=>Bi,logic_negate:()=>bi,logic_null:()=>Ui,logic_operation:()=>yi,logic_tobool:()=>Gi,logic_true_or_false:()=>Xi});var a={};t.r(a),t.d(a,{sdcard_mount:()=>Tn,sdcard_use_spi_init:()=>rn,storage_can_write_ornot:()=>Zi,storage_change_dir:()=>un,storage_close_file:()=>$i,storage_delete_file:()=>en,storage_file_seek:()=>on,storage_file_tell:()=>sn,storage_file_write:()=>ji,storage_fileopen:()=>Hi,storage_fileopen_new:()=>Wi,storage_fileopen_new_encoding:()=>Ki,storage_get_a_line:()=>Ji,storage_get_contents:()=>Qi,storage_get_contents_without_para:()=>qi,storage_get_current_dir:()=>_n,storage_get_file_size:()=>nn,storage_get_filename:()=>zi,storage_is_file:()=>ln,storage_list_all_files:()=>tn,storage_make_dir:()=>pn,storage_open_file_with_os:()=>wi,storage_rename:()=>an});var u={};t.r(u),t.d(u,{procedures_callnoreturn:()=>En,procedures_callreturn:()=>Mn,procedures_defnoreturn:()=>dn,procedures_defreturn:()=>In,procedures_ifreturn:()=>cn,procedures_mutatorarg:()=>On,procedures_mutatorcontainer:()=>hn,procedures_return:()=>Rn});var l={};t.r(l),t.d(l,{tuple_change_to:()=>vn,tuple_create_with:()=>gn,tuple_create_with_container:()=>An,tuple_create_with_item:()=>Ln,tuple_create_with_noreturn:()=>bn,tuple_create_with_text2:()=>Cn,tuple_create_with_text_return:()=>Sn,tuple_del:()=>Pn,tuple_find:()=>Vn,tuple_getIndex:()=>Dn,tuple_getSublist:()=>yn,tuple_get_random_item:()=>Un,tuple_get_sublist:()=>kn,tuple_join:()=>fn,tuple_length:()=>Nn,tuple_max:()=>Fn,tuple_totuple:()=>Xn,tuple_trig:()=>Yn});var r={};t.r(r),t.d(r,{set_add_discard:()=>Qn,set_clear:()=>Kn,set_create_with:()=>xn,set_create_with_container:()=>Gn,set_create_with_item:()=>wn,set_create_with_text_return:()=>zn,set_length:()=>Hn,set_operate:()=>jn,set_operate_update:()=>qn,set_pop:()=>Wn,set_sub:()=>Jn,set_toset:()=>$n,set_update:()=>Zn});var T={};t.r(T),t.d(T,{html_content:()=>ss,html_content_more:()=>os,html_document:()=>es,html_form:()=>ps,html_head_body:()=>ns,html_style:()=>_s,html_style_color:()=>us,html_style_content:()=>as,html_text:()=>ls,html_title:()=>is});var d={};t.r(d),t.d(d,{attribute_access:()=>Ls,function_call:()=>ms,function_call_container:()=>gs,function_call_item:()=>As,raw_block:()=>ds,raw_empty:()=>hs,raw_expression:()=>Is,raw_table:()=>Ts,text_comment:()=>Os,text_print_multiple:()=>Ms,text_print_multiple_container:()=>cs,text_print_multiple_item:()=>Rs,type_check:()=>Es});var I={};t.r(I),t.d(I,{array_create:()=>xs,array_toarray:()=>eo,dataframe_create:()=>Ns,dataframe_create_from_index:()=>fs,dataframe_create_from_one_index:()=>Ps,dataframe_get:()=>zs,numpy_trig:()=>Qs,pandas_readcsv:()=>Zs,pl_axes:()=>ks,pl_bar:()=>Ws,pl_hist:()=>js,pl_label:()=>Bs,pl_legend:()=>Us,pl_pie:()=>Ks,pl_plot:()=>ys,pl_plot_bar:()=>Gs,pl_plot_easy:()=>Ys,pl_plot_scatter:()=>ws,pl_plot_xy:()=>Hs,pl_savefig:()=>$s,pl_show:()=>bs,pl_subplot:()=>Js,pl_text:()=>to,pl_ticks:()=>qs,pl_title:()=>Xs,plot_axes:()=>oo,plot_bar:()=>To,plot_hist:()=>ho,plot_label:()=>ao,plot_legend:()=>_o,plot_pie:()=>Io,plot_plot:()=>no,plot_plot_bar:()=>uo,plot_plot_easy:()=>io,plot_plot_scatter:()=>lo,plot_plot_xy:()=>ro,plot_savefig:()=>Mo,plot_show:()=>so,plot_subplot:()=>Eo,plot_text:()=>co,plot_ticks:()=>Oo,plot_title:()=>po,series_create:()=>Ss,series_create_from_index:()=>Ds,series_create_from_text:()=>Fs,series_get_num:()=>Vs,series_index_value:()=>vs});var h={};t.r(h),t.d(h,{inout_input:()=>mo,inout_print:()=>go,inout_print_container:()=>Do,inout_print_end:()=>Lo,inout_print_inline:()=>Ao,inout_print_item:()=>No,inout_print_many:()=>So,inout_type_input:()=>Co});var O={};t.r(O),t.d(O,{Panic_with_status_code:()=>Vo,base_delay:()=>fo,controls_millis:()=>Fo,controls_mstimer2:()=>yo,controls_mstimer2_start:()=>bo,controls_mstimer2_stop:()=>ko,reset:()=>Yo,time_localtime:()=>vo,time_sleep:()=>Uo});var E={};t.r(E),t.d(E,{turtle_bgcolor:()=>o_,turtle_bgcolor_hex:()=>I_,turtle_bgcolor_hex_new:()=>u_,turtle_circle:()=>i_,turtle_circle_advanced:()=>n_,turtle_clear:()=>Jo,turtle_clone:()=>a_,turtle_color:()=>T_,turtle_color_hex:()=>d_,turtle_color_seclet:()=>L_,turtle_create:()=>Bo,turtle_done:()=>xo,turtle_exitonclick:()=>Go,turtle_fill:()=>zo,turtle_fillcolor:()=>p_,turtle_fillcolor_hex:()=>O_,turtle_fillcolor_hex_new:()=>r_,turtle_getscreen:()=>C_,turtle_goto:()=>jo,turtle_listen:()=>P_,turtle_move:()=>wo,turtle_numinput:()=>c_,turtle_onclick:()=>D_,turtle_onkey:()=>S_,turtle_ontimer:()=>N_,turtle_pencolor:()=>__,turtle_pencolor_hex:()=>h_,turtle_pencolor_hex_new:()=>l_,turtle_penup:()=>Zo,turtle_pos_shape:()=>Qo,turtle_rotate:()=>Ho,turtle_screen_delay:()=>Ko,turtle_screen_savefig:()=>f_,turtle_setheading:()=>Wo,turtle_setxy:()=>qo,turtle_shape:()=>E_,turtle_shapesize:()=>M_,turtle_size:()=>t_,turtle_size_speed:()=>$o,turtle_speed:()=>e_,turtle_textinput:()=>R_,turtle_visible:()=>s_,turtle_write:()=>m_,turtle_write_format:()=>g_,turtle_write_format_skulpt:()=>A_});var M={};t.r(M),t.d(M,{Turn:()=>B_,addOil:()=>ip,game_get_character_img:()=>q_,game_get_local_img:()=>H_,game_get_path_img:()=>K_,game_init:()=>U_,get_actor_point:()=>J_,initSettedMap_1:()=>F_,initSettedMap_2:()=>v_,initSettedMap_3:()=>V_,initSettedMap_4:()=>Y_,initSettedMap_5:()=>y_,initSettedMap_6:()=>b_,initSettedMap_7:()=>k_,initialize:()=>Q_,isBarrier:()=>Z_,isCirculationRight:()=>np,isDone:()=>x_,isLightGreen:()=>tp,isLightRed:()=>ep,isOilFull:()=>$_,isPath:()=>G_,move_direction_steps:()=>X_,place_item:()=>j_,randomOil:()=>z_,set_map:()=>w_,set_pathtype:()=>W_});var c={};t.r(c),t.d(c,{controls_type:()=>ap,controls_typeLists:()=>up,variables_change:()=>_p,variables_get:()=>sp,variables_global:()=>pp,variables_set:()=>op});var R={};t.r(R),t.d(R,{Panic_with_status_code:()=>cp,base_setup:()=>rp,controls_delay:()=>Mp,controls_flow_statements:()=>Ep,controls_for:()=>Ip,controls_forEach:()=>Lp,controls_for_range:()=>hp,controls_if:()=>Tp,controls_interrupts:()=>gp,controls_lambda:()=>Sp,controls_main:()=>lp,controls_millis:()=>Rp,controls_nointerrupts:()=>Ap,controls_pass:()=>Np,controls_range:()=>Cp,controls_repeat:()=>yp,controls_repeat_ext:()=>Fp,controls_thread:()=>Pp,controls_try_finally:()=>dp,controls_whileUntil:()=>Op,do_while:()=>fp,garbage_collection:()=>vp,get_mem_alloc:()=>Vp,get_mem_free:()=>Yp,reset:()=>mp,time_sleep:()=>Dp});var m={};t.r(m),t.d(m,{base_map:()=>ia,math_arithmetic:()=>Bp,math_bit:()=>Xp,math_constant:()=>kp,math_constant_mp:()=>Up,math_constrain:()=>Qp,math_dec:()=>Hp,math_indexer_number:()=>zp,math_map:()=>qp,math_max_min:()=>Kp,math_number:()=>bp,math_number_base_conversion:()=>Jp,math_random:()=>jp,math_random_seed:()=>Zp,math_round:()=>$p,math_selfcalcu:()=>xp,math_single:()=>Gp,math_to_int:()=>Wp,math_trig:()=>wp,text_to_number:()=>ta,text_to_number_skulpt:()=>ea});var g={};t.r(g),t.d(g,{ascii_to_char:()=>pa,char_to_ascii:()=>aa,number_to_text:()=>ua,os_system:()=>va,text:()=>na,text_capital:()=>Ma,text_center:()=>ca,text_char:()=>oa,text_char_at:()=>Ta,text_char_at2:()=>ra,text_char_at3:()=>Pa,text_compareTo:()=>Na,text_compare_to:()=>ha,text_encode:()=>fa,text_equals_starts_ends:()=>Ia,text_eval:()=>Fa,text_find:()=>Ra,text_format:()=>Ca,text_format_noreturn:()=>Sa,text_join:()=>_a,text_join_seq:()=>ma,text_length:()=>la,text_random_char:()=>da,text_replace:()=>ga,text_split:()=>Aa,text_strip:()=>La,text_substring:()=>Ea,text_substring2:()=>Oa,text_substring3:()=>Da,text_textarea:()=>sa});var A={};t.r(A),t.d(A,{list_many_input:()=>za,list_tolist:()=>lu,list_tolist2:()=>ru,list_trig:()=>Qa,lists_2d_get_col_row_data:()=>ya,lists_2d_get_data_with_col_row:()=>Ya,lists_append_extend:()=>Ba,lists_change_to:()=>Za,lists_change_to_general:()=>tu,lists_clear:()=>Wa,lists_create_with:()=>ba,lists_create_with2:()=>iu,lists_create_with_noreturn:()=>$a,lists_create_with_text:()=>ka,lists_create_with_text2:()=>nu,lists_del_general:()=>eu,lists_find:()=>Ka,lists_getIndex3:()=>su,lists_getSublist3:()=>ou,lists_get_index:()=>Ua,lists_get_random_item:()=>xa,lists_get_random_sublist:()=>Ga,lists_get_sublist:()=>Va,lists_insert_value:()=>wa,lists_insert_value2:()=>pu,lists_pop:()=>qa,lists_remove_at:()=>ja,lists_remove_at2:()=>au,lists_reverse:()=>Ha,lists_setIndex3:()=>_u,lists_set_index:()=>Xa,lists_sort:()=>Ja,lists_zip:()=>uu});var L={};t.r(L),t.d(L,{dicts_add_change_del:()=>Lu,dicts_add_or_change:()=>Ou,dicts_clear:()=>cu,dicts_create_with:()=>Tu,dicts_create_with_noreturn:()=>Du,dicts_deldict:()=>Au,dicts_delete:()=>Eu,dicts_get:()=>Iu,dicts_get_default:()=>hu,dicts_items:()=>Ru,dicts_keys:()=>du,dicts_length:()=>gu,dicts_pop:()=>Cu,dicts_setdefault:()=>Su,dicts_to_json:()=>Pu,dicts_todict:()=>Nu,dicts_update:()=>Mu,dicts_values:()=>mu,json_to_dicts:()=>fu});var C={};t.r(C),t.d(C,{logic_boolean:()=>yu,logic_compare:()=>Fu,logic_compare_continous:()=>vu,logic_is:()=>Xu,logic_is_in:()=>Uu,logic_negate:()=>Yu,logic_null:()=>bu,logic_operation:()=>Vu,logic_tobool:()=>Bu,logic_true_or_false:()=>ku});var S={};t.r(S),t.d(S,{sdcard_mount:()=>ul,sdcard_use_spi_init:()=>al,storage_can_write_ornot:()=>Qu,storage_change_dir:()=>nl,storage_close_file:()=>Zu,storage_delete_file:()=>$u,storage_file_seek:()=>il,storage_file_tell:()=>el,storage_file_write:()=>Wu,storage_fileopen:()=>Gu,storage_fileopen_new:()=>wu,storage_fileopen_new_encoding:()=>Hu,storage_get_a_line:()=>qu,storage_get_contents:()=>ju,storage_get_contents_without_para:()=>Ku,storage_get_current_dir:()=>sl,storage_get_file_size:()=>tl,storage_get_filename:()=>Ju,storage_is_file:()=>pl,storage_list_all_files:()=>zu,storage_make_dir:()=>ol,storage_open_file_with_os:()=>xu,storage_rename:()=>_l});var D={};t.r(D),t.d(D,{procedures_callnoreturn:()=>dl,procedures_callreturn:()=>Tl,procedures_defnoreturn:()=>rl,procedures_defreturn:()=>ll,procedures_ifreturn:()=>Il,procedures_return:()=>hl});var N={};t.r(N),t.d(N,{tuple_change_to:()=>Ll,tuple_create_with:()=>Ol,tuple_create_with_noreturn:()=>Nl,tuple_create_with_text2:()=>El,tuple_create_with_text_return:()=>Ml,tuple_del:()=>ml,tuple_find:()=>Cl,tuple_getIndex:()=>cl,tuple_getSublist:()=>Dl,tuple_get_random_item:()=>fl,tuple_get_sublist:()=>Pl,tuple_join:()=>gl,tuple_length:()=>Rl,tuple_max:()=>Al,tuple_totuple:()=>Fl,tuple_trig:()=>Sl});var P={};t.r(P),t.d(P,{set_add_discard:()=>Ul,set_clear:()=>yl,set_create_with:()=>vl,set_create_with_text_return:()=>xl,set_length:()=>Vl,set_operate:()=>bl,set_operate_update:()=>kl,set_pop:()=>Yl,set_sub:()=>Xl,set_toset:()=>Gl,set_update:()=>Bl});var f={};t.r(f),t.d(f,{html_content:()=>Kl,html_content_more:()=>jl,html_document:()=>wl,html_form:()=>Ql,html_head_body:()=>Wl,html_style:()=>ql,html_style_content:()=>Jl,html_text:()=>Zl,html_title:()=>Hl});var F={};t.r(F),t.d(F,{attribute_access:()=>sr,function_call:()=>nr,raw_block:()=>zl,raw_empty:()=>tr,raw_expression:()=>$l,raw_table:()=>er,type_check:()=>ir});var v={};t.r(v),t.d(v,{array_create:()=>Rr,array_toarray:()=>Yr,dataframe_create:()=>pr,dataframe_create_from_index:()=>ar,dataframe_create_from_one_index:()=>ur,dataframe_get:()=>Fr,numpy_trig:()=>Nr,pandas_readcsv:()=>fr,pl_axes:()=>Ir,pl_bar:()=>Lr,pl_hist:()=>Sr,pl_label:()=>cr,pl_legend:()=>Er,pl_pie:()=>Cr,pl_plot:()=>Or,pl_plot_bar:()=>mr,pl_plot_easy:()=>hr,pl_plot_scatter:()=>gr,pl_plot_xy:()=>Ar,pl_savefig:()=>vr,pl_show:()=>dr,pl_subplot:()=>Pr,pl_text:()=>Vr,pl_ticks:()=>Dr,pl_title:()=>Mr,plot_axes:()=>br,plot_bar:()=>Wr,plot_hist:()=>jr,plot_label:()=>xr,plot_legend:()=>Xr,plot_pie:()=>Kr,plot_plot:()=>Ur,plot_plot_bar:()=>Gr,plot_plot_easy:()=>kr,plot_plot_scatter:()=>wr,plot_plot_xy:()=>Hr,plot_savefig:()=>Jr,plot_show:()=>yr,plot_subplot:()=>Qr,plot_text:()=>Zr,plot_ticks:()=>qr,plot_title:()=>Br,series_create:()=>or,series_create_from_index:()=>_r,series_create_from_text:()=>lr,series_get_num:()=>Tr,series_index_value:()=>rr});var V={};t.r(V),t.d(V,{inout_input:()=>zr,inout_print:()=>$r,inout_print_end:()=>eT,inout_print_inline:()=>tT,inout_print_many:()=>nT,inout_type_input:()=>iT});var Y={};t.r(Y),t.d(Y,{controls_end_program:()=>oT,controls_millis:()=>sT,time_localtime:()=>_T});var y={};t.r(y),t.d(y,{turtle_bgcolor:()=>ST,turtle_bgcolor_hex:()=>fT,turtle_bgcolor_hex_new:()=>VT,turtle_circle:()=>gT,turtle_circle_advanced:()=>LT,turtle_clear:()=>OT,turtle_clone:()=>PT,turtle_color:()=>kT,turtle_color_hex:()=>bT,turtle_color_seclet:()=>WT,turtle_create:()=>pT,turtle_done:()=>aT,turtle_exitonclick:()=>uT,turtle_fill:()=>MT,turtle_fillcolor:()=>NT,turtle_fillcolor_hex:()=>vT,turtle_fillcolor_hex_new:()=>yT,turtle_getscreen:()=>KT,turtle_goto:()=>IT,turtle_listen:()=>JT,turtle_move:()=>lT,turtle_numinput:()=>xT,turtle_onclick:()=>qT,turtle_onkey:()=>jT,turtle_ontimer:()=>QT,turtle_pencolor:()=>DT,turtle_pencolor_hex:()=>FT,turtle_pencolor_hex_new:()=>YT,turtle_penup:()=>ET,turtle_pos_shape:()=>hT,turtle_rotate:()=>rT,turtle_screen_delay:()=>dT,turtle_screen_savefig:()=>ZT,turtle_setheading:()=>TT,turtle_setxy:()=>AT,turtle_shape:()=>UT,turtle_shapesize:()=>XT,turtle_size:()=>RT,turtle_size_speed:()=>cT,turtle_speed:()=>mT,turtle_textinput:()=>BT,turtle_visible:()=>CT,turtle_write:()=>GT,turtle_write_format:()=>wT,turtle_write_format_skulpt:()=>HT});var b={};t.r(b),t.d(b,{Turn:()=>pd,addOil:()=>Ad,game_get_character_img:()=>dd,game_get_local_img:()=>rd,game_get_path_img:()=>Od,game_init:()=>zT,get_actor_point:()=>ld,initSettedMap_1:()=>td,initSettedMap_2:()=>ed,initSettedMap_3:()=>id,initSettedMap_4:()=>nd,initSettedMap_5:()=>sd,initSettedMap_6:()=>od,initSettedMap_7:()=>_d,initialize:()=>Id,isBarrier:()=>Md,isCirculationRight:()=>Ld,isDone:()=>ad,isLightGreen:()=>md,isLightRed:()=>gd,isOilFull:()=>Rd,isPath:()=>ud,move_direction_steps:()=>$T,place_item:()=>hd,randomOil:()=>cd,set_map:()=>Td,set_pathtype:()=>Ed});const k=Blockly,U=Mixly,X={NAME_TYPE:"VARIABLE",allVariables:function(t){var e;if(t.getDescendants)e=t.getDescendants();else{if(!t.getAllBlocks)throw"Not Block or Workspace: "+t;e=t.getAllBlocks()}for(var i=Object.create(null),n=0;n1&&(_+=n)):i=_}else i="i";return i}},B=X,x={};x.NAME_TYPE=k.PROCEDURE_CATEGORY_NAME,x.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{controls_type:()=>Z,controls_typeLists:()=>z,variables_change:()=>Q,variables_get:()=>j,variables_global:()=>J,variables_set:()=>q});var i={};t.r(i),t.d(i,{base_setup:()=>et,controls_delay:()=>it,controls_end_program:()=>nt,controls_except:()=>Ot,controls_finally:()=>Et,controls_flow_statements:()=>ut,controls_for:()=>lt,controls_forEach:()=>_t,controls_for_range:()=>rt,controls_if:()=>st,controls_if_else:()=>It,controls_if_elseif:()=>dt,controls_if_if:()=>Tt,controls_lambda:()=>ct,controls_main:()=>tt,controls_pass:()=>Rt,controls_range:()=>ot,controls_repeat_ext:()=>Mt,controls_thread:()=>mt,controls_try:()=>ht,controls_try_finally:()=>at,controls_whileUntil:()=>pt,do_while:()=>gt,garbage_collection:()=>At,get_mem_alloc:()=>Lt,get_mem_free:()=>Ct,get_unique_identifier:()=>St});var n={};t.r(n),t.d(n,{base_map:()=>jt,math_arithmetic:()=>Ft,math_bit:()=>Vt,math_constant:()=>Pt,math_constant_mp:()=>ft,math_constrain:()=>Bt,math_dec:()=>yt,math_indexer_number:()=>Gt,math_map:()=>xt,math_max_min:()=>kt,math_number:()=>Nt,math_number_base_conversion:()=>Ut,math_random:()=>Xt,math_random_seed:()=>wt,math_round:()=>Ht,math_selfcalcu:()=>vt,math_to_int:()=>bt,math_trig:()=>Yt,text_to_number:()=>Wt,text_to_number_skulpt:()=>Kt});var s={};t.r(s),t.d(s,{ascii_to_char:()=>$t,char_to_ascii:()=>te,number_to_text:()=>ee,os_system:()=>Se,text:()=>Qt,text_capital:()=>le,text_center:()=>re,text_char:()=>Zt,text_char_at:()=>se,text_char_at2:()=>ne,text_char_at3:()=>ge,text_compareTo:()=>me,text_compare_to:()=>ue,text_create_with_container:()=>Me,text_create_with_item:()=>ce,text_encode:()=>Le,text_equals_starts_ends:()=>ae,text_eval:()=>Ce,text_find:()=>Te,text_format:()=>Ee,text_format_noreturn:()=>Ae,text_join:()=>zt,text_join_seq:()=>de,text_length:()=>ie,text_random_char:()=>oe,text_replace:()=>Ie,text_split:()=>he,text_strip:()=>Oe,text_substring:()=>pe,text_substring2:()=>_e,text_substring3:()=>Re,text_textarea:()=>Jt});var o={};t.r(o),t.d(o,{list_many_input:()=>Qe,list_tolist:()=>ii,list_tolist2:()=>li,list_trig:()=>Ke,lists_2d_get_col_row_data:()=>Fe,lists_2d_get_data_with_col_row:()=>fe,lists_append_extend:()=>ke,lists_change_to:()=>qe,lists_change_to_general:()=>Ze,lists_clear:()=>Ge,lists_create_with:()=>ve,lists_create_with2:()=>ni,lists_create_with_container:()=>Ye,lists_create_with_item:()=>ye,lists_create_with_noreturn:()=>Je,lists_create_with_text:()=>Ve,lists_create_with_text2:()=>si,lists_del_general:()=>ze,lists_find:()=>We,lists_getIndex3:()=>oi,lists_getSublist3:()=>_i,lists_get_index:()=>Ne,lists_get_random_item:()=>Ue,lists_get_random_sublist:()=>Xe,lists_get_sublist:()=>Pe,lists_insert_value:()=>Be,lists_insert_value2:()=>ai,lists_pop:()=>He,lists_remove_at:()=>we,lists_remove_at2:()=>ui,lists_reverse:()=>xe,lists_setIndex3:()=>pi,lists_set_index:()=>be,lists_sort:()=>je,lists_zip:()=>$e,lists_zip_container:()=>ti,lists_zip_item:()=>ei});var _={};t.r(_),t.d(_,{dicts_add_change_del:()=>Si,dicts_add_or_change:()=>Mi,dicts_clear:()=>mi,dicts_create_with:()=>Ti,dicts_create_with_container:()=>di,dicts_create_with_item:()=>Ii,dicts_create_with_noreturn:()=>Pi,dicts_deldict:()=>Ci,dicts_delete:()=>ci,dicts_get:()=>Oi,dicts_get_default:()=>Ei,dicts_items:()=>gi,dicts_keys:()=>hi,dicts_length:()=>Li,dicts_pop:()=>Di,dicts_setdefault:()=>Ni,dicts_to_json:()=>Fi,dicts_todict:()=>fi,dicts_update:()=>Ri,dicts_values:()=>Ai,json_to_dicts:()=>vi});var p={};t.r(p),t.d(p,{logic_boolean:()=>Ui,logic_compare:()=>Yi,logic_compare_continous:()=>yi,logic_is:()=>Gi,logic_is_in:()=>xi,logic_negate:()=>ki,logic_null:()=>Xi,logic_operation:()=>bi,logic_tobool:()=>wi,logic_true_or_false:()=>Bi});var a={};t.r(a),t.d(a,{sdcard_mount:()=>dn,sdcard_use_spi_init:()=>Tn,storage_can_write_ornot:()=>zi,storage_change_dir:()=>ln,storage_close_file:()=>tn,storage_delete_file:()=>nn,storage_file_seek:()=>_n,storage_file_tell:()=>on,storage_file_write:()=>qi,storage_fileopen:()=>Wi,storage_fileopen_new:()=>Ki,storage_fileopen_new_encoding:()=>ji,storage_get_a_line:()=>Zi,storage_get_contents:()=>Ji,storage_get_contents_without_para:()=>Qi,storage_get_current_dir:()=>pn,storage_get_file_size:()=>sn,storage_get_filename:()=>$i,storage_is_file:()=>rn,storage_list_all_files:()=>en,storage_make_dir:()=>an,storage_open_file_with_os:()=>Hi,storage_rename:()=>un});var u={};t.r(u),t.d(u,{procedures_callnoreturn:()=>Mn,procedures_callreturn:()=>cn,procedures_defnoreturn:()=>In,procedures_defreturn:()=>hn,procedures_ifreturn:()=>Rn,procedures_mutatorarg:()=>En,procedures_mutatorcontainer:()=>On,procedures_return:()=>mn});var l={};t.r(l),t.d(l,{tuple_change_to:()=>Vn,tuple_create_with:()=>An,tuple_create_with_container:()=>Ln,tuple_create_with_item:()=>Cn,tuple_create_with_noreturn:()=>kn,tuple_create_with_text2:()=>Sn,tuple_create_with_text_return:()=>Dn,tuple_del:()=>fn,tuple_find:()=>Yn,tuple_getIndex:()=>Nn,tuple_getSublist:()=>bn,tuple_get_random_item:()=>Xn,tuple_get_sublist:()=>Un,tuple_join:()=>Fn,tuple_length:()=>Pn,tuple_max:()=>vn,tuple_totuple:()=>Bn,tuple_trig:()=>yn});var r={};t.r(r),t.d(r,{set_add_discard:()=>Jn,set_clear:()=>jn,set_create_with:()=>Gn,set_create_with_container:()=>wn,set_create_with_item:()=>Hn,set_create_with_text_return:()=>$n,set_length:()=>Wn,set_operate:()=>qn,set_operate_update:()=>Qn,set_pop:()=>Kn,set_sub:()=>Zn,set_toset:()=>ts,set_update:()=>zn});var T={};t.r(T),t.d(T,{html_content:()=>os,html_content_more:()=>_s,html_document:()=>is,html_form:()=>as,html_head_body:()=>ss,html_style:()=>ps,html_style_color:()=>ls,html_style_content:()=>us,html_text:()=>rs,html_title:()=>ns});var d={};t.r(d),t.d(d,{attribute_access:()=>Cs,function_call:()=>gs,function_call_container:()=>As,function_call_item:()=>Ls,raw_block:()=>Is,raw_empty:()=>Os,raw_expression:()=>hs,raw_table:()=>ds,text_comment:()=>Es,text_print_multiple:()=>cs,text_print_multiple_container:()=>Rs,text_print_multiple_item:()=>ms,type_check:()=>Ms});var I={};t.r(I),t.d(I,{array_create:()=>Gs,array_toarray:()=>io,dataframe_create:()=>Ps,dataframe_create_from_index:()=>Fs,dataframe_create_from_one_index:()=>fs,dataframe_get:()=>$s,numpy_trig:()=>Js,pandas_readcsv:()=>zs,pl_axes:()=>Us,pl_bar:()=>Ks,pl_hist:()=>qs,pl_label:()=>xs,pl_legend:()=>Xs,pl_pie:()=>js,pl_plot:()=>bs,pl_plot_bar:()=>ws,pl_plot_easy:()=>ys,pl_plot_scatter:()=>Hs,pl_plot_xy:()=>Ws,pl_savefig:()=>to,pl_show:()=>ks,pl_subplot:()=>Zs,pl_text:()=>eo,pl_ticks:()=>Qs,pl_title:()=>Bs,plot_axes:()=>_o,plot_bar:()=>Io,plot_hist:()=>Oo,plot_label:()=>uo,plot_legend:()=>po,plot_pie:()=>ho,plot_plot:()=>so,plot_plot_bar:()=>lo,plot_plot_easy:()=>no,plot_plot_scatter:()=>ro,plot_plot_xy:()=>To,plot_savefig:()=>co,plot_show:()=>oo,plot_subplot:()=>Mo,plot_text:()=>Ro,plot_ticks:()=>Eo,plot_title:()=>ao,series_create:()=>Ds,series_create_from_index:()=>Ns,series_create_from_text:()=>vs,series_get_num:()=>Ys,series_index_value:()=>Vs});var h={};t.r(h),t.d(h,{inout_input:()=>go,inout_print:()=>Ao,inout_print_container:()=>No,inout_print_end:()=>Co,inout_print_inline:()=>Lo,inout_print_item:()=>Po,inout_print_many:()=>Do,inout_type_input:()=>So});var O={};t.r(O),t.d(O,{Panic_with_status_code:()=>Yo,base_delay:()=>Fo,controls_millis:()=>vo,controls_mstimer2:()=>bo,controls_mstimer2_start:()=>ko,controls_mstimer2_stop:()=>Uo,reset:()=>yo,time_localtime:()=>Vo,time_sleep:()=>Xo});var E={};t.r(E),t.d(E,{turtle_bgcolor:()=>__,turtle_bgcolor_hex:()=>h_,turtle_bgcolor_hex_new:()=>l_,turtle_circle:()=>n_,turtle_circle_advanced:()=>s_,turtle_clear:()=>Zo,turtle_clone:()=>u_,turtle_color:()=>d_,turtle_color_hex:()=>I_,turtle_color_seclet:()=>C_,turtle_create:()=>xo,turtle_done:()=>Go,turtle_exitonclick:()=>wo,turtle_fill:()=>$o,turtle_fillcolor:()=>a_,turtle_fillcolor_hex:()=>E_,turtle_fillcolor_hex_new:()=>T_,turtle_getscreen:()=>S_,turtle_goto:()=>qo,turtle_listen:()=>f_,turtle_move:()=>Ho,turtle_numinput:()=>R_,turtle_onclick:()=>N_,turtle_onkey:()=>D_,turtle_ontimer:()=>P_,turtle_pencolor:()=>p_,turtle_pencolor_hex:()=>O_,turtle_pencolor_hex_new:()=>r_,turtle_penup:()=>zo,turtle_pos_shape:()=>Jo,turtle_rotate:()=>Wo,turtle_screen_delay:()=>jo,turtle_screen_savefig:()=>F_,turtle_setheading:()=>Ko,turtle_setxy:()=>Qo,turtle_shape:()=>M_,turtle_shapesize:()=>c_,turtle_size:()=>e_,turtle_size_speed:()=>t_,turtle_speed:()=>i_,turtle_textinput:()=>m_,turtle_visible:()=>o_,turtle_write:()=>g_,turtle_write_format:()=>A_,turtle_write_format_skulpt:()=>L_});var M={};t.r(M),t.d(M,{Turn:()=>x_,addOil:()=>np,game_get_character_img:()=>Q_,game_get_local_img:()=>W_,game_get_path_img:()=>j_,game_init:()=>X_,get_actor_point:()=>Z_,initSettedMap_1:()=>v_,initSettedMap_2:()=>V_,initSettedMap_3:()=>Y_,initSettedMap_4:()=>y_,initSettedMap_5:()=>b_,initSettedMap_6:()=>k_,initSettedMap_7:()=>U_,initialize:()=>J_,isBarrier:()=>z_,isCirculationRight:()=>sp,isDone:()=>G_,isLightGreen:()=>ep,isLightRed:()=>ip,isOilFull:()=>tp,isPath:()=>w_,move_direction_steps:()=>B_,place_item:()=>q_,randomOil:()=>$_,set_map:()=>H_,set_pathtype:()=>K_});var c={};t.r(c),t.d(c,{controls_type:()=>up,controls_typeLists:()=>lp,variables_change:()=>pp,variables_get:()=>op,variables_global:()=>ap,variables_set:()=>_p});var R={};t.r(R),t.d(R,{Panic_with_status_code:()=>Rp,base_setup:()=>Tp,controls_delay:()=>cp,controls_flow_statements:()=>Mp,controls_for:()=>hp,controls_forEach:()=>Cp,controls_for_range:()=>Op,controls_if:()=>dp,controls_interrupts:()=>Ap,controls_lambda:()=>Dp,controls_main:()=>rp,controls_millis:()=>mp,controls_nointerrupts:()=>Lp,controls_pass:()=>Pp,controls_range:()=>Sp,controls_repeat:()=>kp,controls_repeat_ext:()=>vp,controls_thread:()=>fp,controls_try_finally:()=>Ip,controls_whileUntil:()=>Ep,do_while:()=>Fp,garbage_collection:()=>Vp,get_mem_alloc:()=>Yp,get_mem_free:()=>yp,get_unique_identifier:()=>bp,reset:()=>gp,time_sleep:()=>Np});var m={};t.r(m),t.d(m,{base_map:()=>sa,math_arithmetic:()=>Gp,math_bit:()=>xp,math_constant:()=>Xp,math_constant_mp:()=>Bp,math_constrain:()=>Zp,math_dec:()=>Kp,math_indexer_number:()=>ta,math_map:()=>Jp,math_max_min:()=>qp,math_number:()=>Up,math_number_base_conversion:()=>zp,math_random:()=>Qp,math_random_seed:()=>$p,math_round:()=>ea,math_selfcalcu:()=>wp,math_single:()=>Hp,math_to_int:()=>jp,math_trig:()=>Wp,text_to_number:()=>ia,text_to_number_skulpt:()=>na});var g={};t.r(g),t.d(g,{ascii_to_char:()=>ua,char_to_ascii:()=>la,number_to_text:()=>ra,os_system:()=>Ya,text:()=>oa,text_capital:()=>Ra,text_center:()=>ma,text_char:()=>pa,text_char_at:()=>Ia,text_char_at2:()=>da,text_char_at3:()=>Fa,text_compareTo:()=>fa,text_compare_to:()=>Ea,text_encode:()=>va,text_equals_starts_ends:()=>Oa,text_eval:()=>Va,text_find:()=>ga,text_format:()=>Da,text_format_noreturn:()=>Na,text_join:()=>aa,text_join_seq:()=>Aa,text_length:()=>Ta,text_random_char:()=>ha,text_replace:()=>La,text_split:()=>Ca,text_strip:()=>Sa,text_substring:()=>ca,text_substring2:()=>Ma,text_substring3:()=>Pa,text_textarea:()=>_a});var A={};t.r(A),t.d(A,{list_many_input:()=>tu,list_tolist:()=>Tu,list_tolist2:()=>du,list_trig:()=>Za,lists_2d_get_col_row_data:()=>ka,lists_2d_get_data_with_col_row:()=>ba,lists_append_extend:()=>Ga,lists_change_to:()=>$a,lists_change_to_general:()=>iu,lists_clear:()=>ja,lists_create_with:()=>Ua,lists_create_with2:()=>su,lists_create_with_noreturn:()=>eu,lists_create_with_text:()=>Xa,lists_create_with_text2:()=>ou,lists_del_general:()=>nu,lists_find:()=>qa,lists_getIndex3:()=>_u,lists_getSublist3:()=>pu,lists_get_index:()=>Ba,lists_get_random_item:()=>wa,lists_get_random_sublist:()=>Ha,lists_get_sublist:()=>ya,lists_insert_value:()=>Wa,lists_insert_value2:()=>uu,lists_pop:()=>Ja,lists_remove_at:()=>Qa,lists_remove_at2:()=>lu,lists_reverse:()=>Ka,lists_setIndex3:()=>au,lists_set_index:()=>xa,lists_sort:()=>za,lists_zip:()=>ru});var L={};t.r(L),t.d(L,{dicts_add_change_del:()=>Su,dicts_add_or_change:()=>Mu,dicts_clear:()=>mu,dicts_create_with:()=>Iu,dicts_create_with_noreturn:()=>Pu,dicts_deldict:()=>Cu,dicts_delete:()=>cu,dicts_get:()=>Ou,dicts_get_default:()=>Eu,dicts_items:()=>gu,dicts_keys:()=>hu,dicts_length:()=>Lu,dicts_pop:()=>Du,dicts_setdefault:()=>Nu,dicts_to_json:()=>Fu,dicts_todict:()=>fu,dicts_update:()=>Ru,dicts_values:()=>Au,json_to_dicts:()=>vu});var C={};t.r(C),t.d(C,{logic_boolean:()=>ku,logic_compare:()=>Vu,logic_compare_continous:()=>Yu,logic_is:()=>xu,logic_is_in:()=>Bu,logic_negate:()=>bu,logic_null:()=>Uu,logic_operation:()=>yu,logic_tobool:()=>Gu,logic_true_or_false:()=>Xu});var S={};t.r(S),t.d(S,{sdcard_mount:()=>rl,sdcard_use_spi_init:()=>ll,storage_can_write_ornot:()=>Zu,storage_change_dir:()=>ol,storage_close_file:()=>$u,storage_delete_file:()=>el,storage_file_seek:()=>sl,storage_file_tell:()=>nl,storage_file_write:()=>ju,storage_fileopen:()=>Hu,storage_fileopen_new:()=>Wu,storage_fileopen_new_encoding:()=>Ku,storage_get_a_line:()=>Ju,storage_get_contents:()=>Qu,storage_get_contents_without_para:()=>qu,storage_get_current_dir:()=>_l,storage_get_file_size:()=>il,storage_get_filename:()=>zu,storage_is_file:()=>ul,storage_list_all_files:()=>tl,storage_make_dir:()=>pl,storage_open_file_with_os:()=>wu,storage_rename:()=>al});var D={};t.r(D),t.d(D,{procedures_callnoreturn:()=>hl,procedures_callreturn:()=>Il,procedures_defnoreturn:()=>dl,procedures_defreturn:()=>Tl,procedures_ifreturn:()=>Ol,procedures_return:()=>El});var N={};t.r(N),t.d(N,{tuple_change_to:()=>Sl,tuple_create_with:()=>Ml,tuple_create_with_noreturn:()=>fl,tuple_create_with_text2:()=>cl,tuple_create_with_text_return:()=>Rl,tuple_del:()=>Al,tuple_find:()=>Dl,tuple_getIndex:()=>ml,tuple_getSublist:()=>Pl,tuple_get_random_item:()=>vl,tuple_get_sublist:()=>Fl,tuple_join:()=>Ll,tuple_length:()=>gl,tuple_max:()=>Cl,tuple_totuple:()=>Vl,tuple_trig:()=>Nl});var P={};t.r(P),t.d(P,{set_add_discard:()=>Bl,set_clear:()=>kl,set_create_with:()=>Yl,set_create_with_text_return:()=>wl,set_length:()=>yl,set_operate:()=>Ul,set_operate_update:()=>Xl,set_pop:()=>bl,set_sub:()=>xl,set_toset:()=>Hl,set_update:()=>Gl});var f={};t.r(f),t.d(f,{html_content:()=>ql,html_content_more:()=>Ql,html_document:()=>Wl,html_form:()=>Zl,html_head_body:()=>jl,html_style:()=>Jl,html_style_content:()=>zl,html_text:()=>$l,html_title:()=>Kl});var F={};t.r(F),t.d(F,{attribute_access:()=>_r,function_call:()=>or,raw_block:()=>tr,raw_empty:()=>ir,raw_expression:()=>er,raw_table:()=>nr,type_check:()=>sr});var v={};t.r(v),t.d(v,{array_create:()=>gr,array_toarray:()=>br,dataframe_create:()=>ur,dataframe_create_from_index:()=>lr,dataframe_create_from_one_index:()=>rr,dataframe_get:()=>Vr,numpy_trig:()=>fr,pandas_readcsv:()=>vr,pl_axes:()=>Or,pl_bar:()=>Sr,pl_hist:()=>Nr,pl_label:()=>mr,pl_legend:()=>cr,pl_pie:()=>Dr,pl_plot:()=>Mr,pl_plot_bar:()=>Ar,pl_plot_easy:()=>Er,pl_plot_scatter:()=>Lr,pl_plot_xy:()=>Cr,pl_savefig:()=>Yr,pl_show:()=>hr,pl_subplot:()=>Fr,pl_text:()=>yr,pl_ticks:()=>Pr,pl_title:()=>Rr,plot_axes:()=>Ur,plot_bar:()=>jr,plot_hist:()=>Qr,plot_label:()=>wr,plot_legend:()=>xr,plot_pie:()=>qr,plot_plot:()=>Br,plot_plot_bar:()=>Hr,plot_plot_easy:()=>Xr,plot_plot_scatter:()=>Wr,plot_plot_xy:()=>Kr,plot_savefig:()=>zr,plot_show:()=>kr,plot_subplot:()=>Zr,plot_text:()=>$r,plot_ticks:()=>Jr,plot_title:()=>Gr,series_create:()=>pr,series_create_from_index:()=>ar,series_create_from_text:()=>Tr,series_get_num:()=>Ir,series_index_value:()=>dr});var V={};t.r(V),t.d(V,{inout_input:()=>tT,inout_print:()=>eT,inout_print_end:()=>nT,inout_print_inline:()=>iT,inout_print_many:()=>oT,inout_type_input:()=>sT});var Y={};t.r(Y),t.d(Y,{controls_end_program:()=>pT,controls_millis:()=>_T,time_localtime:()=>aT});var y={};t.r(y),t.d(y,{turtle_bgcolor:()=>NT,turtle_bgcolor_hex:()=>vT,turtle_bgcolor_hex_new:()=>yT,turtle_circle:()=>LT,turtle_circle_advanced:()=>ST,turtle_clear:()=>MT,turtle_clone:()=>FT,turtle_color:()=>XT,turtle_color_hex:()=>UT,turtle_color_seclet:()=>jT,turtle_create:()=>uT,turtle_done:()=>lT,turtle_exitonclick:()=>rT,turtle_fill:()=>RT,turtle_fillcolor:()=>fT,turtle_fillcolor_hex:()=>YT,turtle_fillcolor_hex_new:()=>kT,turtle_getscreen:()=>qT,turtle_goto:()=>OT,turtle_listen:()=>zT,turtle_move:()=>TT,turtle_numinput:()=>wT,turtle_onclick:()=>JT,turtle_onkey:()=>QT,turtle_ontimer:()=>ZT,turtle_pencolor:()=>PT,turtle_pencolor_hex:()=>VT,turtle_pencolor_hex_new:()=>bT,turtle_penup:()=>cT,turtle_pos_shape:()=>ET,turtle_rotate:()=>dT,turtle_screen_delay:()=>hT,turtle_screen_savefig:()=>$T,turtle_setheading:()=>IT,turtle_setxy:()=>CT,turtle_shape:()=>BT,turtle_shapesize:()=>xT,turtle_size:()=>gT,turtle_size_speed:()=>mT,turtle_speed:()=>AT,turtle_textinput:()=>GT,turtle_visible:()=>DT,turtle_write:()=>HT,turtle_write_format:()=>WT,turtle_write_format_skulpt:()=>KT});var b={};t.r(b),t.d(b,{Turn:()=>ud,addOil:()=>Cd,game_get_character_img:()=>hd,game_get_local_img:()=>dd,game_get_path_img:()=>Md,game_init:()=>td,get_actor_point:()=>Td,initSettedMap_1:()=>id,initSettedMap_2:()=>nd,initSettedMap_3:()=>sd,initSettedMap_4:()=>od,initSettedMap_5:()=>_d,initSettedMap_6:()=>pd,initSettedMap_7:()=>ad,initialize:()=>Od,isBarrier:()=>Rd,isCirculationRight:()=>Sd,isDone:()=>ld,isLightGreen:()=>Ad,isLightRed:()=>Ld,isOilFull:()=>gd,isPath:()=>rd,move_direction_steps:()=>ed,place_item:()=>Ed,randomOil:()=>md,set_map:()=>Id,set_pathtype:()=>cd});const k=Blockly,U=Mixly,X={NAME_TYPE:"VARIABLE",allVariables:function(t){var e;if(t.getDescendants)e=t.getDescendants();else{if(!t.getAllBlocks)throw"Not Block or Workspace: "+t;e=t.getAllBlocks()}for(var i=Object.create(null),n=0;n1&&(_+=n)):i=_}else i="i";return i}},B=X,x={};x.NAME_TYPE=k.PROCEDURE_CATEGORY_NAME,x.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},W.scrubNakedValue=function(t){return t+"\n"},W.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},W.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},W.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=k.utils.string.wrap(o,W.COMMENT_WRAP-3),n+=W.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const K=330,j={init:function(){this.setColour(K),this.appendDummyInput().appendField(new k.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(k.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},q={init:function(){this.setColour(K),this.appendValueInput("VALUE").appendField(new k.FieldTextInput(""),"VAR").appendField(k.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},Q={init:function(){this.setColour(K);var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"],[k.Msg.LANG_MATH_BOOLEAN,"bool"],[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0)}},J={init:function(){this.setColour(K),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},Z={init:function(){this.setColour(K),this.appendValueInput("DATA").appendField(k.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},z={init:function(){this.setColour(K),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new k.FieldDropdown([[k.Msg.LANG_MATH_INT,"int"],[k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[k.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"],[k.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return k.Msg.MICROBIT_controls_TypeLists+{int:k.Msg.LANG_MATH_INT,float:k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:k.Msg.MIXLY_MICROBIT_TYPE_STRING,list:k.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:k.Msg.MIXLY_MICROBIT_TYPE_DICT,set:k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:k.Msg.MIXLY_MICROBIT_IMAGE,bytes:k.Msg.LANG_MATH_BYTE,NoneType:k.Msg.LOGIC_NULL}[e]}))}},$=120,tt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_NAME_MAIN),this.appendStatementInput("DO").appendField(""),this.setTooltip(k.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},et={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_SETUP),this.appendStatementInput("DO").appendField(""),this.setTooltip(k.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},it={init:function(){var t=[[k.Msg.MIXLY_mSecond,"delay"],[k.Msg.MIXLY_uSecond,"delayMicroseconds"]];this.setColour($),this.appendValueInput("DELAY_TIME",Number).appendField(k.Msg.MIXLY_DELAY).appendField(new k.FieldDropdown(t),"UNIT").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_CONTROL_DELAY),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#id9"),this.wiki={"zh-hans":{page:["Arduino AVR","控制","延时"]}}}},nt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_CONTROL_END_PROGRAM),this.setPreviousStatement(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_END_TOOLTIP)}},st={init:function(){this.setColour($),this.appendValueInput("IF0").setCheck([Boolean,Number]).appendField(k.Msg.CONTROLS_IF_MSG_IF),this.appendStatementInput("DO0").appendField(k.Msg.CONTROLS_IF_MSG_THEN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#if"),this.setMutator(new k.icons.MutatorIcon(["controls_if_elseif","controls_if_else"],this));var t=this;this.setTooltip((function(){return t.elseifCount_||t.elseCount_?!t.elseifCount_&&t.elseCount_?k.Msg.CONTROLS_IF_TOOLTIP_2:t.elseifCount_&&!t.elseCount_?k.Msg.CONTROLS_IF_TOOLTIP_3:t.elseifCount_&&t.elseCount_?k.Msg.CONTROLS_IF_TOOLTIP_4:"":k.Msg.CONTROLS_IF_TOOLTIP_1})),this.elseifCount_=0,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},ot={init:function(){this.setColour($),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},_t={init:function(){this.setColour($),this.appendValueInput("LIST").setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(k.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},pt={init:function(){this.setColour($),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new k.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(k.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},at={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},ut={init:function(){this.setColour($);var t=new k.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},lt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},rt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};pt.OPERATORS=[[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],ut.OPERATORS=[[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Tt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},dt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},It={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},ht={init:function(){this.setColour($),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Ot={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Et={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Mt={init:function(){this.jsonInit({message0:k.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:$,tooltip:k.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:k.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},ct={init:function(){this.setColour($),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_STAT),this.setOutput(!0)}},Rt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},mt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},gt={init:function(){this.appendDummyInput().appendField(k.Msg.CONTROLS_REPEAT_TITLE_REPEAT+k.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(k.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new k.FieldDropdown([[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour($),this.setTooltip("do-while loop"),this.setHelpUrl("")}},At={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Ct={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},St=230;k.FieldTextInput.math_number_validator=function(t){return String(t)},k.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Dt={init:function(){this.setColour(St),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},Nt={init:function(){this.setColour(St);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},Pt={init:function(){this.setColour(St);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},ft={init:function(){this.setColour(St),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Ft={init:function(){this.setColour(St),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},vt={init:function(){this.setColour(St),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new k.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Vt={init:function(){this.setColour(St),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:k.Msg.MATH_TRIG_TOOLTIP_SIN,COS:k.Msg.MATH_TRIG_TOOLTIP_COS,TAN:k.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:k.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:k.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:k.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:k.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Yt={init:function(){var t=[[k.Msg.MATH_BIN,"bin"],[k.Msg.MATH_OCT,"oct"],[k.Msg.MATH_HEX,"hex"]];this.setColour(St),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:k.Msg.MATH_DEC_TOOLTIP_BIN,oct:k.Msg.MATH_DEC_TOOLTIP_OCT,hex:k.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},yt={init:function(){var t=[[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"],[k.Msg.MATH_ABS,"fabs"],[k.Msg.MATH_SQRT,"sqrt"]];this.setColour(St),this.appendValueInput("A").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:k.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:k.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:k.Msg.MATH_SINGLE_TOOLTIP_SQ,round:k.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:k.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:k.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},bt={init:function(){var t=[[k.Msg.MIXLY_MAX,"max"],[k.Msg.MIXLY_MIN,"min"]];this.setColour(St),this.appendValueInput("A").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(new k.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(k.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:k.Msg.MIXLY_TOOLTIP_MATH_MAX,min:k.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},kt={init:function(){var t=[[k.Msg.MATH_TWO,"two"],[k.Msg.MATH_EIGHT,"eight"],[k.Msg.MATH_TEN,"ten"],[k.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(St),this.appendDummyInput("").appendField(k.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new k.FieldDropdown(t),"OP").appendField(k.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(k.Msg.MATH_ZHW).appendField(new k.FieldDropdown(t),"OP2").appendField(k.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:k.Msg.MATH_Before_two,eight:k.Msg.MATH_Before_eight,ten:k.Msg.MATH_Before_ten,sixteen:k.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:k.Msg.MATH_Behind_two,eight:k.Msg.MATH_Behind_eight,ten:k.Msg.MATH_Behind_ten,sixteen:k.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Ut={init:function(){var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(St),this.setOutput(!0,Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_RANDOM).appendField(new k.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:k.Msg.LANG_MATH_INT,float:k.Msg.LANG_MATH_FLOAT_RANDOM};return k.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Xt={init:function(){this.setColour(St),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_CONSTRAIN_TOOLTIP)}},Bt={init:function(){this.setColour(St),this.appendValueInput("NUM",Number).appendField(k.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(k.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(k.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_MAP)}},xt={init:function(){this.setColour(St),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},Gt={init:function(){this.setColour(St),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},wt={init:function(){this.setColour(St),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MATH_ROUND).appendField(k.Msg.TEXT_KEEP),this.appendDummyInput().appendField(k.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_ROUND_NEW_TOOLTIP)}},Ht={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"],[k.Msg.MIXLY_TO_BITES,"b"]];this.setColour(St),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:k.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:k.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Wt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(St),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:k.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},Kt=Bt,jt=160,qt={init:function(){this.setColour(jt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(k.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new k.FieldImage(e,12,12,'"')}},Qt={init:function(){this.setColour(jt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(k.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new k.FieldImage(e,12,12,'"')}};k.FieldTextInput.char_validator=function(t){if(t.length>1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Jt={init:function(){this.setColour(jt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldTextInput("",k.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(k.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new k.FieldImage(e,7,12,'"')}},Zt={init:function(){this.setColour(jt),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(k.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},zt={init:function(){this.setColour(jt),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},$t={init:function(){this.setColour(jt),this.appendValueInput("VAR").setCheck(String).appendField(k.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},te={init:function(){this.setColour(jt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ee={init:function(){this.setColour(jt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},ie={init:function(){this.WHERE_OPTIONS=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.TEXT_GET_INDEX_RANDOM+1+k.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(jt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(k.Msg.LISTS_GET_INDEX_GET,"MODE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(k.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+k.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",k.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:k.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:k.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:k.Msg.TEXT_GET_INDEX_RANDOM};return k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+k.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==k.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new k.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},ne={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(jt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.LISTS_GET_INDEX_FROM_START+"n"+k.Msg.TEXT_CHARAT2)}},se={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(jt),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(k.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(k.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},oe={init:function(){this.WHERE_OPTIONS_1=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[k.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(jt),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==k.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new k.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},_e={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(jt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(k.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},pe={init:function(){var t=[[k.Msg.MIXLY_EQUALS,"==="],[k.Msg.MIXLY_STARTSWITH,"startswith"],[k.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(jt),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new k.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},ae={init:function(){this.setColour(jt),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_COMPARETO_HELP)}},ue={init:function(){var t=[[k.Msg.TEXT_UPPER,"upper"],[k.Msg.TEXT_TITLE,"title"],[k.Msg.TEXT_CAPITALIZE,"capitalize"],[k.Msg.TEXT_SWAPCASE,"swapcase"],[k.Msg.TEXT_LOWER,"lower"]];this.setColour(jt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:k.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:k.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:k.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:k.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:k.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},le={init:function(){var t=[[k.Msg.TEXT_LJUST,"ljust"],[k.Msg.TEXT_CENTER,"center"],[k.Msg.TEXT_RJUST,"rjust"]];this.setColour(jt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(k.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(k.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},re={init:function(){this.setColour(jt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(k.Msg.MIXLY_MID+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(k.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},Te={init:function(){this.setColour(jt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},de={init:function(){this.setColour(jt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(k.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Ie={init:function(){this.setColour(jt),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(k.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(k.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},he={init:function(){var t=[[k.Msg.TEXT_TRIM_BOTH,"strip"],[k.Msg.TEXT_TRIM_LEFT,"lstrip"],[k.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(jt),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new k.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(k.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:k.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:k.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:k.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Oe={init:function(){this.setColour(jt),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new k.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ti={init:function(){this.setColour(li),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},di={init:function(){this.setColour(li),this.appendDummyInput().appendField(k.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Ii={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_KEYS),this.setTooltip(k.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},hi={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_TOOLTIP)}},Oi={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Ei={init:function(){this.setColour(li),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(k.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Mi={init:function(){this.setColour(li),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_DELETE_TOOLTIP)}},ci={init:function(){this.setColour(li),this.appendValueInput("DICT2").setCheck("Dict").appendField(k.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(k.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(k.Msg.MIXLY_MID),this.setTooltip(k.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ri={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_CLEAR),this.setTooltip(k.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mi={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_ITEMS),this.setTooltip(k.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},gi={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_VALUES),this.setTooltip(k.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},Ai={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_LENGTH),this.setTooltip(k.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Li={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_DELDICT),this.setTooltip(k.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ci={init:function(){this.MODE=[[k.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[k.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(k.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=k.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=k.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new k.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Si={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setTooltip(k.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Di={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_SETDEFAULT_TOOLTIP)}},Ni={init:function(){this.setColour(li),this.appendDummyInput("").appendField(new k.FieldLabel(k.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new k.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(k.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Pi={init:function(){this.setColour(li),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},fi={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_TO_JSON),this.setTooltip(k.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},Fi={init:function(){this.setColour(li),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(k.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},vi=210,Vi={init:function(){var t=k.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(vi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:k.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:k.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:k.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:k.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:k.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:k.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Yi={init:function(){var t=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(vi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new k.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},yi={init:function(){var t=[[k.Msg.LOGIC_OPERATION_AND,"AND"],[k.Msg.LOGIC_OPERATION_OR,"OR"],[k.Msg.LOGIC_OPERATION_NOR,"NOR"],[k.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(vi),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:k.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:k.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:k.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:k.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},bi={init:function(){this.setColour(vi),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(k.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(k.Msg.LOGIC_NEGATE_TOOLTIP)}},ki={init:function(){var t=[[k.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[k.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(vi),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new k.FieldDropdown(t),"BOOL"),this.setTooltip(k.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Ui={init:function(){this.setColour(vi),this.setOutput(!0),this.appendDummyInput().appendField(k.Msg.LOGIC_NULL),this.setTooltip(k.Msg.LOGIC_NULL_TOOLTIP)}},Xi={init:function(){this.setColour(vi),this.appendValueInput("A"),this.appendValueInput("B").appendField(k.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(k.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Bi={init:function(){var t=[[k.Msg.TEXT_APPEND_TO,"in"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(vi),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new k.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(k.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.IN)}},xi={init:function(){var t=[[k.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(vi),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Gi={init:function(){this.setColour(vi),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},wi={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(k.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Hi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Wi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},Ki={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXPY_TEXT_ENCODE).appendField(new k.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},ji={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},qi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Qi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},Ji={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},Zi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.HTML_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},zi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},$i={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},tn={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const en={init:function(){this.setColour(0),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},nn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},sn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},on={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},_n={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},pn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+k.Msg.MIXLY_ESP32_SET+{mkdir:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},an={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(k.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},un={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},ln={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.HTML_FILE,"isfile"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},rn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(k.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(k.Msg.MIXLY_SETUP+k.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(k.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Tn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(k.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},dn={init:function(){var t=G.findLegalName("",this),e=new k.FieldTextInput(t,G.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new k.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&k.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(k.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(k.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(k.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(k.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=k.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),k.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{k.Events.enable()}},mutationToDom:function(t){var e=k.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var i=0;i"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_s={init:function(){this.setColour(ts),this.appendDummyInput().appendField(k.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},ps={init:function(){this.setColour(ts),this.appendDummyInput().appendField(k.Msg.HTML_FORM_CONTENT).appendField(new k.FieldDropdown([[k.Msg.HTML_TEXT,"text"],[k.Msg.HTML_EMAIL,"email"],[k.Msg.HTML_NUMBER,"number"],[k.Msg.HTML_PASSWORD,"password"],[k.Msg.HTML_CHECKBOX,"checkbox"],[k.Msg.HTML_RADIOBUTTON,"radiobutton"],[k.Msg.HTML_BUTTON,"button"],[k.Msg.HTML_COLOUR,"colour"],[k.Msg.HTML_DATE,"date"],[k.Msg.HTML_LOCALTIME,"local time"],[k.Msg.HTML_FILE,"file"],[k.Msg.HTML_HIDDEN,"hidden"],[k.Msg.HTML_IMAGE,"image"],[k.Msg.HTML_MONTH,"month"],[k.Msg.HTML_RANGE,"range"],[k.Msg.HTML_RESET,"reset"],[k.Msg.HTML_SEARCH,"search"],[k.Msg.HTML_SUBMIT,"submit"],[k.Msg.HTML_TELEPHONENUMBER,"telephone number"],[k.Msg.HTML_TIME,"time"],[k.Msg.HTML_URL,"url"],[k.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(k.Msg.HTML_NAME).appendField(new k.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(k.Msg.HTML_VALUE).appendField(new k.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},as={init:function(){this.setColour(ts),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},us={init:function(){this.setColour(ts),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ls={init:function(){this.setColour(ts),this.appendDummyInput().appendField(k.Msg.HTML_TEXT).appendField(new k.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rs=160,Ts={init:function(){this.setColour(rs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new k.FieldTable(""),"TEXT")}},ds={init:function(){this.setColour(rs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT")}},Is={init:function(){this.setColour(rs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},hs={init:function(){this.setColour(rs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Os={init:function(){this.setColour(rs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new k.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Es={init:function(){this.setColour(rs),this.appendValueInput("VALUE").appendField(k.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Ms={init:function(){this.setColour(rs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=k.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bs={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ks={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Us={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xs={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bs={init:function(){this.setColour(Cs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xs={init:function(){this.setColour(Cs),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_SPLITBYDOU).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Gs={init:function(){this.setColour(Cs);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},ws={init:function(){this.setColour(Cs);var t=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],e=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Hs={init:function(){this.setColour(Cs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ws={init:function(){this.setColour(Cs);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ks={init:function(){this.setColour(Cs);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},js={init:function(){this.setColour(Cs),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qs={init:function(){this.setColour(Cs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Qs={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(Cs),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(k.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setTooltip(k.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},Js={init:function(){this.setColour(Cs),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Zs={init:function(){this.setColour(Cs),this.appendValueInput("FILENAME").appendField(k.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[k.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},zs={init:function(){this.setColour(Cs),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(k.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new k.FieldDropdown([[k.Msg.DATAFRAME_COLUMN,"column"],[k.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(k.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},$s={init:function(){this.setColour(Cs),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},to={init:function(){this.setColour(Cs);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},eo={init:function(){this.setColour(Cs),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},io={init:function(){this.setColour(Cs),this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},no={init:function(){this.setColour(Cs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},so={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},oo={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_o={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},po={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ao={init:function(){this.setColour(Cs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},uo={init:function(){this.setColour(Cs);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},lo={init:function(){this.setColour(Cs);var t=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(t),"DOT"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},ro={init:function(){this.setColour(Cs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},To={init:function(){this.setColour(Cs);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Io={init:function(){this.setColour(Cs);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},ho={init:function(){this.setColour(Cs),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Oo={init:function(){this.setColour(Cs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Eo={init:function(){this.setColour(Cs),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Mo={init:function(){this.setColour(Cs),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},co={init:function(){this.setColour(Cs);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},Ro=20,mo={init:function(){this.setColour(Ro),this.appendValueInput("VAR").appendField(k.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(k.Msg.INOUT_input_TOOLTIP)}},go={init:function(){this.setColour(Ro),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.BLOCKPY_PRINT_TOOLTIP)}},Ao={init:function(){this.setColour(Ro),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},Lo={init:function(){this.setColour(Ro),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(k.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},Co={init:function(){var t=[[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Ro),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(k.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:k.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:k.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:k.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},So={init:function(){this.setColour(Ro),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n0?t:[["'无可用地图'","'无可用地图'"]]}},W_={init:function(){this.appendValueInput("pathtype").setCheck(null).appendField("设置路径样式为"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},K_={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用路径'","'无可用路径'"]]}},j_={init:function(){this.setColour(290),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("posx").setCheck(null).appendField("在("),this.appendDummyInput().appendField(","),this.appendValueInput("posy").setCheck(null).appendField(""),this.appendDummyInput().appendField(")放置").appendField(new k.FieldDropdown([["障碍","'wall'"],["金币","'coin'"]]),"item"),this.setTooltip("")}},q_={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用角色'","'无可用角色'"]]}},Q_={init:function(){this.setColour(290),this.appendValueInput("character").setCheck(null).appendField("初始化角色为"),this.appendDummyInput().appendField("面朝").appendField(new k.FieldDropdown([["北","0"],["南","2"],["西","3"],["东","1"]]),"direction"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},J_={init:function(){this.setColour(290),this.appendDummyInput().appendField("获取⻆⾊所获分数"),this.setOutput(!0,Number),this.setTooltip("")}},Z_={init:function(){this.appendDummyInput().appendField(new k.FieldDropdown([["北","0"],["南","2"],["西","3"],["东","1"]]),"direction"),this.appendDummyInput().appendField("侧有障碍"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},z_={init:function(){this.appendDummyInput().appendField("随机生成小车油量"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},$_={init:function(){this.appendDummyInput().appendField("需要加油"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},tp={init:function(){this.appendDummyInput().appendField("信号灯为绿灯"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},ep={init:function(){this.appendDummyInput().appendField("信号灯为红灯"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},ip={init:function(){this.appendDummyInput().appendField("进加油站加油"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},np={init:function(){this.appendDummyInput().appendField("检查程序循环数目是否正确"),this.setPreviousStatement(!0),this.setColour(290),this.setTooltip("")}},sp=function(t,e){return[e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE),e.ORDER_ATOMIC]},op=function(t,e){if(""==this.getFieldValue("VAR"))return" = None\n";var i=e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"None";return e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE)+" = "+i+"\n"},_p=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"MYVALUE",e.ORDER_ATOMIC)||"None";if("bytes"==i)var s=i+"("+n+',"UTF-8")';else s=i+"("+n+")";return[s,e.ORDER_ATOMIC]},pp=function(t,e){return"global "+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"None")+"\n"},ap=function(t,e){return["type("+(e.valueToCode(this,"DATA",e.ORDER_ATOMIC)||"None")+")",e.ORDER_ATOMIC]},up=function(t,e){return[this.getFieldValue("type"),e.ORDER_ATOMIC]},lp=function(t,e){var i=e.statementToCode(t,"DO");return"if __name__ == '__main__':\n"+(i=e.addLoopTrap(i,t.id)||e.PASS)},rp=function(t,e){var i=e.statementToCode(this,"DO");return(i=i.replace(/(^\s*)|(\s*$)/g,"").replace(/\n {4}/g,"\n")).endsWith("\n")?e.setups_.setup_setup=i:e.setups_.setup_setup=i+"\n",""},Tp=function(t,e){var i=0,n="";do{n+=(0==i?"if ":"elif ")+(e.valueToCode(t,"IF"+i,e.ORDER_NONE)||"False")+":\n"+(e.statementToCode(t,"DO"+i)||e.PASS),++i}while(t.getInput("IF"+i));return t.getInput("ELSE")&&(n+="else:\n"+(e.statementToCode(t,"ELSE")||e.PASS)),n},dp=function(t,e){var i=0,n=e.valueToCode(this,"IF"+i,e.ORDER_NONE)||"null",s="try:\n"+(e.statementToCode(this,"try")||" pass\n");for(i=1;i<=this.elseifCount_;i++)""!==(n=e.valueToCode(this,"IF"+i,e.ORDER_NONE)||"")&&(n=" "+n),s+="except"+n+": \n"+(e.statementToCode(this,"DO"+i)||" pass\n");return this.elseCount_&&(s+="finally:\n"+(e.statementToCode(this,"ELSE")||" pass\n")),s},Ip=function(t,e){var i=e.variableDB_.getName(t.getFieldValue("VAR"),k.Variables.NAME_TYPE),n=e.valueToCode(t,"FROM",e.ORDER_NONE)||"0",s=e.valueToCode(t,"TO",e.ORDER_NONE)||"0",o=e.valueToCode(t,"STEP",e.ORDER_NONE)||"1",_=e.statementToCode(t,"DO"),p=(_=e.addLoopTrap(_,t.id)||e.PASS,""),a=function(t,e){return e.provideFunction_("upRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start <= stop:"," yield start"," start += abs(step)"])},u=function(t,e){return e.provideFunction_("downRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start >= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},k.isNumber(n)&&k.isNumber(s)&&k.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const Vu=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},Yu=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},yu=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},bu=function(t,e){return["None",e.ORDER_ATOMIC]},ku=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Uu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Xu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Bu=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},xu=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},Gu=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},wu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},Hu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},Wu=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},Ku=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},ju=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},qu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Qu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},Ju=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},Zu=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},zu=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},$u=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},tl=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},el=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},il=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},nl=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},sl=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},ol=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},_l=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},pl=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},al=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},ul=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},ll=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),k.Procedures.NAME_TYPE),n=e.statementToCode(this,"STACK")||" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},Hl=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},Wl=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},Kl=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},jl=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},ql=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Ql=function(t,e){return'"},Jl=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Zl=function(){return this.getFieldValue("TEXT")+"\n"},zl=function(t){return t.getFieldValue("TEXT")+"\n"},$l=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},tr=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},er=function(){return""},ir=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},nr=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o=0&&(n[s]=n[s].replace(" ",""));i="";for(s=0;s0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},W.scrubNakedValue=function(t){return t+"\n"},W.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},W.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},W.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=k.utils.string.wrap(o,W.COMMENT_WRAP-3),n+=W.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const K=330,j={init:function(){this.setColour(K),this.appendDummyInput().appendField(new k.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(k.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},q={init:function(){this.setColour(K),this.appendValueInput("VALUE").appendField(new k.FieldTextInput(""),"VAR").appendField(k.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},Q={init:function(){this.setColour(K);var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"],[k.Msg.LANG_MATH_BOOLEAN,"bool"],[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0)}},J={init:function(){this.setColour(K),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},Z={init:function(){this.setColour(K),this.appendValueInput("DATA").appendField(k.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},z={init:function(){this.setColour(K),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new k.FieldDropdown([[k.Msg.LANG_MATH_INT,"int"],[k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[k.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"],[k.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return k.Msg.MICROBIT_controls_TypeLists+{int:k.Msg.LANG_MATH_INT,float:k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:k.Msg.MIXLY_MICROBIT_TYPE_STRING,list:k.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:k.Msg.MIXLY_MICROBIT_TYPE_DICT,set:k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:k.Msg.MIXLY_MICROBIT_IMAGE,bytes:k.Msg.LANG_MATH_BYTE,NoneType:k.Msg.LOGIC_NULL}[e]}))}},$=120,tt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_NAME_MAIN),this.appendStatementInput("DO").appendField(""),this.setTooltip(k.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},et={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_SETUP),this.appendStatementInput("DO").appendField(""),this.setTooltip(k.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},it={init:function(){var t=[[k.Msg.MIXLY_mSecond,"delay"],[k.Msg.MIXLY_uSecond,"delayMicroseconds"]];this.setColour($),this.appendValueInput("DELAY_TIME",Number).appendField(k.Msg.MIXLY_DELAY).appendField(new k.FieldDropdown(t),"UNIT").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_CONTROL_DELAY),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#id9"),this.wiki={"zh-hans":{page:["Arduino AVR","控制","延时"]}}}},nt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_CONTROL_END_PROGRAM),this.setPreviousStatement(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_END_TOOLTIP)}},st={init:function(){this.setColour($),this.appendValueInput("IF0").setCheck([Boolean,Number]).appendField(k.Msg.CONTROLS_IF_MSG_IF),this.appendStatementInput("DO0").appendField(k.Msg.CONTROLS_IF_MSG_THEN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#if"),this.setMutator(new k.icons.MutatorIcon(["controls_if_elseif","controls_if_else"],this));var t=this;this.setTooltip((function(){return t.elseifCount_||t.elseCount_?!t.elseifCount_&&t.elseCount_?k.Msg.CONTROLS_IF_TOOLTIP_2:t.elseifCount_&&!t.elseCount_?k.Msg.CONTROLS_IF_TOOLTIP_3:t.elseifCount_&&t.elseCount_?k.Msg.CONTROLS_IF_TOOLTIP_4:"":k.Msg.CONTROLS_IF_TOOLTIP_1})),this.elseifCount_=0,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},ot={init:function(){this.setColour($),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},_t={init:function(){this.setColour($),this.appendValueInput("LIST").setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(k.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},pt={init:function(){this.setColour($),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new k.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(k.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},at={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},ut={init:function(){this.setColour($);var t=new k.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},lt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},rt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};pt.OPERATORS=[[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],ut.OPERATORS=[[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Tt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},dt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},It={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},ht={init:function(){this.setColour($),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Ot={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Et={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Mt={init:function(){this.jsonInit({message0:k.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:$,tooltip:k.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:k.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},ct={init:function(){this.setColour($),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_STAT),this.setOutput(!0)}},Rt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},mt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},gt={init:function(){this.appendDummyInput().appendField(k.Msg.CONTROLS_REPEAT_TITLE_REPEAT+k.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(k.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new k.FieldDropdown([[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour($),this.setTooltip("do-while loop"),this.setHelpUrl("")}},At={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Ct={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},St={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_GET+k.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_GET_UNIQUE_IDEN)}},Dt=230;k.FieldTextInput.math_number_validator=function(t){return String(t)},k.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Nt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},Pt={init:function(){this.setColour(Dt);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},ft={init:function(){this.setColour(Dt);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Ft={init:function(){this.setColour(Dt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},vt={init:function(){this.setColour(Dt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Vt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new k.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Yt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:k.Msg.MATH_TRIG_TOOLTIP_SIN,COS:k.Msg.MATH_TRIG_TOOLTIP_COS,TAN:k.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:k.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:k.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:k.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:k.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},yt={init:function(){var t=[[k.Msg.MATH_BIN,"bin"],[k.Msg.MATH_OCT,"oct"],[k.Msg.MATH_HEX,"hex"]];this.setColour(Dt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:k.Msg.MATH_DEC_TOOLTIP_BIN,oct:k.Msg.MATH_DEC_TOOLTIP_OCT,hex:k.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},bt={init:function(){var t=[[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"],[k.Msg.MATH_ABS,"fabs"],[k.Msg.MATH_SQRT,"sqrt"]];this.setColour(Dt),this.appendValueInput("A").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:k.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:k.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:k.Msg.MATH_SINGLE_TOOLTIP_SQ,round:k.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:k.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:k.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},kt={init:function(){var t=[[k.Msg.MIXLY_MAX,"max"],[k.Msg.MIXLY_MIN,"min"]];this.setColour(Dt),this.appendValueInput("A").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(new k.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(k.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:k.Msg.MIXLY_TOOLTIP_MATH_MAX,min:k.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Ut={init:function(){var t=[[k.Msg.MATH_TWO,"two"],[k.Msg.MATH_EIGHT,"eight"],[k.Msg.MATH_TEN,"ten"],[k.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Dt),this.appendDummyInput("").appendField(k.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new k.FieldDropdown(t),"OP").appendField(k.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(k.Msg.MATH_ZHW).appendField(new k.FieldDropdown(t),"OP2").appendField(k.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:k.Msg.MATH_Before_two,eight:k.Msg.MATH_Before_eight,ten:k.Msg.MATH_Before_ten,sixteen:k.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:k.Msg.MATH_Behind_two,eight:k.Msg.MATH_Behind_eight,ten:k.Msg.MATH_Behind_ten,sixteen:k.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Xt={init:function(){var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Dt),this.setOutput(!0,Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_RANDOM).appendField(new k.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:k.Msg.LANG_MATH_INT,float:k.Msg.LANG_MATH_FLOAT_RANDOM};return k.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Bt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_CONSTRAIN_TOOLTIP)}},xt={init:function(){this.setColour(Dt),this.appendValueInput("NUM",Number).appendField(k.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(k.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(k.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Gt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},wt={init:function(){this.setColour(Dt),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Ht={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MATH_ROUND).appendField(k.Msg.TEXT_KEEP),this.appendDummyInput().appendField(k.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_ROUND_NEW_TOOLTIP)}},Wt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"],[k.Msg.MIXLY_TO_BITES,"b"]];this.setColour(Dt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:k.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:k.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Kt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Dt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:k.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},jt=xt,qt=160,Qt={init:function(){this.setColour(qt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(k.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new k.FieldImage(e,12,12,'"')}},Jt={init:function(){this.setColour(qt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(k.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new k.FieldImage(e,12,12,'"')}};k.FieldTextInput.char_validator=function(t){if(t.length>1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Zt={init:function(){this.setColour(qt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldTextInput("",k.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(k.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new k.FieldImage(e,7,12,'"')}},zt={init:function(){this.setColour(qt),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(k.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},$t={init:function(){this.setColour(qt),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},te={init:function(){this.setColour(qt),this.appendValueInput("VAR").setCheck(String).appendField(k.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},ee={init:function(){this.setColour(qt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ie={init:function(){this.setColour(qt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},ne={init:function(){this.WHERE_OPTIONS=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.TEXT_GET_INDEX_RANDOM+1+k.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(qt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(k.Msg.LISTS_GET_INDEX_GET,"MODE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(k.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+k.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",k.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:k.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:k.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:k.Msg.TEXT_GET_INDEX_RANDOM};return k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+k.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==k.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new k.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},se={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(qt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.LISTS_GET_INDEX_FROM_START+"n"+k.Msg.TEXT_CHARAT2)}},oe={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(qt),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(k.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(k.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},_e={init:function(){this.WHERE_OPTIONS_1=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[k.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(qt),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==k.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new k.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},pe={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(qt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(k.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},ae={init:function(){var t=[[k.Msg.MIXLY_EQUALS,"==="],[k.Msg.MIXLY_STARTSWITH,"startswith"],[k.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(qt),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new k.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},ue={init:function(){this.setColour(qt),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_COMPARETO_HELP)}},le={init:function(){var t=[[k.Msg.TEXT_UPPER,"upper"],[k.Msg.TEXT_TITLE,"title"],[k.Msg.TEXT_CAPITALIZE,"capitalize"],[k.Msg.TEXT_SWAPCASE,"swapcase"],[k.Msg.TEXT_LOWER,"lower"]];this.setColour(qt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:k.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:k.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:k.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:k.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:k.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},re={init:function(){var t=[[k.Msg.TEXT_LJUST,"ljust"],[k.Msg.TEXT_CENTER,"center"],[k.Msg.TEXT_RJUST,"rjust"]];this.setColour(qt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(k.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(k.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Te={init:function(){this.setColour(qt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(k.Msg.MIXLY_MID+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(k.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},de={init:function(){this.setColour(qt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ie={init:function(){this.setColour(qt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(k.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},he={init:function(){this.setColour(qt),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(k.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(k.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Oe={init:function(){var t=[[k.Msg.TEXT_TRIM_BOTH,"strip"],[k.Msg.TEXT_TRIM_LEFT,"lstrip"],[k.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(qt),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new k.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(k.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:k.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:k.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:k.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Ee={init:function(){this.setColour(qt),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new k.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},di={init:function(){this.setColour(ri),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Ii={init:function(){this.setColour(ri),this.appendDummyInput().appendField(k.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},hi={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_KEYS),this.setTooltip(k.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Oi={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_TOOLTIP)}},Ei={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Mi={init:function(){this.setColour(ri),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(k.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},ci={init:function(){this.setColour(ri),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_DELETE_TOOLTIP)}},Ri={init:function(){this.setColour(ri),this.appendValueInput("DICT2").setCheck("Dict").appendField(k.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(k.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(k.Msg.MIXLY_MID),this.setTooltip(k.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mi={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_CLEAR),this.setTooltip(k.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gi={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_ITEMS),this.setTooltip(k.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Ai={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_VALUES),this.setTooltip(k.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},Li={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_LENGTH),this.setTooltip(k.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Ci={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_DELDICT),this.setTooltip(k.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Si={init:function(){this.MODE=[[k.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[k.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(k.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=k.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=k.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new k.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Di={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setTooltip(k.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Ni={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_SETDEFAULT_TOOLTIP)}},Pi={init:function(){this.setColour(ri),this.appendDummyInput("").appendField(new k.FieldLabel(k.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new k.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(k.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},fi={init:function(){this.setColour(ri),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},Fi={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_TO_JSON),this.setTooltip(k.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},vi={init:function(){this.setColour(ri),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(k.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},Vi=210,Yi={init:function(){var t=k.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Vi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:k.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:k.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:k.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:k.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:k.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:k.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},yi={init:function(){var t=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Vi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new k.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},bi={init:function(){var t=[[k.Msg.LOGIC_OPERATION_AND,"AND"],[k.Msg.LOGIC_OPERATION_OR,"OR"],[k.Msg.LOGIC_OPERATION_NOR,"NOR"],[k.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Vi),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:k.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:k.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:k.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:k.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},ki={init:function(){this.setColour(Vi),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(k.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(k.Msg.LOGIC_NEGATE_TOOLTIP)}},Ui={init:function(){var t=[[k.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[k.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Vi),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new k.FieldDropdown(t),"BOOL"),this.setTooltip(k.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Xi={init:function(){this.setColour(Vi),this.setOutput(!0),this.appendDummyInput().appendField(k.Msg.LOGIC_NULL),this.setTooltip(k.Msg.LOGIC_NULL_TOOLTIP)}},Bi={init:function(){this.setColour(Vi),this.appendValueInput("A"),this.appendValueInput("B").appendField(k.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(k.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},xi={init:function(){var t=[[k.Msg.TEXT_APPEND_TO,"in"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Vi),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new k.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(k.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.IN)}},Gi={init:function(){var t=[[k.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Vi),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},wi={init:function(){this.setColour(Vi),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Hi={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(k.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Wi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ki={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},ji={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXPY_TEXT_ENCODE).appendField(new k.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},qi={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Qi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Ji={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},Zi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},zi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.HTML_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},$i={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},tn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},en={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const nn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},sn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},on={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},_n={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},pn={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},an={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+k.Msg.MIXLY_ESP32_SET+{mkdir:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},un={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(k.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},ln={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},rn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.HTML_FILE,"isfile"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Tn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(k.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(k.Msg.MIXLY_SETUP+k.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(k.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},dn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(k.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},In={init:function(){var t=G.findLegalName("",this),e=new k.FieldTextInput(t,G.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new k.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&k.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(k.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(k.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(k.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(k.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=k.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),k.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{k.Events.enable()}},mutationToDom:function(t){var e=k.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var i=0;i"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ps={init:function(){this.setColour(es),this.appendDummyInput().appendField(k.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},as={init:function(){this.setColour(es),this.appendDummyInput().appendField(k.Msg.HTML_FORM_CONTENT).appendField(new k.FieldDropdown([[k.Msg.HTML_TEXT,"text"],[k.Msg.HTML_EMAIL,"email"],[k.Msg.HTML_NUMBER,"number"],[k.Msg.HTML_PASSWORD,"password"],[k.Msg.HTML_CHECKBOX,"checkbox"],[k.Msg.HTML_RADIOBUTTON,"radiobutton"],[k.Msg.HTML_BUTTON,"button"],[k.Msg.HTML_COLOUR,"colour"],[k.Msg.HTML_DATE,"date"],[k.Msg.HTML_LOCALTIME,"local time"],[k.Msg.HTML_FILE,"file"],[k.Msg.HTML_HIDDEN,"hidden"],[k.Msg.HTML_IMAGE,"image"],[k.Msg.HTML_MONTH,"month"],[k.Msg.HTML_RANGE,"range"],[k.Msg.HTML_RESET,"reset"],[k.Msg.HTML_SEARCH,"search"],[k.Msg.HTML_SUBMIT,"submit"],[k.Msg.HTML_TELEPHONENUMBER,"telephone number"],[k.Msg.HTML_TIME,"time"],[k.Msg.HTML_URL,"url"],[k.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(k.Msg.HTML_NAME).appendField(new k.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(k.Msg.HTML_VALUE).appendField(new k.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},us={init:function(){this.setColour(es),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ls={init:function(){this.setColour(es),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rs={init:function(){this.setColour(es),this.appendDummyInput().appendField(k.Msg.HTML_TEXT).appendField(new k.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ts=160,ds={init:function(){this.setColour(Ts),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new k.FieldTable(""),"TEXT")}},Is={init:function(){this.setColour(Ts),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT")}},hs={init:function(){this.setColour(Ts),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Os={init:function(){this.setColour(Ts),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Es={init:function(){this.setColour(Ts),this.appendDummyInput().appendTitle("Comment:").appendTitle(new k.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Ms={init:function(){this.setColour(Ts),this.appendValueInput("VALUE").appendField(k.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},cs={init:function(){this.setColour(Ts),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=k.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ks={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Us={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xs={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bs={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xs={init:function(){this.setColour(Ss);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gs={init:function(){this.setColour(Ss),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_SPLITBYDOU).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},ws={init:function(){this.setColour(Ss);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},Hs={init:function(){this.setColour(Ss);var t=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],e=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Ws={init:function(){this.setColour(Ss);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ks={init:function(){this.setColour(Ss);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},js={init:function(){this.setColour(Ss);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},qs={init:function(){this.setColour(Ss),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qs={init:function(){this.setColour(Ss);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Js={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(Ss),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(k.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setTooltip(k.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},Zs={init:function(){this.setColour(Ss),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},zs={init:function(){this.setColour(Ss),this.appendValueInput("FILENAME").appendField(k.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[k.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},$s={init:function(){this.setColour(Ss),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(k.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new k.FieldDropdown([[k.Msg.DATAFRAME_COLUMN,"column"],[k.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(k.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},to={init:function(){this.setColour(Ss),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},eo={init:function(){this.setColour(Ss);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},io={init:function(){this.setColour(Ss),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},no={init:function(){this.setColour(Ss),this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},so={init:function(){this.setColour(Ss);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},oo={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_o={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},po={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ao={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},uo={init:function(){this.setColour(Ss);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},lo={init:function(){this.setColour(Ss);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},ro={init:function(){this.setColour(Ss);var t=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(t),"DOT"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},To={init:function(){this.setColour(Ss);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Io={init:function(){this.setColour(Ss);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},ho={init:function(){this.setColour(Ss);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Oo={init:function(){this.setColour(Ss),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Eo={init:function(){this.setColour(Ss);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Mo={init:function(){this.setColour(Ss),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},co={init:function(){this.setColour(Ss),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Ro={init:function(){this.setColour(Ss);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},mo=20,go={init:function(){this.setColour(mo),this.appendValueInput("VAR").appendField(k.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(k.Msg.INOUT_input_TOOLTIP)}},Ao={init:function(){this.setColour(mo),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.BLOCKPY_PRINT_TOOLTIP)}},Lo={init:function(){this.setColour(mo),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},Co={init:function(){this.setColour(mo),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(k.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},So={init:function(){var t=[[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(mo),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(k.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:k.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:k.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:k.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},Do={init:function(){this.setColour(mo),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n0?t:[["'无可用地图'","'无可用地图'"]]}},K_={init:function(){this.appendValueInput("pathtype").setCheck(null).appendField("设置路径样式为"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},j_={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用路径'","'无可用路径'"]]}},q_={init:function(){this.setColour(290),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("posx").setCheck(null).appendField("在("),this.appendDummyInput().appendField(","),this.appendValueInput("posy").setCheck(null).appendField(""),this.appendDummyInput().appendField(")放置").appendField(new k.FieldDropdown([["障碍","'wall'"],["金币","'coin'"]]),"item"),this.setTooltip("")}},Q_={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用角色'","'无可用角色'"]]}},J_={init:function(){this.setColour(290),this.appendValueInput("character").setCheck(null).appendField("初始化角色为"),this.appendDummyInput().appendField("面朝").appendField(new k.FieldDropdown([["北","0"],["南","2"],["西","3"],["东","1"]]),"direction"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Z_={init:function(){this.setColour(290),this.appendDummyInput().appendField("获取⻆⾊所获分数"),this.setOutput(!0,Number),this.setTooltip("")}},z_={init:function(){this.appendDummyInput().appendField(new k.FieldDropdown([["北","0"],["南","2"],["西","3"],["东","1"]]),"direction"),this.appendDummyInput().appendField("侧有障碍"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},$_={init:function(){this.appendDummyInput().appendField("随机生成小车油量"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},tp={init:function(){this.appendDummyInput().appendField("需要加油"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},ep={init:function(){this.appendDummyInput().appendField("信号灯为绿灯"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},ip={init:function(){this.appendDummyInput().appendField("信号灯为红灯"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},np={init:function(){this.appendDummyInput().appendField("进加油站加油"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},sp={init:function(){this.appendDummyInput().appendField("检查程序循环数目是否正确"),this.setPreviousStatement(!0),this.setColour(290),this.setTooltip("")}},op=function(t,e){return[e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE),e.ORDER_ATOMIC]},_p=function(t,e){if(""==this.getFieldValue("VAR"))return" = None\n";var i=e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"None";return e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE)+" = "+i+"\n"},pp=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"MYVALUE",e.ORDER_ATOMIC)||"None";if("bytes"==i)var s=i+"("+n+',"UTF-8")';else s=i+"("+n+")";return[s,e.ORDER_ATOMIC]},ap=function(t,e){return"global "+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"None")+"\n"},up=function(t,e){return["type("+(e.valueToCode(this,"DATA",e.ORDER_ATOMIC)||"None")+")",e.ORDER_ATOMIC]},lp=function(t,e){return[this.getFieldValue("type"),e.ORDER_ATOMIC]},rp=function(t,e){var i=e.statementToCode(t,"DO");return"if __name__ == '__main__':\n"+(i=e.addLoopTrap(i,t.id)||e.PASS)},Tp=function(t,e){var i=e.statementToCode(this,"DO");return(i=i.replace(/(^\s*)|(\s*$)/g,"").replace(/\n {4}/g,"\n")).endsWith("\n")?e.setups_.setup_setup=i:e.setups_.setup_setup=i+"\n",""},dp=function(t,e){var i=0,n="";do{n+=(0==i?"if ":"elif ")+(e.valueToCode(t,"IF"+i,e.ORDER_NONE)||"False")+":\n"+(e.statementToCode(t,"DO"+i)||e.PASS),++i}while(t.getInput("IF"+i));return t.getInput("ELSE")&&(n+="else:\n"+(e.statementToCode(t,"ELSE")||e.PASS)),n},Ip=function(t,e){var i=0,n=e.valueToCode(this,"IF"+i,e.ORDER_NONE)||"null",s="try:\n"+(e.statementToCode(this,"try")||" pass\n");for(i=1;i<=this.elseifCount_;i++)""!==(n=e.valueToCode(this,"IF"+i,e.ORDER_NONE)||"")&&(n=" "+n),s+="except"+n+": \n"+(e.statementToCode(this,"DO"+i)||" pass\n");return this.elseCount_&&(s+="finally:\n"+(e.statementToCode(this,"ELSE")||" pass\n")),s},hp=function(t,e){var i=e.variableDB_.getName(t.getFieldValue("VAR"),k.Variables.NAME_TYPE),n=e.valueToCode(t,"FROM",e.ORDER_NONE)||"0",s=e.valueToCode(t,"TO",e.ORDER_NONE)||"0",o=e.valueToCode(t,"STEP",e.ORDER_NONE)||"1",_=e.statementToCode(t,"DO"),p=(_=e.addLoopTrap(_,t.id)||e.PASS,""),a=function(t,e){return e.provideFunction_("upRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start <= stop:"," yield start"," start += abs(step)"])},u=function(t,e){return e.provideFunction_("downRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start >= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},k.isNumber(n)&&k.isNumber(s)&&k.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const yu=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},bu=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},ku=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Uu=function(t,e){return["None",e.ORDER_ATOMIC]},Xu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Bu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},xu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Gu=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},wu=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},Hu=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},Wu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},Ku=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},ju=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},qu=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},Qu=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ju=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Zu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},zu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},$u=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},tl=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},el=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},il=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},nl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},sl=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},ol=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},_l=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},pl=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},al=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},ul=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},ll=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},rl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},Tl=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),k.Procedures.NAME_TYPE),n=e.statementToCode(this,"STACK")||" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},Kl=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},jl=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},ql=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},Ql=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},Jl=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Zl=function(t,e){return'"},zl=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},$l=function(){return this.getFieldValue("TEXT")+"\n"},tr=function(t){return t.getFieldValue("TEXT")+"\n"},er=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},ir=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},nr=function(){return""},sr=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},or=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o=0&&(n[s]=n[s].replace(" ",""));i="";for(s=0;spromptHelloHelloHello,HelloMixly100,1,2,3051i90x151100a10.998124.821100101010001100501100110000x2x0,1,2,30,1,2,30,1,2,3xMixlyHelloMixly65axMixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixpyI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')dirmylist1,2,3,4,5mylist0mylist02mylist00mylist0101mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistx0,1,2,30,1,2,3mytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}s11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2x000000000000 \ No newline at end of file +promptHelloHelloHello,HelloMixly100,1,2,3051i90x151100a10.998124.821100101010001100501100110000x2x0,1,2,30,1,2,30,1,2,3xMixlyHelloMixly65axMixlyMixly0Mixly02MixlyMixlyHello,mixlyHello,mixly50*Hello,mixlyl--mylistHello,mixlymixlymixpyI love mixly!I love mixlyRandom No. is {}int1100input('1+2*3')dirmylist1,2,3,4,5mylist0mylist02mylist00mylist0101mylistmylist2mylistmylist0mylist00mylist00mylist0mylist0mylist0mylistmylistmylistx0,1,2,30,1,2,3mytup1,2,3,4,5mytup0mytup02mytupmytupmytupmytup0mytupmytup1mytup2xmydictmydictkeymydictkey0mydictkey0mydictkeymydictkeymydictkey0mydictmydictmydictmydictxmydict{"name":"Mixly","color":"green"}s11,2,3,4,5s1s1s1s2s1s2s10s1Mixlys1s2x000000000000 \ No newline at end of file diff --git a/boards/default/python_skulpt_mixtoy/main.bundle.js b/boards/default/python_skulpt_mixtoy/main.bundle.js index 9b4235bd..caf50c6b 100644 --- a/boards/default/python_skulpt_mixtoy/main.bundle.js +++ b/boards/default/python_skulpt_mixtoy/main.bundle.js @@ -1,4 +1,4 @@ -(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{controls_type:()=>Z,controls_typeLists:()=>z,variables_change:()=>Q,variables_get:()=>j,variables_global:()=>J,variables_set:()=>q});var i={};t.r(i),t.d(i,{base_setup:()=>et,controls_delay:()=>it,controls_end_program:()=>nt,controls_except:()=>Et,controls_finally:()=>Ot,controls_flow_statements:()=>ut,controls_for:()=>lt,controls_forEach:()=>_t,controls_for_range:()=>rt,controls_if:()=>st,controls_if_else:()=>dt,controls_if_elseif:()=>It,controls_if_if:()=>Tt,controls_lambda:()=>Rt,controls_main:()=>tt,controls_pass:()=>ct,controls_range:()=>ot,controls_repeat_ext:()=>Mt,controls_thread:()=>mt,controls_try:()=>ht,controls_try_finally:()=>at,controls_whileUntil:()=>pt,do_while:()=>At,garbage_collection:()=>gt,get_mem_alloc:()=>Lt,get_mem_free:()=>Ct});var n={};t.r(n),t.d(n,{base_map:()=>Kt,math_arithmetic:()=>ft,math_bit:()=>vt,math_constant:()=>Nt,math_constant_mp:()=>Pt,math_constrain:()=>Ut,math_dec:()=>Yt,math_indexer_number:()=>Bt,math_map:()=>Gt,math_max_min:()=>bt,math_number:()=>Dt,math_number_base_conversion:()=>kt,math_random:()=>Xt,math_random_seed:()=>xt,math_round:()=>wt,math_selfcalcu:()=>Ft,math_to_int:()=>yt,math_trig:()=>Vt,text_to_number:()=>Ht,text_to_number_skulpt:()=>Wt});var s={};t.r(s),t.d(s,{ascii_to_char:()=>zt,char_to_ascii:()=>$t,number_to_text:()=>te,os_system:()=>Ce,text:()=>qt,text_capital:()=>ue,text_center:()=>le,text_char:()=>Jt,text_char_at:()=>ne,text_char_at2:()=>ie,text_char_at3:()=>me,text_compareTo:()=>ce,text_compare_to:()=>ae,text_create_with_container:()=>Oe,text_create_with_item:()=>Me,text_encode:()=>ge,text_equals_starts_ends:()=>pe,text_eval:()=>Le,text_find:()=>re,text_format:()=>Ee,text_format_noreturn:()=>Ae,text_join:()=>Zt,text_join_seq:()=>Te,text_length:()=>ee,text_random_char:()=>se,text_replace:()=>Ie,text_split:()=>de,text_strip:()=>he,text_substring:()=>_e,text_substring2:()=>oe,text_substring3:()=>Re,text_textarea:()=>Qt});var o={};t.r(o),t.d(o,{list_many_input:()=>qe,list_tolist:()=>ei,list_tolist2:()=>ui,list_trig:()=>We,lists_2d_get_col_row_data:()=>fe,lists_2d_get_data_with_col_row:()=>Pe,lists_append_extend:()=>be,lists_change_to:()=>je,lists_change_to_general:()=>Je,lists_clear:()=>Be,lists_create_with:()=>Fe,lists_create_with2:()=>ii,lists_create_with_container:()=>Ve,lists_create_with_item:()=>Ye,lists_create_with_noreturn:()=>Qe,lists_create_with_text:()=>ve,lists_create_with_text2:()=>ni,lists_del_general:()=>Ze,lists_find:()=>He,lists_getIndex3:()=>si,lists_getSublist3:()=>oi,lists_get_index:()=>De,lists_get_random_item:()=>ke,lists_get_random_sublist:()=>Xe,lists_get_sublist:()=>Ne,lists_insert_value:()=>Ue,lists_insert_value2:()=>pi,lists_pop:()=>we,lists_remove_at:()=>xe,lists_remove_at2:()=>ai,lists_reverse:()=>Ge,lists_setIndex3:()=>_i,lists_set_index:()=>ye,lists_sort:()=>Ke,lists_zip:()=>ze,lists_zip_container:()=>$e,lists_zip_item:()=>ti});var _={};t.r(_),t.d(_,{dicts_add_change_del:()=>Ci,dicts_add_or_change:()=>Oi,dicts_clear:()=>ci,dicts_create_with:()=>ri,dicts_create_with_container:()=>Ti,dicts_create_with_item:()=>Ii,dicts_create_with_noreturn:()=>Ni,dicts_deldict:()=>Li,dicts_delete:()=>Mi,dicts_get:()=>hi,dicts_get_default:()=>Ei,dicts_items:()=>mi,dicts_keys:()=>di,dicts_length:()=>gi,dicts_pop:()=>Si,dicts_setdefault:()=>Di,dicts_to_json:()=>fi,dicts_todict:()=>Pi,dicts_update:()=>Ri,dicts_values:()=>Ai,json_to_dicts:()=>Fi});var p={};t.r(p),t.d(p,{logic_boolean:()=>ki,logic_compare:()=>Vi,logic_compare_continous:()=>Yi,logic_is:()=>Bi,logic_is_in:()=>Gi,logic_negate:()=>bi,logic_null:()=>Xi,logic_operation:()=>yi,logic_tobool:()=>xi,logic_true_or_false:()=>Ui});var a={};t.r(a),t.d(a,{sdcard_mount:()=>Tn,sdcard_use_spi_init:()=>rn,storage_can_write_ornot:()=>Zi,storage_change_dir:()=>un,storage_close_file:()=>$i,storage_delete_file:()=>en,storage_file_seek:()=>on,storage_file_tell:()=>sn,storage_file_write:()=>ji,storage_fileopen:()=>Hi,storage_fileopen_new:()=>Wi,storage_fileopen_new_encoding:()=>Ki,storage_get_a_line:()=>Ji,storage_get_contents:()=>Qi,storage_get_contents_without_para:()=>qi,storage_get_current_dir:()=>_n,storage_get_file_size:()=>nn,storage_get_filename:()=>zi,storage_is_file:()=>ln,storage_list_all_files:()=>tn,storage_make_dir:()=>pn,storage_open_file_with_os:()=>wi,storage_rename:()=>an});var u={};t.r(u),t.d(u,{procedures_callnoreturn:()=>On,procedures_callreturn:()=>Mn,procedures_defnoreturn:()=>In,procedures_defreturn:()=>dn,procedures_ifreturn:()=>Rn,procedures_mutatorarg:()=>En,procedures_mutatorcontainer:()=>hn,procedures_return:()=>cn});var l={};t.r(l),t.d(l,{tuple_change_to:()=>vn,tuple_create_with:()=>An,tuple_create_with_container:()=>gn,tuple_create_with_item:()=>Ln,tuple_create_with_noreturn:()=>bn,tuple_create_with_text2:()=>Cn,tuple_create_with_text_return:()=>Sn,tuple_del:()=>Pn,tuple_find:()=>Vn,tuple_getIndex:()=>Dn,tuple_getSublist:()=>yn,tuple_get_random_item:()=>Xn,tuple_get_sublist:()=>kn,tuple_join:()=>fn,tuple_length:()=>Nn,tuple_max:()=>Fn,tuple_totuple:()=>Un,tuple_trig:()=>Yn});var r={};t.r(r),t.d(r,{set_add_discard:()=>Qn,set_clear:()=>Kn,set_create_with:()=>Bn,set_create_with_container:()=>xn,set_create_with_item:()=>wn,set_create_with_text_return:()=>zn,set_length:()=>Hn,set_operate:()=>jn,set_operate_update:()=>qn,set_pop:()=>Wn,set_sub:()=>Jn,set_toset:()=>$n,set_update:()=>Zn});var T={};t.r(T),t.d(T,{html_content:()=>ss,html_content_more:()=>os,html_document:()=>es,html_form:()=>ps,html_head_body:()=>ns,html_style:()=>_s,html_style_color:()=>us,html_style_content:()=>as,html_text:()=>ls,html_title:()=>is});var I={};t.r(I),t.d(I,{attribute_access:()=>Ls,function_call:()=>ms,function_call_container:()=>As,function_call_item:()=>gs,raw_block:()=>Is,raw_empty:()=>hs,raw_expression:()=>ds,raw_table:()=>Ts,text_comment:()=>Es,text_print_multiple:()=>Ms,text_print_multiple_container:()=>Rs,text_print_multiple_item:()=>cs,type_check:()=>Os});var d={};t.r(d),t.d(d,{array_create:()=>Bs,array_toarray:()=>eo,dataframe_create:()=>Ns,dataframe_create_from_index:()=>fs,dataframe_create_from_one_index:()=>Ps,dataframe_get:()=>zs,numpy_trig:()=>Qs,pandas_readcsv:()=>Zs,pl_axes:()=>ks,pl_bar:()=>Ws,pl_hist:()=>js,pl_label:()=>Gs,pl_legend:()=>Xs,pl_pie:()=>Ks,pl_plot:()=>ys,pl_plot_bar:()=>xs,pl_plot_easy:()=>Ys,pl_plot_scatter:()=>ws,pl_plot_xy:()=>Hs,pl_savefig:()=>$s,pl_show:()=>bs,pl_subplot:()=>Js,pl_text:()=>to,pl_ticks:()=>qs,pl_title:()=>Us,plot_axes:()=>oo,plot_bar:()=>To,plot_hist:()=>ho,plot_label:()=>ao,plot_legend:()=>_o,plot_pie:()=>Io,plot_plot:()=>no,plot_plot_bar:()=>uo,plot_plot_easy:()=>io,plot_plot_scatter:()=>lo,plot_plot_xy:()=>ro,plot_savefig:()=>Mo,plot_show:()=>so,plot_subplot:()=>Oo,plot_text:()=>Ro,plot_ticks:()=>Eo,plot_title:()=>po,series_create:()=>Ss,series_create_from_index:()=>Ds,series_create_from_text:()=>Fs,series_get_num:()=>Vs,series_index_value:()=>vs});var h={};t.r(h),t.d(h,{inout_input:()=>mo,inout_print:()=>Ao,inout_print_container:()=>Do,inout_print_end:()=>Lo,inout_print_inline:()=>go,inout_print_item:()=>No,inout_print_many:()=>So,inout_type_input:()=>Co});var E={};t.r(E),t.d(E,{Panic_with_status_code:()=>Vo,base_delay:()=>fo,controls_millis:()=>Fo,controls_mstimer2:()=>yo,controls_mstimer2_start:()=>bo,controls_mstimer2_stop:()=>ko,reset:()=>Yo,time_localtime:()=>vo,time_sleep:()=>Xo});var O={};t.r(O),t.d(O,{turtle_bgcolor:()=>o_,turtle_bgcolor_hex:()=>d_,turtle_bgcolor_hex_new:()=>u_,turtle_circle:()=>i_,turtle_circle_advanced:()=>n_,turtle_clear:()=>Jo,turtle_clone:()=>a_,turtle_color:()=>T_,turtle_color_hex:()=>I_,turtle_color_seclet:()=>L_,turtle_create:()=>Go,turtle_done:()=>Bo,turtle_exitonclick:()=>xo,turtle_fill:()=>zo,turtle_fillcolor:()=>p_,turtle_fillcolor_hex:()=>E_,turtle_fillcolor_hex_new:()=>r_,turtle_getscreen:()=>C_,turtle_goto:()=>jo,turtle_listen:()=>P_,turtle_move:()=>wo,turtle_numinput:()=>R_,turtle_onclick:()=>D_,turtle_onkey:()=>S_,turtle_ontimer:()=>N_,turtle_pencolor:()=>__,turtle_pencolor_hex:()=>h_,turtle_pencolor_hex_new:()=>l_,turtle_penup:()=>Zo,turtle_pos_shape:()=>Qo,turtle_rotate:()=>Ho,turtle_screen_delay:()=>Ko,turtle_screen_savefig:()=>f_,turtle_setheading:()=>Wo,turtle_setxy:()=>qo,turtle_shape:()=>O_,turtle_shapesize:()=>M_,turtle_size:()=>t_,turtle_size_speed:()=>$o,turtle_speed:()=>e_,turtle_textinput:()=>c_,turtle_visible:()=>s_,turtle_write:()=>m_,turtle_write_format:()=>A_,turtle_write_format_skulpt:()=>g_});var M={};t.r(M),t.d(M,{Turn:()=>b_,addOil:()=>tp,checkMarker:()=>ip,find_books_by_dichotomy:()=>_p,find_books_by_sequence:()=>pp,game_get_character_img:()=>K_,game_get_local_img:()=>x_,game_get_path_img:()=>H_,game_init:()=>V_,getMarkerNum:()=>np,get_actor_point:()=>q_,initSettedMap:()=>v_,initialize:()=>j_,isBarrier:()=>Q_,isCirculationRight:()=>ep,isDone:()=>k_,isLightGreen:()=>$_,isOilFull:()=>z_,isPath:()=>X_,is_Related_Barrier:()=>J_,is_Related_Path:()=>U_,move_direction_steps:()=>Y_,move_related_to_spirite:()=>y_,place_item:()=>W_,randomOil:()=>Z_,randomPlaceBarrier:()=>sp,set_map:()=>B_,set_map_bg:()=>G_,set_pathtype:()=>w_,settedSimpleMap:()=>op});var R={};t.r(R),t.d(R,{controls_type:()=>Tp,controls_typeLists:()=>Ip,variables_change:()=>lp,variables_get:()=>ap,variables_global:()=>rp,variables_set:()=>up});var c={};t.r(c),t.d(c,{Panic_with_status_code:()=>gp,base_setup:()=>hp,controls_delay:()=>Ap,controls_flow_statements:()=>mp,controls_for:()=>Mp,controls_forEach:()=>Np,controls_for_range:()=>Rp,controls_if:()=>Ep,controls_interrupts:()=>Sp,controls_lambda:()=>fp,controls_main:()=>dp,controls_millis:()=>Lp,controls_nointerrupts:()=>Dp,controls_pass:()=>vp,controls_range:()=>Pp,controls_repeat:()=>Up,controls_repeat_ext:()=>yp,controls_thread:()=>Vp,controls_try_finally:()=>Op,controls_whileUntil:()=>cp,do_while:()=>Yp,garbage_collection:()=>bp,get_mem_alloc:()=>kp,get_mem_free:()=>Xp,reset:()=>Cp,time_sleep:()=>Fp});var m={};t.r(m),t.d(m,{base_map:()=>_a,math_arithmetic:()=>Hp,math_bit:()=>wp,math_constant:()=>Bp,math_constant_mp:()=>xp,math_constrain:()=>$p,math_dec:()=>qp,math_indexer_number:()=>ia,math_map:()=>zp,math_max_min:()=>Jp,math_number:()=>Gp,math_number_base_conversion:()=>ta,math_random:()=>Zp,math_random_seed:()=>ea,math_round:()=>na,math_selfcalcu:()=>Wp,math_single:()=>Kp,math_to_int:()=>Qp,math_trig:()=>jp,text_to_number:()=>sa,text_to_number_skulpt:()=>oa});var A={};t.r(A),t.d(A,{ascii_to_char:()=>ra,char_to_ascii:()=>Ta,number_to_text:()=>Ia,os_system:()=>ba,text:()=>pa,text_capital:()=>Aa,text_center:()=>ga,text_char:()=>ua,text_char_at:()=>Ea,text_char_at2:()=>ha,text_char_at3:()=>Va,text_compareTo:()=>va,text_compare_to:()=>Ra,text_encode:()=>Ya,text_equals_starts_ends:()=>Ma,text_eval:()=>ya,text_find:()=>La,text_format:()=>Pa,text_format_noreturn:()=>fa,text_join:()=>la,text_join_seq:()=>Ca,text_length:()=>da,text_random_char:()=>Oa,text_replace:()=>Sa,text_split:()=>Da,text_strip:()=>Na,text_substring:()=>ma,text_substring2:()=>ca,text_substring3:()=>Fa,text_textarea:()=>aa});var g={};t.r(g),t.d(g,{list_many_input:()=>iu,list_tolist:()=>du,list_tolist2:()=>hu,list_trig:()=>$a,lists_2d_get_col_row_data:()=>Ua,lists_2d_get_data_with_col_row:()=>Xa,lists_append_extend:()=>Ha,lists_change_to:()=>eu,lists_change_to_general:()=>su,lists_clear:()=>Qa,lists_create_with:()=>Ga,lists_create_with2:()=>_u,lists_create_with_noreturn:()=>nu,lists_create_with_text:()=>Ba,lists_create_with_text2:()=>pu,lists_del_general:()=>ou,lists_find:()=>Ja,lists_getIndex3:()=>au,lists_getSublist3:()=>uu,lists_get_index:()=>xa,lists_get_random_item:()=>Wa,lists_get_random_sublist:()=>Ka,lists_get_sublist:()=>ka,lists_insert_value:()=>ja,lists_insert_value2:()=>ru,lists_pop:()=>za,lists_remove_at:()=>Za,lists_remove_at2:()=>Tu,lists_reverse:()=>qa,lists_setIndex3:()=>lu,lists_set_index:()=>wa,lists_sort:()=>tu,lists_zip:()=>Iu});var L={};t.r(L),t.d(L,{dicts_add_change_del:()=>Nu,dicts_add_or_change:()=>cu,dicts_clear:()=>gu,dicts_create_with:()=>Eu,dicts_create_with_noreturn:()=>Fu,dicts_deldict:()=>Du,dicts_delete:()=>mu,dicts_get:()=>Mu,dicts_get_default:()=>Ru,dicts_items:()=>Lu,dicts_keys:()=>Ou,dicts_length:()=>Su,dicts_pop:()=>Pu,dicts_setdefault:()=>fu,dicts_to_json:()=>Vu,dicts_todict:()=>vu,dicts_update:()=>Au,dicts_values:()=>Cu,json_to_dicts:()=>Yu});var C={};t.r(C),t.d(C,{logic_boolean:()=>Uu,logic_compare:()=>yu,logic_compare_continous:()=>bu,logic_is:()=>wu,logic_is_in:()=>xu,logic_negate:()=>Xu,logic_null:()=>Gu,logic_operation:()=>ku,logic_tobool:()=>Hu,logic_true_or_false:()=>Bu});var S={};t.r(S),t.d(S,{sdcard_mount:()=>Il,sdcard_use_spi_init:()=>Tl,storage_can_write_ornot:()=>$u,storage_change_dir:()=>pl,storage_close_file:()=>el,storage_delete_file:()=>nl,storage_file_seek:()=>_l,storage_file_tell:()=>ol,storage_file_write:()=>Qu,storage_fileopen:()=>Ku,storage_fileopen_new:()=>ju,storage_fileopen_new_encoding:()=>qu,storage_get_a_line:()=>zu,storage_get_contents:()=>Zu,storage_get_contents_without_para:()=>Ju,storage_get_current_dir:()=>al,storage_get_file_size:()=>sl,storage_get_filename:()=>tl,storage_is_file:()=>rl,storage_list_all_files:()=>il,storage_make_dir:()=>ul,storage_open_file_with_os:()=>Wu,storage_rename:()=>ll});var D={};t.r(D),t.d(D,{procedures_callnoreturn:()=>Ol,procedures_callreturn:()=>El,procedures_defnoreturn:()=>hl,procedures_defreturn:()=>dl,procedures_ifreturn:()=>Ml,procedures_return:()=>Rl});var N={};t.r(N),t.d(N,{tuple_change_to:()=>Nl,tuple_create_with:()=>cl,tuple_create_with_noreturn:()=>vl,tuple_create_with_text2:()=>ml,tuple_create_with_text_return:()=>Al,tuple_del:()=>Cl,tuple_find:()=>Pl,tuple_getIndex:()=>gl,tuple_getSublist:()=>Fl,tuple_get_random_item:()=>Yl,tuple_get_sublist:()=>Vl,tuple_join:()=>Sl,tuple_length:()=>Ll,tuple_max:()=>Dl,tuple_totuple:()=>yl,tuple_trig:()=>fl});var P={};t.r(P),t.d(P,{set_add_discard:()=>xl,set_clear:()=>Ul,set_create_with:()=>bl,set_create_with_text_return:()=>Wl,set_length:()=>kl,set_operate:()=>Gl,set_operate_update:()=>Bl,set_pop:()=>Xl,set_sub:()=>wl,set_toset:()=>Kl,set_update:()=>Hl});var f={};t.r(f),t.d(f,{html_content:()=>Jl,html_content_more:()=>Zl,html_document:()=>jl,html_form:()=>$l,html_head_body:()=>Ql,html_style:()=>zl,html_style_content:()=>tr,html_text:()=>er,html_title:()=>ql});var F={};t.r(F),t.d(F,{attribute_access:()=>ar,function_call:()=>pr,raw_block:()=>ir,raw_empty:()=>sr,raw_expression:()=>nr,raw_table:()=>or,type_check:()=>_r});var v={};t.r(v),t.d(v,{array_create:()=>Lr,array_toarray:()=>Xr,dataframe_create:()=>rr,dataframe_create_from_index:()=>Tr,dataframe_create_from_one_index:()=>Ir,dataframe_get:()=>yr,numpy_trig:()=>vr,pandas_readcsv:()=>Yr,pl_axes:()=>Mr,pl_bar:()=>Nr,pl_hist:()=>fr,pl_label:()=>gr,pl_legend:()=>mr,pl_pie:()=>Pr,pl_plot:()=>cr,pl_plot_bar:()=>Cr,pl_plot_easy:()=>Rr,pl_plot_scatter:()=>Sr,pl_plot_xy:()=>Dr,pl_savefig:()=>br,pl_show:()=>Or,pl_subplot:()=>Vr,pl_text:()=>kr,pl_ticks:()=>Fr,pl_title:()=>Ar,plot_axes:()=>Gr,plot_bar:()=>Qr,plot_hist:()=>Zr,plot_label:()=>Wr,plot_legend:()=>wr,plot_pie:()=>Jr,plot_plot:()=>xr,plot_plot_bar:()=>Kr,plot_plot_easy:()=>Br,plot_plot_scatter:()=>jr,plot_plot_xy:()=>qr,plot_savefig:()=>tT,plot_show:()=>Ur,plot_subplot:()=>$r,plot_text:()=>eT,plot_ticks:()=>zr,plot_title:()=>Hr,series_create:()=>ur,series_create_from_index:()=>lr,series_create_from_text:()=>dr,series_get_num:()=>Er,series_index_value:()=>hr});var V={};t.r(V),t.d(V,{inout_input:()=>iT,inout_print:()=>nT,inout_print_end:()=>oT,inout_print_inline:()=>sT,inout_print_many:()=>pT,inout_type_input:()=>_T});var Y={};t.r(Y),t.d(Y,{controls_end_program:()=>uT,controls_millis:()=>aT,time_localtime:()=>lT});var y={};t.r(y),t.d(y,{turtle_bgcolor:()=>fT,turtle_bgcolor_hex:()=>YT,turtle_bgcolor_hex_new:()=>kT,turtle_circle:()=>ST,turtle_circle_advanced:()=>NT,turtle_clear:()=>cT,turtle_clone:()=>VT,turtle_color:()=>BT,turtle_color_hex:()=>GT,turtle_color_seclet:()=>QT,turtle_create:()=>rT,turtle_done:()=>TT,turtle_exitonclick:()=>IT,turtle_fill:()=>AT,turtle_fillcolor:()=>vT,turtle_fillcolor_hex:()=>bT,turtle_fillcolor_hex_new:()=>UT,turtle_getscreen:()=>JT,turtle_goto:()=>MT,turtle_listen:()=>tI,turtle_move:()=>dT,turtle_numinput:()=>WT,turtle_onclick:()=>zT,turtle_onkey:()=>ZT,turtle_ontimer:()=>$T,turtle_pencolor:()=>FT,turtle_pencolor_hex:()=>yT,turtle_pencolor_hex_new:()=>XT,turtle_penup:()=>mT,turtle_pos_shape:()=>RT,turtle_rotate:()=>hT,turtle_screen_delay:()=>OT,turtle_screen_savefig:()=>eI,turtle_setheading:()=>ET,turtle_setxy:()=>DT,turtle_shape:()=>xT,turtle_shapesize:()=>wT,turtle_size:()=>LT,turtle_size_speed:()=>gT,turtle_speed:()=>CT,turtle_textinput:()=>HT,turtle_visible:()=>PT,turtle_write:()=>KT,turtle_write_format:()=>jT,turtle_write_format_skulpt:()=>qT});var b={};t.r(b),t.d(b,{Turn:()=>_I,addOil:()=>LI,checkMarker:()=>SI,find_books_by_dichotomy:()=>fI,find_books_by_sequence:()=>FI,game_get_character_img:()=>dI,game_get_local_img:()=>rI,game_get_path_img:()=>OI,game_init:()=>iI,getMarkerNum:()=>DI,get_actor_point:()=>lI,initSettedMap:()=>oI,initialize:()=>hI,isBarrier:()=>RI,isCirculationRight:()=>CI,isDone:()=>pI,isLightGreen:()=>gI,isOilFull:()=>AI,isPath:()=>aI,is_Related_Barrier:()=>cI,is_Related_Path:()=>uI,move_direction_steps:()=>nI,move_related_to_spirite:()=>sI,place_item:()=>EI,randomOil:()=>mI,randomPlaceBarrier:()=>NI,set_map:()=>TI,set_map_bg:()=>II,set_pathtype:()=>MI,settedSimpleMap:()=>PI});const k=Blockly,X=Mixly,U={NAME_TYPE:"VARIABLE",allVariables:function(t){var e;if(t.getDescendants)e=t.getDescendants();else{if(!t.getAllBlocks)throw"Not Block or Workspace: "+t;e=t.getAllBlocks()}for(var i=Object.create(null),n=0;n1&&(_+=n)):i=_}else i="i";return i}},G=U,B={};B.NAME_TYPE=k.PROCEDURE_CATEGORY_NAME,B.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{controls_type:()=>Z,controls_typeLists:()=>z,variables_change:()=>Q,variables_get:()=>j,variables_global:()=>J,variables_set:()=>q});var i={};t.r(i),t.d(i,{base_setup:()=>et,controls_delay:()=>it,controls_end_program:()=>nt,controls_except:()=>Et,controls_finally:()=>Ot,controls_flow_statements:()=>ut,controls_for:()=>lt,controls_forEach:()=>_t,controls_for_range:()=>rt,controls_if:()=>st,controls_if_else:()=>dt,controls_if_elseif:()=>It,controls_if_if:()=>Tt,controls_lambda:()=>Rt,controls_main:()=>tt,controls_pass:()=>ct,controls_range:()=>ot,controls_repeat_ext:()=>Mt,controls_thread:()=>mt,controls_try:()=>ht,controls_try_finally:()=>at,controls_whileUntil:()=>pt,do_while:()=>At,garbage_collection:()=>gt,get_mem_alloc:()=>Lt,get_mem_free:()=>Ct,get_unique_identifier:()=>St});var n={};t.r(n),t.d(n,{base_map:()=>jt,math_arithmetic:()=>Ft,math_bit:()=>Vt,math_constant:()=>Pt,math_constant_mp:()=>ft,math_constrain:()=>Gt,math_dec:()=>yt,math_indexer_number:()=>xt,math_map:()=>Bt,math_max_min:()=>kt,math_number:()=>Nt,math_number_base_conversion:()=>Xt,math_random:()=>Ut,math_random_seed:()=>wt,math_round:()=>Ht,math_selfcalcu:()=>vt,math_to_int:()=>bt,math_trig:()=>Yt,text_to_number:()=>Wt,text_to_number_skulpt:()=>Kt});var s={};t.r(s),t.d(s,{ascii_to_char:()=>$t,char_to_ascii:()=>te,number_to_text:()=>ee,os_system:()=>Se,text:()=>Qt,text_capital:()=>le,text_center:()=>re,text_char:()=>Zt,text_char_at:()=>se,text_char_at2:()=>ne,text_char_at3:()=>Ae,text_compareTo:()=>me,text_compare_to:()=>ue,text_create_with_container:()=>Me,text_create_with_item:()=>Re,text_encode:()=>Le,text_equals_starts_ends:()=>ae,text_eval:()=>Ce,text_find:()=>Te,text_format:()=>Oe,text_format_noreturn:()=>ge,text_join:()=>zt,text_join_seq:()=>Ie,text_length:()=>ie,text_random_char:()=>oe,text_replace:()=>de,text_split:()=>he,text_strip:()=>Ee,text_substring:()=>pe,text_substring2:()=>_e,text_substring3:()=>ce,text_textarea:()=>Jt});var o={};t.r(o),t.d(o,{list_many_input:()=>Qe,list_tolist:()=>ii,list_tolist2:()=>li,list_trig:()=>Ke,lists_2d_get_col_row_data:()=>Fe,lists_2d_get_data_with_col_row:()=>fe,lists_append_extend:()=>ke,lists_change_to:()=>qe,lists_change_to_general:()=>Ze,lists_clear:()=>xe,lists_create_with:()=>ve,lists_create_with2:()=>ni,lists_create_with_container:()=>Ye,lists_create_with_item:()=>ye,lists_create_with_noreturn:()=>Je,lists_create_with_text:()=>Ve,lists_create_with_text2:()=>si,lists_del_general:()=>ze,lists_find:()=>We,lists_getIndex3:()=>oi,lists_getSublist3:()=>_i,lists_get_index:()=>Ne,lists_get_random_item:()=>Xe,lists_get_random_sublist:()=>Ue,lists_get_sublist:()=>Pe,lists_insert_value:()=>Ge,lists_insert_value2:()=>ai,lists_pop:()=>He,lists_remove_at:()=>we,lists_remove_at2:()=>ui,lists_reverse:()=>Be,lists_setIndex3:()=>pi,lists_set_index:()=>be,lists_sort:()=>je,lists_zip:()=>$e,lists_zip_container:()=>ti,lists_zip_item:()=>ei});var _={};t.r(_),t.d(_,{dicts_add_change_del:()=>Si,dicts_add_or_change:()=>Mi,dicts_clear:()=>mi,dicts_create_with:()=>Ti,dicts_create_with_container:()=>Ii,dicts_create_with_item:()=>di,dicts_create_with_noreturn:()=>Pi,dicts_deldict:()=>Ci,dicts_delete:()=>Ri,dicts_get:()=>Ei,dicts_get_default:()=>Oi,dicts_items:()=>Ai,dicts_keys:()=>hi,dicts_length:()=>Li,dicts_pop:()=>Di,dicts_setdefault:()=>Ni,dicts_to_json:()=>Fi,dicts_todict:()=>fi,dicts_update:()=>ci,dicts_values:()=>gi,json_to_dicts:()=>vi});var p={};t.r(p),t.d(p,{logic_boolean:()=>Xi,logic_compare:()=>Yi,logic_compare_continous:()=>yi,logic_is:()=>xi,logic_is_in:()=>Bi,logic_negate:()=>ki,logic_null:()=>Ui,logic_operation:()=>bi,logic_tobool:()=>wi,logic_true_or_false:()=>Gi});var a={};t.r(a),t.d(a,{sdcard_mount:()=>In,sdcard_use_spi_init:()=>Tn,storage_can_write_ornot:()=>zi,storage_change_dir:()=>ln,storage_close_file:()=>tn,storage_delete_file:()=>nn,storage_file_seek:()=>_n,storage_file_tell:()=>on,storage_file_write:()=>qi,storage_fileopen:()=>Wi,storage_fileopen_new:()=>Ki,storage_fileopen_new_encoding:()=>ji,storage_get_a_line:()=>Zi,storage_get_contents:()=>Ji,storage_get_contents_without_para:()=>Qi,storage_get_current_dir:()=>pn,storage_get_file_size:()=>sn,storage_get_filename:()=>$i,storage_is_file:()=>rn,storage_list_all_files:()=>en,storage_make_dir:()=>an,storage_open_file_with_os:()=>Hi,storage_rename:()=>un});var u={};t.r(u),t.d(u,{procedures_callnoreturn:()=>Mn,procedures_callreturn:()=>Rn,procedures_defnoreturn:()=>dn,procedures_defreturn:()=>hn,procedures_ifreturn:()=>cn,procedures_mutatorarg:()=>On,procedures_mutatorcontainer:()=>En,procedures_return:()=>mn});var l={};t.r(l),t.d(l,{tuple_change_to:()=>Vn,tuple_create_with:()=>gn,tuple_create_with_container:()=>Ln,tuple_create_with_item:()=>Cn,tuple_create_with_noreturn:()=>kn,tuple_create_with_text2:()=>Sn,tuple_create_with_text_return:()=>Dn,tuple_del:()=>fn,tuple_find:()=>Yn,tuple_getIndex:()=>Nn,tuple_getSublist:()=>bn,tuple_get_random_item:()=>Un,tuple_get_sublist:()=>Xn,tuple_join:()=>Fn,tuple_length:()=>Pn,tuple_max:()=>vn,tuple_totuple:()=>Gn,tuple_trig:()=>yn});var r={};t.r(r),t.d(r,{set_add_discard:()=>Jn,set_clear:()=>jn,set_create_with:()=>xn,set_create_with_container:()=>wn,set_create_with_item:()=>Hn,set_create_with_text_return:()=>$n,set_length:()=>Wn,set_operate:()=>qn,set_operate_update:()=>Qn,set_pop:()=>Kn,set_sub:()=>Zn,set_toset:()=>ts,set_update:()=>zn});var T={};t.r(T),t.d(T,{html_content:()=>os,html_content_more:()=>_s,html_document:()=>is,html_form:()=>as,html_head_body:()=>ss,html_style:()=>ps,html_style_color:()=>ls,html_style_content:()=>us,html_text:()=>rs,html_title:()=>ns});var I={};t.r(I),t.d(I,{attribute_access:()=>Cs,function_call:()=>As,function_call_container:()=>gs,function_call_item:()=>Ls,raw_block:()=>ds,raw_empty:()=>Es,raw_expression:()=>hs,raw_table:()=>Is,text_comment:()=>Os,text_print_multiple:()=>Rs,text_print_multiple_container:()=>cs,text_print_multiple_item:()=>ms,type_check:()=>Ms});var d={};t.r(d),t.d(d,{array_create:()=>xs,array_toarray:()=>io,dataframe_create:()=>Ps,dataframe_create_from_index:()=>Fs,dataframe_create_from_one_index:()=>fs,dataframe_get:()=>$s,numpy_trig:()=>Js,pandas_readcsv:()=>zs,pl_axes:()=>Xs,pl_bar:()=>Ks,pl_hist:()=>qs,pl_label:()=>Bs,pl_legend:()=>Us,pl_pie:()=>js,pl_plot:()=>bs,pl_plot_bar:()=>ws,pl_plot_easy:()=>ys,pl_plot_scatter:()=>Hs,pl_plot_xy:()=>Ws,pl_savefig:()=>to,pl_show:()=>ks,pl_subplot:()=>Zs,pl_text:()=>eo,pl_ticks:()=>Qs,pl_title:()=>Gs,plot_axes:()=>_o,plot_bar:()=>Io,plot_hist:()=>Eo,plot_label:()=>uo,plot_legend:()=>po,plot_pie:()=>ho,plot_plot:()=>so,plot_plot_bar:()=>lo,plot_plot_easy:()=>no,plot_plot_scatter:()=>ro,plot_plot_xy:()=>To,plot_savefig:()=>Ro,plot_show:()=>oo,plot_subplot:()=>Mo,plot_text:()=>co,plot_ticks:()=>Oo,plot_title:()=>ao,series_create:()=>Ds,series_create_from_index:()=>Ns,series_create_from_text:()=>vs,series_get_num:()=>Ys,series_index_value:()=>Vs});var h={};t.r(h),t.d(h,{inout_input:()=>Ao,inout_print:()=>go,inout_print_container:()=>No,inout_print_end:()=>Co,inout_print_inline:()=>Lo,inout_print_item:()=>Po,inout_print_many:()=>Do,inout_type_input:()=>So});var E={};t.r(E),t.d(E,{Panic_with_status_code:()=>Yo,base_delay:()=>Fo,controls_millis:()=>vo,controls_mstimer2:()=>bo,controls_mstimer2_start:()=>ko,controls_mstimer2_stop:()=>Xo,reset:()=>yo,time_localtime:()=>Vo,time_sleep:()=>Uo});var O={};t.r(O),t.d(O,{turtle_bgcolor:()=>__,turtle_bgcolor_hex:()=>h_,turtle_bgcolor_hex_new:()=>l_,turtle_circle:()=>n_,turtle_circle_advanced:()=>s_,turtle_clear:()=>Zo,turtle_clone:()=>u_,turtle_color:()=>I_,turtle_color_hex:()=>d_,turtle_color_seclet:()=>C_,turtle_create:()=>Bo,turtle_done:()=>xo,turtle_exitonclick:()=>wo,turtle_fill:()=>$o,turtle_fillcolor:()=>a_,turtle_fillcolor_hex:()=>O_,turtle_fillcolor_hex_new:()=>T_,turtle_getscreen:()=>S_,turtle_goto:()=>qo,turtle_listen:()=>f_,turtle_move:()=>Ho,turtle_numinput:()=>c_,turtle_onclick:()=>N_,turtle_onkey:()=>D_,turtle_ontimer:()=>P_,turtle_pencolor:()=>p_,turtle_pencolor_hex:()=>E_,turtle_pencolor_hex_new:()=>r_,turtle_penup:()=>zo,turtle_pos_shape:()=>Jo,turtle_rotate:()=>Wo,turtle_screen_delay:()=>jo,turtle_screen_savefig:()=>F_,turtle_setheading:()=>Ko,turtle_setxy:()=>Qo,turtle_shape:()=>M_,turtle_shapesize:()=>R_,turtle_size:()=>e_,turtle_size_speed:()=>t_,turtle_speed:()=>i_,turtle_textinput:()=>m_,turtle_visible:()=>o_,turtle_write:()=>A_,turtle_write_format:()=>g_,turtle_write_format_skulpt:()=>L_});var M={};t.r(M),t.d(M,{Turn:()=>k_,addOil:()=>ep,checkMarker:()=>np,find_books_by_dichotomy:()=>pp,find_books_by_sequence:()=>ap,game_get_character_img:()=>j_,game_get_local_img:()=>w_,game_get_path_img:()=>W_,game_init:()=>Y_,getMarkerNum:()=>sp,get_actor_point:()=>Q_,initSettedMap:()=>V_,initialize:()=>q_,isBarrier:()=>J_,isCirculationRight:()=>ip,isDone:()=>X_,isLightGreen:()=>tp,isOilFull:()=>$_,isPath:()=>U_,is_Related_Barrier:()=>Z_,is_Related_Path:()=>G_,move_direction_steps:()=>y_,move_related_to_spirite:()=>b_,place_item:()=>K_,randomOil:()=>z_,randomPlaceBarrier:()=>op,set_map:()=>x_,set_map_bg:()=>B_,set_pathtype:()=>H_,settedSimpleMap:()=>_p});var R={};t.r(R),t.d(R,{controls_type:()=>Ip,controls_typeLists:()=>dp,variables_change:()=>rp,variables_get:()=>up,variables_global:()=>Tp,variables_set:()=>lp});var c={};t.r(c),t.d(c,{Panic_with_status_code:()=>Lp,base_setup:()=>Ep,controls_delay:()=>gp,controls_flow_statements:()=>Ap,controls_for:()=>Rp,controls_forEach:()=>Pp,controls_for_range:()=>cp,controls_if:()=>Op,controls_interrupts:()=>Dp,controls_lambda:()=>Fp,controls_main:()=>hp,controls_millis:()=>Cp,controls_nointerrupts:()=>Np,controls_pass:()=>Vp,controls_range:()=>fp,controls_repeat:()=>Bp,controls_repeat_ext:()=>bp,controls_thread:()=>Yp,controls_try_finally:()=>Mp,controls_whileUntil:()=>mp,do_while:()=>yp,garbage_collection:()=>kp,get_mem_alloc:()=>Xp,get_mem_free:()=>Up,get_unique_identifier:()=>Gp,reset:()=>Sp,time_sleep:()=>vp});var m={};t.r(m),t.d(m,{base_map:()=>aa,math_arithmetic:()=>Kp,math_bit:()=>Wp,math_constant:()=>wp,math_constant_mp:()=>Hp,math_constrain:()=>ea,math_dec:()=>Jp,math_indexer_number:()=>sa,math_map:()=>ta,math_max_min:()=>zp,math_number:()=>xp,math_number_base_conversion:()=>ia,math_random:()=>$p,math_random_seed:()=>na,math_round:()=>oa,math_selfcalcu:()=>jp,math_single:()=>qp,math_to_int:()=>Zp,math_trig:()=>Qp,text_to_number:()=>_a,text_to_number_skulpt:()=>pa});var A={};t.r(A),t.d(A,{ascii_to_char:()=>Ia,char_to_ascii:()=>da,number_to_text:()=>ha,os_system:()=>Xa,text:()=>ua,text_capital:()=>La,text_center:()=>Ca,text_char:()=>ra,text_char_at:()=>Ma,text_char_at2:()=>Oa,text_char_at3:()=>ya,text_compareTo:()=>Ya,text_compare_to:()=>ma,text_encode:()=>ba,text_equals_starts_ends:()=>ca,text_eval:()=>ka,text_find:()=>Sa,text_format:()=>Fa,text_format_noreturn:()=>va,text_join:()=>Ta,text_join_seq:()=>Da,text_length:()=>Ea,text_random_char:()=>Ra,text_replace:()=>Na,text_split:()=>Pa,text_strip:()=>fa,text_substring:()=>ga,text_substring2:()=>Aa,text_substring3:()=>Va,text_textarea:()=>la});var g={};t.r(g),t.d(g,{list_many_input:()=>su,list_tolist:()=>Eu,list_tolist2:()=>Ou,list_trig:()=>eu,lists_2d_get_col_row_data:()=>Ba,lists_2d_get_data_with_col_row:()=>Ga,lists_append_extend:()=>Ka,lists_change_to:()=>nu,lists_change_to_general:()=>_u,lists_clear:()=>Za,lists_create_with:()=>xa,lists_create_with2:()=>au,lists_create_with_noreturn:()=>ou,lists_create_with_text:()=>wa,lists_create_with_text2:()=>uu,lists_del_general:()=>pu,lists_find:()=>za,lists_getIndex3:()=>lu,lists_getSublist3:()=>ru,lists_get_index:()=>Ha,lists_get_random_item:()=>ja,lists_get_random_sublist:()=>qa,lists_get_sublist:()=>Ua,lists_insert_value:()=>Qa,lists_insert_value2:()=>Iu,lists_pop:()=>tu,lists_remove_at:()=>$a,lists_remove_at2:()=>du,lists_reverse:()=>Ja,lists_setIndex3:()=>Tu,lists_set_index:()=>Wa,lists_sort:()=>iu,lists_zip:()=>hu});var L={};t.r(L),t.d(L,{dicts_add_change_del:()=>fu,dicts_add_or_change:()=>Au,dicts_clear:()=>Cu,dicts_create_with:()=>Mu,dicts_create_with_noreturn:()=>Vu,dicts_deldict:()=>Pu,dicts_delete:()=>gu,dicts_get:()=>cu,dicts_get_default:()=>mu,dicts_items:()=>Su,dicts_keys:()=>Ru,dicts_length:()=>Nu,dicts_pop:()=>Fu,dicts_setdefault:()=>vu,dicts_to_json:()=>yu,dicts_todict:()=>Yu,dicts_update:()=>Lu,dicts_values:()=>Du,json_to_dicts:()=>bu});var C={};t.r(C),t.d(C,{logic_boolean:()=>Bu,logic_compare:()=>ku,logic_compare_continous:()=>Xu,logic_is:()=>Wu,logic_is_in:()=>Hu,logic_negate:()=>Gu,logic_null:()=>xu,logic_operation:()=>Uu,logic_tobool:()=>Ku,logic_true_or_false:()=>wu});var S={};t.r(S),t.d(S,{sdcard_mount:()=>hl,sdcard_use_spi_init:()=>dl,storage_can_write_ornot:()=>el,storage_change_dir:()=>ul,storage_close_file:()=>nl,storage_delete_file:()=>ol,storage_file_seek:()=>al,storage_file_tell:()=>pl,storage_file_write:()=>Zu,storage_fileopen:()=>qu,storage_fileopen_new:()=>Qu,storage_fileopen_new_encoding:()=>Ju,storage_get_a_line:()=>tl,storage_get_contents:()=>$u,storage_get_contents_without_para:()=>zu,storage_get_current_dir:()=>ll,storage_get_file_size:()=>_l,storage_get_filename:()=>il,storage_is_file:()=>Il,storage_list_all_files:()=>sl,storage_make_dir:()=>rl,storage_open_file_with_os:()=>ju,storage_rename:()=>Tl});var D={};t.r(D),t.d(D,{procedures_callnoreturn:()=>Rl,procedures_callreturn:()=>Ml,procedures_defnoreturn:()=>Ol,procedures_defreturn:()=>El,procedures_ifreturn:()=>cl,procedures_return:()=>ml});var N={};t.r(N),t.d(N,{tuple_change_to:()=>fl,tuple_create_with:()=>Al,tuple_create_with_noreturn:()=>Yl,tuple_create_with_text2:()=>gl,tuple_create_with_text_return:()=>Ll,tuple_del:()=>Dl,tuple_find:()=>Fl,tuple_getIndex:()=>Cl,tuple_getSublist:()=>Vl,tuple_get_random_item:()=>bl,tuple_get_sublist:()=>yl,tuple_join:()=>Nl,tuple_length:()=>Sl,tuple_max:()=>Pl,tuple_totuple:()=>kl,tuple_trig:()=>vl});var P={};t.r(P),t.d(P,{set_add_discard:()=>Hl,set_clear:()=>Bl,set_create_with:()=>Xl,set_create_with_text_return:()=>jl,set_length:()=>Ul,set_operate:()=>xl,set_operate_update:()=>wl,set_pop:()=>Gl,set_sub:()=>Wl,set_toset:()=>ql,set_update:()=>Kl});var f={};t.r(f),t.d(f,{html_content:()=>zl,html_content_more:()=>$l,html_document:()=>Ql,html_form:()=>er,html_head_body:()=>Zl,html_style:()=>tr,html_style_content:()=>ir,html_text:()=>nr,html_title:()=>Jl});var F={};t.r(F),t.d(F,{attribute_access:()=>lr,function_call:()=>ur,raw_block:()=>sr,raw_empty:()=>_r,raw_expression:()=>or,raw_table:()=>pr,type_check:()=>ar});var v={};t.r(v),t.d(v,{array_create:()=>Sr,array_toarray:()=>Gr,dataframe_create:()=>Ir,dataframe_create_from_index:()=>dr,dataframe_create_from_one_index:()=>hr,dataframe_get:()=>kr,numpy_trig:()=>Yr,pandas_readcsv:()=>br,pl_axes:()=>cr,pl_bar:()=>fr,pl_hist:()=>vr,pl_label:()=>Cr,pl_legend:()=>gr,pl_pie:()=>Fr,pl_plot:()=>Ar,pl_plot_bar:()=>Dr,pl_plot_easy:()=>mr,pl_plot_scatter:()=>Nr,pl_plot_xy:()=>Pr,pl_savefig:()=>Xr,pl_show:()=>Rr,pl_subplot:()=>yr,pl_text:()=>Ur,pl_ticks:()=>Vr,pl_title:()=>Lr,plot_axes:()=>xr,plot_bar:()=>Zr,plot_hist:()=>$r,plot_label:()=>jr,plot_legend:()=>Wr,plot_pie:()=>zr,plot_plot:()=>Hr,plot_plot_bar:()=>qr,plot_plot_easy:()=>wr,plot_plot_scatter:()=>Qr,plot_plot_xy:()=>Jr,plot_savefig:()=>iT,plot_show:()=>Br,plot_subplot:()=>eT,plot_text:()=>nT,plot_ticks:()=>tT,plot_title:()=>Kr,series_create:()=>rr,series_create_from_index:()=>Tr,series_create_from_text:()=>Er,series_get_num:()=>Mr,series_index_value:()=>Or});var V={};t.r(V),t.d(V,{inout_input:()=>sT,inout_print:()=>oT,inout_print_end:()=>pT,inout_print_inline:()=>_T,inout_print_many:()=>uT,inout_type_input:()=>aT});var Y={};t.r(Y),t.d(Y,{controls_end_program:()=>rT,controls_millis:()=>lT,time_localtime:()=>TT});var y={};t.r(y),t.d(y,{turtle_bgcolor:()=>vT,turtle_bgcolor_hex:()=>bT,turtle_bgcolor_hex_new:()=>UT,turtle_circle:()=>NT,turtle_circle_advanced:()=>fT,turtle_clear:()=>AT,turtle_clone:()=>yT,turtle_color:()=>wT,turtle_color_hex:()=>xT,turtle_color_seclet:()=>ZT,turtle_create:()=>IT,turtle_done:()=>dT,turtle_exitonclick:()=>hT,turtle_fill:()=>LT,turtle_fillcolor:()=>YT,turtle_fillcolor_hex:()=>XT,turtle_fillcolor_hex_new:()=>BT,turtle_getscreen:()=>zT,turtle_goto:()=>cT,turtle_listen:()=>iI,turtle_move:()=>ET,turtle_numinput:()=>jT,turtle_onclick:()=>tI,turtle_onkey:()=>$T,turtle_ontimer:()=>eI,turtle_pencolor:()=>VT,turtle_pencolor_hex:()=>kT,turtle_pencolor_hex_new:()=>GT,turtle_penup:()=>gT,turtle_pos_shape:()=>mT,turtle_rotate:()=>OT,turtle_screen_delay:()=>RT,turtle_screen_savefig:()=>nI,turtle_setheading:()=>MT,turtle_setxy:()=>PT,turtle_shape:()=>HT,turtle_shapesize:()=>WT,turtle_size:()=>ST,turtle_size_speed:()=>CT,turtle_speed:()=>DT,turtle_textinput:()=>KT,turtle_visible:()=>FT,turtle_write:()=>qT,turtle_write_format:()=>QT,turtle_write_format_skulpt:()=>JT});var b={};t.r(b),t.d(b,{Turn:()=>aI,addOil:()=>SI,checkMarker:()=>NI,find_books_by_dichotomy:()=>vI,find_books_by_sequence:()=>VI,game_get_character_img:()=>EI,game_get_local_img:()=>II,game_get_path_img:()=>RI,game_init:()=>sI,getMarkerNum:()=>PI,get_actor_point:()=>TI,initSettedMap:()=>pI,initialize:()=>OI,isBarrier:()=>mI,isCirculationRight:()=>DI,isDone:()=>uI,isLightGreen:()=>CI,isOilFull:()=>LI,isPath:()=>lI,is_Related_Barrier:()=>AI,is_Related_Path:()=>rI,move_direction_steps:()=>oI,move_related_to_spirite:()=>_I,place_item:()=>MI,randomOil:()=>gI,randomPlaceBarrier:()=>fI,set_map:()=>dI,set_map_bg:()=>hI,set_pathtype:()=>cI,settedSimpleMap:()=>FI});const k=Blockly,X=Mixly,U={NAME_TYPE:"VARIABLE",allVariables:function(t){var e;if(t.getDescendants)e=t.getDescendants();else{if(!t.getAllBlocks)throw"Not Block or Workspace: "+t;e=t.getAllBlocks()}for(var i=Object.create(null),n=0;n1&&(_+=n)):i=_}else i="i";return i}},G=U,B={};B.NAME_TYPE=k.PROCEDURE_CATEGORY_NAME,B.allProcedures=function(t){for(var e=t.getAllBlocks(!1),i=[],n=[],s=0;s0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},W.scrubNakedValue=function(t){return t+"\n"},W.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},W.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},W.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=k.utils.string.wrap(o,W.COMMENT_WRAP-3),n+=W.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const K=330,j={init:function(){this.setColour(K),this.appendDummyInput().appendField(new k.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(k.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},q={init:function(){this.setColour(K),this.appendValueInput("VALUE").appendField(new k.FieldTextInput(""),"VAR").appendField(k.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},Q={init:function(){this.setColour(K);var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"],[k.Msg.LANG_MATH_BOOLEAN,"bool"],[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0)}},J={init:function(){this.setColour(K),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},Z={init:function(){this.setColour(K),this.appendValueInput("DATA").appendField(k.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},z={init:function(){this.setColour(K),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new k.FieldDropdown([[k.Msg.LANG_MATH_INT,"int"],[k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[k.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"],[k.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return k.Msg.MICROBIT_controls_TypeLists+{int:k.Msg.LANG_MATH_INT,float:k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:k.Msg.MIXLY_MICROBIT_TYPE_STRING,list:k.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:k.Msg.MIXLY_MICROBIT_TYPE_DICT,set:k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:k.Msg.MIXLY_MICROBIT_IMAGE,bytes:k.Msg.LANG_MATH_BYTE,NoneType:k.Msg.LOGIC_NULL}[e]}))}},$=120,tt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_NAME_MAIN),this.appendStatementInput("DO").appendField(""),this.setTooltip(k.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},et={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_SETUP),this.appendStatementInput("DO").appendField(""),this.setTooltip(k.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},it={init:function(){var t=[[k.Msg.MIXLY_mSecond,"delay"],[k.Msg.MIXLY_uSecond,"delayMicroseconds"]];this.setColour($),this.appendValueInput("DELAY_TIME",Number).appendField(k.Msg.MIXLY_DELAY).appendField(new k.FieldDropdown(t),"UNIT").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_CONTROL_DELAY),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#id9"),this.wiki={"zh-hans":{page:["Arduino AVR","控制","延时"]}}}},nt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_CONTROL_END_PROGRAM),this.setPreviousStatement(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_END_TOOLTIP)}},st={init:function(){this.setColour($),this.appendValueInput("IF0").setCheck([Boolean,Number]).appendField(k.Msg.CONTROLS_IF_MSG_IF),this.appendStatementInput("DO0").appendField(k.Msg.CONTROLS_IF_MSG_THEN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#if"),this.setMutator(new k.icons.MutatorIcon(["controls_if_elseif","controls_if_else"],this));var t=this;this.setTooltip((function(){return t.elseifCount_||t.elseCount_?!t.elseifCount_&&t.elseCount_?k.Msg.CONTROLS_IF_TOOLTIP_2:t.elseifCount_&&!t.elseCount_?k.Msg.CONTROLS_IF_TOOLTIP_3:t.elseifCount_&&t.elseCount_?k.Msg.CONTROLS_IF_TOOLTIP_4:"":k.Msg.CONTROLS_IF_TOOLTIP_1})),this.elseifCount_=0,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},ot={init:function(){this.setColour($),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},_t={init:function(){this.setColour($),this.appendValueInput("LIST").setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(k.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},pt={init:function(){this.setColour($),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new k.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(k.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},at={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},ut={init:function(){this.setColour($);var t=new k.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},lt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},rt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};pt.OPERATORS=[[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],ut.OPERATORS=[[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Tt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},It={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},dt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},ht={init:function(){this.setColour($),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Et={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Ot={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Mt={init:function(){this.jsonInit({message0:k.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:$,tooltip:k.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:k.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Rt={init:function(){this.setColour($),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_STAT),this.setOutput(!0)}},ct={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},mt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},At={init:function(){this.appendDummyInput().appendField(k.Msg.CONTROLS_REPEAT_TITLE_REPEAT+k.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(k.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new k.FieldDropdown([[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour($),this.setTooltip("do-while loop"),this.setHelpUrl("")}},gt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Ct={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},St=230;k.FieldTextInput.math_number_validator=function(t){return String(t)},k.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Dt={init:function(){this.setColour(St),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},Nt={init:function(){this.setColour(St);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},Pt={init:function(){this.setColour(St);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},ft={init:function(){this.setColour(St),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Ft={init:function(){this.setColour(St),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},vt={init:function(){this.setColour(St),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new k.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Vt={init:function(){this.setColour(St),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:k.Msg.MATH_TRIG_TOOLTIP_SIN,COS:k.Msg.MATH_TRIG_TOOLTIP_COS,TAN:k.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:k.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:k.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:k.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:k.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},Yt={init:function(){var t=[[k.Msg.MATH_BIN,"bin"],[k.Msg.MATH_OCT,"oct"],[k.Msg.MATH_HEX,"hex"]];this.setColour(St),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:k.Msg.MATH_DEC_TOOLTIP_BIN,oct:k.Msg.MATH_DEC_TOOLTIP_OCT,hex:k.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},yt={init:function(){var t=[[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"],[k.Msg.MATH_ABS,"fabs"],[k.Msg.MATH_SQRT,"sqrt"]];this.setColour(St),this.appendValueInput("A").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:k.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:k.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:k.Msg.MATH_SINGLE_TOOLTIP_SQ,round:k.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:k.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:k.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},bt={init:function(){var t=[[k.Msg.MIXLY_MAX,"max"],[k.Msg.MIXLY_MIN,"min"]];this.setColour(St),this.appendValueInput("A").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(new k.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(k.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:k.Msg.MIXLY_TOOLTIP_MATH_MAX,min:k.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},kt={init:function(){var t=[[k.Msg.MATH_TWO,"two"],[k.Msg.MATH_EIGHT,"eight"],[k.Msg.MATH_TEN,"ten"],[k.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(St),this.appendDummyInput("").appendField(k.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new k.FieldDropdown(t),"OP").appendField(k.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(k.Msg.MATH_ZHW).appendField(new k.FieldDropdown(t),"OP2").appendField(k.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:k.Msg.MATH_Before_two,eight:k.Msg.MATH_Before_eight,ten:k.Msg.MATH_Before_ten,sixteen:k.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:k.Msg.MATH_Behind_two,eight:k.Msg.MATH_Behind_eight,ten:k.Msg.MATH_Behind_ten,sixteen:k.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Xt={init:function(){var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(St),this.setOutput(!0,Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_RANDOM).appendField(new k.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:k.Msg.LANG_MATH_INT,float:k.Msg.LANG_MATH_FLOAT_RANDOM};return k.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Ut={init:function(){this.setColour(St),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_CONSTRAIN_TOOLTIP)}},Gt={init:function(){this.setColour(St),this.appendValueInput("NUM",Number).appendField(k.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(k.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(k.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_MAP)}},Bt={init:function(){this.setColour(St),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},xt={init:function(){this.setColour(St),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},wt={init:function(){this.setColour(St),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MATH_ROUND).appendField(k.Msg.TEXT_KEEP),this.appendDummyInput().appendField(k.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_ROUND_NEW_TOOLTIP)}},Ht={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"],[k.Msg.MIXLY_TO_BITES,"b"]];this.setColour(St),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:k.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:k.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Wt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(St),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:k.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},Kt=Gt,jt=160,qt={init:function(){this.setColour(jt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(k.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new k.FieldImage(e,12,12,'"')}},Qt={init:function(){this.setColour(jt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(k.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new k.FieldImage(e,12,12,'"')}};k.FieldTextInput.char_validator=function(t){if(t.length>1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Jt={init:function(){this.setColour(jt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldTextInput("",k.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(k.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new k.FieldImage(e,7,12,'"')}},Zt={init:function(){this.setColour(jt),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(k.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},zt={init:function(){this.setColour(jt),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},$t={init:function(){this.setColour(jt),this.appendValueInput("VAR").setCheck(String).appendField(k.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},te={init:function(){this.setColour(jt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ee={init:function(){this.setColour(jt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},ie={init:function(){this.WHERE_OPTIONS=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.TEXT_GET_INDEX_RANDOM+1+k.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(jt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(k.Msg.LISTS_GET_INDEX_GET,"MODE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(k.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+k.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",k.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:k.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:k.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:k.Msg.TEXT_GET_INDEX_RANDOM};return k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+k.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==k.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new k.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},ne={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(jt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.LISTS_GET_INDEX_FROM_START+"n"+k.Msg.TEXT_CHARAT2)}},se={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(jt),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(k.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(k.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},oe={init:function(){this.WHERE_OPTIONS_1=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[k.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(jt),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==k.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new k.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},_e={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(jt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(k.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},pe={init:function(){var t=[[k.Msg.MIXLY_EQUALS,"==="],[k.Msg.MIXLY_STARTSWITH,"startswith"],[k.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(jt),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new k.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},ae={init:function(){this.setColour(jt),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_COMPARETO_HELP)}},ue={init:function(){var t=[[k.Msg.TEXT_UPPER,"upper"],[k.Msg.TEXT_TITLE,"title"],[k.Msg.TEXT_CAPITALIZE,"capitalize"],[k.Msg.TEXT_SWAPCASE,"swapcase"],[k.Msg.TEXT_LOWER,"lower"]];this.setColour(jt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:k.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:k.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:k.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:k.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:k.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},le={init:function(){var t=[[k.Msg.TEXT_LJUST,"ljust"],[k.Msg.TEXT_CENTER,"center"],[k.Msg.TEXT_RJUST,"rjust"]];this.setColour(jt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(k.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(k.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},re={init:function(){this.setColour(jt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(k.Msg.MIXLY_MID+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(k.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},Te={init:function(){this.setColour(jt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ie={init:function(){this.setColour(jt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(k.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},de={init:function(){this.setColour(jt),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(k.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(k.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},he={init:function(){var t=[[k.Msg.TEXT_TRIM_BOTH,"strip"],[k.Msg.TEXT_TRIM_LEFT,"lstrip"],[k.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(jt),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new k.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(k.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:k.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:k.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:k.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Ee={init:function(){this.setColour(jt),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new k.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ti={init:function(){this.setColour(li),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Ii={init:function(){this.setColour(li),this.appendDummyInput().appendField(k.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},di={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_KEYS),this.setTooltip(k.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},hi={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_TOOLTIP)}},Ei={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Oi={init:function(){this.setColour(li),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(k.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Mi={init:function(){this.setColour(li),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_DELETE_TOOLTIP)}},Ri={init:function(){this.setColour(li),this.appendValueInput("DICT2").setCheck("Dict").appendField(k.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(k.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(k.Msg.MIXLY_MID),this.setTooltip(k.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ci={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_CLEAR),this.setTooltip(k.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mi={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_ITEMS),this.setTooltip(k.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Ai={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_VALUES),this.setTooltip(k.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},gi={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_LENGTH),this.setTooltip(k.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Li={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_DELDICT),this.setTooltip(k.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ci={init:function(){this.MODE=[[k.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[k.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(k.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=k.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=k.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new k.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Si={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setTooltip(k.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Di={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_SETDEFAULT_TOOLTIP)}},Ni={init:function(){this.setColour(li),this.appendDummyInput("").appendField(new k.FieldLabel(k.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new k.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(k.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Pi={init:function(){this.setColour(li),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},fi={init:function(){this.setColour(li),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_TO_JSON),this.setTooltip(k.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},Fi={init:function(){this.setColour(li),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(k.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},vi=210,Vi={init:function(){var t=k.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(vi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:k.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:k.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:k.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:k.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:k.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:k.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},Yi={init:function(){var t=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(vi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new k.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},yi={init:function(){var t=[[k.Msg.LOGIC_OPERATION_AND,"AND"],[k.Msg.LOGIC_OPERATION_OR,"OR"],[k.Msg.LOGIC_OPERATION_NOR,"NOR"],[k.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(vi),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:k.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:k.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:k.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:k.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},bi={init:function(){this.setColour(vi),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(k.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(k.Msg.LOGIC_NEGATE_TOOLTIP)}},ki={init:function(){var t=[[k.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[k.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(vi),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new k.FieldDropdown(t),"BOOL"),this.setTooltip(k.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Xi={init:function(){this.setColour(vi),this.setOutput(!0),this.appendDummyInput().appendField(k.Msg.LOGIC_NULL),this.setTooltip(k.Msg.LOGIC_NULL_TOOLTIP)}},Ui={init:function(){this.setColour(vi),this.appendValueInput("A"),this.appendValueInput("B").appendField(k.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(k.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Gi={init:function(){var t=[[k.Msg.TEXT_APPEND_TO,"in"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(vi),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new k.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(k.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.IN)}},Bi={init:function(){var t=[[k.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(vi),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},xi={init:function(){this.setColour(vi),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},wi={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(k.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Hi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Wi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},Ki={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXPY_TEXT_ENCODE).appendField(new k.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},ji={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},qi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Qi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},Ji={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},Zi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.HTML_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},zi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},$i={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},tn={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const en={init:function(){this.setColour(0),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},nn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},sn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},on={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},_n={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},pn={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+k.Msg.MIXLY_ESP32_SET+{mkdir:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},an={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(k.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},un={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},ln={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.HTML_FILE,"isfile"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},rn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(k.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(k.Msg.MIXLY_SETUP+k.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(k.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Tn={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(k.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},In={init:function(){var t=x.findLegalName("",this),e=new k.FieldTextInput(t,x.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new k.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&k.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(k.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(k.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(k.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(k.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=k.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),k.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{k.Events.enable()}},mutationToDom:function(t){var e=k.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var i=0;i"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_s={init:function(){this.setColour(ts),this.appendDummyInput().appendField(k.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},ps={init:function(){this.setColour(ts),this.appendDummyInput().appendField(k.Msg.HTML_FORM_CONTENT).appendField(new k.FieldDropdown([[k.Msg.HTML_TEXT,"text"],[k.Msg.HTML_EMAIL,"email"],[k.Msg.HTML_NUMBER,"number"],[k.Msg.HTML_PASSWORD,"password"],[k.Msg.HTML_CHECKBOX,"checkbox"],[k.Msg.HTML_RADIOBUTTON,"radiobutton"],[k.Msg.HTML_BUTTON,"button"],[k.Msg.HTML_COLOUR,"colour"],[k.Msg.HTML_DATE,"date"],[k.Msg.HTML_LOCALTIME,"local time"],[k.Msg.HTML_FILE,"file"],[k.Msg.HTML_HIDDEN,"hidden"],[k.Msg.HTML_IMAGE,"image"],[k.Msg.HTML_MONTH,"month"],[k.Msg.HTML_RANGE,"range"],[k.Msg.HTML_RESET,"reset"],[k.Msg.HTML_SEARCH,"search"],[k.Msg.HTML_SUBMIT,"submit"],[k.Msg.HTML_TELEPHONENUMBER,"telephone number"],[k.Msg.HTML_TIME,"time"],[k.Msg.HTML_URL,"url"],[k.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(k.Msg.HTML_NAME).appendField(new k.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(k.Msg.HTML_VALUE).appendField(new k.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},as={init:function(){this.setColour(ts),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},us={init:function(){this.setColour(ts),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ls={init:function(){this.setColour(ts),this.appendDummyInput().appendField(k.Msg.HTML_TEXT).appendField(new k.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rs=160,Ts={init:function(){this.setColour(rs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new k.FieldTable(""),"TEXT")}},Is={init:function(){this.setColour(rs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT")}},ds={init:function(){this.setColour(rs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},hs={init:function(){this.setColour(rs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Es={init:function(){this.setColour(rs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new k.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Os={init:function(){this.setColour(rs),this.appendValueInput("VALUE").appendField(k.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Ms={init:function(){this.setColour(rs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=k.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bs={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ks={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xs={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Us={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gs={init:function(){this.setColour(Cs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bs={init:function(){this.setColour(Cs),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_SPLITBYDOU).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},xs={init:function(){this.setColour(Cs);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},ws={init:function(){this.setColour(Cs);var t=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],e=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Hs={init:function(){this.setColour(Cs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ws={init:function(){this.setColour(Cs);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ks={init:function(){this.setColour(Cs);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},js={init:function(){this.setColour(Cs),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qs={init:function(){this.setColour(Cs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Qs={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(Cs),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(k.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setTooltip(k.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},Js={init:function(){this.setColour(Cs),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Zs={init:function(){this.setColour(Cs),this.appendValueInput("FILENAME").appendField(k.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[k.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},zs={init:function(){this.setColour(Cs),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(k.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new k.FieldDropdown([[k.Msg.DATAFRAME_COLUMN,"column"],[k.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(k.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},$s={init:function(){this.setColour(Cs),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},to={init:function(){this.setColour(Cs);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},eo={init:function(){this.setColour(Cs),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},io={init:function(){this.setColour(Cs),this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},no={init:function(){this.setColour(Cs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},so={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},oo={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_o={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},po={init:function(){this.setColour(Cs),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ao={init:function(){this.setColour(Cs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},uo={init:function(){this.setColour(Cs);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},lo={init:function(){this.setColour(Cs);var t=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(t),"DOT"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},ro={init:function(){this.setColour(Cs);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},To={init:function(){this.setColour(Cs);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Io={init:function(){this.setColour(Cs);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},ho={init:function(){this.setColour(Cs),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Eo={init:function(){this.setColour(Cs);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Oo={init:function(){this.setColour(Cs),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Mo={init:function(){this.setColour(Cs),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Ro={init:function(){this.setColour(Cs);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},co=20,mo={init:function(){this.setColour(co),this.appendValueInput("VAR").appendField(k.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(k.Msg.INOUT_input_TOOLTIP)}},Ao={init:function(){this.setColour(co),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.BLOCKPY_PRINT_TOOLTIP)}},go={init:function(){this.setColour(co),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},Lo={init:function(){this.setColour(co),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(k.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},Co={init:function(){var t=[[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(co),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(k.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:k.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:k.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:k.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},So={init:function(){this.setColour(co),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n0?t:[["'无可用地图'","'无可用地图'"]]}},w_={init:function(){this.appendValueInput("pathtype").setCheck(null).appendField(k.Msg.MIXLY_GAME_SETPATHTYPE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},H_={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用路径'","'无可用路径'"]]}},W_={init:function(){this.setColour(290),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("posx").setCheck(null).appendField(k.Msg.TEXT_APPEND_TO+"("),this.appendDummyInput().appendField(","),this.appendValueInput("posy").setCheck(null).appendField(""),this.appendDummyInput().appendField(")"+k.Msg.MIXLY_GAME_LAY).appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_WALL,"'wall'"],[k.Msg.MIXLY_GAME_BARRIER,"'barrier'"],[k.Msg.MIXLY_GAME_COIN,"'coin'"],[k.Msg.MIXLY_GAME_REDMARKER,"'redmarker'"],[k.Msg.MIXLY_GAME_YELLOWMARKER,"'yellowmarker'"],[k.Msg.MIXLY_GAME_BLUEMARKER,"'bluemarker'"],[k.Msg.MIXLY_GAME_GREENMARKER,"'greenmarker'"]]),"item"),this.setTooltip("")}},K_={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用角色'","'无可用角色'"]]}},j_={init:function(){this.setColour(290),this.appendValueInput("character").setCheck(null).appendField(k.Msg.MIXLY_GAME_INIT_CHARA),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_FACE+k.Msg.MIXLY_GAME_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},q_={init:function(){this.setColour(290),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_GETPOINT),this.setOutput(!0,Number),this.setTooltip("")}},Q_={init:function(){this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_UP,"0"],[k.Msg.MIXLY_GAME_DOWN,"2"],[k.Msg.MIXLY_GAME_LEFT,"3"],[k.Msg.MIXLY_GAME_RIGHT,"1"]]),"direction"),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ISBARRIER),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},J_={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_RE_SPIRITE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_FORWARD,"f"],[k.Msg.MIXLY_GAME_BACKWARD,"b"],[k.Msg.MIXLY_GAME_LEFT,"l"],[k.Msg.MIXLY_GAME_RIGHT,"r"]]),"direction"),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ISBARRIER),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},Z_={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_RANDOMCAROIL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},z_={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_NEEDOIL),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},$_={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ISGREEN),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},tp={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ADDOIL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},ep={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_CHECKCIRCURIGHT),this.setPreviousStatement(!0),this.setColour(290),this.setTooltip("")}},ip={init:function(){this.setColour(290),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_CHECK_WHETHER_PASS),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_REDMARKER,"'redmarker'"],[k.Msg.MIXLY_GAME_YELLOWMARKER,"'yellowmarker'"],[k.Msg.MIXLY_GAME_BLUEMARKER,"'bluemarker'"],[k.Msg.MIXLY_GAME_GREENMARKER,"'greenmarker'"]]),"marker"),this.appendDummyInput().appendField("?"),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},np={init:function(){this.setColour(290),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_GET_MARKER_NUM),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_REDMARKER,"'redmarker'"],[k.Msg.MIXLY_GAME_YELLOWMARKER,"'yellowmarker'"],[k.Msg.MIXLY_GAME_BLUEMARKER,"'bluemarker'"],[k.Msg.MIXLY_GAME_GREENMARKER,"'greenmarker'"]]),"marker"),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_NUMBER_OF_MARKER),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},sp={init:function(){this.setColour(290),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("posx").setCheck(null).appendField(k.Msg.TEXT_APPEND_TO+"("),this.appendDummyInput().appendField(","),this.appendValueInput("posy").setCheck(null).appendField(""),this.appendDummyInput().appendField(")"+k.Msg.TEXT_GET_INDEX_RANDOM+k.Msg.MIXLY_GAME_LAY+k.Msg.MIXLY_GAME_BARRIER),this.setTooltip("")}},op={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_INIT_AS).appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_ONE,"0"],[k.Msg.MIXLY_GAME_TWO,"1"],[k.Msg.MIXLY_GAME_THREE,"2"],[k.Msg.MIXLY_GAME_FOUR,"3"],[k.Msg.MIXLY_GAME_FIVE,"4"],[k.Msg.MIXLY_GAME_SIX,"5"],[k.Msg.MIXLY_GAME_SEVEN,"6"],[k.Msg.MIXLY_GAME_EIGHT,"7"],[k.Msg.MIXLY_GAME_NINE,"8"],[k.Msg.MIXLY_GAME_TEN,"9"],[k.Msg.MIXLY_GAME_ELE,"10"],[k.Msg.MIXLY_GAME_TWEL,"11"],[k.Msg.MIXLY_GAME_THIR,"12"],[k.Msg.MIXLY_GAME_FORT,"13"],[k.Msg.MIXLY_GAME_FIFT,"14"],[k.Msg.MIXLY_GAME_SIXT,"15"],[k.Msg.MIXLY_GAME_SEVENT,"16"]]),"level"),this.setInputsInline(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},_p={init:function(){this.appendValueInput("N").setCheck(null).setAlign(k.inputs.Align.LEFT).appendField("二分法查找书籍").appendField("N"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},pp={init:function(){this.appendValueInput("N").setCheck(null).setAlign(k.inputs.Align.LEFT).appendField("顺序法查找书籍").appendField("N"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},ap=function(t,e){return[e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE),e.ORDER_ATOMIC]},up=function(t,e){if(""==this.getFieldValue("VAR"))return" = None\n";var i=e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"None";return e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE)+" = "+i+"\n"},lp=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"MYVALUE",e.ORDER_ATOMIC)||"None";if("bytes"==i)var s=i+"("+n+',"UTF-8")';else s=i+"("+n+")";return[s,e.ORDER_ATOMIC]},rp=function(t,e){return"global "+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"None")+"\n"},Tp=function(t,e){return["type("+(e.valueToCode(this,"DATA",e.ORDER_ATOMIC)||"None")+")",e.ORDER_ATOMIC]},Ip=function(t,e){return[this.getFieldValue("type"),e.ORDER_ATOMIC]},dp=function(t,e){var i=e.statementToCode(t,"DO");return"if __name__ == '__main__':\n"+(i=e.addLoopTrap(i,t.id)||e.PASS)},hp=function(t,e){var i=e.statementToCode(this,"DO");return(i=i.replace(/(^\s*)|(\s*$)/g,"").replace(/\n {4}/g,"\n")).endsWith("\n")?e.setups_.setup_setup=i:e.setups_.setup_setup=i+"\n",""},Ep=function(t,e){var i=0,n="";do{n+=(0==i?"if ":"elif ")+(e.valueToCode(t,"IF"+i,e.ORDER_NONE)||"False")+":\n"+(e.statementToCode(t,"DO"+i)||e.PASS),++i}while(t.getInput("IF"+i));return t.getInput("ELSE")&&(n+="else:\n"+(e.statementToCode(t,"ELSE")||e.PASS)),n},Op=function(t,e){var i=0,n=e.valueToCode(this,"IF"+i,e.ORDER_NONE)||"null",s="try:\n"+(e.statementToCode(this,"try")||" pass\n");for(i=1;i<=this.elseifCount_;i++)""!==(n=e.valueToCode(this,"IF"+i,e.ORDER_NONE)||"")&&(n=" "+n),s+="except"+n+": \n"+(e.statementToCode(this,"DO"+i)||" pass\n");return this.elseCount_&&(s+="finally:\n"+(e.statementToCode(this,"ELSE")||" pass\n")),s},Mp=function(t,e){var i=e.variableDB_.getName(t.getFieldValue("VAR"),k.Variables.NAME_TYPE),n=e.valueToCode(t,"FROM",e.ORDER_NONE)||"0",s=e.valueToCode(t,"TO",e.ORDER_NONE)||"0",o=e.valueToCode(t,"STEP",e.ORDER_NONE)||"1",_=e.statementToCode(t,"DO"),p=(_=e.addLoopTrap(_,t.id)||e.PASS,""),a=function(t,e){return e.provideFunction_("upRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start <= stop:"," yield start"," start += abs(step)"])},u=function(t,e){return e.provideFunction_("downRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start >= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},k.isNumber(n)&&k.isNumber(s)&&k.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const ku=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},Xu=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},Uu=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Gu=function(t,e){return["None",e.ORDER_ATOMIC]},Bu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},xu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},wu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Hu=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Wu=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},Ku=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},ju=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},qu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},Qu=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},Ju=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},Zu=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},zu=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},$u=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},tl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},el=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},il=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},nl=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},sl=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ol=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},_l=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},pl=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},al=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},ul=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},ll=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},rl=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},Tl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},Il=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},dl=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),k.Procedures.NAME_TYPE),n=e.statementToCode(this,"STACK")||" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},ql=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},Ql=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},Jl=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},Zl=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},zl=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},$l=function(t,e){return'"},tr=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},er=function(){return this.getFieldValue("TEXT")+"\n"},ir=function(t){return t.getFieldValue("TEXT")+"\n"},nr=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},sr=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},or=function(){return""},_r=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},pr=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o=0&&(n[s]=n[s].replace(" ",""));i="";for(s=0;s0?e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+_.join("\n"):e.join("\n")+"\n"+n.join("\n")+"\n"+s.join("")+"\n"+t+_.join("\n")},W.scrubNakedValue=function(t){return t+"\n"},W.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},W.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},W.scrub_=function(t,e,i){var n="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=k.utils.string.wrap(o,W.COMMENT_WRAP-3),n+=W.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+p+" + "+s+")":s<0?"int("+p+" - "+-s+")":"int("+p+")",n&&(p="-"+p)),p};const K=330,j={init:function(){this.setColour(K),this.appendDummyInput().appendField(new k.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(k.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},q={init:function(){this.setColour(K),this.appendValueInput("VALUE").appendField(new k.FieldTextInput(""),"VAR").appendField(k.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var t=this.getFieldValue("VAR");return null==t?[]:t.split(",")},renameVar:function(t,e){H.equals(t,this.getFieldValue("VAR"))&&this.setFieldValue(e,"VAR")}},Q={init:function(){this.setColour(K);var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"],[k.Msg.LANG_MATH_BOOLEAN,"bool"],[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0)}},J={init:function(){this.setColour(K),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},Z={init:function(){this.setColour(K),this.appendValueInput("DATA").appendField(k.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},z={init:function(){this.setColour(K),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new k.FieldDropdown([[k.Msg.LANG_MATH_INT,"int"],[k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[k.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[k.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[k.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[k.Msg.LANG_MATH_BYTE,"bytes"],[k.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("type");return k.Msg.MICROBIT_controls_TypeLists+{int:k.Msg.LANG_MATH_INT,float:k.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:k.Msg.MIXLY_MICROBIT_TYPE_STRING,list:k.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:k.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:k.Msg.MIXLY_MICROBIT_TYPE_DICT,set:k.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:k.Msg.MIXLY_MICROBIT_IMAGE,bytes:k.Msg.LANG_MATH_BYTE,NoneType:k.Msg.LOGIC_NULL}[e]}))}},$=120,tt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_NAME_MAIN),this.appendStatementInput("DO").appendField(""),this.setTooltip(k.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},et={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_SETUP),this.appendStatementInput("DO").appendField(""),this.setTooltip(k.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},it={init:function(){var t=[[k.Msg.MIXLY_mSecond,"delay"],[k.Msg.MIXLY_uSecond,"delayMicroseconds"]];this.setColour($),this.appendValueInput("DELAY_TIME",Number).appendField(k.Msg.MIXLY_DELAY).appendField(new k.FieldDropdown(t),"UNIT").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_CONTROL_DELAY),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#id9"),this.wiki={"zh-hans":{page:["Arduino AVR","控制","延时"]}}}},nt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_CONTROL_END_PROGRAM),this.setPreviousStatement(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_END_TOOLTIP)}},st={init:function(){this.setColour($),this.appendValueInput("IF0").setCheck([Boolean,Number]).appendField(k.Msg.CONTROLS_IF_MSG_IF),this.appendStatementInput("DO0").appendField(k.Msg.CONTROLS_IF_MSG_THEN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#if"),this.setMutator(new k.icons.MutatorIcon(["controls_if_elseif","controls_if_else"],this));var t=this;this.setTooltip((function(){return t.elseifCount_||t.elseCount_?!t.elseifCount_&&t.elseCount_?k.Msg.CONTROLS_IF_TOOLTIP_2:t.elseifCount_&&!t.elseCount_?k.Msg.CONTROLS_IF_TOOLTIP_3:t.elseifCount_&&t.elseCount_?k.Msg.CONTROLS_IF_TOOLTIP_4:"":k.Msg.CONTROLS_IF_TOOLTIP_1})),this.elseifCount_=0,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_if_elseif");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_if_elseif":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_if_elseif":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(k.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},ot={init:function(){this.setColour($),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},_t={init:function(){this.setColour($),this.appendValueInput("LIST").setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(k.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},pt={init:function(){this.setColour($),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new k.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(k.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:k.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},at={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,i=[],n=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?i[s]=e.getInputTargetBlock("IF"+s).previousConnection:i[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?n[s]=e.getInputTargetBlock("DO"+s).previousConnection:n[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"IF"+s);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var i=e.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var s=t.newBlock("controls_except");s.initSvg(),i.connect(s.previousConnection),i=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),i.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var i=t.getInputTargetBlock("STACK"),n=[null],s=[null],o=null;i;){switch(i.type){case"controls_except":this.elseifCount_++,n.push(i.valueConnection_),s.push(i.statementConnection_);break;case"controls_finally":this.elseCount_++,o=i.statementConnection_;break;default:throw Error("Unknown block type: "+i.type)}i=i.nextConnection&&i.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(n,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),i=1;e;){switch(e.type){case"controls_except":var n=this.getInput("IF"+i),s=this.getInput("DO"+i);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,i++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var s=this.getInput("IF"+n),o=this.getInput("DO"+n);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(k.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,i){for(var n=1;n<=this.elseifCount_;n++)t[n]&&t[n].reconnect(this,"IF"+n),e[n]&&e[n].reconnect(this,"DO"+n);i&&i.reconnect(this,"ELSE")}},ut={init:function(){this.setColour($);var t=new k.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:k.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},lt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},rt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new k.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return k.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};pt.OPERATORS=[[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],ut.OPERATORS=[[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[k.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Tt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},It={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},dt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(k.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},ht={init:function(){this.setColour($),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Et={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Ot={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(k.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Mt={init:function(){this.jsonInit({message0:k.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:$,tooltip:k.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:k.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Rt={init:function(){this.setColour($),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(k.Msg.MIXLY_STAT),this.setOutput(!0)}},ct={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},mt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},At={init:function(){this.appendDummyInput().appendField(k.Msg.CONTROLS_REPEAT_TITLE_REPEAT+k.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(k.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new k.FieldDropdown([[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[k.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour($),this.setTooltip("do-while loop"),this.setHelpUrl("")}},gt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lt={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Ct={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},St={init:function(){this.setColour($),this.appendDummyInput().appendField(k.Msg.MIXLY_GET+k.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_GET_UNIQUE_IDEN)}},Dt=230;k.FieldTextInput.math_number_validator=function(t){return String(t)},k.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Nt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},Pt={init:function(){this.setColour(Dt);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},ft={init:function(){this.setColour(Dt);this.appendDummyInput("").appendField(k.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new k.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:k.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},Ft={init:function(){this.setColour(Dt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},vt={init:function(){this.setColour(Dt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:k.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:k.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:k.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:k.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:k.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:k.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},Vt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new k.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Yt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:k.Msg.MATH_TRIG_TOOLTIP_SIN,COS:k.Msg.MATH_TRIG_TOOLTIP_COS,TAN:k.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:k.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:k.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:k.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:k.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},yt={init:function(){var t=[[k.Msg.MATH_BIN,"bin"],[k.Msg.MATH_OCT,"oct"],[k.Msg.MATH_HEX,"hex"]];this.setColour(Dt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:k.Msg.MATH_DEC_TOOLTIP_BIN,oct:k.Msg.MATH_DEC_TOOLTIP_OCT,hex:k.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},bt={init:function(){var t=[[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"],[k.Msg.MATH_ABS,"fabs"],[k.Msg.MATH_SQRT,"sqrt"]];this.setColour(Dt),this.appendValueInput("A").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:k.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:k.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:k.Msg.MATH_SINGLE_TOOLTIP_SQ,round:k.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:k.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:k.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},kt={init:function(){var t=[[k.Msg.MIXLY_MAX,"max"],[k.Msg.MIXLY_MIN,"min"]];this.setColour(Dt),this.appendValueInput("A").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(new k.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(k.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:k.Msg.MIXLY_TOOLTIP_MATH_MAX,min:k.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},Xt={init:function(){var t=[[k.Msg.MATH_TWO,"two"],[k.Msg.MATH_EIGHT,"eight"],[k.Msg.MATH_TEN,"ten"],[k.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Dt),this.appendDummyInput("").appendField(k.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new k.FieldDropdown(t),"OP").appendField(k.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(k.Msg.MATH_ZHW).appendField(new k.FieldDropdown(t),"OP2").appendField(k.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),i={two:k.Msg.MATH_Before_two,eight:k.Msg.MATH_Before_eight,ten:k.Msg.MATH_Before_ten,sixteen:k.Msg.MATH_Before_sixteen},n=e.getFieldValue("OP2"),s={two:k.Msg.MATH_Behind_two,eight:k.Msg.MATH_Behind_eight,ten:k.Msg.MATH_Behind_ten,sixteen:k.Msg.MATH_Behind_sixteen};return i[t]+s[n]}))}},Ut={init:function(){var t=[[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Dt),this.setOutput(!0,Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_RANDOM).appendField(new k.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(k.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),i={int:k.Msg.LANG_MATH_INT,float:k.Msg.LANG_MATH_FLOAT_RANDOM};return k.Msg.MATH_RANDOM_INT_TOOLTIP+i[t]}))}},Gt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(k.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_CONSTRAIN_TOOLTIP)}},Bt={init:function(){this.setColour(Dt),this.appendValueInput("NUM",Number).appendField(k.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(k.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(k.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_MAP)}},xt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(new k.FieldTextInput("0",k.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(k.Msg.MATH_NUMBER_TOOLTIP)}},wt={init:function(){this.setColour(Dt),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Ht={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MATH_ROUND).appendField(k.Msg.TEXT_KEEP),this.appendDummyInput().appendField(k.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(k.Msg.MATH_ROUND_NEW_TOOLTIP)}},Wt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"],[k.Msg.MIXLY_TO_BITES,"b"]];this.setColour(Dt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:k.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:k.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Kt={init:function(){var t=[[k.Msg.MIXLY_TO_INT,"int"],[k.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Dt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:k.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:k.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},jt=Bt,qt=160,Qt={init:function(){this.setColour(qt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(k.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new k.FieldImage(e,12,12,'"')}},Jt={init:function(){this.setColour(qt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(k.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new k.FieldImage(e,12,12,'"')}};k.FieldTextInput.char_validator=function(t){if(t.length>1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Zt={init:function(){this.setColour(qt),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new k.FieldTextInput("",k.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(k.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new k.FieldImage(e,7,12,'"')}},zt={init:function(){this.setColour(qt),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(k.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},$t={init:function(){this.setColour(qt),this.appendValueInput("VAR").setCheck(Number).appendField(k.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},te={init:function(){this.setColour(qt),this.appendValueInput("VAR").setCheck(String).appendField(k.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},ee={init:function(){this.setColour(qt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ie={init:function(){this.setColour(qt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},ne={init:function(){this.WHERE_OPTIONS=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.TEXT_GET_INDEX_RANDOM+1+k.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(qt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(k.Msg.LISTS_GET_INDEX_GET,"MODE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(k.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=t.getFieldValue("WHERE"),n="";switch(e+" "+i){case"GET FROM_START":case"GET FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":n=k.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=i&&"FROM_END"!=i||(n+=" "+k.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",k.Msg.ONE_BASED_INDEXING?"#1":"#0")),n}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),i={FROM_START:k.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:k.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:k.Msg.TEXT_GET_INDEX_RANDOM};return k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+i[t]+"n"+k.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==k.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new k.FieldDropdown(this.WHERE_OPTIONS,(function(e){var i="FROM_START"==e||"FROM_END"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),k.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},se={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(qt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(k.Msg.PROCEDURES_DEFRETURN_RETURN+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.LISTS_GET_INDEX_FROM_START+"n"+k.Msg.TEXT_CHARAT2)}},oe={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(qt),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(k.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(k.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},_e={init:function(){this.WHERE_OPTIONS_1=[[k.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[k.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[k.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[k.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(qt),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==k.INPUT_VALUE;t.setAttribute("at1",e);var i=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",i),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),i="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,i)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),k.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(k.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var i=new k.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(i){var n="FROM_START"==i||"FROM_END"==i;if(n!=e){var s=this.sourceBlock_;return s.updateAt_(t,n),s.setFieldValue(i,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(i,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},pe={init:function(){this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(qt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(k.Msg.LISTS_GET_INDEX_GET+" "+k.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(k.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(k.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(k.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},ae={init:function(){var t=[[k.Msg.MIXLY_EQUALS,"==="],[k.Msg.MIXLY_STARTSWITH,"startswith"],[k.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(qt),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new k.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},ue={init:function(){this.setColour(qt),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_COMPARETO_HELP)}},le={init:function(){var t=[[k.Msg.TEXT_UPPER,"upper"],[k.Msg.TEXT_TITLE,"title"],[k.Msg.TEXT_CAPITALIZE,"capitalize"],[k.Msg.TEXT_SWAPCASE,"swapcase"],[k.Msg.TEXT_LOWER,"lower"]];this.setColour(qt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:k.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:k.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:k.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:k.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:k.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},re={init:function(){var t=[[k.Msg.TEXT_LJUST,"ljust"],[k.Msg.TEXT_CENTER,"center"],[k.Msg.TEXT_RJUST,"rjust"]];this.setColour(qt),this.appendValueInput("VAR").appendField(new k.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(k.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(k.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Te={init:function(){this.setColour(qt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(k.Msg.MIXLY_MID+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(k.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},Ie={init:function(){this.setColour(qt),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},de={init:function(){this.setColour(qt),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(k.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(k.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},he={init:function(){this.setColour(qt),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(k.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(k.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Ee={init:function(){var t=[[k.Msg.TEXT_TRIM_BOTH,"strip"],[k.Msg.TEXT_TRIM_LEFT,"lstrip"],[k.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(qt),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new k.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(k.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:k.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:k.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:k.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Oe={init:function(){this.setColour(qt),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new k.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ii={init:function(){this.setColour(ri),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(k.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},di={init:function(){this.setColour(ri),this.appendDummyInput().appendField(k.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},hi={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_KEYS),this.setTooltip(k.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Ei={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_TOOLTIP)}},Oi={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(k.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Mi={init:function(){this.setColour(ri),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(k.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Ri={init:function(){this.setColour(ri),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(k.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_DELETE_TOOLTIP)}},ci={init:function(){this.setColour(ri),this.appendValueInput("DICT2").setCheck("Dict").appendField(k.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(k.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(k.Msg.MIXLY_MID),this.setTooltip(k.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mi={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_CLEAR),this.setTooltip(k.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ai={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_ITEMS),this.setTooltip(k.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},gi={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_VALUES),this.setTooltip(k.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},Li={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_LENGTH),this.setTooltip(k.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Ci={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.DICT_DELDICT),this.setTooltip(k.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Si={init:function(){this.MODE=[[k.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[k.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(k.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(k.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=k.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=k.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==k.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new k.FieldDropdown(this.MODE,(function(e){var i="INSERT"==e;if(i!=t){var n=this.sourceBlock_;return n.updateAt_(i),n.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Di={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(k.Msg.DICTS_ADD_VALUE),this.setTooltip(k.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Ni={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(k.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.DICTS_SETDEFAULT_TOOLTIP)}},Pi={init:function(){this.setColour(ri),this.appendDummyInput("").appendField(new k.FieldLabel(k.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new k.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(k.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;ne?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},fi={init:function(){this.setColour(ri),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},Fi={init:function(){this.setColour(ri),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(k.Msg.MIXLY_TO_JSON),this.setTooltip(k.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},vi={init:function(){this.setColour(ri),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(k.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(k.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0,Number)}},Vi=210,Yi={init:function(){var t=k.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Vi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:k.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:k.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:k.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:k.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:k.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:k.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},yi={init:function(){var t=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=k.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Vi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new k.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},bi={init:function(){var t=[[k.Msg.LOGIC_OPERATION_AND,"AND"],[k.Msg.LOGIC_OPERATION_OR,"OR"],[k.Msg.LOGIC_OPERATION_NOR,"NOR"],[k.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Vi),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new k.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:k.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:k.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:k.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:k.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},ki={init:function(){this.setColour(Vi),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(k.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(k.Msg.LOGIC_NEGATE_TOOLTIP)}},Xi={init:function(){var t=[[k.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[k.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Vi),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new k.FieldDropdown(t),"BOOL"),this.setTooltip(k.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Ui={init:function(){this.setColour(Vi),this.setOutput(!0),this.appendDummyInput().appendField(k.Msg.LOGIC_NULL),this.setTooltip(k.Msg.LOGIC_NULL_TOOLTIP)}},Gi={init:function(){this.setColour(Vi),this.appendValueInput("A"),this.appendValueInput("B").appendField(k.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(k.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},Bi={init:function(){var t=[[k.Msg.TEXT_APPEND_TO,"in"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Vi),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new k.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(k.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.IN)}},xi={init:function(){var t=[[k.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[k.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Vi),this.appendValueInput("A"),this.appendValueInput("B").appendField(new k.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},wi={init:function(){this.setColour(Vi),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},Hi={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(k.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Wi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ki={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},ji={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXPY_TEXT_ENCODE).appendField(new k.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_USE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=k.Msg.MIXLY_BELONG,_=k.Msg.PY_STORAGE_FILE_OBJECT;return i+{r:k.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:k.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:k.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+n+s+_}))}},qi={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+k.Msg.MIXLY_MICROBIT_TYPE_STRING+k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Qi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Ji={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return i+{read:k.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:k.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+n}))}},Zi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MICROBIT_PYTHON_TYPE)}},zi={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.HTML_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},$i={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},tn={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},en={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const nn={init:function(){this.setColour(0),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},sn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+k.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},on={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},_n={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),i=k.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+k.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,n=k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return i+" "+{start:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:k.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+n}))}},pn={init:function(){this.setColour(0),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},an={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+k.Msg.MIXLY_ESP32_SET+{mkdir:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},un={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(k.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},ln={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},rn={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.HTML_FILE,"isfile"],[k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return k.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+k.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:k.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Tn={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(k.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(k.Msg.MIXLY_SETUP+k.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(k.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},In={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(k.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},dn={init:function(){var t=x.findLegalName("",this),e=new k.FieldTextInput(t,x.rename);e.setSpellcheck(!1),this.appendDummyInput().appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new k.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&k.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(k.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(k.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(k.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(t){this.hasStatements_!==t&&(t?(this.appendStatementInput("STACK").appendField(k.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=t)},updateParams_:function(){var t="";this.arguments_.length&&(t=k.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),k.Events.disable();try{this.setFieldValue(t,"PARAMS")}finally{k.Events.enable()}},mutationToDom:function(t){var e=k.utils.xml.createElement("mutation");t&&e.setAttribute("name",this.getFieldValue("NAME"));for(var i=0;i"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ps={init:function(){this.setColour(es),this.appendDummyInput().appendField(k.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},as={init:function(){this.setColour(es),this.appendDummyInput().appendField(k.Msg.HTML_FORM_CONTENT).appendField(new k.FieldDropdown([[k.Msg.HTML_TEXT,"text"],[k.Msg.HTML_EMAIL,"email"],[k.Msg.HTML_NUMBER,"number"],[k.Msg.HTML_PASSWORD,"password"],[k.Msg.HTML_CHECKBOX,"checkbox"],[k.Msg.HTML_RADIOBUTTON,"radiobutton"],[k.Msg.HTML_BUTTON,"button"],[k.Msg.HTML_COLOUR,"colour"],[k.Msg.HTML_DATE,"date"],[k.Msg.HTML_LOCALTIME,"local time"],[k.Msg.HTML_FILE,"file"],[k.Msg.HTML_HIDDEN,"hidden"],[k.Msg.HTML_IMAGE,"image"],[k.Msg.HTML_MONTH,"month"],[k.Msg.HTML_RANGE,"range"],[k.Msg.HTML_RESET,"reset"],[k.Msg.HTML_SEARCH,"search"],[k.Msg.HTML_SUBMIT,"submit"],[k.Msg.HTML_TELEPHONENUMBER,"telephone number"],[k.Msg.HTML_TIME,"time"],[k.Msg.HTML_URL,"url"],[k.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(k.Msg.HTML_NAME).appendField(new k.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(k.Msg.HTML_VALUE).appendField(new k.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(k.Msg.MIXLY_AIP_ATTR).setAlign(k.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},us={init:function(){this.setColour(es),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ls={init:function(){this.setColour(es),this.appendDummyInput().appendField(new k.FieldTextInput("property"),"KEY").appendField(":").appendField(new k.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rs={init:function(){this.setColour(es),this.appendDummyInput().appendField(k.Msg.HTML_TEXT).appendField(new k.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ts=160,Is={init:function(){this.setColour(Ts),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new k.FieldTable(""),"TEXT")}},ds={init:function(){this.setColour(Ts),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT")}},hs={init:function(){this.setColour(Ts),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new k.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Es={init:function(){this.setColour(Ts),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Os={init:function(){this.setColour(Ts),this.appendDummyInput().appendTitle("Comment:").appendTitle(new k.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Ms={init:function(){this.setColour(Ts),this.appendValueInput("VALUE").appendField(k.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Rs={init:function(){this.setColour(Ts),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new k.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=k.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ks={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xs={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Us={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gs={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bs={init:function(){this.setColour(Ss);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xs={init:function(){this.setColour(Ss),this.appendValueInput("FROM").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_SPLITBYDOU).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(k.inputs.Align.RIGHT).appendField(k.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},ws={init:function(){this.setColour(Ss);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},Hs={init:function(){this.setColour(Ss);var t=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],e=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Ws={init:function(){this.setColour(Ss);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[k.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[k.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[k.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[k.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[k.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[k.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[k.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[k.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Ks={init:function(){this.setColour(Ss);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},js={init:function(){this.setColour(Ss);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},qs={init:function(){this.setColour(Ss),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qs={init:function(){this.setColour(Ss);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Js={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[k.Msg.LANG_MATH_TO_ROUND,"round"],[k.Msg.LANG_MATH_TO_CEIL,"ceil"],[k.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(Ss),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(k.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new k.FieldDropdown(t),"OP"),this.setTooltip(k.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},Zs={init:function(){this.setColour(Ss),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},zs={init:function(){this.setColour(Ss),this.appendValueInput("FILENAME").appendField(k.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[k.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(k.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(k.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){k.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},$s={init:function(){this.setColour(Ss),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(k.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(k.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new k.FieldDropdown([[k.Msg.DATAFRAME_COLUMN,"column"],[k.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(k.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},to={init:function(){this.setColour(Ss),this.appendValueInput("FILE").setCheck(String).appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},eo={init:function(){this.setColour(Ss);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},io={init:function(){this.setColour(Ss),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(k.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},no={init:function(){this.setColour(Ss),this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},so={init:function(){this.setColour(Ss);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("SER").setCheck("Series").appendField(k.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},oo={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_o={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},po={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ao={init:function(){this.setColour(Ss),this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},uo={init:function(){this.setColour(Ss);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.blockpy_PYLAB_SET_LABEL).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(k.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},lo={init:function(){this.setColour(Ss);var t=[[k.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[k.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(k.Msg.MIXLY_DISPLAY_DRAW).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:k.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},ro={init:function(){this.setColour(Ss);var t=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_SCATTER).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(k.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(t),"DOT"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},To={init:function(){this.setColour(Ss);var t=[[k.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[k.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[k.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[k.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[k.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[k.Msg.COLOUR_RGB_BLUE,"b"],[k.Msg.COLOUR_RGB_GREEN,"g"],[k.Msg.COLOUR_RGB_RED,"r"],[k.Msg.COLOUR_CYAN,"c"],[k.Msg.COLOUR_MAGENTA,"m"],[k.Msg.COLOUR_YELLOW,"y"],[k.Msg.COLOUR_BLACK,"k"],[k.Msg.COLOUR_WHITE,"w"]],i=[[k.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[k.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[k.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PLOT_XY).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new k.FieldDropdown(i),"DOT"),this.appendDummyInput("").appendField(k.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new k.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Io={init:function(){this.setColour(Ss);var t=[[k.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[k.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_BAR).appendField(k.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(k.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new k.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(k.Msg.HTML_COLOUR).appendField(new k.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},ho={init:function(){this.setColour(Ss);var t=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[k.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[k.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[k.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_PIE).appendField(k.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(k.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new k.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(k.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new k.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Eo={init:function(){this.setColour(Ss),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_HIST).appendField(k.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(k.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Oo={init:function(){this.setColour(Ss);var t=[[k.Msg.PYLAB_LABEL_X,"x"],[k.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(k.Msg.MIXLY_SETTING).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(k.Msg.mixpy_PYLAB_TICKS).appendField(k.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(k.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Mo={init:function(){this.setColour(Ss),this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT).appendField(k.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Ro={init:function(){this.setColour(Ss),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(k.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},co={init:function(){this.setColour(Ss);var t=[[k.Msg.TEXT_TRIM_LEFT,"right"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[k.Msg.mixpy_PL_TEXT_TOP,"bottom"],[k.Msg.mixpy_PL_TEXT_CENTER,"center"],[k.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(k.Msg.MIXLY_SETTING).appendField(k.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(k.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_HOR).appendField(new k.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(k.Msg.mixpy_PL_TEXT_VER).appendField(new k.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(k.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.mixpy_PL_TEXT_TOOLTIP)}},mo=20,Ao={init:function(){this.setColour(mo),this.appendValueInput("VAR").appendField(k.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(k.Msg.INOUT_input_TOOLTIP)}},go={init:function(){this.setColour(mo),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.BLOCKPY_PRINT_TOOLTIP)}},Lo={init:function(){this.setColour(mo),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(k.Msg.TEXT_PRINT_TOOLTIP)}},Co={init:function(){this.setColour(mo),this.appendValueInput("VAR").appendField(k.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(k.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(k.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},So={init:function(){var t=[[k.Msg.LANG_MATH_STRING,"str"],[k.Msg.LANG_MATH_INT,"int"],[k.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(mo),this.appendDummyInput("").appendField(k.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new k.FieldDropdown(t),"DIR"),this.appendValueInput("VAR").appendField(k.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{str:k.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:k.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:k.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[t]}))}},Do={init:function(){this.setColour(mo),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new k.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(k.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("inout_print_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n0?t:[["'无可用地图'","'无可用地图'"]]}},H_={init:function(){this.appendValueInput("pathtype").setCheck(null).appendField(k.Msg.MIXLY_GAME_SETPATHTYPE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},W_={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用路径'","'无可用路径'"]]}},K_={init:function(){this.setColour(290),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("posx").setCheck(null).appendField(k.Msg.TEXT_APPEND_TO+"("),this.appendDummyInput().appendField(","),this.appendValueInput("posy").setCheck(null).appendField(""),this.appendDummyInput().appendField(")"+k.Msg.MIXLY_GAME_LAY).appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_WALL,"'wall'"],[k.Msg.MIXLY_GAME_BARRIER,"'barrier'"],[k.Msg.MIXLY_GAME_COIN,"'coin'"],[k.Msg.MIXLY_GAME_REDMARKER,"'redmarker'"],[k.Msg.MIXLY_GAME_YELLOWMARKER,"'yellowmarker'"],[k.Msg.MIXLY_GAME_BLUEMARKER,"'bluemarker'"],[k.Msg.MIXLY_GAME_GREENMARKER,"'greenmarker'"]]),"item"),this.setTooltip("")}},j_={init:function(){this.imgArr=this.getLocalImg(),this.appendDummyInput().appendField(new k.FieldDropdown(this.getLocalImg()),"type"),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")},onchange:function(){let t=this.getFieldValue("type"),e=this.imgArr;this.haveNewSrc(this.imgArr,e)&&(this.imgArr=e,this.getField("type").menuGenerator_=this.imgArr,this.checkSrc(t,this.imgArr)?this.setFieldValue(t,"type"):this.setFieldValue(this.imgArr[0][1],"type"))},haveNewSrc:function(t,e){if(t.length!==e.length)return!0;for(var i=0;i0?t:[["'无可用角色'","'无可用角色'"]]}},q_={init:function(){this.setColour(290),this.appendValueInput("character").setCheck(null).appendField(k.Msg.MIXLY_GAME_INIT_CHARA),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_FACE+k.Msg.MIXLY_GAME_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Q_={init:function(){this.setColour(290),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_GETPOINT),this.setOutput(!0,Number),this.setTooltip("")}},J_={init:function(){this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_UP,"0"],[k.Msg.MIXLY_GAME_DOWN,"2"],[k.Msg.MIXLY_GAME_LEFT,"3"],[k.Msg.MIXLY_GAME_RIGHT,"1"]]),"direction"),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ISBARRIER),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},Z_={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_RE_SPIRITE).appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_FORWARD,"f"],[k.Msg.MIXLY_GAME_BACKWARD,"b"],[k.Msg.MIXLY_GAME_LEFT,"l"],[k.Msg.MIXLY_GAME_RIGHT,"r"]]),"direction"),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ISBARRIER),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},z_={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_RANDOMCAROIL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},$_={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_NEEDOIL),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},tp={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ISGREEN),this.setOutput(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},ep={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_ADDOIL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},ip={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_CHECKCIRCURIGHT),this.setPreviousStatement(!0),this.setColour(290),this.setTooltip("")}},np={init:function(){this.setColour(290),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_CHECK_WHETHER_PASS),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_REDMARKER,"'redmarker'"],[k.Msg.MIXLY_GAME_YELLOWMARKER,"'yellowmarker'"],[k.Msg.MIXLY_GAME_BLUEMARKER,"'bluemarker'"],[k.Msg.MIXLY_GAME_GREENMARKER,"'greenmarker'"]]),"marker"),this.appendDummyInput().appendField("?"),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},sp={init:function(){this.setColour(290),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_GET_MARKER_NUM),this.appendDummyInput().appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_REDMARKER,"'redmarker'"],[k.Msg.MIXLY_GAME_YELLOWMARKER,"'yellowmarker'"],[k.Msg.MIXLY_GAME_BLUEMARKER,"'bluemarker'"],[k.Msg.MIXLY_GAME_GREENMARKER,"'greenmarker'"]]),"marker"),this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_NUMBER_OF_MARKER),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},op={init:function(){this.setColour(290),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("posx").setCheck(null).appendField(k.Msg.TEXT_APPEND_TO+"("),this.appendDummyInput().appendField(","),this.appendValueInput("posy").setCheck(null).appendField(""),this.appendDummyInput().appendField(")"+k.Msg.TEXT_GET_INDEX_RANDOM+k.Msg.MIXLY_GAME_LAY+k.Msg.MIXLY_GAME_BARRIER),this.setTooltip("")}},_p={init:function(){this.appendDummyInput().appendField(k.Msg.MIXLY_GAME_INIT_AS).appendField(new k.FieldDropdown([[k.Msg.MIXLY_GAME_ONE,"0"],[k.Msg.MIXLY_GAME_TWO,"1"],[k.Msg.MIXLY_GAME_THREE,"2"],[k.Msg.MIXLY_GAME_FOUR,"3"],[k.Msg.MIXLY_GAME_FIVE,"4"],[k.Msg.MIXLY_GAME_SIX,"5"],[k.Msg.MIXLY_GAME_SEVEN,"6"],[k.Msg.MIXLY_GAME_EIGHT,"7"],[k.Msg.MIXLY_GAME_NINE,"8"],[k.Msg.MIXLY_GAME_TEN,"9"],[k.Msg.MIXLY_GAME_ELE,"10"],[k.Msg.MIXLY_GAME_TWEL,"11"],[k.Msg.MIXLY_GAME_THIR,"12"],[k.Msg.MIXLY_GAME_FORT,"13"],[k.Msg.MIXLY_GAME_FIFT,"14"],[k.Msg.MIXLY_GAME_SIXT,"15"],[k.Msg.MIXLY_GAME_SEVENT,"16"]]),"level"),this.setInputsInline(!0),this.setNextStatement(!0),this.setColour(290),this.setTooltip("")}},pp={init:function(){this.appendValueInput("N").setCheck(null).setAlign(k.inputs.Align.LEFT).appendField("二分法查找书籍").appendField("N"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},ap={init:function(){this.appendValueInput("N").setCheck(null).setAlign(k.inputs.Align.LEFT).appendField("顺序法查找书籍").appendField("N"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(290),this.setTooltip(""),this.setHelpUrl("")}},up=function(t,e){return[e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE),e.ORDER_ATOMIC]},lp=function(t,e){if(""==this.getFieldValue("VAR"))return" = None\n";var i=e.valueToCode(this,"VALUE",e.ORDER_ASSIGNMENT)||"None";return e.variableDB_.getName(this.getFieldValue("VAR"),k.Variables.NAME_TYPE)+" = "+i+"\n"},rp=function(t,e){var i=this.getFieldValue("OP"),n=e.valueToCode(this,"MYVALUE",e.ORDER_ATOMIC)||"None";if("bytes"==i)var s=i+"("+n+',"UTF-8")';else s=i+"("+n+")";return[s,e.ORDER_ATOMIC]},Tp=function(t,e){return"global "+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"None")+"\n"},Ip=function(t,e){return["type("+(e.valueToCode(this,"DATA",e.ORDER_ATOMIC)||"None")+")",e.ORDER_ATOMIC]},dp=function(t,e){return[this.getFieldValue("type"),e.ORDER_ATOMIC]},hp=function(t,e){var i=e.statementToCode(t,"DO");return"if __name__ == '__main__':\n"+(i=e.addLoopTrap(i,t.id)||e.PASS)},Ep=function(t,e){var i=e.statementToCode(this,"DO");return(i=i.replace(/(^\s*)|(\s*$)/g,"").replace(/\n {4}/g,"\n")).endsWith("\n")?e.setups_.setup_setup=i:e.setups_.setup_setup=i+"\n",""},Op=function(t,e){var i=0,n="";do{n+=(0==i?"if ":"elif ")+(e.valueToCode(t,"IF"+i,e.ORDER_NONE)||"False")+":\n"+(e.statementToCode(t,"DO"+i)||e.PASS),++i}while(t.getInput("IF"+i));return t.getInput("ELSE")&&(n+="else:\n"+(e.statementToCode(t,"ELSE")||e.PASS)),n},Mp=function(t,e){var i=0,n=e.valueToCode(this,"IF"+i,e.ORDER_NONE)||"null",s="try:\n"+(e.statementToCode(this,"try")||" pass\n");for(i=1;i<=this.elseifCount_;i++)""!==(n=e.valueToCode(this,"IF"+i,e.ORDER_NONE)||"")&&(n=" "+n),s+="except"+n+": \n"+(e.statementToCode(this,"DO"+i)||" pass\n");return this.elseCount_&&(s+="finally:\n"+(e.statementToCode(this,"ELSE")||" pass\n")),s},Rp=function(t,e){var i=e.variableDB_.getName(t.getFieldValue("VAR"),k.Variables.NAME_TYPE),n=e.valueToCode(t,"FROM",e.ORDER_NONE)||"0",s=e.valueToCode(t,"TO",e.ORDER_NONE)||"0",o=e.valueToCode(t,"STEP",e.ORDER_NONE)||"1",_=e.statementToCode(t,"DO"),p=(_=e.addLoopTrap(_,t.id)||e.PASS,""),a=function(t,e){return e.provideFunction_("upRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start <= stop:"," yield start"," start += abs(step)"])},u=function(t,e){return e.provideFunction_("downRange",["def "+e.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start >= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,i){return"("+t+" <= "+e+") and "+a()+"("+t+", "+e+", "+i+") or "+u()+"("+t+", "+e+", "+i+")"},k.isNumber(n)&&k.isNumber(s)&&k.isNumber(o))n=parseFloat(n),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==n%1&&0==s%1&&0==o%1?(n<=s?(s++,t=0==n&&1==o?s:n+", "+s,1!=o&&(t+=", "+o)):t=n+", "+--s+", -"+o,t="range("+t+")"):(t=n",GTE:">="};const Uu=function(t,e){var i=this.getFieldValue("OP"),n="&&"==i?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",n)||"False",o=e.valueToCode(this,"B",n)||"False";if("AND"==i)var _=s+" and "+o;else if("OR"==i)_=s+" or "+o;else if("NOR"==i)_="not("+s+"^"+o+")";else _=s+"^"+o;return[_,n]},Gu=function(t,e){var i=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",i)||"False"),i]},Bu=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},xu=function(t,e){return["None",e.ORDER_ATOMIC]},wu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+i+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Hu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Wu=function(t,e){var i=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",n=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[i+" "+this.getFieldValue("BOOL")+" "+n,e.ORDER_ATOMIC]},Ku=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},ju=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},qu=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},Qu=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},Ju=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},Zu=function(t,e){var i=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+i+")\n"},zu=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"()",e.ORDER_ATOMIC]},$u=function(t,e){var i=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+i+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},tl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},el=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},il=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},nl=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},sl=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},ol=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},_l=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},pl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},al=function(t,e){var i=this.getFieldValue("MODE"),n=0;return n="start"==i?0:"current"==i?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+n+")\n"},ul=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ll=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},rl=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},Tl=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},Il=function(t,e){e.definitions_.import_os="import os";var i=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+i+")",e.ORDER_ATOMIC]},dl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},hl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},El=function(t,e){var i=e.variableDB_.getName(this.getFieldValue("NAME"),k.Procedures.NAME_TYPE),n=e.statementToCode(this,"STACK")||" pass\n";e.INFINITE_LOOP_TRAP&&(n=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+n);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],_=0;_\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},Jl=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"\n"+i+"\n"},Zl=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");if("head"==n)var s="<"+n+'>\n\t\n'+i+"\n";else s="<"+n+">\n"+i+"\n";return s},zl=function(t,e){var i=e.statementToCode(this,"DO"),n=this.getFieldValue("LEVEL");return"<"+n+">\n"+i+"\n"},$l=function(t,e){var i=e.statementToCode(this,"DO"),n=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+n+" >\n"+i+"\n"},tr=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},er=function(t,e){return'"},ir=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},nr=function(){return this.getFieldValue("TEXT")+"\n"},sr=function(t){return t.getFieldValue("TEXT")+"\n"},or=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},_r=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},pr=function(){return""},ar=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},ur=function(t,e){for(var i=t.getFieldValue("NAME"),n=t.hasReturn_,s=new Array(t.itemCount_),o=0;o=0&&(n[s]=n[s].replace(" ",""));i="";for(s=0;s