subscript 10.4.7 → 10.4.9

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/README.md CHANGED
@@ -122,21 +122,33 @@ subscript('constructor.constructor("alert(1)")()')({})
122
122
 
123
123
  ## Performance
124
124
 
125
+ Parsing `a + b * c - d / e + f.g[0](h) + i.j`, 30k iterations:
126
+
125
127
  ```
126
- Parse 30k:
127
- subscript 150ms
128
- justin 183ms
129
- jsep 270ms
130
- expr-eval 480ms
131
- jexl 1056ms
132
-
133
- Eval 30k:
134
- new Function 7ms
135
- subscript 15ms
136
- jsep+eval 30ms
137
- expr-eval 72ms
128
+ Parse:
129
+ new Function 8ms
130
+ subscript 34ms
131
+ cel-js 39ms
132
+ angular-expr 42ms
133
+ justin 51ms
134
+ jsep 54ms
135
+ jessie 76ms ← JS subset (statements + functions)
136
+ expr-eval 81ms
137
+ oxc 84ms ← full JS parser (native Rust)
138
+ mathjs 185ms
139
+ jexl 403ms
140
+
141
+ Eval:
142
+ subscript 3ms
143
+ new Function 4ms
144
+ cel-js 13ms
145
+ expression-eval 14ms
146
+ mathjs 17ms
147
+ angular-expr 62ms
138
148
  ```
139
149
 
150
+ Run via `node --import ./test/https-loader.js test/benchmark.js`.
151
+
140
152
  ## Utils
141
153
 
142
154
  ### Codegen
@@ -4,7 +4,7 @@
4
4
  * { get x() { body } } → ['{}', ['get', 'x', body]]
5
5
  * { set x(v) { body } } → ['{}', ['set', 'x', 'v', body]]
6
6
  */
7
- import { token, expr, skip, space, next, parse, cur, idx } from '../parse.js';
7
+ import { token, expr, skip, next, parse, cur, idx } from '../parse.js';
8
8
 
9
9
  const ASSIGN = 20;
10
10
  const LF = 10, CR = 13;
@@ -23,15 +23,15 @@ const hasLineTerminator = (from, to) => {
23
23
  const accessor = (kind) => a => {
24
24
  if (a) return; // not prefix
25
25
  const from = idx;
26
- space();
26
+ parse.space();
27
27
  if (parse.semi || hasLineTerminator(from, idx)) return false;
28
28
  const name = next(parse.id);
29
29
  if (!name) return false; // no property name = not accessor (e.g. `{ get: 1 }`)
30
- space();
30
+ parse.space();
31
31
  if (cur.charCodeAt(idx) !== OPAREN) return false; // not followed by ( = not accessor
32
32
  skip();
33
33
  const params = expr(0, CPAREN);
34
- space();
34
+ parse.space();
35
35
  if (cur.charCodeAt(idx) !== OBRACE) return false;
36
36
  skip();
37
37
  return [kind, name, params, expr(0, CBRACE)];
@@ -40,15 +40,21 @@ const accessor = (kind) => a => {
40
40
  token('get', ASSIGN - 1, accessor('get'));
41
41
  token('set', ASSIGN - 1, accessor('set'));
42
42
 
43
- // Method shorthand: { foo() {} } [':', 'foo', ['=>', ['()', params], body]]
44
- // Uses token() infix handler - returns undefined to fall through to function call
43
+ // Method shorthand: { foo() {} } / { "foo"() {} } / class { static foo() {} }
44
+ // [':', key, ['=>', ['()', params], body]]
45
+ // Accepts identifier, string-literal node [, "..."], or ['static', key] from unary('static').
45
46
  token('(', ASSIGN - 1, a => {
46
- // Only handle infix position with plain identifier in low-precedence context (object literal)
47
- if (!a || typeof a !== 'string') return;
47
+ if (!a) return;
48
+ // ['static', key] from unary('static'): unwrap, re-wrap the resulting method node.
49
+ let wrap;
50
+ if (Array.isArray(a) && a[0] === 'static') wrap = 'static', a = a[1];
51
+ // Accept identifier or string-literal node as key
52
+ if (typeof a !== 'string' && !(Array.isArray(a) && a[0] === undefined)) return;
48
53
  const params = expr(0, CPAREN) || null;
49
- space();
54
+ parse.space();
50
55
  // Not followed by { - not method shorthand, fall through
51
56
  if (cur.charCodeAt(idx) !== OBRACE) return;
52
57
  skip();
53
- return [':', a, ['=>', ['()', params], expr(0, CBRACE) || null]];
58
+ const node = [':', a, ['=>', ['()', params], expr(0, CBRACE) || null]];
59
+ return wrap ? [wrap, node] : node;
54
60
  });
package/feature/async.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Async/await/yield: async function, async arrow, await, yield expressions - parse half
2
- import { unary, expr, skip, space, keyword, cur, idx, word } from '../parse.js';
2
+ import { parse, unary, expr, skip, keyword, cur, idx, word } from '../parse.js';
3
3
 
4
4
  const PREFIX = 140, ASSIGN = 20;
5
5
 
@@ -9,10 +9,10 @@ unary('await', PREFIX);
9
9
  // yield expr → ['yield', expr]
10
10
  // yield* expr → ['yield*', expr]
11
11
  keyword('yield', PREFIX, () => {
12
- space();
12
+ parse.space();
13
13
  if (cur[idx] === '*') {
14
14
  skip();
15
- space();
15
+ parse.space();
16
16
  return ['yield*', expr(ASSIGN)];
17
17
  }
18
18
  return ['yield', expr(ASSIGN)];
@@ -22,7 +22,7 @@ keyword('yield', PREFIX, () => {
22
22
  // async () => {} → ['async', ['=>', params, body]]
23
23
  // async x => {} → ['async', ['=>', x, body]]
24
24
  keyword('async', PREFIX, () => {
25
- space();
25
+ parse.space();
26
26
  // async function - check for 'function' word
27
27
  if (word('function')) return ['async', expr(PREFIX)];
28
28
  // async arrow: async () => or async x =>
package/feature/class.js CHANGED
@@ -1,12 +1,14 @@
1
1
  // Class declarations and expressions - parse half
2
2
  // class A extends B { ... }
3
- import { binary, unary, token, expr, space, next, parse, keyword, word, skip } from '../parse.js';
3
+ import { binary, unary, token, expr, next, parse, keyword, word, skip } from '../parse.js';
4
4
  import { block } from './if.js';
5
5
 
6
- const TOKEN = 200, PREFIX = 140, COMP = 90;
6
+ const TOKEN = 200, PREFIX = 140, COMP = 90, STATIC = 175;
7
7
 
8
8
  // static member → ['static', member]
9
- unary('static', PREFIX);
9
+ // STATIC > ACCESS (170) so `static m` doesn't pull `(` into the operand as a
10
+ // function call — leaves the `(` for the outer method-shorthand handler.
11
+ unary('static', STATIC);
10
12
 
11
13
  // instanceof: object instanceof Constructor
12
14
  binary('instanceof', COMP);
@@ -20,17 +22,17 @@ token('#', TOKEN, a => {
20
22
 
21
23
  // class [Name] [extends Base] { body }
22
24
  keyword('class', TOKEN, () => {
23
- space();
25
+ parse.space();
24
26
  let name = next(parse.id) || null;
25
27
  // 'extends' parsed as name? → anonymous class
26
28
  if (name === 'extends') {
27
29
  name = null;
28
- space();
30
+ parse.space();
29
31
  } else {
30
- space();
32
+ parse.space();
31
33
  if (!word('extends')) return ['class', name, null, block()];
32
34
  skip(7); // skip 'extends'
33
- space();
35
+ parse.space();
34
36
  }
35
37
  return ['class', name, expr(TOKEN), block()];
36
38
  });
@@ -1,20 +1,20 @@
1
1
  // Function declarations and expressions - parse half
2
- import { space, next, parse, keyword, parens, cur, idx, skip } from '../parse.js';
2
+ import { next, parse, keyword, parens, cur, idx, skip } from '../parse.js';
3
3
  import { block } from './if.js';
4
4
 
5
5
  const TOKEN = 200;
6
6
 
7
7
  keyword('function', TOKEN, () => {
8
- space();
8
+ parse.space();
9
9
  // Check for generator: function*
10
10
  let generator = false;
11
11
  if (cur[idx] === '*') {
12
12
  generator = true;
13
13
  skip();
14
- space();
14
+ parse.space();
15
15
  }
16
16
  const name = next(parse.id);
17
- name && space();
17
+ name && parse.space();
18
18
  const node = generator ? ['function*', name, parens() || null, block()] : ['function', name, parens() || null, block()];
19
19
  return node;
20
20
  });
package/feature/if.js CHANGED
@@ -1,28 +1,28 @@
1
1
  // If/else statement - parse half. else consumed internally.
2
- import { space, skip, expr, err, keyword, parens, word, idx, seek } from '../parse.js';
2
+ import { parse, skip, expr, err, keyword, parens, word, idx, seek } from '../parse.js';
3
3
 
4
4
  const STATEMENT = 5, SEMI = 59;
5
5
 
6
6
  // block() - parse required { body }
7
7
  export const block = () =>
8
- (space() === 123 || err('Expected {'), skip(), expr(STATEMENT - .5, 125) || null);
8
+ (parse.space() === 123 || err('Expected {'), skip(), expr(STATEMENT - .5, 125) || null);
9
9
 
10
10
  // body() - parse { body } or single statement
11
11
  export const body = () =>
12
- space() !== 123 ? expr(STATEMENT + .5) : (skip(), expr(STATEMENT - .5, 125) || null);
12
+ parse.space() !== 123 ? expr(STATEMENT + .5) : (skip(), expr(STATEMENT - .5, 125) || null);
13
13
 
14
14
  // Check for `else` after optional semicolon
15
15
  const checkElse = () => {
16
16
  const from = idx;
17
- if (space() === SEMI) skip();
18
- space();
17
+ if (parse.space() === SEMI) skip();
18
+ parse.space();
19
19
  if (word('else')) return skip(4), true;
20
20
  return seek(from), false;
21
21
  };
22
22
 
23
23
  // if (cond) body [else body] - self-contained
24
24
  keyword('if', STATEMENT + 1, () => {
25
- space();
25
+ parse.space();
26
26
  const node = ['if', parens(), body()];
27
27
  if (checkElse()) node.push(body());
28
28
  return node;
package/feature/loop.js CHANGED
@@ -1,19 +1,19 @@
1
1
  // Loops: while, do-while, for, for await, break, continue, return - parse half
2
- import { expr, skip, space, parse, word, keyword, parens, cur, idx, next, seek } from '../parse.js';
2
+ import { expr, skip, parse, word, keyword, parens, cur, idx, next, seek } from '../parse.js';
3
3
  import { body } from './if.js';
4
4
 
5
5
  const STATEMENT = 5, CBRACE = 125, SEMI = 59;
6
6
 
7
- keyword('while', STATEMENT + 1, () => (space(), ['while', parens(), body()]));
8
- keyword('do', STATEMENT + 1, () => (b => (space(), skip(5), space(), ['do', b, parens()]))(body()));
7
+ keyword('while', STATEMENT + 1, () => (parse.space(), ['while', parens(), body()]));
8
+ keyword('do', STATEMENT + 1, () => (b => (parse.space(), skip(5), parse.space(), ['do', b, parens()]))(body()));
9
9
 
10
10
  // for / for await
11
11
  keyword('for', STATEMENT + 1, () => {
12
- space();
12
+ parse.space();
13
13
  // for await (x of y)
14
14
  if (word('await')) {
15
15
  skip(5);
16
- return (space(), ['for await', parens(), body()]);
16
+ return (parse.space(), ['for await', parens(), body()]);
17
17
  }
18
18
  return ['for', parens(), body()];
19
19
  });
@@ -21,13 +21,13 @@ keyword('for', STATEMENT + 1, () => {
21
21
  keyword('break', STATEMENT + 1, () => {
22
22
  parse.asi && (parse.newline = false);
23
23
  const from = idx;
24
- space();
24
+ parse.space();
25
25
  const c = cur.charCodeAt(idx);
26
26
  if (!c || c === CBRACE || c === SEMI || parse.newline) return ['break'];
27
27
  const label = next(parse.id);
28
28
  if (!label) return ['break'];
29
29
  // Label must be followed by end/semicolon/newline, not another token
30
- space();
30
+ parse.space();
31
31
  const cc = cur.charCodeAt(idx);
32
32
  if (!cc || cc === CBRACE || cc === SEMI || parse.newline) return ['break', label];
33
33
  // Not a valid label - backtrack
@@ -37,12 +37,12 @@ keyword('break', STATEMENT + 1, () => {
37
37
  keyword('continue', STATEMENT + 1, () => {
38
38
  parse.asi && (parse.newline = false);
39
39
  const from = idx;
40
- space();
40
+ parse.space();
41
41
  const c = cur.charCodeAt(idx);
42
42
  if (!c || c === CBRACE || c === SEMI || parse.newline) return ['continue'];
43
43
  const label = next(parse.id);
44
44
  if (!label) return ['continue'];
45
- space();
45
+ parse.space();
46
46
  const cc = cur.charCodeAt(idx);
47
47
  if (!cc || cc === CBRACE || cc === SEMI || parse.newline) return ['continue', label];
48
48
  seek(from);
@@ -50,6 +50,6 @@ keyword('continue', STATEMENT + 1, () => {
50
50
  });
51
51
  keyword('return', STATEMENT + 1, () => {
52
52
  parse.asi && (parse.newline = false);
53
- const c = space();
53
+ const c = parse.space();
54
54
  return !c || c === CBRACE || c === SEMI || parse.newline ? ['return'] : ['return', expr(STATEMENT)];
55
55
  });
package/feature/module.js CHANGED
@@ -8,7 +8,7 @@
8
8
  * export { a } from './x' → ['export', ['from', ['{}', ...], path]]
9
9
  * export const x = 1 → ['export', decl]
10
10
  */
11
- import { token, expr, space, keyword, lookup, skip, word } from '../parse.js';
11
+ import { parse, token, expr, keyword, lookup, skip, word } from '../parse.js';
12
12
 
13
13
  const STATEMENT = 5, SEQ = 10, STAR = 42;
14
14
 
@@ -17,10 +17,10 @@ const prevStar = lookup[STAR];
17
17
  lookup[STAR] = (a, prec) => !a ? (skip(), '*') : prevStar?.(a, prec);
18
18
 
19
19
  // 'from' as contextual binary - only after import-like LHS (not = or ,), false in prefix for identifier fallback
20
- token('from', SEQ + 1, a => !a ? false : a[0] !== '=' && a[0] !== ',' && (space(), ['from', a, expr(SEQ + 1)]));
20
+ token('from', SEQ + 1, a => !a ? false : a[0] !== '=' && a[0] !== ',' && (parse.space(), ['from', a, expr(SEQ + 1)]));
21
21
 
22
22
  // 'as' for aliasing: * as X, { a as b }. False in prefix for identifier fallback
23
- token('as', SEQ + 2, a => !a ? false : (space(), ['as', a, expr(SEQ + 2)]));
23
+ token('as', SEQ + 2, a => !a ? false : (parse.space(), ['as', a, expr(SEQ + 2)]));
24
24
 
25
25
  // import: prefix that parses specifiers + from + path
26
26
  // import.meta returns ['import.meta']
@@ -31,7 +31,7 @@ keyword('import', STATEMENT, () => (
31
31
  // export: prefix for declarations or re-exports (use STATEMENT to capture const/let/function).
32
32
  // `export default X` is recognized inline; outside `export`, `default` stays an identifier.
33
33
  keyword('export', STATEMENT, () => (
34
- space(),
34
+ parse.space(),
35
35
  word('default')
36
36
  ? (skip(7), ['export', ['default', expr(SEQ)]])
37
37
  : ['export', expr(STATEMENT)]
@@ -5,13 +5,13 @@
5
5
  * a?.[x] → optional computed access
6
6
  * a?.() → optional call
7
7
  */
8
- import { token, expr, skip, space } from '../../parse.js';
8
+ import { parse, token, expr, skip } from '../../parse.js';
9
9
 
10
10
  const ACCESS = 170;
11
11
 
12
12
  token('?.', ACCESS, (a, b) => {
13
13
  if (!a) return;
14
- const cc = space();
14
+ const cc = parse.space();
15
15
  // Optional call: a?.()
16
16
  if (cc === 40) { skip(); return ['?.()', a, expr(0, 41) || null]; }
17
17
  // Optional computed: a?.[x]
package/feature/regex.js CHANGED
@@ -11,26 +11,15 @@
11
11
  */
12
12
  import { token, skip, err, next, idx, cur } from '../parse.js';
13
13
 
14
- const PREFIX = 140, SLASH = 47, BSLASH = 92;
14
+ const SLASH = 47, BSLASH = 92;
15
15
 
16
- const regexChar = c => c === BSLASH ? 2 : c && c !== SLASH; // \x = 2 chars, else 1 until /
17
- const regexFlag = c => c === 103 || c === 105 || c === 109 || c === 115 || c === 117 || c === 121; // g i m s u y
18
-
19
- token('/', PREFIX, a => {
20
- if (a) return; // has left operand = division, fall through
21
-
22
- // Invalid regex start (quantifiers) or /= - fall through
23
- const first = cur.charCodeAt(idx);
24
- if (first === SLASH || first === 42 || first === 43 || first === 63 || first === 61) return;
25
-
26
- const pattern = next(regexChar);
16
+ token('/', 140, a => {
17
+ // left operand = division; `//` `/*` `/?` `/+` `/=` = not a regex start
18
+ const c = cur.charCodeAt(idx);
19
+ if (a || c === SLASH || c === 42 || c === 43 || c === 63 || c === 61) return;
20
+ const pattern = next(c => c === BSLASH ? 2 : c && c !== SLASH); // \x = 2 chars, else 1 until /
27
21
  cur.charCodeAt(idx) === SLASH || err('Unterminated regex');
28
- skip(); // consume closing /
29
-
30
- const flags = next(regexFlag);
31
- // Validate regex syntax
32
- try { new RegExp(pattern, flags); }
33
- catch (e) { err('Invalid regex: ' + e.message); }
34
-
22
+ skip();
23
+ const flags = next(c => c === 103 || c === 105 || c === 109 || c === 115 || c === 117 || c === 121); // gimsuy
35
24
  return flags ? ['//', pattern, flags] : ['//', pattern];
36
25
  });
@@ -1,7 +1,7 @@
1
1
  // Additional JS statements: debugger, with (parse-only)
2
2
  // debugger → ['debugger']
3
3
  // with (obj) body → ['with', obj, body]
4
- import { space, keyword, parens } from '../parse.js';
4
+ import { parse, keyword, parens } from '../parse.js';
5
5
  import { body } from './if.js';
6
6
 
7
7
  const STATEMENT = 5;
@@ -10,4 +10,4 @@ const STATEMENT = 5;
10
10
  keyword('debugger', STATEMENT + 1, () => ['debugger']);
11
11
 
12
12
  // with statement
13
- keyword('with', STATEMENT + 1, () => (space(), ['with', parens(), body()]));
13
+ keyword('with', STATEMENT + 1, () => (parse.space(), ['with', parens(), body()]));
package/feature/switch.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Switch/case/default - parse half
2
2
  // AST: ['switch', val, ['case', test, body], ['default', body], ...]
3
- import { expr, skip, space, keyword, parens, idx, err, seek, lookup, word } from '../parse.js';
3
+ import { parse, expr, skip, keyword, parens, idx, err, seek, lookup, word } from '../parse.js';
4
4
 
5
5
  const STATEMENT = 5, ASSIGN = 20, COLON = 58, SEMI = 59, CBRACE = 125;
6
6
 
@@ -17,7 +17,7 @@ reserve('default');
17
17
  // caseBody() - parse statements until next case/default/}
18
18
  const caseBody = (c) => {
19
19
  const stmts = [];
20
- while ((c = space()) !== CBRACE && !word('case') && !word('default')) {
20
+ while ((c = parse.space()) !== CBRACE && !word('case') && !word('default')) {
21
21
  if (c === SEMI) { skip(); continue; }
22
22
  stmts.push(expr(STATEMENT - .5)) || err();
23
23
  }
@@ -26,18 +26,18 @@ const caseBody = (c) => {
26
26
 
27
27
  // switchBody() - parse case/default statements
28
28
  const switchBody = () => {
29
- space() === 123 || err('Expected {'); skip();
29
+ parse.space() === 123 || err('Expected {'); skip();
30
30
  inSwitch++;
31
31
  const cases = [];
32
32
  try {
33
- while (space() !== CBRACE) {
33
+ while (parse.space() !== CBRACE) {
34
34
  if (word('case')) {
35
- seek(idx + 4); space();
35
+ seek(idx + 4); parse.space();
36
36
  const test = expr(ASSIGN - .5);
37
- space() === COLON && skip();
37
+ parse.space() === COLON && skip();
38
38
  cases.push(['case', test, caseBody()]);
39
39
  } else if (word('default')) {
40
- seek(idx + 7); space() === COLON && skip();
40
+ seek(idx + 7); parse.space() === COLON && skip();
41
41
  cases.push(['default', caseBody()]);
42
42
  } else err('Expected case or default');
43
43
  }
@@ -47,4 +47,4 @@ const switchBody = () => {
47
47
  };
48
48
 
49
49
  // switch (x) { ... }
50
- keyword('switch', STATEMENT + 1, () => space() === 40 && ['switch', parens(), ...switchBody()]);
50
+ keyword('switch', STATEMENT + 1, () => parse.space() === 40 && ['switch', parens(), ...switchBody()]);
package/feature/try.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // try/catch/finally/throw statements - parse half
2
2
  // AST (faithful): ['try', body, ['catch', param, handler]?, ['finally', cleanup]?]
3
- import { space, parse, keyword, parens, expr, word, skip, peek } from '../parse.js';
3
+ import { parse, keyword, parens, expr, word, skip, peek } from '../parse.js';
4
4
  import { block } from './if.js';
5
5
 
6
6
  const STATEMENT = 5;
@@ -8,13 +8,13 @@ const STATEMENT = 5;
8
8
  // try { body } [catch (param) { handler }] [finally { cleanup }]
9
9
  keyword('try', STATEMENT + 1, () => {
10
10
  const node = ['try', block()];
11
- space();
11
+ parse.space();
12
12
  if (word('catch')) {
13
- skip(5); space();
13
+ skip(5); parse.space();
14
14
  // ES2019 optional catch binding: `catch { ... }` (no parameter)
15
15
  node.push(['catch', peek() === 40 ? parens() : null, block()]);
16
16
  }
17
- space();
17
+ parse.space();
18
18
  if (word('finally')) {
19
19
  skip(7);
20
20
  node.push(['finally', block()]);
@@ -24,7 +24,7 @@ keyword('try', STATEMENT + 1, () => {
24
24
 
25
25
  keyword('throw', STATEMENT + 1, () => {
26
26
  parse.asi && (parse.newline = false);
27
- space();
27
+ parse.space();
28
28
  if (parse.newline) throw SyntaxError('Unexpected newline after throw');
29
29
  return ['throw', expr(STATEMENT)];
30
30
  });
package/jessie.min.js CHANGED
@@ -1,9 +1,9 @@
1
- var u,c,m=r=>(u=0,c=r,m.enter?.(),r=A(),c[u]?R():r||""),R=(r="Unexpected token",e=u,t=c.slice(0,e).split(`
2
- `),o=t.pop(),n=c.slice(Math.max(0,e-40),e),s="\u032D",l=(c[e]||" ")+s,f=c.slice(e+1,e+20))=>{throw SyntaxError(`${r} at ${t.length+1}:${o.length+1}
1
+ var l,c,s=r=>(l=0,c=r,s.enter?.(),r=h(),c[l]?N():r||""),N=(r="Unexpected token",e=l,t=c.slice(0,e).split(`
2
+ `),o=t.pop(),n=c.slice(Math.max(0,e-40),e),p="\u032D",m=(c[e]||" ")+p,u=c.slice(e+1,e+20))=>{throw SyntaxError(`${r} at ${t.length+1}:${o.length+1}
3
3
  ${c[e-41]!==`
4
- `,""+n}${l}${f}`)},Mr=(r,e=u)=>(Array.isArray(r)&&(r.loc=e),r),N=(r,e=u,t)=>{for(;t=r(c.charCodeAt(u));)u+=t;return c.slice(e,u)},h=(r=1)=>c[u+=r],P=r=>u=r,A=(r=0,e)=>{let t,o,n;for(e&&m.enter?.(r,e);(t=a())&&t!==e&&(n=fr(o,r,t,A));)o=n;return e&&(t==e?(u++,m.exit?.(r,e)):R("Unclosed "+String.fromCharCode(e-(e>42?2:1)))),o},fr=(r,e,t,o,n)=>(n=T[t])&&n(r,e)||(r?null:N(m.id)||null),a=r=>{for(;(r=c.charCodeAt(u))<=32;)u++;return r},Y=(r=u)=>{for(;c.charCodeAt(r)<=32;)r++;return c.charCodeAt(r)},qt=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,I=(r,e=r.length)=>c.substr(u,e)===r&&!m.id(c.charCodeAt(u+e)),v=()=>(h(),A(0,41)),T=[],$={},k=(r,e=32,t,o=r.charCodeAt(0),n=r.length,s=T[o],l=r.toUpperCase()!==r,f,d)=>(e=$[r]=!s&&$[r]||e,T[o]=(g,E,S,w=u)=>(f=S,(S?r==S:(n<2||r.charCodeAt(1)===c.charCodeAt(u+1)&&(n<3||c.substr(u,n)==r))&&(!l||!m.id(c.charCodeAt(u+n)))&&(f=S=r))&&E<e&&(u+=n,(d=t(g))?Mr(d,w):(u=w,f=0,!l&&!s&&!g&&R()),d)||s?.(g,E,f))),y=(r,e,t=!1)=>k(r,e,o=>o&&(n=>n&&[r,o,n])(A(e-(t?.5:0)))),O=(r,e,t)=>k(r,e,o=>t?o&&[r,o]:!o&&(o=A(e-.5))&&[r,o]),j=(r,e)=>k(r,200,t=>!t&&[,e]),lr=(r,e,t)=>k(r,e,(o,n)=>(n=A(e-(t?.5:0)),o?.[0]!==r&&(o=[r,o||null]),n?.[0]===r?o.push(...n.slice(1)):o.push(n||null),o)),x=(r,e)=>k(r[0],e,t=>!t&&[r,A(0,r.charCodeAt(1))||null]),mr=(r,e)=>k(r[0],e,t=>t&&[r,t,A(0,r.charCodeAt(1))||null]),C=(r,e,t,o=r.charCodeAt(0),n=r.length,s=T[o],l)=>T[o]=(f,d,g,E=u)=>!f&&(g?r==g:(n<2||c.substr(u,n)==r)&&(g=r))&&d<e&&!m.id(c.charCodeAt(u+n))&&(!m.prop||m.prop(u+n))&&(P(u+n),(l=t())?Mr(l,E):P(E),l)||s?.(f,d,g);Object.defineProperty(m,"space",{configurable:!0,enumerable:!0,get:()=>a,set:r=>a=r});Object.defineProperty(m,"step",{configurable:!0,enumerable:!0,get:()=>fr,set:r=>fr=r});var ur={},p=(r,e,t=ur[r])=>ur[r]=(...o)=>e(...o)||t?.(...o),i=r=>Array.isArray(r)?r[0]==null?(e=>()=>e)(r[1]):ur[r[0]]?.(...r.slice(1))??R(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:e=>e?.[r];var q=46,W=48,b=57,Ce=69,we=101,Ee=43,Se=45,Z=95,Ur=110,ke=97,Ie=102,Te=65,Ne=70,Fr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),cr=r=>{let e=Fr(N(t=>t===q&&c.charCodeAt(u+1)!==q||t>=W&&t<=b||t===Z||((t===Ce||t===we)&&((t=c.charCodeAt(u+1))>=W&&t<=b||t===Ee||t===Se)?2:0)));return c.charCodeAt(u)===Ur?(h(),[,BigInt(e)]):(r=+e)!=r?R():[,r]},Re={2:r=>r===48||r===49||r===Z,8:r=>r>=48&&r<=55||r===Z,16:r=>r>=W&&r<=b||r>=ke&&r<=Ie||r>=Te&&r<=Ne||r===Z};m.number=null;T[q]=r=>!r&&c.charCodeAt(u+1)!==q&&cr();for(let r=W;r<=b;r++)T[r]=e=>e?void 0:cr();T[W]=r=>{if(r)return;let e=m.number;if(e){for(let[t,o]of Object.entries(e))if(t[0]==="0"&&c[u+1]?.toLowerCase()===t[1]){h(2);let n=Fr(N(Re[o]));return c.charCodeAt(u)===Ur?(h(),[,BigInt("0"+t[1]+n)]):[,parseInt(n,o)]}}return cr()};var _e=92,Dr=34,Gr=39,Xr=117,Kr=120,Oe=123,Pe=125,Hr=10,ve=13,Be={n:`
5
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},jr=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,Qr=r=>(e,t,o="",n=String.fromCharCode(r))=>{if(e||!m.string?.[n])return;h();let s=()=>{let l=c.charCodeAt(u+1);if(l===Hr)return 2;if(l===ve)return c.charCodeAt(u+2)===Hr?3:2;if(l===Kr||l===Xr&&c.charCodeAt(u+2)!==Oe){let f=l===Kr?2:4,d=0,g;for(let E=0;E<f;E++){if((g=jr(c.charCodeAt(u+2+E)))<0)return o+=c[u+1],2;d=d*16+g}return o+=String.fromCharCode(d),2+f}if(l===Xr){let f=0,d=u+3,g;for(;(g=jr(c.charCodeAt(d)))>=0;)f=f*16+g,d++;return d>u+3&&f<=1114111&&c.charCodeAt(d)===Pe?(o+=String.fromCodePoint(f),d-u+1):(o+=c[u+1],2)}return o+=Be[c[u+1]]||c[u+1],2};return N(l=>l-r&&(l!==_e?(o+=c[u],1):s())),c[u]===n?h():R("Bad string"),[,o]};T[Dr]=Qr(Dr);T[Gr]=Qr(Gr);m.string={'"':!0};var Le=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>y(r,Le,!0));var Me=30,Ue=40,Fe=140;O("!",Fe);y("||",Me);y("&&",Ue);var De=50,Ge=60,Xe=70,$r=100,Ke=140;y("|",De);y("&",Xe);y("^",Ge);y(">>",$r);y("<<",$r);O("~",Ke);var rr=90;y("<",rr);y(">",rr);y("<=",rr);y(">=",rr);var xr=80;y("==",xr);y("!=",xr);var Wr=110,dr=120,zr=140;y("+",Wr);y("-",Wr);y("*",dr);y("/",dr);y("%",dr);O("+",zr);O("-",zr);var er=150;k("++",er,r=>r?["++",r,null]:["++",A(er-1)]);k("--",er,r=>r?["--",r,null]:["--",A(er-1)]);var He=5,je=10;lr(",",je);lr(";",He,!0);var Qe=170;x("()",Qe);var ar=170;mr("[]",ar);y(".",ar);mr("()",ar);var $e=32,xe=m.space;m.comment??={"//":`
6
- `,"/*":"*/"};var hr;m.space=()=>{hr||(hr=Object.entries(m.comment).map(([n,s])=>[n,s,n.charCodeAt(0)]));for(var r;r=xe();){for(var e=0,t;t=hr[e++];)if(r===t[2]&&c.substr(u,t[0].length)===t[0]){var o=u+t[0].length;if(t[1]===`
7
- `)for(;c.charCodeAt(o)>=$e;)o++;else{for(;c[o]&&c.substr(o,t[1].length)!==t[1];)o++;c[o]&&(o+=t[1].length)}P(o),r=0;break}if(r)return r}return r};var Jr=80;y("===",Jr);y("!==",Jr);var We=30;y("??",We);var ze=130,Je=20;y("**",ze,!0);y("**=",Je,!0);var Vr=90;y("in",Vr);y("of",Vr);var Ve=20,Ye=100;y(">>>",Ye);y(">>>=",Ve,!0);var Ar=20;y("||=",Ar,!0);y("&&=",Ar,!0);y("??=",Ar,!0);j("true",!0);j("false",!1);j("null",null);C("undefined",200,()=>[]);j("NaN",NaN);j("Infinity",1/0);var yr=20;k("?",yr,(r,e,t)=>r&&(e=A(yr-1))&&N(o=>o===58)&&(t=A(yr-1),["?",r,e,t]));var Ze=20;y("=>",Ze,!0);var qe=20;O("...",qe);var Yr=170;k("?.",Yr,(r,e)=>{if(!r)return;let t=a();return t===40?(h(),["?.()",r,A(0,41)||null]):t===91?(h(),["?.[]",r,A(0,93)]):(e=A(Yr),e?["?.",r,e]:void 0)});var z=140;O("typeof",z);O("void",z);O("delete",z);C("new",z,()=>I(".target")?(h(7),["new.target"]):["new",A(z)]);var be=20,Zr=200;m.prop=r=>Y(r)!==58;x("[]",Zr);x("{}",Zr);y(":",be-1,!0);var rt=170,tr=96,et=36,tt=123,ot=92,nt={n:`
8
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},qr=()=>{let r=[];for(let e="",t;(t=c.charCodeAt(u))!==tr;)t?t===ot?(h(),e+=nt[c[u]]||c[u],h()):t===et&&c.charCodeAt(u+1)===tt?(e&&r.push([,e]),e="",h(2),r.push(A(0,125))):(e+=c[u],h(),t=c.charCodeAt(u),t===tr&&e&&r.push([,e])):R("Unterminated template");return h(),r},it=T[tr];T[tr]=(r,e)=>r&&e<rt?m.asi&&m.newline?void 0:(h(),["``",r,...qr()]):r?it?.(r,e):(h(),(t=>t.length<2&&t[0]?.[0]===void 0?t[0]||[,""]:["`",...t])(qr()));m.string["'"]=!0;m.number={"0x":16,"0b":2,"0o":8};var st=92,pt=117,ft=123,ut=125,lt=183,mt=m.id,br=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,ct=(r=u+2,e,t=0,o=0)=>{if(c.charCodeAt(u)!==st||c.charCodeAt(u+1)!==pt)return 0;if(c.charCodeAt(r)===ft){for(;br(e=c.charCodeAt(++r));)t=t*16+(e<=57?e-48:(e&31)+9);return r>u+3&&t<=1114111&&c.charCodeAt(r)===ut?r-u+1:0}for(;o<4&&br(c.charCodeAt(r+o));)o++;return o===4?6:0};m.id=r=>mt(r)||r===lt||ct();var gr=5,dt=10,Cr=r=>{let e=u,t=A(dt-1);return t==null?r:r==="let"&&(t==="in"||t==="of")?(P(e),r):t[0]==="in"||t[0]==="of"?[t[0],[r,t[1]],t[2]]:t[0]===","?[r,...t.slice(1)]:[r,t]};C("let",gr+1,()=>Cr("let"));C("const",gr+1,()=>Cr("const"));C("var",gr+1,()=>Cr("var"));var or=5,at=59,L=()=>(a()===123||R("Expected {"),h(),A(or-.5,125)||null),F=()=>a()!==123?A(or+.5):(h(),A(or-.5,125)||null),ht=()=>{let r=u;return a()===at&&h(),a(),I("else")?(h(4),!0):(P(r),!1)};C("if",or+1,()=>{a();let r=["if",v(),F()];return ht()&&r.push(F()),r});var At=200;C("function",At,()=>{a();let r=!1;c[u]==="*"&&(r=!0,h(),a());let e=N(m.id);return e&&a(),r?["function*",e,v()||null,L()]:["function",e,v()||null,L()]});var nr=140,wr=20;O("await",nr);C("yield",nr,()=>(a(),c[u]==="*"?(h(),a(),["yield*",A(wr)]):["yield",A(wr)]));C("async",nr,()=>{if(a(),I("function"))return["async",A(nr)];let r=A(wr-.5);return r&&["async",r]});var Er=200,yt=140,gt=90;O("static",yt);y("instanceof",gt);k("#",Er,r=>{if(r)return;let e=N(m.id);return e?"#"+e:void 0});C("class",Er,()=>{a();let r=N(m.id)||null;if(r==="extends")r=null,a();else{if(a(),!I("extends"))return["class",r,null,L()];h(7),a()}return["class",r,A(Er),L()]});var Ct=140,Sr=47,wt=92,Et=r=>r===wt?2:r&&r!==Sr,St=r=>r===103||r===105||r===109||r===115||r===117||r===121;k("/",Ct,r=>{if(r)return;let e=c.charCodeAt(u);if(e===Sr||e===42||e===43||e===63||e===61)return;let t=N(Et);c.charCodeAt(u)===Sr||R("Unterminated regex"),h();let o=N(St);try{new RegExp(t,o)}catch(n){R("Invalid regex: "+n.message)}return o?["//",t,o]:["//",t]});var H=5,J=125,V=59;C("while",H+1,()=>(a(),["while",v(),F()]));C("do",H+1,()=>(r=>(a(),h(5),a(),["do",r,v()]))(F()));C("for",H+1,()=>(a(),I("await")?(h(5),a(),["for await",v(),F()]):["for",v(),F()]));C("break",H+1,()=>{m.asi&&(m.newline=!1);let r=u;a();let e=c.charCodeAt(u);if(!e||e===J||e===V||m.newline)return["break"];let t=N(m.id);if(!t)return["break"];a();let o=c.charCodeAt(u);return!o||o===J||o===V||m.newline?["break",t]:(P(r),["break"])});C("continue",H+1,()=>{m.asi&&(m.newline=!1);let r=u;a();let e=c.charCodeAt(u);if(!e||e===J||e===V||m.newline)return["continue"];let t=N(m.id);if(!t)return["continue"];a();let o=c.charCodeAt(u);return!o||o===J||o===V||m.newline?["continue",t]:(P(r),["continue"])});C("return",H+1,()=>{m.asi&&(m.newline=!1);let r=a();return!r||r===J||r===V||m.newline?["return"]:["return",A(H)]});var kr=5;C("try",kr+1,()=>{let r=["try",L()];return a(),I("catch")&&(h(5),a(),r.push(["catch",Y()===40?v():null,L()])),a(),I("finally")&&(h(7),r.push(["finally",L()])),r});C("throw",kr+1,()=>{if(m.asi&&(m.newline=!1),a(),m.newline)throw SyntaxError("Unexpected newline after throw");return["throw",A(kr)]});var te=5,kt=20,re=58,It=59,oe=125,Ir=0,ne=(r,e=r.length,t=r.charCodeAt(0),o=T[t])=>T[t]=(n,s,l)=>I(r)&&!n&&Ir||o?.(n,s,l);ne("case");ne("default");var ee=r=>{let e=[];for(;(r=a())!==oe&&!I("case")&&!I("default");){if(r===It){h();continue}e.push(A(te-.5))||R()}return e.length>1?[";",...e]:e[0]||null},Tt=()=>{a()===123||R("Expected {"),h(),Ir++;let r=[];try{for(;a()!==oe;)if(I("case")){P(u+4),a();let e=A(kt-.5);a()===re&&h(),r.push(["case",e,ee()])}else I("default")?(P(u+7),a()===re&&h(),r.push(["default",ee()])):R("Expected case or default")}finally{Ir--}return h(),r};C("switch",te+1,()=>a()===40&&["switch",v(),...Tt()]);var ie=5;C("debugger",ie+1,()=>["debugger"]);C("with",ie+1,()=>(a(),["with",v(),F()]));var Tr=5,Q=10,se=42,Nt=T[se];T[se]=(r,e)=>r?Nt?.(r,e):(h(),"*");k("from",Q+1,r=>r?r[0]!=="="&&r[0]!==","&&(a(),["from",r,A(Q+1)]):!1);k("as",Q+2,r=>r?(a(),["as",r,A(Q+2)]):!1);C("import",Tr,()=>I(".meta")?(h(5),["import.meta"]):["import",A(Q)]);C("export",Tr,()=>(a(),I("default")?(h(7),["export",["default",A(Q)]]):["export",A(Tr)]));var Nr=20,Rt=10,_t=13,Ot=40,pe=41,fe=123,ue=125,Pt=(r,e)=>{for(;r<e;){let t=c.charCodeAt(r++);if(t===Rt||t===_t)return!0}return!1},le=r=>e=>{if(e)return;let t=u;if(a(),m.semi||Pt(t,u))return!1;let o=N(m.id);if(!o||(a(),c.charCodeAt(u)!==Ot))return!1;h();let n=A(0,pe);return a(),c.charCodeAt(u)!==fe?!1:(h(),[r,o,n,A(0,ue)])};k("get",Nr-1,le("get"));k("set",Nr-1,le("set"));k("(",Nr-1,r=>{if(!r||typeof r!="string")return;let e=A(0,pe)||null;if(a(),c.charCodeAt(u)===fe)return h(),[":",r,["=>",["()",e],A(0,ue)||null]]});m.comment["#!"]=`
9
- `;var ce=32,Pr=10,vt=59,Bt=125,Lt=91,Mt=40,Or=$.asi??$[";"],Ut=m._baseSpace??=m.space,Ft=m._baseStep??=m.step,Rr=r=>Array.isArray(r)||typeof r=="string",Dt=(r,e)=>{for(;(e=c.charCodeAt(r))<=ce;){if(e===Pr)return!0;r++}return!1},Gt=(r=u,e)=>{for(;r-- >0&&(e=c.charCodeAt(r))<=ce;)if(e===Pr)return!0;return!1};m.space=(r,e)=>{for(;;){for(e=u,r=Ut();e<u;)if(c.charCodeAt(e++)===Pr){m.newline=!0;break}if(r===vt&&Dt(u+1)){P(u+1),m.newline=m.semi=!0;continue}return r}};m.enter=()=>m.newline=m.semi=!1;m.exit=(r,e)=>{e===Bt&&(m.newline=!0,m.semi=!1)};m.step=(r,e,t,o)=>{if(m.semi&&e>=Or)return!1;if(r&&!Rr(r))return null;if(Rr(r)&&(m.semi||(t===Lt||t===Mt)&&Gt()))return me(r,e,o)??null;let n=m.newline;return Ft(r,e,t,o)??(Rr(r)&&n?me(r,e,o)??null:null)};var _r=0,Xt=2e3,me=m.asi=(r,e,t,o,n)=>{if(e>=Or||_r>=Xt)return;m.semi=!1;let s=u;_r++;try{o=t(Or-.5)}finally{_r--}if(!(!o||u===s))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var ae=(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?ae(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)p(r,(e,t)=>(t=i(t),ae(e,(o,n,s)=>de[r](o,n,t(s)))));p("!",r=>(r=i(r),e=>!r(e)));p("||",(r,e)=>(r=i(r),e=i(e),t=>r(t)||e(t)));p("&&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&&e(t)));p("~",r=>(r=i(r),e=>~r(e)));p("|",(r,e)=>(r=i(r),e=i(e),t=>r(t)|e(t)));p("&",(r,e)=>(r=i(r),e=i(e),t=>r(t)&e(t)));p("^",(r,e)=>(r=i(r),e=i(e),t=>r(t)^e(t)));p(">>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>e(t)));p("<<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<<e(t)));p(">",(r,e)=>(r=i(r),e=i(e),t=>r(t)>e(t)));p("<",(r,e)=>(r=i(r),e=i(e),t=>r(t)<e(t)));p(">=",(r,e)=>(r=i(r),e=i(e),t=>r(t)>=e(t)));p("<=",(r,e)=>(r=i(r),e=i(e),t=>r(t)<=e(t)));p("==",(r,e)=>(r=i(r),e=i(e),t=>r(t)==e(t)));p("!=",(r,e)=>(r=i(r),e=i(e),t=>r(t)!=e(t)));p("+",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)+e(t)):(r=i(r),t=>+r(t)));p("-",(r,e)=>e!==void 0?(r=i(r),e=i(e),t=>r(t)-e(t)):(r=i(r),t=>-r(t)));p("*",(r,e)=>(r=i(r),e=i(e),t=>r(t)*e(t)));p("/",(r,e)=>(r=i(r),e=i(e),t=>r(t)/e(t)));p("%",(r,e)=>(r=i(r),e=i(e),t=>r(t)%e(t)));var vr=(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?vr(r[1],e):(()=>{throw Error("Invalid increment target")})();p("++",(r,e)=>vr(r,e===null?(t,o)=>t[o]++:(t,o)=>++t[o]));p("--",(r,e)=>vr(r,e===null?(t,o)=>t[o]--:(t,o)=>--t[o]));var he=(...r)=>(r=r.map(i),e=>{let t;for(let o of r)t=o(e);return t});p(",",he);p(";",he);var D=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",ir=r=>{throw Error(r)};p("[]",(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&&ir("Missing index"),r=i(r),e=i(e),t=>{let o=e(t);return D(o)?void 0:r(t)[o]}));p(".",(r,e)=>(r=i(r),e=e[0]?e:e[1],D(e)?()=>{}:t=>r(t)[e]));p("()",(r,e)=>{if(e===void 0)return r==null?ir("Empty ()"):i(r);let t=n=>n?.[0]===","&&n.slice(1).some(s=>s==null||t(s));t(e)&&ir("Empty argument");let o=e?e[0]===","?(e=e.slice(1).map(i),n=>e.map(s=>s(n))):(e=i(e),n=>[e(n)]):()=>[];return Br(r,(n,s,l)=>n[s](...o(l)))});var M=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&M(r[1])||r[0]==="{}"),Br=(r,e,t,o)=>r==null?ir("Empty ()"):r[0]==="()"&&r.length==2?Br(r[1],e):typeof r=="string"?n=>e(n,r,n):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o,n)):r[0]==="?."?(t=i(r[1]),o=r[2],n=>{let s=t(n);return s==null?void 0:e(s,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 s=t(n);return s==null?void 0:e(s,o(n),n)}):(r=i(r),n=>e([r(n)],0,n)),G=Br;p("===",(r,e)=>(r=i(r),e=i(e),t=>r(t)===e(t)));p("!==",(r,e)=>(r=i(r),e=i(e),t=>r(t)!==e(t)));p("??",(r,e)=>(r=i(r),e=i(e),t=>r(t)??e(t)));var Kt=r=>{throw Error(r)};p("**",(r,e)=>(r=i(r),e=i(e),t=>r(t)**e(t)));p("**=",(r,e)=>(M(r)||Kt("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]**=e(n))));p("in",(r,e)=>(r=i(r),e=i(e),t=>r(t)in e(t)));var Ht=r=>{throw Error(r)};p(">>>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>>e(t)));p(">>>=",(r,e)=>(M(r)||Ht("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]>>>=e(n))));var jt=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,s=jt(n);if(o==="{}"){let l=[];for(let f of s){if(Array.isArray(f)&&f[0]==="..."){let w={};for(let _ in e)l.includes(_)||(w[_]=e[_]);t[f[1]]=w;break}let d,g,E;typeof f=="string"?d=g=f:f[0]==="="?(typeof f[1]=="string"?d=g=f[1]:[,d,g]=f[1],E=f[2]):[,d,g]=f,l.push(d);let S=e[d];S===void 0&&E&&(S=i(E)(t)),X(g,S,t)}}else if(o==="[]"){let l=0;for(let f of s){if(f===null){l++;continue}if(Array.isArray(f)&&f[0]==="..."){t[f[1]]=e.slice(l);break}let d=f,g;Array.isArray(f)&&f[0]==="="&&([,d,g]=f);let E=e[l++];E===void 0&&g&&(E=i(g)(t)),X(d,E,t)}}},Lr=(...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"?s=>{s[t]=n(s)}:s=>X(t,n(s),s)}return i(e)}),e=>{for(let t of r)t(e)});p("let",Lr);p("const",Lr);p("var",Lr);var sr=r=>{throw Error(r)};p("=",(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 M(r)||sr("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]=e(n))});p("||=",(r,e)=>(M(r)||sr("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]||=e(n))));p("&&=",(r,e)=>(M(r)||sr("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]&&=e(n))));p("??=",(r,e)=>(M(r)||sr("Invalid assignment target"),e=i(e),G(r,(t,o,n)=>t[o]??=e(n))));p("?",(r,e,t)=>(r=i(r),e=i(e),t=i(t),o=>r(o)?e(o):t(o)));var B=[];p("=>",(r,e)=>{r=r?.[0]==="()"?r[1]:r;let t=r?r[0]===","?r.slice(1):[r]:[],o=-1,n=null,s=t[t.length-1];Array.isArray(s)&&s[0]==="..."&&(o=t.length-1,n=s[1],t.length--);let l=e?.[0]==="{}";return e=i(l?["{",e[1]]:e),f=>(...d)=>{let g={};t.forEach((S,w)=>g[S]=d[w]),n&&(g[n]=d.slice(o));let E=new Proxy(g,{get:(S,w)=>w in S?S[w]:f?.[w],set:(S,w,_)=>((w in S?S:f)[w]=_,!0),has:(S,w)=>w in S||(f?w in f:!1)});try{let S=e(E);return l?void 0:S}catch(S){if(S===B)return S[0];throw S}}});p("...",r=>(r=i(r),e=>Object.entries(r(e))));p("?.",(r,e)=>(r=i(r),D(e)?()=>{}:t=>r(t)?.[e]));p("?.[]",(r,e)=>(r=i(r),e=i(e),t=>{let o=e(t);return D(o)?void 0:r(t)?.[o]}));p("?.()",(r,e)=>{let t=e?e[0]===","?(e=e.slice(1).map(i),n=>e.map(s=>s(n))):(e=i(e),n=>[e(n)]):()=>[];if(r[0]==="?."){let n=i(r[1]),s=r[2];return D(s)?()=>{}:l=>n(l)?.[s]?.(...t(l))}if(r[0]==="?.[]"){let n=i(r[1]),s=i(r[2]);return l=>{let f=n(l),d=s(l);return D(d)?void 0:f?.[d]?.(...t(l))}}if(r[0]==="."){let n=i(r[1]),s=r[2];return D(s)?()=>{}:l=>n(l)?.[s]?.(...t(l))}if(r[0]==="[]"&&r.length===3){let n=i(r[1]),s=i(r[2]);return l=>{let f=n(l),d=s(l);return D(d)?void 0:f?.[d]?.(...t(l))}}let o=i(r);return n=>o(n)?.(...t(n))});p("typeof",r=>(r=i(r),e=>typeof r(e)));p("void",r=>(r=i(r),e=>(r(e),void 0)));p("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});p("new",r=>{let e=i(r?.[0]==="()"?r[1]:r),t=r?.[0]==="()"?r[2]:null,o=t?t[0]===","?(n=>s=>n.map(l=>l(s)))(t.slice(1).map(i)):(n=>s=>[n(s)])(i(t)):()=>[];return n=>new(e(n))(...o(n))});var pr=Symbol("accessor");p("get",(r,e)=>(e=e?i(e):()=>{},t=>[[pr,r,{get:function(){let o=Object.create(t||{});return o.this=this,e(o)}}]]));p("set",(r,e,t)=>(t=t?i(t):()=>{},o=>[[pr,r,{set:function(n){let s=Object.create(o||{});s.this=this,s[e]=n,t(s)}}]]));var Qt=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);p("{}",(r,e)=>{if(e!==void 0)return;if(!Qt(r))return i(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let t=r.map(o=>i(typeof o=="string"?[":",o,o]:o));return o=>{let n={},s={};for(let l of t.flatMap(f=>f(o)))if(l[0]===pr){let[,f,d]=l;s[f]={...s[f],...d,configurable:!0,enumerable:!0}}else n[l[0]]=l[1];for(let l in s)Object.defineProperty(n,l,s[l]);return n}});p("{",r=>(r=r?i(r):()=>{},e=>r(Object.create(e))));p(":",(r,e)=>(e=i(e),Array.isArray(r)?(r=i(r),t=>[[r(t),e(t)]]):t=>[[r,e(t)]]));p("`",(...r)=>(r=r.map(i),e=>r.map(t=>t(e)).join("")));p("``",(r,...e)=>{r=i(r);let t=[],o=[];for(let s of e)Array.isArray(s)&&s[0]===void 0?t.push(s[1]):o.push(i(s));let n=Object.assign([...t],{raw:t});return s=>r(s)(n,...o.map(l=>l(s)))});p("function",(r,e,t)=>{t=t?i(t):()=>{};let o=e?e[0]===","?e.slice(1):[e]:[],n=null,s=-1,l=o[o.length-1];return Array.isArray(l)&&l[0]==="..."&&(s=o.length-1,n=l[1],o.length--),f=>{let d=(...g)=>{let E={};o.forEach((w,_)=>E[w]=g[_]),n&&(E[n]=g.slice(s));let S=new Proxy(E,{get:(w,_)=>_ in w?w[_]:f[_],set:(w,_,ge)=>((_ in w?w:f)[_]=ge,!0),has:(w,_)=>_ in w||_ in f});try{return t(S)}catch(w){if(w===B)return w[0];throw w}};return r&&(f[r]=d),d}});p("function*",(r,e,t)=>{throw Error("Generator functions are not supported in evaluation")});p("async",r=>{let e=i(r);return t=>{let o=e(t);return async function(...n){return o(...n)}}});p("await",r=>(r=i(r),async e=>await r(e)));p("yield",r=>(r=r?i(r):null,e=>{throw{__yield__:r?r(e):void 0}}));p("yield*",r=>(r=i(r),e=>{throw{__yield_all__:r(e)}}));var $t=Symbol("static"),xt=r=>{throw Error(r)};p("instanceof",(r,e)=>(r=i(r),e=i(e),t=>r(t)instanceof e(t)));p("class",(r,e,t)=>(e=e?i(e):null,t=t?i(t):null,o=>{let n=e?e(o):Object,s=function(...l){if(!(this instanceof s))return xt("Class constructor must be called with new");let f=e?Reflect.construct(n,l,s):this;return s.prototype.__constructor__&&s.prototype.__constructor__.apply(f,l),f};if(Object.setPrototypeOf(s.prototype,n.prototype),Object.setPrototypeOf(s,n),t){let l=Object.create(o);l.super=n;let f=t(l),d=Array.isArray(f)&&typeof f[0]?.[0]=="string"?f:[];for(let[g,E]of d)g==="constructor"?s.prototype.__constructor__=E:s.prototype[g]=E}return r&&(o[r]=s),s}));p("static",r=>(r=i(r),e=>[[$t,r(e)]]));p("//",(r,e)=>{let t=new RegExp(r,e||"");return()=>t});p("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 U=Symbol("break"),K=Symbol("continue");p("while",(r,e)=>(r=i(r),e=i(e),t=>{let o;for(;r(t);)try{o=e(t)}catch(n){if(n===U)break;if(n===K)continue;if(n===B)return n[0];throw n}return o}));p("do",(r,e)=>(r=i(r),e=i(e),t=>{let o;do try{o=r(t)}catch(n){if(n===U)break;if(n===K)continue;if(n===B)return n[0];throw n}while(e(t));return o}));p("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),s=>{let l;for(t?.(s);o(s);n?.(s))try{l=e(s)}catch(f){if(f===U)break;if(f===K)continue;if(f===B)return f[0];throw f}return l}}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 zt(o,n,e);if(t==="of")return Wt(o,n,e)}});var Wt=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let s,l=o?null:n[r];for(let f of e(n)){o?X(r,f,n):n[r]=f;try{s=t(n)}catch(d){if(d===U)break;if(d===K)continue;if(d===B)return d[0];throw d}}return o||(n[r]=l),s}},zt=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let s,l=o?null:n[r];for(let f in e(n)){o?X(r,f,n):n[r]=f;try{s=t(n)}catch(d){if(d===U)break;if(d===K)continue;if(d===B)return d[0];throw d}}return o||(n[r]=l),s}};p("break",()=>()=>{throw U});p("continue",()=>()=>{throw K});p("return",r=>(r=r!==void 0?i(r):null,e=>{throw B[0]=r?.(e),B}));p("try",(r,...e)=>{r=r?i(r):null;let t=e.find(f=>f?.[0]==="catch"),o=e.find(f=>f?.[0]==="finally"),n=t?.[1],s=t?.[2]?i(t[2]):null,l=o?.[1]?i(o[1]):null;return f=>{let d;try{d=r?.(f)}catch(g){if(g===U||g===K||g===B)throw g;if(n!=null&&s){let E=n in f,S=f[n];f[n]=g;try{d=s(f)}finally{E?f[n]=S:delete f[n]}}else if(!s)throw g}finally{l?.(f)}return d}});p("throw",r=>(r=i(r),e=>{throw r(e)}));p("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,s;for(let[f,d]of e)if(n||f===null||f(t)===o)for(n=!0,l=0;l<d.length;l++)try{s=d[l](t)}catch(g){if(g===U)return s;throw g}var l;return s}):t=>r(t)));p("import",()=>()=>{});p("export",()=>()=>{});p("from",(r,e)=>()=>{});p("as",(r,e)=>()=>{});p("default",r=>i(r));var Ae=new WeakMap,Jt=(r,...e)=>typeof r=="string"?i(m(r)):Ae.get(r)||Ae.set(r,Vt(r,e)).get(r),ye=57344,Vt=(r,e)=>{let t=r.reduce((s,l,f)=>s+(f?String.fromCharCode(ye+f-1):"")+l,""),o=m(t),n=s=>{if(typeof s=="string"&&s.length===1){let l=s.charCodeAt(0)-ye,f;if(l>=0&&l<e.length)return f=e[l],Yt(f)?f:[,f]}return Array.isArray(s)?s.map(n):s};return i(n(o))},Yt=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Zt=Jt;export{mr as access,y as binary,i as compile,c as cur,Zt as default,R as err,A as expr,x as group,qt as id,u as idx,C as keyword,j as literal,Mr as loc,T as lookup,lr as nary,N as next,p as operator,ur as operators,v as parens,m as parse,Y as peek,$ as prec,P as seek,h as skip,a as space,fr as step,k as token,O as unary,I as word};
4
+ `,""+n}${m}${u}`)},Br=(r,e=l)=>(Array.isArray(r)&&(r.loc=e),r),I=(r,e=l,t)=>{for(;t=r(c.charCodeAt(l));)l+=t;return c.slice(e,l)},d=(r=1)=>c[l+=r],O=r=>l=r,h=(r=0,e)=>{let t,o,n;for(e&&s.enter?.(r,e);(t=s.space())&&t!==e&&(n=s.step(o,r,t,h));)o=n;return e&&(t==e?(l++,s.exit?.(r,e)):N("Unclosed "+String.fromCharCode(e-(e>42?2:1)))),o},Y=(r=l)=>{for(;c.charCodeAt(r)<=32;)r++;return c.charCodeAt(r)},Jt=s.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,k=(r,e=r.length)=>c.substr(l,e)===r&&!s.id(c.charCodeAt(l+e)),P=()=>(d(),h(0,41)),T=[],$={},S=(r,e=32,t,o=r.charCodeAt(0),n=r.length,p=T[o],m=r.toUpperCase()!==r,u,a)=>(e=$[r]=!p&&$[r]||e,T[o]=(y,g,E,w=l)=>(u=E,(E?r==E:(n<2||r.charCodeAt(1)===c.charCodeAt(l+1)&&(n<3||c.substr(l,n)==r))&&(!m||!s.id(c.charCodeAt(l+n)))&&(u=E=r))&&g<e&&(l+=n,(a=t(y))?Br(a,w):(l=w,u=0,!m&&!p&&!y&&N()),a)||p?.(y,g,u))),A=(r,e,t=!1)=>S(r,e,o=>o&&(n=>n&&[r,o,n])(h(e-(t?.5:0)))),_=(r,e,t)=>S(r,e,o=>t?o&&[r,o]:!o&&(o=h(e-.5))&&[r,o]),H=(r,e)=>S(r,200,t=>!t&&[,e]),fr=(r,e,t)=>S(r,e,(o,n)=>(n=h(e-(t?.5:0)),o?.[0]!==r&&(o=[r,o||null]),n?.[0]===r?o.push(...n.slice(1)):o.push(n||null),o)),j=(r,e)=>S(r[0],e,t=>!t&&[r,h(0,r.charCodeAt(1))||null]),ur=(r,e)=>S(r[0],e,t=>t&&[r,t,h(0,r.charCodeAt(1))||null]),C=(r,e,t,o=r.charCodeAt(0),n=r.length,p=T[o],m)=>T[o]=(u,a,y,g=l)=>!u&&(y?r==y:(n<2||c.substr(l,n)==r)&&(y=r))&&a<e&&!s.id(c.charCodeAt(l+n))&&(!s.prop||s.prop(l+n))&&(O(l+n),(m=t())?Br(m,g):O(g),m)||p?.(u,a,y);s.space=r=>{for(;(r=c.charCodeAt(l))<=32;)l++;return r};s.step=(r,e,t,o,n)=>(n=T[t])&&n(r,e)||(r?null:I(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))??N(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:e=>e?.[r];var q=46,W=48,x=57,ye=69,Ce=101,we=43,ge=45,Z=95,Lr=110,Ee=97,Se=102,ke=65,Te=70,Mr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),lr=r=>{let e=Mr(I(t=>t===q&&c.charCodeAt(l+1)!==q||t>=W&&t<=x||t===Z||((t===ye||t===Ce)&&((t=c.charCodeAt(l+1))>=W&&t<=x||t===we||t===ge)?2:0)));return c.charCodeAt(l)===Lr?(d(),[,BigInt(e)]):(r=+e)!=r?N():[,r]},Ie={2:r=>r===48||r===49||r===Z,8:r=>r>=48&&r<=55||r===Z,16:r=>r>=W&&r<=x||r>=Ee&&r<=Se||r>=ke&&r<=Te||r===Z};s.number=null;T[q]=r=>!r&&c.charCodeAt(l+1)!==q&&lr();for(let r=W;r<=x;r++)T[r]=e=>e?void 0:lr();T[W]=r=>{if(r)return;let e=s.number;if(e){for(let[t,o]of Object.entries(e))if(t[0]==="0"&&c[l+1]?.toLowerCase()===t[1]){d(2);let n=Mr(I(Ie[o]));return c.charCodeAt(l)===Lr?(d(),[,BigInt("0"+t[1]+n)]):[,parseInt(n,o)]}}return lr()};var Ne=92,Ur=34,Dr=39,Fr=117,Gr=120,Re=123,_e=125,Xr=10,Oe=13,Pe={n:`
5
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},Kr=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,Hr=r=>(e,t,o="",n=String.fromCharCode(r))=>{if(e||!s.string?.[n])return;d();let p=()=>{let m=c.charCodeAt(l+1);if(m===Xr)return 2;if(m===Oe)return c.charCodeAt(l+2)===Xr?3:2;if(m===Gr||m===Fr&&c.charCodeAt(l+2)!==Re){let u=m===Gr?2:4,a=0,y;for(let g=0;g<u;g++){if((y=Kr(c.charCodeAt(l+2+g)))<0)return o+=c[l+1],2;a=a*16+y}return o+=String.fromCharCode(a),2+u}if(m===Fr){let u=0,a=l+3,y;for(;(y=Kr(c.charCodeAt(a)))>=0;)u=u*16+y,a++;return a>l+3&&u<=1114111&&c.charCodeAt(a)===_e?(o+=String.fromCodePoint(u),a-l+1):(o+=c[l+1],2)}return o+=Pe[c[l+1]]||c[l+1],2};return I(m=>m-r&&(m!==Ne?(o+=c[l],1):p())),c[l]===n?d():N("Bad string"),[,o]};T[Ur]=Hr(Ur);T[Dr]=Hr(Dr);s.string={'"':!0};var ve=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>A(r,ve,!0));var Be=30,Le=40,Me=140;_("!",Me);A("||",Be);A("&&",Le);var Ue=50,De=60,Fe=70,Qr=100,Ge=140;A("|",Ue);A("&",Fe);A("^",De);A(">>",Qr);A("<<",Qr);_("~",Ge);var b=90;A("<",b);A(">",b);A("<=",b);A(">=",b);var $r=80;A("==",$r);A("!=",$r);var jr=110,mr=120,Wr=140;A("+",jr);A("-",jr);A("*",mr);A("/",mr);A("%",mr);_("+",Wr);_("-",Wr);var rr=150;S("++",rr,r=>r?["++",r,null]:["++",h(rr-1)]);S("--",rr,r=>r?["--",r,null]:["--",h(rr-1)]);var Xe=5,Ke=10;fr(",",Ke);fr(";",Xe,!0);var He=170;j("()",He);var cr=170;ur("[]",cr);A(".",cr);ur("()",cr);var Qe=32,$e=s.space;s.comment??={"//":`
6
+ `,"/*":"*/"};var ar;s.space=()=>{ar||(ar=Object.entries(s.comment).map(([n,p])=>[n,p,n.charCodeAt(0)]));for(var r;r=$e();){for(var e=0,t;t=ar[e++];)if(r===t[2]&&c.substr(l,t[0].length)===t[0]){var o=l+t[0].length;if(t[1]===`
7
+ `)for(;c.charCodeAt(o)>=Qe;)o++;else{for(;c[o]&&c.substr(o,t[1].length)!==t[1];)o++;c[o]&&(o+=t[1].length)}O(o),r=0;break}if(r)return r}return r};var zr=80;A("===",zr);A("!==",zr);var je=30;A("??",je);var We=130,ze=20;A("**",We,!0);A("**=",ze,!0);var Jr=90;A("in",Jr);A("of",Jr);var Je=20,Ve=100;A(">>>",Ve);A(">>>=",Je,!0);var dr=20;A("||=",dr,!0);A("&&=",dr,!0);A("??=",dr,!0);H("true",!0);H("false",!1);H("null",null);C("undefined",200,()=>[]);H("NaN",NaN);H("Infinity",1/0);var hr=20;S("?",hr,(r,e,t)=>r&&(e=h(hr-1))&&I(o=>o===58)&&(t=h(hr-1),["?",r,e,t]));var Ye=20;A("=>",Ye,!0);var Ze=20;_("...",Ze);var Vr=170;S("?.",Vr,(r,e)=>{if(!r)return;let t=s.space();return t===40?(d(),["?.()",r,h(0,41)||null]):t===91?(d(),["?.[]",r,h(0,93)]):(e=h(Vr),e?["?.",r,e]:void 0)});var z=140;_("typeof",z);_("void",z);_("delete",z);C("new",z,()=>k(".target")?(d(7),["new.target"]):["new",h(z)]);var qe=20,Yr=200;s.prop=r=>Y(r)!==58;j("[]",Yr);j("{}",Yr);A(":",qe-1,!0);var xe=170,er=96,be=36,rt=123,et=92,tt={n:`
8
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},Zr=()=>{let r=[];for(let e="",t;(t=c.charCodeAt(l))!==er;)t?t===et?(d(),e+=tt[c[l]]||c[l],d()):t===be&&c.charCodeAt(l+1)===rt?(e&&r.push([,e]),e="",d(2),r.push(h(0,125))):(e+=c[l],d(),t=c.charCodeAt(l),t===er&&e&&r.push([,e])):N("Unterminated template");return d(),r},ot=T[er];T[er]=(r,e)=>r&&e<xe?s.asi&&s.newline?void 0:(d(),["``",r,...Zr()]):r?ot?.(r,e):(d(),(t=>t.length<2&&t[0]?.[0]===void 0?t[0]||[,""]:["`",...t])(Zr()));s.string["'"]=!0;s.number={"0x":16,"0b":2,"0o":8};var nt=92,it=117,st=123,pt=125,ft=183,ut=s.id,qr=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,lt=(r=l+2,e,t=0,o=0)=>{if(c.charCodeAt(l)!==nt||c.charCodeAt(l+1)!==it)return 0;if(c.charCodeAt(r)===st){for(;qr(e=c.charCodeAt(++r));)t=t*16+(e<=57?e-48:(e&31)+9);return r>l+3&&t<=1114111&&c.charCodeAt(r)===pt?r-l+1:0}for(;o<4&&qr(c.charCodeAt(r+o));)o++;return o===4?6:0};s.id=r=>ut(r)||r===ft||lt();var Ar=5,mt=10,yr=r=>{let e=l,t=h(mt-1);return t==null?r:r==="let"&&(t==="in"||t==="of")?(O(e),r):t[0]==="in"||t[0]==="of"?[t[0],[r,t[1]],t[2]]:t[0]===","?[r,...t.slice(1)]:[r,t]};C("let",Ar+1,()=>yr("let"));C("const",Ar+1,()=>yr("const"));C("var",Ar+1,()=>yr("var"));var tr=5,ct=59,B=()=>(s.space()===123||N("Expected {"),d(),h(tr-.5,125)||null),U=()=>s.space()!==123?h(tr+.5):(d(),h(tr-.5,125)||null),at=()=>{let r=l;return s.space()===ct&&d(),s.space(),k("else")?(d(4),!0):(O(r),!1)};C("if",tr+1,()=>{s.space();let r=["if",P(),U()];return at()&&r.push(U()),r});var dt=200;C("function",dt,()=>{s.space();let r=!1;c[l]==="*"&&(r=!0,d(),s.space());let e=I(s.id);return e&&s.space(),r?["function*",e,P()||null,B()]:["function",e,P()||null,B()]});var or=140,Cr=20;_("await",or);C("yield",or,()=>(s.space(),c[l]==="*"?(d(),s.space(),["yield*",h(Cr)]):["yield",h(Cr)]));C("async",or,()=>{if(s.space(),k("function"))return["async",h(or)];let r=h(Cr-.5);return r&&["async",r]});var wr=200;var ht=90,At=175;_("static",At);A("instanceof",ht);S("#",wr,r=>{if(r)return;let e=I(s.id);return e?"#"+e:void 0});C("class",wr,()=>{s.space();let r=I(s.id)||null;if(r==="extends")r=null,s.space();else{if(s.space(),!k("extends"))return["class",r,null,B()];d(7),s.space()}return["class",r,h(wr),B()]});var gr=47,yt=92;S("/",140,r=>{let e=c.charCodeAt(l);if(r||e===gr||e===42||e===43||e===63||e===61)return;let t=I(n=>n===yt?2:n&&n!==gr);c.charCodeAt(l)===gr||N("Unterminated regex"),d();let o=I(n=>n===103||n===105||n===109||n===115||n===117||n===121);return o?["//",t,o]:["//",t]});var K=5,J=125,V=59;C("while",K+1,()=>(s.space(),["while",P(),U()]));C("do",K+1,()=>(r=>(s.space(),d(5),s.space(),["do",r,P()]))(U()));C("for",K+1,()=>(s.space(),k("await")?(d(5),s.space(),["for await",P(),U()]):["for",P(),U()]));C("break",K+1,()=>{s.asi&&(s.newline=!1);let r=l;s.space();let e=c.charCodeAt(l);if(!e||e===J||e===V||s.newline)return["break"];let t=I(s.id);if(!t)return["break"];s.space();let o=c.charCodeAt(l);return!o||o===J||o===V||s.newline?["break",t]:(O(r),["break"])});C("continue",K+1,()=>{s.asi&&(s.newline=!1);let r=l;s.space();let e=c.charCodeAt(l);if(!e||e===J||e===V||s.newline)return["continue"];let t=I(s.id);if(!t)return["continue"];s.space();let o=c.charCodeAt(l);return!o||o===J||o===V||s.newline?["continue",t]:(O(r),["continue"])});C("return",K+1,()=>{s.asi&&(s.newline=!1);let r=s.space();return!r||r===J||r===V||s.newline?["return"]:["return",h(K)]});var Er=5;C("try",Er+1,()=>{let r=["try",B()];return s.space(),k("catch")&&(d(5),s.space(),r.push(["catch",Y()===40?P():null,B()])),s.space(),k("finally")&&(d(7),r.push(["finally",B()])),r});C("throw",Er+1,()=>{if(s.asi&&(s.newline=!1),s.space(),s.newline)throw SyntaxError("Unexpected newline after throw");return["throw",h(Er)]});var re=5,Ct=20,xr=58,wt=59,ee=125,Sr=0,te=(r,e=r.length,t=r.charCodeAt(0),o=T[t])=>T[t]=(n,p,m)=>k(r)&&!n&&Sr||o?.(n,p,m);te("case");te("default");var br=r=>{let e=[];for(;(r=s.space())!==ee&&!k("case")&&!k("default");){if(r===wt){d();continue}e.push(h(re-.5))||N()}return e.length>1?[";",...e]:e[0]||null},gt=()=>{s.space()===123||N("Expected {"),d(),Sr++;let r=[];try{for(;s.space()!==ee;)if(k("case")){O(l+4),s.space();let e=h(Ct-.5);s.space()===xr&&d(),r.push(["case",e,br()])}else k("default")?(O(l+7),s.space()===xr&&d(),r.push(["default",br()])):N("Expected case or default")}finally{Sr--}return d(),r};C("switch",re+1,()=>s.space()===40&&["switch",P(),...gt()]);var oe=5;C("debugger",oe+1,()=>["debugger"]);C("with",oe+1,()=>(s.space(),["with",P(),U()]));var kr=5,Q=10,ne=42,Et=T[ne];T[ne]=(r,e)=>r?Et?.(r,e):(d(),"*");S("from",Q+1,r=>r?r[0]!=="="&&r[0]!==","&&(s.space(),["from",r,h(Q+1)]):!1);S("as",Q+2,r=>r?(s.space(),["as",r,h(Q+2)]):!1);C("import",kr,()=>k(".meta")?(d(5),["import.meta"]):["import",h(Q)]);C("export",kr,()=>(s.space(),k("default")?(d(7),["export",["default",h(Q)]]):["export",h(kr)]));var Tr=20,St=10,kt=13,Tt=40,ie=41,se=123,pe=125,It=(r,e)=>{for(;r<e;){let t=c.charCodeAt(r++);if(t===St||t===kt)return!0}return!1},fe=r=>e=>{if(e)return;let t=l;if(s.space(),s.semi||It(t,l))return!1;let o=I(s.id);if(!o||(s.space(),c.charCodeAt(l)!==Tt))return!1;d();let n=h(0,ie);return s.space(),c.charCodeAt(l)!==se?!1:(d(),[r,o,n,h(0,pe)])};S("get",Tr-1,fe("get"));S("set",Tr-1,fe("set"));S("(",Tr-1,r=>{if(!r)return;let e;if(Array.isArray(r)&&r[0]==="static"&&(e="static",r=r[1]),typeof r!="string"&&!(Array.isArray(r)&&r[0]===void 0))return;let t=h(0,ie)||null;if(s.space(),c.charCodeAt(l)!==se)return;d();let o=[":",r,["=>",["()",t],h(0,pe)||null]];return e?[e,o]:o});s.comment["#!"]=`
9
+ `;var le=32,_r=10,Nt=59,Rt=125,_t=91,Ot=40,Rr=$.asi??$[";"],Pt=s._baseSpace??=s.space,vt=s._baseStep??=s.step,Ir=r=>Array.isArray(r)||typeof r=="string",Bt=(r,e)=>{for(;(e=c.charCodeAt(r))<=le;){if(e===_r)return!0;r++}return!1},Lt=(r=l,e)=>{for(;r-- >0&&(e=c.charCodeAt(r))<=le;)if(e===_r)return!0;return!1};s.space=(r,e)=>{for(;;){for(e=l,r=Pt();e<l;)if(c.charCodeAt(e++)===_r){s.newline=!0;break}if(r===Nt&&Bt(l+1)){O(l+1),s.newline=s.semi=!0;continue}return r}};s.enter=()=>s.newline=s.semi=!1;s.exit=(r,e)=>{e===Rt&&(s.newline=!0,s.semi=!1)};s.step=(r,e,t,o)=>{if(s.semi&&e>=Rr)return!1;if(r&&!Ir(r))return null;if(Ir(r)&&(s.semi||(t===_t||t===Ot)&&Lt()))return ue(r,e,o)??null;let n=s.newline;return vt(r,e,t,o)??(Ir(r)&&n?ue(r,e,o)??null:null)};var Nr=0,Mt=2e3,ue=s.asi=(r,e,t,o,n)=>{if(e>=Rr||Nr>=Mt)return;s.semi=!1;let p=l;Nr++;try{o=t(Rr-.5)}finally{Nr--}if(!(!o||l===p))return n=o?.[0]===";"?o.slice(1):[o],r?.[0]===";"?(r.push(...n),r):[";",r,...n]};var ce=(r,e,t,o)=>typeof r=="string"?n=>e(n,r,n):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o,n)):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n),n)):r[0]==="()"&&r.length===2?ce(r[1],e):(()=>{throw Error("Invalid assignment target")})(),me={"=":(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 me)f(r,(e,t)=>(t=i(t),ce(e,(o,n,p)=>me[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 Or=(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?Or(r[1],e):(()=>{throw Error("Invalid increment target")})();f("++",(r,e)=>Or(r,e===null?(t,o)=>t[o]++:(t,o)=>++t[o]));f("--",(r,e)=>Or(r,e===null?(t,o)=>t[o]--:(t,o)=>--t[o]));var ae=(...r)=>(r=r.map(i),e=>{let t;for(let o of r)t=o(e);return t});f(",",ae);f(";",ae);var D=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",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=e(t);return D(o)?void 0:r(t)[o]}));f(".",(r,e)=>(r=i(r),e=e[0]?e:e[1],D(e)?()=>{}:t=>r(t)[e]));f("()",(r,e)=>{if(e===void 0)return r==null?nr("Empty ()"):i(r);let t=n=>n?.[0]===","&&n.slice(1).some(p=>p==null||t(p));t(e)&&nr("Empty argument");let o=e?e[0]===","?(e=e.slice(1).map(i),n=>e.map(p=>p(n))):(e=i(e),n=>[e(n)]):()=>[];return Pr(r,(n,p,m)=>n[p](...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]==="{}"),Pr=(r,e,t,o)=>r==null?nr("Empty ()"):r[0]==="()"&&r.length==2?Pr(r[1],e):typeof r=="string"?n=>e(n,r,n):r[0]==="."?(t=i(r[1]),o=r[2],n=>e(t(n),o,n)):r[0]==="?."?(t=i(r[1]),o=r[2],n=>{let p=t(n);return p==null?void 0:e(p,o,n)}):r[0]==="[]"&&r.length===3?(t=i(r[1]),o=i(r[2]),n=>e(t(n),o(n),n)):r[0]==="?.[]"?(t=i(r[1]),o=i(r[2]),n=>{let p=t(n);return p==null?void 0:e(p,o(n),n)}):(r=i(r),n=>e([r(n)],0,n)),F=Pr;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 Ut=r=>{throw Error(r)};f("**",(r,e)=>(r=i(r),e=i(e),t=>r(t)**e(t)));f("**=",(r,e)=>(L(r)||Ut("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]**=e(n))));f("in",(r,e)=>(r=i(r),e=i(e),t=>r(t)in e(t)));var Dt=r=>{throw Error(r)};f(">>>",(r,e)=>(r=i(r),e=i(e),t=>r(t)>>>e(t)));f(">>>=",(r,e)=>(L(r)||Dt("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]>>>=e(n))));var Ft=r=>r[0]?.[0]===","?r[0].slice(1):r,G=(r,e,t)=>{if(typeof r=="string"){t[r]=e;return}let[o,...n]=r,p=Ft(n);if(o==="{}"){let m=[];for(let u of p){if(Array.isArray(u)&&u[0]==="..."){let w={};for(let R in e)m.includes(R)||(w[R]=e[R]);t[u[1]]=w;break}let a,y,g;typeof u=="string"?a=y=u:u[0]==="="?(typeof u[1]=="string"?a=y=u[1]:[,a,y]=u[1],g=u[2]):[,a,y]=u,m.push(a);let E=e[a];E===void 0&&g&&(E=i(g)(t)),G(y,E,t)}}else if(o==="[]"){let m=0;for(let u of p){if(u===null){m++;continue}if(Array.isArray(u)&&u[0]==="..."){t[u[1]]=e.slice(m);break}let a=u,y;Array.isArray(u)&&u[0]==="="&&([,a,y]=u);let g=e[m++];g===void 0&&y&&(g=i(y)(t)),G(a,g,t)}}},vr=(...r)=>(r=r.map(e=>{if(typeof e=="string")return t=>{t[e]=void 0};if(e[0]==="="){let[,t,o]=e,n=i(o);return typeof t=="string"?p=>{p[t]=n(p)}:p=>G(t,n(p),p)}return i(e)}),e=>{for(let t of r)t(e)});f("let",vr);f("const",vr);f("var",vr);var 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=>G(t,e(o),o)}return L(r)||ir("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]=e(n))});f("||=",(r,e)=>(L(r)||ir("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]||=e(n))));f("&&=",(r,e)=>(L(r)||ir("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]&&=e(n))));f("??=",(r,e)=>(L(r)||ir("Invalid assignment target"),e=i(e),F(r,(t,o,n)=>t[o]??=e(n))));f("?",(r,e,t)=>(r=i(r),e=i(e),t=i(t),o=>r(o)?e(o):t(o)));var v=[];f("=>",(r,e)=>{r=r?.[0]==="()"?r[1]:r;let t=r?r[0]===","?r.slice(1):[r]:[],o=-1,n=null,p=t[t.length-1];Array.isArray(p)&&p[0]==="..."&&(o=t.length-1,n=p[1],t.length--);let m=e?.[0]==="{}";return e=i(m?["{",e[1]]:e),u=>(...a)=>{let y={};t.forEach((E,w)=>y[E]=a[w]),n&&(y[n]=a.slice(o));let g=new Proxy(y,{get:(E,w)=>w in E?E[w]:u?.[w],set:(E,w,R)=>((w in E?E:u)[w]=R,!0),has:(E,w)=>w in E||(u?w in u:!1)});try{let E=e(g);return m?void 0:E}catch(E){if(E===v)return E[0];throw E}}});f("...",r=>(r=i(r),e=>Object.entries(r(e))));f("?.",(r,e)=>(r=i(r),D(e)?()=>{}:t=>r(t)?.[e]));f("?.[]",(r,e)=>(r=i(r),e=i(e),t=>{let o=e(t);return D(o)?void 0:r(t)?.[o]}));f("?.()",(r,e)=>{let t=e?e[0]===","?(e=e.slice(1).map(i),n=>e.map(p=>p(n))):(e=i(e),n=>[e(n)]):()=>[];if(r[0]==="?."){let n=i(r[1]),p=r[2];return D(p)?()=>{}:m=>n(m)?.[p]?.(...t(m))}if(r[0]==="?.[]"){let n=i(r[1]),p=i(r[2]);return m=>{let u=n(m),a=p(m);return D(a)?void 0:u?.[a]?.(...t(m))}}if(r[0]==="."){let n=i(r[1]),p=r[2];return D(p)?()=>{}:m=>n(m)?.[p]?.(...t(m))}if(r[0]==="[]"&&r.length===3){let n=i(r[1]),p=i(r[2]);return m=>{let u=n(m),a=p(m);return D(a)?void 0:u?.[a]?.(...t(m))}}let o=i(r);return n=>o(n)?.(...t(n))});f("typeof",r=>(r=i(r),e=>typeof r(e)));f("void",r=>(r=i(r),e=>(r(e),void 0)));f("delete",r=>{if(r[0]==="."){let e=i(r[1]),t=r[2];return o=>delete e(o)[t]}if(r[0]==="[]"){let e=i(r[1]),t=i(r[2]);return o=>delete e(o)[t(o)]}return()=>!0});f("new",r=>{let e=i(r?.[0]==="()"?r[1]:r),t=r?.[0]==="()"?r[2]:null,o=t?t[0]===","?(n=>p=>n.map(m=>m(p)))(t.slice(1).map(i)):(n=>p=>[n(p)])(i(t)):()=>[];return n=>new(e(n))(...o(n))});var 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 Gt=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);f("{}",(r,e)=>{if(e!==void 0)return;if(!Gt(r))return i(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let t=r.map(o=>i(typeof o=="string"?[":",o,o]:o));return o=>{let n={},p={};for(let m of t.flatMap(u=>u(o)))if(m[0]===sr){let[,u,a]=m;p[u]={...p[u],...a,configurable:!0,enumerable:!0}}else n[m[0]]=m[1];for(let m in p)Object.defineProperty(n,m,p[m]);return n}});f("{",r=>(r=r?i(r):()=>{},e=>r(Object.create(e))));f(":",(r,e)=>(e=i(e),Array.isArray(r)?(r=i(r),t=>[[r(t),e(t)]]):t=>[[r,e(t)]]));f("`",(...r)=>(r=r.map(i),e=>r.map(t=>t(e)).join("")));f("``",(r,...e)=>{r=i(r);let t=[],o=[];for(let p of e)Array.isArray(p)&&p[0]===void 0?t.push(p[1]):o.push(i(p));let n=Object.assign([...t],{raw:t});return p=>r(p)(n,...o.map(m=>m(p)))});f("function",(r,e,t)=>{t=t?i(t):()=>{};let o=e?e[0]===","?e.slice(1):[e]:[],n=null,p=-1,m=o[o.length-1];return Array.isArray(m)&&m[0]==="..."&&(p=o.length-1,n=m[1],o.length--),u=>{let a=(...y)=>{let g={};o.forEach((w,R)=>g[w]=y[R]),n&&(g[n]=y.slice(p));let E=new Proxy(g,{get:(w,R)=>R in w?w[R]:u[R],set:(w,R,Ae)=>((R in w?w:u)[R]=Ae,!0),has:(w,R)=>R in w||R in u});try{return t(E)}catch(w){if(w===v)return w[0];throw w}};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 Xt=Symbol("static"),Kt=r=>{throw Error(r)};f("instanceof",(r,e)=>(r=i(r),e=i(e),t=>r(t)instanceof e(t)));f("class",(r,e,t)=>(e=e?i(e):null,t=t?i(t):null,o=>{let n=e?e(o):Object,p=function(...m){if(!(this instanceof p))return Kt("Class constructor must be called with new");let u=e?Reflect.construct(n,m,p):this;return p.prototype.__constructor__&&p.prototype.__constructor__.apply(u,m),u};if(Object.setPrototypeOf(p.prototype,n.prototype),Object.setPrototypeOf(p,n),t){let m=Object.create(o);m.super=n;let u=t(m),a=Array.isArray(u)&&typeof u[0]?.[0]=="string"?u:[];for(let[y,g]of a)y==="constructor"?p.prototype.__constructor__=g:p.prototype[y]=g}return r&&(o[r]=p),p}));f("static",r=>(r=i(r),e=>[[Xt,r(e)]]));f("//",(r,e)=>{let t=new RegExp(r,e||"");return()=>t});f("if",(r,e,t)=>(r=i(r),e=i(e),t=t!==void 0?i(t):null,o=>r(o)?e(o):t?.(o)));var M=Symbol("break"),X=Symbol("continue");f("while",(r,e)=>(r=i(r),e=i(e),t=>{let o;for(;r(t);)try{o=e(t)}catch(n){if(n===M)break;if(n===X)continue;if(n===v)return n[0];throw n}return o}));f("do",(r,e)=>(r=i(r),e=i(e),t=>{let o;do try{o=r(t)}catch(n){if(n===M)break;if(n===X)continue;if(n===v)return n[0];throw n}while(e(t));return o}));f("for",(r,e)=>{if(Array.isArray(r)&&r[0]===";"){let[,t,o,n]=r;return t=t?i(t):null,o=o?i(o):()=>!0,n=n?i(n):null,e=i(e),p=>{let m;for(t?.(p);o(p);n?.(p))try{m=e(p)}catch(u){if(u===M)break;if(u===X)continue;if(u===v)return u[0];throw u}return m}}if(Array.isArray(r)&&(r[0]==="in"||r[0]==="of")){let[t,o,n]=r;if(Array.isArray(o)&&(o[0]==="let"||o[0]==="const"||o[0]==="var")&&(o=o[1]),t==="in")return Qt(o,n,e);if(t==="of")return Ht(o,n,e)}});var Ht=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,m=o?null:n[r];for(let u of e(n)){o?G(r,u,n):n[r]=u;try{p=t(n)}catch(a){if(a===M)break;if(a===X)continue;if(a===v)return a[0];throw a}}return o||(n[r]=m),p}},Qt=(r,e,t)=>{e=i(e),t=i(t);let o=Array.isArray(r);return n=>{let p,m=o?null:n[r];for(let u in e(n)){o?G(r,u,n):n[r]=u;try{p=t(n)}catch(a){if(a===M)break;if(a===X)continue;if(a===v)return a[0];throw a}}return o||(n[r]=m),p}};f("break",()=>()=>{throw M});f("continue",()=>()=>{throw X});f("return",r=>(r=r!==void 0?i(r):null,e=>{throw v[0]=r?.(e),v}));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,m=o?.[1]?i(o[1]):null;return u=>{let a;try{a=r?.(u)}catch(y){if(y===M||y===X||y===v)throw y;if(n!=null&&p){let g=n in u,E=u[n];u[n]=y;try{a=p(u)}finally{g?u[n]=E:delete u[n]}}else if(!p)throw y}finally{m?.(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,m=0;m<a.length;m++)try{p=a[m](t)}catch(y){if(y===M)return p;throw y}var m;return p}):t=>r(t)));f("import",()=>()=>{});f("export",()=>()=>{});f("from",(r,e)=>()=>{});f("as",(r,e)=>()=>{});f("default",r=>i(r));var de=new WeakMap,$t=(r,...e)=>typeof r=="string"?i(s(r)):de.get(r)||de.set(r,jt(r,e)).get(r),he=57344,jt=(r,e)=>{let t=r.reduce((p,m,u)=>p+(u?String.fromCharCode(he+u-1):"")+m,""),o=s(t),n=p=>{if(typeof p=="string"&&p.length===1){let m=p.charCodeAt(0)-he,u;if(m>=0&&m<e.length)return u=e[m],Wt(u)?u:[,u]}return Array.isArray(p)?p.map(n):p};return i(n(o))},Wt=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),zt=$t;export{ur as access,A as binary,i as compile,c as cur,zt as default,N as err,h as expr,j as group,Jt as id,l as idx,C as keyword,H as literal,Br as loc,T as lookup,fr as nary,I as next,f as operator,pr as operators,P as parens,s as parse,Y as peek,$ as prec,O as seek,d as skip,S as token,_ as unary,k as word};
package/justin.min.js CHANGED
@@ -1,8 +1,8 @@
1
- var u,l,A=r=>(u=0,l=r,A.enter?.(),r=y(),l[u]?v():r||""),v=(r="Unexpected token",t=u,e=l.slice(0,t).split(`
1
+ var u,l,d=r=>(u=0,l=r,d.enter?.(),r=y(),l[u]?v():r||""),v=(r="Unexpected token",t=u,e=l.slice(0,t).split(`
2
2
  `),o=e.pop(),i=l.slice(Math.max(0,t-40),t),p="\u032D",m=(l[t]||" ")+p,f=l.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
3
3
  ${l[t-41]!==`
4
- `,""+i}${m}${f}`)},pr=(r,t=u)=>(Array.isArray(r)&&(r.loc=t),r),R=(r,t=u,e)=>{for(;e=r(l.charCodeAt(u));)u+=e;return l.slice(t,u)},C=(r=1)=>l[u+=r],D=r=>u=r,y=(r=0,t)=>{let e,o,i;for(t&&A.enter?.(r,t);(e=U())&&e!==t&&(i=J(o,r,e,y));)o=i;return t&&(e==t?(u++,A.exit?.(r,t)):v("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},J=(r,t,e,o,i)=>(i=w[e])&&i(r,t)||(r?null:R(A.id)||null),U=r=>{for(;(r=l.charCodeAt(u))<=32;)u++;return r},mr=(r=u)=>{for(;l.charCodeAt(r)<=32;)r++;return l.charCodeAt(r)},Lt=A.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)=>l.substr(u,t)===r&&!A.id(l.charCodeAt(u+t)),Tt=()=>(C(),y(0,41)),w=[],sr={},I=(r,t=32,e,o=r.charCodeAt(0),i=r.length,p=w[o],m=r.toUpperCase()!==r,f,d)=>(t=sr[r]=!p&&sr[r]||t,w[o]=(g,S,h,E=u)=>(f=h,(h?r==h:(i<2||r.charCodeAt(1)===l.charCodeAt(u+1)&&(i<3||l.substr(u,i)==r))&&(!m||!A.id(l.charCodeAt(u+i)))&&(f=h=r))&&S<t&&(u+=i,(d=e(g))?pr(d,E):(u=E,f=0,!m&&!p&&!g&&v()),d)||p?.(g,S,f))),c=(r,t,e=!1)=>I(r,t,o=>o&&(i=>i&&[r,o,i])(y(t-(e?.5:0)))),k=(r,t,e)=>I(r,t,o=>e?o&&[r,o]:!o&&(o=y(t-.5))&&[r,o]),L=(r,t)=>I(r,200,e=>!e&&[,t]),Y=(r,t,e)=>I(r,t,(o,i)=>(i=y(t-(e?.5:0)),o?.[0]!==r&&(o=[r,o||null]),i?.[0]===r?o.push(...i.slice(1)):o.push(i||null),o)),_=(r,t)=>I(r[0],t,e=>!e&&[r,y(0,r.charCodeAt(1))||null]),Z=(r,t)=>I(r[0],t,e=>e&&[r,e,y(0,r.charCodeAt(1))||null]),F=(r,t,e,o=r.charCodeAt(0),i=r.length,p=w[o],m)=>w[o]=(f,d,g,S=u)=>!f&&(g?r==g:(i<2||l.substr(u,i)==r)&&(g=r))&&d<t&&!A.id(l.charCodeAt(u+i))&&(!A.prop||A.prop(u+i))&&(D(u+i),(m=e())?pr(m,S):D(S),m)||p?.(f,d,g);Object.defineProperty(A,"space",{configurable:!0,enumerable:!0,get:()=>U,set:r=>U=r});Object.defineProperty(A,"step",{configurable:!0,enumerable:!0,get:()=>J,set:r=>J=r});var V={},s=(r,t,e=V[r])=>V[r]=(...o)=>t(...o)||e?.(...o),n=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):V[r[0]]?.(...r.slice(1))??v(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var X=46,a=48,$=57,ar=69,Br=101,Mr=43,Dr=45,G=95,ur=110,Fr=97,Gr=102,Xr=65,$r=70,lr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),q=r=>{let t=lr(R(e=>e===X&&l.charCodeAt(u+1)!==X||e>=a&&e<=$||e===G||((e===ar||e===Br)&&((e=l.charCodeAt(u+1))>=a&&e<=$||e===Mr||e===Dr)?2:0)));return l.charCodeAt(u)===ur?(C(),[,BigInt(t)]):(r=+t)!=r?v():[,r]},jr={2:r=>r===48||r===49||r===G,8:r=>r>=48&&r<=55||r===G,16:r=>r>=a&&r<=$||r>=Fr&&r<=Gr||r>=Xr&&r<=$r||r===G};A.number=null;w[X]=r=>!r&&l.charCodeAt(u+1)!==X&&q();for(let r=a;r<=$;r++)w[r]=t=>t?void 0:q();w[a]=r=>{if(r)return;let t=A.number;if(t){for(let[e,o]of Object.entries(t))if(e[0]==="0"&&l[u+1]?.toLowerCase()===e[1]){C(2);let i=lr(R(jr[o]));return l.charCodeAt(u)===ur?(C(),[,BigInt("0"+e[1]+i)]):[,parseInt(i,o)]}}return q()};var Qr=92,cr=34,dr=39,Ar=117,gr=120,Hr=123,Kr=125,hr=10,Wr=13,zr={n:`
5
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},yr=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,Cr=r=>(t,e,o="",i=String.fromCharCode(r))=>{if(t||!A.string?.[i])return;C();let p=()=>{let m=l.charCodeAt(u+1);if(m===hr)return 2;if(m===Wr)return l.charCodeAt(u+2)===hr?3:2;if(m===gr||m===Ar&&l.charCodeAt(u+2)!==Hr){let f=m===gr?2:4,d=0,g;for(let S=0;S<f;S++){if((g=yr(l.charCodeAt(u+2+S)))<0)return o+=l[u+1],2;d=d*16+g}return o+=String.fromCharCode(d),2+f}if(m===Ar){let f=0,d=u+3,g;for(;(g=yr(l.charCodeAt(d)))>=0;)f=f*16+g,d++;return d>u+3&&f<=1114111&&l.charCodeAt(d)===Kr?(o+=String.fromCodePoint(f),d-u+1):(o+=l[u+1],2)}return o+=zr[l[u+1]]||l[u+1],2};return R(m=>m-r&&(m!==Qr?(o+=l[u],1):p())),l[u]===i?C():v("Bad string"),[,o]};w[cr]=Cr(cr);w[dr]=Cr(dr);A.string={'"':!0};var Jr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>c(r,Jr,!0));var Vr=30,Yr=40,Zr=140;k("!",Zr);c("||",Vr);c("&&",Yr);var qr=50,xr=60,br=70,Sr=100,rt=140;c("|",qr);c("&",br);c("^",xr);c(">>",Sr);c("<<",Sr);k("~",rt);var j=90;c("<",j);c(">",j);c("<=",j);c(">=",j);var Er=80;c("==",Er);c("!=",Er);var wr=110,x=120,Ir=140;c("+",wr);c("-",wr);c("*",x);c("/",x);c("%",x);k("+",Ir);k("-",Ir);var Q=150;I("++",Q,r=>r?["++",r,null]:["++",y(Q-1)]);I("--",Q,r=>r?["--",r,null]:["--",y(Q-1)]);var tt=5,et=10;Y(",",et);Y(";",tt,!0);var ot=170;_("()",ot);var b=170;Z("[]",b);c(".",b);Z("()",b);var nt=32,it=A.space;A.comment??={"//":`
6
- `,"/*":"*/"};var rr;A.space=()=>{rr||(rr=Object.entries(A.comment).map(([i,p])=>[i,p,i.charCodeAt(0)]));for(var r;r=it();){for(var t=0,e;e=rr[t++];)if(r===e[2]&&l.substr(u,e[0].length)===e[0]){var o=u+e[0].length;if(e[1]===`
7
- `)for(;l.charCodeAt(o)>=nt;)o++;else{for(;l[o]&&l.substr(o,e[1].length)!==e[1];)o++;l[o]&&(o+=e[1].length)}D(o),r=0;break}if(r)return r}return r};var kr=80;c("===",kr);c("!==",kr);var st=30;c("??",st);var pt=130,mt=20;c("**",pt,!0);c("**=",mt,!0);var vr=90;c("in",vr);c("of",vr);var ft=20,ut=100;c(">>>",ut);c(">>>=",ft,!0);var tr=20;c("||=",tr,!0);c("&&=",tr,!0);c("??=",tr,!0);L("true",!0);L("false",!1);L("null",null);F("undefined",200,()=>[]);L("NaN",NaN);L("Infinity",1/0);var er=20;I("?",er,(r,t,e)=>r&&(t=y(er-1))&&R(o=>o===58)&&(e=y(er-1),["?",r,t,e]));var lt=20;c("=>",lt,!0);var ct=20;k("...",ct);var Nr=170;I("?.",Nr,(r,t)=>{if(!r)return;let e=U();return e===40?(C(),["?.()",r,y(0,41)||null]):e===91?(C(),["?.[]",r,y(0,93)]):(t=y(Nr),t?["?.",r,t]:void 0)});var B=140;k("typeof",B);k("void",B);k("delete",B);F("new",B,()=>fr(".target")?(C(7),["new.target"]):["new",y(B)]);var dt=20,Or=200;A.prop=r=>mr(r)!==58;_("[]",Or);_("{}",Or);c(":",dt-1,!0);var At=170,H=96,gt=36,ht=123,yt=92,Ct={n:`
8
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},Pr=()=>{let r=[];for(let t="",e;(e=l.charCodeAt(u))!==H;)e?e===yt?(C(),t+=Ct[l[u]]||l[u],C()):e===gt&&l.charCodeAt(u+1)===ht?(t&&r.push([,t]),t="",C(2),r.push(y(0,125))):(t+=l[u],C(),e=l.charCodeAt(u),e===H&&t&&r.push([,t])):v("Unterminated template");return C(),r},St=w[H];w[H]=(r,t)=>r&&t<At?A.asi&&A.newline?void 0:(C(),["``",r,...Pr()]):r?St?.(r,t):(C(),(e=>e.length<2&&e[0]?.[0]===void 0?e[0]||[,""]:["`",...e])(Pr()));A.string["'"]=!0;A.number={"0x":16,"0b":2,"0o":8};var Lr=(r,t,e,o)=>typeof r=="string"?i=>t(i,r,i):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o,i)):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i),i)):r[0]==="()"&&r.length===2?Lr(r[1],t):(()=>{throw Error("Invalid assignment target")})(),Rr={"=":(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 Rr)s(r,(t,e)=>(e=n(e),Lr(t,(o,i,p)=>Rr[r](o,i,e(p)))));s("!",r=>(r=n(r),t=>!r(t)));s("||",(r,t)=>(r=n(r),t=n(t),e=>r(e)||t(e)));s("&&",(r,t)=>(r=n(r),t=n(t),e=>r(e)&&t(e)));s("~",r=>(r=n(r),t=>~r(t)));s("|",(r,t)=>(r=n(r),t=n(t),e=>r(e)|t(e)));s("&",(r,t)=>(r=n(r),t=n(t),e=>r(e)&t(e)));s("^",(r,t)=>(r=n(r),t=n(t),e=>r(e)^t(e)));s(">>",(r,t)=>(r=n(r),t=n(t),e=>r(e)>>t(e)));s("<<",(r,t)=>(r=n(r),t=n(t),e=>r(e)<<t(e)));s(">",(r,t)=>(r=n(r),t=n(t),e=>r(e)>t(e)));s("<",(r,t)=>(r=n(r),t=n(t),e=>r(e)<t(e)));s(">=",(r,t)=>(r=n(r),t=n(t),e=>r(e)>=t(e)));s("<=",(r,t)=>(r=n(r),t=n(t),e=>r(e)<=t(e)));s("==",(r,t)=>(r=n(r),t=n(t),e=>r(e)==t(e)));s("!=",(r,t)=>(r=n(r),t=n(t),e=>r(e)!=t(e)));s("+",(r,t)=>t!==void 0?(r=n(r),t=n(t),e=>r(e)+t(e)):(r=n(r),e=>+r(e)));s("-",(r,t)=>t!==void 0?(r=n(r),t=n(t),e=>r(e)-t(e)):(r=n(r),e=>-r(e)));s("*",(r,t)=>(r=n(r),t=n(t),e=>r(e)*t(e)));s("/",(r,t)=>(r=n(r),t=n(t),e=>r(e)/t(e)));s("%",(r,t)=>(r=n(r),t=n(t),e=>r(e)%t(e)));var or=(r,t,e,o)=>typeof r=="string"?i=>t(i,r):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o)):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i))):r[0]==="()"&&r.length===2?or(r[1],t):(()=>{throw Error("Invalid increment target")})();s("++",(r,t)=>or(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));s("--",(r,t)=>or(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var Tr=(...r)=>(r=r.map(n),t=>{let e;for(let o of r)e=o(t);return e});s(",",Tr);s(";",Tr);var O=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",K=r=>{throw Error(r)};s("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=n(e[1]),o=>e(o)):(e=n(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&K("Missing index"),r=n(r),t=n(t),e=>{let o=t(e);return O(o)?void 0:r(e)[o]}));s(".",(r,t)=>(r=n(r),t=t[0]?t:t[1],O(t)?()=>{}:e=>r(e)[t]));s("()",(r,t)=>{if(t===void 0)return r==null?K("Empty ()"):n(r);let e=i=>i?.[0]===","&&i.slice(1).some(p=>p==null||e(p));e(t)&&K("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(n),i=>t.map(p=>p(i))):(t=n(t),i=>[t(i)]):()=>[];return nr(r,(i,p,m)=>i[p](...o(m)))});var N=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&N(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"?i=>t(i,r,i):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o,i)):r[0]==="?."?(e=n(r[1]),o=r[2],i=>{let p=e(i);return p==null?void 0:t(p,o,i)}):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i),i)):r[0]==="?.[]"?(e=n(r[1]),o=n(r[2]),i=>{let p=e(i);return p==null?void 0:t(p,o(i),i)}):(r=n(r),i=>t([r(i)],0,i)),P=nr;s("===",(r,t)=>(r=n(r),t=n(t),e=>r(e)===t(e)));s("!==",(r,t)=>(r=n(r),t=n(t),e=>r(e)!==t(e)));s("??",(r,t)=>(r=n(r),t=n(t),e=>r(e)??t(e)));var Et=r=>{throw Error(r)};s("**",(r,t)=>(r=n(r),t=n(t),e=>r(e)**t(e)));s("**=",(r,t)=>(N(r)||Et("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]**=t(i))));s("in",(r,t)=>(r=n(r),t=n(t),e=>r(e)in t(e)));var wt=r=>{throw Error(r)};s(">>>",(r,t)=>(r=n(r),t=n(t),e=>r(e)>>>t(e)));s(">>>=",(r,t)=>(N(r)||wt("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]>>>=t(i))));var It=r=>r[0]?.[0]===","?r[0].slice(1):r,M=(r,t,e)=>{if(typeof r=="string"){e[r]=t;return}let[o,...i]=r,p=It(i);if(o==="{}"){let m=[];for(let f of p){if(Array.isArray(f)&&f[0]==="..."){let E={};for(let T in t)m.includes(T)||(E[T]=t[T]);e[f[1]]=E;break}let d,g,S;typeof f=="string"?d=g=f:f[0]==="="?(typeof f[1]=="string"?d=g=f[1]:[,d,g]=f[1],S=f[2]):[,d,g]=f,m.push(d);let h=t[d];h===void 0&&S&&(h=n(S)(e)),M(g,h,e)}}else if(o==="[]"){let m=0;for(let f of p){if(f===null){m++;continue}if(Array.isArray(f)&&f[0]==="..."){e[f[1]]=t.slice(m);break}let d=f,g;Array.isArray(f)&&f[0]==="="&&([,d,g]=f);let S=t[m++];S===void 0&&g&&(S=n(g)(e)),M(d,S,e)}}},ir=(...r)=>(r=r.map(t=>{if(typeof t=="string")return e=>{e[t]=void 0};if(t[0]==="="){let[,e,o]=t,i=n(o);return typeof e=="string"?p=>{p[e]=i(p)}:p=>M(e,i(p),p)}return n(t)}),t=>{for(let e of r)e(t)});s("let",ir);s("const",ir);s("var",ir);var W=r=>{throw Error(r)};s("=",(r,t)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let e=r[1];return t=n(t),typeof e=="string"?o=>{o[e]=t(o)}:o=>M(e,t(o),o)}return N(r)||W("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]=t(i))});s("||=",(r,t)=>(N(r)||W("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]||=t(i))));s("&&=",(r,t)=>(N(r)||W("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]&&=t(i))));s("??=",(r,t)=>(N(r)||W("Invalid assignment target"),t=n(t),P(r,(e,o,i)=>e[o]??=t(i))));s("?",(r,t,e)=>(r=n(r),t=n(t),e=n(e),o=>r(o)?t(o):e(o)));var kt=[];s("=>",(r,t)=>{r=r?.[0]==="()"?r[1]:r;let e=r?r[0]===","?r.slice(1):[r]:[],o=-1,i=null,p=e[e.length-1];Array.isArray(p)&&p[0]==="..."&&(o=e.length-1,i=p[1],e.length--);let m=t?.[0]==="{}";return t=n(m?["{",t[1]]:t),f=>(...d)=>{let g={};e.forEach((h,E)=>g[h]=d[E]),i&&(g[i]=d.slice(o));let S=new Proxy(g,{get:(h,E)=>E in h?h[E]:f?.[E],set:(h,E,T)=>((E in h?h:f)[E]=T,!0),has:(h,E)=>E in h||(f?E in f:!1)});try{let h=t(S);return m?void 0:h}catch(h){if(h===kt)return h[0];throw h}}});s("...",r=>(r=n(r),t=>Object.entries(r(t))));s("?.",(r,t)=>(r=n(r),O(t)?()=>{}:e=>r(e)?.[t]));s("?.[]",(r,t)=>(r=n(r),t=n(t),e=>{let o=t(e);return O(o)?void 0:r(e)?.[o]}));s("?.()",(r,t)=>{let e=t?t[0]===","?(t=t.slice(1).map(n),i=>t.map(p=>p(i))):(t=n(t),i=>[t(i)]):()=>[];if(r[0]==="?."){let i=n(r[1]),p=r[2];return O(p)?()=>{}:m=>i(m)?.[p]?.(...e(m))}if(r[0]==="?.[]"){let i=n(r[1]),p=n(r[2]);return m=>{let f=i(m),d=p(m);return O(d)?void 0:f?.[d]?.(...e(m))}}if(r[0]==="."){let i=n(r[1]),p=r[2];return O(p)?()=>{}:m=>i(m)?.[p]?.(...e(m))}if(r[0]==="[]"&&r.length===3){let i=n(r[1]),p=n(r[2]);return m=>{let f=i(m),d=p(m);return O(d)?void 0:f?.[d]?.(...e(m))}}let o=n(r);return i=>o(i)?.(...e(i))});s("typeof",r=>(r=n(r),t=>typeof r(t)));s("void",r=>(r=n(r),t=>(r(t),void 0)));s("delete",r=>{if(r[0]==="."){let t=n(r[1]),e=r[2];return o=>delete t(o)[e]}if(r[0]==="[]"){let t=n(r[1]),e=n(r[2]);return o=>delete t(o)[e(o)]}return()=>!0});s("new",r=>{let t=n(r?.[0]==="()"?r[1]:r),e=r?.[0]==="()"?r[2]:null,o=e?e[0]===","?(i=>p=>i.map(m=>m(p)))(e.slice(1).map(n)):(i=>p=>[i(p)])(n(e)):()=>[];return i=>new(t(i))(...o(i))});var z=Symbol("accessor");s("get",(r,t)=>(t=t?n(t):()=>{},e=>[[z,r,{get:function(){let o=Object.create(e||{});return o.this=this,t(o)}}]]));s("set",(r,t,e)=>(e=e?n(e):()=>{},o=>[[z,r,{set:function(i){let p=Object.create(o||{});p.this=this,p[t]=i,e(p)}}]]));var vt=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);s("{}",(r,t)=>{if(t!==void 0)return;if(!vt(r))return n(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let e=r.map(o=>n(typeof o=="string"?[":",o,o]:o));return o=>{let i={},p={};for(let m of e.flatMap(f=>f(o)))if(m[0]===z){let[,f,d]=m;p[f]={...p[f],...d,configurable:!0,enumerable:!0}}else i[m[0]]=m[1];for(let m in p)Object.defineProperty(i,m,p[m]);return i}});s("{",r=>(r=r?n(r):()=>{},t=>r(Object.create(t))));s(":",(r,t)=>(t=n(t),Array.isArray(r)?(r=n(r),e=>[[r(e),t(e)]]):e=>[[r,t(e)]]));s("`",(...r)=>(r=r.map(n),t=>r.map(e=>e(t)).join("")));s("``",(r,...t)=>{r=n(r);let e=[],o=[];for(let p of t)Array.isArray(p)&&p[0]===void 0?e.push(p[1]):o.push(n(p));let i=Object.assign([...e],{raw:e});return p=>r(p)(i,...o.map(m=>m(p)))});var Ur=new WeakMap,Nt=(r,...t)=>typeof r=="string"?n(A(r)):Ur.get(r)||Ur.set(r,Ot(r,t)).get(r),_r=57344,Ot=(r,t)=>{let e=r.reduce((p,m,f)=>p+(f?String.fromCharCode(_r+f-1):"")+m,""),o=A(e),i=p=>{if(typeof p=="string"&&p.length===1){let m=p.charCodeAt(0)-_r,f;if(m>=0&&m<t.length)return f=t[m],Pt(f)?f:[,f]}return Array.isArray(p)?p.map(i):p};return n(i(o))},Pt=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Rt=Nt;export{Z as access,c as binary,n as compile,l as cur,Rt as default,v as err,y as expr,_ as group,Lt as id,u as idx,F as keyword,L as literal,pr as loc,w as lookup,Y as nary,R as next,s as operator,V as operators,Tt as parens,A as parse,mr as peek,sr as prec,D as seek,C as skip,U as space,J as step,I as token,k as unary,fr as word};
4
+ `,""+i}${m}${f}`)},ir=(r,t=u)=>(Array.isArray(r)&&(r.loc=t),r),L=(r,t=u,e)=>{for(;e=r(l.charCodeAt(u));)u+=e;return l.slice(t,u)},C=(r=1)=>l[u+=r],M=r=>u=r,y=(r=0,t)=>{let e,o,i;for(t&&d.enter?.(r,t);(e=d.space())&&e!==t&&(i=d.step(o,r,e,y));)o=i;return t&&(e==t?(u++,d.exit?.(r,t)):v("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},sr=(r=u)=>{for(;l.charCodeAt(r)<=32;)r++;return l.charCodeAt(r)},Rt=d.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,pr=(r,t=r.length)=>l.substr(u,t)===r&&!d.id(l.charCodeAt(u+t)),Lt=()=>(C(),y(0,41)),w=[],nr={},I=(r,t=32,e,o=r.charCodeAt(0),i=r.length,p=w[o],m=r.toUpperCase()!==r,f,A)=>(t=nr[r]=!p&&nr[r]||t,w[o]=(h,S,g,E=u)=>(f=g,(g?r==g:(i<2||r.charCodeAt(1)===l.charCodeAt(u+1)&&(i<3||l.substr(u,i)==r))&&(!m||!d.id(l.charCodeAt(u+i)))&&(f=g=r))&&S<t&&(u+=i,(A=e(h))?ir(A,E):(u=E,f=0,!m&&!p&&!h&&v()),A)||p?.(h,S,f))),c=(r,t,e=!1)=>I(r,t,o=>o&&(i=>i&&[r,o,i])(y(t-(e?.5:0)))),k=(r,t,e)=>I(r,t,o=>e?o&&[r,o]:!o&&(o=y(t-.5))&&[r,o]),P=(r,t)=>I(r,200,e=>!e&&[,t]),J=(r,t,e)=>I(r,t,(o,i)=>(i=y(t-(e?.5:0)),o?.[0]!==r&&(o=[r,o||null]),i?.[0]===r?o.push(...i.slice(1)):o.push(i||null),o)),U=(r,t)=>I(r[0],t,e=>!e&&[r,y(0,r.charCodeAt(1))||null]),V=(r,t)=>I(r[0],t,e=>e&&[r,e,y(0,r.charCodeAt(1))||null]),D=(r,t,e,o=r.charCodeAt(0),i=r.length,p=w[o],m)=>w[o]=(f,A,h,S=u)=>!f&&(h?r==h:(i<2||l.substr(u,i)==r)&&(h=r))&&A<t&&!d.id(l.charCodeAt(u+i))&&(!d.prop||d.prop(u+i))&&(M(u+i),(m=e())?ir(m,S):M(S),m)||p?.(f,A,h);d.space=r=>{for(;(r=l.charCodeAt(u))<=32;)u++;return r};d.step=(r,t,e,o,i)=>(i=w[e])&&i(r,t)||(r?null:L(d.id)||null);var z={},s=(r,t,e=z[r])=>z[r]=(...o)=>t(...o)||e?.(...o),n=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):z[r[0]]?.(...r.slice(1))??v(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var G=46,_=48,X=57,Ur=69,_r=101,Br=43,ar=45,F=95,mr=110,Mr=97,Dr=102,Fr=65,Gr=70,fr=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),Y=r=>{let t=fr(L(e=>e===G&&l.charCodeAt(u+1)!==G||e>=_&&e<=X||e===F||((e===Ur||e===_r)&&((e=l.charCodeAt(u+1))>=_&&e<=X||e===Br||e===ar)?2:0)));return l.charCodeAt(u)===mr?(C(),[,BigInt(t)]):(r=+t)!=r?v():[,r]},Xr={2:r=>r===48||r===49||r===F,8:r=>r>=48&&r<=55||r===F,16:r=>r>=_&&r<=X||r>=Mr&&r<=Dr||r>=Fr&&r<=Gr||r===F};d.number=null;w[G]=r=>!r&&l.charCodeAt(u+1)!==G&&Y();for(let r=_;r<=X;r++)w[r]=t=>t?void 0:Y();w[_]=r=>{if(r)return;let t=d.number;if(t){for(let[e,o]of Object.entries(t))if(e[0]==="0"&&l[u+1]?.toLowerCase()===e[1]){C(2);let i=fr(L(Xr[o]));return l.charCodeAt(u)===mr?(C(),[,BigInt("0"+e[1]+i)]):[,parseInt(i,o)]}}return Y()};var $r=92,ur=34,lr=39,cr=117,dr=120,Qr=123,Hr=125,Ar=10,jr=13,Kr={n:`
5
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},hr=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,gr=r=>(t,e,o="",i=String.fromCharCode(r))=>{if(t||!d.string?.[i])return;C();let p=()=>{let m=l.charCodeAt(u+1);if(m===Ar)return 2;if(m===jr)return l.charCodeAt(u+2)===Ar?3:2;if(m===dr||m===cr&&l.charCodeAt(u+2)!==Qr){let f=m===dr?2:4,A=0,h;for(let S=0;S<f;S++){if((h=hr(l.charCodeAt(u+2+S)))<0)return o+=l[u+1],2;A=A*16+h}return o+=String.fromCharCode(A),2+f}if(m===cr){let f=0,A=u+3,h;for(;(h=hr(l.charCodeAt(A)))>=0;)f=f*16+h,A++;return A>u+3&&f<=1114111&&l.charCodeAt(A)===Hr?(o+=String.fromCodePoint(f),A-u+1):(o+=l[u+1],2)}return o+=Kr[l[u+1]]||l[u+1],2};return L(m=>m-r&&(m!==$r?(o+=l[u],1):p())),l[u]===i?C():v("Bad string"),[,o]};w[ur]=gr(ur);w[lr]=gr(lr);d.string={'"':!0};var Wr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>c(r,Wr,!0));var zr=30,Jr=40,Vr=140;k("!",Vr);c("||",zr);c("&&",Jr);var Yr=50,Zr=60,qr=70,yr=100,xr=140;c("|",Yr);c("&",qr);c("^",Zr);c(">>",yr);c("<<",yr);k("~",xr);var $=90;c("<",$);c(">",$);c("<=",$);c(">=",$);var Cr=80;c("==",Cr);c("!=",Cr);var Sr=110,Z=120,Er=140;c("+",Sr);c("-",Sr);c("*",Z);c("/",Z);c("%",Z);k("+",Er);k("-",Er);var Q=150;I("++",Q,r=>r?["++",r,null]:["++",y(Q-1)]);I("--",Q,r=>r?["--",r,null]:["--",y(Q-1)]);var br=5,rt=10;J(",",rt);J(";",br,!0);var tt=170;U("()",tt);var q=170;V("[]",q);c(".",q);V("()",q);var et=32,ot=d.space;d.comment??={"//":`
6
+ `,"/*":"*/"};var x;d.space=()=>{x||(x=Object.entries(d.comment).map(([i,p])=>[i,p,i.charCodeAt(0)]));for(var r;r=ot();){for(var t=0,e;e=x[t++];)if(r===e[2]&&l.substr(u,e[0].length)===e[0]){var o=u+e[0].length;if(e[1]===`
7
+ `)for(;l.charCodeAt(o)>=et;)o++;else{for(;l[o]&&l.substr(o,e[1].length)!==e[1];)o++;l[o]&&(o+=e[1].length)}M(o),r=0;break}if(r)return r}return r};var wr=80;c("===",wr);c("!==",wr);var nt=30;c("??",nt);var it=130,st=20;c("**",it,!0);c("**=",st,!0);var Ir=90;c("in",Ir);c("of",Ir);var pt=20,mt=100;c(">>>",mt);c(">>>=",pt,!0);var b=20;c("||=",b,!0);c("&&=",b,!0);c("??=",b,!0);P("true",!0);P("false",!1);P("null",null);D("undefined",200,()=>[]);P("NaN",NaN);P("Infinity",1/0);var rr=20;I("?",rr,(r,t,e)=>r&&(t=y(rr-1))&&L(o=>o===58)&&(e=y(rr-1),["?",r,t,e]));var ft=20;c("=>",ft,!0);var ut=20;k("...",ut);var kr=170;I("?.",kr,(r,t)=>{if(!r)return;let e=d.space();return e===40?(C(),["?.()",r,y(0,41)||null]):e===91?(C(),["?.[]",r,y(0,93)]):(t=y(kr),t?["?.",r,t]:void 0)});var B=140;k("typeof",B);k("void",B);k("delete",B);D("new",B,()=>pr(".target")?(C(7),["new.target"]):["new",y(B)]);var lt=20,vr=200;d.prop=r=>sr(r)!==58;U("[]",vr);U("{}",vr);c(":",lt-1,!0);var ct=170,H=96,dt=36,At=123,ht=92,gt={n:`
8
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},Nr=()=>{let r=[];for(let t="",e;(e=l.charCodeAt(u))!==H;)e?e===ht?(C(),t+=gt[l[u]]||l[u],C()):e===dt&&l.charCodeAt(u+1)===At?(t&&r.push([,t]),t="",C(2),r.push(y(0,125))):(t+=l[u],C(),e=l.charCodeAt(u),e===H&&t&&r.push([,t])):v("Unterminated template");return C(),r},yt=w[H];w[H]=(r,t)=>r&&t<ct?d.asi&&d.newline?void 0:(C(),["``",r,...Nr()]):r?yt?.(r,t):(C(),(e=>e.length<2&&e[0]?.[0]===void 0?e[0]||[,""]:["`",...e])(Nr()));d.string["'"]=!0;d.number={"0x":16,"0b":2,"0o":8};var Rr=(r,t,e,o)=>typeof r=="string"?i=>t(i,r,i):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o,i)):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i),i)):r[0]==="()"&&r.length===2?Rr(r[1],t):(()=>{throw Error("Invalid assignment target")})(),Or={"=":(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 Or)s(r,(t,e)=>(e=n(e),Rr(t,(o,i,p)=>Or[r](o,i,e(p)))));s("!",r=>(r=n(r),t=>!r(t)));s("||",(r,t)=>(r=n(r),t=n(t),e=>r(e)||t(e)));s("&&",(r,t)=>(r=n(r),t=n(t),e=>r(e)&&t(e)));s("~",r=>(r=n(r),t=>~r(t)));s("|",(r,t)=>(r=n(r),t=n(t),e=>r(e)|t(e)));s("&",(r,t)=>(r=n(r),t=n(t),e=>r(e)&t(e)));s("^",(r,t)=>(r=n(r),t=n(t),e=>r(e)^t(e)));s(">>",(r,t)=>(r=n(r),t=n(t),e=>r(e)>>t(e)));s("<<",(r,t)=>(r=n(r),t=n(t),e=>r(e)<<t(e)));s(">",(r,t)=>(r=n(r),t=n(t),e=>r(e)>t(e)));s("<",(r,t)=>(r=n(r),t=n(t),e=>r(e)<t(e)));s(">=",(r,t)=>(r=n(r),t=n(t),e=>r(e)>=t(e)));s("<=",(r,t)=>(r=n(r),t=n(t),e=>r(e)<=t(e)));s("==",(r,t)=>(r=n(r),t=n(t),e=>r(e)==t(e)));s("!=",(r,t)=>(r=n(r),t=n(t),e=>r(e)!=t(e)));s("+",(r,t)=>t!==void 0?(r=n(r),t=n(t),e=>r(e)+t(e)):(r=n(r),e=>+r(e)));s("-",(r,t)=>t!==void 0?(r=n(r),t=n(t),e=>r(e)-t(e)):(r=n(r),e=>-r(e)));s("*",(r,t)=>(r=n(r),t=n(t),e=>r(e)*t(e)));s("/",(r,t)=>(r=n(r),t=n(t),e=>r(e)/t(e)));s("%",(r,t)=>(r=n(r),t=n(t),e=>r(e)%t(e)));var tr=(r,t,e,o)=>typeof r=="string"?i=>t(i,r):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o)):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i))):r[0]==="()"&&r.length===2?tr(r[1],t):(()=>{throw Error("Invalid increment target")})();s("++",(r,t)=>tr(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));s("--",(r,t)=>tr(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var Lr=(...r)=>(r=r.map(n),t=>{let e;for(let o of r)e=o(t);return e});s(",",Lr);s(";",Lr);var O=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",j=r=>{throw Error(r)};s("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=n(e[1]),o=>e(o)):(e=n(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&j("Missing index"),r=n(r),t=n(t),e=>{let o=t(e);return O(o)?void 0:r(e)[o]}));s(".",(r,t)=>(r=n(r),t=t[0]?t:t[1],O(t)?()=>{}:e=>r(e)[t]));s("()",(r,t)=>{if(t===void 0)return r==null?j("Empty ()"):n(r);let e=i=>i?.[0]===","&&i.slice(1).some(p=>p==null||e(p));e(t)&&j("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(n),i=>t.map(p=>p(i))):(t=n(t),i=>[t(i)]):()=>[];return er(r,(i,p,m)=>i[p](...o(m)))});var N=r=>typeof r=="string"||Array.isArray(r)&&(r[0]==="."||r[0]==="?."||r[0]==="[]"&&r.length===3||r[0]==="?.[]"||r[0]==="()"&&r.length===2&&N(r[1])||r[0]==="{}"),er=(r,t,e,o)=>r==null?j("Empty ()"):r[0]==="()"&&r.length==2?er(r[1],t):typeof r=="string"?i=>t(i,r,i):r[0]==="."?(e=n(r[1]),o=r[2],i=>t(e(i),o,i)):r[0]==="?."?(e=n(r[1]),o=r[2],i=>{let p=e(i);return p==null?void 0:t(p,o,i)}):r[0]==="[]"&&r.length===3?(e=n(r[1]),o=n(r[2]),i=>t(e(i),o(i),i)):r[0]==="?.[]"?(e=n(r[1]),o=n(r[2]),i=>{let p=e(i);return p==null?void 0:t(p,o(i),i)}):(r=n(r),i=>t([r(i)],0,i)),R=er;s("===",(r,t)=>(r=n(r),t=n(t),e=>r(e)===t(e)));s("!==",(r,t)=>(r=n(r),t=n(t),e=>r(e)!==t(e)));s("??",(r,t)=>(r=n(r),t=n(t),e=>r(e)??t(e)));var Ct=r=>{throw Error(r)};s("**",(r,t)=>(r=n(r),t=n(t),e=>r(e)**t(e)));s("**=",(r,t)=>(N(r)||Ct("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]**=t(i))));s("in",(r,t)=>(r=n(r),t=n(t),e=>r(e)in t(e)));var St=r=>{throw Error(r)};s(">>>",(r,t)=>(r=n(r),t=n(t),e=>r(e)>>>t(e)));s(">>>=",(r,t)=>(N(r)||St("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]>>>=t(i))));var Et=r=>r[0]?.[0]===","?r[0].slice(1):r,a=(r,t,e)=>{if(typeof r=="string"){e[r]=t;return}let[o,...i]=r,p=Et(i);if(o==="{}"){let m=[];for(let f of p){if(Array.isArray(f)&&f[0]==="..."){let E={};for(let T in t)m.includes(T)||(E[T]=t[T]);e[f[1]]=E;break}let A,h,S;typeof f=="string"?A=h=f:f[0]==="="?(typeof f[1]=="string"?A=h=f[1]:[,A,h]=f[1],S=f[2]):[,A,h]=f,m.push(A);let g=t[A];g===void 0&&S&&(g=n(S)(e)),a(h,g,e)}}else if(o==="[]"){let m=0;for(let f of p){if(f===null){m++;continue}if(Array.isArray(f)&&f[0]==="..."){e[f[1]]=t.slice(m);break}let A=f,h;Array.isArray(f)&&f[0]==="="&&([,A,h]=f);let S=t[m++];S===void 0&&h&&(S=n(h)(e)),a(A,S,e)}}},or=(...r)=>(r=r.map(t=>{if(typeof t=="string")return e=>{e[t]=void 0};if(t[0]==="="){let[,e,o]=t,i=n(o);return typeof e=="string"?p=>{p[e]=i(p)}:p=>a(e,i(p),p)}return n(t)}),t=>{for(let e of r)e(t)});s("let",or);s("const",or);s("var",or);var K=r=>{throw Error(r)};s("=",(r,t)=>{if(Array.isArray(r)&&(r[0]==="let"||r[0]==="const"||r[0]==="var")){let e=r[1];return t=n(t),typeof e=="string"?o=>{o[e]=t(o)}:o=>a(e,t(o),o)}return N(r)||K("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]=t(i))});s("||=",(r,t)=>(N(r)||K("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]||=t(i))));s("&&=",(r,t)=>(N(r)||K("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]&&=t(i))));s("??=",(r,t)=>(N(r)||K("Invalid assignment target"),t=n(t),R(r,(e,o,i)=>e[o]??=t(i))));s("?",(r,t,e)=>(r=n(r),t=n(t),e=n(e),o=>r(o)?t(o):e(o)));var wt=[];s("=>",(r,t)=>{r=r?.[0]==="()"?r[1]:r;let e=r?r[0]===","?r.slice(1):[r]:[],o=-1,i=null,p=e[e.length-1];Array.isArray(p)&&p[0]==="..."&&(o=e.length-1,i=p[1],e.length--);let m=t?.[0]==="{}";return t=n(m?["{",t[1]]:t),f=>(...A)=>{let h={};e.forEach((g,E)=>h[g]=A[E]),i&&(h[i]=A.slice(o));let S=new Proxy(h,{get:(g,E)=>E in g?g[E]:f?.[E],set:(g,E,T)=>((E in g?g:f)[E]=T,!0),has:(g,E)=>E in g||(f?E in f:!1)});try{let g=t(S);return m?void 0:g}catch(g){if(g===wt)return g[0];throw g}}});s("...",r=>(r=n(r),t=>Object.entries(r(t))));s("?.",(r,t)=>(r=n(r),O(t)?()=>{}:e=>r(e)?.[t]));s("?.[]",(r,t)=>(r=n(r),t=n(t),e=>{let o=t(e);return O(o)?void 0:r(e)?.[o]}));s("?.()",(r,t)=>{let e=t?t[0]===","?(t=t.slice(1).map(n),i=>t.map(p=>p(i))):(t=n(t),i=>[t(i)]):()=>[];if(r[0]==="?."){let i=n(r[1]),p=r[2];return O(p)?()=>{}:m=>i(m)?.[p]?.(...e(m))}if(r[0]==="?.[]"){let i=n(r[1]),p=n(r[2]);return m=>{let f=i(m),A=p(m);return O(A)?void 0:f?.[A]?.(...e(m))}}if(r[0]==="."){let i=n(r[1]),p=r[2];return O(p)?()=>{}:m=>i(m)?.[p]?.(...e(m))}if(r[0]==="[]"&&r.length===3){let i=n(r[1]),p=n(r[2]);return m=>{let f=i(m),A=p(m);return O(A)?void 0:f?.[A]?.(...e(m))}}let o=n(r);return i=>o(i)?.(...e(i))});s("typeof",r=>(r=n(r),t=>typeof r(t)));s("void",r=>(r=n(r),t=>(r(t),void 0)));s("delete",r=>{if(r[0]==="."){let t=n(r[1]),e=r[2];return o=>delete t(o)[e]}if(r[0]==="[]"){let t=n(r[1]),e=n(r[2]);return o=>delete t(o)[e(o)]}return()=>!0});s("new",r=>{let t=n(r?.[0]==="()"?r[1]:r),e=r?.[0]==="()"?r[2]:null,o=e?e[0]===","?(i=>p=>i.map(m=>m(p)))(e.slice(1).map(n)):(i=>p=>[i(p)])(n(e)):()=>[];return i=>new(t(i))(...o(i))});var W=Symbol("accessor");s("get",(r,t)=>(t=t?n(t):()=>{},e=>[[W,r,{get:function(){let o=Object.create(e||{});return o.this=this,t(o)}}]]));s("set",(r,t,e)=>(e=e?n(e):()=>{},o=>[[W,r,{set:function(i){let p=Object.create(o||{});p.this=this,p[t]=i,e(p)}}]]));var It=r=>r==null||typeof r=="string"||[":",",","...","get","set"].includes(r[0]);s("{}",(r,t)=>{if(t!==void 0)return;if(!It(r))return n(["{",r]);r=r?r[0]!==","?[r]:r.slice(1):[];let e=r.map(o=>n(typeof o=="string"?[":",o,o]:o));return o=>{let i={},p={};for(let m of e.flatMap(f=>f(o)))if(m[0]===W){let[,f,A]=m;p[f]={...p[f],...A,configurable:!0,enumerable:!0}}else i[m[0]]=m[1];for(let m in p)Object.defineProperty(i,m,p[m]);return i}});s("{",r=>(r=r?n(r):()=>{},t=>r(Object.create(t))));s(":",(r,t)=>(t=n(t),Array.isArray(r)?(r=n(r),e=>[[r(e),t(e)]]):e=>[[r,t(e)]]));s("`",(...r)=>(r=r.map(n),t=>r.map(e=>e(t)).join("")));s("``",(r,...t)=>{r=n(r);let e=[],o=[];for(let p of t)Array.isArray(p)&&p[0]===void 0?e.push(p[1]):o.push(n(p));let i=Object.assign([...e],{raw:e});return p=>r(p)(i,...o.map(m=>m(p)))});var Pr=new WeakMap,kt=(r,...t)=>typeof r=="string"?n(d(r)):Pr.get(r)||Pr.set(r,vt(r,t)).get(r),Tr=57344,vt=(r,t)=>{let e=r.reduce((p,m,f)=>p+(f?String.fromCharCode(Tr+f-1):"")+m,""),o=d(e),i=p=>{if(typeof p=="string"&&p.length===1){let m=p.charCodeAt(0)-Tr,f;if(m>=0&&m<t.length)return f=t[m],Nt(f)?f:[,f]}return Array.isArray(p)?p.map(i):p};return n(i(o))},Nt=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Ot=kt;export{V as access,c as binary,n as compile,l as cur,Ot as default,v as err,y as expr,U as group,Rt as id,u as idx,D as keyword,P as literal,ir as loc,w as lookup,J as nary,L as next,s as operator,z as operators,Lt as parens,d as parse,sr as peek,nr as prec,M as seek,C as skip,I as token,k as unary,pr as word};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "subscript",
3
- "version": "10.4.7",
3
+ "version": "10.4.9",
4
4
  "description": "Modular expression parser & evaluator",
5
5
  "main": "subscript.js",
6
6
  "module": "subscript.js",
@@ -76,6 +76,7 @@
76
76
  "devDependencies": {
77
77
  "@playwright/test": "^1.57.0",
78
78
  "esbuild": "^0.27.2",
79
+ "oxc-parser": "^0.130.0",
79
80
  "terser": "^5.44.1",
80
81
  "tst": "^9.2.1"
81
82
  }
package/parse.js CHANGED
@@ -43,24 +43,13 @@ export let idx, cur,
43
43
  let cc, token, newNode;
44
44
  if (end) parse.enter?.(p, end);
45
45
 
46
- while ((cc = space()) && cc !== end && (newNode = step(token, p, cc, expr))) token = newNode;
46
+ while ((cc = parse.space()) && cc !== end && (newNode = parse.step(token, p, cc, expr))) token = newNode;
47
47
 
48
48
  if (end) cc == end ? (idx++, parse.exit?.(p, end)) : err('Unclosed ' + String.fromCharCode(end - (end > 42 ? 2 : 1)));
49
49
 
50
50
  return token;
51
51
  },
52
52
 
53
- // one Pratt iteration: try operator, else identifier (only at start). Returns
54
- // truthy node or null (never `false`/`undefined`, so wrapper overrides can
55
- // chain via `??`).
56
- step = (a, p, cc, expr, fn) => ((fn = lookup[cc]) && fn(a, p)) || (a ? null : next(parse.id) || null),
57
-
58
- // skip space chars, return first non-space character
59
- space = (cc) => {
60
- while ((cc = cur.charCodeAt(idx)) <= SPACE) idx++;
61
- return cc;
62
- },
63
-
64
53
  // peek at next non-space char without modifying idx
65
54
  peek = (from = idx) => { while (cur.charCodeAt(from) <= SPACE) from++; return cur.charCodeAt(from); },
66
55
 
@@ -139,20 +128,17 @@ export let idx, cur,
139
128
  (seek(idx + l), (r = map()) ? loc(r, from) : seek(from), r) ||
140
129
  prev?.(a, curPrec, curOp);
141
130
 
142
- // Keep parse.space / parse.step overrides in sync with the exported bindings,
143
- // so wrappers installed via parse.X = ... are picked up by the hot loops here.
144
- Object.defineProperty(parse, 'space', {
145
- configurable: true,
146
- enumerable: true,
147
- get: () => space,
148
- set: fn => (space = fn)
149
- });
150
- Object.defineProperty(parse, 'step', {
151
- configurable: true,
152
- enumerable: true,
153
- get: () => step,
154
- set: fn => (step = fn)
155
- });
131
+ // Skip space chars, return first non-space character.
132
+ // Wrappers (comment, asi) compose by reading the previous parse.space first.
133
+ parse.space = (cc) => {
134
+ while ((cc = cur.charCodeAt(idx)) <= SPACE) idx++;
135
+ return cc;
136
+ };
137
+
138
+ // One Pratt iteration: try operator, else identifier (only at start).
139
+ // Returns truthy node or null so wrapper overrides can chain via `??`.
140
+ parse.step = (a, p, cc, expr, fn) =>
141
+ ((fn = lookup[cc]) && fn(a, p)) || (a ? null : next(parse.id) || null);
156
142
 
157
143
  // === Compile: AST → Evaluator ===
158
144
 
package/subscript.min.js CHANGED
@@ -1,5 +1,5 @@
1
- var s,p,A=r=>(s=0,p=r,A.enter?.(),r=g(),p[s]?S():r||""),S=(r="Unexpected token",t=s,e=p.slice(0,t).split(`
2
- `),o=e.pop(),n=p.slice(Math.max(0,t-40),t),m="\u032D",f=(p[t]||" ")+m,d=p.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
1
+ var s,p,d=r=>(s=0,p=r,d.enter?.(),r=g(),p[s]?S():r||""),S=(r="Unexpected token",t=s,e=p.slice(0,t).split(`
2
+ `),o=e.pop(),n=p.slice(Math.max(0,t-40),t),m="\u032D",f=(p[t]||" ")+m,A=p.slice(t+1,t+20))=>{throw SyntaxError(`${r} at ${e.length+1}:${o.length+1}
3
3
  ${p[t-41]!==`
4
- `,""+n}${f}${d}`)},J=(r,t=s)=>(Array.isArray(r)&&(r.loc=t),r),I=(r,t=s,e)=>{for(;e=r(p.charCodeAt(s));)s+=e;return p.slice(t,s)},w=(r=1)=>p[s+=r],W=r=>s=r,g=(r=0,t)=>{let e,o,n;for(t&&A.enter?.(r,t);(e=N())&&e!==t&&(n=F(o,r,e,g));)o=n;return t&&(e==t?(s++,A.exit?.(r,t)):S("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},F=(r,t,e,o,n)=>(n=C[e])&&n(r,t)||(r?null:I(A.id)||null),N=r=>{for(;(r=p.charCodeAt(s))<=32;)s++;return r},vr=(r=s)=>{for(;p.charCodeAt(r)<=32;)r++;return p.charCodeAt(r)},Gr=A.id=r=>r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r==36||r==95||r>=192&&r!=215&&r!=247,Wr=(r,t=r.length)=>p.substr(s,t)===r&&!A.id(p.charCodeAt(s+t)),zr=()=>(w(),g(0,41)),C=[],z={},E=(r,t=32,e,o=r.charCodeAt(0),n=r.length,m=C[o],f=r.toUpperCase()!==r,d,h)=>(t=z[r]=!m&&z[r]||t,C[o]=(c,y,R,G=s)=>(d=R,(R?r==R:(n<2||r.charCodeAt(1)===p.charCodeAt(s+1)&&(n<3||p.substr(s,n)==r))&&(!f||!A.id(p.charCodeAt(s+n)))&&(d=R=r))&&y<t&&(s+=n,(h=e(c))?J(h,G):(s=G,d=0,!f&&!m&&!c&&S()),h)||m?.(c,y,d))),u=(r,t,e=!1)=>E(r,t,o=>o&&(n=>n&&[r,o,n])(g(t-(e?.5:0)))),_=(r,t,e)=>E(r,t,o=>e?o&&[r,o]:!o&&(o=g(t-.5))&&[r,o]),Jr=(r,t)=>E(r,200,e=>!e&&[,t]),$=(r,t,e)=>E(r,t,(o,n)=>(n=g(t-(e?.5:0)),o?.[0]!==r&&(o=[r,o||null]),n?.[0]===r?o.push(...n.slice(1)):o.push(n||null),o)),K=(r,t)=>E(r[0],t,e=>!e&&[r,g(0,r.charCodeAt(1))||null]),B=(r,t)=>E(r[0],t,e=>e&&[r,e,g(0,r.charCodeAt(1))||null]),Kr=(r,t,e,o=r.charCodeAt(0),n=r.length,m=C[o],f)=>C[o]=(d,h,c,y=s)=>!d&&(c?r==c:(n<2||p.substr(s,n)==r)&&(c=r))&&h<t&&!A.id(p.charCodeAt(s+n))&&(!A.prop||A.prop(s+n))&&(W(s+n),(f=e())?J(f,y):W(y),f)||m?.(d,h,c);Object.defineProperty(A,"space",{configurable:!0,enumerable:!0,get:()=>N,set:r=>N=r});Object.defineProperty(A,"step",{configurable:!0,enumerable:!0,get:()=>F,set:r=>F=r});var O={},l=(r,t,e=O[r])=>O[r]=(...o)=>t(...o)||e?.(...o),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):O[r[0]]?.(...r.slice(1))??S(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var T=46,P=48,k=57,dr=69,Ar=101,hr=43,cr=45,U=95,V=110,Cr=97,gr=102,yr=65,Er=70,Y=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),X=r=>{let t=Y(I(e=>e===T&&p.charCodeAt(s+1)!==T||e>=P&&e<=k||e===U||((e===dr||e===Ar)&&((e=p.charCodeAt(s+1))>=P&&e<=k||e===hr||e===cr)?2:0)));return p.charCodeAt(s)===V?(w(),[,BigInt(t)]):(r=+t)!=r?S():[,r]},Sr={2:r=>r===48||r===49||r===U,8:r=>r>=48&&r<=55||r===U,16:r=>r>=P&&r<=k||r>=Cr&&r<=gr||r>=yr&&r<=Er||r===U};A.number=null;C[T]=r=>!r&&p.charCodeAt(s+1)!==T&&X();for(let r=P;r<=k;r++)C[r]=t=>t?void 0:X();C[P]=r=>{if(r)return;let t=A.number;if(t){for(let[e,o]of Object.entries(t))if(e[0]==="0"&&p[s+1]?.toLowerCase()===e[1]){w(2);let n=Y(I(Sr[o]));return p.charCodeAt(s)===V?(w(),[,BigInt("0"+e[1]+n)]):[,parseInt(n,o)]}}return X()};var wr=92,Z=34,q=39,x=117,j=120,_r=123,Ir=125,a=10,Pr=13,Rr={n:`
5
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},b=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,rr=r=>(t,e,o="",n=String.fromCharCode(r))=>{if(t||!A.string?.[n])return;w();let m=()=>{let f=p.charCodeAt(s+1);if(f===a)return 2;if(f===Pr)return p.charCodeAt(s+2)===a?3:2;if(f===j||f===x&&p.charCodeAt(s+2)!==_r){let d=f===j?2:4,h=0,c;for(let y=0;y<d;y++){if((c=b(p.charCodeAt(s+2+y)))<0)return o+=p[s+1],2;h=h*16+c}return o+=String.fromCharCode(h),2+d}if(f===x){let d=0,h=s+3,c;for(;(c=b(p.charCodeAt(h)))>=0;)d=d*16+c,h++;return h>s+3&&d<=1114111&&p.charCodeAt(h)===Ir?(o+=String.fromCodePoint(d),h-s+1):(o+=p[s+1],2)}return o+=Rr[p[s+1]]||p[s+1],2};return I(f=>f-r&&(f!==wr?(o+=p[s],1):m())),p[s]===n?w():S("Bad string"),[,o]};C[Z]=rr(Z);C[q]=rr(q);A.string={'"':!0};var Ur=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>u(r,Ur,!0));var Tr=30,kr=40,Lr=140;_("!",Lr);u("||",Tr);u("&&",kr);var Dr=50,Mr=60,Fr=70,tr=100,Nr=140;u("|",Dr);u("&",Fr);u("^",Mr);u(">>",tr);u("<<",tr);_("~",Nr);var L=90;u("<",L);u(">",L);u("<=",L);u(">=",L);var er=80;u("==",er);u("!=",er);var or=110,Q=120,nr=140;u("+",or);u("-",or);u("*",Q);u("/",Q);u("%",Q);_("+",nr);_("-",nr);var D=150;E("++",D,r=>r?["++",r,null]:["++",g(D-1)]);E("--",D,r=>r?["--",r,null]:["--",g(D-1)]);var Or=5,$r=10;$(",",$r);$(";",Or,!0);var Br=170;K("()",Br);var H=170;B("[]",H);u(".",H);B("()",H);var sr=(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?sr(r[1],t):(()=>{throw Error("Invalid assignment target")})(),ir={"=":(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 ir)l(r,(t,e)=>(e=i(e),sr(t,(o,n,m)=>ir[r](o,n,e(m)))));l("!",r=>(r=i(r),t=>!r(t)));l("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));l("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));l("~",r=>(r=i(r),t=>~r(t)));l("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));l("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));l("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));l(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));l("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));l(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));l("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));l(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));l("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));l("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));l("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));l("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));l("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));l("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));l("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));l("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var v=(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?v(r[1],t):(()=>{throw Error("Invalid increment target")})();l("++",(r,t)=>v(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));l("--",(r,t)=>v(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var pr=(...r)=>(r=r.map(i),t=>{let e;for(let o of r)e=o(t);return e});l(",",pr);l(";",pr);var lr=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",M=r=>{throw Error(r)};l("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=i(e[1]),o=>e(o)):(e=i(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&M("Missing index"),r=i(r),t=i(t),e=>{let o=t(e);return lr(o)?void 0:r(e)[o]}));l(".",(r,t)=>(r=i(r),t=t[0]?t:t[1],lr(t)?()=>{}:e=>r(e)[t]));l("()",(r,t)=>{if(t===void 0)return r==null?M("Empty ()"):i(r);let e=n=>n?.[0]===","&&n.slice(1).some(m=>m==null||e(m));e(t)&&M("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(i),n=>t.map(m=>m(n))):(t=i(t),n=>[t(n)]):()=>[];return mr(r,(n,m,f)=>n[m](...o(f)))});var mr=(r,t,e,o)=>r==null?M("Empty ()"):r[0]==="()"&&r.length==2?mr(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 m=e(n);return m==null?void 0:t(m,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 m=e(n);return m==null?void 0:t(m,o(n),n)}):(r=i(r),n=>t([r(n)],0,n));var ur=new WeakMap,Xr=(r,...t)=>typeof r=="string"?i(A(r)):ur.get(r)||ur.set(r,Qr(r,t)).get(r),fr=57344,Qr=(r,t)=>{let e=r.reduce((m,f,d)=>m+(d?String.fromCharCode(fr+d-1):"")+f,""),o=A(e),n=m=>{if(typeof m=="string"&&m.length===1){let f=m.charCodeAt(0)-fr,d;if(f>=0&&f<t.length)return d=t[f],Hr(d)?d:[,d]}return Array.isArray(m)?m.map(n):m};return i(n(o))},Hr=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),Wt=Xr;export{B as access,u as binary,i as compile,p as cur,Wt as default,S as err,g as expr,K as group,Gr as id,s as idx,Kr as keyword,Jr as literal,J as loc,C as lookup,$ as nary,I as next,l as operator,O as operators,zr as parens,A as parse,vr as peek,z as prec,W as seek,w as skip,N as space,F as step,E as token,_ as unary,Wr as word};
4
+ `,""+n}${f}${A}`)},W=(r,t=s)=>(Array.isArray(r)&&(r.loc=t),r),I=(r,t=s,e)=>{for(;e=r(p.charCodeAt(s));)s+=e;return p.slice(t,s)},w=(r=1)=>p[s+=r],v=r=>s=r,g=(r=0,t)=>{let e,o,n;for(t&&d.enter?.(r,t);(e=d.space())&&e!==t&&(n=d.step(o,r,e,g));)o=n;return t&&(e==t?(s++,d.exit?.(r,t)):S("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),o},Qr=(r=s)=>{for(;p.charCodeAt(r)<=32;)r++;return p.charCodeAt(r)},Hr=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,vr=(r,t=r.length)=>p.substr(s,t)===r&&!d.id(p.charCodeAt(s+t)),Gr=()=>(w(),g(0,41)),c=[],G={},E=(r,t=32,e,o=r.charCodeAt(0),n=r.length,m=c[o],f=r.toUpperCase()!==r,A,h)=>(t=G[r]=!m&&G[r]||t,c[o]=(C,y,U,H=s)=>(A=U,(U?r==U:(n<2||r.charCodeAt(1)===p.charCodeAt(s+1)&&(n<3||p.substr(s,n)==r))&&(!f||!d.id(p.charCodeAt(s+n)))&&(A=U=r))&&y<t&&(s+=n,(h=e(C))?W(h,H):(s=H,A=0,!f&&!m&&!C&&S()),h)||m?.(C,y,A))),u=(r,t,e=!1)=>E(r,t,o=>o&&(n=>n&&[r,o,n])(g(t-(e?.5:0)))),_=(r,t,e)=>E(r,t,o=>e?o&&[r,o]:!o&&(o=g(t-.5))&&[r,o]),Wr=(r,t)=>E(r,200,e=>!e&&[,t]),N=(r,t,e)=>E(r,t,(o,n)=>(n=g(t-(e?.5:0)),o?.[0]!==r&&(o=[r,o||null]),n?.[0]===r?o.push(...n.slice(1)):o.push(n||null),o)),z=(r,t)=>E(r[0],t,e=>!e&&[r,g(0,r.charCodeAt(1))||null]),$=(r,t)=>E(r[0],t,e=>e&&[r,e,g(0,r.charCodeAt(1))||null]),zr=(r,t,e,o=r.charCodeAt(0),n=r.length,m=c[o],f)=>c[o]=(A,h,C,y=s)=>!A&&(C?r==C:(n<2||p.substr(s,n)==r)&&(C=r))&&h<t&&!d.id(p.charCodeAt(s+n))&&(!d.prop||d.prop(s+n))&&(v(s+n),(f=e())?W(f,y):v(y),f)||m?.(A,h,C);d.space=r=>{for(;(r=p.charCodeAt(s))<=32;)s++;return r};d.step=(r,t,e,o,n)=>(n=c[e])&&n(r,t)||(r?null:I(d.id)||null);var F={},l=(r,t,e=F[r])=>F[r]=(...o)=>t(...o)||e?.(...o),i=r=>Array.isArray(r)?r[0]==null?(t=>()=>t)(r[1]):F[r[0]]?.(...r.slice(1))??S(`Unknown operator: ${r[0]}`,r?.loc):r===void 0?()=>{}:t=>t?.[r];var T=46,R=48,k=57,ur=69,fr=101,Ar=43,dr=45,P=95,J=110,hr=97,Cr=102,cr=65,gr=70,K=r=>r.indexOf("_")<0?r:r.replaceAll("_",""),B=r=>{let t=K(I(e=>e===T&&p.charCodeAt(s+1)!==T||e>=R&&e<=k||e===P||((e===ur||e===fr)&&((e=p.charCodeAt(s+1))>=R&&e<=k||e===Ar||e===dr)?2:0)));return p.charCodeAt(s)===J?(w(),[,BigInt(t)]):(r=+t)!=r?S():[,r]},yr={2:r=>r===48||r===49||r===P,8:r=>r>=48&&r<=55||r===P,16:r=>r>=R&&r<=k||r>=hr&&r<=Cr||r>=cr&&r<=gr||r===P};d.number=null;c[T]=r=>!r&&p.charCodeAt(s+1)!==T&&B();for(let r=R;r<=k;r++)c[r]=t=>t?void 0:B();c[R]=r=>{if(r)return;let t=d.number;if(t){for(let[e,o]of Object.entries(t))if(e[0]==="0"&&p[s+1]?.toLowerCase()===e[1]){w(2);let n=K(I(yr[o]));return p.charCodeAt(s)===J?(w(),[,BigInt("0"+e[1]+n)]):[,parseInt(n,o)]}}return B()};var Er=92,V=34,Y=39,Z=117,q=120,Sr=123,wr=125,x=10,_r=13,Ir={n:`
5
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v",0:"\0"},j=r=>r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1,a=r=>(t,e,o="",n=String.fromCharCode(r))=>{if(t||!d.string?.[n])return;w();let m=()=>{let f=p.charCodeAt(s+1);if(f===x)return 2;if(f===_r)return p.charCodeAt(s+2)===x?3:2;if(f===q||f===Z&&p.charCodeAt(s+2)!==Sr){let A=f===q?2:4,h=0,C;for(let y=0;y<A;y++){if((C=j(p.charCodeAt(s+2+y)))<0)return o+=p[s+1],2;h=h*16+C}return o+=String.fromCharCode(h),2+A}if(f===Z){let A=0,h=s+3,C;for(;(C=j(p.charCodeAt(h)))>=0;)A=A*16+C,h++;return h>s+3&&A<=1114111&&p.charCodeAt(h)===wr?(o+=String.fromCodePoint(A),h-s+1):(o+=p[s+1],2)}return o+=Ir[p[s+1]]||p[s+1],2};return I(f=>f-r&&(f!==Er?(o+=p[s],1):m())),p[s]===n?w():S("Bad string"),[,o]};c[V]=a(V);c[Y]=a(Y);d.string={'"':!0};var Rr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(r=>u(r,Rr,!0));var Ur=30,Pr=40,Tr=140;_("!",Tr);u("||",Ur);u("&&",Pr);var kr=50,Lr=60,Dr=70,b=100,Mr=140;u("|",kr);u("&",Dr);u("^",Lr);u(">>",b);u("<<",b);_("~",Mr);var L=90;u("<",L);u(">",L);u("<=",L);u(">=",L);var rr=80;u("==",rr);u("!=",rr);var tr=110,X=120,er=140;u("+",tr);u("-",tr);u("*",X);u("/",X);u("%",X);_("+",er);_("-",er);var D=150;E("++",D,r=>r?["++",r,null]:["++",g(D-1)]);E("--",D,r=>r?["--",r,null]:["--",g(D-1)]);var Fr=5,Nr=10;N(",",Nr);N(";",Fr,!0);var $r=170;z("()",$r);var O=170;$("[]",O);u(".",O);$("()",O);var nr=(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?nr(r[1],t):(()=>{throw Error("Invalid assignment target")})(),or={"=":(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 or)l(r,(t,e)=>(e=i(e),nr(t,(o,n,m)=>or[r](o,n,e(m)))));l("!",r=>(r=i(r),t=>!r(t)));l("||",(r,t)=>(r=i(r),t=i(t),e=>r(e)||t(e)));l("&&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&&t(e)));l("~",r=>(r=i(r),t=>~r(t)));l("|",(r,t)=>(r=i(r),t=i(t),e=>r(e)|t(e)));l("&",(r,t)=>(r=i(r),t=i(t),e=>r(e)&t(e)));l("^",(r,t)=>(r=i(r),t=i(t),e=>r(e)^t(e)));l(">>",(r,t)=>(r=i(r),t=i(t),e=>r(e)>>t(e)));l("<<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<<t(e)));l(">",(r,t)=>(r=i(r),t=i(t),e=>r(e)>t(e)));l("<",(r,t)=>(r=i(r),t=i(t),e=>r(e)<t(e)));l(">=",(r,t)=>(r=i(r),t=i(t),e=>r(e)>=t(e)));l("<=",(r,t)=>(r=i(r),t=i(t),e=>r(e)<=t(e)));l("==",(r,t)=>(r=i(r),t=i(t),e=>r(e)==t(e)));l("!=",(r,t)=>(r=i(r),t=i(t),e=>r(e)!=t(e)));l("+",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)+t(e)):(r=i(r),e=>+r(e)));l("-",(r,t)=>t!==void 0?(r=i(r),t=i(t),e=>r(e)-t(e)):(r=i(r),e=>-r(e)));l("*",(r,t)=>(r=i(r),t=i(t),e=>r(e)*t(e)));l("/",(r,t)=>(r=i(r),t=i(t),e=>r(e)/t(e)));l("%",(r,t)=>(r=i(r),t=i(t),e=>r(e)%t(e)));var Q=(r,t,e,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?Q(r[1],t):(()=>{throw Error("Invalid increment target")})();l("++",(r,t)=>Q(r,t===null?(e,o)=>e[o]++:(e,o)=>++e[o]));l("--",(r,t)=>Q(r,t===null?(e,o)=>e[o]--:(e,o)=>--e[o]));var ir=(...r)=>(r=r.map(i),t=>{let e;for(let o of r)e=o(t);return e});l(",",ir);l(";",ir);var sr=r=>r?.[0]==="_"&&r[1]==="_"||r==="constructor"||r==="prototype",M=r=>{throw Error(r)};l("[]",(r,t)=>t===void 0?(r=r?r[0]===","?r.slice(1):[r]:[],r=r.map(e=>e==null?(()=>{}):e[0]==="..."?(e=i(e[1]),o=>e(o)):(e=i(e),o=>[e(o)])),e=>r.flatMap(o=>o(e))):(t==null&&M("Missing index"),r=i(r),t=i(t),e=>{let o=t(e);return sr(o)?void 0:r(e)[o]}));l(".",(r,t)=>(r=i(r),t=t[0]?t:t[1],sr(t)?()=>{}:e=>r(e)[t]));l("()",(r,t)=>{if(t===void 0)return r==null?M("Empty ()"):i(r);let e=n=>n?.[0]===","&&n.slice(1).some(m=>m==null||e(m));e(t)&&M("Empty argument");let o=t?t[0]===","?(t=t.slice(1).map(i),n=>t.map(m=>m(n))):(t=i(t),n=>[t(n)]):()=>[];return pr(r,(n,m,f)=>n[m](...o(f)))});var pr=(r,t,e,o)=>r==null?M("Empty ()"):r[0]==="()"&&r.length==2?pr(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 m=e(n);return m==null?void 0:t(m,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 m=e(n);return m==null?void 0:t(m,o(n),n)}):(r=i(r),n=>t([r(n)],0,n));var lr=new WeakMap,Br=(r,...t)=>typeof r=="string"?i(d(r)):lr.get(r)||lr.set(r,Xr(r,t)).get(r),mr=57344,Xr=(r,t)=>{let e=r.reduce((m,f,A)=>m+(A?String.fromCharCode(mr+A-1):"")+f,""),o=d(e),n=m=>{if(typeof m=="string"&&m.length===1){let f=m.charCodeAt(0)-mr,A;if(f>=0&&f<t.length)return A=t[f],Or(A)?A:[,A]}return Array.isArray(m)?m.map(n):m};return i(n(o))},Or=r=>typeof r=="string"||Array.isArray(r)&&(typeof r[0]=="string"||r[0]===void 0),vt=Br;export{$ as access,u as binary,i as compile,p as cur,vt as default,S as err,g as expr,z as group,Hr as id,s as idx,zr as keyword,Wr as literal,W as loc,c as lookup,N as nary,I as next,l as operator,F as operators,Gr as parens,d as parse,Qr as peek,G as prec,v as seek,w as skip,E as token,_ as unary,vr as word};