subscript 10.4.12 → 10.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/feature/switch.js CHANGED
@@ -19,7 +19,7 @@ const caseBody = (c) => {
19
19
  const stmts = [];
20
20
  while ((c = parse.space()) !== CBRACE && !word('case') && !word('default')) {
21
21
  if (c === SEMI) { skip(); continue; }
22
- stmts.push(expr(STATEMENT - .5)) || err();
22
+ stmts.push(expr(STATEMENT + .5)) || err();
23
23
  }
24
24
  return stmts.length > 1 ? [';', ...stmts] : stmts[0] || null;
25
25
  };
package/jessie.min.js CHANGED
@@ -1,9 +1,9 @@
1
1
  var u,c,s=r=>(u=0,c=r,s.enter?.(),r=d(),c[u]?N():r||""),N=(r="Unexpected token",e=u,t=c.slice(0,e).split(`
2
2
  `),o=t.pop(),n=c.slice(Math.max(0,e-40),e),p="\u032D",m=(c[e]||" ")+p,l=c.slice(e+1,e+20))=>{throw SyntaxError(`${r} at ${t.length+1}:${o.length+1}
3
3
  ${c[e-41]!==`
4
- `,""+n}${m}${l}`)},Mr=(r,e=u)=>(Array.isArray(r)&&(r.loc=e),r),T=(r,e=u,t)=>{for(;t=r(c.charCodeAt(u));)u+=t;return c.slice(e,u)},h=(r=1)=>c[u+=r],O=r=>u=r,d=(r=0,e)=>{let t,o,n;for(e&&s.enter?.(r,e);(t=s.space())&&t!==e&&(n=s.step(o,r,t,d));)o=n;return e&&(t==e?(u++,s.exit?.(r,e)):N("Unclosed "+String.fromCharCode(e-(e>42?2:1)))),o},j=(r=u)=>{for(;c.charCodeAt(r)<=32;)r++;return c.charCodeAt(r)},so=s.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,k=(r,e=r.length)=>c.substr(u,e)===r&&!s.id(c.charCodeAt(u+e)),L=()=>(h(),d(0,41)),I=[],G={},S=(r,e=32,t,o=r.charCodeAt(0),n=r.length,p=I[o],m=r.toUpperCase()!==r,l,a)=>(e=G[r]=!p&&G[r]||e,I[o]=(y,g,E,w=u)=>(l=E,(E?r==E:(n<2||r.charCodeAt(1)===c.charCodeAt(u+1)&&(n<3||c.substr(u,n)==r))&&(!m||!s.id(c.charCodeAt(u+n)))&&(l=E=r))&&g<e&&(u+=n,(a=t(y))?Mr(a,w):(u=w,l=0,!m&&!p&&!y&&N()),a)||p?.(y,g,l))),A=(r,e,t=!1)=>S(r,e,o=>o&&(n=>n&&[r,o,n])(d(e-(t?.5:0)))),_=(r,e,t)=>S(r,e,o=>t?o&&[r,o]:!o&&(o=d(e-.5))&&[r,o]),Q=(r,e)=>S(r,200,t=>!t&&[,e]),pr=(r,e,t,o)=>S(r,e,(n,p)=>(p=d(e-(t?.5:0)),n?.[0]!==r&&(n=[r,n||null]),p?.[0]===r?n.push(...p.slice(1)):p?n.push(p):(o||j()===r.charCodeAt(0))&&n.push(null),n)),W=(r,e)=>S(r[0],e,t=>!t&&[r,d(0,r.charCodeAt(1))||null]),fr=(r,e)=>S(r[0],e,t=>t&&[r,t,d(0,r.charCodeAt(1))||null]),lr=(r,e)=>(s.space(),e=c.charCodeAt(u),s.id(e)&&(e<48||e>57)?T(s.id):d(r)),Ur=(r,e)=>S(r,e,t=>t&&(o=>o&&[r,t,o])(lr(e))),C=(r,e,t,o=r.charCodeAt(0),n=r.length,p=I[o],m)=>(G[r]??=e,I[o]=(l,a,y,g=u)=>!l&&(y?r==y:(n<2||c.substr(u,n)==r)&&(y=r))&&a<e&&!s.id(c.charCodeAt(u+n))&&(!s.prop||s.prop(u+n))&&(O(u+n),(m=t())?Mr(m,g):O(g),m)||p?.(l,a,y));s.space=r=>{for(;(r=c.charCodeAt(u))<=32;)u++;return r};s.step=(r,e,t,o,n)=>(n=I[t])&&n(r,e)||(r?null:T(s.id)||null);var sr={},f=(r,e,t=sr[r])=>sr[r]=(...o)=>e(...o)||t?.(...o),i=r=>Array.isArray(r)?r[0]==null?(e=>()=>e)(r[1]):sr[r[0]]?.(...r.slice(1))??N(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:e=>e?.[r];var Z=46,z=48,q=57,ke=69,Te=101,Ie=43,Ne=45,Y=95,Dr=110,Re=97,_e=102,Oe=65,Le=70,Fr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),ur=r=>{let e=Fr(T(t=>t===Z&&c.charCodeAt(u+1)!==Z||t>=z&&t<=q||t===Y||((t===ke||t===Te)&&((t=c.charCodeAt(u+1))>=z&&t<=q||t===Ie||t===Ne)?2:0)));return c.charCodeAt(u)===Dr?(h(),[,BigInt(e)]):(r=+e)!=r?N():[,r]},Pe={2:r=>r===48||r===49||r===Y,8:r=>r>=48&&r<=55||r===Y,16:r=>r>=z&&r<=q||r>=Re&&r<=_e||r>=Oe&&r<=Le||r===Y};s.number=null;I[Z]=r=>!r&&c.charCodeAt(u+1)!==Z&&ur();for(let r=z;r<=q;r++)I[r]=e=>e?void 0:ur();I[z]=r=>{if(r)return;let e=s.number;if(e){for(let[t,o]of Object.entries(e))if(t[0]==="0"&&c[u+1]?.toLowerCase()===t[1]){h(2);let n=Fr(T(Pe[o]));return c.charCodeAt(u)===Dr?(h(),[,BigInt("0"+t[1]+n)]):[,parseInt(n,o)]}}return ur()};var Be=92,Gr=34,Kr=39,Xr=117,Hr=120,ve=123,Me=125,Qr=10,Ue=13,De={n:`
4
+ `,""+n}${m}${l}`)},Mr=(r,e=u)=>(Array.isArray(r)&&(r.loc=e),r),T=(r,e=u,t)=>{for(;t=r(c.charCodeAt(u));)u+=t;return c.slice(e,u)},h=(r=1)=>c[u+=r],O=r=>u=r,d=(r=0,e)=>{let t,o,n;for(e&&s.enter?.(r,e);(t=s.space())&&t!==e&&(n=s.step(o,r,t,d));)o=n;return e&&(t==e?(u++,s.exit?.(r,e)):N("Unclosed "+String.fromCharCode(e-(e>42?2:1)))),o},j=(r=u)=>{for(;c.charCodeAt(r)<=32;)r++;return c.charCodeAt(r)},so=s.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,k=(r,e=r.length)=>c.substr(u,e)===r&&!s.id(c.charCodeAt(u+e)),L=()=>(h(),d(0,41)),I=[],G={},S=(r,e=32,t,o=r.charCodeAt(0),n=r.length,p=I[o],m=r.toUpperCase()!==r,l,a)=>(e=G[r]=!p&&G[r]||e,I[o]=(y,g,E,w=u)=>(l=E,(E?r==E:(n<2||r.charCodeAt(1)===c.charCodeAt(u+1)&&(n<3||c.substr(u,n)==r))&&(!m||!s.id(c.charCodeAt(u+n)))&&(l=E=r))&&g<e&&(u+=n,(a=t(y))?Mr(a,w):(u=w,l=0,!m&&!p&&!y&&N()),a)||p?.(y,g,l))),A=(r,e,t=!1)=>S(r,e,o=>o&&(n=>n&&[r,o,n])(d(e-(t?.5:0)))),_=(r,e,t)=>S(r,e,o=>t?o&&[r,o]:!o&&(o=d(e-.5))&&[r,o]),Q=(r,e)=>S(r,200,t=>!t&&[,e]),pr=(r,e,t,o)=>S(r,e,(n,p)=>(p=d(e-(t?.5:0)),n?.[0]!==r&&(n=[r,n||null]),p?.[0]===r?n.push(...p.slice(1)):p?n.push(p):o||j()===r.charCodeAt(0)?n.push(null):n.length===2&&(n=n[1]),n)),W=(r,e)=>S(r[0],e,t=>!t&&[r,d(0,r.charCodeAt(1))||null]),fr=(r,e)=>S(r[0],e,t=>t&&[r,t,d(0,r.charCodeAt(1))||null]),lr=(r,e)=>(s.space(),e=c.charCodeAt(u),s.id(e)&&(e<48||e>57)?T(s.id):d(r)),Ur=(r,e)=>S(r,e,t=>t&&(o=>o&&[r,t,o])(lr(e))),C=(r,e,t,o=r.charCodeAt(0),n=r.length,p=I[o],m)=>(G[r]??=e,I[o]=(l,a,y,g=u)=>!l&&(y?r==y:(n<2||c.substr(u,n)==r)&&(y=r))&&a<e&&!s.id(c.charCodeAt(u+n))&&(!s.prop||s.prop(u+n))&&(O(u+n),(m=t())?Mr(m,g):O(g),m)||p?.(l,a,y));s.space=r=>{for(;(r=c.charCodeAt(u))<=32;)u++;return r};s.step=(r,e,t,o,n)=>(n=I[t])&&n(r,e)||(r?null:T(s.id)||null);var sr={},f=(r,e,t=sr[r])=>sr[r]=(...o)=>e(...o)||t?.(...o),i=r=>Array.isArray(r)?r[0]==null?(e=>()=>e)(r[1]):sr[r[0]]?.(...r.slice(1))??N(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:e=>e?.[r];var Z=46,z=48,q=57,ke=69,Te=101,Ie=43,Ne=45,Y=95,Dr=110,Re=97,_e=102,Oe=65,Le=70,Fr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),ur=r=>{let e=Fr(T(t=>t===Z&&c.charCodeAt(u+1)!==Z||t>=z&&t<=q||t===Y||((t===ke||t===Te)&&((t=c.charCodeAt(u+1))>=z&&t<=q||t===Ie||t===Ne)?2:0)));return c.charCodeAt(u)===Dr?(h(),[,BigInt(e)]):(r=+e)!=r?N():[,r]},Pe={2:r=>r===48||r===49||r===Y,8:r=>r>=48&&r<=55||r===Y,16:r=>r>=z&&r<=q||r>=Re&&r<=_e||r>=Oe&&r<=Le||r===Y};s.number=null;I[Z]=r=>!r&&c.charCodeAt(u+1)!==Z&&ur();for(let r=z;r<=q;r++)I[r]=e=>e?void 0:ur();I[z]=r=>{if(r)return;let e=s.number;if(e){for(let[t,o]of Object.entries(e))if(t[0]==="0"&&c[u+1]?.toLowerCase()===t[1]){h(2);let n=Fr(T(Pe[o]));return c.charCodeAt(u)===Dr?(h(),[,BigInt("0"+t[1]+n)]):[,parseInt(n,o)]}}return ur()};var Be=92,Gr=34,Kr=39,Xr=117,Hr=120,ve=123,Me=125,Qr=10,Ue=13,De={n:`
5
5
  `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},$r=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,jr=r=>(e,t,o="",n=String.fromCharCode(r))=>{if(e||!s.string?.[n])return;h();let p=()=>{let m=c.charCodeAt(u+1);if(m===Qr)return 2;if(m===Ue)return c.charCodeAt(u+2)===Qr?3:2;if(m===Hr||m===Xr&&c.charCodeAt(u+2)!==ve){let l=m===Hr?2:4,a=0,y;for(let g=0;g<l;g++){if((y=$r(c.charCodeAt(u+2+g)))<0)return o+=c[u+1],2;a=a*16+y}return o+=String.fromCharCode(a),2+l}if(m===Xr){let l=0,a=u+3,y;for(;(y=$r(c.charCodeAt(a)))>=0;)l=l*16+y,a++;return a>u+3&&l<=1114111&&c.charCodeAt(a)===Me?(o+=String.fromCodePoint(l),a-u+1):(o+=c[u+1],2)}return o+=De[c[u+1]]||c[u+1],2};return T(m=>m-r&&(m!==Be?(o+=c[u],1):p())),c[u]===n?h():N("Bad string"),[,o]};I[Gr]=jr(Gr);I[Kr]=jr(Kr);s.string={'"':!0};var Fe=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>A(r,Fe,!0));var Ge=30,Ke=40,Xe=140;_("!",Xe);A("||",Ge);A("&&",Ke);var He=50,Qe=60,$e=70,Wr=100,je=140;A("|",He);A("&",$e);A("^",Qe);A(">>",Wr);A("<<",Wr);_("~",je);var x=90;A("<",x);A(">",x);A("<=",x);A(">=",x);var zr=80;A("==",zr);A("!=",zr);var Jr=110,mr=120,Vr=140;A("+",Jr);A("-",Jr);A("*",mr);A("/",mr);A("%",mr);_("+",Vr);_("-",Vr);var b=150;S("++",b,r=>r?["++",r,null]:["++",d(b-1)]);S("--",b,r=>r?["--",r,null]:["--",d(b-1)]);var We=5,ze=10;pr(",",ze);pr(";",We,!0,!0);var Je=170;W("()",Je);var Yr=170,Ve=160;fr("[]",Yr);Ur(".",Yr);fr("()",Ve);var Ye=32,Ze=s.space;s.comment??={"//":`
6
6
  `,"/*":"*/"};var cr;s.space=()=>{cr||(cr=Object.entries(s.comment).map(([n,p])=>[n,p,n.charCodeAt(0)]));for(var r;r=Ze();){for(var e=0,t;t=cr[e++];)if(r===t[2]&&c.substr(u,t[0].length)===t[0]){var o=u+t[0].length;if(t[1]===`
7
7
  `)for(;c.charCodeAt(o)>=Ye;)o++;else{for(;c[o]&&c.substr(o,t[1].length)!==t[1];)o++;c[o]&&(o+=t[1].length)}O(o),r=0;break}if(r)return r}return r};var Zr=80;A("===",Zr);A("!==",Zr);var qe=30;A("??",qe);var xe=130,be=20;A("**",xe,!0);A("**=",be,!0);var qr=90;A("in",qr);A("of",qr);var rt=20,et=100;A(">>>",et);A(">>>=",rt,!0);var ar=20;A("||=",ar,!0);A("&&=",ar,!0);A("??=",ar,!0);Q("true",!0);Q("false",!1);Q("null",null);C("undefined",200,()=>[]);Q("NaN",NaN);Q("Infinity",1/0);var dr=20;S("?",dr,(r,e,t)=>r&&(e=d(dr-1))&&T(o=>o===58)&&(t=d(dr-1),["?",r,e,t]));var tt=20;A("=>",tt,!0);var ot=20;_("...",ot);var xr=170;S("?.",xr,(r,e)=>{if(!r)return;let t=s.space();return t===40?(h(),["?.()",r,d(0,41)||null]):t===91?(h(),["?.[]",r,d(0,93)]):(e=lr(xr),e?["?.",r,e]:void 0)});var hr=140,br=160,nt=br+1;_("typeof",hr);_("void",hr);_("delete",hr);var it=r=>s.space()===40?(h(),["()",r,d(0,41)||null]):r;C("new",nt,()=>k(".target")?(h(7),["new.target"]):["new",it(d(br))]);var st=20,re=200;s.prop=r=>j(r)!==58;W("[]",re);W("{}",re);A(":",st-1,!0);var pt=170,Ar=96,ft=36,lt=123,ut=92,mt={n:`
8
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},ee=()=>{let r=[],e="",t;for(;(t=c.charCodeAt(u))!==Ar;)t?t===ut?(h(),e+=mt[c[u]]||c[u],h()):t===ft&&c.charCodeAt(u+1)===lt?(r.push([,e]),e="",h(2),r.push(d(0,125))):(e+=c[u],h()):N("Unterminated template");return r.push([,e]),h(),r},ct=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],at=I[Ar];I[Ar]=(r,e)=>r&&e<pt?s.asi&&s.newline?void 0:(h(),["``",r,...ee()]):r?at?.(r,e):(h(),ct(ee()));s.string["'"]=!0;s.number={"0x":16,"0b":2,"0o":8};var dt=92,ht=117,At=123,yt=125,Ct=183,wt=s.id,te=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,gt=(r=u+2,e,t=0,o=0)=>{if(c.charCodeAt(u)!==dt||c.charCodeAt(u+1)!==ht)return 0;if(c.charCodeAt(r)===At){for(;te(e=c.charCodeAt(++r));)t=t*16+(e<=57?e-48:(e&31)+9);return r>u+3&&t<=1114111&&c.charCodeAt(r)===yt?r-u+1:0}for(;o<4&&te(c.charCodeAt(r+o));)o++;return o===4?6:0};s.id=r=>wt(r)||r===Ct||gt();var yr=5,Et=10,Cr=r=>{let e=u,t=d(Et-1);return t==null?r:r==="let"&&(t==="in"||t==="of")?(O(e),r):t[0]==="in"||t[0]==="of"?[t[0],[r,t[1]],t[2]]:t[0]===","?[r,...t.slice(1)]:[r,t]};C("let",yr+1,()=>Cr("let"));C("const",yr+1,()=>Cr("const"));C("var",yr+1,()=>Cr("var"));var rr=5,St=59,B=()=>(s.space()===123||N("Expected {"),h(),d(rr-.5,125)||null),U=()=>s.space()!==123?d(rr+.5):(h(),d(rr-.5,125)||null),kt=()=>{let r=u;return s.space()===St&&h(),s.space(),k("else")?(h(4),s.semi=!1,!0):(O(r),!1)};C("if",rr+1,()=>{s.space();let r=["if",L(),U()];return kt()&&r.push(U()),r});var Tt=200;C("function",Tt,()=>{s.space();let r=!1;c[u]==="*"&&(r=!0,h(),s.space());let e=T(s.id);return e&&s.space(),r?["function*",e,L()||null,B()]:["function",e,L()||null,B()]});var er=140,wr=20;_("await",er);C("yield",er,()=>(s.space(),c[u]==="*"?(h(),s.space(),["yield*",d(wr)]):["yield",d(wr)]));C("async",er,()=>{if(s.space(),k("function"))return["async",d(er)];let r=d(wr-.5);return r&&["async",r]});var gr=200;var It=90,Nt=175;_("static",Nt);A("instanceof",It);S("#",gr,r=>{if(r)return;let e=T(s.id);return e?"#"+e:void 0});C("class",gr,()=>{s.space();let r=T(s.id)||null;if(r==="extends")r=null,s.space();else{if(s.space(),!k("extends"))return["class",r,null,B()];h(7),s.space()}return["class",r,d(gr),B()]});var Er=47,Rt=92,_t=91,Ot=93;S("/",140,r=>{let e=c.charCodeAt(u);if(r||e===Er||e===42||e===43||e===63)return;let t=!1,o=T(p=>p===Rt?2:p===_t?(t=!0,1):p===Ot?(t=!1,1):p&&(t||p!==Er));c.charCodeAt(u)===Er||N("Unterminated regex"),h();let n=T(p=>p===103||p===105||p===109||p===115||p===117||p===121);return n?["//",o,n]:["//",o]});var H=5,J=125,V=59;C("while",H+1,()=>(s.space(),["while",L(),U()]));C("do",H+1,()=>(r=>(s.space(),h(5),s.space(),["do",r,L()]))(U()));C("for",H+1,()=>(s.space(),k("await")?(h(5),s.space(),["for await",L(),U()]):["for",L(),U()]));C("break",H+1,()=>{s.asi&&(s.newline=!1);let r=u;s.space();let e=c.charCodeAt(u);if(!e||e===J||e===V||s.newline)return["break"];let t=T(s.id);if(!t)return["break"];s.space();let o=c.charCodeAt(u);return!o||o===J||o===V||s.newline?["break",t]:(O(r),["break"])});C("continue",H+1,()=>{s.asi&&(s.newline=!1);let r=u;s.space();let e=c.charCodeAt(u);if(!e||e===J||e===V||s.newline)return["continue"];let t=T(s.id);if(!t)return["continue"];s.space();let o=c.charCodeAt(u);return!o||o===J||o===V||s.newline?["continue",t]:(O(r),["continue"])});C("return",H+1,()=>{s.asi&&(s.newline=!1);let r=s.space();return!r||r===J||r===V||s.newline?["return"]:["return",d(H)]});var Sr=5;C("try",Sr+1,()=>{let r=["try",B()];return s.space(),k("catch")&&(h(5),s.space(),r.push(["catch",j()===40?L():null,B()])),s.space(),k("finally")&&(h(7),r.push(["finally",B()])),r});C("throw",Sr+1,()=>{if(s.asi&&(s.newline=!1),s.space(),s.newline)throw SyntaxError("Unexpected newline after throw");return["throw",d(Sr)]});var ie=5,Lt=20,oe=58,Pt=59,se=125,kr=0,pe=(r,e=r.length,t=r.charCodeAt(0),o=I[t])=>I[t]=(n,p,m)=>k(r)&&!n&&kr||o?.(n,p,m);pe("case");pe("default");var ne=r=>{let e=[];for(;(r=s.space())!==se&&!k("case")&&!k("default");){if(r===Pt){h();continue}e.push(d(ie-.5))||N()}return e.length>1?[";",...e]:e[0]||null},Bt=()=>{s.space()===123||N("Expected {"),h(),kr++;let r=[];try{for(;s.space()!==se;)if(k("case")){O(u+4),s.space();let e=d(Lt-.5);s.space()===oe&&h(),r.push(["case",e,ne()])}else k("default")?(O(u+7),s.space()===oe&&h(),r.push(["default",ne()])):N("Expected case or default")}finally{kr--}return h(),r};C("switch",ie+1,()=>s.space()===40&&["switch",L(),...Bt()]);var Tr=5,vt=20;C("debugger",Tr+1,()=>["debugger"]);C("with",Tr+1,()=>(s.space(),["with",L(),U()]));var Mt=["if","for","while","do","switch","try"];S(":",vt-1,r=>typeof r=="string"&&(s.space(),Mt.some(e=>k(e)))&&[":",r,d(Tr)]);var Ir=5,$=10,fe=42,Ut=I[fe];I[fe]=(r,e)=>r?Ut?.(r,e):(h(),"*");S("from",$+1,r=>r?r[0]!=="="&&r[0]!==","&&(s.space(),["from",r,d($+1)]):!1);S("as",$+2,r=>r?(s.space(),["as",r,d($+2)]):!1);C("import",Ir,()=>k(".meta")?(h(5),["import.meta"]):["import",d($)]);C("export",Ir,()=>(s.space(),k("default")?(h(7),["export",["default",d($)]]):["export",d(Ir)]));var Nr=20,Dt=10,Ft=13,Gt=40,le=41,ue=123,me=125,Kt=(r,e)=>{for(;r<e;){let t=c.charCodeAt(r++);if(t===Dt||t===Ft)return!0}return!1},ce=r=>e=>{if(e)return;let t=u;if(s.space(),s.semi||Kt(t,u))return!1;let o=T(s.id);if(!o||(s.space(),c.charCodeAt(u)!==Gt))return!1;h();let n=d(0,le);return s.space(),c.charCodeAt(u)!==ue?!1:(h(),[r,o,n,d(0,me)])};S("get",Nr-1,ce("get"));S("set",Nr-1,ce("set"));S("(",Nr-1,r=>{if(!r)return;let e;if(Array.isArray(r)&&r[0]==="static"&&(e="static",r=r[1]),typeof r!="string"&&!(Array.isArray(r)&&r[0]===void 0))return;let t=d(0,le)||null;if(s.space(),c.charCodeAt(u)!==ue)return;h();let o=[":",r,["=>",["()",t],d(0,me)||null]];return e?[e,o]:o});s.comment["#!"]=`
8
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},ee=()=>{let r=[],e="",t;for(;(t=c.charCodeAt(u))!==Ar;)t?t===ut?(h(),e+=mt[c[u]]||c[u],h()):t===ft&&c.charCodeAt(u+1)===lt?(r.push([,e]),e="",h(2),r.push(d(0,125))):(e+=c[u],h()):N("Unterminated template");return r.push([,e]),h(),r},ct=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],at=I[Ar];I[Ar]=(r,e)=>r&&e<pt?s.asi&&s.newline?void 0:(h(),["``",r,...ee()]):r?at?.(r,e):(h(),ct(ee()));s.string["'"]=!0;s.number={"0x":16,"0b":2,"0o":8};var dt=92,ht=117,At=123,yt=125,Ct=183,wt=s.id,te=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,gt=(r=u+2,e,t=0,o=0)=>{if(c.charCodeAt(u)!==dt||c.charCodeAt(u+1)!==ht)return 0;if(c.charCodeAt(r)===At){for(;te(e=c.charCodeAt(++r));)t=t*16+(e<=57?e-48:(e&31)+9);return r>u+3&&t<=1114111&&c.charCodeAt(r)===yt?r-u+1:0}for(;o<4&&te(c.charCodeAt(r+o));)o++;return o===4?6:0};s.id=r=>wt(r)||r===Ct||gt();var yr=5,Et=10,Cr=r=>{let e=u,t=d(Et-1);return t==null?r:r==="let"&&(t==="in"||t==="of")?(O(e),r):t[0]==="in"||t[0]==="of"?[t[0],[r,t[1]],t[2]]:t[0]===","?[r,...t.slice(1)]:[r,t]};C("let",yr+1,()=>Cr("let"));C("const",yr+1,()=>Cr("const"));C("var",yr+1,()=>Cr("var"));var rr=5,St=59,B=()=>(s.space()===123||N("Expected {"),h(),d(rr-.5,125)||null),U=()=>s.space()!==123?d(rr+.5):(h(),d(rr-.5,125)||null),kt=()=>{let r=u;return s.space()===St&&h(),s.space(),k("else")?(h(4),s.semi=!1,!0):(O(r),!1)};C("if",rr+1,()=>{s.space();let r=["if",L(),U()];return kt()&&r.push(U()),r});var Tt=200;C("function",Tt,()=>{s.space();let r=!1;c[u]==="*"&&(r=!0,h(),s.space());let e=T(s.id);return e&&s.space(),r?["function*",e,L()||null,B()]:["function",e,L()||null,B()]});var er=140,wr=20;_("await",er);C("yield",er,()=>(s.space(),c[u]==="*"?(h(),s.space(),["yield*",d(wr)]):["yield",d(wr)]));C("async",er,()=>{if(s.space(),k("function"))return["async",d(er)];let r=d(wr-.5);return r&&["async",r]});var gr=200;var It=90,Nt=175;_("static",Nt);A("instanceof",It);S("#",gr,r=>{if(r)return;let e=T(s.id);return e?"#"+e:void 0});C("class",gr,()=>{s.space();let r=T(s.id)||null;if(r==="extends")r=null,s.space();else{if(s.space(),!k("extends"))return["class",r,null,B()];h(7),s.space()}return["class",r,d(gr),B()]});var Er=47,Rt=92,_t=91,Ot=93;S("/",140,r=>{let e=c.charCodeAt(u);if(r||e===Er||e===42||e===43||e===63)return;let t=!1,o=T(p=>p===Rt?2:p===_t?(t=!0,1):p===Ot?(t=!1,1):p&&(t||p!==Er));c.charCodeAt(u)===Er||N("Unterminated regex"),h();let n=T(p=>p===103||p===105||p===109||p===115||p===117||p===121);return n?["//",o,n]:["//",o]});var H=5,J=125,V=59;C("while",H+1,()=>(s.space(),["while",L(),U()]));C("do",H+1,()=>(r=>(s.space(),h(5),s.space(),["do",r,L()]))(U()));C("for",H+1,()=>(s.space(),k("await")?(h(5),s.space(),["for await",L(),U()]):["for",L(),U()]));C("break",H+1,()=>{s.asi&&(s.newline=!1);let r=u;s.space();let e=c.charCodeAt(u);if(!e||e===J||e===V||s.newline)return["break"];let t=T(s.id);if(!t)return["break"];s.space();let o=c.charCodeAt(u);return!o||o===J||o===V||s.newline?["break",t]:(O(r),["break"])});C("continue",H+1,()=>{s.asi&&(s.newline=!1);let r=u;s.space();let e=c.charCodeAt(u);if(!e||e===J||e===V||s.newline)return["continue"];let t=T(s.id);if(!t)return["continue"];s.space();let o=c.charCodeAt(u);return!o||o===J||o===V||s.newline?["continue",t]:(O(r),["continue"])});C("return",H+1,()=>{s.asi&&(s.newline=!1);let r=s.space();return!r||r===J||r===V||s.newline?["return"]:["return",d(H)]});var Sr=5;C("try",Sr+1,()=>{let r=["try",B()];return s.space(),k("catch")&&(h(5),s.space(),r.push(["catch",j()===40?L():null,B()])),s.space(),k("finally")&&(h(7),r.push(["finally",B()])),r});C("throw",Sr+1,()=>{if(s.asi&&(s.newline=!1),s.space(),s.newline)throw SyntaxError("Unexpected newline after throw");return["throw",d(Sr)]});var ie=5,Lt=20,oe=58,Pt=59,se=125,kr=0,pe=(r,e=r.length,t=r.charCodeAt(0),o=I[t])=>I[t]=(n,p,m)=>k(r)&&!n&&kr||o?.(n,p,m);pe("case");pe("default");var ne=r=>{let e=[];for(;(r=s.space())!==se&&!k("case")&&!k("default");){if(r===Pt){h();continue}e.push(d(ie+.5))||N()}return e.length>1?[";",...e]:e[0]||null},Bt=()=>{s.space()===123||N("Expected {"),h(),kr++;let r=[];try{for(;s.space()!==se;)if(k("case")){O(u+4),s.space();let e=d(Lt-.5);s.space()===oe&&h(),r.push(["case",e,ne()])}else k("default")?(O(u+7),s.space()===oe&&h(),r.push(["default",ne()])):N("Expected case or default")}finally{kr--}return h(),r};C("switch",ie+1,()=>s.space()===40&&["switch",L(),...Bt()]);var Tr=5,vt=20;C("debugger",Tr+1,()=>["debugger"]);C("with",Tr+1,()=>(s.space(),["with",L(),U()]));var Mt=["if","for","while","do","switch","try"];S(":",vt-1,r=>typeof r=="string"&&(s.space(),Mt.some(e=>k(e)))&&[":",r,d(Tr)]);var Ir=5,$=10,fe=42,Ut=I[fe];I[fe]=(r,e)=>r?Ut?.(r,e):(h(),"*");S("from",$+1,r=>r?r[0]!=="="&&r[0]!==","&&(s.space(),["from",r,d($+1)]):!1);S("as",$+2,r=>r?(s.space(),["as",r,d($+2)]):!1);C("import",Ir,()=>k(".meta")?(h(5),["import.meta"]):["import",d($)]);C("export",Ir,()=>(s.space(),k("default")?(h(7),["export",["default",d($)]]):["export",d(Ir)]));var Nr=20,Dt=10,Ft=13,Gt=40,le=41,ue=123,me=125,Kt=(r,e)=>{for(;r<e;){let t=c.charCodeAt(r++);if(t===Dt||t===Ft)return!0}return!1},ce=r=>e=>{if(e)return;let t=u;if(s.space(),s.semi||Kt(t,u))return!1;let o=T(s.id);if(!o||(s.space(),c.charCodeAt(u)!==Gt))return!1;h();let n=d(0,le);return s.space(),c.charCodeAt(u)!==ue?!1:(h(),[r,o,n,d(0,me)])};S("get",Nr-1,ce("get"));S("set",Nr-1,ce("set"));S("(",Nr-1,r=>{if(!r)return;let e;if(Array.isArray(r)&&r[0]==="static"&&(e="static",r=r[1]),typeof r!="string"&&!(Array.isArray(r)&&r[0]===void 0))return;let t=d(0,le)||null;if(s.space(),c.charCodeAt(u)!==ue)return;h();let o=[":",r,["=>",["()",t],d(0,me)||null]];return e?[e,o]:o});s.comment["#!"]=`
9
9
  `;var Ae=32,Lr=10,Xt=59,Ht=125,ae=91,de=40,tr=G.asi??G[";"],Qt=s._baseSpace??=s.space,$t=s._baseStep??=s.step,Rr=r=>Array.isArray(r)||typeof r=="string",jt=(G[";"]??5)+1,Or=r=>Array.isArray(r)&&(G[r[0]]<=jt||r[0]==="{}"&&Or(r[1])),Wt=(r,e)=>{for(;(e=c.charCodeAt(r))<=Ae;){if(e===Lr)return!0;r++}return!1},zt=(r=u,e)=>{for(;r-- >0&&(e=c.charCodeAt(r))<=Ae;)if(e===Lr)return!0;return!1};s.space=(r,e)=>{for(;;){for(e=u,r=Qt();e<u;)if(c.charCodeAt(e++)===Lr){s.newline=!0;break}if(r===Xt&&Wt(u+1)){O(u+1),s.newline=s.semi=!0;continue}return r}};s.enter=()=>s.newline=s.semi=!1;s.exit=(r,e)=>{e===Ht&&(s.newline=!0,s.semi=!1)};s.step=(r,e,t,o)=>{if(s.semi&&e>=tr)return!1;if(r&&!Rr(r))return null;if(Rr(r)){let p=(t===ae||t===de)&&zt();if(s.semi||t===ae&&(p||Or(r))||t===de&&(Or(r)||p&&e>=tr))return he(r,e,o)??null}let n=s.newline;return $t(r,e,t,o)??(Rr(r)&&n?he(r,e,o)??null:null)};var _r=0,Jt=2e3,he=s.asi=(r,e,t,o,n)=>{if(e>=tr||_r>=Jt)return;s.semi=!1;let p=u;_r++;try{o=t(tr-.5)}finally{_r--}if(!(!o||u===p))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var Ce=(r,e,t,o)=>typeof r=="string"?n=>e(n,r,n):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o,n)):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n),n)):r[0]==="()"&&r.length===2?Ce(r[1],e):(()=>{throw Error("Invalid assignment target")})(),ye={"=":(r,e,t)=>r[e]=t,"+=":(r,e,t)=>r[e]+=t,"-=":(r,e,t)=>r[e]-=t,"*=":(r,e,t)=>r[e]*=t,"/=":(r,e,t)=>r[e]/=t,"%=":(r,e,t)=>r[e]%=t,"|=":(r,e,t)=>r[e]|=t,"&=":(r,e,t)=>r[e]&=t,"^=":(r,e,t)=>r[e]^=t,">>=":(r,e,t)=>r[e]>>=t,"<<=":(r,e,t)=>r[e]<<=t};for(let r in ye)f(r,(e,t)=>(t=i(t),Ce(e,(o,n,p)=>ye[r](o,n,t(p)))));f("!",r=>(r=i(r),e=>!r(e)));f("||",(r,e)=>(r=i(r),e=i(e),t=>r(t)||e(t)));f("&&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&&e(t)));f("~",r=>(r=i(r),e=>~r(e)));f("|",(r,e)=>(r=i(r),e=i(e),t=>r(t)|e(t)));f("&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&e(t)));f("^",(r,e)=>(r=i(r),e=i(e),t=>r(t)^e(t)));f(">>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>e(t)));f("<<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<<e(t)));f(">",(r,e)=>(r=i(r),e=i(e),t=>r(t)>e(t)));f("<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<e(t)));f(">=",(r,e)=>(r=i(r),e=i(e),t=>r(t)>=e(t)));f("<=",(r,e)=>(r=i(r),e=i(e),t=>r(t)<=e(t)));f("==",(r,e)=>(r=i(r),e=i(e),t=>r(t)==e(t)));f("!=",(r,e)=>(r=i(r),e=i(e),t=>r(t)!=e(t)));f("+",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)+e(t)):(r=i(r),t=>+r(t)));f("-",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)-e(t)):(r=i(r),t=>-r(t)));f("*",(r,e)=>(r=i(r),e=i(e),t=>r(t)*e(t)));f("/",(r,e)=>(r=i(r),e=i(e),t=>r(t)/e(t)));f("%",(r,e)=>(r=i(r),e=i(e),t=>r(t)%e(t)));var Pr=(r,e,t,o)=>typeof r=="string"?n=>e(n,r):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o)):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n))):r[0]==="()"&&r.length===2?Pr(r[1],e):(()=>{throw Error("Invalid increment target")})();f("++",(r,e)=>Pr(r,e===null?(t,o)=>t[o]++:(t,o)=>++t[o]));f("--",(r,e)=>Pr(r,e===null?(t,o)=>t[o]--:(t,o)=>--t[o]));var we=(...r)=>(r=r.map(i),e=>{let t;for(let o of r)t=o(e);return t});f(",",we);f(";",we);var D=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",or=r=>{throw Error(r)};f("[]",(r,e)=>e===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(t=>t==null?(()=>{}):t[0]==="..."?(t=i(t[1]),o=>t(o)):(t=i(t),o=>[t(o)])),t=>r.flatMap(o=>o(t))):(e==null&&or("Missing index"),r=i(r),e=i(e),t=>{let o=e(t);return D(o)?void 0:r(t)[o]}));f(".",(r,e)=>(r=i(r),e=e[0]?e:e[1],D(e)?()=>{}:t=>r(t)[e]));f("()",(r,e)=>{if(e===void 0)return r==null?or("Empty ()"):i(r);let t=n=>n?.[0]===","&&n.slice(1).some(p=>p==null||t(p));t(e)&&or("Empty argument");let o=e?e[0]===","?(e=e.slice(1).map(i),n=>e.map(p=>p(n))):(e=i(e),n=>[e(n)]):()=>[];return Br(r,(n,p,m)=>n[p](...o(m)))});var v=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&v(r[1])||r[0]==="{}"),Br=(r,e,t,o)=>r==null?or("Empty ()"):r[0]==="()"&&r.length==2?Br(r[1],e):typeof r=="string"?n=>e(n,r,n):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o,n)):r[0]==="?."?(t=i(r[1]),o=r[2],n=>{let p=t(n);return p==null?void 0:e(p,o,n)}):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n),n)):r[0]==="?.[]"?(t=i(r[1]),o=i(r[2]),n=>{let p=t(n);return p==null?void 0:e(p,o(n),n)}):(r=i(r),n=>e([r(n)],0,n)),F=Br;f("===",(r,e)=>(r=i(r),e=i(e),t=>r(t)===e(t)));f("!==",(r,e)=>(r=i(r),e=i(e),t=>r(t)!==e(t)));f("??",(r,e)=>(r=i(r),e=i(e),t=>r(t)??e(t)));var Vt=r=>{throw Error(r)};f("**",(r,e)=>(r=i(r),e=i(e),t=>r(t)**e(t)));f("**=",(r,e)=>(v(r)||Vt("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]**=e(n))));f("in",(r,e)=>(r=i(r),e=i(e),t=>r(t)in e(t)));var Yt=r=>{throw Error(r)};f(">>>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>>e(t)));f(">>>=",(r,e)=>(v(r)||Yt("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]>>>=e(n))));var Zt=r=>r[0]?.[0]===","?r[0].slice(1):r,K=(r,e,t)=>{if(typeof r=="string"){t[r]=e;return}let[o,...n]=r,p=Zt(n);if(o==="{}"){let m=[];for(let l of p){if(Array.isArray(l)&&l[0]==="..."){let w={};for(let R in e)m.includes(R)||(w[R]=e[R]);t[l[1]]=w;break}let a,y,g;typeof l=="string"?a=y=l:l[0]==="="?(typeof l[1]=="string"?a=y=l[1]:[,a,y]=l[1],g=l[2]):[,a,y]=l,m.push(a);let E=e[a];E===void 0&&g&&(E=i(g)(t)),K(y,E,t)}}else if(o==="[]"){let m=0;for(let l of p){if(l===null){m++;continue}if(Array.isArray(l)&&l[0]==="..."){t[l[1]]=e.slice(m);break}let a=l,y;Array.isArray(l)&&l[0]==="="&&([,a,y]=l);let g=e[m++];g===void 0&&y&&(g=i(y)(t)),K(a,g,t)}}},vr=(...r)=>(r=r.map(e=>{if(typeof e=="string")return t=>{t[e]=void 0};if(e[0]==="="){let[,t,o]=e,n=i(o);return typeof t=="string"?p=>{p[t]=n(p)}:p=>K(t,n(p),p)}return i(e)}),e=>{for(let t of r)t(e)});f("let",vr);f("const",vr);f("var",vr);var nr=r=>{throw Error(r)};f("=",(r,e)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let t=r[1];return e=i(e),typeof t=="string"?o=>{o[t]=e(o)}:o=>K(t,e(o),o)}return v(r)||nr("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]=e(n))});f("||=",(r,e)=>(v(r)||nr("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]||=e(n))));f("&&=",(r,e)=>(v(r)||nr("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]&&=e(n))));f("??=",(r,e)=>(v(r)||nr("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]??=e(n))));f("?",(r,e,t)=>(r=i(r),e=i(e),t=i(t),o=>r(o)?e(o):t(o)));var P=[];f("=>",(r,e)=>{r=r?.[0]==="()"?r[1]:r;let t=r?r[0]===","?r.slice(1):[r]:[],o=-1,n=null,p=t[t.length-1];Array.isArray(p)&&p[0]==="..."&&(o=t.length-1,n=p[1],t.length--);let m=e?.[0]==="{}";return e=i(m?["{",e[1]]:e),l=>(...a)=>{let y={};t.forEach((E,w)=>y[E]=a[w]),n&&(y[n]=a.slice(o));let g=new Proxy(y,{get:(E,w)=>w in E?E[w]:l?.[w],set:(E,w,R)=>((w in E?E:l)[w]=R,!0),has:(E,w)=>w in E||(l?w in l:!1)});try{let E=e(g);return m?void 0:E}catch(E){if(E===P)return E[0];throw E}}});f("...",r=>(r=i(r),e=>Object.entries(r(e))));f("?.",(r,e)=>(r=i(r),D(e)?()=>{}:t=>r(t)?.[e]));f("?.[]",(r,e)=>(r=i(r),e=i(e),t=>{let o=e(t);return D(o)?void 0:r(t)?.[o]}));f("?.()",(r,e)=>{let t=e?e[0]===","?(e=e.slice(1).map(i),n=>e.map(p=>p(n))):(e=i(e),n=>[e(n)]):()=>[];if(r[0]==="?."){let n=i(r[1]),p=r[2];return D(p)?()=>{}:m=>n(m)?.[p]?.(...t(m))}if(r[0]==="?.[]"){let n=i(r[1]),p=i(r[2]);return m=>{let l=n(m),a=p(m);return D(a)?void 0:l?.[a]?.(...t(m))}}if(r[0]==="."){let n=i(r[1]),p=r[2];return D(p)?()=>{}:m=>n(m)?.[p]?.(...t(m))}if(r[0]==="[]"&&r.length===3){let n=i(r[1]),p=i(r[2]);return m=>{let l=n(m),a=p(m);return D(a)?void 0:l?.[a]?.(...t(m))}}let o=i(r);return n=>o(n)?.(...t(n))});f("typeof",r=>(r=i(r),e=>typeof r(e)));f("void",r=>(r=i(r),e=>(r(e),void 0)));f("delete",r=>{if(r[0]==="."){let e=i(r[1]),t=r[2];return o=>delete e(o)[t]}if(r[0]==="[]"){let e=i(r[1]),t=i(r[2]);return o=>delete e(o)[t(o)]}return()=>!0});f("new",r=>{let e=i(r?.[0]==="()"?r[1]:r),t=r?.[0]==="()"?r[2]:null,o=t?t[0]===","?(n=>p=>n.map(m=>m(p)))(t.slice(1).map(i)):(n=>p=>[n(p)])(i(t)):()=>[];return n=>new(e(n))(...o(n))});var ir=Symbol("accessor");f("get",(r,e)=>(e=e?i(e):()=>{},t=>[[ir,r,{get:function(){let o=Object.create(t||{});return o.this=this,e(o)}}]]));f("set",(r,e,t)=>(t=t?i(t):()=>{},o=>[[ir,r,{set:function(n){let p=Object.create(o||{});p.this=this,p[e]=n,t(p)}}]]));var qt=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);f("{}",(r,e)=>{if(e!==void 0)return;if(!qt(r))return i(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let t=r.map(o=>i(typeof o=="string"?[":",o,o]:o));return o=>{let n={},p={};for(let m of t.flatMap(l=>l(o)))if(m[0]===ir){let[,l,a]=m;p[l]={...p[l],...a,configurable:!0,enumerable:!0}}else n[m[0]]=m[1];for(let m in p)Object.defineProperty(n,m,p[m]);return n}});f("{",r=>(r=r?i(r):()=>{},e=>r(Object.create(e))));f(":",(r,e)=>(e=i(e),Array.isArray(r)?(r=i(r),t=>[[r(t),e(t)]]):t=>[[r,e(t)]]));f("`",(...r)=>(r=r.map(i),e=>r.map(t=>t(e)).join("")));f("``",(r,...e)=>{r=i(r);let t=[],o=[];for(let p of e)Array.isArray(p)&&p[0]===void 0?t.push(p[1]):o.push(i(p));let n=Object.assign([...t],{raw:t});return p=>r(p)(n,...o.map(m=>m(p)))});f("function",(r,e,t)=>{t=t?i(t):()=>{};let o=e?e[0]===","?e.slice(1):[e]:[],n=null,p=-1,m=o[o.length-1];return Array.isArray(m)&&m[0]==="..."&&(p=o.length-1,n=m[1],o.length--),l=>{let a=(...y)=>{let g={};o.forEach((w,R)=>g[w]=y[R]),n&&(g[n]=y.slice(p));let E=new Proxy(g,{get:(w,R)=>R in w?w[R]:l[R],set:(w,R,Se)=>((R in w?w:l)[R]=Se,!0),has:(w,R)=>R in w||R in l});try{return t(E)}catch(w){if(w===P)return w[0];throw w}};return r&&(l[r]=a),a}});f("function*",(r,e,t)=>{throw Error("Generator functions are not supported in evaluation")});f("async",r=>{let e=i(r);return t=>{let o=e(t);return async function(...n){return o(...n)}}});f("await",r=>(r=i(r),async e=>await r(e)));f("yield",r=>(r=r?i(r):null,e=>{throw{__yield__:r?r(e):void 0}}));f("yield*",r=>(r=i(r),e=>{throw{__yield_all__:r(e)}}));var xt=Symbol("static"),bt=r=>{throw Error(r)};f("instanceof",(r,e)=>(r=i(r),e=i(e),t=>r(t)instanceof e(t)));f("class",(r,e,t)=>(e=e?i(e):null,t=t?i(t):null,o=>{let n=e?e(o):Object,p=function(...m){if(!(this instanceof p))return bt("Class constructor must be called with new");let l=e?Reflect.construct(n,m,p):this;return p.prototype.__constructor__&&p.prototype.__constructor__.apply(l,m),l};if(Object.setPrototypeOf(p.prototype,n.prototype),Object.setPrototypeOf(p,n),t){let m=Object.create(o);m.super=n;let l=t(m),a=Array.isArray(l)&&typeof l[0]?.[0]=="string"?l:[];for(let[y,g]of a)y==="constructor"?p.prototype.__constructor__=g:p.prototype[y]=g}return r&&(o[r]=p),p}));f("static",r=>(r=i(r),e=>[[xt,r(e)]]));f("//",(r,e)=>{let t=new RegExp(r,e||"");return()=>t});f("if",(r,e,t)=>(r=i(r),e=i(e),t=t!==void 0?i(t):null,o=>r(o)?e(o):t?.(o)));var M=Symbol("break"),X=Symbol("continue");f("while",(r,e)=>(r=i(r),e=i(e),t=>{let o;for(;r(t);)try{o=e(t)}catch(n){if(n===M)break;if(n===X)continue;if(n===P)return n[0];throw n}return o}));f("do",(r,e)=>(r=i(r),e=i(e),t=>{let o;do try{o=r(t)}catch(n){if(n===M)break;if(n===X)continue;if(n===P)return n[0];throw n}while(e(t));return o}));f("for",(r,e)=>{if(Array.isArray(r)&&r[0]===";"){let[,t,o,n]=r;return t=t?i(t):null,o=o?i(o):()=>!0,n=n?i(n):null,e=i(e),p=>{let m;for(t?.(p);o(p);n?.(p))try{m=e(p)}catch(l){if(l===M)break;if(l===X)continue;if(l===P)return l[0];throw l}return m}}if(Array.isArray(r)&&(r[0]==="in"||r[0]==="of")){let[t,o,n]=r;if(Array.isArray(o)&&(o[0]==="let"||o[0]==="const"||o[0]==="var")&&(o=o[1]),t==="in")return eo(o,n,e);if(t==="of")return ro(o,n,e)}});var ro=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,m=o?null:n[r];for(let l of e(n)){o?K(r,l,n):n[r]=l;try{p=t(n)}catch(a){if(a===M)break;if(a===X)continue;if(a===P)return a[0];throw a}}return o||(n[r]=m),p}},eo=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,m=o?null:n[r];for(let l in e(n)){o?K(r,l,n):n[r]=l;try{p=t(n)}catch(a){if(a===M)break;if(a===X)continue;if(a===P)return a[0];throw a}}return o||(n[r]=m),p}};f("break",()=>()=>{throw M});f("continue",()=>()=>{throw X});f("return",r=>(r=r!==void 0?i(r):null,e=>{throw P[0]=r?.(e),P}));f("try",(r,...e)=>{r=r?i(r):null;let t=e.find(l=>l?.[0]==="catch"),o=e.find(l=>l?.[0]==="finally"),n=t?.[1],p=t?.[2]?i(t[2]):null,m=o?.[1]?i(o[1]):null;return l=>{let a;try{a=r?.(l)}catch(y){if(y===M||y===X||y===P)throw y;if(n!=null&&p){let g=n in l,E=l[n];l[n]=y;try{a=p(l)}finally{g?l[n]=E:delete l[n]}}else if(!p)throw y}finally{m?.(l)}return a}});f("throw",r=>(r=i(r),e=>{throw r(e)}));f("switch",(r,...e)=>(r=i(r),e.length?(e=e.map(t=>[t[0]==="case"?i(t[1]):null,(t[0]==="case"?t[2]:t[1])?.[0]===";"?(t[0]==="case"?t[2]:t[1]).slice(1).map(i):(t[0]==="case"?t[2]:t[1])?[i(t[0]==="case"?t[2]:t[1])]:[]]),t=>{let o=r(t),n=!1,p;for(let[l,a]of e)if(n||l===null||l(t)===o)for(n=!0,m=0;m<a.length;m++)try{p=a[m](t)}catch(y){if(y===M)return p;throw y}var m;return p}):t=>r(t)));f("import",()=>()=>{});f("export",()=>()=>{});f("from",(r,e)=>()=>{});f("as",(r,e)=>()=>{});f("default",r=>i(r));var ge=new WeakMap,to=(r,...e)=>typeof r=="string"?i(s(r)):ge.get(r)||ge.set(r,oo(r,e)).get(r),Ee=57344,oo=(r,e)=>{let t=r.reduce((p,m,l)=>p+(l?String.fromCharCode(Ee+l-1):"")+m,""),o=s(t),n=p=>{if(typeof p=="string"&&p.length===1){let m=p.charCodeAt(0)-Ee,l;if(m>=0&&m<e.length)return l=e[m],no(l)?l:[,l]}return Array.isArray(p)?p.map(n):p};return i(n(o))},no=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),io=to;export{fr as access,A as binary,i as compile,c as cur,io as default,N as err,d as expr,W as group,so as id,u as idx,C as keyword,Q as literal,Mr as loc,I as lookup,Ur as member,pr as nary,T as next,f as operator,sr as operators,L as parens,s as parse,j as peek,G as prec,lr as propName,O as seek,h as skip,S as token,_ as unary,k as word};
package/justin.min.js CHANGED
@@ -1,8 +1,8 @@
1
1
  var u,l,d=r=>(u=0,l=r,d.enter?.(),r=C(),l[u]?N():r||""),N=(r="Unexpected token",t=u,e=l.slice(0,t).split(`
2
2
  `),o=e.pop(),i=l.slice(Math.max(0,t-40),t),s="\u032D",m=(l[t]||" ")+s,f=l.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
3
3
  ${l[t-41]!==`
4
- `,""+i}${m}${f}`)},sr=(r,t=u)=>(Array.isArray(r)&&(r.loc=t),r),L=(r,t=u,e)=>{for(;e=r(l.charCodeAt(u));)u+=e;return l.slice(t,u)},y=(r=1)=>l[u+=r],B=r=>u=r,C=(r=0,t)=>{let e,o,i;for(t&&d.enter?.(r,t);(e=d.space())&&e!==t&&(i=d.step(o,r,e,C));)o=i;return t&&(e==t?(u++,d.exit?.(r,t)):N("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},z=(r=u)=>{for(;l.charCodeAt(r)<=32;)r++;return l.charCodeAt(r)},Bt=d.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,pr=(r,t=r.length)=>l.substr(u,t)===r&&!d.id(l.charCodeAt(u+t)),Mt=()=>(y(),C(0,41)),w=[],K={},I=(r,t=32,e,o=r.charCodeAt(0),i=r.length,s=w[o],m=r.toUpperCase()!==r,f,A)=>(t=K[r]=!s&&K[r]||t,w[o]=(h,S,g,E=u)=>(f=g,(g?r==g:(i<2||r.charCodeAt(1)===l.charCodeAt(u+1)&&(i<3||l.substr(u,i)==r))&&(!m||!d.id(l.charCodeAt(u+i)))&&(f=g=r))&&S<t&&(u+=i,(A=e(h))?sr(A,E):(u=E,f=0,!m&&!s&&!h&&N()),A)||s?.(h,S,f))),c=(r,t,e=!1)=>I(r,t,o=>o&&(i=>i&&[r,o,i])(C(t-(e?.5:0)))),k=(r,t,e)=>I(r,t,o=>e?o&&[r,o]:!o&&(o=C(t-.5))&&[r,o]),P=(r,t)=>I(r,200,e=>!e&&[,t]),J=(r,t,e,o)=>I(r,t,(i,s)=>(s=C(t-(e?.5:0)),i?.[0]!==r&&(i=[r,i||null]),s?.[0]===r?i.push(...s.slice(1)):s?i.push(s):(o||z()===r.charCodeAt(0))&&i.push(null),i)),a=(r,t)=>I(r[0],t,e=>!e&&[r,C(0,r.charCodeAt(1))||null]),V=(r,t)=>I(r[0],t,e=>e&&[r,e,C(0,r.charCodeAt(1))||null]),Y=(r,t)=>(d.space(),t=l.charCodeAt(u),d.id(t)&&(t<48||t>57)?L(d.id):C(r)),mr=(r,t)=>I(r,t,e=>e&&(o=>o&&[r,e,o])(Y(t))),M=(r,t,e,o=r.charCodeAt(0),i=r.length,s=w[o],m)=>(K[r]??=t,w[o]=(f,A,h,S=u)=>!f&&(h?r==h:(i<2||l.substr(u,i)==r)&&(h=r))&&A<t&&!d.id(l.charCodeAt(u+i))&&(!d.prop||d.prop(u+i))&&(B(u+i),(m=e())?sr(m,S):B(S),m)||s?.(f,A,h));d.space=r=>{for(;(r=l.charCodeAt(u))<=32;)u++;return r};d.step=(r,t,e,o,i)=>(i=w[e])&&i(r,t)||(r?null:L(d.id)||null);var W={},p=(r,t,e=W[r])=>W[r]=(...o)=>t(...o)||e?.(...o),n=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):W[r[0]]?.(...r.slice(1))??N(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var F=46,U=48,G=57,Br=69,Mr=101,Dr=43,Fr=45,D=95,fr=110,Gr=97,Xr=102,$r=65,Qr=70,ur=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),Z=r=>{let t=ur(L(e=>e===F&&l.charCodeAt(u+1)!==F||e>=U&&e<=G||e===D||((e===Br||e===Mr)&&((e=l.charCodeAt(u+1))>=U&&e<=G||e===Dr||e===Fr)?2:0)));return l.charCodeAt(u)===fr?(y(),[,BigInt(t)]):(r=+t)!=r?N():[,r]},Hr={2:r=>r===48||r===49||r===D,8:r=>r>=48&&r<=55||r===D,16:r=>r>=U&&r<=G||r>=Gr&&r<=Xr||r>=$r&&r<=Qr||r===D};d.number=null;w[F]=r=>!r&&l.charCodeAt(u+1)!==F&&Z();for(let r=U;r<=G;r++)w[r]=t=>t?void 0:Z();w[U]=r=>{if(r)return;let t=d.number;if(t){for(let[e,o]of Object.entries(t))if(e[0]==="0"&&l[u+1]?.toLowerCase()===e[1]){y(2);let i=ur(L(Hr[o]));return l.charCodeAt(u)===fr?(y(),[,BigInt("0"+e[1]+i)]):[,parseInt(i,o)]}}return Z()};var jr=92,lr=34,cr=39,dr=117,Ar=120,Kr=123,Wr=125,hr=10,zr=13,Jr={n:`
5
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},gr=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,Cr=r=>(t,e,o="",i=String.fromCharCode(r))=>{if(t||!d.string?.[i])return;y();let s=()=>{let m=l.charCodeAt(u+1);if(m===hr)return 2;if(m===zr)return l.charCodeAt(u+2)===hr?3:2;if(m===Ar||m===dr&&l.charCodeAt(u+2)!==Kr){let f=m===Ar?2:4,A=0,h;for(let S=0;S<f;S++){if((h=gr(l.charCodeAt(u+2+S)))<0)return o+=l[u+1],2;A=A*16+h}return o+=String.fromCharCode(A),2+f}if(m===dr){let f=0,A=u+3,h;for(;(h=gr(l.charCodeAt(A)))>=0;)f=f*16+h,A++;return A>u+3&&f<=1114111&&l.charCodeAt(A)===Wr?(o+=String.fromCodePoint(f),A-u+1):(o+=l[u+1],2)}return o+=Jr[l[u+1]]||l[u+1],2};return L(m=>m-r&&(m!==jr?(o+=l[u],1):s())),l[u]===i?y():N("Bad string"),[,o]};w[lr]=Cr(lr);w[cr]=Cr(cr);d.string={'"':!0};var Vr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>c(r,Vr,!0));var Yr=30,Zr=40,qr=140;k("!",qr);c("||",Yr);c("&&",Zr);var xr=50,br=60,rt=70,yr=100,tt=140;c("|",xr);c("&",rt);c("^",br);c(">>",yr);c("<<",yr);k("~",tt);var X=90;c("<",X);c(">",X);c("<=",X);c(">=",X);var Sr=80;c("==",Sr);c("!=",Sr);var Er=110,q=120,wr=140;c("+",Er);c("-",Er);c("*",q);c("/",q);c("%",q);k("+",wr);k("-",wr);var $=150;I("++",$,r=>r?["++",r,null]:["++",C($-1)]);I("--",$,r=>r?["--",r,null]:["--",C($-1)]);var et=5,ot=10;J(",",ot);J(";",et,!0,!0);var nt=170;a("()",nt);var Ir=170,it=160;V("[]",Ir);mr(".",Ir);V("()",it);var st=32,pt=d.space;d.comment??={"//":`
4
+ `,""+i}${m}${f}`)},sr=(r,t=u)=>(Array.isArray(r)&&(r.loc=t),r),L=(r,t=u,e)=>{for(;e=r(l.charCodeAt(u));)u+=e;return l.slice(t,u)},y=(r=1)=>l[u+=r],a=r=>u=r,C=(r=0,t)=>{let e,o,i;for(t&&d.enter?.(r,t);(e=d.space())&&e!==t&&(i=d.step(o,r,e,C));)o=i;return t&&(e==t?(u++,d.exit?.(r,t)):N("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},z=(r=u)=>{for(;l.charCodeAt(r)<=32;)r++;return l.charCodeAt(r)},at=d.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,pr=(r,t=r.length)=>l.substr(u,t)===r&&!d.id(l.charCodeAt(u+t)),Mt=()=>(y(),C(0,41)),w=[],K={},I=(r,t=32,e,o=r.charCodeAt(0),i=r.length,s=w[o],m=r.toUpperCase()!==r,f,A)=>(t=K[r]=!s&&K[r]||t,w[o]=(h,S,g,E=u)=>(f=g,(g?r==g:(i<2||r.charCodeAt(1)===l.charCodeAt(u+1)&&(i<3||l.substr(u,i)==r))&&(!m||!d.id(l.charCodeAt(u+i)))&&(f=g=r))&&S<t&&(u+=i,(A=e(h))?sr(A,E):(u=E,f=0,!m&&!s&&!h&&N()),A)||s?.(h,S,f))),c=(r,t,e=!1)=>I(r,t,o=>o&&(i=>i&&[r,o,i])(C(t-(e?.5:0)))),k=(r,t,e)=>I(r,t,o=>e?o&&[r,o]:!o&&(o=C(t-.5))&&[r,o]),P=(r,t)=>I(r,200,e=>!e&&[,t]),J=(r,t,e,o)=>I(r,t,(i,s)=>(s=C(t-(e?.5:0)),i?.[0]!==r&&(i=[r,i||null]),s?.[0]===r?i.push(...s.slice(1)):s?i.push(s):o||z()===r.charCodeAt(0)?i.push(null):i.length===2&&(i=i[1]),i)),U=(r,t)=>I(r[0],t,e=>!e&&[r,C(0,r.charCodeAt(1))||null]),V=(r,t)=>I(r[0],t,e=>e&&[r,e,C(0,r.charCodeAt(1))||null]),Y=(r,t)=>(d.space(),t=l.charCodeAt(u),d.id(t)&&(t<48||t>57)?L(d.id):C(r)),mr=(r,t)=>I(r,t,e=>e&&(o=>o&&[r,e,o])(Y(t))),M=(r,t,e,o=r.charCodeAt(0),i=r.length,s=w[o],m)=>(K[r]??=t,w[o]=(f,A,h,S=u)=>!f&&(h?r==h:(i<2||l.substr(u,i)==r)&&(h=r))&&A<t&&!d.id(l.charCodeAt(u+i))&&(!d.prop||d.prop(u+i))&&(a(u+i),(m=e())?sr(m,S):a(S),m)||s?.(f,A,h));d.space=r=>{for(;(r=l.charCodeAt(u))<=32;)u++;return r};d.step=(r,t,e,o,i)=>(i=w[e])&&i(r,t)||(r?null:L(d.id)||null);var W={},p=(r,t,e=W[r])=>W[r]=(...o)=>t(...o)||e?.(...o),n=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):W[r[0]]?.(...r.slice(1))??N(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var F=46,_=48,G=57,ar=69,Mr=101,Dr=43,Fr=45,D=95,fr=110,Gr=97,Xr=102,$r=65,Qr=70,ur=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),Z=r=>{let t=ur(L(e=>e===F&&l.charCodeAt(u+1)!==F||e>=_&&e<=G||e===D||((e===ar||e===Mr)&&((e=l.charCodeAt(u+1))>=_&&e<=G||e===Dr||e===Fr)?2:0)));return l.charCodeAt(u)===fr?(y(),[,BigInt(t)]):(r=+t)!=r?N():[,r]},Hr={2:r=>r===48||r===49||r===D,8:r=>r>=48&&r<=55||r===D,16:r=>r>=_&&r<=G||r>=Gr&&r<=Xr||r>=$r&&r<=Qr||r===D};d.number=null;w[F]=r=>!r&&l.charCodeAt(u+1)!==F&&Z();for(let r=_;r<=G;r++)w[r]=t=>t?void 0:Z();w[_]=r=>{if(r)return;let t=d.number;if(t){for(let[e,o]of Object.entries(t))if(e[0]==="0"&&l[u+1]?.toLowerCase()===e[1]){y(2);let i=ur(L(Hr[o]));return l.charCodeAt(u)===fr?(y(),[,BigInt("0"+e[1]+i)]):[,parseInt(i,o)]}}return Z()};var jr=92,lr=34,cr=39,dr=117,Ar=120,Kr=123,Wr=125,hr=10,zr=13,Jr={n:`
5
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},gr=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,Cr=r=>(t,e,o="",i=String.fromCharCode(r))=>{if(t||!d.string?.[i])return;y();let s=()=>{let m=l.charCodeAt(u+1);if(m===hr)return 2;if(m===zr)return l.charCodeAt(u+2)===hr?3:2;if(m===Ar||m===dr&&l.charCodeAt(u+2)!==Kr){let f=m===Ar?2:4,A=0,h;for(let S=0;S<f;S++){if((h=gr(l.charCodeAt(u+2+S)))<0)return o+=l[u+1],2;A=A*16+h}return o+=String.fromCharCode(A),2+f}if(m===dr){let f=0,A=u+3,h;for(;(h=gr(l.charCodeAt(A)))>=0;)f=f*16+h,A++;return A>u+3&&f<=1114111&&l.charCodeAt(A)===Wr?(o+=String.fromCodePoint(f),A-u+1):(o+=l[u+1],2)}return o+=Jr[l[u+1]]||l[u+1],2};return L(m=>m-r&&(m!==jr?(o+=l[u],1):s())),l[u]===i?y():N("Bad string"),[,o]};w[lr]=Cr(lr);w[cr]=Cr(cr);d.string={'"':!0};var Vr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>c(r,Vr,!0));var Yr=30,Zr=40,qr=140;k("!",qr);c("||",Yr);c("&&",Zr);var xr=50,br=60,rt=70,yr=100,tt=140;c("|",xr);c("&",rt);c("^",br);c(">>",yr);c("<<",yr);k("~",tt);var X=90;c("<",X);c(">",X);c("<=",X);c(">=",X);var Sr=80;c("==",Sr);c("!=",Sr);var Er=110,q=120,wr=140;c("+",Er);c("-",Er);c("*",q);c("/",q);c("%",q);k("+",wr);k("-",wr);var $=150;I("++",$,r=>r?["++",r,null]:["++",C($-1)]);I("--",$,r=>r?["--",r,null]:["--",C($-1)]);var et=5,ot=10;J(",",ot);J(";",et,!0,!0);var nt=170;U("()",nt);var Ir=170,it=160;V("[]",Ir);mr(".",Ir);V("()",it);var st=32,pt=d.space;d.comment??={"//":`
6
6
  `,"/*":"*/"};var x;d.space=()=>{x||(x=Object.entries(d.comment).map(([i,s])=>[i,s,i.charCodeAt(0)]));for(var r;r=pt();){for(var t=0,e;e=x[t++];)if(r===e[2]&&l.substr(u,e[0].length)===e[0]){var o=u+e[0].length;if(e[1]===`
7
- `)for(;l.charCodeAt(o)>=st;)o++;else{for(;l[o]&&l.substr(o,e[1].length)!==e[1];)o++;l[o]&&(o+=e[1].length)}B(o),r=0;break}if(r)return r}return r};var kr=80;c("===",kr);c("!==",kr);var mt=30;c("??",mt);var ft=130,ut=20;c("**",ft,!0);c("**=",ut,!0);var Nr=90;c("in",Nr);c("of",Nr);var lt=20,ct=100;c(">>>",ct);c(">>>=",lt,!0);var b=20;c("||=",b,!0);c("&&=",b,!0);c("??=",b,!0);P("true",!0);P("false",!1);P("null",null);M("undefined",200,()=>[]);P("NaN",NaN);P("Infinity",1/0);var rr=20;I("?",rr,(r,t,e)=>r&&(t=C(rr-1))&&L(o=>o===58)&&(e=C(rr-1),["?",r,t,e]));var dt=20;c("=>",dt,!0);var At=20;k("...",At);var vr=170;I("?.",vr,(r,t)=>{if(!r)return;let e=d.space();return e===40?(y(),["?.()",r,C(0,41)||null]):e===91?(y(),["?.[]",r,C(0,93)]):(t=Y(vr),t?["?.",r,t]:void 0)});var tr=140,Lr=160,ht=Lr+1;k("typeof",tr);k("void",tr);k("delete",tr);var gt=r=>d.space()===40?(y(),["()",r,C(0,41)||null]):r;M("new",ht,()=>pr(".target")?(y(7),["new.target"]):["new",gt(C(Lr))]);var Ct=20,Or=200;d.prop=r=>z(r)!==58;a("[]",Or);a("{}",Or);c(":",Ct-1,!0);var yt=170,er=96,St=36,Et=123,wt=92,It={n:`
8
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},Rr=()=>{let r=[],t="",e;for(;(e=l.charCodeAt(u))!==er;)e?e===wt?(y(),t+=It[l[u]]||l[u],y()):e===St&&l.charCodeAt(u+1)===Et?(r.push([,t]),t="",y(2),r.push(C(0,125))):(t+=l[u],y()):N("Unterminated template");return r.push([,t]),y(),r},kt=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],Nt=w[er];w[er]=(r,t)=>r&&t<yt?d.asi&&d.newline?void 0:(y(),["``",r,...Rr()]):r?Nt?.(r,t):(y(),kt(Rr()));d.string["'"]=!0;d.number={"0x":16,"0b":2,"0o":8};var Tr=(r,t,e,o)=>typeof r=="string"?i=>t(i,r,i):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o,i)):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i),i)):r[0]==="()"&&r.length===2?Tr(r[1],t):(()=>{throw Error("Invalid assignment target")})(),Pr={"=":(r,t,e)=>r[t]=e,"+=":(r,t,e)=>r[t]+=e,"-=":(r,t,e)=>r[t]-=e,"*=":(r,t,e)=>r[t]*=e,"/=":(r,t,e)=>r[t]/=e,"%=":(r,t,e)=>r[t]%=e,"|=":(r,t,e)=>r[t]|=e,"&=":(r,t,e)=>r[t]&=e,"^=":(r,t,e)=>r[t]^=e,">>=":(r,t,e)=>r[t]>>=e,"<<=":(r,t,e)=>r[t]<<=e};for(let r in Pr)p(r,(t,e)=>(e=n(e),Tr(t,(o,i,s)=>Pr[r](o,i,e(s)))));p("!",r=>(r=n(r),t=>!r(t)));p("||",(r,t)=>(r=n(r),t=n(t),e=>r(e)||t(e)));p("&&",(r,t)=>(r=n(r),t=n(t),e=>r(e)&&t(e)));p("~",r=>(r=n(r),t=>~r(t)));p("|",(r,t)=>(r=n(r),t=n(t),e=>r(e)|t(e)));p("&",(r,t)=>(r=n(r),t=n(t),e=>r(e)&t(e)));p("^",(r,t)=>(r=n(r),t=n(t),e=>r(e)^t(e)));p(">>",(r,t)=>(r=n(r),t=n(t),e=>r(e)>>t(e)));p("<<",(r,t)=>(r=n(r),t=n(t),e=>r(e)<<t(e)));p(">",(r,t)=>(r=n(r),t=n(t),e=>r(e)>t(e)));p("<",(r,t)=>(r=n(r),t=n(t),e=>r(e)<t(e)));p(">=",(r,t)=>(r=n(r),t=n(t),e=>r(e)>=t(e)));p("<=",(r,t)=>(r=n(r),t=n(t),e=>r(e)<=t(e)));p("==",(r,t)=>(r=n(r),t=n(t),e=>r(e)==t(e)));p("!=",(r,t)=>(r=n(r),t=n(t),e=>r(e)!=t(e)));p("+",(r,t)=>t!==void 0?(r=n(r),t=n(t),e=>r(e)+t(e)):(r=n(r),e=>+r(e)));p("-",(r,t)=>t!==void 0?(r=n(r),t=n(t),e=>r(e)-t(e)):(r=n(r),e=>-r(e)));p("*",(r,t)=>(r=n(r),t=n(t),e=>r(e)*t(e)));p("/",(r,t)=>(r=n(r),t=n(t),e=>r(e)/t(e)));p("%",(r,t)=>(r=n(r),t=n(t),e=>r(e)%t(e)));var or=(r,t,e,o)=>typeof r=="string"?i=>t(i,r):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o)):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i))):r[0]==="()"&&r.length===2?or(r[1],t):(()=>{throw Error("Invalid increment target")})();p("++",(r,t)=>or(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));p("--",(r,t)=>or(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var ar=(...r)=>(r=r.map(n),t=>{let e;for(let o of r)e=o(t);return e});p(",",ar);p(";",ar);var O=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",Q=r=>{throw Error(r)};p("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=n(e[1]),o=>e(o)):(e=n(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&Q("Missing index"),r=n(r),t=n(t),e=>{let o=t(e);return O(o)?void 0:r(e)[o]}));p(".",(r,t)=>(r=n(r),t=t[0]?t:t[1],O(t)?()=>{}:e=>r(e)[t]));p("()",(r,t)=>{if(t===void 0)return r==null?Q("Empty ()"):n(r);let e=i=>i?.[0]===","&&i.slice(1).some(s=>s==null||e(s));e(t)&&Q("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(n),i=>t.map(s=>s(i))):(t=n(t),i=>[t(i)]):()=>[];return nr(r,(i,s,m)=>i[s](...o(m)))});var v=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&v(r[1])||r[0]==="{}"),nr=(r,t,e,o)=>r==null?Q("Empty ()"):r[0]==="()"&&r.length==2?nr(r[1],t):typeof r=="string"?i=>t(i,r,i):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o,i)):r[0]==="?."?(e=n(r[1]),o=r[2],i=>{let s=e(i);return s==null?void 0:t(s,o,i)}):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i),i)):r[0]==="?.[]"?(e=n(r[1]),o=n(r[2]),i=>{let s=e(i);return s==null?void 0:t(s,o(i),i)}):(r=n(r),i=>t([r(i)],0,i)),R=nr;p("===",(r,t)=>(r=n(r),t=n(t),e=>r(e)===t(e)));p("!==",(r,t)=>(r=n(r),t=n(t),e=>r(e)!==t(e)));p("??",(r,t)=>(r=n(r),t=n(t),e=>r(e)??t(e)));var vt=r=>{throw Error(r)};p("**",(r,t)=>(r=n(r),t=n(t),e=>r(e)**t(e)));p("**=",(r,t)=>(v(r)||vt("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]**=t(i))));p("in",(r,t)=>(r=n(r),t=n(t),e=>r(e)in t(e)));var Lt=r=>{throw Error(r)};p(">>>",(r,t)=>(r=n(r),t=n(t),e=>r(e)>>>t(e)));p(">>>=",(r,t)=>(v(r)||Lt("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]>>>=t(i))));var Ot=r=>r[0]?.[0]===","?r[0].slice(1):r,_=(r,t,e)=>{if(typeof r=="string"){e[r]=t;return}let[o,...i]=r,s=Ot(i);if(o==="{}"){let m=[];for(let f of s){if(Array.isArray(f)&&f[0]==="..."){let E={};for(let T in t)m.includes(T)||(E[T]=t[T]);e[f[1]]=E;break}let A,h,S;typeof f=="string"?A=h=f:f[0]==="="?(typeof f[1]=="string"?A=h=f[1]:[,A,h]=f[1],S=f[2]):[,A,h]=f,m.push(A);let g=t[A];g===void 0&&S&&(g=n(S)(e)),_(h,g,e)}}else if(o==="[]"){let m=0;for(let f of s){if(f===null){m++;continue}if(Array.isArray(f)&&f[0]==="..."){e[f[1]]=t.slice(m);break}let A=f,h;Array.isArray(f)&&f[0]==="="&&([,A,h]=f);let S=t[m++];S===void 0&&h&&(S=n(h)(e)),_(A,S,e)}}},ir=(...r)=>(r=r.map(t=>{if(typeof t=="string")return e=>{e[t]=void 0};if(t[0]==="="){let[,e,o]=t,i=n(o);return typeof e=="string"?s=>{s[e]=i(s)}:s=>_(e,i(s),s)}return n(t)}),t=>{for(let e of r)e(t)});p("let",ir);p("const",ir);p("var",ir);var H=r=>{throw Error(r)};p("=",(r,t)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let e=r[1];return t=n(t),typeof e=="string"?o=>{o[e]=t(o)}:o=>_(e,t(o),o)}return v(r)||H("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]=t(i))});p("||=",(r,t)=>(v(r)||H("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]||=t(i))));p("&&=",(r,t)=>(v(r)||H("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]&&=t(i))));p("??=",(r,t)=>(v(r)||H("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]??=t(i))));p("?",(r,t,e)=>(r=n(r),t=n(t),e=n(e),o=>r(o)?t(o):e(o)));var Rt=[];p("=>",(r,t)=>{r=r?.[0]==="()"?r[1]:r;let e=r?r[0]===","?r.slice(1):[r]:[],o=-1,i=null,s=e[e.length-1];Array.isArray(s)&&s[0]==="..."&&(o=e.length-1,i=s[1],e.length--);let m=t?.[0]==="{}";return t=n(m?["{",t[1]]:t),f=>(...A)=>{let h={};e.forEach((g,E)=>h[g]=A[E]),i&&(h[i]=A.slice(o));let S=new Proxy(h,{get:(g,E)=>E in g?g[E]:f?.[E],set:(g,E,T)=>((E in g?g:f)[E]=T,!0),has:(g,E)=>E in g||(f?E in f:!1)});try{let g=t(S);return m?void 0:g}catch(g){if(g===Rt)return g[0];throw g}}});p("...",r=>(r=n(r),t=>Object.entries(r(t))));p("?.",(r,t)=>(r=n(r),O(t)?()=>{}:e=>r(e)?.[t]));p("?.[]",(r,t)=>(r=n(r),t=n(t),e=>{let o=t(e);return O(o)?void 0:r(e)?.[o]}));p("?.()",(r,t)=>{let e=t?t[0]===","?(t=t.slice(1).map(n),i=>t.map(s=>s(i))):(t=n(t),i=>[t(i)]):()=>[];if(r[0]==="?."){let i=n(r[1]),s=r[2];return O(s)?()=>{}:m=>i(m)?.[s]?.(...e(m))}if(r[0]==="?.[]"){let i=n(r[1]),s=n(r[2]);return m=>{let f=i(m),A=s(m);return O(A)?void 0:f?.[A]?.(...e(m))}}if(r[0]==="."){let i=n(r[1]),s=r[2];return O(s)?()=>{}:m=>i(m)?.[s]?.(...e(m))}if(r[0]==="[]"&&r.length===3){let i=n(r[1]),s=n(r[2]);return m=>{let f=i(m),A=s(m);return O(A)?void 0:f?.[A]?.(...e(m))}}let o=n(r);return i=>o(i)?.(...e(i))});p("typeof",r=>(r=n(r),t=>typeof r(t)));p("void",r=>(r=n(r),t=>(r(t),void 0)));p("delete",r=>{if(r[0]==="."){let t=n(r[1]),e=r[2];return o=>delete t(o)[e]}if(r[0]==="[]"){let t=n(r[1]),e=n(r[2]);return o=>delete t(o)[e(o)]}return()=>!0});p("new",r=>{let t=n(r?.[0]==="()"?r[1]:r),e=r?.[0]==="()"?r[2]:null,o=e?e[0]===","?(i=>s=>i.map(m=>m(s)))(e.slice(1).map(n)):(i=>s=>[i(s)])(n(e)):()=>[];return i=>new(t(i))(...o(i))});var j=Symbol("accessor");p("get",(r,t)=>(t=t?n(t):()=>{},e=>[[j,r,{get:function(){let o=Object.create(e||{});return o.this=this,t(o)}}]]));p("set",(r,t,e)=>(e=e?n(e):()=>{},o=>[[j,r,{set:function(i){let s=Object.create(o||{});s.this=this,s[t]=i,e(s)}}]]));var Pt=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);p("{}",(r,t)=>{if(t!==void 0)return;if(!Pt(r))return n(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let e=r.map(o=>n(typeof o=="string"?[":",o,o]:o));return o=>{let i={},s={};for(let m of e.flatMap(f=>f(o)))if(m[0]===j){let[,f,A]=m;s[f]={...s[f],...A,configurable:!0,enumerable:!0}}else i[m[0]]=m[1];for(let m in s)Object.defineProperty(i,m,s[m]);return i}});p("{",r=>(r=r?n(r):()=>{},t=>r(Object.create(t))));p(":",(r,t)=>(t=n(t),Array.isArray(r)?(r=n(r),e=>[[r(e),t(e)]]):e=>[[r,t(e)]]));p("`",(...r)=>(r=r.map(n),t=>r.map(e=>e(t)).join("")));p("``",(r,...t)=>{r=n(r);let e=[],o=[];for(let s of t)Array.isArray(s)&&s[0]===void 0?e.push(s[1]):o.push(n(s));let i=Object.assign([...e],{raw:e});return s=>r(s)(i,...o.map(m=>m(s)))});var Ur=new WeakMap,Tt=(r,...t)=>typeof r=="string"?n(d(r)):Ur.get(r)||Ur.set(r,at(r,t)).get(r),_r=57344,at=(r,t)=>{let e=r.reduce((s,m,f)=>s+(f?String.fromCharCode(_r+f-1):"")+m,""),o=d(e),i=s=>{if(typeof s=="string"&&s.length===1){let m=s.charCodeAt(0)-_r,f;if(m>=0&&m<t.length)return f=t[m],Ut(f)?f:[,f]}return Array.isArray(s)?s.map(i):s};return n(i(o))},Ut=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),_t=Tt;export{V as access,c as binary,n as compile,l as cur,_t as default,N as err,C as expr,a as group,Bt as id,u as idx,M as keyword,P as literal,sr as loc,w as lookup,mr as member,J as nary,L as next,p as operator,W as operators,Mt as parens,d as parse,z as peek,K as prec,Y as propName,B as seek,y as skip,I as token,k as unary,pr as word};
7
+ `)for(;l.charCodeAt(o)>=st;)o++;else{for(;l[o]&&l.substr(o,e[1].length)!==e[1];)o++;l[o]&&(o+=e[1].length)}a(o),r=0;break}if(r)return r}return r};var kr=80;c("===",kr);c("!==",kr);var mt=30;c("??",mt);var ft=130,ut=20;c("**",ft,!0);c("**=",ut,!0);var Nr=90;c("in",Nr);c("of",Nr);var lt=20,ct=100;c(">>>",ct);c(">>>=",lt,!0);var b=20;c("||=",b,!0);c("&&=",b,!0);c("??=",b,!0);P("true",!0);P("false",!1);P("null",null);M("undefined",200,()=>[]);P("NaN",NaN);P("Infinity",1/0);var rr=20;I("?",rr,(r,t,e)=>r&&(t=C(rr-1))&&L(o=>o===58)&&(e=C(rr-1),["?",r,t,e]));var dt=20;c("=>",dt,!0);var At=20;k("...",At);var vr=170;I("?.",vr,(r,t)=>{if(!r)return;let e=d.space();return e===40?(y(),["?.()",r,C(0,41)||null]):e===91?(y(),["?.[]",r,C(0,93)]):(t=Y(vr),t?["?.",r,t]:void 0)});var tr=140,Lr=160,ht=Lr+1;k("typeof",tr);k("void",tr);k("delete",tr);var gt=r=>d.space()===40?(y(),["()",r,C(0,41)||null]):r;M("new",ht,()=>pr(".target")?(y(7),["new.target"]):["new",gt(C(Lr))]);var Ct=20,Or=200;d.prop=r=>z(r)!==58;U("[]",Or);U("{}",Or);c(":",Ct-1,!0);var yt=170,er=96,St=36,Et=123,wt=92,It={n:`
8
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},Rr=()=>{let r=[],t="",e;for(;(e=l.charCodeAt(u))!==er;)e?e===wt?(y(),t+=It[l[u]]||l[u],y()):e===St&&l.charCodeAt(u+1)===Et?(r.push([,t]),t="",y(2),r.push(C(0,125))):(t+=l[u],y()):N("Unterminated template");return r.push([,t]),y(),r},kt=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],Nt=w[er];w[er]=(r,t)=>r&&t<yt?d.asi&&d.newline?void 0:(y(),["``",r,...Rr()]):r?Nt?.(r,t):(y(),kt(Rr()));d.string["'"]=!0;d.number={"0x":16,"0b":2,"0o":8};var Tr=(r,t,e,o)=>typeof r=="string"?i=>t(i,r,i):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o,i)):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i),i)):r[0]==="()"&&r.length===2?Tr(r[1],t):(()=>{throw Error("Invalid assignment target")})(),Pr={"=":(r,t,e)=>r[t]=e,"+=":(r,t,e)=>r[t]+=e,"-=":(r,t,e)=>r[t]-=e,"*=":(r,t,e)=>r[t]*=e,"/=":(r,t,e)=>r[t]/=e,"%=":(r,t,e)=>r[t]%=e,"|=":(r,t,e)=>r[t]|=e,"&=":(r,t,e)=>r[t]&=e,"^=":(r,t,e)=>r[t]^=e,">>=":(r,t,e)=>r[t]>>=e,"<<=":(r,t,e)=>r[t]<<=e};for(let r in Pr)p(r,(t,e)=>(e=n(e),Tr(t,(o,i,s)=>Pr[r](o,i,e(s)))));p("!",r=>(r=n(r),t=>!r(t)));p("||",(r,t)=>(r=n(r),t=n(t),e=>r(e)||t(e)));p("&&",(r,t)=>(r=n(r),t=n(t),e=>r(e)&&t(e)));p("~",r=>(r=n(r),t=>~r(t)));p("|",(r,t)=>(r=n(r),t=n(t),e=>r(e)|t(e)));p("&",(r,t)=>(r=n(r),t=n(t),e=>r(e)&t(e)));p("^",(r,t)=>(r=n(r),t=n(t),e=>r(e)^t(e)));p(">>",(r,t)=>(r=n(r),t=n(t),e=>r(e)>>t(e)));p("<<",(r,t)=>(r=n(r),t=n(t),e=>r(e)<<t(e)));p(">",(r,t)=>(r=n(r),t=n(t),e=>r(e)>t(e)));p("<",(r,t)=>(r=n(r),t=n(t),e=>r(e)<t(e)));p(">=",(r,t)=>(r=n(r),t=n(t),e=>r(e)>=t(e)));p("<=",(r,t)=>(r=n(r),t=n(t),e=>r(e)<=t(e)));p("==",(r,t)=>(r=n(r),t=n(t),e=>r(e)==t(e)));p("!=",(r,t)=>(r=n(r),t=n(t),e=>r(e)!=t(e)));p("+",(r,t)=>t!==void 0?(r=n(r),t=n(t),e=>r(e)+t(e)):(r=n(r),e=>+r(e)));p("-",(r,t)=>t!==void 0?(r=n(r),t=n(t),e=>r(e)-t(e)):(r=n(r),e=>-r(e)));p("*",(r,t)=>(r=n(r),t=n(t),e=>r(e)*t(e)));p("/",(r,t)=>(r=n(r),t=n(t),e=>r(e)/t(e)));p("%",(r,t)=>(r=n(r),t=n(t),e=>r(e)%t(e)));var or=(r,t,e,o)=>typeof r=="string"?i=>t(i,r):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o)):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i))):r[0]==="()"&&r.length===2?or(r[1],t):(()=>{throw Error("Invalid increment target")})();p("++",(r,t)=>or(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));p("--",(r,t)=>or(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var Ur=(...r)=>(r=r.map(n),t=>{let e;for(let o of r)e=o(t);return e});p(",",Ur);p(";",Ur);var O=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",Q=r=>{throw Error(r)};p("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=n(e[1]),o=>e(o)):(e=n(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&Q("Missing index"),r=n(r),t=n(t),e=>{let o=t(e);return O(o)?void 0:r(e)[o]}));p(".",(r,t)=>(r=n(r),t=t[0]?t:t[1],O(t)?()=>{}:e=>r(e)[t]));p("()",(r,t)=>{if(t===void 0)return r==null?Q("Empty ()"):n(r);let e=i=>i?.[0]===","&&i.slice(1).some(s=>s==null||e(s));e(t)&&Q("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(n),i=>t.map(s=>s(i))):(t=n(t),i=>[t(i)]):()=>[];return nr(r,(i,s,m)=>i[s](...o(m)))});var v=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&v(r[1])||r[0]==="{}"),nr=(r,t,e,o)=>r==null?Q("Empty ()"):r[0]==="()"&&r.length==2?nr(r[1],t):typeof r=="string"?i=>t(i,r,i):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o,i)):r[0]==="?."?(e=n(r[1]),o=r[2],i=>{let s=e(i);return s==null?void 0:t(s,o,i)}):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i),i)):r[0]==="?.[]"?(e=n(r[1]),o=n(r[2]),i=>{let s=e(i);return s==null?void 0:t(s,o(i),i)}):(r=n(r),i=>t([r(i)],0,i)),R=nr;p("===",(r,t)=>(r=n(r),t=n(t),e=>r(e)===t(e)));p("!==",(r,t)=>(r=n(r),t=n(t),e=>r(e)!==t(e)));p("??",(r,t)=>(r=n(r),t=n(t),e=>r(e)??t(e)));var vt=r=>{throw Error(r)};p("**",(r,t)=>(r=n(r),t=n(t),e=>r(e)**t(e)));p("**=",(r,t)=>(v(r)||vt("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]**=t(i))));p("in",(r,t)=>(r=n(r),t=n(t),e=>r(e)in t(e)));var Lt=r=>{throw Error(r)};p(">>>",(r,t)=>(r=n(r),t=n(t),e=>r(e)>>>t(e)));p(">>>=",(r,t)=>(v(r)||Lt("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]>>>=t(i))));var Ot=r=>r[0]?.[0]===","?r[0].slice(1):r,B=(r,t,e)=>{if(typeof r=="string"){e[r]=t;return}let[o,...i]=r,s=Ot(i);if(o==="{}"){let m=[];for(let f of s){if(Array.isArray(f)&&f[0]==="..."){let E={};for(let T in t)m.includes(T)||(E[T]=t[T]);e[f[1]]=E;break}let A,h,S;typeof f=="string"?A=h=f:f[0]==="="?(typeof f[1]=="string"?A=h=f[1]:[,A,h]=f[1],S=f[2]):[,A,h]=f,m.push(A);let g=t[A];g===void 0&&S&&(g=n(S)(e)),B(h,g,e)}}else if(o==="[]"){let m=0;for(let f of s){if(f===null){m++;continue}if(Array.isArray(f)&&f[0]==="..."){e[f[1]]=t.slice(m);break}let A=f,h;Array.isArray(f)&&f[0]==="="&&([,A,h]=f);let S=t[m++];S===void 0&&h&&(S=n(h)(e)),B(A,S,e)}}},ir=(...r)=>(r=r.map(t=>{if(typeof t=="string")return e=>{e[t]=void 0};if(t[0]==="="){let[,e,o]=t,i=n(o);return typeof e=="string"?s=>{s[e]=i(s)}:s=>B(e,i(s),s)}return n(t)}),t=>{for(let e of r)e(t)});p("let",ir);p("const",ir);p("var",ir);var H=r=>{throw Error(r)};p("=",(r,t)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let e=r[1];return t=n(t),typeof e=="string"?o=>{o[e]=t(o)}:o=>B(e,t(o),o)}return v(r)||H("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]=t(i))});p("||=",(r,t)=>(v(r)||H("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]||=t(i))));p("&&=",(r,t)=>(v(r)||H("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]&&=t(i))));p("??=",(r,t)=>(v(r)||H("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]??=t(i))));p("?",(r,t,e)=>(r=n(r),t=n(t),e=n(e),o=>r(o)?t(o):e(o)));var Rt=[];p("=>",(r,t)=>{r=r?.[0]==="()"?r[1]:r;let e=r?r[0]===","?r.slice(1):[r]:[],o=-1,i=null,s=e[e.length-1];Array.isArray(s)&&s[0]==="..."&&(o=e.length-1,i=s[1],e.length--);let m=t?.[0]==="{}";return t=n(m?["{",t[1]]:t),f=>(...A)=>{let h={};e.forEach((g,E)=>h[g]=A[E]),i&&(h[i]=A.slice(o));let S=new Proxy(h,{get:(g,E)=>E in g?g[E]:f?.[E],set:(g,E,T)=>((E in g?g:f)[E]=T,!0),has:(g,E)=>E in g||(f?E in f:!1)});try{let g=t(S);return m?void 0:g}catch(g){if(g===Rt)return g[0];throw g}}});p("...",r=>(r=n(r),t=>Object.entries(r(t))));p("?.",(r,t)=>(r=n(r),O(t)?()=>{}:e=>r(e)?.[t]));p("?.[]",(r,t)=>(r=n(r),t=n(t),e=>{let o=t(e);return O(o)?void 0:r(e)?.[o]}));p("?.()",(r,t)=>{let e=t?t[0]===","?(t=t.slice(1).map(n),i=>t.map(s=>s(i))):(t=n(t),i=>[t(i)]):()=>[];if(r[0]==="?."){let i=n(r[1]),s=r[2];return O(s)?()=>{}:m=>i(m)?.[s]?.(...e(m))}if(r[0]==="?.[]"){let i=n(r[1]),s=n(r[2]);return m=>{let f=i(m),A=s(m);return O(A)?void 0:f?.[A]?.(...e(m))}}if(r[0]==="."){let i=n(r[1]),s=r[2];return O(s)?()=>{}:m=>i(m)?.[s]?.(...e(m))}if(r[0]==="[]"&&r.length===3){let i=n(r[1]),s=n(r[2]);return m=>{let f=i(m),A=s(m);return O(A)?void 0:f?.[A]?.(...e(m))}}let o=n(r);return i=>o(i)?.(...e(i))});p("typeof",r=>(r=n(r),t=>typeof r(t)));p("void",r=>(r=n(r),t=>(r(t),void 0)));p("delete",r=>{if(r[0]==="."){let t=n(r[1]),e=r[2];return o=>delete t(o)[e]}if(r[0]==="[]"){let t=n(r[1]),e=n(r[2]);return o=>delete t(o)[e(o)]}return()=>!0});p("new",r=>{let t=n(r?.[0]==="()"?r[1]:r),e=r?.[0]==="()"?r[2]:null,o=e?e[0]===","?(i=>s=>i.map(m=>m(s)))(e.slice(1).map(n)):(i=>s=>[i(s)])(n(e)):()=>[];return i=>new(t(i))(...o(i))});var j=Symbol("accessor");p("get",(r,t)=>(t=t?n(t):()=>{},e=>[[j,r,{get:function(){let o=Object.create(e||{});return o.this=this,t(o)}}]]));p("set",(r,t,e)=>(e=e?n(e):()=>{},o=>[[j,r,{set:function(i){let s=Object.create(o||{});s.this=this,s[t]=i,e(s)}}]]));var Pt=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);p("{}",(r,t)=>{if(t!==void 0)return;if(!Pt(r))return n(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let e=r.map(o=>n(typeof o=="string"?[":",o,o]:o));return o=>{let i={},s={};for(let m of e.flatMap(f=>f(o)))if(m[0]===j){let[,f,A]=m;s[f]={...s[f],...A,configurable:!0,enumerable:!0}}else i[m[0]]=m[1];for(let m in s)Object.defineProperty(i,m,s[m]);return i}});p("{",r=>(r=r?n(r):()=>{},t=>r(Object.create(t))));p(":",(r,t)=>(t=n(t),Array.isArray(r)?(r=n(r),e=>[[r(e),t(e)]]):e=>[[r,t(e)]]));p("`",(...r)=>(r=r.map(n),t=>r.map(e=>e(t)).join("")));p("``",(r,...t)=>{r=n(r);let e=[],o=[];for(let s of t)Array.isArray(s)&&s[0]===void 0?e.push(s[1]):o.push(n(s));let i=Object.assign([...e],{raw:e});return s=>r(s)(i,...o.map(m=>m(s)))});var _r=new WeakMap,Tt=(r,...t)=>typeof r=="string"?n(d(r)):_r.get(r)||_r.set(r,Ut(r,t)).get(r),Br=57344,Ut=(r,t)=>{let e=r.reduce((s,m,f)=>s+(f?String.fromCharCode(Br+f-1):"")+m,""),o=d(e),i=s=>{if(typeof s=="string"&&s.length===1){let m=s.charCodeAt(0)-Br,f;if(m>=0&&m<t.length)return f=t[m],_t(f)?f:[,f]}return Array.isArray(s)?s.map(i):s};return n(i(o))},_t=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Bt=Tt;export{V as access,c as binary,n as compile,l as cur,Bt as default,N as err,C as expr,U as group,at as id,u as idx,M as keyword,P as literal,sr as loc,w as lookup,mr as member,J as nary,L as next,p as operator,W as operators,Mt as parens,d as parse,z as peek,K as prec,Y as propName,a as seek,y as skip,I as token,k as unary,pr as word};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "subscript",
3
- "version": "10.4.12",
3
+ "version": "10.4.13",
4
4
  "description": "Modular expression parser & evaluator",
5
5
  "main": "subscript.js",
6
6
  "module": "subscript.js",
package/parse.js CHANGED
@@ -120,7 +120,8 @@ export let idx, cur,
120
120
  (a?.[0] !== op) && (a = [op, a || null]),
121
121
  b?.[0] === op ? a.push(...b.slice(1)) :
122
122
  b ? a.push(b) :
123
- (trail || peek() === op.charCodeAt(0)) && a.push(null),
123
+ (trail || peek() === op.charCodeAt(0)) ? a.push(null) :
124
+ a.length === 2 && (a = a[1]),
124
125
  a
125
126
  ))
126
127
  ,
package/subscript.min.js CHANGED
@@ -1,5 +1,5 @@
1
1
  var s,p,f=r=>(s=0,p=r,f.enter?.(),r=g(),p[s]?S():r||""),S=(r="Unexpected token",t=s,e=p.slice(0,t).split(`
2
2
  `),n=e.pop(),o=p.slice(Math.max(0,t-40),t),m="\u032D",u=(p[t]||" ")+m,d=p.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${n.length+1}
3
3
  ${p[t-41]!==`
4
- `,""+o}${u}${d}`)},G=(r,t=s)=>(Array.isArray(r)&&(r.loc=t),r),_=(r,t=s,e)=>{for(;e=r(p.charCodeAt(s));)s+=e;return p.slice(t,s)},w=(r=1)=>p[s+=r],v=r=>s=r,g=(r=0,t)=>{let e,n,o;for(t&&f.enter?.(r,t);(e=f.space())&&e!==t&&(o=f.step(n,r,e,g));)n=o;return t&&(e==t?(s++,f.exit?.(r,t)):S("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),n},fr=(r=s)=>{for(;p.charCodeAt(r)<=32;)r++;return p.charCodeAt(r)},Wr=f.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,zr=(r,t=r.length)=>p.substr(s,t)===r&&!f.id(p.charCodeAt(s+t)),Jr=()=>(w(),g(0,41)),c=[],N={},y=(r,t=32,e,n=r.charCodeAt(0),o=r.length,m=c[n],u=r.toUpperCase()!==r,d,h)=>(t=N[r]=!m&&N[r]||t,c[n]=(C,E,U,H=s)=>(d=U,(U?r==U:(o<2||r.charCodeAt(1)===p.charCodeAt(s+1)&&(o<3||p.substr(s,o)==r))&&(!u||!f.id(p.charCodeAt(s+o)))&&(d=U=r))&&E<t&&(s+=o,(h=e(C))?G(h,H):(s=H,d=0,!u&&!m&&!C&&S()),h)||m?.(C,E,d))),A=(r,t,e=!1)=>y(r,t,n=>n&&(o=>o&&[r,n,o])(g(t-(e?.5:0)))),I=(r,t,e)=>y(r,t,n=>e?n&&[r,n]:!n&&(n=g(t-.5))&&[r,n]),Kr=(r,t)=>y(r,200,e=>!e&&[,t]),$=(r,t,e,n)=>y(r,t,(o,m)=>(m=g(t-(e?.5:0)),o?.[0]!==r&&(o=[r,o||null]),m?.[0]===r?o.push(...m.slice(1)):m?o.push(m):(n||fr()===r.charCodeAt(0))&&o.push(null),o)),W=(r,t)=>y(r[0],t,e=>!e&&[r,g(0,r.charCodeAt(1))||null]),B=(r,t)=>y(r[0],t,e=>e&&[r,e,g(0,r.charCodeAt(1))||null]),dr=(r,t)=>(f.space(),t=p.charCodeAt(s),f.id(t)&&(t<48||t>57)?_(f.id):g(r)),z=(r,t)=>y(r,t,e=>e&&(n=>n&&[r,e,n])(dr(t))),Vr=(r,t,e,n=r.charCodeAt(0),o=r.length,m=c[n],u)=>(N[r]??=t,c[n]=(d,h,C,E=s)=>!d&&(C?r==C:(o<2||p.substr(s,o)==r)&&(C=r))&&h<t&&!f.id(p.charCodeAt(s+o))&&(!f.prop||f.prop(s+o))&&(v(s+o),(u=e())?G(u,E):v(E),u)||m?.(d,h,C));f.space=r=>{for(;(r=p.charCodeAt(s))<=32;)s++;return r};f.step=(r,t,e,n,o)=>(o=c[e])&&o(r,t)||(r?null:_(f.id)||null);var F={},l=(r,t,e=F[r])=>F[r]=(...n)=>t(...n)||e?.(...n),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):F[r[0]]?.(...r.slice(1))??S(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var P=46,R=48,T=57,Ar=69,hr=101,Cr=43,cr=45,L=95,J=110,gr=97,yr=102,Er=65,Sr=70,K=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),X=r=>{let t=K(_(e=>e===P&&p.charCodeAt(s+1)!==P||e>=R&&e<=T||e===L||((e===Ar||e===hr)&&((e=p.charCodeAt(s+1))>=R&&e<=T||e===Cr||e===cr)?2:0)));return p.charCodeAt(s)===J?(w(),[,BigInt(t)]):(r=+t)!=r?S():[,r]},wr={2:r=>r===48||r===49||r===L,8:r=>r>=48&&r<=55||r===L,16:r=>r>=R&&r<=T||r>=gr&&r<=yr||r>=Er&&r<=Sr||r===L};f.number=null;c[P]=r=>!r&&p.charCodeAt(s+1)!==P&&X();for(let r=R;r<=T;r++)c[r]=t=>t?void 0:X();c[R]=r=>{if(r)return;let t=f.number;if(t){for(let[e,n]of Object.entries(t))if(e[0]==="0"&&p[s+1]?.toLowerCase()===e[1]){w(2);let o=K(_(wr[n]));return p.charCodeAt(s)===J?(w(),[,BigInt("0"+e[1]+o)]):[,parseInt(o,n)]}}return X()};var _r=92,V=34,Y=39,Z=117,q=120,Ir=123,Rr=125,x=10,Ur=13,Lr={n:`
5
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},j=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,a=r=>(t,e,n="",o=String.fromCharCode(r))=>{if(t||!f.string?.[o])return;w();let m=()=>{let u=p.charCodeAt(s+1);if(u===x)return 2;if(u===Ur)return p.charCodeAt(s+2)===x?3:2;if(u===q||u===Z&&p.charCodeAt(s+2)!==Ir){let d=u===q?2:4,h=0,C;for(let E=0;E<d;E++){if((C=j(p.charCodeAt(s+2+E)))<0)return n+=p[s+1],2;h=h*16+C}return n+=String.fromCharCode(h),2+d}if(u===Z){let d=0,h=s+3,C;for(;(C=j(p.charCodeAt(h)))>=0;)d=d*16+C,h++;return h>s+3&&d<=1114111&&p.charCodeAt(h)===Rr?(n+=String.fromCodePoint(d),h-s+1):(n+=p[s+1],2)}return n+=Lr[p[s+1]]||p[s+1],2};return _(u=>u-r&&(u!==_r?(n+=p[s],1):m())),p[s]===o?w():S("Bad string"),[,n]};c[V]=a(V);c[Y]=a(Y);f.string={'"':!0};var Pr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>A(r,Pr,!0));var Tr=30,kr=40,Dr=140;I("!",Dr);A("||",Tr);A("&&",kr);var Mr=50,Nr=60,Fr=70,b=100,$r=140;A("|",Mr);A("&",Fr);A("^",Nr);A(">>",b);A("<<",b);I("~",$r);var k=90;A("<",k);A(">",k);A("<=",k);A(">=",k);var rr=80;A("==",rr);A("!=",rr);var tr=110,O=120,er=140;A("+",tr);A("-",tr);A("*",O);A("/",O);A("%",O);I("+",er);I("-",er);var D=150;y("++",D,r=>r?["++",r,null]:["++",g(D-1)]);y("--",D,r=>r?["--",r,null]:["--",g(D-1)]);var Br=5,Xr=10;$(",",Xr);$(";",Br,!0,!0);var Or=170;W("()",Or);var or=170,Qr=160;B("[]",or);z(".",or);B("()",Qr);var ir=(r,t,e,n)=>typeof r=="string"?o=>t(o,r,o):r[0]==="."?(e=i(r[1]),n=r[2],o=>t(e(o),n,o)):r[0]==="[]"&&r.length===3?(e=i(r[1]),n=i(r[2]),o=>t(e(o),n(o),o)):r[0]==="()"&&r.length===2?ir(r[1],t):(()=>{throw Error("Invalid assignment target")})(),nr={"=":(r,t,e)=>r[t]=e,"+=":(r,t,e)=>r[t]+=e,"-=":(r,t,e)=>r[t]-=e,"*=":(r,t,e)=>r[t]*=e,"/=":(r,t,e)=>r[t]/=e,"%=":(r,t,e)=>r[t]%=e,"|=":(r,t,e)=>r[t]|=e,"&=":(r,t,e)=>r[t]&=e,"^=":(r,t,e)=>r[t]^=e,">>=":(r,t,e)=>r[t]>>=e,"<<=":(r,t,e)=>r[t]<<=e};for(let r in nr)l(r,(t,e)=>(e=i(e),ir(t,(n,o,m)=>nr[r](n,o,e(m)))));l("!",r=>(r=i(r),t=>!r(t)));l("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));l("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));l("~",r=>(r=i(r),t=>~r(t)));l("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));l("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));l("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));l(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));l("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));l(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));l("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));l(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));l("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));l("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));l("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));l("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));l("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));l("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));l("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));l("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var Q=(r,t,e,n)=>typeof r=="string"?o=>t(o,r):r[0]==="."?(e=i(r[1]),n=r[2],o=>t(e(o),n)):r[0]==="[]"&&r.length===3?(e=i(r[1]),n=i(r[2]),o=>t(e(o),n(o))):r[0]==="()"&&r.length===2?Q(r[1],t):(()=>{throw Error("Invalid increment target")})();l("++",(r,t)=>Q(r,t===null?(e,n)=>e[n]++:(e,n)=>++e[n]));l("--",(r,t)=>Q(r,t===null?(e,n)=>e[n]--:(e,n)=>--e[n]));var sr=(...r)=>(r=r.map(i),t=>{let e;for(let n of r)e=n(t);return e});l(",",sr);l(";",sr);var pr=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",M=r=>{throw Error(r)};l("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=i(e[1]),n=>e(n)):(e=i(e),n=>[e(n)])),e=>r.flatMap(n=>n(e))):(t==null&&M("Missing index"),r=i(r),t=i(t),e=>{let n=t(e);return pr(n)?void 0:r(e)[n]}));l(".",(r,t)=>(r=i(r),t=t[0]?t:t[1],pr(t)?()=>{}:e=>r(e)[t]));l("()",(r,t)=>{if(t===void 0)return r==null?M("Empty ()"):i(r);let e=o=>o?.[0]===","&&o.slice(1).some(m=>m==null||e(m));e(t)&&M("Empty argument");let n=t?t[0]===","?(t=t.slice(1).map(i),o=>t.map(m=>m(o))):(t=i(t),o=>[t(o)]):()=>[];return mr(r,(o,m,u)=>o[m](...n(u)))});var mr=(r,t,e,n)=>r==null?M("Empty ()"):r[0]==="()"&&r.length==2?mr(r[1],t):typeof r=="string"?o=>t(o,r,o):r[0]==="."?(e=i(r[1]),n=r[2],o=>t(e(o),n,o)):r[0]==="?."?(e=i(r[1]),n=r[2],o=>{let m=e(o);return m==null?void 0:t(m,n,o)}):r[0]==="[]"&&r.length===3?(e=i(r[1]),n=i(r[2]),o=>t(e(o),n(o),o)):r[0]==="?.[]"?(e=i(r[1]),n=i(r[2]),o=>{let m=e(o);return m==null?void 0:t(m,n(o),o)}):(r=i(r),o=>t([r(o)],0,o));var lr=new WeakMap,Hr=(r,...t)=>typeof r=="string"?i(f(r)):lr.get(r)||lr.set(r,vr(r,t)).get(r),ur=57344,vr=(r,t)=>{let e=r.reduce((m,u,d)=>m+(d?String.fromCharCode(ur+d-1):"")+u,""),n=f(e),o=m=>{if(typeof m=="string"&&m.length===1){let u=m.charCodeAt(0)-ur,d;if(u>=0&&u<t.length)return d=t[u],Gr(d)?d:[,d]}return Array.isArray(m)?m.map(o):m};return i(o(n))},Gr=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),zt=Hr;export{B as access,A as binary,i as compile,p as cur,zt as default,S as err,g as expr,W as group,Wr as id,s as idx,Vr as keyword,Kr as literal,G as loc,c as lookup,z as member,$ as nary,_ as next,l as operator,F as operators,Jr as parens,f as parse,fr as peek,N as prec,dr as propName,v as seek,w as skip,y as token,I as unary,zr as word};
4
+ `,""+o}${u}${d}`)},G=(r,t=s)=>(Array.isArray(r)&&(r.loc=t),r),_=(r,t=s,e)=>{for(;e=r(p.charCodeAt(s));)s+=e;return p.slice(t,s)},w=(r=1)=>p[s+=r],v=r=>s=r,g=(r=0,t)=>{let e,n,o;for(t&&f.enter?.(r,t);(e=f.space())&&e!==t&&(o=f.step(n,r,e,g));)n=o;return t&&(e==t?(s++,f.exit?.(r,t)):S("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),n},fr=(r=s)=>{for(;p.charCodeAt(r)<=32;)r++;return p.charCodeAt(r)},Wr=f.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,zr=(r,t=r.length)=>p.substr(s,t)===r&&!f.id(p.charCodeAt(s+t)),Jr=()=>(w(),g(0,41)),c=[],N={},y=(r,t=32,e,n=r.charCodeAt(0),o=r.length,m=c[n],u=r.toUpperCase()!==r,d,A)=>(t=N[r]=!m&&N[r]||t,c[n]=(C,E,U,H=s)=>(d=U,(U?r==U:(o<2||r.charCodeAt(1)===p.charCodeAt(s+1)&&(o<3||p.substr(s,o)==r))&&(!u||!f.id(p.charCodeAt(s+o)))&&(d=U=r))&&E<t&&(s+=o,(A=e(C))?G(A,H):(s=H,d=0,!u&&!m&&!C&&S()),A)||m?.(C,E,d))),h=(r,t,e=!1)=>y(r,t,n=>n&&(o=>o&&[r,n,o])(g(t-(e?.5:0)))),I=(r,t,e)=>y(r,t,n=>e?n&&[r,n]:!n&&(n=g(t-.5))&&[r,n]),Kr=(r,t)=>y(r,200,e=>!e&&[,t]),$=(r,t,e,n)=>y(r,t,(o,m)=>(m=g(t-(e?.5:0)),o?.[0]!==r&&(o=[r,o||null]),m?.[0]===r?o.push(...m.slice(1)):m?o.push(m):n||fr()===r.charCodeAt(0)?o.push(null):o.length===2&&(o=o[1]),o)),W=(r,t)=>y(r[0],t,e=>!e&&[r,g(0,r.charCodeAt(1))||null]),B=(r,t)=>y(r[0],t,e=>e&&[r,e,g(0,r.charCodeAt(1))||null]),dr=(r,t)=>(f.space(),t=p.charCodeAt(s),f.id(t)&&(t<48||t>57)?_(f.id):g(r)),z=(r,t)=>y(r,t,e=>e&&(n=>n&&[r,e,n])(dr(t))),Vr=(r,t,e,n=r.charCodeAt(0),o=r.length,m=c[n],u)=>(N[r]??=t,c[n]=(d,A,C,E=s)=>!d&&(C?r==C:(o<2||p.substr(s,o)==r)&&(C=r))&&A<t&&!f.id(p.charCodeAt(s+o))&&(!f.prop||f.prop(s+o))&&(v(s+o),(u=e())?G(u,E):v(E),u)||m?.(d,A,C));f.space=r=>{for(;(r=p.charCodeAt(s))<=32;)s++;return r};f.step=(r,t,e,n,o)=>(o=c[e])&&o(r,t)||(r?null:_(f.id)||null);var F={},l=(r,t,e=F[r])=>F[r]=(...n)=>t(...n)||e?.(...n),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):F[r[0]]?.(...r.slice(1))??S(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var P=46,R=48,T=57,hr=69,Ar=101,Cr=43,cr=45,L=95,J=110,gr=97,yr=102,Er=65,Sr=70,K=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),X=r=>{let t=K(_(e=>e===P&&p.charCodeAt(s+1)!==P||e>=R&&e<=T||e===L||((e===hr||e===Ar)&&((e=p.charCodeAt(s+1))>=R&&e<=T||e===Cr||e===cr)?2:0)));return p.charCodeAt(s)===J?(w(),[,BigInt(t)]):(r=+t)!=r?S():[,r]},wr={2:r=>r===48||r===49||r===L,8:r=>r>=48&&r<=55||r===L,16:r=>r>=R&&r<=T||r>=gr&&r<=yr||r>=Er&&r<=Sr||r===L};f.number=null;c[P]=r=>!r&&p.charCodeAt(s+1)!==P&&X();for(let r=R;r<=T;r++)c[r]=t=>t?void 0:X();c[R]=r=>{if(r)return;let t=f.number;if(t){for(let[e,n]of Object.entries(t))if(e[0]==="0"&&p[s+1]?.toLowerCase()===e[1]){w(2);let o=K(_(wr[n]));return p.charCodeAt(s)===J?(w(),[,BigInt("0"+e[1]+o)]):[,parseInt(o,n)]}}return X()};var _r=92,V=34,Y=39,Z=117,q=120,Ir=123,Rr=125,x=10,Ur=13,Lr={n:`
5
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},j=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,a=r=>(t,e,n="",o=String.fromCharCode(r))=>{if(t||!f.string?.[o])return;w();let m=()=>{let u=p.charCodeAt(s+1);if(u===x)return 2;if(u===Ur)return p.charCodeAt(s+2)===x?3:2;if(u===q||u===Z&&p.charCodeAt(s+2)!==Ir){let d=u===q?2:4,A=0,C;for(let E=0;E<d;E++){if((C=j(p.charCodeAt(s+2+E)))<0)return n+=p[s+1],2;A=A*16+C}return n+=String.fromCharCode(A),2+d}if(u===Z){let d=0,A=s+3,C;for(;(C=j(p.charCodeAt(A)))>=0;)d=d*16+C,A++;return A>s+3&&d<=1114111&&p.charCodeAt(A)===Rr?(n+=String.fromCodePoint(d),A-s+1):(n+=p[s+1],2)}return n+=Lr[p[s+1]]||p[s+1],2};return _(u=>u-r&&(u!==_r?(n+=p[s],1):m())),p[s]===o?w():S("Bad string"),[,n]};c[V]=a(V);c[Y]=a(Y);f.string={'"':!0};var Pr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>h(r,Pr,!0));var Tr=30,kr=40,Dr=140;I("!",Dr);h("||",Tr);h("&&",kr);var Mr=50,Nr=60,Fr=70,b=100,$r=140;h("|",Mr);h("&",Fr);h("^",Nr);h(">>",b);h("<<",b);I("~",$r);var k=90;h("<",k);h(">",k);h("<=",k);h(">=",k);var rr=80;h("==",rr);h("!=",rr);var tr=110,O=120,er=140;h("+",tr);h("-",tr);h("*",O);h("/",O);h("%",O);I("+",er);I("-",er);var D=150;y("++",D,r=>r?["++",r,null]:["++",g(D-1)]);y("--",D,r=>r?["--",r,null]:["--",g(D-1)]);var Br=5,Xr=10;$(",",Xr);$(";",Br,!0,!0);var Or=170;W("()",Or);var or=170,Qr=160;B("[]",or);z(".",or);B("()",Qr);var ir=(r,t,e,n)=>typeof r=="string"?o=>t(o,r,o):r[0]==="."?(e=i(r[1]),n=r[2],o=>t(e(o),n,o)):r[0]==="[]"&&r.length===3?(e=i(r[1]),n=i(r[2]),o=>t(e(o),n(o),o)):r[0]==="()"&&r.length===2?ir(r[1],t):(()=>{throw Error("Invalid assignment target")})(),nr={"=":(r,t,e)=>r[t]=e,"+=":(r,t,e)=>r[t]+=e,"-=":(r,t,e)=>r[t]-=e,"*=":(r,t,e)=>r[t]*=e,"/=":(r,t,e)=>r[t]/=e,"%=":(r,t,e)=>r[t]%=e,"|=":(r,t,e)=>r[t]|=e,"&=":(r,t,e)=>r[t]&=e,"^=":(r,t,e)=>r[t]^=e,">>=":(r,t,e)=>r[t]>>=e,"<<=":(r,t,e)=>r[t]<<=e};for(let r in nr)l(r,(t,e)=>(e=i(e),ir(t,(n,o,m)=>nr[r](n,o,e(m)))));l("!",r=>(r=i(r),t=>!r(t)));l("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));l("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));l("~",r=>(r=i(r),t=>~r(t)));l("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));l("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));l("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));l(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));l("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));l(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));l("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));l(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));l("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));l("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));l("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));l("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));l("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));l("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));l("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));l("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var Q=(r,t,e,n)=>typeof r=="string"?o=>t(o,r):r[0]==="."?(e=i(r[1]),n=r[2],o=>t(e(o),n)):r[0]==="[]"&&r.length===3?(e=i(r[1]),n=i(r[2]),o=>t(e(o),n(o))):r[0]==="()"&&r.length===2?Q(r[1],t):(()=>{throw Error("Invalid increment target")})();l("++",(r,t)=>Q(r,t===null?(e,n)=>e[n]++:(e,n)=>++e[n]));l("--",(r,t)=>Q(r,t===null?(e,n)=>e[n]--:(e,n)=>--e[n]));var sr=(...r)=>(r=r.map(i),t=>{let e;for(let n of r)e=n(t);return e});l(",",sr);l(";",sr);var pr=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",M=r=>{throw Error(r)};l("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=i(e[1]),n=>e(n)):(e=i(e),n=>[e(n)])),e=>r.flatMap(n=>n(e))):(t==null&&M("Missing index"),r=i(r),t=i(t),e=>{let n=t(e);return pr(n)?void 0:r(e)[n]}));l(".",(r,t)=>(r=i(r),t=t[0]?t:t[1],pr(t)?()=>{}:e=>r(e)[t]));l("()",(r,t)=>{if(t===void 0)return r==null?M("Empty ()"):i(r);let e=o=>o?.[0]===","&&o.slice(1).some(m=>m==null||e(m));e(t)&&M("Empty argument");let n=t?t[0]===","?(t=t.slice(1).map(i),o=>t.map(m=>m(o))):(t=i(t),o=>[t(o)]):()=>[];return mr(r,(o,m,u)=>o[m](...n(u)))});var mr=(r,t,e,n)=>r==null?M("Empty ()"):r[0]==="()"&&r.length==2?mr(r[1],t):typeof r=="string"?o=>t(o,r,o):r[0]==="."?(e=i(r[1]),n=r[2],o=>t(e(o),n,o)):r[0]==="?."?(e=i(r[1]),n=r[2],o=>{let m=e(o);return m==null?void 0:t(m,n,o)}):r[0]==="[]"&&r.length===3?(e=i(r[1]),n=i(r[2]),o=>t(e(o),n(o),o)):r[0]==="?.[]"?(e=i(r[1]),n=i(r[2]),o=>{let m=e(o);return m==null?void 0:t(m,n(o),o)}):(r=i(r),o=>t([r(o)],0,o));var lr=new WeakMap,Hr=(r,...t)=>typeof r=="string"?i(f(r)):lr.get(r)||lr.set(r,vr(r,t)).get(r),ur=57344,vr=(r,t)=>{let e=r.reduce((m,u,d)=>m+(d?String.fromCharCode(ur+d-1):"")+u,""),n=f(e),o=m=>{if(typeof m=="string"&&m.length===1){let u=m.charCodeAt(0)-ur,d;if(u>=0&&u<t.length)return d=t[u],Gr(d)?d:[,d]}return Array.isArray(m)?m.map(o):m};return i(o(n))},Gr=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),zt=Hr;export{B as access,h as binary,i as compile,p as cur,zt as default,S as err,g as expr,W as group,Wr as id,s as idx,Vr as keyword,Kr as literal,G as loc,c as lookup,z as member,$ as nary,_ as next,l as operator,F as operators,Jr as parens,f as parse,fr as peek,N as prec,dr as propName,v as seek,w as skip,y as token,I as unary,zr as word};