mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-03-14 18:00:50 +00:00
17 lines
No EOL
103 KiB
JavaScript
17 lines
No EOL
103 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92552,(e,t,r)=>{"use strict";let n,s;function i(e,t){return t.reduce((e,[t,r])=>({type:"BinaryExpression",operator:t,left:e,right:r}),e)}function o(e,t){return{type:"UnaryExpression",operator:e,argument:t}}class a extends SyntaxError{constructor(e,t,r,n){super(e),this.expected=t,this.found=r,this.location=n,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let r=null,n=e.find(e=>e.source===this.location.source);n&&(r=n.text.split(/\r\n|\n|\r/g));let s=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(s):s,o=this.location.source+":"+i.line+":"+i.column;if(r){let e=this.location.end,n="".padEnd(i.line.toString().length," "),a=r[s.line-1],l=(s.line===e.line?e.column:a.length+1)-s.column||1;t+="\n --> "+o+"\n"+n+" |\n"+i.line+" | "+a+"\n"+n+" | "+"".padEnd(s.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+o}return t}static buildMessage(e,t){function r(e){return e.codePointAt(0).toString(16).toUpperCase()}let n=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function s(e){return n?e.replace(n,e=>"\\u{"+r(e)+"}"):e}function i(e){return s(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}function o(e){return s(e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}let a={literal:e=>'"'+i(e.text)+'"',class(e){let t=e.parts.map(e=>Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return a[e.type](e)}return"Expected "+function(e){let t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let r=1;r<t.length;r++)t[r-1]!==t[r]&&(t[e]=t[r],e++);t.length=e}switch(t.length){case 1:return t[0];case 2:return t[0]+" or "+t[1];default:return t.slice(0,-1).join(", ")+", or "+t[t.length-1]}}(e)+" but "+(t?'"'+i(t)+'"':"end of input")+" found."}}t.exports={StartRules:["Program"],SyntaxError:a,parse:function(e,t){let r,l={},u=(t=void 0!==t?t:{}).grammarSource,c={Program:tL},p=tL,f="package",h="function",d="datablock",m="else",g="while",b="switch$",y="switch",$="case",A="default",x="return",C="break",S="continue",v="parent",w="true",E="false",_=/^[<>]/,k=/^[+\-]/,R=/^[%*\/]/,N=/^[!\-~]/,L=/^[a-zA-Z_]/,O=/^[a-zA-Z0-9_]/,I=/^[ \t]/,j=/^[^"\\\n\r]/,M=/^[^'\\\n\r]/,B=/^[0-9a-fA-F]/,T=/^[0-9]/,P=/^[xX]/,H=/^[^\n\r]/,D=/^[\n\r]/,F=/^[ \t\n\r]/,G=tE(";",!1),q=tE("package",!1),J=tE("{",!1),U=tE("}",!1),W=tE("function",!1),K=tE("(",!1),z=tE(")",!1),Z=tE("::",!1),V=tE(",",!1),Q=tE("datablock",!1),X=tE(":",!1),Y=tE("new",!1),ee=tE("[",!1),et=tE("]",!1),er=tE("=",!1),en=tE(".",!1),es=tE("if",!1),ei=tE("else",!1),eo=tE("for",!1),ea=tE("while",!1),el=tE("do",!1),eu=tE("switch$",!1),ec=tE("switch",!1),ep=tE("case",!1),ef=tE("default",!1),eh=tE("or",!1),ed=tE("return",!1),em=tE("break",!1),eg=tE("continue",!1),eb=tE("+=",!1),ey=tE("-=",!1),e$=tE("*=",!1),eA=tE("/=",!1),ex=tE("%=",!1),eC=tE("<<=",!1),eS=tE(">>=",!1),ev=tE("&=",!1),ew=tE("|=",!1),eE=tE("^=",!1),e_=tE("?",!1),ek=tE("||",!1),eR=tE("&&",!1),eN=tE("|",!1),eL=tE("^",!1),eO=tE("&",!1),eI=tE("==",!1),ej=tE("!=",!1),eM=tE("<=",!1),eB=tE(">=",!1),eT=t_(["<",">"],!1,!1,!1),eP=tE("$=",!1),eH=tE("!$=",!1),eD=tE("@",!1),eF=tE("NL",!1),eG=tE("TAB",!1),eq=tE("SPC",!1),eJ=tE("<<",!1),eU=tE(">>",!1),eW=t_(["+","-"],!1,!1,!1),eK=t_(["%","*","/"],!1,!1,!1),ez=t_(["!","-","~"],!1,!1,!1),eZ=tE("++",!1),eV=tE("--",!1),eQ=tE("*",!1),eX=tE("%",!1),eY=t_([["a","z"],["A","Z"],"_"],!1,!1,!1),e0=t_([["a","z"],["A","Z"],["0","9"],"_"],!1,!1,!1),e1=tE("$",!1),e2=tE("parent",!1),e4=t_([" "," "],!1,!1,!1),e3=tE('"',!1),e9=tE("'",!1),e5=tE("\\",!1),e6=t_(['"',"\\","\n","\r"],!0,!1,!1),e8=t_(["'","\\","\n","\r"],!0,!1,!1),e7=tE("n",!1),te=tE("r",!1),tt=tE("t",!1),tr=tE("x",!1),tn=t_([["0","9"],["a","f"],["A","F"]],!1,!1,!1),ts=tE("cr",!1),ti=tE("cp",!1),to=tE("co",!1),ta=tE("c",!1),tl=t_([["0","9"]],!1,!1,!1),tu={type:"any"},tc=tE("0",!1),tp=t_(["x","X"],!1,!1,!1),tf=tE("-",!1),th=tE("true",!1),td=tE("false",!1),tm=tE("//",!1),tg=t_(["\n","\r"],!0,!1,!1),tb=t_(["\n","\r"],!1,!1,!1),ty=tE("/*",!1),t$=tE("*/",!1),tA=t_([" "," ","\n","\r"],!1,!1,!1),tx=0|t.peg$currPos,tC=[{line:1,column:1}],tS=tx,tv=t.peg$maxFailExpected||[],tw=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in c))throw Error("Can't start parsing from rule \""+t.startRule+'".');p=c[t.startRule]}function tE(e,t){return{type:"literal",text:e,ignoreCase:t}}function t_(e,t,r,n){return{type:"class",parts:e,inverted:t,ignoreCase:r,unicode:n}}function tk(t){let r,n=tC[t];if(n)return n;if(t>=tC.length)r=tC.length-1;else for(r=t;!tC[--r];);for(n={line:(n=tC[r]).line,column:n.column};r<t;)10===e.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return tC[t]=n,n}function tR(e,t,r){let n=tk(e),s=tk(t),i={source:u,start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:s.line,column:s.column}};return r&&u&&"function"==typeof u.offset&&(i.start=u.offset(i.start),i.end=u.offset(i.end)),i}function tN(e){tx<tS||(tx>tS&&(tS=tx,tv=[]),tv.push(e))}function tL(){let e,t,r;for(rp(),e=[],t=tx,(r=rl())===l&&(r=tO()),r!==l?t=r=[r,rp()]:(tx=t,t=l);t!==l;)e.push(t),t=tx,(r=rl())===l&&(r=tO()),r!==l?t=r=[r,rp()]:(tx=t,t=l);return{type:"Program",body:e.map(([e])=>e).filter(Boolean),execScriptPaths:Array.from(n),hasDynamicExec:s}}function tO(){let t,r,n,s,i,o,a,u,c,p,d,$,A,v,w,E,_;return(t=function(){let t,r,n,s,i,o,a,u;if(t=tx,e.substr(tx,7)===f?(r=f,tx+=7):(r=l,0===tw&&tN(q)),r!==l)if(rc()!==l)if((n=rn())!==l)if(ru(),123===e.charCodeAt(tx)?(s="{",tx++):(s=l,0===tw&&tN(J)),s!==l){for(rp(),i=[],o=tx,(a=rl())===l&&(a=tO()),a!==l?o=a=[a,u=rp()]:(tx=o,o=l);o!==l;)i.push(o),o=tx,(a=rl())===l&&(a=tO()),a!==l?o=a=[a,u=rp()]:(tx=o,o=l);(125===e.charCodeAt(tx)?(o="}",tx++):(o=l,0===tw&&tN(U)),o!==l)?(a=ru(),59===e.charCodeAt(tx)?(u=";",tx++):(u=l,0===tw&&tN(G)),u===l&&(u=null),t={type:"PackageDeclaration",name:n,body:i.map(([e])=>e).filter(Boolean)}):(tx=t,t=l)}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a;if(t=tx,e.substr(tx,8)===h?(r=h,tx+=8):(r=l,0===tw&&tN(W)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s;if(t=tx,(r=rn())!==l)if("::"===e.substr(tx,2)?(n="::",tx+=2):(n=l,0===tw&&tN(Z)),n!==l)if((s=rn())!==l)t={type:"MethodName",namespace:r,method:s};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t===l&&(t=rn()),t}())!==l)if(ru(),40===e.charCodeAt(tx)?(s="(",tx++):(s=l,0===tw&&tN(K)),s!==l)if(ru(),(i=function(){let t,r,n,s,i,o,a,u;if(t=tx,(r=rn())!==l){for(n=[],s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=rn())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=rn())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);t=[r,...n.map(([,,,e])=>e)]}else tx=t,t=l;return t}())===l&&(i=null),ru(),41===e.charCodeAt(tx)?(o=")",tx++):(o=l,0===tw&&tN(z)),o!==l)if(ru(),(a=tF())!==l)t={type:"FunctionDeclaration",name:n,params:i||[],body:a};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&((n=tx,(s=tI())!==l)?(ru(),59===e.charCodeAt(tx)?(i=";",tx++):(i=l,0===tw&&tN(G)),i===l&&(i=null),ru(),n=s):(tx=n,n=l),(t=n)===l&&((o=tx,(a=tj())!==l)?(ru(),59===e.charCodeAt(tx)?(u=";",tx++):(u=l,0===tw&&tN(G)),u===l&&(u=null),ru(),o=a):(tx=o,o=l),(t=o)===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p,f;if(t=tx,"if"===e.substr(tx,2)?(r="if",tx+=2):(r=l,0===tw&&tN(es)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(i=")",tx++):(i=l,0===tw&&tN(z)),i!==l)if(ru(),(o=tO())!==l){var h;a=tx,u=ru(),e.substr(tx,4)===m?(c=m,tx+=4):(c=l,0===tw&&tN(ei)),c!==l?(p=ru(),(f=tO())!==l?a=u=[u,c,p,f]:(tx=a,a=l)):(tx=a,a=l),a===l&&(a=null),t={type:"IfStatement",test:s,consequent:o,alternate:(h=a)?h[3]:null}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p;if(t=tx,"for"===e.substr(tx,3)?(r="for",tx+=3):(r=l,0===tw&&tN(eo)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())===l&&(s=null),ru(),59===e.charCodeAt(tx)?(i=";",tx++):(i=l,0===tw&&tN(G)),i!==l)if(ru(),(o=tG())===l&&(o=null),ru(),59===e.charCodeAt(tx)?(a=";",tx++):(a=l,0===tw&&tN(G)),a!==l)if(ru(),(u=tG())===l&&(u=null),ru(),41===e.charCodeAt(tx)?(c=")",tx++):(c=l,0===tw&&tN(z)),c!==l)if(ru(),(p=tO())!==l){var f,h;f=s,h=o,t={type:"ForStatement",init:f,test:h,update:u,body:p}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u;if(t=tx,"do"===e.substr(tx,2)?(r="do",tx+=2):(r=l,0===tw&&tN(el)),r!==l)if(ru(),(n=tO())!==l)if(ru(),e.substr(tx,5)===g?(s=g,tx+=5):(s=l,0===tw&&tN(ea)),s!==l)if(ru(),40===e.charCodeAt(tx)?(i="(",tx++):(i=l,0===tw&&tN(K)),i!==l)if(ru(),(o=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(a=")",tx++):(a=l,0===tw&&tN(z)),a!==l)ru(),59===e.charCodeAt(tx)?(u=";",tx++):(u=l,0===tw&&tN(G)),u===l&&(u=null),t={type:"DoWhileStatement",test:o,body:n};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o;if(t=tx,e.substr(tx,5)===g?(r=g,tx+=5):(r=l,0===tw&&tN(ea)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(i=")",tx++):(i=l,0===tw&&tN(z)),i!==l)if(ru(),(o=tO())!==l)t={type:"WhileStatement",test:s,body:o};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p;if(t=tx,e.substr(tx,7)===b?(r=b,tx+=7):(r=l,0===tw&&tN(eu)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(i=")",tx++):(i=l,0===tw&&tN(z)),i!==l)if(ru(),123===e.charCodeAt(tx)?(o="{",tx++):(o=l,0===tw&&tN(J)),o!==l){for(rp(),a=[],u=tx,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tx=u,u=l);u!==l;)a.push(u),u=tx,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tx=u,u=l);(125===e.charCodeAt(tx)?(u="}",tx++):(u=l,0===tw&&tN(U)),u!==l)?t={type:"SwitchStatement",stringMode:!0,discriminant:s,cases:a.map(([e])=>e).filter(e=>e&&"SwitchCase"===e.type)}:(tx=t,t=l)}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;if(t===l)if(t=tx,e.substr(tx,6)===y?(r=y,tx+=6):(r=l,0===tw&&tN(ec)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(i=")",tx++):(i=l,0===tw&&tN(z)),i!==l)if(ru(),123===e.charCodeAt(tx)?(o="{",tx++):(o=l,0===tw&&tN(J)),o!==l){for(rp(),a=[],u=tx,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tx=u,u=l);u!==l;)a.push(u),u=tx,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tx=u,u=l);(125===e.charCodeAt(tx)?(u="}",tx++):(u=l,0===tw&&tN(U)),u!==l)?t={type:"SwitchStatement",stringMode:!1,discriminant:s,cases:a.map(([e])=>e).filter(e=>e&&"SwitchCase"===e.type)}:(tx=t,t=l)}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i;if(t=tx,e.substr(tx,6)===x?(r=x,tx+=6):(r=l,0===tw&&tN(ed)),r!==l)if(n=tx,(s=rc())!==l&&(i=tG())!==l?n=s=[s,i]:(tx=n,n=l),n===l&&(n=null),s=ru(),59===e.charCodeAt(tx)?(i=";",tx++):(i=l,0===tw&&tN(G)),i!==l){var o;t={type:"ReturnStatement",value:(o=n)?o[1]:null}}else tx=t,t=l;else tx=t,t=l;return t}())===l&&(c=tx,e.substr(tx,5)===C?(p=C,tx+=5):(p=l,0===tw&&tN(em)),p!==l?(ru(),59===e.charCodeAt(tx)?(d=";",tx++):(d=l,0===tw&&tN(G)),d!==l?c={type:"BreakStatement"}:(tx=c,c=l)):(tx=c,c=l),(t=c)===l&&($=tx,e.substr(tx,8)===S?(A=S,tx+=8):(A=l,0===tw&&tN(eg)),A!==l?(ru(),59===e.charCodeAt(tx)?(v=";",tx++):(v=l,0===tw&&tN(G)),v!==l?$={type:"ContinueStatement"}:(tx=$,$=l)):(tx=$,$=l),(t=$)===l&&((w=tx,(E=tG())!==l&&(ru(),59===e.charCodeAt(tx)?(_=";",tx++):(_=l,0===tw&&tN(G)),_!==l))?w={type:"ExpressionStatement",expression:E}:(tx=w,w=l),(t=w)===l&&(t=tF())===l&&(t=rl())===l)))))&&(t=tx,ru(),59===e.charCodeAt(tx)?(r=";",tx++):(r=l,0===tw&&tN(G)),r!==l?(ru(),t=null):(tx=t,t=l)),t}function tI(){let t,r,n,s,i,o,a,u,c,p,f,h,m,g;if(t=tx,e.substr(tx,9)===d?(r=d,tx+=9):(r=l,0===tw&&tN(Q)),r!==l)if(rc()!==l)if((n=rn())!==l)if(ru(),40===e.charCodeAt(tx)?(s="(",tx++):(s=l,0===tw&&tN(K)),s!==l)if(ru(),(i=tB())===l&&(i=null),ru(),41===e.charCodeAt(tx)?(o=")",tx++):(o=l,0===tw&&tN(z)),o!==l){var b,y,$;if(ru(),a=tx,58===e.charCodeAt(tx)?(u=":",tx++):(u=l,0===tw&&tN(X)),u!==l?(c=ru(),(p=rn())!==l?a=u=[u,c,p]:(tx=a,a=l)):(tx=a,a=l),a===l&&(a=null),u=ru(),c=tx,123===e.charCodeAt(tx)?(p="{",tx++):(p=l,0===tw&&tN(J)),p!==l){for(f=ru(),h=[],m=tM();m!==l;)h.push(m),m=tM();m=ru(),125===e.charCodeAt(tx)?(g="}",tx++):(g=l,0===tw&&tN(U)),g!==l?c=p=[p,f,h,m,g,ru()]:(tx=c,c=l)}else tx=c,c=l;c===l&&(c=null),b=i,y=a,$=c,t={type:"DatablockDeclaration",className:n,instanceName:b,parent:y?y[2]:null,body:$?$[2].filter(Boolean):[]}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}function tj(){let t,r,n,s,i,o,a,u,c,p,f,h;if(t=tx,"new"===e.substr(tx,3)?(r="new",tx+=3):(r=l,0===tw&&tN(Y)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s,i,o,a,u,c,p;if((t=tx,40===e.charCodeAt(tx)?(r="(",tx++):(r=l,0===tw&&tN(K)),r!==l&&(n=ru(),(s=tG())!==l&&(i=ru(),41===e.charCodeAt(tx)?(o=")",tx++):(o=l,0===tw&&tN(z)),o!==l)))?t=s:(tx=t,t=l),t===l)if(t=tx,(r=rn())!==l){var f;for(n=[],s=tx,i=ru(),91===e.charCodeAt(tx)?(o="[",tx++):(o=l,0===tw&&tN(ee)),o!==l?(a=ru(),(u=tH())!==l?(c=ru(),93===e.charCodeAt(tx)?(p="]",tx++):(p=l,0===tw&&tN(et)),p!==l?s=i=[i,o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),91===e.charCodeAt(tx)?(o="[",tx++):(o=l,0===tw&&tN(ee)),o!==l?(a=ru(),(u=tH())!==l?(c=ru(),93===e.charCodeAt(tx)?(p="]",tx++):(p=l,0===tw&&tN(et)),p!==l?s=i=[i,o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);f=r,t=n.reduce((e,[,,,t])=>({type:"IndexExpression",object:e,index:t}),f)}else tx=t,t=l;return t}())!==l)if(ru(),40===e.charCodeAt(tx)?(s="(",tx++):(s=l,0===tw&&tN(K)),s!==l)if(ru(),(i=tB())===l&&(i=null),ru(),41===e.charCodeAt(tx)?(o=")",tx++):(o=l,0===tw&&tN(z)),o!==l){var d;if(ru(),a=tx,123===e.charCodeAt(tx)?(u="{",tx++):(u=l,0===tw&&tN(J)),u!==l){for(c=ru(),p=[],f=tM();f!==l;)p.push(f),f=tM();f=ru(),125===e.charCodeAt(tx)?(h="}",tx++):(h=l,0===tw&&tN(U)),h!==l?a=u=[u,c,p,f,h,ru()]:(tx=a,a=l)}else tx=a,a=l;a===l&&(a=null),t={type:"ObjectDeclaration",className:n,instanceName:i,body:(d=a)?d[2].filter(Boolean):[]}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}function tM(){let t,r,n;return(t=tx,(r=tj())!==l)?(ru(),59===e.charCodeAt(tx)?(n=";",tx++):(n=l,0===tw&&tN(G)),n===l&&(n=null),ru(),t=r):(tx=t,t=l),t===l&&((t=tx,(r=tI())!==l)?(ru(),59===e.charCodeAt(tx)?(n=";",tx++):(n=l,0===tw&&tN(G)),n===l&&(n=null),ru(),t=r):(tx=t,t=l),t===l&&(t=function(){let t,r,n,s,i;if(t=tx,ru(),(r=tT())!==l)if(ru(),61===e.charCodeAt(tx)?(n="=",tx++):(n=l,0===tw&&tN(er)),n!==l)if(ru(),(s=tG())!==l)ru(),59===e.charCodeAt(tx)?(i=";",tx++):(i=l,0===tw&&tN(G)),i===l&&(i=null),ru(),t={type:"Assignment",target:r,value:s};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=rl())===l&&(t=function(){let t,r;if(t=[],r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA)),r!==l)for(;r!==l;)t.push(r),r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA));else t=l;return t!==l&&(t=null),t}())),t}function tB(){let e;return(e=tY())===l&&(e=rn())===l&&(e=ra()),e}function tT(){let e,t,r,n;if(e=tx,(t=t8())!==l){for(r=[],n=tP();n!==l;)r.push(n),n=tP();e=r.reduce((e,t)=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},t)}else tx=e,e=l;return e}function tP(){let t,r,n,s;return(t=tx,46===e.charCodeAt(tx)?(r=".",tx++):(r=l,0===tw&&tN(en)),r!==l&&(ru(),(n=rn())!==l))?t={type:"property",value:n}:(tx=t,t=l),t===l&&((t=tx,91===e.charCodeAt(tx)?(r="[",tx++):(r=l,0===tw&&tN(ee)),r!==l&&(ru(),(n=tH())!==l&&(ru(),93===e.charCodeAt(tx)?(s="]",tx++):(s=l,0===tw&&tN(et)),s!==l)))?t={type:"index",value:n}:(tx=t,t=l)),t}function tH(){let t,r,n,s,i,o,a,u;if(t=tx,(r=tG())!==l){for(n=[],s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);t=n.length>0?[r,...n.map(([,,,e])=>e)]:r}else tx=t,t=l;return t}function tD(){let t,r,n,s,i,o,a,u,c;if(t=tx,e.substr(tx,4)===$?(r=$,tx+=4):(r=l,0===tw&&tN(ep)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s,i,o,a,u;if(t=tx,(r=t3())!==l){for(n=[],s=tx,i=ru(),"or"===e.substr(tx,2)?(o="or",tx+=2):(o=l,0===tw&&tN(eh)),o!==l&&(a=rc())!==l&&(u=t3())!==l?s=i=[i,o,a,u]:(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),"or"===e.substr(tx,2)?(o="or",tx+=2):(o=l,0===tw&&tN(eh)),o!==l&&(a=rc())!==l&&(u=t3())!==l?s=i=[i,o,a,u]:(tx=s,s=l);t=n.length>0?[r,...n.map(([,,,e])=>e)]:r}else tx=t,t=l;return t}())!==l)if(ru(),58===e.charCodeAt(tx)?(s=":",tx++):(s=l,0===tw&&tN(X)),s!==l){for(i=rp(),o=[],a=tx,(u=rl())===l&&(u=tO()),u!==l?a=u=[u,c=rp()]:(tx=a,a=l);a!==l;)o.push(a),a=tx,(u=rl())===l&&(u=tO()),u!==l?a=u=[u,c=rp()]:(tx=a,a=l);t={type:"SwitchCase",test:n,consequent:o.map(([e])=>e).filter(Boolean)}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;if(t===l)if(t=tx,e.substr(tx,7)===A?(r=A,tx+=7):(r=l,0===tw&&tN(ef)),r!==l)if(ru(),58===e.charCodeAt(tx)?(n=":",tx++):(n=l,0===tw&&tN(X)),n!==l){for(rp(),s=[],i=tx,(o=rl())===l&&(o=tO()),o!==l?i=o=[o,a=rp()]:(tx=i,i=l);i!==l;)s.push(i),i=tx,(o=rl())===l&&(o=tO()),o!==l?i=o=[o,a=rp()]:(tx=i,i=l);t={type:"SwitchCase",test:null,consequent:s.map(([e])=>e).filter(Boolean)}}else tx=t,t=l;else tx=t,t=l;return t}function tF(){let t,r,n,s,i,o;if(t=tx,123===e.charCodeAt(tx)?(r="{",tx++):(r=l,0===tw&&tN(J)),r!==l){for(rp(),n=[],s=tx,(i=rl())===l&&(i=tO()),i!==l?s=i=[i,o=rp()]:(tx=s,s=l);s!==l;)n.push(s),s=tx,(i=rl())===l&&(i=tO()),i!==l?s=i=[i,o=rp()]:(tx=s,s=l);(125===e.charCodeAt(tx)?(s="}",tx++):(s=l,0===tw&&tN(U)),s!==l)?t={type:"BlockStatement",body:n.map(([e])=>e).filter(Boolean)}:(tx=t,t=l)}else tx=t,t=l;return t}function tG(){let t,r,n,s;if(t=tx,(r=tT())!==l)if(ru(),(n=tq())!==l)if(ru(),(s=tG())!==l)t={type:"AssignmentExpression",operator:n,target:r,value:s};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t===l&&(t=function(){let t,r,n,s,i,o;if(t=tx,(r=tJ())!==l)if(ru(),63===e.charCodeAt(tx)?(n="?",tx++):(n=l,0===tw&&tN(e_)),n!==l)if(ru(),(s=tG())!==l)if(ru(),58===e.charCodeAt(tx)?(i=":",tx++):(i=l,0===tw&&tN(X)),i!==l)if(ru(),(o=tG())!==l)t={type:"ConditionalExpression",test:r,consequent:s,alternate:o};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t===l&&(t=tJ()),t}()),t}function tq(){let t;return 61===e.charCodeAt(tx)?(t="=",tx++):(t=l,0===tw&&tN(er)),t===l&&("+="===e.substr(tx,2)?(t="+=",tx+=2):(t=l,0===tw&&tN(eb)),t===l&&("-="===e.substr(tx,2)?(t="-=",tx+=2):(t=l,0===tw&&tN(ey)),t===l&&("*="===e.substr(tx,2)?(t="*=",tx+=2):(t=l,0===tw&&tN(e$)),t===l&&("/="===e.substr(tx,2)?(t="/=",tx+=2):(t=l,0===tw&&tN(eA)),t===l&&("%="===e.substr(tx,2)?(t="%=",tx+=2):(t=l,0===tw&&tN(ex)),t===l&&("<<="===e.substr(tx,3)?(t="<<=",tx+=3):(t=l,0===tw&&tN(eC)),t===l&&(">>="===e.substr(tx,3)?(t=">>=",tx+=3):(t=l,0===tw&&tN(eS)),t===l&&("&="===e.substr(tx,2)?(t="&=",tx+=2):(t=l,0===tw&&tN(ev)),t===l&&("|="===e.substr(tx,2)?(t="|=",tx+=2):(t=l,0===tw&&tN(ew)),t===l&&("^="===e.substr(tx,2)?(t="^=",tx+=2):(t=l,0===tw&&tN(eE)))))))))))),t}function tJ(){let t,r,n,s,o,a,u,c;if(t=tx,(r=tU())!==l){for(n=[],s=tx,o=ru(),"||"===e.substr(tx,2)?(a="||",tx+=2):(a=l,0===tw&&tN(ek)),a!==l?(u=ru(),(c=tU())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),"||"===e.substr(tx,2)?(a="||",tx+=2):(a=l,0===tw&&tN(ek)),a!==l?(u=ru(),(c=tU())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function tU(){let t,r,n,s,o,a,u,c;if(t=tx,(r=tW())!==l){for(n=[],s=tx,o=ru(),"&&"===e.substr(tx,2)?(a="&&",tx+=2):(a=l,0===tw&&tN(eR)),a!==l?(u=ru(),(c=tW())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),"&&"===e.substr(tx,2)?(a="&&",tx+=2):(a=l,0===tw&&tN(eR)),a!==l?(u=ru(),(c=tW())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function tW(){let t,r,n,s,o,a,u,c,p;if(t=tx,(r=tK())!==l){for(n=[],s=tx,o=ru(),124===e.charCodeAt(tx)?(a="|",tx++):(a=l,0===tw&&tN(eN)),a!==l?(u=tx,tw++,124===e.charCodeAt(tx)?(c="|",tx++):(c=l,0===tw&&tN(eN)),tw--,c===l?u=void 0:(tx=u,u=l),u!==l?(c=ru(),(p=tK())!==l?s=o=[o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),124===e.charCodeAt(tx)?(a="|",tx++):(a=l,0===tw&&tN(eN)),a!==l?(u=tx,tw++,124===e.charCodeAt(tx)?(c="|",tx++):(c=l,0===tw&&tN(eN)),tw--,c===l?u=void 0:(tx=u,u=l),u!==l?(c=ru(),(p=tK())!==l?s=o=[o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,,t])=>[e,t]))}else tx=t,t=l;return t}function tK(){let t,r,n,s,o,a,u,c;if(t=tx,(r=tz())!==l){for(n=[],s=tx,o=ru(),94===e.charCodeAt(tx)?(a="^",tx++):(a=l,0===tw&&tN(eL)),a!==l?(u=ru(),(c=tz())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),94===e.charCodeAt(tx)?(a="^",tx++):(a=l,0===tw&&tN(eL)),a!==l?(u=ru(),(c=tz())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function tz(){let t,r,n,s,o,a,u,c,p;if(t=tx,(r=tZ())!==l){for(n=[],s=tx,o=ru(),38===e.charCodeAt(tx)?(a="&",tx++):(a=l,0===tw&&tN(eO)),a!==l?(u=tx,tw++,38===e.charCodeAt(tx)?(c="&",tx++):(c=l,0===tw&&tN(eO)),tw--,c===l?u=void 0:(tx=u,u=l),u!==l?(c=ru(),(p=tZ())!==l?s=o=[o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),38===e.charCodeAt(tx)?(a="&",tx++):(a=l,0===tw&&tN(eO)),a!==l?(u=tx,tw++,38===e.charCodeAt(tx)?(c="&",tx++):(c=l,0===tw&&tN(eO)),tw--,c===l?u=void 0:(tx=u,u=l),u!==l?(c=ru(),(p=tZ())!==l?s=o=[o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,,t])=>[e,t]))}else tx=t,t=l;return t}function tZ(){let e,t,r,n,s,o,a,u;if(e=tx,(t=tQ())!==l){for(r=[],n=tx,s=ru(),(o=tV())!==l?(a=ru(),(u=tQ())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);n!==l;)r.push(n),n=tx,s=ru(),(o=tV())!==l?(a=ru(),(u=tQ())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tx=e,e=l;return e}function tV(){let t;return"=="===e.substr(tx,2)?(t="==",tx+=2):(t=l,0===tw&&tN(eI)),t===l&&("!="===e.substr(tx,2)?(t="!=",tx+=2):(t=l,0===tw&&tN(ej))),t}function tQ(){let e,t,r,n,s,o,a,u;if(e=tx,(t=tY())!==l){for(r=[],n=tx,s=ru(),(o=tX())!==l?(a=ru(),(u=tY())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);n!==l;)r.push(n),n=tx,s=ru(),(o=tX())!==l?(a=ru(),(u=tY())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tx=e,e=l;return e}function tX(){let t;return"<="===e.substr(tx,2)?(t="<=",tx+=2):(t=l,0===tw&&tN(eM)),t===l&&(">="===e.substr(tx,2)?(t=">=",tx+=2):(t=l,0===tw&&tN(eB)),t===l&&(t=e.charAt(tx),_.test(t)?tx++:(t=l,0===tw&&tN(eT)))),t}function tY(){let e,t,r,n,s,o,a,u;if(e=tx,(t=t2())!==l){for(r=[],n=tx,s=ru(),(o=t1())!==l?(a=ru(),(u=t0())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);n!==l;)r.push(n),n=tx,s=ru(),(o=t1())!==l?(a=ru(),(u=t0())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tx=e,e=l;return e}function t0(){let e,t,r,n;if(e=tx,(t=tT())!==l)if(ru(),(r=tq())!==l)if(ru(),(n=tG())!==l)e={type:"AssignmentExpression",operator:r,target:t,value:n};else tx=e,e=l;else tx=e,e=l;else tx=e,e=l;return e===l&&(e=t2()),e}function t1(){let t;return"$="===e.substr(tx,2)?(t="$=",tx+=2):(t=l,0===tw&&tN(eP)),t===l&&("!$="===e.substr(tx,3)?(t="!$=",tx+=3):(t=l,0===tw&&tN(eH)),t===l&&(64===e.charCodeAt(tx)?(t="@",tx++):(t=l,0===tw&&tN(eD)),t===l&&("NL"===e.substr(tx,2)?(t="NL",tx+=2):(t=l,0===tw&&tN(eF)),t===l&&("TAB"===e.substr(tx,3)?(t="TAB",tx+=3):(t=l,0===tw&&tN(eG)),t===l&&("SPC"===e.substr(tx,3)?(t="SPC",tx+=3):(t=l,0===tw&&tN(eq))))))),t}function t2(){let e,t,r,n,s,o,a,u;if(e=tx,(t=t3())!==l){for(r=[],n=tx,s=ru(),(o=t4())!==l?(a=ru(),(u=t3())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);n!==l;)r.push(n),n=tx,s=ru(),(o=t4())!==l?(a=ru(),(u=t3())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tx=e,e=l;return e}function t4(){let t;return"<<"===e.substr(tx,2)?(t="<<",tx+=2):(t=l,0===tw&&tN(eJ)),t===l&&(">>"===e.substr(tx,2)?(t=">>",tx+=2):(t=l,0===tw&&tN(eU))),t}function t3(){let t,r,n,s,o,a,u,c;if(t=tx,(r=t9())!==l){for(n=[],s=tx,o=ru(),a=e.charAt(tx),k.test(a)?tx++:(a=l,0===tw&&tN(eW)),a!==l?(u=ru(),(c=t9())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),a=e.charAt(tx),k.test(a)?tx++:(a=l,0===tw&&tN(eW)),a!==l?(u=ru(),(c=t9())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function t9(){let t,r,n,s,o,a,u,c;if(t=tx,(r=t5())!==l){for(n=[],s=tx,o=ru(),a=e.charAt(tx),R.test(a)?tx++:(a=l,0===tw&&tN(eK)),a!==l?(u=ru(),(c=t5())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),a=e.charAt(tx),R.test(a)?tx++:(a=l,0===tw&&tN(eK)),a!==l?(u=ru(),(c=t5())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function t5(){let t,r,n;return(t=tx,r=e.charAt(tx),N.test(r)?tx++:(r=l,0===tw&&tN(ez)),r!==l&&(ru(),(n=t6())!==l))?t=o(r,n):(tx=t,t=l),t===l&&((t=tx,"++"===e.substr(tx,2)?(r="++",tx+=2):(r=l,0===tw&&tN(eZ)),r===l&&("--"===e.substr(tx,2)?(r="--",tx+=2):(r=l,0===tw&&tN(eV))),r!==l&&(ru(),(n=t6())!==l))?t=o(r,n):(tx=t,t=l),t===l&&((t=tx,42===e.charCodeAt(tx)?(r="*",tx++):(r=l,0===tw&&tN(eQ)),r!==l&&(ru(),(n=t6())!==l))?t={type:"TagDereferenceExpression",argument:n}:(tx=t,t=l),t===l&&(t=function(){let t,r,n;if(t=tx,(r=t8())!==l)if(ru(),"++"===e.substr(tx,2)?(n="++",tx+=2):(n=l,0===tw&&tN(eZ)),n===l&&("--"===e.substr(tx,2)?(n="--",tx+=2):(n=l,0===tw&&tN(eV))),n!==l)t={type:"PostfixExpression",operator:n,argument:r};else tx=t,t=l;else tx=t,t=l;return t===l&&(t=t8()),t}()))),t}function t6(){let e,t,r,n;if(e=tx,(t=tT())!==l)if(ru(),(r=tq())!==l)if(ru(),(n=tG())!==l)e={type:"AssignmentExpression",operator:r,target:t,value:n};else tx=e,e=l;else tx=e,e=l;else tx=e,e=l;return e===l&&(e=t5()),e}function t8(){let t,r,i,o,a,u,c,p,f,h;if(t=tx,(r=function(){let t,r,n,s,i,o,a,u,c,p,f,h,d,m,g,b;if(t=tx,(a=tj())===l&&(a=tI())===l&&(a=function(){let t,r,n,s;if(t=tx,34===e.charCodeAt(tx)?(r='"',tx++):(r=l,0===tw&&tN(e3)),r!==l){for(n=[],s=rs();s!==l;)n.push(s),s=rs();(34===e.charCodeAt(tx)?(s='"',tx++):(s=l,0===tw&&tN(e3)),s!==l)?t={type:"StringLiteral",value:n.join("")}:(tx=t,t=l)}else tx=t,t=l;if(t===l)if(t=tx,39===e.charCodeAt(tx)?(r="'",tx++):(r=l,0===tw&&tN(e9)),r!==l){for(n=[],s=ri();s!==l;)n.push(s),s=ri();(39===e.charCodeAt(tx)?(s="'",tx++):(s=l,0===tw&&tN(e9)),s!==l)?t={type:"StringLiteral",value:n.join(""),tagged:!0}:(tx=t,t=l)}else tx=t,t=l;return t}())===l&&(a=ra())===l&&((u=tx,e.substr(tx,4)===w?(c=w,tx+=4):(c=l,0===tw&&tN(th)),c===l&&(e.substr(tx,5)===E?(c=E,tx+=5):(c=l,0===tw&&tN(td))),c!==l&&(p=tx,tw++,f=rh(),tw--,f===l?p=void 0:(tx=p,p=l),p!==l))?u={type:"BooleanLiteral",value:"true"===c}:(tx=u,u=l),(a=u)===l&&((h=re())===l&&(h=rt())===l&&(h=rr()),(a=h)===l))&&((d=tx,40===e.charCodeAt(tx)?(m="(",tx++):(m=l,0===tw&&tN(K)),m!==l&&(ru(),(g=tG())!==l&&(ru(),41===e.charCodeAt(tx)?(b=")",tx++):(b=l,0===tw&&tN(z)),b!==l)))?d=g:(tx=d,d=l),a=d),(r=a)!==l){for(n=[],s=tx,i=ru(),(o=tP())!==l?s=i=[i,o]:(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),(o=tP())!==l?s=i=[i,o]:(tx=s,s=l);t=n.reduce((e,[,t])=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},r)}else tx=t,t=l;return t}())!==l){for(i=[],o=tx,a=ru(),40===e.charCodeAt(tx)?(u="(",tx++):(u=l,0===tw&&tN(K)),u!==l?(c=ru(),(p=t7())===l&&(p=null),f=ru(),41===e.charCodeAt(tx)?(h=")",tx++):(h=l,0===tw&&tN(z)),h!==l?o=a=[a,u,c,p,f,h]:(tx=o,o=l)):(tx=o,o=l),o===l&&(o=tx,a=ru(),(u=tP())!==l?o=a=[a,u]:(tx=o,o=l));o!==l;)i.push(o),o=tx,a=ru(),40===e.charCodeAt(tx)?(u="(",tx++):(u=l,0===tw&&tN(K)),u!==l?(c=ru(),(p=t7())===l&&(p=null),f=ru(),41===e.charCodeAt(tx)?(h=")",tx++):(h=l,0===tw&&tN(z)),h!==l?o=a=[a,u,c,p,f,h]:(tx=o,o=l)):(tx=o,o=l),o===l&&(o=tx,a=ru(),(u=tP())!==l?o=a=[a,u]:(tx=o,o=l));t=i.reduce((e,t)=>{if("("===t[1]){var r;let[,,,i]=t;return r=i||[],"Identifier"===e.type&&"exec"===e.name.toLowerCase()&&(r.length>0&&"StringLiteral"===r[0].type?n.add(r[0].value):s=!0),{type:"CallExpression",callee:e,arguments:r}}let i=t[1];return"property"===i.type?{type:"MemberExpression",object:e,property:i.value}:{type:"IndexExpression",object:e,index:i.value}},r)}else tx=t,t=l;return t}function t7(){let t,r,n,s,i,o,a,u;if(t=tx,(r=tG())!==l){for(n=[],s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);t=[r,...n.map(([,,,e])=>e)]}else tx=t,t=l;return t}function re(){let t,r,n,s,i,o,a;if(t=tx,37===e.charCodeAt(tx)?(r="%",tx++):(r=l,0===tw&&tN(eX)),r!==l){if(n=tx,s=tx,i=e.charAt(tx),L.test(i)?tx++:(i=l,0===tw&&tN(eY)),i!==l){for(o=[],a=e.charAt(tx),O.test(a)?tx++:(a=l,0===tw&&tN(e0));a!==l;)o.push(a),a=e.charAt(tx),O.test(a)?tx++:(a=l,0===tw&&tN(e0));s=i=[i,o]}else tx=s,s=l;(n=s!==l?e.substring(n,tx):s)!==l?t={type:"Variable",scope:"local",name:n}:(tx=t,t=l)}else tx=t,t=l;return t}function rt(){let t,r,n,s,i,o,a,u,c,p,f,h,d;if(t=tx,36===e.charCodeAt(tx)?(r="$",tx++):(r=l,0===tw&&tN(e1)),r!==l){if(n=tx,s=tx,"::"===e.substr(tx,2)?(i="::",tx+=2):(i=l,0===tw&&tN(Z)),i===l&&(i=null),o=e.charAt(tx),L.test(o)?tx++:(o=l,0===tw&&tN(eY)),o!==l){for(a=[],u=e.charAt(tx),O.test(u)?tx++:(u=l,0===tw&&tN(e0));u!==l;)a.push(u),u=e.charAt(tx),O.test(u)?tx++:(u=l,0===tw&&tN(e0));if(u=[],c=tx,"::"===e.substr(tx,2)?(p="::",tx+=2):(p=l,0===tw&&tN(Z)),p!==l)if(f=e.charAt(tx),L.test(f)?tx++:(f=l,0===tw&&tN(eY)),f!==l){for(h=[],d=e.charAt(tx),O.test(d)?tx++:(d=l,0===tw&&tN(e0));d!==l;)h.push(d),d=e.charAt(tx),O.test(d)?tx++:(d=l,0===tw&&tN(e0));c=p=[p,f,h]}else tx=c,c=l;else tx=c,c=l;for(;c!==l;)if(u.push(c),c=tx,"::"===e.substr(tx,2)?(p="::",tx+=2):(p=l,0===tw&&tN(Z)),p!==l)if(f=e.charAt(tx),L.test(f)?tx++:(f=l,0===tw&&tN(eY)),f!==l){for(h=[],d=e.charAt(tx),O.test(d)?tx++:(d=l,0===tw&&tN(e0));d!==l;)h.push(d),d=e.charAt(tx),O.test(d)?tx++:(d=l,0===tw&&tN(e0));c=p=[p,f,h]}else tx=c,c=l;else tx=c,c=l;s=i=[i,o,a,u]}else tx=s,s=l;(n=s!==l?e.substring(n,tx):s)!==l?t={type:"Variable",scope:"global",name:n}:(tx=t,t=l)}else tx=t,t=l;return t}function rr(){let t,r,n,s,i,o,a,u,c,p,f;if(t=tx,r=tx,n=tx,e.substr(tx,6)===v?(s=v,tx+=6):(s=l,0===tw&&tN(e2)),s!==l){for(i=[],o=e.charAt(tx),I.test(o)?tx++:(o=l,0===tw&&tN(e4));o!==l;)i.push(o),o=e.charAt(tx),I.test(o)?tx++:(o=l,0===tw&&tN(e4));if("::"===e.substr(tx,2)?(o="::",tx+=2):(o=l,0===tw&&tN(Z)),o!==l){for(a=[],u=e.charAt(tx),I.test(u)?tx++:(u=l,0===tw&&tN(e4));u!==l;)a.push(u),u=e.charAt(tx),I.test(u)?tx++:(u=l,0===tw&&tN(e4));if(u=e.charAt(tx),L.test(u)?tx++:(u=l,0===tw&&tN(eY)),u!==l){for(c=[],p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));p!==l;)c.push(p),p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));n=s=[s,i,o,a,u,c]}else tx=n,n=l}else tx=n,n=l}else tx=n,n=l;if((r=n!==l?e.substring(r,tx):n)!==l&&(r={type:"Identifier",name:r.replace(/\s+/g,"")}),(t=r)===l){if(t=tx,r=tx,n=tx,e.substr(tx,6)===v?(s=v,tx+=6):(s=l,0===tw&&tN(e2)),s!==l){if(i=[],o=tx,"::"===e.substr(tx,2)?(a="::",tx+=2):(a=l,0===tw&&tN(Z)),a!==l)if(u=e.charAt(tx),L.test(u)?tx++:(u=l,0===tw&&tN(eY)),u!==l){for(c=[],p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));p!==l;)c.push(p),p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));o=a=[a,u,c]}else tx=o,o=l;else tx=o,o=l;if(o!==l)for(;o!==l;)if(i.push(o),o=tx,"::"===e.substr(tx,2)?(a="::",tx+=2):(a=l,0===tw&&tN(Z)),a!==l)if(u=e.charAt(tx),L.test(u)?tx++:(u=l,0===tw&&tN(eY)),u!==l){for(c=[],p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));p!==l;)c.push(p),p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));o=a=[a,u,c]}else tx=o,o=l;else tx=o,o=l;else i=l;i!==l?n=s=[s,i]:(tx=n,n=l)}else tx=n,n=l;if((r=n!==l?e.substring(r,tx):n)!==l&&(r={type:"Identifier",name:r}),(t=r)===l){if(t=tx,r=tx,n=tx,s=e.charAt(tx),L.test(s)?tx++:(s=l,0===tw&&tN(eY)),s!==l){for(i=[],o=e.charAt(tx),O.test(o)?tx++:(o=l,0===tw&&tN(e0));o!==l;)i.push(o),o=e.charAt(tx),O.test(o)?tx++:(o=l,0===tw&&tN(e0));if(o=[],a=tx,"::"===e.substr(tx,2)?(u="::",tx+=2):(u=l,0===tw&&tN(Z)),u!==l)if(c=e.charAt(tx),L.test(c)?tx++:(c=l,0===tw&&tN(eY)),c!==l){for(p=[],f=e.charAt(tx),O.test(f)?tx++:(f=l,0===tw&&tN(e0));f!==l;)p.push(f),f=e.charAt(tx),O.test(f)?tx++:(f=l,0===tw&&tN(e0));a=u=[u,c,p]}else tx=a,a=l;else tx=a,a=l;for(;a!==l;)if(o.push(a),a=tx,"::"===e.substr(tx,2)?(u="::",tx+=2):(u=l,0===tw&&tN(Z)),u!==l)if(c=e.charAt(tx),L.test(c)?tx++:(c=l,0===tw&&tN(eY)),c!==l){for(p=[],f=e.charAt(tx),O.test(f)?tx++:(f=l,0===tw&&tN(e0));f!==l;)p.push(f),f=e.charAt(tx),O.test(f)?tx++:(f=l,0===tw&&tN(e0));a=u=[u,c,p]}else tx=a,a=l;else tx=a,a=l;n=s=[s,i,o]}else tx=n,n=l;(r=n!==l?e.substring(r,tx):n)!==l&&(r={type:"Identifier",name:r}),t=r}}return t}function rn(){let e;return(e=re())===l&&(e=rt())===l&&(e=rr()),e}function rs(){let t,r,n;return(t=tx,92===e.charCodeAt(tx)?(r="\\",tx++):(r=l,0===tw&&tN(e5)),r!==l&&(n=ro())!==l)?t=n:(tx=t,t=l),t===l&&(t=e.charAt(tx),j.test(t)?tx++:(t=l,0===tw&&tN(e6))),t}function ri(){let t,r,n;return(t=tx,92===e.charCodeAt(tx)?(r="\\",tx++):(r=l,0===tw&&tN(e5)),r!==l&&(n=ro())!==l)?t=n:(tx=t,t=l),t===l&&(t=e.charAt(tx),M.test(t)?tx++:(t=l,0===tw&&tN(e8))),t}function ro(){let t,r,n,s,i,o;return t=tx,110===e.charCodeAt(tx)?(r="n",tx++):(r=l,0===tw&&tN(e7)),r!==l&&(r="\n"),(t=r)===l&&(t=tx,114===e.charCodeAt(tx)?(r="r",tx++):(r=l,0===tw&&tN(te)),r!==l&&(r="\r"),(t=r)===l)&&(t=tx,116===e.charCodeAt(tx)?(r="t",tx++):(r=l,0===tw&&tN(tt)),r!==l&&(r=" "),(t=r)===l)&&((t=tx,120===e.charCodeAt(tx)?(r="x",tx++):(r=l,0===tw&&tN(tr)),r!==l&&(n=tx,s=tx,i=e.charAt(tx),B.test(i)?tx++:(i=l,0===tw&&tN(tn)),i!==l?(o=e.charAt(tx),B.test(o)?tx++:(o=l,0===tw&&tN(tn)),o!==l?s=i=[i,o]:(tx=s,s=l)):(tx=s,s=l),(n=s!==l?e.substring(n,tx):s)!==l))?t=String.fromCharCode(parseInt(n,16)):(tx=t,t=l),t===l&&(t=tx,"cr"===e.substr(tx,2)?(r="cr",tx+=2):(r=l,0===tw&&tN(ts)),r!==l&&(r="\x0f"),(t=r)===l&&(t=tx,"cp"===e.substr(tx,2)?(r="cp",tx+=2):(r=l,0===tw&&tN(ti)),r!==l&&(r="\x10"),(t=r)===l))&&(t=tx,"co"===e.substr(tx,2)?(r="co",tx+=2):(r=l,0===tw&&tN(to)),r!==l&&(r="\x11"),(t=r)===l)&&((t=tx,99===e.charCodeAt(tx)?(r="c",tx++):(r=l,0===tw&&tN(ta)),r!==l&&(n=e.charAt(tx),T.test(n)?tx++:(n=l,0===tw&&tN(tl)),n!==l))?t=String.fromCharCode([2,3,4,5,6,7,8,11,12,14][parseInt(n,10)]):(tx=t,t=l),t===l&&(t=tx,e.length>tx?(r=e.charAt(tx),tx++):(r=l,0===tw&&tN(tu)),t=r))),t}function ra(){let t,r,n,s,i,o,a,u,c;if(t=tx,r=tx,n=tx,48===e.charCodeAt(tx)?(s="0",tx++):(s=l,0===tw&&tN(tc)),s!==l)if(i=e.charAt(tx),P.test(i)?tx++:(i=l,0===tw&&tN(tp)),i!==l){if(o=[],a=e.charAt(tx),B.test(a)?tx++:(a=l,0===tw&&tN(tn)),a!==l)for(;a!==l;)o.push(a),a=e.charAt(tx),B.test(a)?tx++:(a=l,0===tw&&tN(tn));else o=l;o!==l?n=s=[s,i,o]:(tx=n,n=l)}else tx=n,n=l;else tx=n,n=l;if((r=n!==l?e.substring(r,tx):n)!==l&&(n=tx,tw++,s=rh(),tw--,s===l?n=void 0:(tx=n,n=l),n!==l)?t={type:"NumberLiteral",value:parseInt(r,16)}:(tx=t,t=l),t===l){if(t=tx,r=tx,n=tx,45===e.charCodeAt(tx)?(s="-",tx++):(s=l,0===tw&&tN(tf)),s===l&&(s=null),i=[],o=e.charAt(tx),T.test(o)?tx++:(o=l,0===tw&&tN(tl)),o!==l)for(;o!==l;)i.push(o),o=e.charAt(tx),T.test(o)?tx++:(o=l,0===tw&&tN(tl));else i=l;if(i!==l){if(o=tx,46===e.charCodeAt(tx)?(a=".",tx++):(a=l,0===tw&&tN(en)),a!==l){if(u=[],c=e.charAt(tx),T.test(c)?tx++:(c=l,0===tw&&tN(tl)),c!==l)for(;c!==l;)u.push(c),c=e.charAt(tx),T.test(c)?tx++:(c=l,0===tw&&tN(tl));else u=l;u!==l?o=a=[a,u]:(tx=o,o=l)}else tx=o,o=l;o===l&&(o=null),n=s=[s,i,o]}else tx=n,n=l;if(n===l)if(n=tx,45===e.charCodeAt(tx)?(s="-",tx++):(s=l,0===tw&&tN(tf)),s===l&&(s=null),46===e.charCodeAt(tx)?(i=".",tx++):(i=l,0===tw&&tN(en)),i!==l){if(o=[],a=e.charAt(tx),T.test(a)?tx++:(a=l,0===tw&&tN(tl)),a!==l)for(;a!==l;)o.push(a),a=e.charAt(tx),T.test(a)?tx++:(a=l,0===tw&&tN(tl));else o=l;o!==l?n=s=[s,i,o]:(tx=n,n=l)}else tx=n,n=l;(r=n!==l?e.substring(r,tx):n)!==l&&(n=tx,tw++,s=rh(),tw--,s===l?n=void 0:(tx=n,n=l),n!==l)?t={type:"NumberLiteral",value:parseFloat(r)}:(tx=t,t=l)}return t}function rl(){let t;return(t=function(){let t,r,n,s,i;if(t=tx,"//"===e.substr(tx,2)?(r="//",tx+=2):(r=l,0===tw&&tN(tm)),r!==l){for(n=tx,s=[],i=e.charAt(tx),H.test(i)?tx++:(i=l,0===tw&&tN(tg));i!==l;)s.push(i),i=e.charAt(tx),H.test(i)?tx++:(i=l,0===tw&&tN(tg));n=e.substring(n,tx),s=e.charAt(tx),D.test(s)?tx++:(s=l,0===tw&&tN(tb)),s===l&&(s=null),t={type:"Comment",value:n}}else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a;if(t=tx,"/*"===e.substr(tx,2)?(r="/*",tx+=2):(r=l,0===tw&&tN(ty)),r!==l){for(n=tx,s=[],i=tx,o=tx,tw++,"*/"===e.substr(tx,2)?(a="*/",tx+=2):(a=l,0===tw&&tN(t$)),tw--,a===l?o=void 0:(tx=o,o=l),o!==l?(e.length>tx?(a=e.charAt(tx),tx++):(a=l,0===tw&&tN(tu)),a!==l?i=o=[o,a]:(tx=i,i=l)):(tx=i,i=l);i!==l;)s.push(i),i=tx,o=tx,tw++,"*/"===e.substr(tx,2)?(a="*/",tx+=2):(a=l,0===tw&&tN(t$)),tw--,a===l?o=void 0:(tx=o,o=l),o!==l?(e.length>tx?(a=e.charAt(tx),tx++):(a=l,0===tw&&tN(tu)),a!==l?i=o=[o,a]:(tx=i,i=l)):(tx=i,i=l);(n=e.substring(n,tx),"*/"===e.substr(tx,2)?(s="*/",tx+=2):(s=l,0===tw&&tN(t$)),s!==l)?t={type:"Comment",value:n}:(tx=t,t=l)}else tx=t,t=l;return t}()),t}function ru(){let t,r;for(t=[],r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA)),r===l&&(r=rf());r!==l;)t.push(r),r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA)),r===l&&(r=rf());return t}function rc(){let t,r,n,s;if(t=tx,r=[],n=e.charAt(tx),F.test(n)?tx++:(n=l,0===tw&&tN(tA)),n!==l)for(;n!==l;)r.push(n),n=e.charAt(tx),F.test(n)?tx++:(n=l,0===tw&&tN(tA));else r=l;if(r!==l){for(n=[],s=e.charAt(tx),F.test(s)?tx++:(s=l,0===tw&&tN(tA)),s===l&&(s=rf());s!==l;)n.push(s),s=e.charAt(tx),F.test(s)?tx++:(s=l,0===tw&&tN(tA)),s===l&&(s=rf());t=r=[r,n]}else tx=t,t=l;return t}function rp(){let t,r;for(t=[],r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA));r!==l;)t.push(r),r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA));return t}function rf(){let t,r,n,s,i,o;if(t=tx,"//"===e.substr(tx,2)?(r="//",tx+=2):(r=l,0===tw&&tN(tm)),r!==l){for(n=[],s=e.charAt(tx),H.test(s)?tx++:(s=l,0===tw&&tN(tg));s!==l;)n.push(s),s=e.charAt(tx),H.test(s)?tx++:(s=l,0===tw&&tN(tg));s=e.charAt(tx),D.test(s)?tx++:(s=l,0===tw&&tN(tb)),s===l&&(s=null),t=r=[r,n,s]}else tx=t,t=l;if(t===l)if(t=tx,"/*"===e.substr(tx,2)?(r="/*",tx+=2):(r=l,0===tw&&tN(ty)),r!==l){for(n=[],s=tx,i=tx,tw++,"*/"===e.substr(tx,2)?(o="*/",tx+=2):(o=l,0===tw&&tN(t$)),tw--,o===l?i=void 0:(tx=i,i=l),i!==l?(e.length>tx?(o=e.charAt(tx),tx++):(o=l,0===tw&&tN(tu)),o!==l?s=i=[i,o]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=tx,tw++,"*/"===e.substr(tx,2)?(o="*/",tx+=2):(o=l,0===tw&&tN(t$)),tw--,o===l?i=void 0:(tx=i,i=l),i!==l?(e.length>tx?(o=e.charAt(tx),tx++):(o=l,0===tw&&tN(tu)),o!==l?s=i=[i,o]:(tx=s,s=l)):(tx=s,s=l);"*/"===e.substr(tx,2)?(s="*/",tx+=2):(s=l,0===tw&&tN(t$)),s!==l?t=r=[r,n,s]:(tx=t,t=l)}else tx=t,t=l;return t}function rh(){let t;return t=e.charAt(tx),O.test(t)?tx++:(t=l,0===tw&&tN(e0)),t}n=new Set,s=!1;let rd=(r=p())!==l&&tx===e.length;function rm(){var t,n,s;throw r!==l&&tx<e.length&&tN({type:"end"}),t=tv,n=tS<e.length?function(t=tx){let r=e.codePointAt(t);return void 0===r?"":String.fromCodePoint(r)}(tS):null,s=tS<e.length?tR(tS,tS+1):tR(tS,tS),new a(a.buildMessage(t,n),t,n,s)}return t.peg$library?{peg$result:r,peg$currPos:tx,peg$FAILED:l,peg$maxFailExpected:tv,peg$maxFailPos:tS,peg$success:rd,peg$throw:rd?void 0:rm}:rd?r:void rm()}}},53487,(e,t,r)=>{"use strict";let n="[^\\\\/]",s="[^/]",i="(?:\\/|$)",o="(?:^|\\/)",a=`\\.{1,2}${i}`,l=`(?!${o}${a})`,u=`(?!\\.{0,1}${i})`,c=`(?!${a})`,p=`${s}*?`,f={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:a,NO_DOT:"(?!\\.)",NO_DOTS:l,NO_DOT_SLASH:u,NO_DOTS_SLASH:c,QMARK_NO_DOT:"[^.\\/]",STAR:p,START_ANCHOR:o,SEP:"/"},h={...f,SLASH_LITERAL:"[\\\\/]",QMARK:n,STAR:`${n}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"};t.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?h:f}},19241,(e,t,r)=>{"use strict";var n=e.i(47167);let{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_GLOBAL:a}=e.r(53487);r.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r.hasRegexChars=e=>o.test(e),r.isRegexChar=e=>1===e.length&&r.hasRegexChars(e),r.escapeRegex=e=>e.replace(a,"\\$1"),r.toPosixSlashes=e=>e.replace(s,"/"),r.isWindows=()=>{if("u">typeof navigator&&navigator.platform){let e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return void 0!==n.default&&!!n.default.platform&&"win32"===n.default.platform},r.removeBackslashes=e=>e.replace(i,e=>"\\"===e?"":e),r.escapeLast=(e,t,n)=>{let s=e.lastIndexOf(t,n);return -1===s?e:"\\"===e[s-1]?r.escapeLast(e,t,s-1):`${e.slice(0,s)}\\${e.slice(s)}`},r.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},r.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${e})${s}`;return!0===t.negated&&(i=`(?:^(?!${i}).*$)`),i},r.basename=(e,{windows:t}={})=>{let r=e.split(t?/[\\/]/:"/"),n=r[r.length-1];return""===n?r[r.length-2]:n}},26094,(e,t,r)=>{"use strict";let n=e.r(19241),{CHAR_ASTERISK:s,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:l,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:p,CHAR_LEFT_PARENTHESES:f,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:d,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:b,CHAR_RIGHT_SQUARE_BRACKET:y}=e.r(53487),$=e=>e===c||e===o,A=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let r,x,C=t||{},S=e.length-1,v=!0===C.parts||!0===C.scanToEnd,w=[],E=[],_=[],k=e,R=-1,N=0,L=0,O=!1,I=!1,j=!1,M=!1,B=!1,T=!1,P=!1,H=!1,D=!1,F=!1,G=0,q={value:"",depth:0,isGlob:!1},J=()=>R>=S,U=()=>k.charCodeAt(R+1),W=()=>(r=x,k.charCodeAt(++R));for(;R<S;){let e;if((x=W())===o){P=q.backslashes=!0,(x=W())===p&&(T=!0);continue}if(!0===T||x===p){for(G++;!0!==J()&&(x=W());){if(x===o){P=q.backslashes=!0,W();continue}if(x===p){G++;continue}if(!0!==T&&x===l&&(x=W())===l||!0!==T&&x===a){if(O=q.isBrace=!0,j=q.isGlob=!0,F=!0,!0===v)continue;break}if(x===g&&0==--G){T=!1,O=q.isBrace=!0,F=!0;break}}if(!0===v)continue;break}if(x===c){if(w.push(R),E.push(q),q={value:"",depth:0,isGlob:!1},!0===F)continue;if(r===l&&R===N+1){N+=2;continue}L=R+1;continue}if(!0!==C.noext&&!0==(x===d||x===i||x===s||x===m||x===u)&&U()===f){if(j=q.isGlob=!0,M=q.isExtglob=!0,F=!0,x===u&&R===N&&(D=!0),!0===v){for(;!0!==J()&&(x=W());){if(x===o){P=q.backslashes=!0,x=W();continue}if(x===b){j=q.isGlob=!0,F=!0;break}}continue}break}if(x===s){if(r===s&&(B=q.isGlobstar=!0),j=q.isGlob=!0,F=!0,!0===v)continue;break}if(x===m){if(j=q.isGlob=!0,F=!0,!0===v)continue;break}if(x===h){for(;!0!==J()&&(e=W());){if(e===o){P=q.backslashes=!0,W();continue}if(e===y){I=q.isBracket=!0,j=q.isGlob=!0,F=!0;break}}if(!0===v)continue;break}if(!0!==C.nonegate&&x===u&&R===N){H=q.negated=!0,N++;continue}if(!0!==C.noparen&&x===f){if(j=q.isGlob=!0,!0===v){for(;!0!==J()&&(x=W());){if(x===f){P=q.backslashes=!0,x=W();continue}if(x===b){F=!0;break}}continue}break}if(!0===j){if(F=!0,!0===v)continue;break}}!0===C.noext&&(M=!1,j=!1);let K=k,z="",Z="";N>0&&(z=k.slice(0,N),k=k.slice(N),L-=N),K&&!0===j&&L>0?(K=k.slice(0,L),Z=k.slice(L)):!0===j?(K="",Z=k):K=k,K&&""!==K&&"/"!==K&&K!==k&&$(K.charCodeAt(K.length-1))&&(K=K.slice(0,-1)),!0===C.unescape&&(Z&&(Z=n.removeBackslashes(Z)),K&&!0===P&&(K=n.removeBackslashes(K)));let V={prefix:z,input:e,start:N,base:K,glob:Z,isBrace:O,isBracket:I,isGlob:j,isExtglob:M,isGlobstar:B,negated:H,negatedExtglob:D};if(!0===C.tokens&&(V.maxDepth=0,$(x)||E.push(q),V.tokens=E),!0===C.parts||!0===C.tokens){let t;for(let r=0;r<w.length;r++){let n=t?t+1:N,s=w[r],i=e.slice(n,s);C.tokens&&(0===r&&0!==N?(E[r].isPrefix=!0,E[r].value=z):E[r].value=i,A(E[r]),V.maxDepth+=E[r].depth),(0!==r||""!==i)&&_.push(i),t=s}if(t&&t+1<e.length){let r=e.slice(t+1);_.push(r),C.tokens&&(E[E.length-1].value=r,A(E[E.length-1]),V.maxDepth+=E[E.length-1].depth)}V.slashes=w,V.parts=_}return V}},17932,(e,t,r)=>{"use strict";let n=e.r(53487),s=e.r(19241),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:l,REPLACEMENTS:u}=n,c=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map(e=>s.escapeRegex(e)).join("..")}return r},p=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,f=(e,t)=>{let r;if("string"!=typeof e)throw TypeError("Expected a string");e=u[e]||e;let h={...t},d="number"==typeof h.maxLength?Math.min(i,h.maxLength):i,m=e.length;if(m>d)throw SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${d}`);let g={type:"bos",value:"",output:h.prepend||""},b=[g],y=h.capture?"":"?:",$=n.globChars(h.windows),A=n.extglobChars($),{DOT_LITERAL:x,PLUS_LITERAL:C,SLASH_LITERAL:S,ONE_CHAR:v,DOTS_SLASH:w,NO_DOT:E,NO_DOT_SLASH:_,NO_DOTS_SLASH:k,QMARK:R,QMARK_NO_DOT:N,STAR:L,START_ANCHOR:O}=$,I=e=>`(${y}(?:(?!${O}${e.dot?w:x}).)*?)`,j=h.dot?"":E,M=h.dot?R:N,B=!0===h.bash?I(h):L;h.capture&&(B=`(${B})`),"boolean"==typeof h.noext&&(h.noextglob=h.noext);let T={input:e,index:-1,start:0,dot:!0===h.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};m=(e=s.removePrefix(e,T)).length;let P=[],H=[],D=[],F=g,G=()=>T.index===m-1,q=T.peek=(t=1)=>e[T.index+t],J=T.advance=()=>e[++T.index]||"",U=()=>e.slice(T.index+1),W=(e="",t=0)=>{T.consumed+=e,T.index+=t},K=e=>{T.output+=null!=e.output?e.output:e.value,W(e.value)},z=()=>{let e=1;for(;"!"===q()&&("("!==q(2)||"?"===q(3));)J(),T.start++,e++;return e%2!=0&&(T.negated=!0,T.start++,!0)},Z=e=>{T[e]++,D.push(e)},V=e=>{T[e]--,D.pop()},Q=e=>{if("globstar"===F.type){let t=T.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||P.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(T.output=T.output.slice(0,-F.output.length),F.type="star",F.value="*",F.output=B,T.output+=F.output)}if(P.length&&"paren"!==e.type&&(P[P.length-1].inner+=e.value),(e.value||e.output)&&K(e),F&&"text"===F.type&&"text"===e.type){F.output=(F.output||F.value)+e.value,F.value+=e.value;return}e.prev=F,b.push(e),F=e},X=(e,t)=>{let r={...A[t],conditions:1,inner:""};r.prev=F,r.parens=T.parens,r.output=T.output;let n=(h.capture?"(":"")+r.open;Z("parens"),Q({type:e,value:t,output:T.output?"":v}),Q({type:"paren",extglob:!0,value:J(),output:n}),P.push(r)},Y=e=>{let n,s=e.close+(h.capture?")":"");if("negate"===e.type){let r=B;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=I(h)),(r!==B||G()||/^\)+$/.test(U()))&&(s=e.close=`)$))${r}`),e.inner.includes("*")&&(n=U())&&/^\.[^\\/.]+$/.test(n)){let i=f(n,{...t,fastpaths:!1}).output;s=e.close=`)${i})${r})`}"bos"===e.prev.type&&(T.negatedExtglob=!0)}Q({type:"paren",extglob:!0,value:r,output:s}),V("parens")};if(!1!==h.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let r=!1,n=e.replace(l,(e,t,n,s,i,o)=>"\\"===s?(r=!0,e):"?"===s?t?t+s+(i?R.repeat(i.length):""):0===o?M+(i?R.repeat(i.length):""):R.repeat(n.length):"."===s?x.repeat(n.length):"*"===s?t?t+s+(i?B:""):B:t?e:`\\${e}`);return(!0===r&&(n=!0===h.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===e&&!0===h.contains)?T.output=e:T.output=s.wrapOutput(n,T,t),T}for(;!G();){if("\0"===(r=J()))continue;if("\\"===r){let e=q();if("/"===e&&!0!==h.bash||"."===e||";"===e)continue;if(!e){Q({type:"text",value:r+="\\"});continue}let t=/^\\+/.exec(U()),n=0;if(t&&t[0].length>2&&(n=t[0].length,T.index+=n,n%2!=0&&(r+="\\")),!0===h.unescape?r=J():r+=J(),0===T.brackets){Q({type:"text",value:r});continue}}if(T.brackets>0&&("]"!==r||"["===F.value||"[^"===F.value)){if(!1!==h.posix&&":"===r){let e=F.value.slice(1);if(e.includes("[")&&(F.posix=!0,e.includes(":"))){let e=F.value.lastIndexOf("["),t=F.value.slice(0,e),r=o[F.value.slice(e+2)];if(r){F.value=t+r,T.backtrack=!0,J(),g.output||1!==b.indexOf(F)||(g.output=v);continue}}}("["===r&&":"!==q()||"-"===r&&"]"===q())&&(r=`\\${r}`),"]"===r&&("["===F.value||"[^"===F.value)&&(r=`\\${r}`),!0===h.posix&&"!"===r&&"["===F.value&&(r="^"),F.value+=r,K({value:r});continue}if(1===T.quotes&&'"'!==r){r=s.escapeRegex(r),F.value+=r,K({value:r});continue}if('"'===r){T.quotes=+(1!==T.quotes),!0===h.keepQuotes&&Q({type:"text",value:r});continue}if("("===r){Z("parens"),Q({type:"paren",value:r});continue}if(")"===r){if(0===T.parens&&!0===h.strictBrackets)throw SyntaxError(p("opening","("));let e=P[P.length-1];if(e&&T.parens===e.parens+1){Y(P.pop());continue}Q({type:"paren",value:r,output:T.parens?")":"\\)"}),V("parens");continue}if("["===r){if(!0!==h.nobracket&&U().includes("]"))Z("brackets");else{if(!0!==h.nobracket&&!0===h.strictBrackets)throw SyntaxError(p("closing","]"));r=`\\${r}`}Q({type:"bracket",value:r});continue}if("]"===r){if(!0===h.nobracket||F&&"bracket"===F.type&&1===F.value.length){Q({type:"text",value:r,output:`\\${r}`});continue}if(0===T.brackets){if(!0===h.strictBrackets)throw SyntaxError(p("opening","["));Q({type:"text",value:r,output:`\\${r}`});continue}V("brackets");let e=F.value.slice(1);if(!0===F.posix||"^"!==e[0]||e.includes("/")||(r=`/${r}`),F.value+=r,K({value:r}),!1===h.literalBrackets||s.hasRegexChars(e))continue;let t=s.escapeRegex(F.value);if(T.output=T.output.slice(0,-F.value.length),!0===h.literalBrackets){T.output+=t,F.value=t;continue}F.value=`(${y}${t}|${F.value})`,T.output+=F.value;continue}if("{"===r&&!0!==h.nobrace){Z("braces");let e={type:"brace",value:r,output:"(",outputIndex:T.output.length,tokensIndex:T.tokens.length};H.push(e),Q(e);continue}if("}"===r){let e=H[H.length-1];if(!0===h.nobrace||!e){Q({type:"text",value:r,output:r});continue}let t=")";if(!0===e.dots){let e=b.slice(),r=[];for(let t=e.length-1;t>=0&&(b.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&r.unshift(e[t].value);t=c(r,h),T.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){let n=T.output.slice(0,e.outputIndex),s=T.tokens.slice(e.tokensIndex);for(let i of(e.value=e.output="\\{",r=t="\\}",T.output=n,s))T.output+=i.output||i.value}Q({type:"brace",value:r,output:t}),V("braces"),H.pop();continue}if("|"===r){P.length>0&&P[P.length-1].conditions++,Q({type:"text",value:r});continue}if(","===r){let e=r,t=H[H.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),Q({type:"comma",value:r,output:e});continue}if("/"===r){if("dot"===F.type&&T.index===T.start+1){T.start=T.index+1,T.consumed="",T.output="",b.pop(),F=g;continue}Q({type:"slash",value:r,output:S});continue}if("."===r){if(T.braces>0&&"dot"===F.type){"."===F.value&&(F.output=x);let e=H[H.length-1];F.type="dots",F.output+=r,F.value+=r,e.dots=!0;continue}if(T.braces+T.parens===0&&"bos"!==F.type&&"slash"!==F.type){Q({type:"text",value:r,output:x});continue}Q({type:"dot",value:r,output:x});continue}if("?"===r){if(!(F&&"("===F.value)&&!0!==h.noextglob&&"("===q()&&"?"!==q(2)){X("qmark",r);continue}if(F&&"paren"===F.type){let e=q(),t=r;("("!==F.value||/[!=<:]/.test(e))&&("<"!==e||/<([!=]|\w+>)/.test(U()))||(t=`\\${r}`),Q({type:"text",value:r,output:t});continue}if(!0!==h.dot&&("slash"===F.type||"bos"===F.type)){Q({type:"qmark",value:r,output:N});continue}Q({type:"qmark",value:r,output:R});continue}if("!"===r){if(!0!==h.noextglob&&"("===q()&&("?"!==q(2)||!/[!=<:]/.test(q(3)))){X("negate",r);continue}if(!0!==h.nonegate&&0===T.index){z();continue}}if("+"===r){if(!0!==h.noextglob&&"("===q()&&"?"!==q(2)){X("plus",r);continue}if(F&&"("===F.value||!1===h.regex){Q({type:"plus",value:r,output:C});continue}if(F&&("bracket"===F.type||"paren"===F.type||"brace"===F.type)||T.parens>0){Q({type:"plus",value:r});continue}Q({type:"plus",value:C});continue}if("@"===r){if(!0!==h.noextglob&&"("===q()&&"?"!==q(2)){Q({type:"at",extglob:!0,value:r,output:""});continue}Q({type:"text",value:r});continue}if("*"!==r){("$"===r||"^"===r)&&(r=`\\${r}`);let e=a.exec(U());e&&(r+=e[0],T.index+=e[0].length),Q({type:"text",value:r});continue}if(F&&("globstar"===F.type||!0===F.star)){F.type="star",F.star=!0,F.value+=r,F.output=B,T.backtrack=!0,T.globstar=!0,W(r);continue}let t=U();if(!0!==h.noextglob&&/^\([^?]/.test(t)){X("star",r);continue}if("star"===F.type){if(!0===h.noglobstar){W(r);continue}let n=F.prev,s=n.prev,i="slash"===n.type||"bos"===n.type,o=s&&("star"===s.type||"globstar"===s.type);if(!0===h.bash&&(!i||t[0]&&"/"!==t[0])){Q({type:"star",value:r,output:""});continue}let a=T.braces>0&&("comma"===n.type||"brace"===n.type),l=P.length&&("pipe"===n.type||"paren"===n.type);if(!i&&"paren"!==n.type&&!a&&!l){Q({type:"star",value:r,output:""});continue}for(;"/**"===t.slice(0,3);){let r=e[T.index+4];if(r&&"/"!==r)break;t=t.slice(3),W("/**",3)}if("bos"===n.type&&G()){F.type="globstar",F.value+=r,F.output=I(h),T.output=F.output,T.globstar=!0,W(r);continue}if("slash"===n.type&&"bos"!==n.prev.type&&!o&&G()){T.output=T.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type="globstar",F.output=I(h)+(h.strictSlashes?")":"|$)"),F.value+=r,T.globstar=!0,T.output+=n.output+F.output,W(r);continue}if("slash"===n.type&&"bos"!==n.prev.type&&"/"===t[0]){let e=void 0!==t[1]?"|$":"";T.output=T.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type="globstar",F.output=`${I(h)}${S}|${S}${e})`,F.value+=r,T.output+=n.output+F.output,T.globstar=!0,W(r+J()),Q({type:"slash",value:"/",output:""});continue}if("bos"===n.type&&"/"===t[0]){F.type="globstar",F.value+=r,F.output=`(?:^|${S}|${I(h)}${S})`,T.output=F.output,T.globstar=!0,W(r+J()),Q({type:"slash",value:"/",output:""});continue}T.output=T.output.slice(0,-F.output.length),F.type="globstar",F.output=I(h),F.value+=r,T.output+=F.output,T.globstar=!0,W(r);continue}let n={type:"star",value:r,output:B};if(!0===h.bash){n.output=".*?",("bos"===F.type||"slash"===F.type)&&(n.output=j+n.output),Q(n);continue}if(F&&("bracket"===F.type||"paren"===F.type)&&!0===h.regex){n.output=r,Q(n);continue}(T.index===T.start||"slash"===F.type||"dot"===F.type)&&("dot"===F.type?(T.output+=_,F.output+=_):!0===h.dot?(T.output+=k,F.output+=k):(T.output+=j,F.output+=j),"*"!==q()&&(T.output+=v,F.output+=v)),Q(n)}for(;T.brackets>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing","]"));T.output=s.escapeLast(T.output,"["),V("brackets")}for(;T.parens>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing",")"));T.output=s.escapeLast(T.output,"("),V("parens")}for(;T.braces>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing","}"));T.output=s.escapeLast(T.output,"{"),V("braces")}if(!0!==h.strictSlashes&&("star"===F.type||"bracket"===F.type)&&Q({type:"maybe_slash",value:"",output:`${S}?`}),!0===T.backtrack)for(let e of(T.output="",T.tokens))T.output+=null!=e.output?e.output:e.value,e.suffix&&(T.output+=e.suffix);return T};f.fastpaths=(e,t)=>{let r={...t},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>o)throw SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=u[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:p,DOTS_SLASH:f,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:m,STAR:g,START_ANCHOR:b}=n.globChars(r.windows),y=r.dot?d:h,$=r.dot?m:h,A=r.capture?"":"?:",x=!0===r.bash?".*?":g;r.capture&&(x=`(${x})`);let C=e=>!0===e.noglobstar?x:`(${A}(?:(?!${b}${e.dot?f:l}).)*?)`,S=e=>{switch(e){case"*":return`${y}${p}${x}`;case".*":return`${l}${p}${x}`;case"*.*":return`${y}${x}${l}${p}${x}`;case"*/*":return`${y}${x}${c}${p}${$}${x}`;case"**":return y+C(r);case"**/*":return`(?:${y}${C(r)}${c})?${$}${p}${x}`;case"**/*.*":return`(?:${y}${C(r)}${c})?${$}${x}${l}${p}${x}`;case"**/.*":return`(?:${y}${C(r)}${c})?${l}${p}${x}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let r=S(t[1]);if(!r)return;return r+l+t[2]}}},v=S(s.removePrefix(e,{negated:!1,prefix:""}));return v&&!0!==r.strictSlashes&&(v+=`${c}?`),v},t.exports=f},53174,(e,t,r)=>{"use strict";let n=e.r(26094),s=e.r(17932),i=e.r(19241),o=e.r(53487),a=(e,t,r=!1)=>{if(Array.isArray(e)){let n=e.map(e=>a(e,t,r));return e=>{for(let t of n){let r=t(e);if(r)return r}return!1}}let n=e&&"object"==typeof e&&!Array.isArray(e)&&e.tokens&&e.input;if(""===e||"string"!=typeof e&&!n)throw TypeError("Expected pattern to be a non-empty string");let s=t||{},i=s.windows,o=n?a.compileRe(e,t):a.makeRe(e,t,!1,!0),l=o.state;delete o.state;let u=()=>!1;if(s.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=a(s.ignore,e,r)}let c=(r,n=!1)=>{let{isMatch:c,match:p,output:f}=a.test(r,o,t,{glob:e,posix:i}),h={glob:e,state:l,regex:o,posix:i,input:r,output:f,match:p,isMatch:c};return("function"==typeof s.onResult&&s.onResult(h),!1===c)?(h.isMatch=!1,!!n&&h):u(r)?("function"==typeof s.onIgnore&&s.onIgnore(h),h.isMatch=!1,!!n&&h):("function"==typeof s.onMatch&&s.onMatch(h),!n||h)};return r&&(c.state=l),c};a.test=(e,t,r,{glob:n,posix:s}={})=>{if("string"!=typeof e)throw TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};let o=r||{},l=o.format||(s?i.toPosixSlashes:null),u=e===n,c=u&&l?l(e):e;return!1===u&&(u=(c=l?l(e):e)===n),(!1===u||!0===o.capture)&&(u=!0===o.matchBase||!0===o.basename?a.matchBase(e,t,r,s):t.exec(c)),{isMatch:!!u,match:u,output:c}},a.matchBase=(e,t,r)=>(t instanceof RegExp?t:a.makeRe(t,r)).test(i.basename(e)),a.isMatch=(e,t,r)=>a(t,r)(e),a.parse=(e,t)=>Array.isArray(e)?e.map(e=>a.parse(e,t)):s(e,{...t,fastpaths:!1}),a.scan=(e,t)=>n(e,t),a.compileRe=(e,t,r=!1,n=!1)=>{if(!0===r)return e.output;let s=t||{},i=s.contains?"":"^",o=s.contains?"":"$",l=`${i}(?:${e.output})${o}`;e&&!0===e.negated&&(l=`^(?!${l}).*$`);let u=a.toRegex(l,t);return!0===n&&(u.state=e),u},a.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||"string"!=typeof e)throw TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1!==t.fastpaths&&("."===e[0]||"*"===e[0])&&(i.output=s.fastpaths(e,t)),i.output||(i=s(e,t)),a.compileRe(i,t,r,n)},a.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=o,t.exports=a},54970,(e,t,r)=>{"use strict";let n=e.r(53174),s=e.r(19241);function i(e,t,r=!1){return t&&(null===t.windows||void 0===t.windows)&&(t={...t,windows:s.isWindows()}),n(e,t,r)}Object.assign(i,n),t.exports=i},62395,33870,38433,86608,e=>{"use strict";e.s(["parse",()=>B,"runServer",()=>H],86608);var t=e.i(92552);function r(e){let t=e.indexOf("::");return -1===t?null:{namespace:e.slice(0,t),method:e.slice(t+2)}}let n={"+":"$.add","-":"$.sub","*":"$.mul","/":"$.div","<":"$.lt","<=":"$.le",">":"$.gt",">=":"$.ge","==":"$.eq","!=":"$.ne","%":"$.mod","&":"$.bitand","|":"$.bitor","^":"$.bitxor","<<":"$.shl",">>":"$.shr"};class s{indent;runtime;functions;globals;locals;indentLevel=0;currentClass=null;currentFunction=null;constructor(e={}){this.indent=e.indent??" ",this.runtime=e.runtime??"$",this.functions=e.functions??"$f",this.globals=e.globals??"$g",this.locals=e.locals??"$l"}getAccessInfo(e){if("Variable"===e.type){let t=JSON.stringify(e.name),r="global"===e.scope?this.globals:this.locals;return{getter:`${r}.get(${t})`,setter:e=>`${r}.set(${t}, ${e})`,postIncHelper:`${r}.postInc(${t})`,postDecHelper:`${r}.postDec(${t})`}}if("MemberExpression"===e.type){let t=this.expression(e.object),r="Identifier"===e.property.type?JSON.stringify(e.property.name):this.expression(e.property);return{getter:`${this.runtime}.prop(${t}, ${r})`,setter:e=>`${this.runtime}.setProp(${t}, ${r}, ${e})`,postIncHelper:`${this.runtime}.propPostInc(${t}, ${r})`,postDecHelper:`${this.runtime}.propPostDec(${t}, ${r})`}}if("IndexExpression"===e.type){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let r=JSON.stringify(e.object.name),n="global"===e.object.scope?this.globals:this.locals,s=t.join(", ");return{getter:`${n}.get(${r}, ${s})`,setter:e=>`${n}.set(${r}, ${s}, ${e})`,postIncHelper:`${n}.postInc(${r}, ${s})`,postDecHelper:`${n}.postDec(${r}, ${s})`}}if("MemberExpression"===e.object.type){let r=e.object,n=this.expression(r.object),s="Identifier"===r.property.type?JSON.stringify(r.property.name):this.expression(r.property),i=`${this.runtime}.key(${s}, ${t.join(", ")})`;return{getter:`${this.runtime}.prop(${n}, ${i})`,setter:e=>`${this.runtime}.setProp(${n}, ${i}, ${e})`,postIncHelper:`${this.runtime}.propPostInc(${n}, ${i})`,postDecHelper:`${this.runtime}.propPostDec(${n}, ${i})`}}let r=this.expression(e.object),n=1===t.length?t[0]:`${this.runtime}.key(${t.join(", ")})`;return{getter:`${this.runtime}.getIndex(${r}, ${n})`,setter:e=>`${this.runtime}.setIndex(${r}, ${n}, ${e})`,postIncHelper:`${this.runtime}.indexPostInc(${r}, ${n})`,postDecHelper:`${this.runtime}.indexPostDec(${r}, ${n})`}}return null}generate(e){let t=[];for(let r of e.body){let e=this.statement(r);e&&t.push(e)}return t.join("\n\n")}statement(e){switch(e.type){case"Comment":return"";case"ExpressionStatement":return this.line(`${this.expression(e.expression)};`);case"FunctionDeclaration":return this.functionDeclaration(e);case"PackageDeclaration":return this.packageDeclaration(e);case"DatablockDeclaration":return this.datablockDeclaration(e);case"ObjectDeclaration":return this.line(`${this.objectDeclaration(e)};`);case"IfStatement":return this.ifStatement(e);case"ForStatement":return this.forStatement(e);case"WhileStatement":return this.whileStatement(e);case"DoWhileStatement":return this.doWhileStatement(e);case"SwitchStatement":return this.switchStatement(e);case"ReturnStatement":return this.returnStatement(e);case"BreakStatement":return this.line("break;");case"ContinueStatement":return this.line("continue;");case"BlockStatement":return this.blockStatement(e);default:throw Error(`Unknown statement type: ${e.type}`)}}functionDeclaration(e){let t=r(e.name.name);if(t){let r=t.namespace,n=t.method;this.currentClass=r.toLowerCase(),this.currentFunction=n.toLowerCase();let s=this.functionBody(e.body,e.params);return this.currentClass=null,this.currentFunction=null,`${this.line(`${this.runtime}.registerMethod(${JSON.stringify(r)}, ${JSON.stringify(n)}, function() {`)}
|
|
${s}
|
|
${this.line("});")}`}{let t=e.name.name;this.currentFunction=t.toLowerCase();let r=this.functionBody(e.body,e.params);return this.currentFunction=null,`${this.line(`${this.runtime}.registerFunction(${JSON.stringify(t)}, function() {`)}
|
|
${r}
|
|
${this.line("});")}`}}functionBody(e,t){this.indentLevel++;let r=[];r.push(this.line(`const ${this.locals} = ${this.runtime}.locals();`));for(let e=0;e<t.length;e++)r.push(this.line(`${this.locals}.set(${JSON.stringify(t[e].name)}, arguments[${e}]);`));for(let t of e.body)r.push(this.statement(t));return this.indentLevel--,r.join("\n")}packageDeclaration(e){let t=JSON.stringify(e.name.name);this.indentLevel++;let r=e.body.map(e=>this.statement(e)).join("\n\n");return this.indentLevel--,`${this.line(`${this.runtime}.package(${t}, function() {`)}
|
|
${r}
|
|
${this.line("});")}`}datablockDeclaration(e){let t=JSON.stringify(e.className.name),r=e.instanceName?JSON.stringify(e.instanceName.name):"null",n=e.parent?JSON.stringify(e.parent.name):"null",s=this.objectBody(e.body);return this.line(`${this.runtime}.datablock(${t}, ${r}, ${n}, ${s});`)}objectDeclaration(e){let t="Identifier"===e.className.type?JSON.stringify(e.className.name):this.expression(e.className),r=null===e.instanceName?"null":"Identifier"===e.instanceName.type?JSON.stringify(e.instanceName.name):this.expression(e.instanceName),n=[],s=[];for(let t of e.body)"Assignment"===t.type?n.push(t):s.push(t);let i=this.objectBody(n);if(s.length>0){let e=s.map(e=>this.objectDeclaration(e)).join(",\n");return`${this.runtime}.create(${t}, ${r}, ${i}, [
|
|
${e}
|
|
])`}return`${this.runtime}.create(${t}, ${r}, ${i})`}objectBody(e){if(0===e.length)return"{}";let t=[];for(let r of e)if("Assignment"===r.type){let e=this.expression(r.value);if("Identifier"===r.target.type){let n=r.target.name;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)?t.push(`${n}: ${e}`):t.push(`[${JSON.stringify(n)}]: ${e}`)}else if("IndexExpression"===r.target.type){let n=this.objectPropertyKey(r.target);t.push(`[${n}]: ${e}`)}else{let n=this.expression(r.target);t.push(`[${n}]: ${e}`)}}if(t.length<=1)return`{ ${t.join(", ")} }`;let r=this.indent.repeat(this.indentLevel+1),n=this.indent.repeat(this.indentLevel);return`{
|
|
${r}${t.join(",\n"+r)}
|
|
${n}}`}objectPropertyKey(e){let t="Identifier"===e.object.type?JSON.stringify(e.object.name):this.expression(e.object),r=Array.isArray(e.index)?e.index.map(e=>this.expression(e)).join(", "):this.expression(e.index);return`${this.runtime}.key(${t}, ${r})`}ifStatement(e){let t=this.expression(e.test),r=this.statementAsBlock(e.consequent);if(e.alternate)if("IfStatement"===e.alternate.type){let n=this.ifStatement(e.alternate).replace(/^\s*/,"");return this.line(`if (${t}) ${r} else ${n}`)}else{let n=this.statementAsBlock(e.alternate);return this.line(`if (${t}) ${r} else ${n}`)}return this.line(`if (${t}) ${r}`)}forStatement(e){let t=e.init?this.expression(e.init):"",r=e.test?this.expression(e.test):"",n=e.update?this.expression(e.update):"",s=this.statementAsBlock(e.body);return this.line(`for (${t}; ${r}; ${n}) ${s}`)}whileStatement(e){let t=this.expression(e.test),r=this.statementAsBlock(e.body);return this.line(`while (${t}) ${r}`)}doWhileStatement(e){let t=this.statementAsBlock(e.body),r=this.expression(e.test);return this.line(`do ${t} while (${r});`)}switchStatement(e){if(e.stringMode)return this.switchStringStatement(e);let t=this.expression(e.discriminant);this.indentLevel++;let r=[];for(let t of e.cases)r.push(this.switchCase(t));return this.indentLevel--,`${this.line(`switch (${t}) {`)}
|
|
${r.join("\n")}
|
|
${this.line("}")}`}switchCase(e){let t=[];if(null===e.test)t.push(this.line("default:"));else if(Array.isArray(e.test))for(let r of e.test)t.push(this.line(`case ${this.expression(r)}:`));else t.push(this.line(`case ${this.expression(e.test)}:`));for(let r of(this.indentLevel++,e.consequent))t.push(this.statement(r));return t.push(this.line("break;")),this.indentLevel--,t.join("\n")}switchStringStatement(e){let t=this.expression(e.discriminant),r=[];for(let t of e.cases)if(null===t.test)r.push(`default: () => { ${this.blockContent(t.consequent)} }`);else if(Array.isArray(t.test))for(let e of t.test)r.push(`${this.expression(e)}: () => { ${this.blockContent(t.consequent)} }`);else r.push(`${this.expression(t.test)}: () => { ${this.blockContent(t.consequent)} }`);return this.line(`${this.runtime}.switchStr(${t}, { ${r.join(", ")} });`)}returnStatement(e){return e.value?this.line(`return ${this.expression(e.value)};`):this.line("return;")}blockStatement(e){this.indentLevel++;let t=e.body.map(e=>this.statement(e)).join("\n");return this.indentLevel--,`{
|
|
${t}
|
|
${this.line("}")}`}statementAsBlock(e){if("BlockStatement"===e.type)return this.blockStatement(e);this.indentLevel++;let t=this.statement(e);return this.indentLevel--,`{
|
|
${t}
|
|
${this.line("}")}`}blockContent(e){return e.map(e=>this.statement(e).trim()).join(" ")}expression(e){switch(e.type){case"Identifier":return this.identifier(e);case"Variable":return this.variable(e);case"NumberLiteral":case"BooleanLiteral":return String(e.value);case"StringLiteral":return JSON.stringify(e.value);case"BinaryExpression":return this.binaryExpression(e);case"UnaryExpression":return this.unaryExpression(e);case"PostfixExpression":return this.postfixExpression(e);case"AssignmentExpression":return this.assignmentExpression(e);case"ConditionalExpression":return`(${this.expression(e.test)} ? ${this.expression(e.consequent)} : ${this.expression(e.alternate)})`;case"CallExpression":return this.callExpression(e);case"MemberExpression":return this.memberExpression(e);case"IndexExpression":return this.indexExpression(e);case"TagDereferenceExpression":return`${this.runtime}.deref(${this.expression(e.argument)})`;case"ObjectDeclaration":return this.objectDeclaration(e);case"DatablockDeclaration":return`${this.runtime}.datablock(${JSON.stringify(e.className.name)}, ${e.instanceName?JSON.stringify(e.instanceName.name):"null"}, ${e.parent?JSON.stringify(e.parent.name):"null"}, ${this.objectBody(e.body)})`;default:throw Error(`Unknown expression type: ${e.type}`)}}identifier(e){let t=r(e.name);return t&&"parent"===t.namespace.toLowerCase()?e.name:t?`${this.runtime}.nsRef(${JSON.stringify(t.namespace)}, ${JSON.stringify(t.method)})`:JSON.stringify(e.name)}variable(e){return"global"===e.scope?`${this.globals}.get(${JSON.stringify(e.name)})`:`${this.locals}.get(${JSON.stringify(e.name)})`}binaryExpression(e){let t=this.expression(e.left),r=this.expression(e.right),s=e.operator,i=this.concatExpression(t,s,r);if(i)return i;if("$="===s)return`${this.runtime}.streq(${t}, ${r})`;if("!$="===s)return`!${this.runtime}.streq(${t}, ${r})`;if("&&"===s||"||"===s)return`(${t} ${s} ${r})`;let o=n[s];return o?`${o}(${t}, ${r})`:`(${t} ${s} ${r})`}unaryExpression(e){if("++"===e.operator||"--"===e.operator){let t=this.getAccessInfo(e.argument);if(t){let r="++"===e.operator?1:-1;return t.setter(`${this.runtime}.add(${t.getter}, ${r})`)}}let t=this.expression(e.argument);return"~"===e.operator?`${this.runtime}.bitnot(${t})`:"-"===e.operator?`${this.runtime}.neg(${t})`:`${e.operator}${t}`}postfixExpression(e){let t=this.getAccessInfo(e.argument);if(t){let r="++"===e.operator?t.postIncHelper:t.postDecHelper;if(r)return r}return`${this.expression(e.argument)}${e.operator}`}assignmentExpression(e){let t=this.expression(e.value),r=e.operator,n=this.getAccessInfo(e.target);if(!n)throw Error(`Unhandled assignment target type: ${e.target.type}`);if("="===r)return n.setter(t);{let e=r.slice(0,-1),s=this.compoundAssignmentValue(n.getter,e,t);return n.setter(s)}}callExpression(e){let t=e.arguments.map(e=>this.expression(e)).join(", ");if("Identifier"===e.callee.type){let n=e.callee.name,s=r(n);if(s&&"parent"===s.namespace.toLowerCase())if(this.currentClass)return`${this.runtime}.parent(${JSON.stringify(this.currentClass)}, ${JSON.stringify(s.method)}, arguments[0]${t?", "+t:""})`;else if(this.currentFunction)return`${this.runtime}.parentFunc(${JSON.stringify(this.currentFunction)}${t?", "+t:""})`;else throw Error("Parent:: call outside of function context");return s?`${this.runtime}.nsCall(${JSON.stringify(s.namespace)}, ${JSON.stringify(s.method)}${t?", "+t:""})`:`${this.functions}.call(${JSON.stringify(n)}${t?", "+t:""})`}if("MemberExpression"===e.callee.type){let r=this.expression(e.callee.object),n="Identifier"===e.callee.property.type?JSON.stringify(e.callee.property.name):this.expression(e.callee.property);return`${this.runtime}.call(${r}, ${n}${t?", "+t:""})`}let n=this.expression(e.callee);return`${n}(${t})`}memberExpression(e){let t=this.expression(e.object);return e.computed||"Identifier"!==e.property.type?`${this.runtime}.prop(${t}, ${this.expression(e.property)})`:`${this.runtime}.prop(${t}, ${JSON.stringify(e.property.name)})`}indexExpression(e){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let r=JSON.stringify(e.object.name),n="global"===e.object.scope?this.globals:this.locals;return`${n}.get(${r}, ${t.join(", ")})`}if("MemberExpression"===e.object.type){let r=e.object,n=this.expression(r.object),s="Identifier"===r.property.type?JSON.stringify(r.property.name):this.expression(r.property),i=`${this.runtime}.key(${s}, ${t.join(", ")})`;return`${this.runtime}.prop(${n}, ${i})`}let r=this.expression(e.object);return 1===t.length?`${this.runtime}.getIndex(${r}, ${t[0]})`:`${this.runtime}.getIndex(${r}, ${this.runtime}.key(${t.join(", ")}))`}line(e){return this.indent.repeat(this.indentLevel)+e}concatExpression(e,t,r){switch(t){case"@":return`${this.runtime}.concat(${e}, ${r})`;case"SPC":return`${this.runtime}.concat(${e}, " ", ${r})`;case"TAB":return`${this.runtime}.concat(${e}, "\\t", ${r})`;case"NL":return`${this.runtime}.concat(${e}, "\\n", ${r})`;default:return null}}compoundAssignmentValue(e,t,r){let s=this.concatExpression(e,t,r);if(s)return s;let i=n[t];return i?`${i}(${e}, ${r})`:`(${e} ${t} ${r})`}}e.s(["createRuntime",()=>I,"createScriptCache",()=>R],33870);var i=e.i(54970),o=e.i(25645);class a{map=new Map;keyLookup=new Map;constructor(e){if(e)for(const[t,r]of e)this.set(t,r)}get size(){return this.map.size}get(e){let t=this.keyLookup.get(e.toLowerCase());return void 0!==t?this.map.get(t):void 0}set(e,t){let r=e.toLowerCase(),n=this.keyLookup.get(r);return void 0!==n?this.map.set(n,t):(this.keyLookup.set(r,e),this.map.set(e,t)),this}has(e){return this.keyLookup.has(e.toLowerCase())}delete(e){let t=e.toLowerCase(),r=this.keyLookup.get(t);return void 0!==r&&(this.keyLookup.delete(t),this.map.delete(r))}clear(){this.map.clear(),this.keyLookup.clear()}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}[Symbol.iterator](){return this.map[Symbol.iterator]()}forEach(e){for(let[t,r]of this.map)e(r,t,this)}get[Symbol.toStringTag](){return"CaseInsensitiveMap"}getOriginalKey(e){return this.keyLookup.get(e.toLowerCase())}}class l{set=new Set;constructor(e){if(e)for(const t of e)this.add(t)}get size(){return this.set.size}add(e){return this.set.add(e.toLowerCase()),this}has(e){return this.set.has(e.toLowerCase())}delete(e){return this.set.delete(e.toLowerCase())}clear(){this.set.clear()}[Symbol.iterator](){return this.set[Symbol.iterator]()}get[Symbol.toStringTag](){return"CaseInsensitiveSet"}}function u(e){return e.replace(/\\/g,"/").toLowerCase()}function c(e){return String(e??"")}function p(e){return Number(e)||0}function f(e){let t=c(e||"0 0 0").split(" ").map(Number);return[t[0]||0,t[1]||0,t[2]||0]}function h(e,t,r){let n=0;for(;t+n<e.length&&!r.includes(e[t+n]);)n++;return n}function d(e,t,r){let n=0;for(;t>0;){if(n>=e.length)return"";let s=h(e,n,r);if(n+s>=e.length)return"";n+=s+1,t--}let s=h(e,n,r);return 0===s?"":e.substring(n,n+s)}function m(e,t,r,n){let s=0,i=t;for(;i>0;){if(s>=e.length)return"";let t=h(e,s,n);if(s+t>=e.length)return"";s+=t+1,i--}let o=s,a=r-t+1;for(;a>0;){let t=h(e,s,n);if((s+=t)>=e.length)break;s++,a--}let l=s;return l>o&&n.includes(e[l-1])&&l--,e.substring(o,l)}function g(e,t){if(""===e)return 0;let r=0;for(let n=0;n<e.length;n++)t.includes(e[n])&&r++;return r+1}function b(e,t,r,n,s){let i=[],o=0,a=0;for(;o<e.length||a<=t;){if(o<e.length){let s=h(e,o,n);a===t?i.push(r):i.push(e.substring(o,o+s)),(o+=s)<e.length&&o++}else a===t?i.push(r):i.push("");if(++a>t&&o>=e.length)break}return i.join(s)}function y(e,t,r,n){let s=[],i=0,o=0;for(;i<e.length;){let n=h(e,i,r);o!==t&&s.push(e.substring(i,i+n)),(i+=n)<e.length&&i++,o++}return s.join(n)}function $(e){let{runtime:t,fileSystem:r}=e,n=[],s=0,i="";return{echo(...e){console.log(...e.map(c))},warn(...e){console.warn(...e.map(c))},error(...e){console.error(...e.map(c))},call:(e,...r)=>t().$f.call(c(e),...r),eval(e){throw Error("eval() not implemented: requires runtime parsing and execution")},collapseescape:e=>c(e).replace(/\\([ntr\\])/g,(e,t)=>"n"===t?"\n":"t"===t?" ":"r"===t?"\r":"\\"),expandescape:e=>c(e).replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r"),export(e,t,r){console.warn(`export(${e}): not implemented`)},quit(){console.warn("quit(): not implemented in browser")},trace(e){},isobject:e=>t().$.isObject(e),nametoid:e=>t().$.nameToId(e),strlen:e=>c(e).length,strchr(e,t){let r=c(e),n=c(t)[0]??"",s=r.indexOf(n);return s>=0?r.substring(s):""},strpos:(e,t,r)=>c(e).indexOf(c(t),p(r)),strcmp(e,t){let r=c(e),n=c(t);return r<n?-1:+(r>n)},stricmp(e,t){let r=c(e).toLowerCase(),n=c(t).toLowerCase();return r<n?-1:+(r>n)},strstr:(e,t)=>c(e).indexOf(c(t)),getsubstr(e,t,r){let n=c(e),s=p(t);return void 0===r?n.substring(s):n.substring(s,s+p(r))},getword:(e,t)=>d(c(e),p(t)," \n"),getwordcount:e=>g(c(e)," \n"),getfield:(e,t)=>d(c(e),p(t)," \n"),getfieldcount:e=>g(c(e)," \n"),setword:(e,t,r)=>b(c(e),p(t),c(r)," \n"," "),setfield:(e,t,r)=>b(c(e),p(t),c(r)," \n"," "),firstword:e=>d(c(e),0," \n"),restwords:e=>m(c(e),1,1e6," \n"),trim:e=>c(e).trim(),ltrim:e=>c(e).replace(/^\s+/,""),rtrim:e=>c(e).replace(/\s+$/,""),strupr:e=>c(e).toUpperCase(),strlwr:e=>c(e).toLowerCase(),strreplace:(e,t,r)=>c(e).split(c(t)).join(c(r)),filterstring:(e,t)=>c(e),stripchars(e,t){let r=c(e),n=new Set(c(t).split(""));return r.split("").filter(e=>!n.has(e)).join("")},getfields(e,t,r){let n=void 0!==r?Number(r):1e6;return m(c(e),p(t),n," \n")},getwords(e,t,r){let n=void 0!==r?Number(r):1e6;return m(c(e),p(t),n," \n")},removeword:(e,t)=>y(c(e),p(t)," \n"," "),removefield:(e,t)=>y(c(e),p(t)," \n"," "),getrecord:(e,t)=>d(c(e),p(t),"\n"),getrecordcount:e=>g(c(e),"\n"),setrecord:(e,t,r)=>b(c(e),p(t),c(r),"\n","\n"),removerecord:(e,t)=>y(c(e),p(t),"\n","\n"),nexttoken(e,t,r){throw Error("nextToken() is not implemented: it requires variable mutation")},strtoplayername:e=>c(e).replace(/[^\w\s-]/g,"").trim(),mabs:e=>Math.abs(p(e)),mfloor:e=>Math.floor(p(e)),mceil:e=>Math.ceil(p(e)),msqrt:e=>Math.sqrt(p(e)),mpow:(e,t)=>Math.pow(p(e),p(t)),msin:e=>Math.sin(p(e)),mcos:e=>Math.cos(p(e)),mtan:e=>Math.tan(p(e)),masin:e=>Math.asin(p(e)),macos:e=>Math.acos(p(e)),matan:(e,t)=>Math.atan2(p(e),p(t)),mlog:e=>Math.log(p(e)),getrandom(e,t){if(void 0===e)return Math.random();if(void 0===t)return Math.floor(Math.random()*(p(e)+1));let r=p(e);return Math.floor(Math.random()*(p(t)-r+1))+r},mdegtorad:e=>p(e)*(Math.PI/180),mradtodeg:e=>p(e)*(180/Math.PI),mfloatlength:(e,t)=>p(e).toFixed(p(t)),getboxcenter(e){let t=c(e).split(" ").map(Number),r=t[0]||0,n=t[1]||0,s=t[2]||0,i=t[3]||0,o=t[4]||0,a=t[5]||0;return`${(r+i)/2} ${(n+o)/2} ${(s+a)/2}`},vectoradd(e,t){let[r,n,s]=f(e),[i,o,a]=f(t);return`${r+i} ${n+o} ${s+a}`},vectorsub(e,t){let[r,n,s]=f(e),[i,o,a]=f(t);return`${r-i} ${n-o} ${s-a}`},vectorscale(e,t){let[r,n,s]=f(e),i=p(t);return`${r*i} ${n*i} ${s*i}`},vectordot(e,t){let[r,n,s]=f(e),[i,o,a]=f(t);return r*i+n*o+s*a},vectorcross(e,t){let[r,n,s]=f(e),[i,o,a]=f(t);return`${n*a-s*o} ${s*i-r*a} ${r*o-n*i}`},vectorlen(e){let[t,r,n]=f(e);return Math.sqrt(t*t+r*r+n*n)},vectornormalize(e){let[t,r,n]=f(e),s=Math.sqrt(t*t+r*r+n*n);return 0===s?"0 0 0":`${t/s} ${r/s} ${n/s}`},vectordist(e,t){let[r,n,s]=f(e),[i,o,a]=f(t),l=r-i,u=n-o,c=s-a;return Math.sqrt(l*l+u*u+c*c)},matrixcreate(e,t){throw Error("MatrixCreate() not implemented: requires axis-angle rotation math")},matrixcreatefromeuler(e){throw Error("MatrixCreateFromEuler() not implemented: requires Euler→Quaternion→AxisAngle conversion")},matrixmultiply(e,t){throw Error("MatrixMultiply() not implemented: requires full 4x4 matrix multiplication")},matrixmulpoint(e,t){throw Error("MatrixMulPoint() not implemented: requires full transform application")},matrixmulvector(e,t){throw Error("MatrixMulVector() not implemented: requires rotation matrix application")},getsimtime:()=>Date.now()-t().state.startTime,getrealtime:()=>Date.now(),schedule(e,r,n,...s){let i=Number(e)||0,o=t(),a=setTimeout(()=>{o.state.pendingTimeouts.delete(a);try{o.$f.call(String(n),...s)}catch(e){throw console.error(`schedule: error calling ${n}:`,e),e}},i);return o.state.pendingTimeouts.add(a),a},cancel(e){clearTimeout(e),t().state.pendingTimeouts.delete(e)},iseventpending:e=>t().state.pendingTimeouts.has(e),exec(e){let r=String(e??"");if(console.debug(`exec(${JSON.stringify(r)}): preparing to execute…`),!r.includes("."))return console.error(`exec: invalid script file name ${JSON.stringify(r)}.`),!1;let n=u(r),s=t(),{executedScripts:i,scripts:o}=s.state;if(i.has(n))return console.debug(`exec(${JSON.stringify(r)}): skipping (already executed)`),!0;let a=o.get(n);return null==a?(console.warn(`exec(${JSON.stringify(r)}): script not found`),!1):(i.add(n),console.debug(`exec(${JSON.stringify(r)}): executing!`),s.executeAST(a),!0)},compile(e){throw Error("compile() not implemented: requires DSO bytecode compiler")},isdemo:()=>!1,isfile:e=>r?r.isFile(c(e)):(console.warn("isFile(): no fileSystem handler configured"),!1),fileext(e){let t=c(e),r=t.lastIndexOf(".");return r>=0?t.substring(r):""},filebase(e){let t=c(e),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\")),n=t.lastIndexOf("."),s=r>=0?r+1:0,i=n>s?n:t.length;return t.substring(s,i)},filepath(e){let t=c(e),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return r>=0?t.substring(0,r):""},expandfilename(e){throw Error("expandFilename() not implemented: requires filesystem path expansion")},findfirstfile:e=>r?(i=c(e),n=r.findFiles(i),s=0,n[s++]??""):(console.warn("findFirstFile(): no fileSystem handler configured"),""),findnextfile(e){let t=c(e);if(t!==i){if(!r)return"";i=t,n=r.findFiles(t)}return n[s++]??""},getfilecrc:e=>c(e),iswriteablefilename:e=>!1,activatepackage(e){t().$.activatePackage(c(e))},deactivatepackage(e){t().$.deactivatePackage(c(e))},ispackage:e=>t().$.isPackage(c(e)),isactivepackage:e=>t().$.isActivePackage(c(e)),getpackagelist:()=>t().$.getPackageList(),addmessagecallback(e,t){},alxcreatesource:(...e)=>0,alxgetwavelen:e=>0,alxlistenerf(e,t){},alxplay:(...e)=>0,alxsetchannelvolume(e,t){},alxsourcef(e,t,r){},alxstop(e){},alxstopall(){},activatedirectinput(){},activatekeyboard(){},deactivatedirectinput(){},deactivatekeyboard(){},disablejoystick(){},enablejoystick(){},enablewinconsole(e){},isjoystickdetected:()=>!1,lockmouse(e){},addmaterialmapping(e,t){},flushtexturecache(){},getdesktopresolution:()=>"1920 1080 32",getdisplaydevicelist:()=>"OpenGL",getresolutionlist:e=>"640 480 800 600 1024 768 1280 720 1920 1080",getvideodriverinfo:()=>"WebGL",isdevicefullscreenonly:e=>!1,isfullscreen:()=>!1,screenshot(e){},setdisplaydevice:e=>!0,setfov(e){},setinteriorrendermode(e){},setopenglanisotropy(e){},setopenglmipreduction(e){},setopenglskymipreduction(e){},setopengltexturecompressionhint(e){},setscreenmode(e,t,r,n){},setverticalsync(e){},setzoomspeed(e){},togglefullscreen(){},videosetgammacorrection(e){},snaptoggle(){},addtaggedstring:e=>0,buildtaggedstring:(e,...t)=>"",detag:e=>c(e),gettag:e=>0,gettaggedstring:e=>"",removetaggedstring(e){},commandtoclient(e,t){},commandtoserver(e){},cancelserverquery(){},querymasterserver(){},querysingleserver(){},setnetport:e=>!0,allowconnections(e){},startheartbeat(){},stopheartbeat(){},gotowebpage(e){},deletedatablocks(){},preloaddatablock:e=>!0,containerboxempty:(...e)=>!0,containerraycast:(...e)=>"",containersearchcurrdist:()=>0,containersearchnext:()=>0,initcontainerradiussearch(){},calcexplosioncoverage:(...e)=>1,getcontrolobjectaltitude:()=>0,getcontrolobjectspeed:()=>0,getterrainheight:e=>0,lightscene(){},pathonmissionloaddone(){}}}function A(e){return e.toLowerCase()}function x(e){let t=e.trim();return A(t.startsWith("$")?t.slice(1):t)}function C(e,t){let r=e.get(t);return r||(r=new Set,e.set(t,r)),r}function S(e,t){for(let r of t)e.add(A(r))}function v(e,t,r){if(e.anyClassValues.has("*")||e.anyClassValues.has(r))return!0;for(let n of t){let t=e.valuesByClass.get(A(n));if(t&&(t.has("*")||t.has(r)))return!0}return!1}let w=[{classNames:["SceneObject","GameBase","ShapeBase","Item","Player"],fields:["position","rotation","scale","transform","hidden","renderingdistance","datablock","shapename","shapefile","initialbarrel","skin","team","health","energy","energylevel","damagelevel","damageflash","damagepercent","damagestate","mountobject","mountedimage","targetposition","targetrotation","targetscale","missiontypeslist","renderenabled","vis","velocity","name"]},{classNames:["*"],fields:["position","rotation","scale","hidden","shapefile","datablock"]}],E=[{classNames:["SceneObject","GameBase","ShapeBase","SimObject"],methods:["settransform","setposition","setrotation","setscale","sethidden","setdatablock","setshapename","mountimage","unmountimage","mountobject","unmountobject","setdamagelevel","setenergylevel","schedule","delete","deleteallobjects","add","remove","playthread","stopthread","setthreaddir","pausethread"]},{classNames:["*"],methods:["settransform","setscale","delete","add","remove"]}],_=["missionrunning","loadingmission"],k=(0,o.createLogger)("runtime");function R(){return{scripts:new Map,generatedCode:new WeakMap}}function N(e){return e.toLowerCase()}function L(e){return Number(e)>>>0}function O(e){if(null==e)return null;if("string"==typeof e)return e||null;if("number"==typeof e)return String(e);throw Error(`Invalid instance name type: ${typeof e}`)}function I(e={}){let t,r,n,o=e.reactiveFieldRules??w,c=e.reactiveMethodRules??E,p=e.reactiveGlobalNames??_,f=(t=function(e){let t=new Set,r=new Map;for(let n of e)for(let e of n.classNames){let s=A(e);if("*"===s){S(t,n.fields);continue}S(C(r,s),n.fields)}return{anyClassValues:t,valuesByClass:r}}(o),(e,r)=>v(t,e,A(r))),h=(r=function(e){let t=new Set,r=new Map;for(let n of e)for(let e of n.classNames){let s=A(e);if("*"===s){S(t,n.methods);continue}S(C(r,s),n.methods)}return{anyClassValues:t,valuesByClass:r}}(c),(e,t)=>v(r,e,A(t))),d=(n=function(e){let t=new Set;for(let r of e)t.add(x(r));return t}(p),e=>{let t=x(e);return n.has("*")||n.has(t)}),m=new a,g=new a,b=new a,y=[],j=new l,M=3,T=1027,P=new Map,H=new a,D=new a,F=new a,G=new a,q=new a,J=new Set,U=[],W=!1,K=0;if(e.globals)for(let[t,r]of Object.entries(e.globals)){if(!t.startsWith("$"))throw Error(`Global variable "${t}" must start with $, e.g. "$${t}"`);F.set(t.slice(1),r)}let z=new Set,Z=new Set,V=e.ignoreScripts&&e.ignoreScripts.length>0?(0,i.default)(e.ignoreScripts,{nocase:!0}):null,Q=e.cache??R(),X=Q.scripts,Y=Q.generatedCode,ee=new Map;function et(e){let t=ee.get(e);return t&&t.length>0?t[t.length-1]:void 0}function er(e,t,r){let n;(n=ee.get(e))||(n=[],ee.set(e,n)),n.push(t);try{return r()}finally{let t;(t=ee.get(e))&&t.pop()}}function en(e,t){return`${e.toLowerCase()}::${t.toLowerCase()}`}function es(e,t){return m.get(e)?.get(t)??null}function ei(e){if(!e)return[];let t=[],r=new Set,n=e.class||e._className||e._class,s=n?N(String(n)):"";for(;s&&!r.has(s);)t.push(s),r.add(s),s=q.get(s)??"";return e._superClass&&!r.has(e._superClass)&&t.push(e._superClass),t}function eo(){if(W=!1,0===U.length)return;let e=U.splice(0,U.length);for(let t of(K+=1,J))t({type:"batch.flushed",tick:K,events:e})}function ea(e){for(let t of(U.push(e),J))t(e);W||(W=!0,queueMicrotask(eo))}function el(e){ea({type:"object.created",objectId:e._id,object:e})}function eu(e,t,r,n){let s=N(t);Object.is(r,n)||f(ei(e),s)&&ea({type:"field.changed",objectId:e._id,field:s,value:r,previousValue:n,object:e})}let ec=new Set,ep=null,ef=null,eh=(e.builtins??$)({runtime:()=>ef,fileSystem:e.fileSystem??null});function ed(e){let t=b.get(e);if(!t)return void j.add(e);if(!t.active){for(let[e,r]of(t.active=!0,y.push(t.name),t.methods)){m.has(e)||m.set(e,new a);let t=m.get(e);for(let[e,n]of r)t.has(e)||t.set(e,[]),t.get(e).push(n)}for(let[e,r]of t.functions)g.has(e)||g.set(e,[]),g.get(e).push(r)}}function em(e){return null==e||""===e?null:"object"==typeof e&&null!=e._id?e:"string"==typeof e?H.get(e)??null:"number"==typeof e?P.get(e)??null:null}function eg(e,t,r){let n=em(e);if(null==n)return 0;let s=eA(n[t]);return n[t]=s+r,eu(n,t,n[t],s),s}function eb(e,t){let r=es(e,t);return r&&r.length>0?r[r.length-1]:null}function ey(e,t,r,n){let s=es(e,t);return s&&0!==s.length?{found:!0,result:er(en(e,t),s.length-1,()=>s[s.length-1](r,...n))}:{found:!1}}function e$(e,t,r,n){let s;h((s=ei(r)).length?s:[e],t)&&ea({type:"method.called",className:N(e),methodName:N(t),objectId:r._id,args:[...n]});let i=G.get(e);if(i){let e=i.get(t);if(e)for(let t of e)t(r,...n)}}function eA(e){if(null==e||""===e)return 0;let t=Number(e);return isNaN(t)?0:t}function ex(e){if(!e||""===e)return null;e.startsWith("/")&&(e=e.slice(1));let t=e.split("/"),r=null;for(let e=0;e<t.length;e++){let n=t[e];if(n){if(0===e)r=/^\d+$/.test(n)?P.get(parseInt(n,10))??null:H.get(n)??null;else{if(!r||!r._children)return null;let e=n.toLowerCase();r=r._children.find(t=>t._name?.toLowerCase()===e)??null}if(!r)return null}}return r}function eC(e){return null==e||""===e?null:ex(String(e))}function eS(e,t){function r(e,t){return e+t.join("_")}return{get:(t,...n)=>e.get(r(t,n))??"",set(n,...s){if(0===s.length)throw Error("set() requires at least a value argument");if(1===s.length){let r=e.get(n);return e.set(n,s[0]),t?.onSet?.(n,s[0],r),s[0]}let i=s[s.length-1],o=r(n,s.slice(0,-1)),a=e.get(o);return e.set(o,i),t?.onSet?.(o,i,a),i},postInc(n,...s){let i=r(n,s),o=eA(e.get(i)),a=o+1;return e.set(i,a),t?.onSet?.(i,a,o),o},postDec(n,...s){let i=r(n,s),o=eA(e.get(i)),a=o-1;return e.set(i,a),t?.onSet?.(i,a,o),o}}}function ev(){return eS(new a)}let ew={registerMethod:function(e,t,r){if(ep)ep.methods.has(e)||ep.methods.set(e,new a),ep.methods.get(e).set(t,r);else{m.has(e)||m.set(e,new a);let n=m.get(e);n.has(t)||n.set(t,[]),n.get(t).push(r)}},registerFunction:function(e,t){ep?ep.functions.set(e,t):(g.has(e)||g.set(e,[]),g.get(e).push(t))},package:function(e,t){let r=b.get(e);r||(r={name:e,active:!1,methods:new a,functions:new a},b.set(e,r));let n=ep;ep=r,t(),ep=n,j.has(e)&&(j.delete(e),ed(e))},activatePackage:ed,deactivatePackage:function(e){let t=b.get(e);if(!t||!t.active)return;t.active=!1;let r=y.findIndex(t=>t.toLowerCase()===e.toLowerCase());for(let[e,n]of(-1!==r&&y.splice(r,1),t.methods)){let t=m.get(e);if(t)for(let[e,r]of n){let n=t.get(e);if(n){let e=n.indexOf(r);-1!==e&&n.splice(e,1)}}}for(let[e,r]of t.functions){let t=g.get(e);if(t){let e=t.indexOf(r);-1!==e&&t.splice(e,1)}}},create:function(e,t,r,n){let s=N(e),i=function(){for(;P.has(T);)T+=1;let e=T;return T+=1,e}(),o={_class:s,_className:e,_id:i};for(let[e,t]of Object.entries(r))o[N(e)]=t;o.superclass&&(o._superClass=N(String(o.superclass)),o.class&&q.set(N(String(o.class)),o._superClass)),P.set(i,o);let a=O(t);if(a&&(o._name=a,H.set(a,o)),n){for(let e of n)e._parent=o;o._children=n}let l=eb(e,"onAdd");return l&&l(o),el(o),o},datablock:function(e,t,r,n){let s=N(e),i=function(){for(;P.has(M);)M+=1;let e=M;return M+=1,e}(),o={_class:s,_className:e,_id:i,_isDatablock:!0},a=O(r);if(a){let e=D.get(a);if(e){for(let[t,r]of Object.entries(e))t.startsWith("_")||(o[t]=r);o._parent=e}}for(let[e,t]of Object.entries(n))o[N(e)]=t;P.set(i,o);let l=O(t);return l&&(o._name=l,H.set(l,o),D.set(l,o)),el(o),o},deleteObject:function e(t){var r;let n;if(null==t||("number"==typeof t?n=P.get(t):"string"==typeof t?n=H.get(t):"object"==typeof t&&t._id&&(n=t),!n))return!1;let s=eb(n._className,"onRemove");if(s&&s(n),P.delete(n._id),n._name&&H.delete(n._name),n._isDatablock&&n._name&&D.delete(n._name),n._parent&&n._parent._children){let e=n._parent._children.indexOf(n);-1!==e&&n._parent._children.splice(e,1)}if(n._children)for(let t of[...n._children])e(t);return ea({type:"object.deleted",objectId:(r=n)._id,object:r}),!0},prop:function(e,t){let r=em(e);return null==r?"":r[N(t)]??""},setProp:function(e,t,r){let n=em(e);if(null==n)return r;let s=N(t),i=n[s];return n[s]=r,eu(n,s,r,i),r},getIndex:function(e,t){let r=em(e);return null==r?"":r[String(t)]??""},setIndex:function(e,t,r){let n=em(e);if(null==n)return r;let s=String(t),i=n[s];return n[s]=r,eu(n,s,r,i),r},propPostInc:function(e,t){return eg(e,N(t),1)},propPostDec:function(e,t){return eg(e,N(t),-1)},indexPostInc:function(e,t){return eg(e,String(t),1)},indexPostDec:function(e,t){return eg(e,String(t),-1)},key:function(e,...t){return e+t.join("_")},call:function(e,t,...r){if(null==e||("string"==typeof e||"number"==typeof e)&&null==(e=eC(e)))return"";let n=e.class||e._className||e._class;if(n){let s=ey(n,t,e,r);if(s.found)return e$(n,t,e,r),s.result}let s=e._superClass||q.get(n);for(;s;){let n=ey(s,t,e,r);if(n.found)return e$(s,t,e,r),n.result;s=q.get(s)}return""},nsCall:function(e,t,...r){let n=es(e,t);if(!n||0===n.length)return"";let s=en(e,t),i=n[n.length-1],o=er(s,n.length-1,()=>i(...r)),a=r[0];return a&&"object"==typeof a&&e$(e,t,a,r.slice(1)),o},nsRef:function(e,t){let r=es(e,t);if(!r||0===r.length)return null;let n=en(e,t),s=r[r.length-1];return(...e)=>er(n,r.length-1,()=>s(...e))},parent:function(e,t,r,...n){let s=es(e,t),i=en(e,t),o=et(i);if(s&&void 0!==o&&o>=1){let a=o-1,l=er(i,a,()=>s[a](r,...n));return r&&"object"==typeof r&&e$(e,t,r,n),l}let a=q.get(e);for(;a;){let e=es(a,t);if(e&&e.length>0){let s=er(en(a,t),e.length-1,()=>e[e.length-1](r,...n));return r&&"object"==typeof r&&e$(a,t,r,n),s}a=q.get(a)}return""},parentFunc:function(e,...t){let r=g.get(e);if(!r)return"";let n=e.toLowerCase(),s=et(n);if(void 0===s||s<1)return"";let i=s-1;return er(n,i,()=>r[i](...t))},add:function(e,t){return eA(e)+eA(t)},sub:function(e,t){return eA(e)-eA(t)},mul:function(e,t){return eA(e)*eA(t)},div:function(e,t){return eA(e)/eA(t)},neg:function(e){return-eA(e)},lt:function(e,t){return eA(e)<eA(t)},le:function(e,t){return eA(e)<=eA(t)},gt:function(e,t){return eA(e)>eA(t)},ge:function(e,t){return eA(e)>=eA(t)},eq:function(e,t){return eA(e)===eA(t)},ne:function(e,t){return eA(e)!==eA(t)},mod:function(e,t){let r=0|Number(t);return 0===r?0:(0|Number(e))%r},bitand:function(e,t){return L(e)&L(t)},bitor:function(e,t){return L(e)|L(t)},bitxor:function(e,t){return L(e)^L(t)},shl:function(e,t){return L(L(e)<<(31&L(t)))},shr:function(e,t){return L(e)>>>(31&L(t))},bitnot:function(e){return~L(e)>>>0},concat:function(...e){return e.map(e=>String(e??"")).join("")},streq:function(e,t){return String(e??"").toLowerCase()===String(t??"").toLowerCase()},switchStr:function(e,t){let r=String(e??"").toLowerCase();for(let[e,n]of Object.entries(t))if("default"!==e&&N(e)===r)return void n();t.default&&t.default()},deref:eC,nameToId:function(e){let t=ex(e);return t?t._id:-1},isObject:function(e){return null!=e&&("object"==typeof e&&!!e._id||("number"==typeof e?P.has(e):"string"==typeof e&&H.has(e)))},isFunction:function(e){return g.has(e)||e.toLowerCase()in eh},isPackage:function(e){return b.has(e)},isActivePackage:function(e){let t=b.get(e);return t?.active??!1},getPackageList:function(){return y.join(" ")},locals:ev,onMethodCalled(e,t,r){let n=G.get(e);n||(n=new a,G.set(e,n));let s=n.get(t);return s||(s=[],n.set(t,s)),s.push(r),()=>{let e=s.indexOf(r);-1!==e&&s.splice(e,1)}}},eE={call(e,...t){let r=g.get(e);if(r&&r.length>0)return er(e.toLowerCase(),r.length-1,()=>r[r.length-1](...t));let n=eh[e.toLowerCase()];return n?n(...t):(k.warn(`Unknown function: ${e}(${t.map(e=>JSON.stringify(e)).join(", ")})`),"")}},e_=eS(F,{onSet:function(e,t,r){let n=N(e.startsWith("$")?e.slice(1):e);Object.is(t,r)||d(n)&&ea({type:"global.changed",name:n,value:t,previousValue:r})}}),ek={methods:m,functions:g,packages:b,activePackages:y,objectsById:P,objectsByName:H,datablocks:D,globals:F,executedScripts:z,failedScripts:Z,scripts:X,generatedCode:Y,pendingTimeouts:ec,startTime:Date.now()};function eR(e){let t=function(e){let t=Y.get(e);null==t&&(t=new s(void 0).generate(e),Y.set(e,t));return t}(e),r=ev();Function("$","$f","$g","$l",t)(ew,eE,e_,r)}function eN(e,t){return{execute(){if(t){let e=u(t);ek.executedScripts.add(e)}eR(e)}}}async function eL(t,r,n){let s=e.loadScript;if(!s){t.length>0&&k.warn("Script has exec() calls but no loadScript provided: %o",t);return}async function i(t){e.signal?.throwIfAborted();let i=u(t);if(ek.scripts.has(i)||ek.failedScripts.has(i))return;if(V&&V(i)){k.warn("Ignoring script: %s",t),ek.failedScripts.add(i);return}if(n.has(i))return;let o=r.get(i);if(o)return void await o;e.progress?.addItem(t);let a=(async()=>{let o,a=await s(t);if(null==a){k.warn("Script not found: %s",t),ek.failedScripts.add(i),e.progress?.completeItem();return}try{o=B(a,{filename:t})}catch(r){k.warn("Failed to parse script: %s %o",t,r),ek.failedScripts.add(i),e.progress?.completeItem();return}let l=new Set(n);l.add(i),await eL(o.execScriptPaths,r,l),ek.scripts.set(i,o),e.progress?.completeItem()})();r.set(i,a),await a}await Promise.all(t.map(i))}async function eO(t){let r=e.loadScript;if(!r)throw Error("loadFromPath requires loadScript option to be set");let n=u(t);if(ek.scripts.has(n))return eN(ek.scripts.get(n),t);e.progress?.addItem(t);let s=await r(t);if(null==s)throw e.progress?.completeItem(),Error(`Script not found: ${t}`);let i=await eI(s,{path:t});return e.progress?.completeItem(),i}async function eI(e,t){if(t?.path){let e=u(t.path);if(ek.scripts.has(e))return eN(ek.scripts.get(e),t.path)}return ej(B(e,{filename:t?.path}),t)}async function ej(t,r){let n=new Map,s=new Set;if(r?.path){let e=u(r.path);ek.scripts.set(e,t),s.add(e)}let i=[...t.execScriptPaths,...e.preloadScripts??[]];return await eL(i,n,s),eN(t,r?.path)}return ef={$:ew,$f:eE,$g:e_,state:ek,destroy:function(){for(let e of(U.length>0&&eo(),ek.pendingTimeouts))clearTimeout(e);ek.pendingTimeouts.clear(),J.clear()},executeAST:eR,loadFromPath:eO,loadFromSource:eI,loadFromAST:ej,call:(e,...t)=>eE.call(e,...t),getObjectByName:e=>H.get(e),subscribeRuntimeEvents:e=>(J.add(e),()=>{J.delete(e)})}}let j=(0,o.createLogger)("engineMethods");function M(){let e=new Set,t=0,r=0,n=null;function s(){for(let t of e)t()}return{get total(){return t},get loaded(){return r},get current(){return n},get progress(){return 0===t?0:r/t},on(t,r){e.add(r)},off(t,r){e.delete(r)},addItem(e){t++,n=e,s()},completeItem(){r++,n=null,s()},setCurrent(e){n=e,s()}}}function B(e,r){try{return t.default.parse(e)}catch(e){if(r?.filename&&e.location)throw Error(`${r.filename}:${e.location.start.line}:${e.location.start.column}: ${e.message}`,{cause:e});throw e}}function T(e){if("boolean"==typeof e)return e;if("number"==typeof e)return 0!==e;if("string"==typeof e){let t=e.trim().toLowerCase();return""!==t&&"0"!==t&&"false"!==t}return!!e}function P(){let e=Error("Operation aborted");return e.name="AbortError",e}function H(e){let t,{missionName:r,missionType:n,runtimeOptions:s,onMissionLoadDone:i}=e,{signal:o,fileSystem:a,globals:l={},preloadScripts:u=[],reactiveGlobalNames:c}=s??{},p=a?.findFiles("scripts/*Game.cs")??[],f=c?Array.from(new Set([...c,"missionRunning"])):void 0,h=I({...s,reactiveGlobalNames:f,globals:{...l,"$Host::Map":r,"$Host::MissionType":n},preloadScripts:[...u,...p]});(t=h.$.registerMethod.bind(h.$))("ShapeBase","playThread",(e,t,r)=>{e._threads||(e._threads={}),e._threads[Number(t)]={sequence:String(r),playing:!0,direction:!0}}),t("ShapeBase","stopThread",(e,t)=>{e._threads&&delete e._threads[Number(t)]}),t("ShapeBase","setThreadDir",(e,t,r)=>{e._threads||(e._threads={});let n=Number(t);e._threads[n]?e._threads[n].direction=!!Number(r):e._threads[n]={sequence:"",playing:!1,direction:!!Number(r)}}),t("ShapeBase","pauseThread",(e,t)=>{e._threads?.[Number(t)]&&(e._threads[Number(t)].playing=!1)}),t("ShapeBase","playAudio",()=>{}),t("ShapeBase","stopAudio",()=>{}),t("SimObject","getDatablock",e=>{let t=e.datablock;return t?h.getObjectByName(String(t))??"":""}),t("SimObject","getGroup",e=>e._parent??""),t("SimObject","getName",e=>e._name??""),t("SimObject","getType",()=>16384),t("SimGroup","getCount",e=>e._children?e._children.length:0),t("SimGroup","getObject",(e,t)=>{let r=e._children;return r?r[Number(t)]??"":""}),t("GameBase","isEnabled",()=>!0),t("GameBase","isDisabled",()=>!1),t("GameBase","setPoweredState",()=>{}),t("GameBase","setRechargeRate",()=>{}),t("GameBase","getRechargeRate",()=>0),t("GameBase","setEnergyLevel",()=>{}),t("GameBase","getEnergyLevel",()=>0),t("ShapeBase","getDamageLevel",()=>0),t("ShapeBase","setDamageLevel",()=>{}),t("ShapeBase","getRepairRate",()=>0),t("ShapeBase","setRepairRate",()=>{}),t("ShapeBase","getDamagePercent",()=>0),t("GameBase","getControllingClient",()=>0),t("SimObject","schedule",(e,t,r,...n)=>{let s=setTimeout(()=>{h.state.pendingTimeouts.delete(s);try{h.$.call(e,String(r),...n)}catch(t){j.error("schedule: error calling %s on %s: %o",r,e._id,t)}},Number(t)||0);return h.state.pendingTimeouts.add(s),s});let d=async function(){try{let e=await h.loadFromPath("scripts/server.cs");o?.throwIfAborted(),await h.loadFromPath(`missions/${r}.mis`),o?.throwIfAborted(),e.execute();let t=function(e,t){let{signal:r,onMissionLoadDone:n}=t;return new Promise((t,s)=>{let i=!1,o=!1,a=()=>T(e.$g.get("missionRunning")),l=()=>{i||(i=!0,h(),t())},u=e=>{i||(i=!0,h(),s(e))},c=t=>{if(!n||o)return;let r=t??e.getObjectByName("Game");r&&(o=!0,n(r))},p=()=>u(P()),f=e.subscribeRuntimeEvents(e=>{if("global.changed"===e.type&&"missionrunning"===e.name){T(e.value)&&(c(),l());return}"batch.flushed"===e.type&&a()&&(c(),l())});function h(){f(),r?.removeEventListener("abort",p)}if(r){if(r.aborted)return void u(P());r.addEventListener("abort",p,{once:!0})}a()&&(c(),l())})}(h,{signal:o,onMissionLoadDone:i}),n=await h.loadFromSource("CreateServer($Host::Map, $Host::MissionType);");o?.throwIfAborted(),n.execute(),await t}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}}();return{runtime:h,ready:d}}e.s(["createProgressTracker",()=>M],38433);let D=/^[ \t]*(DisplayName|MissionTypes|BriefingWAV|Bitmap|PlanetName)[ \t]*=[ \t]*(.+)$/i,F=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+BEGIN[ \t]*-+$/i,G=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+END[ \t]*-+$/i,q={arena:"Arena",bounty:"Bounty",cnh:"CnH",ctf:"CTF",dm:"DM",dnd:"DnD",hunters:"Hunters",lakrabbit:"LakRabbit",lakzm:"LakZM",lctf:"LCTF",none:"None",rabbit:"Rabbit",sctf:"SCtF",siege:"Siege",singleplayer:"SinglePlayer",tdm:"TDM",teamhunters:"TeamHunters",teamlak:"TeamLak",tr2:"TR2"};function J(e){let t=B(e),{pragma:r,sections:n}=function(e){let t={},r=[],n={name:null,comments:[]};for(let s of e.body)if("Comment"===s.type){let e=function(e){let t;return(t=e.match(F))?{type:"sectionBegin",name:t[1]}:(t=e.match(G))?{type:"sectionEnd",name:t[1]}:(t=e.match(D))?{type:"definition",identifier:t[1],value:t[2]}:null}(s.value);if(e)switch(e.type){case"definition":null===n.name?t[e.identifier.toLowerCase()]=e.value:n.comments.push(s.value);break;case"sectionBegin":(null!==n.name||n.comments.length>0)&&r.push(n),n={name:e.name.toUpperCase(),comments:[]};break;case"sectionEnd":null!==n.name&&r.push(n),n={name:null,comments:[]}}else n.comments.push(s.value)}return(null!==n.name||n.comments.length>0)&&r.push(n),{pragma:t,sections:r}}(t);function s(e){return n.find(t=>t.name===e)?.comments.map(e=>e.trimStart()).join("\n")??null}return{displayName:r.displayname??null,missionTypes:r.missiontypes?.split(/\s+/).filter(Boolean).map(e=>q[e.toLowerCase()]??e)??[],missionBriefing:s("MISSION BRIEFING"),briefingWav:r.briefingwav??null,bitmap:r.bitmap??null,planetName:r.planetname??null,missionBlurb:s("MISSION BLURB"),missionQuote:s("MISSION QUOTE"),missionString:s("MISSION STRING"),execScriptPaths:t.execScriptPaths,hasDynamicExec:t.hasDynamicExec,ast:t}}function U(e,t){if(e)return e[t.toLowerCase()]}function W(e){let[t,r,n]=(e.position??"0 0 0").split(" ").map(e=>parseFloat(e));return[r||0,n||0,t||0]}function K(e){let[t,r,n]=(e.scale??"1 1 1").split(" ").map(e=>parseFloat(e));return[r||0,n||0,t||0]}e.s(["getPosition",()=>W,"getProperty",()=>U,"getScale",()=>K,"normalizedMissionTypes",0,q,"parseMissionScript",()=>J],62395)}]); |