// Do not edit this file; automatically generated. /* eslint-disable */ ;(function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD define(["./blockly_compressed.js"], factory); } else if (typeof exports === 'object') { // Node.js module.exports = factory(require("./blockly_compressed.js")); } else { // Browser var factoryExports = factory(root.Blockly); root.Blockly.Lua = factoryExports.luaGenerator; root.Blockly.Lua.__namespace__ = factoryExports.__namespace__; } }(this, function(__parent__) { var $=__parent__.__namespace__; var module$exports$Blockly$Lua={},module$contents$Blockly$Lua_objectUtils=$.module$build$src$core$utils$object,module$contents$Blockly$Lua_stringUtils=$.module$build$src$core$utils$string,module$contents$Blockly$Lua_Generator=$.Generator$$module$build$src$core$generator,module$contents$Blockly$Lua_inputTypes=$.module$build$src$core$input_types.inputTypes,module$contents$Blockly$Lua_Names=$.module$build$src$core$names.Names;module$exports$Blockly$Lua.luaGenerator=new $.Generator$$module$build$src$core$generator("Lua"); module$exports$Blockly$Lua.luaGenerator.addReservedWords("_,__inext,assert,bit,colors,colours,coroutine,disk,dofile,error,fs,fetfenv,getmetatable,gps,help,io,ipairs,keys,loadfile,loadstring,math,native,next,os,paintutils,pairs,parallel,pcall,peripheral,print,printError,rawequal,rawget,rawset,read,rednet,redstone,rs,select,setfenv,setmetatable,sleep,string,table,term,textutils,tonumber,tostring,turtle,type,unpack,vector,write,xpcall,_VERSION,__indext,HTTP,and,break,do,else,elseif,end,false,for,function,if,in,local,nil,not,or,repeat,return,then,true,until,while,add,sub,mul,div,mod,pow,unm,concat,len,eq,lt,le,index,newindex,call,assert,collectgarbage,dofile,error,_G,getmetatable,inpairs,load,loadfile,next,pairs,pcall,print,rawequal,rawget,rawlen,rawset,select,setmetatable,tonumber,tostring,type,_VERSION,xpcall,require,package,string,table,math,bit32,io,file,os,debug"); module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC=0;module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH=1;module$exports$Blockly$Lua.luaGenerator.ORDER_EXPONENTIATION=2;module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY=3;module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE=4;module$exports$Blockly$Lua.luaGenerator.ORDER_ADDITIVE=5;module$exports$Blockly$Lua.luaGenerator.ORDER_CONCATENATION=6;module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL=7; module$exports$Blockly$Lua.luaGenerator.ORDER_AND=8;module$exports$Blockly$Lua.luaGenerator.ORDER_OR=9;module$exports$Blockly$Lua.luaGenerator.ORDER_NONE=99;module$exports$Blockly$Lua.luaGenerator.isInitialized=!1; module$exports$Blockly$Lua.luaGenerator.init=function(a){Object.getPrototypeOf(this).init.call(this);this.nameDB_?this.nameDB_.reset():this.nameDB_=new $.module$build$src$core$names.Names(this.RESERVED_WORDS_);this.nameDB_.setVariableMap(a.getVariableMap());this.nameDB_.populateVariables(a);this.nameDB_.populateProcedures(a);this.isInitialized=!0}; module$exports$Blockly$Lua.luaGenerator.finish=function(a){const b=$.module$build$src$core$utils$object.values(this.definitions_);a=Object.getPrototypeOf(this).finish.call(this,a);this.isInitialized=!1;this.nameDB_.reset();return b.join("\n\n")+"\n\n\n"+a};module$exports$Blockly$Lua.luaGenerator.scrubNakedValue=function(a){return"local _ = "+a+"\n"};module$exports$Blockly$Lua.luaGenerator.quote_=function(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/'/g,"\\'");return"'"+a+"'"}; module$exports$Blockly$Lua.luaGenerator.multiline_quote_=function(a){return a.split(/\n/g).map(this.quote_).join(" .. '\\n' ..\n")}; module$exports$Blockly$Lua.luaGenerator.scrub_=function(a,b,c){let d="";if(!a.outputConnection||!a.outputConnection.targetConnection){var e=a.getCommentText();e&&(e=$.module$build$src$core$utils$string.wrap(e,this.COMMENT_WRAP-3),d+=this.prefixLines(e,"-- ")+"\n");for(let f=0;fa?module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY:module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC]}; module$exports$Blockly$Lua.luaGenerator.math_arithmetic=function(a){var b={ADD:[" + ",module$exports$Blockly$Lua.luaGenerator.ORDER_ADDITIVE],MINUS:[" - ",module$exports$Blockly$Lua.luaGenerator.ORDER_ADDITIVE],MULTIPLY:[" * ",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE],POWER:[" ^ ",module$exports$Blockly$Lua.luaGenerator.ORDER_EXPONENTIATION]}[a.getFieldValue("OP")];const c=b[0];b=b[1];const d=module$exports$Blockly$Lua.luaGenerator.valueToCode(a, "A",b)||"0";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"B",b)||"0";return[d+c+a,b]}; module$exports$Blockly$Lua.luaGenerator.math_single=function(a){var b=a.getFieldValue("OP");if("NEG"===b)return a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"NUM",module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY)||"0",["-"+a,module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY];if("POW10"===b)return a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"NUM",module$exports$Blockly$Lua.luaGenerator.ORDER_EXPONENTIATION)||"0",["10 ^ "+a,module$exports$Blockly$Lua.luaGenerator.ORDER_EXPONENTIATION]; a="ROUND"===b?module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"NUM",module$exports$Blockly$Lua.luaGenerator.ORDER_ADDITIVE)||"0":module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"NUM",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0";switch(b){case "ABS":b="math.abs("+a+")";break;case "ROOT":b="math.sqrt("+a+")";break;case "LN":b="math.log("+a+")";break;case "LOG10":b="math.log("+a+", 10)";break;case "EXP":b="math.exp("+a+")";break;case "ROUND":b="math.floor("+a+" + .5)";break;case "ROUNDUP":b= "math.ceil("+a+")";break;case "ROUNDDOWN":b="math.floor("+a+")";break;case "SIN":b="math.sin(math.rad("+a+"))";break;case "COS":b="math.cos(math.rad("+a+"))";break;case "TAN":b="math.tan(math.rad("+a+"))";break;case "ASIN":b="math.deg(math.asin("+a+"))";break;case "ACOS":b="math.deg(math.acos("+a+"))";break;case "ATAN":b="math.deg(math.atan("+a+"))";break;default:throw Error("Unknown math operator: "+b);}return[b,module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]}; module$exports$Blockly$Lua.luaGenerator.math_constant=function(a){return{PI:["math.pi",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH],E:["math.exp(1)",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH],GOLDEN_RATIO:["(1 + math.sqrt(5)) / 2",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE],SQRT2:["math.sqrt(2)",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH],SQRT1_2:["math.sqrt(1 / 2)",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH],INFINITY:["math.huge",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]}[a.getFieldValue("CONSTANT")]}; module$exports$Blockly$Lua.luaGenerator.math_number_property=function(a){var b={EVEN:[" % 2 == 0",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL],ODD:[" % 2 == 1",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL],WHOLE:[" % 1 == 0",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL],POSITIVE:[" > 0", module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL],NEGATIVE:[" < 0",module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL],DIVISIBLE_BY:[null,module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL],PRIME:[null,module$exports$Blockly$Lua.luaGenerator.ORDER_NONE,module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]}; const c=a.getFieldValue("PROPERTY"),[d,e,f]=b[c];b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"NUMBER_TO_CHECK",e)||"0";if("PRIME"===c)a=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_isPrime",` function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(n) -- https://en.wikipedia.org/wiki/Primality_test#Naive_methods if n == 2 or n == 3 then return true end -- False if n is NaN, negative, is 1, or not whole. -- And false if n is divisible by 2 or 3. if not(n > 1) or n % 1 ~= 0 or n % 2 == 0 or n % 3 == 0 then return false end -- Check all the numbers of form 6k +/- 1, up to sqrt(n). for x = 6, math.sqrt(n) + 1.5, 6 do if n % (x - 1) == 0 or n % (x + 1) == 0 then return false end end return true end `)+"("+b+")";else if("DIVISIBLE_BY"===c){a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"DIVISOR",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE)||"0";if("0"===a)return["nil",module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC];a=b+" % "+a+" == 0"}else a=b+d;return[a,f]}; module$exports$Blockly$Lua.luaGenerator.math_change=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"DELTA",module$exports$Blockly$Lua.luaGenerator.ORDER_ADDITIVE)||"0";a=module$exports$Blockly$Lua.luaGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE);return a+" = "+a+" + "+b+"\n"};module$exports$Blockly$Lua.luaGenerator.math_round=module$exports$Blockly$Lua.luaGenerator.math_single; module$exports$Blockly$Lua.luaGenerator.math_trig=module$exports$Blockly$Lua.luaGenerator.math_single;module$exports$Blockly$Lua.luaGenerator.math_on_list=function(a){function b(){return module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_sum",` function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t) local result = 0 for _, v in ipairs(t) do result = result + v end return result end `)}var c=a.getFieldValue("OP");a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"LIST",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"{}";switch(c){case "SUM":c=b();break;case "MIN":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_min",` function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t) if #t == 0 then return 0 end local result = math.huge for _, v in ipairs(t) do if v < result then result = v end end return result end `);break;case "AVERAGE":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_average",` function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t) if #t == 0 then return 0 end return ${b()}(t) / #t end `);break;case "MAX":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_max",` function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t) if #t == 0 then return 0 end local result = -math.huge for _, v in ipairs(t) do if v > result then result = v end end return result end `);break;case "MEDIAN":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_median",` function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t) -- Source: http://lua-users.org/wiki/SimpleStats if #t == 0 then return 0 end local temp = {} for _, v in ipairs(t) do if type(v) == 'number' then table.insert(temp, v) end end table.sort(temp) if #temp % 2 == 0 then return (temp[#temp / 2] + temp[(#temp / 2) + 1]) / 2 else return temp[math.ceil(#temp / 2)] end end `);break;case "MODE":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_modes",` function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t) -- Source: http://lua-users.org/wiki/SimpleStats local counts = {} for _, v in ipairs(t) do if counts[v] == nil then counts[v] = 1 else counts[v] = counts[v] + 1 end end local biggestCount = 0 for _, v in pairs(counts) do if v > biggestCount then biggestCount = v end end local temp = {} for k, v in pairs(counts) do if v == biggestCount then table.insert(temp, k) end end return temp end `);break;case "STD_DEV":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_standard_deviation",` function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t) local m local vm local total = 0 local count = 0 local result m = #t == 0 and 0 or ${b()}(t) / #t for _, v in ipairs(t) do if type(v) == 'number' then vm = v - m total = total + (vm * vm) count = count + 1 end end result = math.sqrt(total / (count-1)) return result end `);break;case "RANDOM":c=module$exports$Blockly$Lua.luaGenerator.provideFunction_("math_random_list",` function ${module$exports$Blockly$Lua.luaGenerator.FUNCTION_NAME_PLACEHOLDER_}(t) if #t == 0 then return nil end return t[math.random(#t)] end `);break;default:throw Error("Unknown operator: "+c);}return[c+"("+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};module$exports$Blockly$Lua.luaGenerator.math_modulo=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"DIVIDEND",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE)||"0";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"DIVISOR",module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE)||"0";return[b+" % "+a,module$exports$Blockly$Lua.luaGenerator.ORDER_MULTIPLICATIVE]}; module$exports$Blockly$Lua.luaGenerator.math_constrain=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"VALUE",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0",c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"LOW",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"-math.huge";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"HIGH",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"math.huge";return["math.min(math.max("+b+", "+c+"), "+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]}; module$exports$Blockly$Lua.luaGenerator.math_random_int=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"FROM",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TO",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0";return["math.random("+b+", "+a+")",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};module$exports$Blockly$Lua.luaGenerator.math_random_float=function(a){return["math.random()",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]}; module$exports$Blockly$Lua.luaGenerator.math_atan2=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"X",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0";return["math.deg(math.atan2("+(module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"Y",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0")+", "+b+"))",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]};var module$exports$Blockly$Lua$loops={},module$contents$Blockly$Lua$loops_stringUtils=$.module$build$src$core$utils$string,module$contents$Blockly$Lua$loops_NameType=$.NameType$$module$build$src$core$names,module$contents$Blockly$Lua$loops_CONTINUE_STATEMENT="goto continue\n",module$contents$Blockly$Lua$loops_addContinueLabel=function(a){return-1!==a.indexOf(module$contents$Blockly$Lua$loops_CONTINUE_STATEMENT)?a+module$exports$Blockly$Lua.luaGenerator.INDENT+"::continue::\n":a}; module$exports$Blockly$Lua.luaGenerator.controls_repeat_ext=function(a){let b;b=a.getField("TIMES")?String(Number(a.getFieldValue("TIMES"))):module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TIMES",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0";b=$.module$build$src$core$utils$string.isNumber(b)?parseInt(b,10):"math.floor("+b+")";let c=module$exports$Blockly$Lua.luaGenerator.statementToCode(a,"DO");c=module$exports$Blockly$Lua.luaGenerator.addLoopTrap(c,a);c=module$contents$Blockly$Lua$loops_addContinueLabel(c); return"for "+module$exports$Blockly$Lua.luaGenerator.nameDB_.getDistinctName("count",$.NameType$$module$build$src$core$names.VARIABLE)+" = 1, "+b+" do\n"+c+"end\n"};module$exports$Blockly$Lua.luaGenerator.controls_repeat=module$exports$Blockly$Lua.luaGenerator.controls_repeat_ext; module$exports$Blockly$Lua.luaGenerator.controls_whileUntil=function(a){const b="UNTIL"===a.getFieldValue("MODE");let c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"BOOL",b?module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY:module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"false",d=module$exports$Blockly$Lua.luaGenerator.statementToCode(a,"DO");d=module$exports$Blockly$Lua.luaGenerator.addLoopTrap(d,a);d=module$contents$Blockly$Lua$loops_addContinueLabel(d);b&&(c="not "+c);return"while "+ c+" do\n"+d+"end\n"}; module$exports$Blockly$Lua.luaGenerator.controls_for=function(a){const b=module$exports$Blockly$Lua.luaGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE),c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"FROM",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0",d=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"TO",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"0",e=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"BY", module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"1";let f=module$exports$Blockly$Lua.luaGenerator.statementToCode(a,"DO");f=module$exports$Blockly$Lua.luaGenerator.addLoopTrap(f,a);f=module$contents$Blockly$Lua$loops_addContinueLabel(f);a="";let g;$.module$build$src$core$utils$string.isNumber(c)&&$.module$build$src$core$utils$string.isNumber(d)&&$.module$build$src$core$utils$string.isNumber(e)?g=(Number(c)<=Number(d)?"":"-")+Math.abs(Number(e)):(a="",g=module$exports$Blockly$Lua.luaGenerator.nameDB_.getDistinctName(b+ "_inc",$.NameType$$module$build$src$core$names.VARIABLE),a+=g+" = ",a=$.module$build$src$core$utils$string.isNumber(e)?a+(Math.abs(e)+"\n"):a+("math.abs("+e+")\n"),a=a+("if ("+c+") > ("+d+") then\n")+(module$exports$Blockly$Lua.luaGenerator.INDENT+g+" = -"+g+"\n"),a+="end\n");return a+("for "+b+" = "+c+", "+d+", "+g)+(" do\n"+f+"end\n")}; module$exports$Blockly$Lua.luaGenerator.controls_forEach=function(a){const b=module$exports$Blockly$Lua.luaGenerator.nameDB_.getName(a.getFieldValue("VAR"),$.NameType$$module$build$src$core$names.VARIABLE),c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"LIST",module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"{}";let d=module$exports$Blockly$Lua.luaGenerator.statementToCode(a,"DO");d=module$exports$Blockly$Lua.luaGenerator.addLoopTrap(d,a);d=module$contents$Blockly$Lua$loops_addContinueLabel(d); return"for _, "+b+" in ipairs("+c+") do \n"+d+"end\n"}; module$exports$Blockly$Lua.luaGenerator.controls_flow_statements=function(a){let b="";module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX&&(b+=module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX,a));module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX&&(b+=module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX,a));if(module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX){const c=a.getSurroundLoop(); c&&!c.suppressPrefixSuffix&&(b+=module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX,c))}switch(a.getFieldValue("FLOW")){case "BREAK":return b+"break\n";case "CONTINUE":return b+module$contents$Blockly$Lua$loops_CONTINUE_STATEMENT}throw Error("Unknown flow statement.");};var module$exports$Blockly$Lua$logic={}; module$exports$Blockly$Lua.luaGenerator.controls_if=function(a){var b=0;let c="";module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX&&(c+=module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_PREFIX,a));do{const d=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"IF"+b,module$exports$Blockly$Lua.luaGenerator.ORDER_NONE)||"false";let e=module$exports$Blockly$Lua.luaGenerator.statementToCode(a,"DO"+b);module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX&&(e= module$exports$Blockly$Lua.luaGenerator.prefixLines(module$exports$Blockly$Lua.luaGenerator.injectId(module$exports$Blockly$Lua.luaGenerator.STATEMENT_SUFFIX,a),module$exports$Blockly$Lua.luaGenerator.INDENT)+e);c+=(0",GTE:">="}[a.getFieldValue("OP")],c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"A",module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL)||"0";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"B",module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL)||"0";return[c+" "+b+" "+a,module$exports$Blockly$Lua.luaGenerator.ORDER_RELATIONAL]}; module$exports$Blockly$Lua.luaGenerator.logic_operation=function(a){const b="AND"===a.getFieldValue("OP")?"and":"or",c="and"===b?module$exports$Blockly$Lua.luaGenerator.ORDER_AND:module$exports$Blockly$Lua.luaGenerator.ORDER_OR;let d=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"A",c);a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"B",c);if(d||a){const e="and"===b?"true":"false";d||(d=e);a||(a=e)}else a=d="false";return[d+" "+b+" "+a,c]}; module$exports$Blockly$Lua.luaGenerator.logic_negate=function(a){return["not "+(module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"BOOL",module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY)||"true"),module$exports$Blockly$Lua.luaGenerator.ORDER_UNARY]};module$exports$Blockly$Lua.luaGenerator.logic_boolean=function(a){return["TRUE"===a.getFieldValue("BOOL")?"true":"false",module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC]}; module$exports$Blockly$Lua.luaGenerator.logic_null=function(a){return["nil",module$exports$Blockly$Lua.luaGenerator.ORDER_ATOMIC]}; module$exports$Blockly$Lua.luaGenerator.logic_ternary=function(a){const b=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"IF",module$exports$Blockly$Lua.luaGenerator.ORDER_AND)||"false",c=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"THEN",module$exports$Blockly$Lua.luaGenerator.ORDER_AND)||"nil";a=module$exports$Blockly$Lua.luaGenerator.valueToCode(a,"ELSE",module$exports$Blockly$Lua.luaGenerator.ORDER_OR)||"nil";return[b+" and "+c+" or "+a,module$exports$Blockly$Lua.luaGenerator.ORDER_OR]};var module$exports$Blockly$Lua$lists={},module$contents$Blockly$Lua$lists_NameType=$.NameType$$module$build$src$core$names;module$exports$Blockly$Lua.luaGenerator.lists_create_empty=function(a){return["{}",module$exports$Blockly$Lua.luaGenerator.ORDER_HIGH]}; module$exports$Blockly$Lua.luaGenerator.lists_create_with=function(a){const b=Array(a.itemCount_);for(let c=0;c