subscript 10.8.0 → 10.8.1

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/string.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * String literals with ES escape sequences.
3
3
  * Configurable via parse.string: { '"': true, "'": true }
4
4
  */
5
- import { parse, lookup, next, err, skip, idx, cur } from '../parse.js';
5
+ import { parse, lookup, err, skip, idx, cur } from '../parse.js';
6
6
 
7
7
  const BSLASH = 92, DQUOTE = 34, SQUOTE = 39, U = 117, X = 120, LBRACE = 123, RBRACE = 125, LF = 10, CR = 13;
8
8
  const esc = { n: '\n', r: '\r', t: '\t', b: '\b', f: '\f', v: '\v', '0': '\0' };
@@ -55,15 +55,30 @@ const decodeEscape = () => {
55
55
  return [esc[cur[idx + 1]] || cur[idx + 1], 2];
56
56
  };
57
57
 
58
- // `s` is the closed-over accumulator shared with the escape handler.
58
+ // Copy literal spans once. Joining decoded escapes once also stays linear on
59
+ // engines with flat strings, where character-by-character concatenation copies
60
+ // every prefix. Leave the closing quote or template interpolation to the caller.
61
+ const scanString = (q, template = false) => {
62
+ let start = idx, parts, c;
63
+ while ((c = cur.charCodeAt(idx)) - q) {
64
+ if (template && (c === 0 || c === 36 && cur.charCodeAt(idx + 1) === LBRACE)) break;
65
+ if (c !== BSLASH) { skip(); continue; }
66
+ if (!parts) parts = [];
67
+ parts.push(cur.slice(start, idx));
68
+ const [text, width] = decodeEscape();
69
+ parts.push(text);
70
+ skip(width);
71
+ start = idx;
72
+ }
73
+ const tail = cur.slice(start, idx);
74
+ return parts ? (parts.push(tail), parts.join('')) : tail;
75
+ };
76
+
59
77
  const parseString = q => (a, _, s = '', qc = String.fromCharCode(q)) => {
60
78
  if (a || !parse.string?.[qc]) return;
61
79
  skip();
62
80
 
63
- const escape = () => { const [t, w] = decodeEscape(); s += t; return w; };
64
-
65
- // c - q is 0 at close, NaN at EOF — both falsy, terminating the loop.
66
- next(c => c - q && (c !== BSLASH ? (s += cur[idx], 1) : escape()));
81
+ s += scanString(q);
67
82
  cur[idx] === qc ? skip() : err('Bad string');
68
83
  return [, s];
69
84
  };
@@ -72,4 +87,4 @@ lookup[DQUOTE] = parseString(DQUOTE);
72
87
  lookup[SQUOTE] = parseString(SQUOTE);
73
88
  parse.string = { '"': true };
74
89
 
75
- export { esc, decodeEscape };
90
+ export { esc, decodeEscape, scanString };
@@ -4,9 +4,9 @@
4
4
  * Tagged: tag`...` → ['``', 'tag', ...]
5
5
  */
6
6
  import { parse, skip, err, expr, lookup, cur, idx } from '../parse.js';
7
- import { decodeEscape } from './string.js';
7
+ import { scanString } from './string.js';
8
8
 
9
- const ACCESS = 170, BACKTICK = 96, DOLLAR = 36, OBRACE = 123, BSLASH = 92;
9
+ const ACCESS = 170, BACKTICK = 96, DOLLAR = 36, OBRACE = 123;
10
10
 
11
11
  // Parse template body after opening ` — string and expression segments
12
12
  // strictly alternate (string, expr, string, …), so every interpolation is
@@ -16,13 +16,14 @@ const ACCESS = 170, BACKTICK = 96, DOLLAR = 36, OBRACE = 123, BSLASH = 92;
16
16
  // same code point as the '' literal.
17
17
  const parseBody = () => {
18
18
  const parts = [];
19
- let s = '', c, e;
20
- for (; (c = cur.charCodeAt(idx)) !== BACKTICK; )
21
- !c ? err('Unterminated template') :
22
- c === BSLASH ? (e = decodeEscape(), s += e[0], skip(e[1])) :
23
- c === DOLLAR && cur.charCodeAt(idx + 1) === OBRACE ? (parts.push([, s]), s = '', skip(2), parts.push(expr(0, 125))) :
24
- (s += cur[idx], skip());
25
- return parts.push([, s]), skip(), parts;
19
+ for (;;) {
20
+ parts.push([, scanString(BACKTICK, true)]);
21
+ const c = cur.charCodeAt(idx);
22
+ if (c === BACKTICK) return skip(), parts;
23
+ if (c !== DOLLAR || cur.charCodeAt(idx + 1) !== OBRACE) err('Unterminated template');
24
+ skip(2);
25
+ parts.push(expr(0, 125));
26
+ }
26
27
  };
27
28
 
28
29
  // Collapse a single-part body to that part (string or expression); else keep as ['`', ...parts]
package/jessie.min.js CHANGED
@@ -1,7 +1,7 @@
1
- var u,m,s=r=>(u=0,m=r,s.enter?.(),r=d(),m[u]?O():r||""),O=(r="Unexpected token",e=u,t=m.slice(0,e).split(`
2
- `),o=t.pop(),n=m.slice(Math.max(0,e-40),e),p="\u032D",c=(m[e]||" ")+p,l=m.slice(e+1,e+20))=>{throw SyntaxError(`${r} at ${t.length+1}:${o.length+1}
3
- ${n}${c}${l}`)},Xe=(r,e=u)=>(Array.isArray(r)&&(r.loc=e),r),E=(r,e=u,t)=>{for(;t=r(m.charCodeAt(u));)u+=t;return m.slice(e,u)},h=(r=1)=>m[u+=r],T=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)):O("Unclosed "+String.fromCharCode(e-(e>42?2:1)))),o},x=(r=u)=>{for(;m.charCodeAt(r)<=32;)r++;return m.charCodeAt(r)},Mo=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,S=(r,e=r.length)=>m.substr(u,e)===r&&!s.id(m.charCodeAt(u+e)),L=()=>(h(),d(0,41)),N=[],v={},g=(r,e=32,t,o=r.charCodeAt(0))=>$r({op:r,l:r.length,p:v[r]=!N[o]&&v[r]||e,map:t,word:r.toUpperCase()!==r,kw:!1}),A=(r,e,t=!1)=>g(r,e,(o,n)=>o&&(n=d(e-(t?.5:0)))&&[r,o,n]),_=(r,e,t)=>g(r,e,o=>t?o&&[r,o]:!o&&(o=d(e-.5))&&[r,o]),j=(r,e)=>g(r,200,t=>!t&&[,e]),pr=(r,e,t,o)=>g(r,e,(n,p,c=n)=>(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||x()===r.charCodeAt(0)?n.push(null):c&&n.length===2&&(n=n[1]),n)),z=(r,e)=>g(r[0],e,t=>!t&&[r,d(0,r.charCodeAt(1))||null]),fr=(r,e)=>g(r[0],e,t=>t&&[r,t,d(0,r.charCodeAt(1))||null]),lr=(r,e)=>(s.space(),e=m.charCodeAt(u),s.id(e)&&(e<48||e>57)?E(s.id):d(r)),Qr=(r,e)=>g(r,e,(t,o)=>t&&(o=lr(e))&&[r,t,o]),w=(r,e,t)=>(v[r]??=e,$r({op:r,l:r.length,p:e,map:t,word:!0,kw:!0})),Xr=(r,e,t=(o,n,p,c=u,l,a,y)=>{for(y=0;a=r[y++];)if(!(a.kw&&o)&&!(p?a.op!==p:!((a.l<2||a.op.charCodeAt(1)===m.charCodeAt(u+1)&&(a.l<3||m.substr(u,a.l)===a.op))&&(!a.word||!s.id(m.charCodeAt(u+a.l)))&&(p=a.op)))&&!(n>=a.p)&&!(a.kw&&s.prop&&!s.prop(u+a.l))){if(u+=a.l,l=a.map(o))return Xe(l,c);u=c,p=0,a.word||o||e||r[y]||O()}return e?.(o,n,p)})=>(t.ops=r,t.tail=e,t),$r=(r,e=r.op.charCodeAt(0),t=N[e])=>N[e]=t?.ops?Xr([r,...t.ops],t.tail):Xr([r],t);s.space=r=>{for(;(r=m.charCodeAt(u))<=32;)u++;return r};s.step=(r,e,t,o,n)=>(n=N[t])&&n(r,e)||(r?null:E(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))??O(`Unknown operator: ${r[0]}`,r?.loc):i.id(r);i.id=r=>r===void 0?()=>{}:e=>e?.[r];var ur=46,Q=48,W=57,jr=69,Wr=101,Qe=43,$e=45,qr=95,je=97,We=102,qe=65,ze=70,zr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),Je=r=>r===ur&&(r=m.charCodeAt(u+1))!==ur&&!(s.id(r)&&r>W&&r!==Wr&&r!==jr)||r>=Q&&r<=W||r===qr||((r===jr||r===Wr)&&((r=m.charCodeAt(u+1))>=Q&&r<=W||r===Qe||r===$e)?2:0),cr=r=>(r=+zr(E(Je)))!=r?O():[,r],Ve=r=>e=>e===qr||e>=Q&&e<=W&&e-Q<r||r===16&&(e>=je&&e<=We||e>=qe&&e<=ze);s.number=null;N[ur]=r=>!r&&m.charCodeAt(u+1)>=Q&&m.charCodeAt(u+1)<=W&&cr();for(let r=Q;r<=W;r++)N[r]=e=>e?void 0:cr();N[Q]=(r,e)=>{if(!r){for(let t in s.number)if(t[0]==="0"&&(m.charCodeAt(u+1)|32)===t.charCodeAt(1)){h(2);let o=zr(E(Ve(e=s.number[t])));return[,parseInt(o,e)]}return cr()}};var te=92,Jr=34,Vr=39,Yr=117,Zr=120,Ye=123,Ze=125,br=10,be=13,rt={n:`
4
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},re=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,ee=r=>{if(m.charCodeAt(r)!==te)return;let e=m.charCodeAt(r+1);if(e===Zr||e===Yr&&m.charCodeAt(r+2)!==Ye){let t=e===Zr?2:4,o=0,n;for(let p=0;p<t;p++){if((n=re(m.charCodeAt(r+2+p)))<0)return;o=o*16+n}return[o,2+t]}if(e===Yr){let t=0,o=r+3,n;for(;(n=re(m.charCodeAt(o)))>=0;)t=t*16+n,o++;if(o>r+3&&t<=1114111&&m.charCodeAt(o)===Ze)return[t,o-r+1]}},mr=()=>{let r=m.charCodeAt(u+1);if(r===br)return["",2];if(r===be)return["",m.charCodeAt(u+2)===br?3:2];let e=ee(u);if(e){let[t,o]=e;if(t>=55296&&t<=56319){let n=ee(u+o);n&&n[0]>=56320&&n[0]<=57343&&(t=65536+(t-55296)*1024+n[0]-56320,o+=n[1])}return[String.fromCodePoint(t),o]}return[rt[m[u+1]]||m[u+1],2]},oe=r=>(e,t,o="",n=String.fromCharCode(r))=>{if(e||!s.string?.[n])return;h();let p=()=>{let[c,l]=mr();return o+=c,l};return E(c=>c-r&&(c!==te?(o+=m[u],1):p())),m[u]===n?h():O("Bad string"),[,o]};N[Jr]=oe(Jr);N[Vr]=oe(Vr);s.string={'"':!0};var et=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>A(r,et,!0));var tt=30,ot=40,nt=140;_("!",nt);A("||",tt);A("&&",ot);var it=50,st=60,pt=70,ne=100,ft=140;A("|",it);A("&",pt);A("^",st);A(">>",ne);A("<<",ne);_("~",ft);var Y=90;A("<",Y);A(">",Y);A("<=",Y);A(">=",Y);var ie=80;A("==",ie);A("!=",ie);var se=110,ar=120,pe=140;A("+",se);A("-",se);A("*",ar);A("/",ar);A("%",ar);_("+",pe);_("-",pe);var Z=150;g("++",Z,r=>r?["++",r,null]:["++",d(Z-1)]);g("--",Z,r=>r?["--",r,null]:["--",d(Z-1)]);var lt=5,ut=10;pr(",",ut);pr(";",lt,!0,!0);var ct=170;z("()",ct);var fe=170,mt=160;fr("[]",fe);Qr(".",fe);fr("()",mt);var at=s.space;s.comment??={"//":`
5
- `,"/*":"*/"};s.space=()=>{for(var r,e,t,o,n;r=at();){for(t in e=s.comment)if(r===t.charCodeAt(0)&&(t.length<2||m.charCodeAt(u+1)===t.charCodeAt(1))&&(t.length<3||m.substr(u,t.length)===t)){o=e[t],n=m.indexOf(o,u+t.length),T(n<0?m.length:o===`
6
- `?n:n+o.length),r=0;break}if(r)return r}return r};var le=80;A("===",le);A("!==",le);var dt=30;A("??",dt);var ht=130,At=20;A("**",ht,!0);A("**=",At,!0);var ue=90;A("in",ue);A("of",ue);var yt=20,wt=100;A(">>>",wt);A(">>>=",yt,!0);var dr=20;A("||=",dr,!0);A("&&=",dr,!0);A("??=",dr,!0);j("true",!0);j("false",!1);j("null",null);w("undefined",200,()=>[]);j("NaN",NaN);j("Infinity",1/0);var hr=20;g("?",hr,(r,e,t)=>r&&(e=d(hr-1))&&E(o=>o===58)&&(t=d(hr-1),["?",r,e,t]));var Ct=20;A("=>",Ct,!0);var gt=20;_("...",gt);var ce=170;g("?.",ce,(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(ce),e?["?.",r,e]:void 0)});var Ar=140,me=160,Et=me+1;_("typeof",Ar);_("void",Ar);_("delete",Ar);var St=r=>s.space()===40?(h(),["()",r,d(0,41)||null]):r;w("new",Et,()=>S(".target")?(h(7),["new.target"]):["new",St(d(me))]);var kt=20,ae=200;s.prop=r=>x(r)!==58;z("[]",ae);z("{}",ae);A(":",kt-1,!0);var Tt=170,yr=96,Nt=36,Rt=123,It=92,de=()=>{let r=[],e="",t,o;for(;(t=m.charCodeAt(u))!==yr;)t?t===It?(o=mr(),e+=o[0],h(o[1])):t===Nt&&m.charCodeAt(u+1)===Rt?(r.push([,e]),e="",h(2),r.push(d(0,125))):(e+=m[u],h()):O("Unterminated template");return r.push([,e]),h(),r},Ot=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],_t=N[yr];N[yr]=(r,e)=>r&&e<Tt?s.asi&&s.newline?void 0:(h(),["``",r,...de()]):r?_t?.(r,e):(h(),Ot(de()));s.string["'"]=!0;s.number={"0x":16,"0b":2,"0o":8};var Lt=92,Pt=117,vt=123,Bt=125,Mt=183,Ut=s.id,he=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,Dt=(r=u+2,e,t=0,o=0)=>{if(m.charCodeAt(u)!==Lt||m.charCodeAt(u+1)!==Pt)return 0;if(m.charCodeAt(r)===vt){for(;he(e=m.charCodeAt(++r));)t=t*16+(e<=57?e-48:(e&31)+9);return r>u+3&&t<=1114111&&m.charCodeAt(r)===Bt?r-u+1:0}for(;o<4&&he(m.charCodeAt(r+o));)o++;return o===4?6:0};s.id=r=>Ut(r)||r===Mt||Dt();var wr=5,ye=10,Cr=r=>{let e=u,t=d(ye-1);return t==null?r:r==="let"&&(t==="in"||t==="of")?(T(e),r):t[0]===","?[r,...t.slice(1)]:[r,t]};w("let",wr+1,()=>Cr("let"));w("const",wr+1,()=>Cr("const"));w("var",wr+1,()=>Cr("var"));var Ae=r=>Array.isArray(r)&&r[0]==="="&&typeof r[1]=="string";w("using",200,()=>{let r=u;s.space();let e=m.charCodeAt(u);if(s.id(e)&&(e<48||e>57)){let t=u;if(E(s.id),s.space(),m.charCodeAt(u)===61&&m.charCodeAt(u+1)!==61&&m.charCodeAt(u+1)!==62){T(t);let o=d(ye-1);if(o[0]===","?o.slice(1).every(Ae):Ae(o))return o[0]===","?["using",...o.slice(1)]:["using",o]}}return T(r),"using"});var b=5,Kt=59,U=()=>(s.space()===123||O("Expected {"),h(),d(b-.5,125)||null),F=()=>s.space()!==123?d(b+.5):(h(),d(b-.5,125)||null),Ft=()=>{let r=u;return s.space()===Kt&&h(),s.space(),S("else")?(h(4),s.semi=!1,!0):(T(r),!1)};w("if",b+1,()=>{s.space();let r=["if",L(),F()];return Ft()&&r.push(F()),r});var Gt=200;w("function",Gt,()=>{s.space();let r=!1;m[u]==="*"&&(r=!0,h(),s.space());let e=E(s.id);return e&&s.space(),r?["function*",e,L()||null,U()]:["function",e,L()||null,U()]});var we=200,Er=140,gr=20,Ce=40;_("await",Er);var xt=10,Ht=13,ge=r=>{let e;for(;(e=m.charCodeAt(r))<=32;){if(e===xt||e===Ht)return!0;r++}return!1};w("yield",Er,()=>ge(u)?["yield"]:(s.space(),m[u]==="*"?(h(),s.space(),["yield*",d(gr)]):["yield",d(gr)]));w("async",we,()=>{if(ge(u))return;if(s.space(),S("function"))return["async",d(Er)];let r=u,e=d(we-.5);if(e?.[0]===":")return[":",e[1],["async",e[2]]];if(e&&x()===Ce)return["async",e];if((e||x()===Ce)&&(T(r),e=d(gr-.5))?.[0]==="=>")return["async",e]});var Ee=200;var Xt=90,Qt=175,$t=160,jt=$t-.5;_("static",Qt);A("instanceof",Xt);g("#",Ee,r=>{if(r)return;let e=E(s.id);return e?"#"+e:void 0});w("class",Ee,()=>{s.space();let r=E(s.id)||null;if(r==="extends")r=null,s.space();else{if(s.space(),!S("extends"))return["class",r,null,U()];h(7),s.space()}return["class",r,d(jt),U()]});var Sr=47,Wt=92,qt=91,zt=93;g("/",140,r=>{let e=m.charCodeAt(u);if(r||e===Sr||e===42||e===43||e===63)return;let t=!1,o=E(p=>p===Wt?2:p===qt?(t=!0,1):p===zt?(t=!1,1):p&&(t||p!==Sr));m.charCodeAt(u)===Sr||O("Unterminated regex"),h();let n=E(p=>p===103||p===105||p===109||p===115||p===117||p===121);return n?["//",o,n]:["//",o]});var $=5,J=125,V=59;w("while",$+1,()=>(s.space(),["while",L(),F()]));w("do",$+1,r=>(r=F(),s.space(),h(5),s.space(),["do",r,L()]));var Se={let:1,const:1,var:1},kr=(r,e=r,t)=>{if(Se[r?.[0]]&&Array.isArray(r[1]))return(e=kr(r[1]))?.[0]==="in"||e?.[0]==="of"?[e[0],[r[0],e[1]],r.length>2?[",",e[2],...r.slice(2)]:e[2]]:r;for(;Array.isArray(e)&&v[e[0]]<v.in&&!Se[e[0]];)t=e,e=e[1];return t&&Array.isArray(e)&&(e[0]==="in"||e[0]==="of")?(t[1]=e[2],[e[0],e[1],r]):r};w("for",$+1,()=>(s.space(),S("await")?(h(5),s.space(),["for await",kr(L()),F()]):["for",kr(L()),F()]));w("break",$+1,()=>{s.asi&&(s.newline=!1);let r=u,e=s.space();if(!e||e===J||e===V||s.newline)return["break"];let t=E(s.id);if(!t)return["break"];let o=s.space();return!o||o===J||o===V||s.newline?["break",t]:(T(r),["break"])});w("continue",$+1,()=>{s.asi&&(s.newline=!1);let r=u,e=s.space();if(!e||e===J||e===V||s.newline)return["continue"];let t=E(s.id);if(!t)return["continue"];let o=s.space();return!o||o===J||o===V||s.newline?["continue",t]:(T(r),["continue"])});w("return",$+1,()=>{s.asi&&(s.newline=!1);let r=s.space();return!r||r===J||r===V||s.newline?["return"]:["return",d($)]});var Tr=5;w("try",Tr+1,()=>{let r=["try",U()];return s.space(),S("catch")&&(h(5),s.space(),r.push(["catch",x()===40?L():null,U()])),s.space(),S("finally")&&(h(7),r.push(["finally",U()])),r});w("throw",Tr+1,()=>{if(s.asi&&(s.newline=!1),s.space(),s.newline)throw SyntaxError("Unexpected newline after throw");return["throw",d(Tr)]});var Ne=5,Jt=20,ke=58,Vt=59,Nr=125,Rr=0,Re=(r,e=r.length,t=r.charCodeAt(0),o=N[t])=>N[t]=(n,p,c)=>S(r)&&!n&&Rr&&(!s.prop||s.prop(u+e))||o?.(n,p,c);Re("case");Re("default");var Te=r=>{let e=[];for(;(r=s.space())!==Nr&&!S("case")&&!S("default");){if(r===Vt){h();continue}s.semi=!1,e.push(d(Ne+.5))||O()}return e.length>1?[";",...e]:e[0]||null},Yt=()=>{s.space()===123||O("Expected {"),h(),Rr++;let r=[];try{for(;s.space()!==Nr;)if(S("case")){T(u+4),s.space(),s.semi=!1;let e=d(Jt-.5);s.space()===ke&&h(),r.push(["case",e,Te()])}else S("default")?(T(u+7),s.space()===ke&&h(),r.push(["default",Te()])):O("Expected case or default")}finally{Rr--}return h(),s.exit?.(0,Nr),r};w("switch",Ne+1,()=>s.space()===40&&["switch",L(),...Yt()]);var Ir=5,Zt=20;w("debugger",Ir+1,()=>["debugger"]);w("with",Ir+1,()=>(s.space(),["with",L(),F()]));var bt=["if","for","while","do","switch","try"];g(":",Zt-1,r=>typeof r=="string"&&(s.space(),bt.some(e=>S(e)))&&[":",r,d(Ir)]);var Or=5,q=10,Ie=42,ro=N[Ie];N[Ie]=(r,e)=>r?ro?.(r,e):(h(),"*");g("from",q+1,r=>r?r[0]!=="="&&r[0]!==","&&(s.space(),["from",r,d(q+1)]):!1);g("as",q+2,r=>r?(s.space(),["as",r,d(q+2)]):!1);w("import",Or,()=>S(".meta")?(h(5),["import.meta"]):["import",d(q)]);w("export",Or,()=>(s.space(),S("default")?(h(7),["export",["default",d(q)]]):["export",d(Or)]));var eo=20,rr=200,to=10,oo=13,no=34,io=35,so=39,Oe=40,Lr=41,po=91,Pr=123,vr=125,fo=(r,e)=>{for(;r<e;){let t=m.charCodeAt(r++);if(t===to||t===oo)return!0}return!1},lo=r=>r===no||r===so||r===po||r===io,_e=()=>E(s.id)||(lo(m.charCodeAt(u))?d(rr-.5):null),uo=r=>typeof r=="string"||Array.isArray(r)&&(r[0]===void 0||r[0]==="[]"),er=r=>e=>{let t=s.newline,o=s.semi,n=r(e);return n||(s.newline=t,s.semi=o),n},Le=r=>e=>{if(e)return;let t=u;if(s.space(),s.semi||fo(t,u))return!1;let o=_e();if(!o||(s.space(),m.charCodeAt(u)!==Oe))return!1;h();let n=d(0,Lr);return s.space(),m.charCodeAt(u)!==Pr?!1:(h(),[r,o,n,d(0,vr)])};g("get",rr,er(Le("get")));g("set",rr,er(Le("set")));var _r=r=>r==null||typeof r=="string"||Array.isArray(r)&&(r[0]===","?r.slice(1).every(_r):r[0]==="="?typeof r[1]=="string"||_r(r[1]):r[0]==="..."||r[0]==="{}"||r[0]==="[]"),co=v["*"];g("*",rr,er(r=>{let e=r&&s.newline;if(r&&!e)return;let t=u,o=_e();if(!o)return r?(T(t),void 0):!1;if(s.space(),m.charCodeAt(u)!==Oe)return r?(T(t),void 0):!1;h();let n=d(0,Lr)||null;if(r&&!_r(n))return T(t),void 0;if(s.space(),m.charCodeAt(u)!==Pr)return r?(T(t),void 0):!1;h();let p=[":",o,["function*",null,n,d(0,vr)||null]];return r?r[0]===";"?(r.push(p),r):[";",r,p]:p}));v["*"]=co;g("(",eo-1,er(r=>{if(!r)return;let e,t;if(Array.isArray(r)&&r[0]==="static"&&(e="static",r=r[1]),Array.isArray(r)&&r[0]==="async"&&(t=!0,r=r[1]),!uo(r))return;let o=d(0,Lr)||null;if(s.space(),m.charCodeAt(u)!==Pr)return;h();let n=["function",null,o,d(0,vr)||null];t&&(n=["async",n]);let p=[":",r,n];return e?[e,p]:p}));s.comment["#!"]=`
7
- `;var Me=32,Dr=10,mo=59,ao=125,Pe=91,ve=40,tr=v.asi??v[";"],ho=s._baseSpace??=s.space,Ao=s._baseStep??=s.step,Br=r=>Array.isArray(r)||typeof r=="string",yo=(v[";"]??5)+1,Ur=r=>Array.isArray(r)&&(v[r[0]]<=yo||r[0]==="{}"&&Ur(r[1])),wo=(r,e)=>{for(;(e=m.charCodeAt(r))<=Me;){if(e===Dr)return!0;r++}return!1},Co=(r=u,e)=>{for(;r-- >0&&(e=m.charCodeAt(r))<=Me;)if(e===Dr)return!0;return!1};s.space=(r,e)=>{for(;;){for(e=u,r=ho();e<u;)if(m.charCodeAt(e++)===Dr){s.newline=!0;break}if(r===mo&&wo(u+1)){T(u+1),s.newline=s.semi=!0;continue}return r}};s.enter=()=>s.newline=s.semi=!1;s.exit=(r,e)=>{e===ao&&(s.newline=!0,s.semi=!1)};s.step=(r,e,t,o)=>{if(s.semi&&e>=tr)return!1;if(r&&!Br(r))return null;if(Br(r)){let p=(t===Pe||t===ve)&&Co();if(s.semi||t===Pe&&(p||Ur(r))||t===ve&&(Ur(r)||p&&e>=tr))return Be(r,e,o)??null}let n=s.newline;return Ao(r,e,t,o)??(Br(r)&&n?Be(r,e,o)??null:null)};var Mr=0,go=2e3,Be=s.asi=(r,e,t,o,n)=>{if(e>=tr||Mr>=go)return;s.semi=!1;let p=u;Mr++;try{o=t(tr-.5)}finally{Mr--}if(!(!o||u===p))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var De=(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?De(r[1],e):(()=>{throw Error("Invalid assignment target")})(),Ue={"=":(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 Ue)f(r,(e,t)=>(t=i(t),De(e,(o,n,p)=>Ue[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 Kr=(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?Kr(r[1],e):(()=>{throw Error("Invalid increment target")})();f("++",(r,e)=>Kr(r,e===null?(t,o)=>t[o]++:(t,o)=>++t[o]));f("--",(r,e)=>Kr(r,e===null?(t,o)=>t[o]--:(t,o)=>--t[o]));var Ke=(...r)=>(r=r.map(i),e=>{let t;for(let o of r)t=o(e);return t});f(",",Ke);f(";",Ke);var Fe=r=>r!=null&&(typeof r=="object"||typeof r=="function"),M=r=>Fe(r)?Reflect.ownKeys({[r]:0})[0]:r,P=r=>typeof r=="string"&&(r[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype"),Eo=r=>P(M(r));i.id=r=>r===void 0||Eo(r)?()=>{}:e=>e?.[r];var 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=M(e(t));return P(o)?void 0:r(t)[o]}));f(".",(r,e)=>(r=i(r),e=M(e[0]?e:e[1]),P(e)?()=>{}:t=>r(t)[e]));f("()",(r,e)=>{if(e===void 0)return r==null?or("Empty ()"):i(r);let t=p=>p?.[0]===","&&p.slice(1).some(c=>c==null||t(c));t(e)&&or("Empty argument");let o=e?e[0]===","?(e=e.slice(1).map(i),p=>e.map(c=>c(p))):(e=i(e),p=>[e(p)]):()=>[],n=xr(r);return n<0?()=>{}:Gr(r,n?(p,c,l)=>(c=M(c),P(c)?void 0:p[c](...o(l))):(p,c,l)=>p[c](...o(l)))});var D=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&D(r[1])||r[0]==="{}"),Gr=(r,e,t,o)=>r==null?or("Empty ()"):r[0]==="()"&&r.length==2?Gr(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)),Fr=r=>Fe(r)?1:P(r)?-1:0,xr=(r,e=r?.[0],t=r?.[2])=>typeof r=="string"?Fr(r):e==="()"&&r.length==2?xr(r[1]):e==="."||e==="?."?Fr(t):(e==="[]"||e==="?.[]")&&r.length===3?Array.isArray(t)&&t[0]==null?Fr(t[1]):1:0,G=(r,e,t=xr(r))=>t<0?()=>{}:Gr(r,t?(o,n,p)=>(n=M(n),P(n)?void 0:e(o,n,p)):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)));var So=r=>{throw Error(r)};f("**",(r,e)=>(r=i(r),e=i(e),t=>r(t)**e(t)));f("**=",(r,e)=>(D(r)||So("Invalid assignment target"),e=i(e),G(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 ko=r=>{throw Error(r)};f(">>>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>>e(t)));f(">>>=",(r,e)=>(D(r)||ko("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]>>>=e(n))));var To=r=>r[0]?.[0]===","?r[0].slice(1):r,H=(r,e,t)=>{if(typeof r=="string"){t[r]=e;return}let[o,...n]=r,p=To(n);if(o==="{}"){let c=[];for(let l of p){if(Array.isArray(l)&&l[0]==="..."){let C={};for(let I in e)!c.includes(I)&&!P(I)&&(C[I]=e[I]);t[l[1]]=C;break}let a,y,R;typeof l=="string"?a=y=l:l[0]==="="?(typeof l[1]=="string"?a=y=l[1]:[,a,y]=l[1],R=l[2]):[,a,y]=l,c.push(a=M(a));let k=P(a)?void 0:e[a];k===void 0&&R&&(k=i(R)(t)),H(y,k,t)}}else if(o==="[]"){let c=0;for(let l of p){if(l===null){c++;continue}if(Array.isArray(l)&&l[0]==="..."){t[l[1]]=e.slice(c);break}let a=l,y;Array.isArray(l)&&l[0]==="="&&([,a,y]=l);let R=e[c++];R===void 0&&y&&(R=i(y)(t)),H(a,R,t)}}},Hr=(...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=>H(t,n(p),p)}return i(e)}),e=>{for(let t of r)t(e)});f("let",Hr);f("const",Hr);f("var",Hr);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=>H(t,e(o),o)}return D(r)||nr("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]=e(n))});f("||=",(r,e)=>(D(r)||nr("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]||=e(n))));f("&&=",(r,e)=>(D(r)||nr("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]&&=e(n))));f("??=",(r,e)=>(D(r)||nr("Invalid assignment target"),e=i(e),G(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 B=[];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 c=e?.[0]==="{}";return e=i(c?["{",e[1]]:e),l=>(...a)=>{let y={};t.forEach((k,C)=>y[k]=a[C]),n&&(y[n]=a.slice(o));let R=new Proxy(y,{get:(k,C)=>C in k?k[C]:l?.[C],set:(k,C,I)=>((C in k?k:l)[C]=I,!0),has:(k,C)=>C in k||(l?C in l:!1)});try{let k=e(R);return c?void 0:k}catch(k){if(k===B)return k[0];throw k}}});f("...",r=>(r=i(r),e=>{let t=r(e),o=[];for(let n of Object.keys(t))P(n)||o.push([n,t[n]]);return o}));f("?.",(r,e)=>(r=i(r),e=M(e),P(e)?()=>{}:t=>r(t)?.[e]));f("?.[]",(r,e)=>(r=i(r),e=i(e),t=>{let o=r(t);if(o==null)return;let n=M(e(t));return P(n)?void 0:o[n]}));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]==="."||r[0]==="?."){let n=r[0]==="?.",p=i(r[1]),c=M(r[2]);return P(c)?()=>{}:n?l=>p(l)?.[c]?.(...t(l)):l=>p(l)[c]?.(...t(l))}if((r[0]==="[]"||r[0]==="?.[]")&&r.length===3){let n=r[0]==="?.[]",p=i(r[1]),c=i(r[2]);return l=>{let a=p(l);if(n&&a==null)return;let y=M(c(l));return P(y)?void 0:a[y]?.(...t(l))}}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(c=>c(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 No=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);f("{}",(r,e)=>{if(e!==void 0)return;if(!No(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 c of t.flatMap(l=>l(o)))if(c[0]===ir){let[,l,a]=c;p[l]={...p[l],...a,configurable:!0,enumerable:!0}}else n[c[0]]=c[1];for(let c in p)Object.defineProperty(n,c,p[c]);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(c=>c(p)))});f("function",(r,e,t)=>{t=t?i(t):()=>{};let o=e?e[0]===","?e.slice(1):[e]:[],n=null,p=-1,c=o[o.length-1];return Array.isArray(c)&&c[0]==="..."&&(p=o.length-1,n=c[1],o.length--),l=>{let a=(...y)=>{let R={};o.forEach((C,I)=>R[C]=y[I]),n&&(R[n]=y.slice(p));let k=new Proxy(R,{get:(C,I)=>I in C?C[I]:l[I],set:(C,I,He)=>((I in C?C:l)[I]=He,!0),has:(C,I)=>I in C||I in l});try{return t(k)}catch(C){if(C===B)return C[0];throw C}};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 Ro=Symbol("static"),Io=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?.(o),p=function(...c){if(!(this instanceof p))return Io("Class constructor must be called with new");let l=e?Reflect.construct(n,c,p):this;return p.prototype.__constructor__&&p.prototype.__constructor__.apply(l,c),l};if(e&&(Object.setPrototypeOf(p.prototype,n.prototype),Object.setPrototypeOf(p,n)),t){let c=Object.create(o);e&&(c.super=n);let l=t(c),a=Array.isArray(l)&&typeof l[0]?.[0]=="string"?l:[];for(let[y,R]of a)y==="constructor"?p.prototype.__constructor__=R:p.prototype[y]=R}return r&&(o[r]=p),p}));f("static",r=>(r=i(r),e=>[[Ro,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 K=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===K)break;if(n===X)continue;if(n===B)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===K)break;if(n===X)continue;if(n===B)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 c;for(t?.(p);o(p);n?.(p))try{c=e(p)}catch(l){if(l===K)break;if(l===X)continue;if(l===B)return l[0];throw l}return c}}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 _o(o,n,e);if(t==="of")return Oo(o,n,e)}});var Oo=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,c=o?null:n[r];for(let l of e(n)){o?H(r,l,n):n[r]=l;try{p=t(n)}catch(a){if(a===K)break;if(a===X)continue;if(a===B)return a[0];throw a}}return o||(n[r]=c),p}},_o=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,c=o?null:n[r];for(let l in e(n)){o?H(r,l,n):n[r]=l;try{p=t(n)}catch(a){if(a===K)break;if(a===X)continue;if(a===B)return a[0];throw a}}return o||(n[r]=c),p}};f("break",()=>()=>{throw K});f("continue",()=>()=>{throw X});f("return",r=>(r=r!==void 0?i(r):null,e=>{throw B[0]=r?.(e),B}));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,c=o?.[1]?i(o[1]):null;return l=>{let a;try{a=r?.(l)}catch(y){if(y===K||y===X||y===B)throw y;if(n!=null&&p){let R=n in l,k=l[n];l[n]=y;try{a=p(l)}finally{R?l[n]=k:delete l[n]}}else if(!p)throw y}finally{c?.(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,c=0;c<a.length;c++)try{p=a[c](t)}catch(y){if(y===K)return p;throw y}var c;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,Lo=(r,...e)=>typeof r=="string"?i(s(r)):Ge.get(r)||Ge.set(r,Po(r,e)).get(r),xe=57344,Po=(r,e)=>{let t=r.reduce((p,c,l)=>p+(l?String.fromCharCode(xe+l-1):"")+c,""),o=s(t),n=p=>{if(typeof p=="string"&&p.length===1){let c=p.charCodeAt(0)-xe,l;if(c>=0&&c<e.length)return l=e[c],vo(l)?l:[,l]}return Array.isArray(p)?p.map(n):p};return i(n(o))},vo=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Bo=Lo;export{fr as access,A as binary,i as compile,m as cur,Bo as default,O as err,d as expr,z as group,Mo as id,u as idx,w as keyword,j as literal,Xe as loc,N as lookup,Qr as member,pr as nary,E as next,f as operator,sr as operators,L as parens,s as parse,x as peek,v as prec,lr as propName,T as seek,h as skip,g as token,_ as unary,S as word};
1
+ var l,m,s=r=>(l=0,m=r,s.enter?.(),r=d(),m[l]?O():r||""),O=(r="Unexpected token",e=l,t=m.slice(0,e).split(`
2
+ `),o=t.pop(),n=m.slice(Math.max(0,e-40),e),p="\u032D",c=(m[e]||" ")+p,u=m.slice(e+1,e+20))=>{throw SyntaxError(`${r} at ${t.length+1}:${o.length+1}
3
+ ${n}${c}${u}`)},Qe=(r,e=l)=>(Array.isArray(r)&&(r.loc=e),r),T=(r,e=l,t)=>{for(;t=r(m.charCodeAt(l));)l+=t;return m.slice(e,l)},h=(r=1)=>m[l+=r],k=r=>l=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?(l++,s.exit?.(r,e)):O("Unclosed "+String.fromCharCode(e-(e>42?2:1)))),o},x=(r=l)=>{for(;m.charCodeAt(r)<=32;)r++;return m.charCodeAt(r)},Mo=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,E=(r,e=r.length)=>m.substr(l,e)===r&&!s.id(m.charCodeAt(l+e)),P=()=>(h(),d(0,41)),N=[],v={},g=(r,e=32,t,o=r.charCodeAt(0))=>jr({op:r,l:r.length,p:v[r]=!N[o]&&v[r]||e,map:t,word:r.toUpperCase()!==r,kw:!1}),A=(r,e,t=!1)=>g(r,e,(o,n)=>o&&(n=d(e-(t?.5:0)))&&[r,o,n]),_=(r,e,t)=>g(r,e,o=>t?o&&[r,o]:!o&&(o=d(e-.5))&&[r,o]),$=(r,e)=>g(r,200,t=>!t&&[,e]),fr=(r,e,t,o)=>g(r,e,(n,p,c=n)=>(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||x()===r.charCodeAt(0)?n.push(null):c&&n.length===2&&(n=n[1]),n)),z=(r,e)=>g(r[0],e,t=>!t&&[r,d(0,r.charCodeAt(1))||null]),lr=(r,e)=>g(r[0],e,t=>t&&[r,t,d(0,r.charCodeAt(1))||null]),ur=(r,e)=>(s.space(),e=m.charCodeAt(l),s.id(e)&&(e<48||e>57)?T(s.id):d(r)),Qr=(r,e)=>g(r,e,(t,o)=>t&&(o=ur(e))&&[r,t,o]),w=(r,e,t)=>(v[r]??=e,jr({op:r,l:r.length,p:e,map:t,word:!0,kw:!0})),Hr=(r,e,t=(o,n,p,c=l,u,a,y)=>{for(y=0;a=r[y++];)if(!(a.kw&&o)&&!(p?a.op!==p:!((a.l<2||a.op.charCodeAt(1)===m.charCodeAt(l+1)&&(a.l<3||m.substr(l,a.l)===a.op))&&(!a.word||!s.id(m.charCodeAt(l+a.l)))&&(p=a.op)))&&!(n>=a.p)&&!(a.kw&&s.prop&&!s.prop(l+a.l))){if(l+=a.l,u=a.map(o))return Qe(u,c);l=c,p=0,a.word||o||e||r[y]||O()}return e?.(o,n,p)})=>(t.ops=r,t.tail=e,t),jr=(r,e=r.op.charCodeAt(0),t=N[e])=>N[e]=t?.ops?Hr([r,...t.ops],t.tail):Hr([r],t);s.space=r=>{for(;(r=m.charCodeAt(l))<=32;)l++;return r};s.step=(r,e,t,o,n)=>(n=N[t])&&n(r,e)||(r?null:T(s.id)||null);var pr={},f=(r,e,t=pr[r])=>pr[r]=(...o)=>e(...o)||t?.(...o),i=r=>Array.isArray(r)?r[0]==null?(e=>()=>e)(r[1]):pr[r[0]]?.(...r.slice(1))??O(`Unknown operator: ${r[0]}`,r?.loc):i.id(r);i.id=r=>r===void 0?()=>{}:e=>e?.[r];var cr=46,Q=48,W=57,$r=69,Wr=101,je=43,$e=45,qr=95,We=97,qe=102,ze=65,Je=70,zr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),Ve=r=>r===cr&&(r=m.charCodeAt(l+1))!==cr&&!(s.id(r)&&r>W&&r!==Wr&&r!==$r)||r>=Q&&r<=W||r===qr||((r===$r||r===Wr)&&((r=m.charCodeAt(l+1))>=Q&&r<=W||r===je||r===$e)?2:0),mr=r=>(r=+zr(T(Ve)))!=r?O():[,r],Ye=r=>e=>e===qr||e>=Q&&e<=W&&e-Q<r||r===16&&(e>=We&&e<=qe||e>=ze&&e<=Je);s.number=null;N[cr]=r=>!r&&m.charCodeAt(l+1)>=Q&&m.charCodeAt(l+1)<=W&&mr();for(let r=Q;r<=W;r++)N[r]=e=>e?void 0:mr();N[Q]=(r,e)=>{if(!r){for(let t in s.number)if(t[0]==="0"&&(m.charCodeAt(l+1)|32)===t.charCodeAt(1)){h(2);let o=zr(T(Ye(e=s.number[t])));return[,parseInt(o,e)]}return mr()}};var te=92,Jr=34,Vr=39,Yr=117,Zr=120,oe=123,Ze=125,br=10,be=13,rt={n:`
4
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},re=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,ee=r=>{if(m.charCodeAt(r)!==te)return;let e=m.charCodeAt(r+1);if(e===Zr||e===Yr&&m.charCodeAt(r+2)!==oe){let t=e===Zr?2:4,o=0,n;for(let p=0;p<t;p++){if((n=re(m.charCodeAt(r+2+p)))<0)return;o=o*16+n}return[o,2+t]}if(e===Yr){let t=0,o=r+3,n;for(;(n=re(m.charCodeAt(o)))>=0;)t=t*16+n,o++;if(o>r+3&&t<=1114111&&m.charCodeAt(o)===Ze)return[t,o-r+1]}},et=()=>{let r=m.charCodeAt(l+1);if(r===br)return["",2];if(r===be)return["",m.charCodeAt(l+2)===br?3:2];let e=ee(l);if(e){let[t,o]=e;if(t>=55296&&t<=56319){let n=ee(l+o);n&&n[0]>=56320&&n[0]<=57343&&(t=65536+(t-55296)*1024+n[0]-56320,o+=n[1])}return[String.fromCodePoint(t),o]}return[rt[m[l+1]]||m[l+1],2]},ar=(r,e=!1)=>{let t=l,o,n;for(;(n=m.charCodeAt(l))-r&&!(e&&(n===0||n===36&&m.charCodeAt(l+1)===oe));){if(n!==te){h();continue}o||(o=[]),o.push(m.slice(t,l));let[c,u]=et();o.push(c),h(u),t=l}let p=m.slice(t,l);return o?(o.push(p),o.join("")):p},ne=r=>(e,t,o="",n=String.fromCharCode(r))=>{if(!(e||!s.string?.[n]))return h(),o+=ar(r),m[l]===n?h():O("Bad string"),[,o]};N[Jr]=ne(Jr);N[Vr]=ne(Vr);s.string={'"':!0};var tt=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>A(r,tt,!0));var ot=30,nt=40,it=140;_("!",it);A("||",ot);A("&&",nt);var st=50,pt=60,ft=70,ie=100,lt=140;A("|",st);A("&",ft);A("^",pt);A(">>",ie);A("<<",ie);_("~",lt);var Y=90;A("<",Y);A(">",Y);A("<=",Y);A(">=",Y);var se=80;A("==",se);A("!=",se);var pe=110,dr=120,fe=140;A("+",pe);A("-",pe);A("*",dr);A("/",dr);A("%",dr);_("+",fe);_("-",fe);var Z=150;g("++",Z,r=>r?["++",r,null]:["++",d(Z-1)]);g("--",Z,r=>r?["--",r,null]:["--",d(Z-1)]);var ut=5,ct=10;fr(",",ct);fr(";",ut,!0,!0);var mt=170;z("()",mt);var le=170,at=160;lr("[]",le);Qr(".",le);lr("()",at);var dt=s.space;s.comment??={"//":`
5
+ `,"/*":"*/"};s.space=()=>{for(var r,e,t,o,n;r=dt();){for(t in e=s.comment)if(r===t.charCodeAt(0)&&(t.length<2||m.charCodeAt(l+1)===t.charCodeAt(1))&&(t.length<3||m.substr(l,t.length)===t)){o=e[t],n=m.indexOf(o,l+t.length),k(n<0?m.length:o===`
6
+ `?n:n+o.length),r=0;break}if(r)return r}return r};var ue=80;A("===",ue);A("!==",ue);var ht=30;A("??",ht);var At=130,yt=20;A("**",At,!0);A("**=",yt,!0);var ce=90;A("in",ce);A("of",ce);var wt=20,Ct=100;A(">>>",Ct);A(">>>=",wt,!0);var hr=20;A("||=",hr,!0);A("&&=",hr,!0);A("??=",hr,!0);$("true",!0);$("false",!1);$("null",null);w("undefined",200,()=>[]);$("NaN",NaN);$("Infinity",1/0);var Ar=20;g("?",Ar,(r,e,t)=>r&&(e=d(Ar-1))&&T(o=>o===58)&&(t=d(Ar-1),["?",r,e,t]));var gt=20;A("=>",gt,!0);var Et=20;_("...",Et);var me=170;g("?.",me,(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=ur(me),e?["?.",r,e]:void 0)});var yr=140,ae=160,St=ae+1;_("typeof",yr);_("void",yr);_("delete",yr);var kt=r=>s.space()===40?(h(),["()",r,d(0,41)||null]):r;w("new",St,()=>E(".target")?(h(7),["new.target"]):["new",kt(d(ae))]);var Tt=20,de=200;s.prop=r=>x(r)!==58;z("[]",de);z("{}",de);A(":",Tt-1,!0);var Nt=170,b=96,Rt=36,It=123,he=()=>{let r=[];for(;;){r.push([,ar(b,!0)]);let e=m.charCodeAt(l);if(e===b)return h(),r;(e!==Rt||m.charCodeAt(l+1)!==It)&&O("Unterminated template"),h(2),r.push(d(0,125))}},Ot=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],_t=N[b];N[b]=(r,e)=>r&&e<Nt?s.asi&&s.newline?void 0:(h(),["``",r,...he()]):r?_t?.(r,e):(h(),Ot(he()));s.string["'"]=!0;s.number={"0x":16,"0b":2,"0o":8};var Pt=92,Lt=117,vt=123,Bt=125,Mt=183,Ut=s.id,Ae=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,Dt=(r=l+2,e,t=0,o=0)=>{if(m.charCodeAt(l)!==Pt||m.charCodeAt(l+1)!==Lt)return 0;if(m.charCodeAt(r)===vt){for(;Ae(e=m.charCodeAt(++r));)t=t*16+(e<=57?e-48:(e&31)+9);return r>l+3&&t<=1114111&&m.charCodeAt(r)===Bt?r-l+1:0}for(;o<4&&Ae(m.charCodeAt(r+o));)o++;return o===4?6:0};s.id=r=>Ut(r)||r===Mt||Dt();var wr=5,we=10,Cr=r=>{let e=l,t=d(we-1);return t==null?r:r==="let"&&(t==="in"||t==="of")?(k(e),r):t[0]===","?[r,...t.slice(1)]:[r,t]};w("let",wr+1,()=>Cr("let"));w("const",wr+1,()=>Cr("const"));w("var",wr+1,()=>Cr("var"));var ye=r=>Array.isArray(r)&&r[0]==="="&&typeof r[1]=="string";w("using",200,()=>{let r=l;s.space();let e=m.charCodeAt(l);if(s.id(e)&&(e<48||e>57)){let t=l;if(T(s.id),s.space(),m.charCodeAt(l)===61&&m.charCodeAt(l+1)!==61&&m.charCodeAt(l+1)!==62){k(t);let o=d(we-1);if(o[0]===","?o.slice(1).every(ye):ye(o))return o[0]===","?["using",...o.slice(1)]:["using",o]}}return k(r),"using"});var rr=5,Kt=59,U=()=>(s.space()===123||O("Expected {"),h(),d(rr-.5,125)||null),F=()=>s.space()!==123?d(rr+.5):(h(),d(rr-.5,125)||null),Ft=()=>{let r=l;return s.space()===Kt&&h(),s.space(),E("else")?(h(4),s.semi=!1,!0):(k(r),!1)};w("if",rr+1,()=>{s.space();let r=["if",P(),F()];return Ft()&&r.push(F()),r});var Gt=200;w("function",Gt,()=>{s.space();let r=!1;m[l]==="*"&&(r=!0,h(),s.space());let e=T(s.id);return e&&s.space(),r?["function*",e,P()||null,U()]:["function",e,P()||null,U()]});var Ce=200,Er=140,gr=20,ge=40;_("await",Er);var xt=10,Xt=13,Ee=r=>{let e;for(;(e=m.charCodeAt(r))<=32;){if(e===xt||e===Xt)return!0;r++}return!1};w("yield",Er,()=>Ee(l)?["yield"]:(s.space(),m[l]==="*"?(h(),s.space(),["yield*",d(gr)]):["yield",d(gr)]));w("async",Ce,()=>{if(Ee(l))return;if(s.space(),E("function"))return["async",d(Er)];let r=l,e=d(Ce-.5);if(e?.[0]===":")return[":",e[1],["async",e[2]]];if(e&&x()===ge)return["async",e];if((e||x()===ge)&&(k(r),e=d(gr-.5))?.[0]==="=>")return["async",e]});var Se=200;var Ht=90,Qt=175,jt=160,$t=jt-.5;_("static",Qt);A("instanceof",Ht);g("#",Se,r=>{if(r)return;let e=T(s.id);return e?"#"+e:void 0});w("class",Se,()=>{s.space();let r=T(s.id)||null;if(r==="extends")r=null,s.space();else{if(s.space(),!E("extends"))return["class",r,null,U()];h(7),s.space()}return["class",r,d($t),U()]});var Sr=47,Wt=92,qt=91,zt=93;g("/",140,r=>{let e=m.charCodeAt(l);if(r||e===Sr||e===42||e===43||e===63)return;let t=!1,o=T(p=>p===Wt?2:p===qt?(t=!0,1):p===zt?(t=!1,1):p&&(t||p!==Sr));m.charCodeAt(l)===Sr||O("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 j=5,J=125,V=59;w("while",j+1,()=>(s.space(),["while",P(),F()]));w("do",j+1,r=>(r=F(),s.space(),h(5),s.space(),["do",r,P()]));var ke={let:1,const:1,var:1},kr=(r,e=r,t)=>{if(ke[r?.[0]]&&Array.isArray(r[1]))return(e=kr(r[1]))?.[0]==="in"||e?.[0]==="of"?[e[0],[r[0],e[1]],r.length>2?[",",e[2],...r.slice(2)]:e[2]]:r;for(;Array.isArray(e)&&v[e[0]]<v.in&&!ke[e[0]];)t=e,e=e[1];return t&&Array.isArray(e)&&(e[0]==="in"||e[0]==="of")?(t[1]=e[2],[e[0],e[1],r]):r};w("for",j+1,()=>(s.space(),E("await")?(h(5),s.space(),["for await",kr(P()),F()]):["for",kr(P()),F()]));w("break",j+1,()=>{s.asi&&(s.newline=!1);let r=l,e=s.space();if(!e||e===J||e===V||s.newline)return["break"];let t=T(s.id);if(!t)return["break"];let o=s.space();return!o||o===J||o===V||s.newline?["break",t]:(k(r),["break"])});w("continue",j+1,()=>{s.asi&&(s.newline=!1);let r=l,e=s.space();if(!e||e===J||e===V||s.newline)return["continue"];let t=T(s.id);if(!t)return["continue"];let o=s.space();return!o||o===J||o===V||s.newline?["continue",t]:(k(r),["continue"])});w("return",j+1,()=>{s.asi&&(s.newline=!1);let r=s.space();return!r||r===J||r===V||s.newline?["return"]:["return",d(j)]});var Tr=5;w("try",Tr+1,()=>{let r=["try",U()];return s.space(),E("catch")&&(h(5),s.space(),r.push(["catch",x()===40?P():null,U()])),s.space(),E("finally")&&(h(7),r.push(["finally",U()])),r});w("throw",Tr+1,()=>{if(s.asi&&(s.newline=!1),s.space(),s.newline)throw SyntaxError("Unexpected newline after throw");return["throw",d(Tr)]});var Re=5,Jt=20,Te=58,Vt=59,Nr=125,Rr=0,Ie=(r,e=r.length,t=r.charCodeAt(0),o=N[t])=>N[t]=(n,p,c)=>E(r)&&!n&&Rr&&(!s.prop||s.prop(l+e))||o?.(n,p,c);Ie("case");Ie("default");var Ne=r=>{let e=[];for(;(r=s.space())!==Nr&&!E("case")&&!E("default");){if(r===Vt){h();continue}s.semi=!1,e.push(d(Re+.5))||O()}return e.length>1?[";",...e]:e[0]||null},Yt=()=>{s.space()===123||O("Expected {"),h(),Rr++;let r=[];try{for(;s.space()!==Nr;)if(E("case")){k(l+4),s.space(),s.semi=!1;let e=d(Jt-.5);s.space()===Te&&h(),r.push(["case",e,Ne()])}else E("default")?(k(l+7),s.space()===Te&&h(),r.push(["default",Ne()])):O("Expected case or default")}finally{Rr--}return h(),s.exit?.(0,Nr),r};w("switch",Re+1,()=>s.space()===40&&["switch",P(),...Yt()]);var Ir=5,Zt=20;w("debugger",Ir+1,()=>["debugger"]);w("with",Ir+1,()=>(s.space(),["with",P(),F()]));var bt=["if","for","while","do","switch","try"];g(":",Zt-1,r=>typeof r=="string"&&(s.space(),bt.some(e=>E(e)))&&[":",r,d(Ir)]);var Or=5,q=10,Oe=42,ro=N[Oe];N[Oe]=(r,e)=>r?ro?.(r,e):(h(),"*");g("from",q+1,r=>r?r[0]!=="="&&r[0]!==","&&(s.space(),["from",r,d(q+1)]):!1);g("as",q+2,r=>r?(s.space(),["as",r,d(q+2)]):!1);w("import",Or,()=>E(".meta")?(h(5),["import.meta"]):["import",d(q)]);w("export",Or,()=>(s.space(),E("default")?(h(7),["export",["default",d(q)]]):["export",d(Or)]));var eo=20,er=200,to=10,oo=13,no=34,io=35,so=39,_e=40,Pr=41,po=91,Lr=123,vr=125,fo=(r,e)=>{for(;r<e;){let t=m.charCodeAt(r++);if(t===to||t===oo)return!0}return!1},lo=r=>r===no||r===so||r===po||r===io,Pe=()=>T(s.id)||(lo(m.charCodeAt(l))?d(er-.5):null),uo=r=>typeof r=="string"||Array.isArray(r)&&(r[0]===void 0||r[0]==="[]"),tr=r=>e=>{let t=s.newline,o=s.semi,n=r(e);return n||(s.newline=t,s.semi=o),n},Le=r=>e=>{if(e)return;let t=l;if(s.space(),s.semi||fo(t,l))return!1;let o=Pe();if(!o||(s.space(),m.charCodeAt(l)!==_e))return!1;h();let n=d(0,Pr);return s.space(),m.charCodeAt(l)!==Lr?!1:(h(),[r,o,n,d(0,vr)])};g("get",er,tr(Le("get")));g("set",er,tr(Le("set")));var _r=r=>r==null||typeof r=="string"||Array.isArray(r)&&(r[0]===","?r.slice(1).every(_r):r[0]==="="?typeof r[1]=="string"||_r(r[1]):r[0]==="..."||r[0]==="{}"||r[0]==="[]"),co=v["*"];g("*",er,tr(r=>{let e=r&&s.newline;if(r&&!e)return;let t=l,o=Pe();if(!o)return r?(k(t),void 0):!1;if(s.space(),m.charCodeAt(l)!==_e)return r?(k(t),void 0):!1;h();let n=d(0,Pr)||null;if(r&&!_r(n))return k(t),void 0;if(s.space(),m.charCodeAt(l)!==Lr)return r?(k(t),void 0):!1;h();let p=[":",o,["function*",null,n,d(0,vr)||null]];return r?r[0]===";"?(r.push(p),r):[";",r,p]:p}));v["*"]=co;g("(",eo-1,tr(r=>{if(!r)return;let e,t;if(Array.isArray(r)&&r[0]==="static"&&(e="static",r=r[1]),Array.isArray(r)&&r[0]==="async"&&(t=!0,r=r[1]),!uo(r))return;let o=d(0,Pr)||null;if(s.space(),m.charCodeAt(l)!==Lr)return;h();let n=["function",null,o,d(0,vr)||null];t&&(n=["async",n]);let p=[":",r,n];return e?[e,p]:p}));s.comment["#!"]=`
7
+ `;var Ue=32,Dr=10,mo=59,ao=125,ve=91,Be=40,or=v.asi??v[";"],ho=s._baseSpace??=s.space,Ao=s._baseStep??=s.step,Br=r=>Array.isArray(r)||typeof r=="string",yo=(v[";"]??5)+1,Ur=r=>Array.isArray(r)&&(v[r[0]]<=yo||r[0]==="{}"&&Ur(r[1])),wo=(r,e)=>{for(;(e=m.charCodeAt(r))<=Ue;){if(e===Dr)return!0;r++}return!1},Co=(r=l,e)=>{for(;r-- >0&&(e=m.charCodeAt(r))<=Ue;)if(e===Dr)return!0;return!1};s.space=(r,e)=>{for(;;){for(e=l,r=ho();e<l;)if(m.charCodeAt(e++)===Dr){s.newline=!0;break}if(r===mo&&wo(l+1)){k(l+1),s.newline=s.semi=!0;continue}return r}};s.enter=()=>s.newline=s.semi=!1;s.exit=(r,e)=>{e===ao&&(s.newline=!0,s.semi=!1)};s.step=(r,e,t,o)=>{if(s.semi&&e>=or)return!1;if(r&&!Br(r))return null;if(Br(r)){let p=(t===ve||t===Be)&&Co();if(s.semi||t===ve&&(p||Ur(r))||t===Be&&(Ur(r)||p&&e>=or))return Me(r,e,o)??null}let n=s.newline;return Ao(r,e,t,o)??(Br(r)&&n?Me(r,e,o)??null:null)};var Mr=0,go=2e3,Me=s.asi=(r,e,t,o,n)=>{if(e>=or||Mr>=go)return;s.semi=!1;let p=l;Mr++;try{o=t(or-.5)}finally{Mr--}if(!(!o||l===p))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var Ke=(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?Ke(r[1],e):(()=>{throw Error("Invalid assignment target")})(),De={"=":(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 De)f(r,(e,t)=>(t=i(t),Ke(e,(o,n,p)=>De[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 Kr=(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?Kr(r[1],e):(()=>{throw Error("Invalid increment target")})();f("++",(r,e)=>Kr(r,e===null?(t,o)=>t[o]++:(t,o)=>++t[o]));f("--",(r,e)=>Kr(r,e===null?(t,o)=>t[o]--:(t,o)=>--t[o]));var Fe=(...r)=>(r=r.map(i),e=>{let t;for(let o of r)t=o(e);return t});f(",",Fe);f(";",Fe);var Ge=r=>r!=null&&(typeof r=="object"||typeof r=="function"),M=r=>Ge(r)?Reflect.ownKeys({[r]:0})[0]:r,L=r=>typeof r=="string"&&(r[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype"),Eo=r=>L(M(r));i.id=r=>r===void 0||Eo(r)?()=>{}:e=>e?.[r];var nr=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&&nr("Missing index"),r=i(r),e=i(e),t=>{let o=M(e(t));return L(o)?void 0:r(t)[o]}));f(".",(r,e)=>(r=i(r),e=M(e[0]?e:e[1]),L(e)?()=>{}:t=>r(t)[e]));f("()",(r,e)=>{if(e===void 0)return r==null?nr("Empty ()"):i(r);let t=p=>p?.[0]===","&&p.slice(1).some(c=>c==null||t(c));t(e)&&nr("Empty argument");let o=e?e[0]===","?(e=e.slice(1).map(i),p=>e.map(c=>c(p))):(e=i(e),p=>[e(p)]):()=>[],n=xr(r);return n<0?()=>{}:Gr(r,n?(p,c,u)=>(c=M(c),L(c)?void 0:p[c](...o(u))):(p,c,u)=>p[c](...o(u)))});var D=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&D(r[1])||r[0]==="{}"),Gr=(r,e,t,o)=>r==null?nr("Empty ()"):r[0]==="()"&&r.length==2?Gr(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)),Fr=r=>Ge(r)?1:L(r)?-1:0,xr=(r,e=r?.[0],t=r?.[2])=>typeof r=="string"?Fr(r):e==="()"&&r.length==2?xr(r[1]):e==="."||e==="?."?Fr(t):(e==="[]"||e==="?.[]")&&r.length===3?Array.isArray(t)&&t[0]==null?Fr(t[1]):1:0,G=(r,e,t=xr(r))=>t<0?()=>{}:Gr(r,t?(o,n,p)=>(n=M(n),L(n)?void 0:e(o,n,p)):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)));var So=r=>{throw Error(r)};f("**",(r,e)=>(r=i(r),e=i(e),t=>r(t)**e(t)));f("**=",(r,e)=>(D(r)||So("Invalid assignment target"),e=i(e),G(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 ko=r=>{throw Error(r)};f(">>>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>>e(t)));f(">>>=",(r,e)=>(D(r)||ko("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]>>>=e(n))));var To=r=>r[0]?.[0]===","?r[0].slice(1):r,X=(r,e,t)=>{if(typeof r=="string"){t[r]=e;return}let[o,...n]=r,p=To(n);if(o==="{}"){let c=[];for(let u of p){if(Array.isArray(u)&&u[0]==="..."){let C={};for(let I in e)!c.includes(I)&&!L(I)&&(C[I]=e[I]);t[u[1]]=C;break}let a,y,R;typeof u=="string"?a=y=u:u[0]==="="?(typeof u[1]=="string"?a=y=u[1]:[,a,y]=u[1],R=u[2]):[,a,y]=u,c.push(a=M(a));let S=L(a)?void 0:e[a];S===void 0&&R&&(S=i(R)(t)),X(y,S,t)}}else if(o==="[]"){let c=0;for(let u of p){if(u===null){c++;continue}if(Array.isArray(u)&&u[0]==="..."){t[u[1]]=e.slice(c);break}let a=u,y;Array.isArray(u)&&u[0]==="="&&([,a,y]=u);let R=e[c++];R===void 0&&y&&(R=i(y)(t)),X(a,R,t)}}},Xr=(...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=>X(t,n(p),p)}return i(e)}),e=>{for(let t of r)t(e)});f("let",Xr);f("const",Xr);f("var",Xr);var ir=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=>X(t,e(o),o)}return D(r)||ir("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]=e(n))});f("||=",(r,e)=>(D(r)||ir("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]||=e(n))));f("&&=",(r,e)=>(D(r)||ir("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]&&=e(n))));f("??=",(r,e)=>(D(r)||ir("Invalid assignment target"),e=i(e),G(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 B=[];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 c=e?.[0]==="{}";return e=i(c?["{",e[1]]:e),u=>(...a)=>{let y={};t.forEach((S,C)=>y[S]=a[C]),n&&(y[n]=a.slice(o));let R=new Proxy(y,{get:(S,C)=>C in S?S[C]:u?.[C],set:(S,C,I)=>((C in S?S:u)[C]=I,!0),has:(S,C)=>C in S||(u?C in u:!1)});try{let S=e(R);return c?void 0:S}catch(S){if(S===B)return S[0];throw S}}});f("...",r=>(r=i(r),e=>{let t=r(e),o=[];for(let n of Object.keys(t))L(n)||o.push([n,t[n]]);return o}));f("?.",(r,e)=>(r=i(r),e=M(e),L(e)?()=>{}:t=>r(t)?.[e]));f("?.[]",(r,e)=>(r=i(r),e=i(e),t=>{let o=r(t);if(o==null)return;let n=M(e(t));return L(n)?void 0:o[n]}));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]==="."||r[0]==="?."){let n=r[0]==="?.",p=i(r[1]),c=M(r[2]);return L(c)?()=>{}:n?u=>p(u)?.[c]?.(...t(u)):u=>p(u)[c]?.(...t(u))}if((r[0]==="[]"||r[0]==="?.[]")&&r.length===3){let n=r[0]==="?.[]",p=i(r[1]),c=i(r[2]);return u=>{let a=p(u);if(n&&a==null)return;let y=M(c(u));return L(y)?void 0:a[y]?.(...t(u))}}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(c=>c(p)))(t.slice(1).map(i)):(n=>p=>[n(p)])(i(t)):()=>[];return n=>new(e(n))(...o(n))});var sr=Symbol("accessor");f("get",(r,e)=>(e=e?i(e):()=>{},t=>[[sr,r,{get:function(){let o=Object.create(t||{});return o.this=this,e(o)}}]]));f("set",(r,e,t)=>(t=t?i(t):()=>{},o=>[[sr,r,{set:function(n){let p=Object.create(o||{});p.this=this,p[e]=n,t(p)}}]]));var No=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);f("{}",(r,e)=>{if(e!==void 0)return;if(!No(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 c of t.flatMap(u=>u(o)))if(c[0]===sr){let[,u,a]=c;p[u]={...p[u],...a,configurable:!0,enumerable:!0}}else n[c[0]]=c[1];for(let c in p)Object.defineProperty(n,c,p[c]);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(c=>c(p)))});f("function",(r,e,t)=>{t=t?i(t):()=>{};let o=e?e[0]===","?e.slice(1):[e]:[],n=null,p=-1,c=o[o.length-1];return Array.isArray(c)&&c[0]==="..."&&(p=o.length-1,n=c[1],o.length--),u=>{let a=(...y)=>{let R={};o.forEach((C,I)=>R[C]=y[I]),n&&(R[n]=y.slice(p));let S=new Proxy(R,{get:(C,I)=>I in C?C[I]:u[I],set:(C,I,He)=>((I in C?C:u)[I]=He,!0),has:(C,I)=>I in C||I in u});try{return t(S)}catch(C){if(C===B)return C[0];throw C}};return r&&(u[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 Ro=Symbol("static"),Io=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?.(o),p=function(...c){if(!(this instanceof p))return Io("Class constructor must be called with new");let u=e?Reflect.construct(n,c,p):this;return p.prototype.__constructor__&&p.prototype.__constructor__.apply(u,c),u};if(e&&(Object.setPrototypeOf(p.prototype,n.prototype),Object.setPrototypeOf(p,n)),t){let c=Object.create(o);e&&(c.super=n);let u=t(c),a=Array.isArray(u)&&typeof u[0]?.[0]=="string"?u:[];for(let[y,R]of a)y==="constructor"?p.prototype.__constructor__=R:p.prototype[y]=R}return r&&(o[r]=p),p}));f("static",r=>(r=i(r),e=>[[Ro,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 K=Symbol("break"),H=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===K)break;if(n===H)continue;if(n===B)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===K)break;if(n===H)continue;if(n===B)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 c;for(t?.(p);o(p);n?.(p))try{c=e(p)}catch(u){if(u===K)break;if(u===H)continue;if(u===B)return u[0];throw u}return c}}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 _o(o,n,e);if(t==="of")return Oo(o,n,e)}});var Oo=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,c=o?null:n[r];for(let u of e(n)){o?X(r,u,n):n[r]=u;try{p=t(n)}catch(a){if(a===K)break;if(a===H)continue;if(a===B)return a[0];throw a}}return o||(n[r]=c),p}},_o=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,c=o?null:n[r];for(let u in e(n)){o?X(r,u,n):n[r]=u;try{p=t(n)}catch(a){if(a===K)break;if(a===H)continue;if(a===B)return a[0];throw a}}return o||(n[r]=c),p}};f("break",()=>()=>{throw K});f("continue",()=>()=>{throw H});f("return",r=>(r=r!==void 0?i(r):null,e=>{throw B[0]=r?.(e),B}));f("try",(r,...e)=>{r=r?i(r):null;let t=e.find(u=>u?.[0]==="catch"),o=e.find(u=>u?.[0]==="finally"),n=t?.[1],p=t?.[2]?i(t[2]):null,c=o?.[1]?i(o[1]):null;return u=>{let a;try{a=r?.(u)}catch(y){if(y===K||y===H||y===B)throw y;if(n!=null&&p){let R=n in u,S=u[n];u[n]=y;try{a=p(u)}finally{R?u[n]=S:delete u[n]}}else if(!p)throw y}finally{c?.(u)}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[u,a]of e)if(n||u===null||u(t)===o)for(n=!0,c=0;c<a.length;c++)try{p=a[c](t)}catch(y){if(y===K)return p;throw y}var c;return p}):t=>r(t)));f("import",()=>()=>{});f("export",()=>()=>{});f("from",(r,e)=>()=>{});f("as",(r,e)=>()=>{});f("default",r=>i(r));var xe=new WeakMap,Po=(r,...e)=>typeof r=="string"?i(s(r)):xe.get(r)||xe.set(r,Lo(r,e)).get(r),Xe=57344,Lo=(r,e)=>{let t=r.reduce((p,c,u)=>p+(u?String.fromCharCode(Xe+u-1):"")+c,""),o=s(t),n=p=>{if(typeof p=="string"&&p.length===1){let c=p.charCodeAt(0)-Xe,u;if(c>=0&&c<e.length)return u=e[c],vo(u)?u:[,u]}return Array.isArray(p)?p.map(n):p};return i(n(o))},vo=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Bo=Po;export{lr as access,A as binary,i as compile,m as cur,Bo as default,O as err,d as expr,z as group,Mo as id,l as idx,w as keyword,$ as literal,Qe as loc,N as lookup,Qr as member,fr as nary,T as next,f as operator,pr as operators,P as parens,s as parse,x as peek,v as prec,ur as propName,k as seek,h as skip,g as token,_ as unary,E as word};
package/justin.min.js CHANGED
@@ -1,6 +1,6 @@
1
- var u,c,d=r=>(u=0,c=r,d.enter?.(),r=h(),c[u]?O():r||""),O=(r="Unexpected token",t=u,e=c.slice(0,t).split(`
2
- `),o=e.pop(),n=c.slice(Math.max(0,t-40),t),s="\u032D",f=(c[t]||" ")+s,m=c.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
3
- ${n}${f}${m}`)},jr=(r,t=u)=>(Array.isArray(r)&&(r.loc=t),r),v=(r,t=u,e)=>{for(;e=r(c.charCodeAt(u));)u+=e;return c.slice(t,u)},C=(r=1)=>c[u+=r],mr=r=>u=r,h=(r=0,t)=>{let e,o,n;for(t&&d.enter?.(r,t);(e=d.space())&&e!==t&&(n=d.step(o,r,e,h));)o=n;return t&&(e==t?(u++,d.exit?.(r,t)):O("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},H=(r=u)=>{for(;c.charCodeAt(r)<=32;)r++;return c.charCodeAt(r)},Kt=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,fr=(r,t=r.length)=>c.substr(u,t)===r&&!d.id(c.charCodeAt(u+t)),$t=()=>(C(),h(0,41)),w=[],j={},I=(r,t=32,e,o=r.charCodeAt(0))=>lr({op:r,l:r.length,p:j[r]=!w[o]&&j[r]||t,map:e,word:r.toUpperCase()!==r,kw:!1}),l=(r,t,e=!1)=>I(r,t,(o,n)=>o&&(n=h(t-(e?.5:0)))&&[r,o,n]),N=(r,t,e)=>I(r,t,o=>e?o&&[r,o]:!o&&(o=h(t-.5))&&[r,o]),F=(r,t)=>I(r,200,e=>!e&&[,t]),W=(r,t,e,o)=>I(r,t,(n,s,f=n)=>(s=h(t-(e?.5:0)),n?.[0]!==r&&(n=[r,n||null]),s?.[0]===r?n.push(...s.slice(1)):s?n.push(s):o||H()===r.charCodeAt(0)?n.push(null):f&&n.length===2&&(n=n[1]),n)),_=(r,t)=>I(r[0],t,e=>!e&&[r,h(0,r.charCodeAt(1))||null]),q=(r,t)=>I(r[0],t,e=>e&&[r,e,h(0,r.charCodeAt(1))||null]),z=(r,t)=>(d.space(),t=c.charCodeAt(u),d.id(t)&&(t<48||t>57)?v(d.id):h(r)),ur=(r,t)=>I(r,t,(e,o)=>e&&(o=z(t))&&[r,e,o]),B=(r,t,e)=>(j[r]??=t,lr({op:r,l:r.length,p:t,map:e,word:!0,kw:!0})),pr=(r,t,e=(o,n,s,f=u,m,A,g)=>{for(g=0;A=r[g++];)if(!(A.kw&&o)&&!(s?A.op!==s:!((A.l<2||A.op.charCodeAt(1)===c.charCodeAt(u+1)&&(A.l<3||c.substr(u,A.l)===A.op))&&(!A.word||!d.id(c.charCodeAt(u+A.l)))&&(s=A.op)))&&!(n>=A.p)&&!(A.kw&&d.prop&&!d.prop(u+A.l))){if(u+=A.l,m=A.map(o))return jr(m,f);u=f,s=0,A.word||o||t||r[g]||O()}return t?.(o,n,s)})=>(e.ops=r,e.tail=t,e),lr=(r,t=r.op.charCodeAt(0),e=w[t])=>w[t]=e?.ops?pr([r,...e.ops],e.tail):pr([r],e);d.space=r=>{for(;(r=c.charCodeAt(u))<=32;)u++;return r};d.step=(r,t,e,o,n)=>(n=w[e])&&n(r,t)||(r?null:v(d.id)||null);var Q={},p=(r,t,e=Q[r])=>Q[r]=(...o)=>t(...o)||e?.(...o),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):Q[r[0]]?.(...r.slice(1))??O(`Unknown operator: ${r[0]}`,r?.loc):i.id(r);i.id=r=>r===void 0?()=>{}:t=>t?.[r];var J=46,D=48,U=57,cr=69,dr=101,Qr=43,Hr=45,Ar=95,Wr=97,qr=102,zr=65,Jr=70,hr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),Vr=r=>r===J&&(r=c.charCodeAt(u+1))!==J&&!(d.id(r)&&r>U&&r!==dr&&r!==cr)||r>=D&&r<=U||r===Ar||((r===cr||r===dr)&&((r=c.charCodeAt(u+1))>=D&&r<=U||r===Qr||r===Hr)?2:0),V=r=>(r=+hr(v(Vr)))!=r?O():[,r],Yr=r=>t=>t===Ar||t>=D&&t<=U&&t-D<r||r===16&&(t>=Wr&&t<=qr||t>=zr&&t<=Jr);d.number=null;w[J]=r=>!r&&c.charCodeAt(u+1)>=D&&c.charCodeAt(u+1)<=U&&V();for(let r=D;r<=U;r++)w[r]=t=>t?void 0:V();w[D]=(r,t)=>{if(!r){for(let e in d.number)if(e[0]==="0"&&(c.charCodeAt(u+1)|32)===e.charCodeAt(1)){C(2);let o=hr(v(Yr(t=d.number[e])));return[,parseInt(o,t)]}return V()}};var Nr=92,gr=34,yr=39,Cr=117,Sr=120,Zr=123,xr=125,Er=10,br=13,rt={n:`
4
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},wr=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,Ir=r=>{if(c.charCodeAt(r)!==Nr)return;let t=c.charCodeAt(r+1);if(t===Sr||t===Cr&&c.charCodeAt(r+2)!==Zr){let e=t===Sr?2:4,o=0,n;for(let s=0;s<e;s++){if((n=wr(c.charCodeAt(r+2+s)))<0)return;o=o*16+n}return[o,2+e]}if(t===Cr){let e=0,o=r+3,n;for(;(n=wr(c.charCodeAt(o)))>=0;)e=e*16+n,o++;if(o>r+3&&e<=1114111&&c.charCodeAt(o)===xr)return[e,o-r+1]}},Y=()=>{let r=c.charCodeAt(u+1);if(r===Er)return["",2];if(r===br)return["",c.charCodeAt(u+2)===Er?3:2];let t=Ir(u);if(t){let[e,o]=t;if(e>=55296&&e<=56319){let n=Ir(u+o);n&&n[0]>=56320&&n[0]<=57343&&(e=65536+(e-55296)*1024+n[0]-56320,o+=n[1])}return[String.fromCodePoint(e),o]}return[rt[c[u+1]]||c[u+1],2]},kr=r=>(t,e,o="",n=String.fromCharCode(r))=>{if(t||!d.string?.[n])return;C();let s=()=>{let[f,m]=Y();return o+=f,m};return v(f=>f-r&&(f!==Nr?(o+=c[u],1):s())),c[u]===n?C():O("Bad string"),[,o]};w[gr]=kr(gr);w[yr]=kr(yr);d.string={'"':!0};var tt=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>l(r,tt,!0));var et=30,ot=40,nt=140;N("!",nt);l("||",et);l("&&",ot);var it=50,st=60,pt=70,Or=100,mt=140;l("|",it);l("&",pt);l("^",st);l(">>",Or);l("<<",Or);N("~",mt);var G=90;l("<",G);l(">",G);l("<=",G);l(">=",G);var Lr=80;l("==",Lr);l("!=",Lr);var Rr=110,Z=120,vr=140;l("+",Rr);l("-",Rr);l("*",Z);l("/",Z);l("%",Z);N("+",vr);N("-",vr);var M=150;I("++",M,r=>r?["++",r,null]:["++",h(M-1)]);I("--",M,r=>r?["--",r,null]:["--",h(M-1)]);var ft=5,ut=10;W(",",ut);W(";",ft,!0,!0);var lt=170;_("()",lt);var Pr=170,ct=160;q("[]",Pr);ur(".",Pr);q("()",ct);var dt=d.space;d.comment??={"//":`
5
- `,"/*":"*/"};d.space=()=>{for(var r,t,e,o,n;r=dt();){for(e in t=d.comment)if(r===e.charCodeAt(0)&&(e.length<2||c.charCodeAt(u+1)===e.charCodeAt(1))&&(e.length<3||c.substr(u,e.length)===e)){o=t[e],n=c.indexOf(o,u+e.length),mr(n<0?c.length:o===`
6
- `?n:n+o.length),r=0;break}if(r)return r}return r};var Dr=80;l("===",Dr);l("!==",Dr);var At=30;l("??",At);var ht=130,gt=20;l("**",ht,!0);l("**=",gt,!0);var Tr=90;l("in",Tr);l("of",Tr);var yt=20,Ct=100;l(">>>",Ct);l(">>>=",yt,!0);var x=20;l("||=",x,!0);l("&&=",x,!0);l("??=",x,!0);F("true",!0);F("false",!1);F("null",null);B("undefined",200,()=>[]);F("NaN",NaN);F("Infinity",1/0);var b=20;I("?",b,(r,t,e)=>r&&(t=h(b-1))&&v(o=>o===58)&&(e=h(b-1),["?",r,t,e]));var St=20;l("=>",St,!0);var Et=20;N("...",Et);var Fr=170;I("?.",Fr,(r,t)=>{if(!r)return;let e=d.space();return e===40?(C(),["?.()",r,h(0,41)||null]):e===91?(C(),["?.[]",r,h(0,93)]):(t=z(Fr),t?["?.",r,t]:void 0)});var rr=140,Ur=160,wt=Ur+1;N("typeof",rr);N("void",rr);N("delete",rr);var It=r=>d.space()===40?(C(),["()",r,h(0,41)||null]):r;B("new",wt,()=>fr(".target")?(C(7),["new.target"]):["new",It(h(Ur))]);var Nt=20,_r=200;d.prop=r=>H(r)!==58;_("[]",_r);_("{}",_r);l(":",Nt-1,!0);var kt=170,tr=96,Ot=36,Lt=123,Rt=92,ar=()=>{let r=[],t="",e,o;for(;(e=c.charCodeAt(u))!==tr;)e?e===Rt?(o=Y(),t+=o[0],C(o[1])):e===Ot&&c.charCodeAt(u+1)===Lt?(r.push([,t]),t="",C(2),r.push(h(0,125))):(t+=c[u],C()):O("Unterminated template");return r.push([,t]),C(),r},vt=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],Pt=w[tr];w[tr]=(r,t)=>r&&t<kt?d.asi&&d.newline?void 0:(C(),["``",r,...ar()]):r?Pt?.(r,t):(C(),vt(ar()));d.string["'"]=!0;d.number={"0x":16,"0b":2,"0o":8};var Gr=(r,t,e,o)=>typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="()"&&r.length===2?Gr(r[1],t):(()=>{throw Error("Invalid assignment target")})(),Br={"=":(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 Br)p(r,(t,e)=>(e=i(e),Gr(t,(o,n,s)=>Br[r](o,n,e(s)))));p("!",r=>(r=i(r),t=>!r(t)));p("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));p("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));p("~",r=>(r=i(r),t=>~r(t)));p("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));p("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));p("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));p(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));p("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));p(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));p("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));p(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));p("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));p("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));p("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));p("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));p("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));p("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));p("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));p("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var er=(r,t,e,o)=>typeof r=="string"?n=>t(n,r):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n))):r[0]==="()"&&r.length===2?er(r[1],t):(()=>{throw Error("Invalid increment target")})();p("++",(r,t)=>er(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));p("--",(r,t)=>er(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var Mr=(...r)=>(r=r.map(i),t=>{let e;for(let o of r)e=o(t);return e});p(",",Mr);p(";",Mr);var Xr=r=>r!=null&&(typeof r=="object"||typeof r=="function"),k=r=>Xr(r)?Reflect.ownKeys({[r]:0})[0]:r,S=r=>typeof r=="string"&&(r[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype"),Dt=r=>S(k(r));i.id=r=>r===void 0||Dt(r)?()=>{}:t=>t?.[r];var X=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=i(e[1]),o=>e(o)):(e=i(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&X("Missing index"),r=i(r),t=i(t),e=>{let o=k(t(e));return S(o)?void 0:r(e)[o]}));p(".",(r,t)=>(r=i(r),t=k(t[0]?t:t[1]),S(t)?()=>{}:e=>r(e)[t]));p("()",(r,t)=>{if(t===void 0)return r==null?X("Empty ()"):i(r);let e=s=>s?.[0]===","&&s.slice(1).some(f=>f==null||e(f));e(t)&&X("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(i),s=>t.map(f=>f(s))):(t=i(t),s=>[t(s)]):()=>[],n=ir(r);return n<0?()=>{}:nr(r,n?(s,f,m)=>(f=k(f),S(f)?void 0:s[f](...o(m))):(s,f,m)=>s[f](...o(m)))});var L=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&L(r[1])||r[0]==="{}"),nr=(r,t,e,o)=>r==null?X("Empty ()"):r[0]==="()"&&r.length==2?nr(r[1],t):typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="?."?(e=i(r[1]),o=r[2],n=>{let s=e(n);return s==null?void 0:t(s,o,n)}):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="?.[]"?(e=i(r[1]),o=i(r[2]),n=>{let s=e(n);return s==null?void 0:t(s,o(n),n)}):(r=i(r),n=>t([r(n)],0,n)),or=r=>Xr(r)?1:S(r)?-1:0,ir=(r,t=r?.[0],e=r?.[2])=>typeof r=="string"?or(r):t==="()"&&r.length==2?ir(r[1]):t==="."||t==="?."?or(e):(t==="[]"||t==="?.[]")&&r.length===3?Array.isArray(e)&&e[0]==null?or(e[1]):1:0,P=(r,t,e=ir(r))=>e<0?()=>{}:nr(r,e?(o,n,s)=>(n=k(n),S(n)?void 0:t(o,n,s)):t);p("===",(r,t)=>(r=i(r),t=i(t),e=>r(e)===t(e)));p("!==",(r,t)=>(r=i(r),t=i(t),e=>r(e)!==t(e)));p("??",(r,t)=>(r=i(r),t=i(t),e=>r(e)??t(e)));var Tt=r=>{throw Error(r)};p("**",(r,t)=>(r=i(r),t=i(t),e=>r(e)**t(e)));p("**=",(r,t)=>(L(r)||Tt("Invalid assignment target"),t=i(t),P(r,(e,o,n)=>e[o]**=t(n))));p("in",(r,t)=>(r=i(r),t=i(t),e=>r(e)in t(e)));var Ft=r=>{throw Error(r)};p(">>>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>>t(e)));p(">>>=",(r,t)=>(L(r)||Ft("Invalid assignment target"),t=i(t),P(r,(e,o,n)=>e[o]>>>=t(n))));var Ut=r=>r[0]?.[0]===","?r[0].slice(1):r,a=(r,t,e)=>{if(typeof r=="string"){e[r]=t;return}let[o,...n]=r,s=Ut(n);if(o==="{}"){let f=[];for(let m of s){if(Array.isArray(m)&&m[0]==="..."){let E={};for(let T in t)!f.includes(T)&&!S(T)&&(E[T]=t[T]);e[m[1]]=E;break}let A,g,R;typeof m=="string"?A=g=m:m[0]==="="?(typeof m[1]=="string"?A=g=m[1]:[,A,g]=m[1],R=m[2]):[,A,g]=m,f.push(A=k(A));let y=S(A)?void 0:t[A];y===void 0&&R&&(y=i(R)(e)),a(g,y,e)}}else if(o==="[]"){let f=0;for(let m of s){if(m===null){f++;continue}if(Array.isArray(m)&&m[0]==="..."){e[m[1]]=t.slice(f);break}let A=m,g;Array.isArray(m)&&m[0]==="="&&([,A,g]=m);let R=t[f++];R===void 0&&g&&(R=i(g)(e)),a(A,R,e)}}},sr=(...r)=>(r=r.map(t=>{if(typeof t=="string")return e=>{e[t]=void 0};if(t[0]==="="){let[,e,o]=t,n=i(o);return typeof e=="string"?s=>{s[e]=n(s)}:s=>a(e,n(s),s)}return i(t)}),t=>{for(let e of r)e(t)});p("let",sr);p("const",sr);p("var",sr);var K=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=i(t),typeof e=="string"?o=>{o[e]=t(o)}:o=>a(e,t(o),o)}return L(r)||K("Invalid assignment target"),t=i(t),P(r,(e,o,n)=>e[o]=t(n))});p("||=",(r,t)=>(L(r)||K("Invalid assignment target"),t=i(t),P(r,(e,o,n)=>e[o]||=t(n))));p("&&=",(r,t)=>(L(r)||K("Invalid assignment target"),t=i(t),P(r,(e,o,n)=>e[o]&&=t(n))));p("??=",(r,t)=>(L(r)||K("Invalid assignment target"),t=i(t),P(r,(e,o,n)=>e[o]??=t(n))));p("?",(r,t,e)=>(r=i(r),t=i(t),e=i(e),o=>r(o)?t(o):e(o)));var _t=[];p("=>",(r,t)=>{r=r?.[0]==="()"?r[1]:r;let e=r?r[0]===","?r.slice(1):[r]:[],o=-1,n=null,s=e[e.length-1];Array.isArray(s)&&s[0]==="..."&&(o=e.length-1,n=s[1],e.length--);let f=t?.[0]==="{}";return t=i(f?["{",t[1]]:t),m=>(...A)=>{let g={};e.forEach((y,E)=>g[y]=A[E]),n&&(g[n]=A.slice(o));let R=new Proxy(g,{get:(y,E)=>E in y?y[E]:m?.[E],set:(y,E,T)=>((E in y?y:m)[E]=T,!0),has:(y,E)=>E in y||(m?E in m:!1)});try{let y=t(R);return f?void 0:y}catch(y){if(y===_t)return y[0];throw y}}});p("...",r=>(r=i(r),t=>{let e=r(t),o=[];for(let n of Object.keys(e))S(n)||o.push([n,e[n]]);return o}));p("?.",(r,t)=>(r=i(r),t=k(t),S(t)?()=>{}:e=>r(e)?.[t]));p("?.[]",(r,t)=>(r=i(r),t=i(t),e=>{let o=r(e);if(o==null)return;let n=k(t(e));return S(n)?void 0:o[n]}));p("?.()",(r,t)=>{let e=t?t[0]===","?(t=t.slice(1).map(i),n=>t.map(s=>s(n))):(t=i(t),n=>[t(n)]):()=>[];if(r[0]==="."||r[0]==="?."){let n=r[0]==="?.",s=i(r[1]),f=k(r[2]);return S(f)?()=>{}:n?m=>s(m)?.[f]?.(...e(m)):m=>s(m)[f]?.(...e(m))}if((r[0]==="[]"||r[0]==="?.[]")&&r.length===3){let n=r[0]==="?.[]",s=i(r[1]),f=i(r[2]);return m=>{let A=s(m);if(n&&A==null)return;let g=k(f(m));return S(g)?void 0:A[g]?.(...e(m))}}let o=i(r);return n=>o(n)?.(...e(n))});p("typeof",r=>(r=i(r),t=>typeof r(t)));p("void",r=>(r=i(r),t=>(r(t),void 0)));p("delete",r=>{if(r[0]==="."){let t=i(r[1]),e=r[2];return o=>delete t(o)[e]}if(r[0]==="[]"){let t=i(r[1]),e=i(r[2]);return o=>delete t(o)[e(o)]}return()=>!0});p("new",r=>{let t=i(r?.[0]==="()"?r[1]:r),e=r?.[0]==="()"?r[2]:null,o=e?e[0]===","?(n=>s=>n.map(f=>f(s)))(e.slice(1).map(i)):(n=>s=>[n(s)])(i(e)):()=>[];return n=>new(t(n))(...o(n))});var $=Symbol("accessor");p("get",(r,t)=>(t=t?i(t):()=>{},e=>[[$,r,{get:function(){let o=Object.create(e||{});return o.this=this,t(o)}}]]));p("set",(r,t,e)=>(e=e?i(e):()=>{},o=>[[$,r,{set:function(n){let s=Object.create(o||{});s.this=this,s[t]=n,e(s)}}]]));var at=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);p("{}",(r,t)=>{if(t!==void 0)return;if(!at(r))return i(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let e=r.map(o=>i(typeof o=="string"?[":",o,o]:o));return o=>{let n={},s={};for(let f of e.flatMap(m=>m(o)))if(f[0]===$){let[,m,A]=f;s[m]={...s[m],...A,configurable:!0,enumerable:!0}}else n[f[0]]=f[1];for(let f in s)Object.defineProperty(n,f,s[f]);return n}});p("{",r=>(r=r?i(r):()=>{},t=>r(Object.create(t))));p(":",(r,t)=>(t=i(t),Array.isArray(r)?(r=i(r),e=>[[r(e),t(e)]]):e=>[[r,t(e)]]));p("`",(...r)=>(r=r.map(i),t=>r.map(e=>e(t)).join("")));p("``",(r,...t)=>{r=i(r);let e=[],o=[];for(let s of t)Array.isArray(s)&&s[0]===void 0?e.push(s[1]):o.push(i(s));let n=Object.assign([...e],{raw:e});return s=>r(s)(n,...o.map(f=>f(s)))});var Kr=new WeakMap,Bt=(r,...t)=>typeof r=="string"?i(d(r)):Kr.get(r)||Kr.set(r,Gt(r,t)).get(r),$r=57344,Gt=(r,t)=>{let e=r.reduce((s,f,m)=>s+(m?String.fromCharCode($r+m-1):"")+f,""),o=d(e),n=s=>{if(typeof s=="string"&&s.length===1){let f=s.charCodeAt(0)-$r,m;if(f>=0&&f<t.length)return m=t[f],Mt(m)?m:[,m]}return Array.isArray(s)?s.map(n):s};return i(n(o))},Mt=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Xt=Bt;export{q as access,l as binary,i as compile,c as cur,Xt as default,O as err,h as expr,_ as group,Kt as id,u as idx,B as keyword,F as literal,jr as loc,w as lookup,ur as member,W as nary,v as next,p as operator,Q as operators,$t as parens,d as parse,H as peek,j as prec,z as propName,mr as seek,C as skip,I as token,N as unary,fr as word};
1
+ var l,u,d=r=>(l=0,u=r,d.enter?.(),r=A(),u[l]?O():r||""),O=(r="Unexpected token",t=l,e=u.slice(0,t).split(`
2
+ `),o=e.pop(),n=u.slice(Math.max(0,t-40),t),s="\u032D",f=(u[t]||" ")+s,m=u.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
3
+ ${n}${f}${m}`)},Qr=(r,t=l)=>(Array.isArray(r)&&(r.loc=t),r),a=(r,t=l,e)=>{for(;e=r(u.charCodeAt(l));)l+=e;return u.slice(t,l)},y=(r=1)=>u[l+=r],mr=r=>l=r,A=(r=0,t)=>{let e,o,n;for(t&&d.enter?.(r,t);(e=d.space())&&e!==t&&(n=d.step(o,r,e,A));)o=n;return t&&(e==t?(l++,d.exit?.(r,t)):O("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},W=(r=l)=>{for(;u.charCodeAt(r)<=32;)r++;return u.charCodeAt(r)},Kt=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,fr=(r,t=r.length)=>u.substr(l,t)===r&&!d.id(u.charCodeAt(l+t)),$t=()=>(y(),A(0,41)),E=[],Q={},I=(r,t=32,e,o=r.charCodeAt(0))=>ur({op:r,l:r.length,p:Q[r]=!E[o]&&Q[r]||t,map:e,word:r.toUpperCase()!==r,kw:!1}),c=(r,t,e=!1)=>I(r,t,(o,n)=>o&&(n=A(t-(e?.5:0)))&&[r,o,n]),N=(r,t,e)=>I(r,t,o=>e?o&&[r,o]:!o&&(o=A(t-.5))&&[r,o]),T=(r,t)=>I(r,200,e=>!e&&[,t]),q=(r,t,e,o)=>I(r,t,(n,s,f=n)=>(s=A(t-(e?.5:0)),n?.[0]!==r&&(n=[r,n||null]),s?.[0]===r?n.push(...s.slice(1)):s?n.push(s):o||W()===r.charCodeAt(0)?n.push(null):f&&n.length===2&&(n=n[1]),n)),U=(r,t)=>I(r[0],t,e=>!e&&[r,A(0,r.charCodeAt(1))||null]),z=(r,t)=>I(r[0],t,e=>e&&[r,e,A(0,r.charCodeAt(1))||null]),J=(r,t)=>(d.space(),t=u.charCodeAt(l),d.id(t)&&(t<48||t>57)?a(d.id):A(r)),lr=(r,t)=>I(r,t,(e,o)=>e&&(o=J(t))&&[r,e,o]),B=(r,t,e)=>(Q[r]??=t,ur({op:r,l:r.length,p:t,map:e,word:!0,kw:!0})),pr=(r,t,e=(o,n,s,f=l,m,h,g)=>{for(g=0;h=r[g++];)if(!(h.kw&&o)&&!(s?h.op!==s:!((h.l<2||h.op.charCodeAt(1)===u.charCodeAt(l+1)&&(h.l<3||u.substr(l,h.l)===h.op))&&(!h.word||!d.id(u.charCodeAt(l+h.l)))&&(s=h.op)))&&!(n>=h.p)&&!(h.kw&&d.prop&&!d.prop(l+h.l))){if(l+=h.l,m=h.map(o))return Qr(m,f);l=f,s=0,h.word||o||t||r[g]||O()}return t?.(o,n,s)})=>(e.ops=r,e.tail=t,e),ur=(r,t=r.op.charCodeAt(0),e=E[t])=>E[t]=e?.ops?pr([r,...e.ops],e.tail):pr([r],e);d.space=r=>{for(;(r=u.charCodeAt(l))<=32;)l++;return r};d.step=(r,t,e,o,n)=>(n=E[e])&&n(r,t)||(r?null:a(d.id)||null);var H={},p=(r,t,e=H[r])=>H[r]=(...o)=>t(...o)||e?.(...o),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):H[r[0]]?.(...r.slice(1))??O(`Unknown operator: ${r[0]}`,r?.loc):i.id(r);i.id=r=>r===void 0?()=>{}:t=>t?.[r];var V=46,P=48,F=57,cr=69,dr=101,Hr=43,Wr=45,hr=95,qr=97,zr=102,Jr=65,Vr=70,Ar=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),Yr=r=>r===V&&(r=u.charCodeAt(l+1))!==V&&!(d.id(r)&&r>F&&r!==dr&&r!==cr)||r>=P&&r<=F||r===hr||((r===cr||r===dr)&&((r=u.charCodeAt(l+1))>=P&&r<=F||r===Hr||r===Wr)?2:0),Y=r=>(r=+Ar(a(Yr)))!=r?O():[,r],Zr=r=>t=>t===hr||t>=P&&t<=F&&t-P<r||r===16&&(t>=qr&&t<=zr||t>=Jr&&t<=Vr);d.number=null;E[V]=r=>!r&&u.charCodeAt(l+1)>=P&&u.charCodeAt(l+1)<=F&&Y();for(let r=P;r<=F;r++)E[r]=t=>t?void 0:Y();E[P]=(r,t)=>{if(!r){for(let e in d.number)if(e[0]==="0"&&(u.charCodeAt(l+1)|32)===e.charCodeAt(1)){y(2);let o=Ar(a(Zr(t=d.number[e])));return[,parseInt(o,t)]}return Y()}};var Nr=92,gr=34,Cr=39,yr=117,Sr=120,kr=123,xr=125,wr=10,br=13,rt={n:`
4
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},Er=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,Ir=r=>{if(u.charCodeAt(r)!==Nr)return;let t=u.charCodeAt(r+1);if(t===Sr||t===yr&&u.charCodeAt(r+2)!==kr){let e=t===Sr?2:4,o=0,n;for(let s=0;s<e;s++){if((n=Er(u.charCodeAt(r+2+s)))<0)return;o=o*16+n}return[o,2+e]}if(t===yr){let e=0,o=r+3,n;for(;(n=Er(u.charCodeAt(o)))>=0;)e=e*16+n,o++;if(o>r+3&&e<=1114111&&u.charCodeAt(o)===xr)return[e,o-r+1]}},tt=()=>{let r=u.charCodeAt(l+1);if(r===wr)return["",2];if(r===br)return["",u.charCodeAt(l+2)===wr?3:2];let t=Ir(l);if(t){let[e,o]=t;if(e>=55296&&e<=56319){let n=Ir(l+o);n&&n[0]>=56320&&n[0]<=57343&&(e=65536+(e-55296)*1024+n[0]-56320,o+=n[1])}return[String.fromCodePoint(e),o]}return[rt[u[l+1]]||u[l+1],2]},Z=(r,t=!1)=>{let e=l,o,n;for(;(n=u.charCodeAt(l))-r&&!(t&&(n===0||n===36&&u.charCodeAt(l+1)===kr));){if(n!==Nr){y();continue}o||(o=[]),o.push(u.slice(e,l));let[f,m]=tt();o.push(f),y(m),e=l}let s=u.slice(e,l);return o?(o.push(s),o.join("")):s},Or=r=>(t,e,o="",n=String.fromCharCode(r))=>{if(!(t||!d.string?.[n]))return y(),o+=Z(r),u[l]===n?y():O("Bad string"),[,o]};E[gr]=Or(gr);E[Cr]=Or(Cr);d.string={'"':!0};var et=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>c(r,et,!0));var ot=30,nt=40,it=140;N("!",it);c("||",ot);c("&&",nt);var st=50,pt=60,mt=70,Rr=100,ft=140;c("|",st);c("&",mt);c("^",pt);c(">>",Rr);c("<<",Rr);N("~",ft);var G=90;c("<",G);c(">",G);c("<=",G);c(">=",G);var vr=80;c("==",vr);c("!=",vr);var Lr=110,x=120,ar=140;c("+",Lr);c("-",Lr);c("*",x);c("/",x);c("%",x);N("+",ar);N("-",ar);var M=150;I("++",M,r=>r?["++",r,null]:["++",A(M-1)]);I("--",M,r=>r?["--",r,null]:["--",A(M-1)]);var lt=5,ut=10;q(",",ut);q(";",lt,!0,!0);var ct=170;U("()",ct);var Pr=170,dt=160;z("[]",Pr);lr(".",Pr);z("()",dt);var ht=d.space;d.comment??={"//":`
5
+ `,"/*":"*/"};d.space=()=>{for(var r,t,e,o,n;r=ht();){for(e in t=d.comment)if(r===e.charCodeAt(0)&&(e.length<2||u.charCodeAt(l+1)===e.charCodeAt(1))&&(e.length<3||u.substr(l,e.length)===e)){o=t[e],n=u.indexOf(o,l+e.length),mr(n<0?u.length:o===`
6
+ `?n:n+o.length),r=0;break}if(r)return r}return r};var Dr=80;c("===",Dr);c("!==",Dr);var At=30;c("??",At);var gt=130,Ct=20;c("**",gt,!0);c("**=",Ct,!0);var Tr=90;c("in",Tr);c("of",Tr);var yt=20,St=100;c(">>>",St);c(">>>=",yt,!0);var b=20;c("||=",b,!0);c("&&=",b,!0);c("??=",b,!0);T("true",!0);T("false",!1);T("null",null);B("undefined",200,()=>[]);T("NaN",NaN);T("Infinity",1/0);var rr=20;I("?",rr,(r,t,e)=>r&&(t=A(rr-1))&&a(o=>o===58)&&(e=A(rr-1),["?",r,t,e]));var wt=20;c("=>",wt,!0);var Et=20;N("...",Et);var Fr=170;I("?.",Fr,(r,t)=>{if(!r)return;let e=d.space();return e===40?(y(),["?.()",r,A(0,41)||null]):e===91?(y(),["?.[]",r,A(0,93)]):(t=J(Fr),t?["?.",r,t]:void 0)});var tr=140,Ur=160,It=Ur+1;N("typeof",tr);N("void",tr);N("delete",tr);var Nt=r=>d.space()===40?(y(),["()",r,A(0,41)||null]):r;B("new",It,()=>fr(".target")?(y(7),["new.target"]):["new",Nt(A(Ur))]);var kt=20,_r=200;d.prop=r=>W(r)!==58;U("[]",_r);U("{}",_r);c(":",kt-1,!0);var Ot=170,X=96,Rt=36,vt=123,Br=()=>{let r=[];for(;;){r.push([,Z(X,!0)]);let t=u.charCodeAt(l);if(t===X)return y(),r;(t!==Rt||u.charCodeAt(l+1)!==vt)&&O("Unterminated template"),y(2),r.push(A(0,125))}},Lt=r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r],at=E[X];E[X]=(r,t)=>r&&t<Ot?d.asi&&d.newline?void 0:(y(),["``",r,...Br()]):r?at?.(r,t):(y(),Lt(Br()));d.string["'"]=!0;d.number={"0x":16,"0b":2,"0o":8};var Mr=(r,t,e,o)=>typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="()"&&r.length===2?Mr(r[1],t):(()=>{throw Error("Invalid assignment target")})(),Gr={"=":(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 Gr)p(r,(t,e)=>(e=i(e),Mr(t,(o,n,s)=>Gr[r](o,n,e(s)))));p("!",r=>(r=i(r),t=>!r(t)));p("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));p("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));p("~",r=>(r=i(r),t=>~r(t)));p("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));p("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));p("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));p(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));p("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));p(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));p("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));p(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));p("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));p("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));p("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));p("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));p("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));p("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));p("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));p("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var er=(r,t,e,o)=>typeof r=="string"?n=>t(n,r):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n))):r[0]==="()"&&r.length===2?er(r[1],t):(()=>{throw Error("Invalid increment target")})();p("++",(r,t)=>er(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));p("--",(r,t)=>er(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var Xr=(...r)=>(r=r.map(i),t=>{let e;for(let o of r)e=o(t);return e});p(",",Xr);p(";",Xr);var Kr=r=>r!=null&&(typeof r=="object"||typeof r=="function"),k=r=>Kr(r)?Reflect.ownKeys({[r]:0})[0]:r,S=r=>typeof r=="string"&&(r[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype"),Pt=r=>S(k(r));i.id=r=>r===void 0||Pt(r)?()=>{}:t=>t?.[r];var K=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=i(e[1]),o=>e(o)):(e=i(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&K("Missing index"),r=i(r),t=i(t),e=>{let o=k(t(e));return S(o)?void 0:r(e)[o]}));p(".",(r,t)=>(r=i(r),t=k(t[0]?t:t[1]),S(t)?()=>{}:e=>r(e)[t]));p("()",(r,t)=>{if(t===void 0)return r==null?K("Empty ()"):i(r);let e=s=>s?.[0]===","&&s.slice(1).some(f=>f==null||e(f));e(t)&&K("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(i),s=>t.map(f=>f(s))):(t=i(t),s=>[t(s)]):()=>[],n=ir(r);return n<0?()=>{}:nr(r,n?(s,f,m)=>(f=k(f),S(f)?void 0:s[f](...o(m))):(s,f,m)=>s[f](...o(m)))});var R=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&R(r[1])||r[0]==="{}"),nr=(r,t,e,o)=>r==null?K("Empty ()"):r[0]==="()"&&r.length==2?nr(r[1],t):typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="?."?(e=i(r[1]),o=r[2],n=>{let s=e(n);return s==null?void 0:t(s,o,n)}):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="?.[]"?(e=i(r[1]),o=i(r[2]),n=>{let s=e(n);return s==null?void 0:t(s,o(n),n)}):(r=i(r),n=>t([r(n)],0,n)),or=r=>Kr(r)?1:S(r)?-1:0,ir=(r,t=r?.[0],e=r?.[2])=>typeof r=="string"?or(r):t==="()"&&r.length==2?ir(r[1]):t==="."||t==="?."?or(e):(t==="[]"||t==="?.[]")&&r.length===3?Array.isArray(e)&&e[0]==null?or(e[1]):1:0,L=(r,t,e=ir(r))=>e<0?()=>{}:nr(r,e?(o,n,s)=>(n=k(n),S(n)?void 0:t(o,n,s)):t);p("===",(r,t)=>(r=i(r),t=i(t),e=>r(e)===t(e)));p("!==",(r,t)=>(r=i(r),t=i(t),e=>r(e)!==t(e)));p("??",(r,t)=>(r=i(r),t=i(t),e=>r(e)??t(e)));var Dt=r=>{throw Error(r)};p("**",(r,t)=>(r=i(r),t=i(t),e=>r(e)**t(e)));p("**=",(r,t)=>(R(r)||Dt("Invalid assignment target"),t=i(t),L(r,(e,o,n)=>e[o]**=t(n))));p("in",(r,t)=>(r=i(r),t=i(t),e=>r(e)in t(e)));var Tt=r=>{throw Error(r)};p(">>>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>>t(e)));p(">>>=",(r,t)=>(R(r)||Tt("Invalid assignment target"),t=i(t),L(r,(e,o,n)=>e[o]>>>=t(n))));var Ft=r=>r[0]?.[0]===","?r[0].slice(1):r,_=(r,t,e)=>{if(typeof r=="string"){e[r]=t;return}let[o,...n]=r,s=Ft(n);if(o==="{}"){let f=[];for(let m of s){if(Array.isArray(m)&&m[0]==="..."){let w={};for(let D in t)!f.includes(D)&&!S(D)&&(w[D]=t[D]);e[m[1]]=w;break}let h,g,v;typeof m=="string"?h=g=m:m[0]==="="?(typeof m[1]=="string"?h=g=m[1]:[,h,g]=m[1],v=m[2]):[,h,g]=m,f.push(h=k(h));let C=S(h)?void 0:t[h];C===void 0&&v&&(C=i(v)(e)),_(g,C,e)}}else if(o==="[]"){let f=0;for(let m of s){if(m===null){f++;continue}if(Array.isArray(m)&&m[0]==="..."){e[m[1]]=t.slice(f);break}let h=m,g;Array.isArray(m)&&m[0]==="="&&([,h,g]=m);let v=t[f++];v===void 0&&g&&(v=i(g)(e)),_(h,v,e)}}},sr=(...r)=>(r=r.map(t=>{if(typeof t=="string")return e=>{e[t]=void 0};if(t[0]==="="){let[,e,o]=t,n=i(o);return typeof e=="string"?s=>{s[e]=n(s)}:s=>_(e,n(s),s)}return i(t)}),t=>{for(let e of r)e(t)});p("let",sr);p("const",sr);p("var",sr);var $=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=i(t),typeof e=="string"?o=>{o[e]=t(o)}:o=>_(e,t(o),o)}return R(r)||$("Invalid assignment target"),t=i(t),L(r,(e,o,n)=>e[o]=t(n))});p("||=",(r,t)=>(R(r)||$("Invalid assignment target"),t=i(t),L(r,(e,o,n)=>e[o]||=t(n))));p("&&=",(r,t)=>(R(r)||$("Invalid assignment target"),t=i(t),L(r,(e,o,n)=>e[o]&&=t(n))));p("??=",(r,t)=>(R(r)||$("Invalid assignment target"),t=i(t),L(r,(e,o,n)=>e[o]??=t(n))));p("?",(r,t,e)=>(r=i(r),t=i(t),e=i(e),o=>r(o)?t(o):e(o)));var Ut=[];p("=>",(r,t)=>{r=r?.[0]==="()"?r[1]:r;let e=r?r[0]===","?r.slice(1):[r]:[],o=-1,n=null,s=e[e.length-1];Array.isArray(s)&&s[0]==="..."&&(o=e.length-1,n=s[1],e.length--);let f=t?.[0]==="{}";return t=i(f?["{",t[1]]:t),m=>(...h)=>{let g={};e.forEach((C,w)=>g[C]=h[w]),n&&(g[n]=h.slice(o));let v=new Proxy(g,{get:(C,w)=>w in C?C[w]:m?.[w],set:(C,w,D)=>((w in C?C:m)[w]=D,!0),has:(C,w)=>w in C||(m?w in m:!1)});try{let C=t(v);return f?void 0:C}catch(C){if(C===Ut)return C[0];throw C}}});p("...",r=>(r=i(r),t=>{let e=r(t),o=[];for(let n of Object.keys(e))S(n)||o.push([n,e[n]]);return o}));p("?.",(r,t)=>(r=i(r),t=k(t),S(t)?()=>{}:e=>r(e)?.[t]));p("?.[]",(r,t)=>(r=i(r),t=i(t),e=>{let o=r(e);if(o==null)return;let n=k(t(e));return S(n)?void 0:o[n]}));p("?.()",(r,t)=>{let e=t?t[0]===","?(t=t.slice(1).map(i),n=>t.map(s=>s(n))):(t=i(t),n=>[t(n)]):()=>[];if(r[0]==="."||r[0]==="?."){let n=r[0]==="?.",s=i(r[1]),f=k(r[2]);return S(f)?()=>{}:n?m=>s(m)?.[f]?.(...e(m)):m=>s(m)[f]?.(...e(m))}if((r[0]==="[]"||r[0]==="?.[]")&&r.length===3){let n=r[0]==="?.[]",s=i(r[1]),f=i(r[2]);return m=>{let h=s(m);if(n&&h==null)return;let g=k(f(m));return S(g)?void 0:h[g]?.(...e(m))}}let o=i(r);return n=>o(n)?.(...e(n))});p("typeof",r=>(r=i(r),t=>typeof r(t)));p("void",r=>(r=i(r),t=>(r(t),void 0)));p("delete",r=>{if(r[0]==="."){let t=i(r[1]),e=r[2];return o=>delete t(o)[e]}if(r[0]==="[]"){let t=i(r[1]),e=i(r[2]);return o=>delete t(o)[e(o)]}return()=>!0});p("new",r=>{let t=i(r?.[0]==="()"?r[1]:r),e=r?.[0]==="()"?r[2]:null,o=e?e[0]===","?(n=>s=>n.map(f=>f(s)))(e.slice(1).map(i)):(n=>s=>[n(s)])(i(e)):()=>[];return n=>new(t(n))(...o(n))});var j=Symbol("accessor");p("get",(r,t)=>(t=t?i(t):()=>{},e=>[[j,r,{get:function(){let o=Object.create(e||{});return o.this=this,t(o)}}]]));p("set",(r,t,e)=>(e=e?i(e):()=>{},o=>[[j,r,{set:function(n){let s=Object.create(o||{});s.this=this,s[t]=n,e(s)}}]]));var _t=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);p("{}",(r,t)=>{if(t!==void 0)return;if(!_t(r))return i(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let e=r.map(o=>i(typeof o=="string"?[":",o,o]:o));return o=>{let n={},s={};for(let f of e.flatMap(m=>m(o)))if(f[0]===j){let[,m,h]=f;s[m]={...s[m],...h,configurable:!0,enumerable:!0}}else n[f[0]]=f[1];for(let f in s)Object.defineProperty(n,f,s[f]);return n}});p("{",r=>(r=r?i(r):()=>{},t=>r(Object.create(t))));p(":",(r,t)=>(t=i(t),Array.isArray(r)?(r=i(r),e=>[[r(e),t(e)]]):e=>[[r,t(e)]]));p("`",(...r)=>(r=r.map(i),t=>r.map(e=>e(t)).join("")));p("``",(r,...t)=>{r=i(r);let e=[],o=[];for(let s of t)Array.isArray(s)&&s[0]===void 0?e.push(s[1]):o.push(i(s));let n=Object.assign([...e],{raw:e});return s=>r(s)(n,...o.map(f=>f(s)))});var $r=new WeakMap,Bt=(r,...t)=>typeof r=="string"?i(d(r)):$r.get(r)||$r.set(r,Gt(r,t)).get(r),jr=57344,Gt=(r,t)=>{let e=r.reduce((s,f,m)=>s+(m?String.fromCharCode(jr+m-1):"")+f,""),o=d(e),n=s=>{if(typeof s=="string"&&s.length===1){let f=s.charCodeAt(0)-jr,m;if(f>=0&&f<t.length)return m=t[f],Mt(m)?m:[,m]}return Array.isArray(s)?s.map(n):s};return i(n(o))},Mt=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Xt=Bt;export{z as access,c as binary,i as compile,u as cur,Xt as default,O as err,A as expr,U as group,Kt as id,l as idx,B as keyword,T as literal,Qr as loc,E as lookup,lr as member,q as nary,a as next,p as operator,H as operators,$t as parens,d as parse,W as peek,Q as prec,J as propName,mr as seek,y as skip,I as token,N as unary,fr as word};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "subscript",
3
- "version": "10.8.0",
3
+ "version": "10.8.1",
4
4
  "description": "Modular expression parser & evaluator",
5
5
  "main": "subscript.js",
6
6
  "module": "subscript.js",
package/subscript.min.js CHANGED
@@ -1,4 +1,4 @@
1
- var p,l,f=r=>(p=0,l=r,f.enter?.(),r=A(),l[p]?E():r||""),E=(r="Unexpected token",t=p,e=l.slice(0,t).split(`
2
- `),o=e.pop(),n=l.slice(Math.max(0,t-40),t),s="\u032D",u=(l[t]||" ")+s,d=l.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
3
- ${n}${u}${d}`)},Ar=(r,t=p)=>(Array.isArray(r)&&(r.loc=t),r),S=(r,t=p,e)=>{for(;e=r(l.charCodeAt(p));)p+=e;return l.slice(t,p)},D=(r=1)=>l[p+=r],Jr=r=>p=r,A=(r=0,t)=>{let e,o,n;for(t&&f.enter?.(r,t);(e=f.space())&&e!==t&&(n=f.step(o,r,e,A));)o=n;return t&&(e==t?(p++,f.exit?.(r,t)):E("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},Cr=(r=p)=>{for(;l.charCodeAt(r)<=32;)r++;return l.charCodeAt(r)},Vr=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,Yr=(r,t=r.length)=>l.substr(p,t)===r&&!f.id(l.charCodeAt(p+t)),Zr=()=>(D(),A(0,41)),C=[],L={},g=(r,t=32,e,o=r.charCodeAt(0))=>K({op:r,l:r.length,p:L[r]=!C[o]&&L[r]||t,map:e,word:r.toUpperCase()!==r,kw:!1}),c=(r,t,e=!1)=>g(r,t,(o,n)=>o&&(n=A(t-(e?.5:0)))&&[r,o,n]),y=(r,t,e)=>g(r,t,o=>e?o&&[r,o]:!o&&(o=A(t-.5))&&[r,o]),jr=(r,t)=>g(r,200,e=>!e&&[,t]),M=(r,t,e,o)=>g(r,t,(n,s,u=n)=>(s=A(t-(e?.5:0)),n?.[0]!==r&&(n=[r,n||null]),s?.[0]===r?n.push(...s.slice(1)):s?n.push(s):o||Cr()===r.charCodeAt(0)?n.push(null):u&&n.length===2&&(n=n[1]),n)),G=(r,t)=>g(r[0],t,e=>!e&&[r,A(0,r.charCodeAt(1))||null]),x=(r,t)=>g(r[0],t,e=>e&&[r,e,A(0,r.charCodeAt(1))||null]),gr=(r,t)=>(f.space(),t=l.charCodeAt(p),f.id(t)&&(t<48||t>57)?S(f.id):A(r)),H=(r,t)=>g(r,t,(e,o)=>e&&(o=gr(t))&&[r,e,o]),ar=(r,t,e)=>(L[r]??=t,K({op:r,l:r.length,p:t,map:e,word:!0,kw:!0})),Q=(r,t,e=(o,n,s,u=p,d,h,T)=>{for(T=0;h=r[T++];)if(!(h.kw&&o)&&!(s?h.op!==s:!((h.l<2||h.op.charCodeAt(1)===l.charCodeAt(p+1)&&(h.l<3||l.substr(p,h.l)===h.op))&&(!h.word||!f.id(l.charCodeAt(p+h.l)))&&(s=h.op)))&&!(n>=h.p)&&!(h.kw&&f.prop&&!f.prop(p+h.l))){if(p+=h.l,d=h.map(o))return Ar(d,u);p=u,s=0,h.word||o||t||r[T]||E()}return t?.(o,n,s)})=>(e.ops=r,e.tail=t,e),K=(r,t=r.op.charCodeAt(0),e=C[t])=>C[t]=e?.ops?Q([r,...e.ops],e.tail):Q([r],e);f.space=r=>{for(;(r=l.charCodeAt(p))<=32;)p++;return r};f.step=(r,t,e,o,n)=>(n=C[e])&&n(r,t)||(r?null:S(f.id)||null);var N={},m=(r,t,e=N[r])=>N[r]=(...o)=>t(...o)||e?.(...o),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):N[r[0]]?.(...r.slice(1))??E(`Unknown operator: ${r[0]}`,r?.loc):i.id(r);i.id=r=>r===void 0?()=>{}:t=>t?.[r];var O=46,w=48,R=57,v=69,W=101,Er=43,Sr=45,q=95,yr=97,wr=102,Dr=65,Rr=70,z=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),Pr=r=>r===O&&(r=l.charCodeAt(p+1))!==O&&!(f.id(r)&&r>R&&r!==W&&r!==v)||r>=w&&r<=R||r===q||((r===v||r===W)&&((r=l.charCodeAt(p+1))>=w&&r<=R||r===Er||r===Sr)?2:0),$=r=>(r=+z(S(Pr)))!=r?E():[,r],_r=r=>t=>t===q||t>=w&&t<=R&&t-w<r||r===16&&(t>=yr&&t<=wr||t>=Dr&&t<=Rr);f.number=null;C[O]=r=>!r&&l.charCodeAt(p+1)>=w&&l.charCodeAt(p+1)<=R&&$();for(let r=w;r<=R;r++)C[r]=t=>t?void 0:$();C[w]=(r,t)=>{if(!r){for(let e in f.number)if(e[0]==="0"&&(l.charCodeAt(p+1)|32)===e.charCodeAt(1)){D(2);let o=z(S(_r(t=f.number[e])));return[,parseInt(o,t)]}return $()}};var rr=92,J=34,V=39,Y=117,Z=120,Fr=123,Ur=125,j=10,Ir=13,Tr={n:`
4
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},a=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,b=r=>{if(l.charCodeAt(r)!==rr)return;let t=l.charCodeAt(r+1);if(t===Z||t===Y&&l.charCodeAt(r+2)!==Fr){let e=t===Z?2:4,o=0,n;for(let s=0;s<e;s++){if((n=a(l.charCodeAt(r+2+s)))<0)return;o=o*16+n}return[o,2+e]}if(t===Y){let e=0,o=r+3,n;for(;(n=a(l.charCodeAt(o)))>=0;)e=e*16+n,o++;if(o>r+3&&e<=1114111&&l.charCodeAt(o)===Ur)return[e,o-r+1]}},Lr=()=>{let r=l.charCodeAt(p+1);if(r===j)return["",2];if(r===Ir)return["",l.charCodeAt(p+2)===j?3:2];let t=b(p);if(t){let[e,o]=t;if(e>=55296&&e<=56319){let n=b(p+o);n&&n[0]>=56320&&n[0]<=57343&&(e=65536+(e-55296)*1024+n[0]-56320,o+=n[1])}return[String.fromCodePoint(e),o]}return[Tr[l[p+1]]||l[p+1],2]},tr=r=>(t,e,o="",n=String.fromCharCode(r))=>{if(t||!f.string?.[n])return;D();let s=()=>{let[u,d]=Lr();return o+=u,d};return S(u=>u-r&&(u!==rr?(o+=l[p],1):s())),l[p]===n?D():E("Bad string"),[,o]};C[J]=tr(J);C[V]=tr(V);f.string={'"':!0};var Nr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>c(r,Nr,!0));var Mr=30,xr=40,Or=140;y("!",Or);c("||",Mr);c("&&",xr);var $r=50,Xr=60,Br=70,er=100,kr=140;c("|",$r);c("&",Br);c("^",Xr);c(">>",er);c("<<",er);y("~",kr);var _=90;c("<",_);c(">",_);c("<=",_);c(">=",_);var or=80;c("==",or);c("!=",or);var nr=110,X=120,ir=140;c("+",nr);c("-",nr);c("*",X);c("/",X);c("%",X);y("+",ir);y("-",ir);var F=150;g("++",F,r=>r?["++",r,null]:["++",A(F-1)]);g("--",F,r=>r?["--",r,null]:["--",A(F-1)]);var Qr=5,Gr=10;M(",",Gr);M(";",Qr,!0,!0);var Hr=170;G("()",Hr);var sr=170,Kr=160;x("[]",sr);H(".",sr);x("()",Kr);var lr=(r,t,e,o)=>typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="()"&&r.length===2?lr(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)m(r,(t,e)=>(e=i(e),lr(t,(o,n,s)=>pr[r](o,n,e(s)))));m("!",r=>(r=i(r),t=>!r(t)));m("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));m("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));m("~",r=>(r=i(r),t=>~r(t)));m("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));m("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));m("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));m(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));m("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));m(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));m("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));m(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));m("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));m("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));m("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));m("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));m("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));m("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));m("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));m("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var B=(r,t,e,o)=>typeof r=="string"?n=>t(n,r):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n))):r[0]==="()"&&r.length===2?B(r[1],t):(()=>{throw Error("Invalid increment target")})();m("++",(r,t)=>B(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));m("--",(r,t)=>B(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var mr=(...r)=>(r=r.map(i),t=>{let e;for(let o of r)e=o(t);return e});m(",",mr);m(";",mr);var ur=r=>r!=null&&(typeof r=="object"||typeof r=="function"),I=r=>ur(r)?Reflect.ownKeys({[r]:0})[0]:r,P=r=>typeof r=="string"&&(r[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype"),vr=r=>P(I(r));i.id=r=>r===void 0||vr(r)?()=>{}:t=>t?.[r];var U=r=>{throw Error(r)};m("[]",(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]),o=>e(o)):(e=i(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&U("Missing index"),r=i(r),t=i(t),e=>{let o=I(t(e));return P(o)?void 0:r(e)[o]}));m(".",(r,t)=>(r=i(r),t=I(t[0]?t:t[1]),P(t)?()=>{}:e=>r(e)[t]));m("()",(r,t)=>{if(t===void 0)return r==null?U("Empty ()"):i(r);let e=s=>s?.[0]===","&&s.slice(1).some(u=>u==null||e(u));e(t)&&U("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(i),s=>t.map(u=>u(s))):(t=i(t),s=>[t(s)]):()=>[],n=cr(r);return n<0?()=>{}:fr(r,n?(s,u,d)=>(u=I(u),P(u)?void 0:s[u](...o(d))):(s,u,d)=>s[u](...o(d)))});var fr=(r,t,e,o)=>r==null?U("Empty ()"):r[0]==="()"&&r.length==2?fr(r[1],t):typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="?."?(e=i(r[1]),o=r[2],n=>{let s=e(n);return s==null?void 0:t(s,o,n)}):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="?.[]"?(e=i(r[1]),o=i(r[2]),n=>{let s=e(n);return s==null?void 0:t(s,o(n),n)}):(r=i(r),n=>t([r(n)],0,n)),k=r=>ur(r)?1:P(r)?-1:0,cr=(r,t=r?.[0],e=r?.[2])=>typeof r=="string"?k(r):t==="()"&&r.length==2?cr(r[1]):t==="."||t==="?."?k(e):(t==="[]"||t==="?.[]")&&r.length===3?Array.isArray(e)&&e[0]==null?k(e[1]):1:0;var dr=new WeakMap,Wr=(r,...t)=>typeof r=="string"?i(f(r)):dr.get(r)||dr.set(r,qr(r,t)).get(r),hr=57344,qr=(r,t)=>{let e=r.reduce((s,u,d)=>s+(d?String.fromCharCode(hr+d-1):"")+u,""),o=f(e),n=s=>{if(typeof s=="string"&&s.length===1){let u=s.charCodeAt(0)-hr,d;if(u>=0&&u<t.length)return d=t[u],zr(d)?d:[,d]}return Array.isArray(s)?s.map(n):s};return i(n(o))},zr=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Yt=Wr;export{x as access,c as binary,i as compile,l as cur,Yt as default,E as err,A as expr,G as group,Vr as id,p as idx,ar as keyword,jr as literal,Ar as loc,C as lookup,H as member,M as nary,S as next,m as operator,N as operators,Zr as parens,f as parse,Cr as peek,L as prec,gr as propName,Jr as seek,D as skip,g as token,y as unary,Yr as word};
1
+ var p,l,m=r=>(p=0,l=r,m.enter?.(),r=A(),l[p]?E():r||""),E=(r="Unexpected token",t=p,e=l.slice(0,t).split(`
2
+ `),o=e.pop(),n=l.slice(Math.max(0,t-40),t),s="\u032D",c=(l[t]||" ")+s,d=l.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
3
+ ${n}${c}${d}`)},Cr=(r,t=p)=>(Array.isArray(r)&&(r.loc=t),r),R=(r,t=p,e)=>{for(;e=r(l.charCodeAt(p));)p+=e;return l.slice(t,p)},S=(r=1)=>l[p+=r],Vr=r=>p=r,A=(r=0,t)=>{let e,o,n;for(t&&m.enter?.(r,t);(e=m.space())&&e!==t&&(n=m.step(o,r,e,A));)o=n;return t&&(e==t?(p++,m.exit?.(r,t)):E("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},gr=(r=p)=>{for(;l.charCodeAt(r)<=32;)r++;return l.charCodeAt(r)},Yr=m.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)=>l.substr(p,t)===r&&!m.id(l.charCodeAt(p+t)),jr=()=>(S(),A(0,41)),C=[],L={},g=(r,t=32,e,o=r.charCodeAt(0))=>K({op:r,l:r.length,p:L[r]=!C[o]&&L[r]||t,map:e,word:r.toUpperCase()!==r,kw:!1}),f=(r,t,e=!1)=>g(r,t,(o,n)=>o&&(n=A(t-(e?.5:0)))&&[r,o,n]),y=(r,t,e)=>g(r,t,o=>e?o&&[r,o]:!o&&(o=A(t-.5))&&[r,o]),ar=(r,t)=>g(r,200,e=>!e&&[,t]),M=(r,t,e,o)=>g(r,t,(n,s,c=n)=>(s=A(t-(e?.5:0)),n?.[0]!==r&&(n=[r,n||null]),s?.[0]===r?n.push(...s.slice(1)):s?n.push(s):o||gr()===r.charCodeAt(0)?n.push(null):c&&n.length===2&&(n=n[1]),n)),G=(r,t)=>g(r[0],t,e=>!e&&[r,A(0,r.charCodeAt(1))||null]),x=(r,t)=>g(r[0],t,e=>e&&[r,e,A(0,r.charCodeAt(1))||null]),Er=(r,t)=>(m.space(),t=l.charCodeAt(p),m.id(t)&&(t<48||t>57)?R(m.id):A(r)),H=(r,t)=>g(r,t,(e,o)=>e&&(o=Er(t))&&[r,e,o]),br=(r,t,e)=>(L[r]??=t,K({op:r,l:r.length,p:t,map:e,word:!0,kw:!0})),Q=(r,t,e=(o,n,s,c=p,d,h,T)=>{for(T=0;h=r[T++];)if(!(h.kw&&o)&&!(s?h.op!==s:!((h.l<2||h.op.charCodeAt(1)===l.charCodeAt(p+1)&&(h.l<3||l.substr(p,h.l)===h.op))&&(!h.word||!m.id(l.charCodeAt(p+h.l)))&&(s=h.op)))&&!(n>=h.p)&&!(h.kw&&m.prop&&!m.prop(p+h.l))){if(p+=h.l,d=h.map(o))return Cr(d,c);p=c,s=0,h.word||o||t||r[T]||E()}return t?.(o,n,s)})=>(e.ops=r,e.tail=t,e),K=(r,t=r.op.charCodeAt(0),e=C[t])=>C[t]=e?.ops?Q([r,...e.ops],e.tail):Q([r],e);m.space=r=>{for(;(r=l.charCodeAt(p))<=32;)p++;return r};m.step=(r,t,e,o,n)=>(n=C[e])&&n(r,t)||(r?null:R(m.id)||null);var N={},u=(r,t,e=N[r])=>N[r]=(...o)=>t(...o)||e?.(...o),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):N[r[0]]?.(...r.slice(1))??E(`Unknown operator: ${r[0]}`,r?.loc):i.id(r);i.id=r=>r===void 0?()=>{}:t=>t?.[r];var O=46,w=48,D=57,v=69,W=101,Sr=43,yr=45,q=95,wr=97,Dr=102,Rr=65,Pr=70,z=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),_r=r=>r===O&&(r=l.charCodeAt(p+1))!==O&&!(m.id(r)&&r>D&&r!==W&&r!==v)||r>=w&&r<=D||r===q||((r===v||r===W)&&((r=l.charCodeAt(p+1))>=w&&r<=D||r===Sr||r===yr)?2:0),$=r=>(r=+z(R(_r)))!=r?E():[,r],Fr=r=>t=>t===q||t>=w&&t<=D&&t-w<r||r===16&&(t>=wr&&t<=Dr||t>=Rr&&t<=Pr);m.number=null;C[O]=r=>!r&&l.charCodeAt(p+1)>=w&&l.charCodeAt(p+1)<=D&&$();for(let r=w;r<=D;r++)C[r]=t=>t?void 0:$();C[w]=(r,t)=>{if(!r){for(let e in m.number)if(e[0]==="0"&&(l.charCodeAt(p+1)|32)===e.charCodeAt(1)){S(2);let o=z(R(Fr(t=m.number[e])));return[,parseInt(o,t)]}return $()}};var rr=92,J=34,V=39,Y=117,Z=120,tr=123,Ur=125,j=10,Ir=13,Tr={n:`
4
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},a=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,b=r=>{if(l.charCodeAt(r)!==rr)return;let t=l.charCodeAt(r+1);if(t===Z||t===Y&&l.charCodeAt(r+2)!==tr){let e=t===Z?2:4,o=0,n;for(let s=0;s<e;s++){if((n=a(l.charCodeAt(r+2+s)))<0)return;o=o*16+n}return[o,2+e]}if(t===Y){let e=0,o=r+3,n;for(;(n=a(l.charCodeAt(o)))>=0;)e=e*16+n,o++;if(o>r+3&&e<=1114111&&l.charCodeAt(o)===Ur)return[e,o-r+1]}},Lr=()=>{let r=l.charCodeAt(p+1);if(r===j)return["",2];if(r===Ir)return["",l.charCodeAt(p+2)===j?3:2];let t=b(p);if(t){let[e,o]=t;if(e>=55296&&e<=56319){let n=b(p+o);n&&n[0]>=56320&&n[0]<=57343&&(e=65536+(e-55296)*1024+n[0]-56320,o+=n[1])}return[String.fromCodePoint(e),o]}return[Tr[l[p+1]]||l[p+1],2]},Nr=(r,t=!1)=>{let e=p,o,n;for(;(n=l.charCodeAt(p))-r&&!(t&&(n===0||n===36&&l.charCodeAt(p+1)===tr));){if(n!==rr){S();continue}o||(o=[]),o.push(l.slice(e,p));let[c,d]=Lr();o.push(c),S(d),e=p}let s=l.slice(e,p);return o?(o.push(s),o.join("")):s},er=r=>(t,e,o="",n=String.fromCharCode(r))=>{if(!(t||!m.string?.[n]))return S(),o+=Nr(r),l[p]===n?S():E("Bad string"),[,o]};C[J]=er(J);C[V]=er(V);m.string={'"':!0};var Mr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>f(r,Mr,!0));var xr=30,Or=40,$r=140;y("!",$r);f("||",xr);f("&&",Or);var Xr=50,kr=60,Br=70,or=100,Qr=140;f("|",Xr);f("&",Br);f("^",kr);f(">>",or);f("<<",or);y("~",Qr);var _=90;f("<",_);f(">",_);f("<=",_);f(">=",_);var nr=80;f("==",nr);f("!=",nr);var ir=110,X=120,sr=140;f("+",ir);f("-",ir);f("*",X);f("/",X);f("%",X);y("+",sr);y("-",sr);var F=150;g("++",F,r=>r?["++",r,null]:["++",A(F-1)]);g("--",F,r=>r?["--",r,null]:["--",A(F-1)]);var Gr=5,Hr=10;M(",",Hr);M(";",Gr,!0,!0);var Kr=170;G("()",Kr);var pr=170,vr=160;x("[]",pr);H(".",pr);x("()",vr);var ur=(r,t,e,o)=>typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="()"&&r.length===2?ur(r[1],t):(()=>{throw Error("Invalid assignment target")})(),lr={"=":(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 lr)u(r,(t,e)=>(e=i(e),ur(t,(o,n,s)=>lr[r](o,n,e(s)))));u("!",r=>(r=i(r),t=>!r(t)));u("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));u("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));u("~",r=>(r=i(r),t=>~r(t)));u("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));u("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));u("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));u(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));u("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));u(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));u("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));u(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));u("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));u("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));u("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));u("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));u("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));u("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));u("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));u("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var k=(r,t,e,o)=>typeof r=="string"?n=>t(n,r):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o)):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n))):r[0]==="()"&&r.length===2?k(r[1],t):(()=>{throw Error("Invalid increment target")})();u("++",(r,t)=>k(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));u("--",(r,t)=>k(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var mr=(...r)=>(r=r.map(i),t=>{let e;for(let o of r)e=o(t);return e});u(",",mr);u(";",mr);var cr=r=>r!=null&&(typeof r=="object"||typeof r=="function"),I=r=>cr(r)?Reflect.ownKeys({[r]:0})[0]:r,P=r=>typeof r=="string"&&(r[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype"),Wr=r=>P(I(r));i.id=r=>r===void 0||Wr(r)?()=>{}:t=>t?.[r];var U=r=>{throw Error(r)};u("[]",(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]),o=>e(o)):(e=i(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&U("Missing index"),r=i(r),t=i(t),e=>{let o=I(t(e));return P(o)?void 0:r(e)[o]}));u(".",(r,t)=>(r=i(r),t=I(t[0]?t:t[1]),P(t)?()=>{}:e=>r(e)[t]));u("()",(r,t)=>{if(t===void 0)return r==null?U("Empty ()"):i(r);let e=s=>s?.[0]===","&&s.slice(1).some(c=>c==null||e(c));e(t)&&U("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(i),s=>t.map(c=>c(s))):(t=i(t),s=>[t(s)]):()=>[],n=dr(r);return n<0?()=>{}:fr(r,n?(s,c,d)=>(c=I(c),P(c)?void 0:s[c](...o(d))):(s,c,d)=>s[c](...o(d)))});var fr=(r,t,e,o)=>r==null?U("Empty ()"):r[0]==="()"&&r.length==2?fr(r[1],t):typeof r=="string"?n=>t(n,r,n):r[0]==="."?(e=i(r[1]),o=r[2],n=>t(e(n),o,n)):r[0]==="?."?(e=i(r[1]),o=r[2],n=>{let s=e(n);return s==null?void 0:t(s,o,n)}):r[0]==="[]"&&r.length===3?(e=i(r[1]),o=i(r[2]),n=>t(e(n),o(n),n)):r[0]==="?.[]"?(e=i(r[1]),o=i(r[2]),n=>{let s=e(n);return s==null?void 0:t(s,o(n),n)}):(r=i(r),n=>t([r(n)],0,n)),B=r=>cr(r)?1:P(r)?-1:0,dr=(r,t=r?.[0],e=r?.[2])=>typeof r=="string"?B(r):t==="()"&&r.length==2?dr(r[1]):t==="."||t==="?."?B(e):(t==="[]"||t==="?.[]")&&r.length===3?Array.isArray(e)&&e[0]==null?B(e[1]):1:0;var hr=new WeakMap,qr=(r,...t)=>typeof r=="string"?i(m(r)):hr.get(r)||hr.set(r,zr(r,t)).get(r),Ar=57344,zr=(r,t)=>{let e=r.reduce((s,c,d)=>s+(d?String.fromCharCode(Ar+d-1):"")+c,""),o=m(e),n=s=>{if(typeof s=="string"&&s.length===1){let c=s.charCodeAt(0)-Ar,d;if(c>=0&&c<t.length)return d=t[c],Jr(d)?d:[,d]}return Array.isArray(s)?s.map(n):s};return i(n(o))},Jr=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Zt=qr;export{x as access,f as binary,i as compile,l as cur,Zt as default,E as err,A as expr,G as group,Yr as id,p as idx,br as keyword,ar as literal,Cr as loc,C as lookup,H as member,M as nary,R as next,u as operator,N as operators,jr as parens,m as parse,gr as peek,L as prec,Er as propName,Vr as seek,S as skip,g as token,y as unary,Zr as word};