@dbml/parse 3.13.9 → 3.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,61 +1,61 @@
1
- var jn = typeof global == "object" && global && global.Object === Object && global, Wr = typeof self == "object" && self && self.Object === Object && self, be = jn || Wr || Function("return this")(), pe = be.Symbol, Xn = Object.prototype, Hr = Xn.hasOwnProperty, zr = Xn.toString, He = pe ? pe.toStringTag : void 0;
2
- function qr(e) {
3
- var t = Hr.call(e, He), n = e[He];
1
+ var Xn = typeof global == "object" && global && global.Object === Object && global, Hr = typeof self == "object" && self && self.Object === Object && self, be = Xn || Hr || Function("return this")(), pe = be.Symbol, Wn = Object.prototype, zr = Wn.hasOwnProperty, qr = Wn.toString, He = pe ? pe.toStringTag : void 0;
2
+ function Yr(e) {
3
+ var t = zr.call(e, He), n = e[He];
4
4
  try {
5
5
  e[He] = void 0;
6
6
  var r = !0;
7
7
  } catch {
8
8
  }
9
- var s = zr.call(e);
9
+ var s = qr.call(e);
10
10
  return r && (t ? e[He] = n : delete e[He]), s;
11
11
  }
12
- var Yr = Object.prototype, Qr = Yr.toString;
13
- function Kr(e) {
14
- return Qr.call(e);
12
+ var Qr = Object.prototype, Kr = Qr.toString;
13
+ function Jr(e) {
14
+ return Kr.call(e);
15
15
  }
16
- var Jr = "[object Null]", Zr = "[object Undefined]", nn = pe ? pe.toStringTag : void 0;
16
+ var Zr = "[object Null]", es = "[object Undefined]", nn = pe ? pe.toStringTag : void 0;
17
17
  function $e(e) {
18
- return e == null ? e === void 0 ? Zr : Jr : nn && nn in Object(e) ? qr(e) : Kr(e);
18
+ return e == null ? e === void 0 ? es : Zr : nn && nn in Object(e) ? Yr(e) : Jr(e);
19
19
  }
20
20
  function Se(e) {
21
21
  return e != null && typeof e == "object";
22
22
  }
23
- var es = "[object Symbol]";
23
+ var ts = "[object Symbol]";
24
24
  function pt(e) {
25
- return typeof e == "symbol" || Se(e) && $e(e) == es;
25
+ return typeof e == "symbol" || Se(e) && $e(e) == ts;
26
26
  }
27
- function Wn(e, t) {
27
+ function Hn(e, t) {
28
28
  for (var n = -1, r = e == null ? 0 : e.length, s = Array(r); ++n < r; )
29
29
  s[n] = t(e[n], n, e);
30
30
  return s;
31
31
  }
32
32
  var ce = Array.isArray, rn = pe ? pe.prototype : void 0, sn = rn ? rn.toString : void 0;
33
- function Hn(e) {
33
+ function zn(e) {
34
34
  if (typeof e == "string")
35
35
  return e;
36
36
  if (ce(e))
37
- return Wn(e, Hn) + "";
37
+ return Hn(e, zn) + "";
38
38
  if (pt(e))
39
39
  return sn ? sn.call(e) : "";
40
40
  var t = e + "";
41
41
  return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
42
42
  }
43
- var ts = /\s/;
44
- function ns(e) {
45
- for (var t = e.length; t-- && ts.test(e.charAt(t)); )
43
+ var ns = /\s/;
44
+ function rs(e) {
45
+ for (var t = e.length; t-- && ns.test(e.charAt(t)); )
46
46
  ;
47
47
  return t;
48
48
  }
49
- var rs = /^\s+/;
50
- function ss(e) {
51
- return e && e.slice(0, ns(e) + 1).replace(rs, "");
49
+ var ss = /^\s+/;
50
+ function is(e) {
51
+ return e && e.slice(0, rs(e) + 1).replace(ss, "");
52
52
  }
53
53
  function Ve(e) {
54
54
  var t = typeof e;
55
55
  return e != null && (t == "object" || t == "function");
56
56
  }
57
- var an = NaN, is = /^[-+]0x[0-9a-f]+$/i, as = /^0b[01]+$/i, os = /^0o[0-7]+$/i, ls = parseInt;
58
- function cs(e) {
57
+ var an = NaN, as = /^[-+]0x[0-9a-f]+$/i, os = /^0b[01]+$/i, ls = /^0o[0-7]+$/i, cs = parseInt;
58
+ function us(e) {
59
59
  if (typeof e == "number")
60
60
  return e;
61
61
  if (pt(e))
@@ -66,15 +66,15 @@ function cs(e) {
66
66
  }
67
67
  if (typeof e != "string")
68
68
  return e === 0 ? e : +e;
69
- e = ss(e);
70
- var n = as.test(e);
71
- return n || os.test(e) ? ls(e.slice(2), n ? 2 : 8) : is.test(e) ? an : +e;
69
+ e = is(e);
70
+ var n = os.test(e);
71
+ return n || ls.test(e) ? cs(e.slice(2), n ? 2 : 8) : as.test(e) ? an : +e;
72
72
  }
73
- var us = 1 / 0, hs = 17976931348623157e292;
73
+ var on = 1 / 0, hs = 17976931348623157e292;
74
74
  function fs(e) {
75
75
  if (!e)
76
76
  return e === 0 ? e : 0;
77
- if (e = cs(e), e === us || e === -1 / 0) {
77
+ if (e = us(e), e === on || e === -on) {
78
78
  var t = e < 0 ? -1 : 1;
79
79
  return t * hs;
80
80
  }
@@ -88,18 +88,18 @@ function dt(e) {
88
88
  return e;
89
89
  }
90
90
  var ds = "[object AsyncFunction]", Es = "[object Function]", Ns = "[object GeneratorFunction]", Ts = "[object Proxy]";
91
- function zn(e) {
91
+ function qn(e) {
92
92
  if (!Ve(e))
93
93
  return !1;
94
94
  var t = $e(e);
95
95
  return t == Es || t == Ns || t == ds || t == Ts;
96
96
  }
97
- var vt = be["__core-js_shared__"], on = function() {
97
+ var vt = be["__core-js_shared__"], ln = function() {
98
98
  var e = /[^.]+$/.exec(vt && vt.keys && vt.keys.IE_PROTO || "");
99
99
  return e ? "Symbol(src)_1." + e : "";
100
100
  }();
101
101
  function bs(e) {
102
- return !!on && on in e;
102
+ return !!ln && ln in e;
103
103
  }
104
104
  var ms = Function.prototype, Is = ms.toString;
105
105
  function Ue(e) {
@@ -121,7 +121,7 @@ var gs = /[\\^$.*+?()[\]{}|]/g, _s = /^\[object .+?Constructor\]$/, As = Functio
121
121
  function Ps(e) {
122
122
  if (!Ve(e) || bs(e))
123
123
  return !1;
124
- var t = zn(e) ? ws : _s;
124
+ var t = qn(e) ? ws : _s;
125
125
  return t.test(Ue(e));
126
126
  }
127
127
  function Ss(e, t) {
@@ -163,14 +163,14 @@ function Us(e) {
163
163
  return e;
164
164
  };
165
165
  }
166
- var ln = function() {
166
+ var cn = function() {
167
167
  try {
168
168
  var e = Me(Object, "defineProperty");
169
169
  return e({}, "", {}), e;
170
170
  } catch {
171
171
  }
172
- }(), Ms = ln ? function(e, t) {
173
- return ln(e, "toString", {
172
+ }(), Ms = cn ? function(e, t) {
173
+ return cn(e, "toString", {
174
174
  configurable: !0,
175
175
  enumerable: !1,
176
176
  value: Us(t),
@@ -185,17 +185,17 @@ function Bs(e, t, n, r) {
185
185
  return -1;
186
186
  }
187
187
  var Gs = 9007199254740991, Vs = /^(?:0|[1-9]\d*)$/;
188
- function qn(e, t) {
188
+ function Yn(e, t) {
189
189
  var n = typeof e;
190
190
  return t = t ?? Gs, !!t && (n == "number" || n != "symbol" && Vs.test(e)) && e > -1 && e % 1 == 0 && e < t;
191
191
  }
192
- function Yn(e, t) {
192
+ function Qn(e, t) {
193
193
  return e === t || e !== e && t !== t;
194
194
  }
195
- var cn = Math.max;
195
+ var un = Math.max;
196
196
  function Cs(e, t, n) {
197
- return t = cn(t === void 0 ? e.length - 1 : t, 0), function() {
198
- for (var r = arguments, s = -1, i = cn(r.length - t, 0), a = Array(i); ++s < i; )
197
+ return t = un(t === void 0 ? e.length - 1 : t, 0), function() {
198
+ for (var r = arguments, s = -1, i = un(r.length - t, 0), a = Array(i); ++s < i; )
199
199
  a[s] = r[t + s];
200
200
  s = -1;
201
201
  for (var o = Array(t + 1); ++s < t; )
@@ -211,31 +211,31 @@ function Ft(e) {
211
211
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= js;
212
212
  }
213
213
  function Et(e) {
214
- return e != null && Ft(e.length) && !zn(e);
214
+ return e != null && Ft(e.length) && !qn(e);
215
215
  }
216
216
  var Xs = Object.prototype;
217
- function Qn(e) {
217
+ function Kn(e) {
218
218
  var t = e && e.constructor, n = typeof t == "function" && t.prototype || Xs;
219
219
  return e === n;
220
220
  }
221
- function Kn(e, t) {
221
+ function Jn(e, t) {
222
222
  for (var n = -1, r = Array(e); ++n < e; )
223
223
  r[n] = t(n);
224
224
  return r;
225
225
  }
226
226
  var Ws = "[object Arguments]";
227
- function un(e) {
227
+ function hn(e) {
228
228
  return Se(e) && $e(e) == Ws;
229
229
  }
230
- var Jn = Object.prototype, Hs = Jn.hasOwnProperty, zs = Jn.propertyIsEnumerable, Bt = un(/* @__PURE__ */ function() {
230
+ var Zn = Object.prototype, Hs = Zn.hasOwnProperty, zs = Zn.propertyIsEnumerable, Bt = hn(/* @__PURE__ */ function() {
231
231
  return arguments;
232
- }()) ? un : function(e) {
232
+ }()) ? hn : function(e) {
233
233
  return Se(e) && Hs.call(e, "callee") && !zs.call(e, "callee");
234
234
  };
235
235
  function qs() {
236
236
  return !1;
237
237
  }
238
- var Zn = typeof exports == "object" && exports && !exports.nodeType && exports, hn = Zn && typeof module == "object" && module && !module.nodeType && module, Ys = hn && hn.exports === Zn, fn = Ys ? be.Buffer : void 0, Qs = fn ? fn.isBuffer : void 0, St = Qs || qs, Ks = "[object Arguments]", Js = "[object Array]", Zs = "[object Boolean]", ei = "[object Date]", ti = "[object Error]", ni = "[object Function]", ri = "[object Map]", si = "[object Number]", ii = "[object Object]", ai = "[object RegExp]", oi = "[object Set]", li = "[object String]", ci = "[object WeakMap]", ui = "[object ArrayBuffer]", hi = "[object DataView]", fi = "[object Float32Array]", pi = "[object Float64Array]", di = "[object Int8Array]", Ei = "[object Int16Array]", Ni = "[object Int32Array]", Ti = "[object Uint8Array]", bi = "[object Uint8ClampedArray]", mi = "[object Uint16Array]", Ii = "[object Uint32Array]", O = {};
238
+ var er = typeof exports == "object" && exports && !exports.nodeType && exports, fn = er && typeof module == "object" && module && !module.nodeType && module, Ys = fn && fn.exports === er, pn = Ys ? be.Buffer : void 0, Qs = pn ? pn.isBuffer : void 0, St = Qs || qs, Ks = "[object Arguments]", Js = "[object Array]", Zs = "[object Boolean]", ei = "[object Date]", ti = "[object Error]", ni = "[object Function]", ri = "[object Map]", si = "[object Number]", ii = "[object Object]", ai = "[object RegExp]", oi = "[object Set]", li = "[object String]", ci = "[object WeakMap]", ui = "[object ArrayBuffer]", hi = "[object DataView]", fi = "[object Float32Array]", pi = "[object Float64Array]", di = "[object Int8Array]", Ei = "[object Int16Array]", Ni = "[object Int32Array]", Ti = "[object Uint8Array]", bi = "[object Uint8ClampedArray]", mi = "[object Uint16Array]", Ii = "[object Uint32Array]", O = {};
239
239
  O[fi] = O[pi] = O[di] = O[Ei] = O[Ni] = O[Ti] = O[bi] = O[mi] = O[Ii] = !0;
240
240
  O[Ks] = O[Js] = O[ui] = O[Zs] = O[hi] = O[ei] = O[ti] = O[ni] = O[ri] = O[si] = O[ii] = O[ai] = O[oi] = O[li] = O[ci] = !1;
241
241
  function gi(e) {
@@ -246,21 +246,21 @@ function _i(e) {
246
246
  return e(t);
247
247
  };
248
248
  }
249
- var er = typeof exports == "object" && exports && !exports.nodeType && exports, ze = er && typeof module == "object" && module && !module.nodeType && module, Ai = ze && ze.exports === er, yt = Ai && jn.process, pn = function() {
249
+ var tr = typeof exports == "object" && exports && !exports.nodeType && exports, ze = tr && typeof module == "object" && module && !module.nodeType && module, Ai = ze && ze.exports === tr, yt = Ai && Xn.process, dn = function() {
250
250
  try {
251
251
  var e = ze && ze.require && ze.require("util").types;
252
252
  return e || yt && yt.binding && yt.binding("util");
253
253
  } catch {
254
254
  }
255
- }(), dn = pn && pn.isTypedArray, tr = dn ? _i(dn) : gi, Li = Object.prototype, vi = Li.hasOwnProperty;
256
- function nr(e, t) {
257
- var n = ce(e), r = !n && Bt(e), s = !n && !r && St(e), i = !n && !r && !s && tr(e), a = n || r || s || i, o = a ? Kn(e.length, String) : [], u = o.length;
255
+ }(), En = dn && dn.isTypedArray, nr = En ? _i(En) : gi, Li = Object.prototype, vi = Li.hasOwnProperty;
256
+ function rr(e, t) {
257
+ var n = ce(e), r = !n && Bt(e), s = !n && !r && St(e), i = !n && !r && !s && nr(e), a = n || r || s || i, o = a ? Jn(e.length, String) : [], u = o.length;
258
258
  for (var p in e)
259
259
  (t || vi.call(e, p)) && !(a && // Safari 9 has enumerable `arguments.length` in strict mode.
260
260
  (p == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
261
261
  s && (p == "offset" || p == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
262
262
  i && (p == "buffer" || p == "byteLength" || p == "byteOffset") || // Skip index properties.
263
- qn(p, u))) && o.push(p);
263
+ Yn(p, u))) && o.push(p);
264
264
  return o;
265
265
  }
266
266
  function yi(e, t) {
@@ -270,7 +270,7 @@ function yi(e, t) {
270
270
  }
271
271
  var wi = yi(Object.keys, Object), Pi = Object.prototype, Si = Pi.hasOwnProperty;
272
272
  function Oi(e) {
273
- if (!Qn(e))
273
+ if (!Kn(e))
274
274
  return wi(e);
275
275
  var t = [];
276
276
  for (var n in Object(e))
@@ -278,7 +278,7 @@ function Oi(e) {
278
278
  return t;
279
279
  }
280
280
  function Gt(e) {
281
- return Et(e) ? nr(e) : Oi(e);
281
+ return Et(e) ? rr(e) : Oi(e);
282
282
  }
283
283
  function xi(e) {
284
284
  var t = [];
@@ -291,13 +291,13 @@ var Di = Object.prototype, Ri = Di.hasOwnProperty;
291
291
  function ki(e) {
292
292
  if (!Ve(e))
293
293
  return xi(e);
294
- var t = Qn(e), n = [];
294
+ var t = Kn(e), n = [];
295
295
  for (var r in e)
296
296
  r == "constructor" && (t || !Ri.call(e, r)) || n.push(r);
297
297
  return n;
298
298
  }
299
299
  function Ui(e) {
300
- return Et(e) ? nr(e, !0) : ki(e);
300
+ return Et(e) ? rr(e, !0) : ki(e);
301
301
  }
302
302
  var Mi = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Fi = /^\w*$/;
303
303
  function Vt(e, t) {
@@ -350,7 +350,7 @@ function Yi() {
350
350
  }
351
351
  function Nt(e, t) {
352
352
  for (var n = e.length; n--; )
353
- if (Yn(e[n][0], t))
353
+ if (Qn(e[n][0], t))
354
354
  return n;
355
355
  return -1;
356
356
  }
@@ -455,9 +455,9 @@ var ha = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=
455
455
  }), t;
456
456
  });
457
457
  function da(e) {
458
- return e == null ? "" : Hn(e);
458
+ return e == null ? "" : zn(e);
459
459
  }
460
- function rr(e, t) {
460
+ function sr(e, t) {
461
461
  return ce(e) ? e : Vt(e, t) ? [e] : pa(da(e));
462
462
  }
463
463
  function bt(e) {
@@ -466,34 +466,34 @@ function bt(e) {
466
466
  var t = e + "";
467
467
  return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
468
468
  }
469
- function sr(e, t) {
470
- t = rr(t, e);
469
+ function ir(e, t) {
470
+ t = sr(t, e);
471
471
  for (var n = 0, r = t.length; e != null && n < r; )
472
472
  e = e[bt(t[n++])];
473
473
  return n && n == r ? e : void 0;
474
474
  }
475
- function ir(e, t, n) {
476
- var r = e == null ? void 0 : sr(e, t);
475
+ function ar(e, t, n) {
476
+ var r = e == null ? void 0 : ir(e, t);
477
477
  return r === void 0 ? n : r;
478
478
  }
479
- function ar(e, t) {
479
+ function or(e, t) {
480
480
  for (var n = -1, r = t.length, s = e.length; ++n < r; )
481
481
  e[s + n] = t[n];
482
482
  return e;
483
483
  }
484
- var En = pe ? pe.isConcatSpreadable : void 0;
484
+ var Nn = pe ? pe.isConcatSpreadable : void 0;
485
485
  function Ea(e) {
486
- return ce(e) || Bt(e) || !!(En && e && e[En]);
486
+ return ce(e) || Bt(e) || !!(Nn && e && e[Nn]);
487
487
  }
488
488
  function Na(e, t, n, r, s) {
489
489
  var i = -1, a = e.length;
490
490
  for (n || (n = Ea), s || (s = []); ++i < a; ) {
491
491
  var o = e[i];
492
- n(o) ? ar(s, o) : s[s.length] = o;
492
+ n(o) ? or(s, o) : s[s.length] = o;
493
493
  }
494
494
  return s;
495
495
  }
496
- function Nn(e) {
496
+ function Tn(e) {
497
497
  var t = e == null ? 0 : e.length;
498
498
  return t ? Na(e) : [];
499
499
  }
@@ -530,7 +530,7 @@ Ne.prototype.delete = ba;
530
530
  Ne.prototype.get = ma;
531
531
  Ne.prototype.has = Ia;
532
532
  Ne.prototype.set = _a;
533
- function or(e, t) {
533
+ function lr(e, t) {
534
534
  for (var n = -1, r = e == null ? 0 : e.length, s = 0, i = []; ++n < r; ) {
535
535
  var a = e[n];
536
536
  t(a, n, e) && (i[s++] = a);
@@ -540,37 +540,37 @@ function or(e, t) {
540
540
  function Aa() {
541
541
  return [];
542
542
  }
543
- var La = Object.prototype, va = La.propertyIsEnumerable, Tn = Object.getOwnPropertySymbols, ya = Tn ? function(e) {
544
- return e == null ? [] : (e = Object(e), or(Tn(e), function(t) {
543
+ var La = Object.prototype, va = La.propertyIsEnumerable, bn = Object.getOwnPropertySymbols, ya = bn ? function(e) {
544
+ return e == null ? [] : (e = Object(e), lr(bn(e), function(t) {
545
545
  return va.call(e, t);
546
546
  }));
547
547
  } : Aa;
548
548
  function wa(e, t, n) {
549
549
  var r = t(e);
550
- return ce(e) ? r : ar(r, n(e));
550
+ return ce(e) ? r : or(r, n(e));
551
551
  }
552
- function bn(e) {
552
+ function mn(e) {
553
553
  return wa(e, Gt, ya);
554
554
  }
555
- var Ot = Me(be, "DataView"), xt = Me(be, "Promise"), Dt = Me(be, "Set"), mn = "[object Map]", Pa = "[object Object]", In = "[object Promise]", gn = "[object Set]", _n = "[object WeakMap]", An = "[object DataView]", Sa = Ue(Ot), Oa = Ue(Qe), xa = Ue(xt), Da = Ue(Dt), Ra = Ue(Pt), ve = $e;
556
- (Ot && ve(new Ot(new ArrayBuffer(1))) != An || Qe && ve(new Qe()) != mn || xt && ve(xt.resolve()) != In || Dt && ve(new Dt()) != gn || Pt && ve(new Pt()) != _n) && (ve = function(e) {
555
+ var Ot = Me(be, "DataView"), xt = Me(be, "Promise"), Dt = Me(be, "Set"), In = "[object Map]", Pa = "[object Object]", gn = "[object Promise]", _n = "[object Set]", An = "[object WeakMap]", Ln = "[object DataView]", Sa = Ue(Ot), Oa = Ue(Qe), xa = Ue(xt), Da = Ue(Dt), Ra = Ue(Pt), ve = $e;
556
+ (Ot && ve(new Ot(new ArrayBuffer(1))) != Ln || Qe && ve(new Qe()) != In || xt && ve(xt.resolve()) != gn || Dt && ve(new Dt()) != _n || Pt && ve(new Pt()) != An) && (ve = function(e) {
557
557
  var t = $e(e), n = t == Pa ? e.constructor : void 0, r = n ? Ue(n) : "";
558
558
  if (r)
559
559
  switch (r) {
560
560
  case Sa:
561
- return An;
561
+ return Ln;
562
562
  case Oa:
563
- return mn;
564
- case xa:
565
563
  return In;
566
- case Da:
564
+ case xa:
567
565
  return gn;
568
- case Ra:
566
+ case Da:
569
567
  return _n;
568
+ case Ra:
569
+ return An;
570
570
  }
571
571
  return t;
572
572
  });
573
- var Ln = be.Uint8Array, ka = "__lodash_hash_undefined__";
573
+ var vn = be.Uint8Array, ka = "__lodash_hash_undefined__";
574
574
  function Ua(e) {
575
575
  return this.__data__.set(e, ka), this;
576
576
  }
@@ -594,7 +594,7 @@ function Ba(e, t) {
594
594
  return e.has(t);
595
595
  }
596
596
  var Ga = 1, Va = 2;
597
- function lr(e, t, n, r, s, i) {
597
+ function cr(e, t, n, r, s, i) {
598
598
  var a = n & Ga, o = e.length, u = t.length;
599
599
  if (o != u && !(a && u > o))
600
600
  return !1;
@@ -639,7 +639,7 @@ function $a(e) {
639
639
  n[++t] = r;
640
640
  }), n;
641
641
  }
642
- var ja = 1, Xa = 2, Wa = "[object Boolean]", Ha = "[object Date]", za = "[object Error]", qa = "[object Map]", Ya = "[object Number]", Qa = "[object RegExp]", Ka = "[object Set]", Ja = "[object String]", Za = "[object Symbol]", eo = "[object ArrayBuffer]", to = "[object DataView]", vn = pe ? pe.prototype : void 0, wt = vn ? vn.valueOf : void 0;
642
+ var ja = 1, Xa = 2, Wa = "[object Boolean]", Ha = "[object Date]", za = "[object Error]", qa = "[object Map]", Ya = "[object Number]", Qa = "[object RegExp]", Ka = "[object Set]", Ja = "[object String]", Za = "[object Symbol]", eo = "[object ArrayBuffer]", to = "[object DataView]", yn = pe ? pe.prototype : void 0, wt = yn ? yn.valueOf : void 0;
643
643
  function no(e, t, n, r, s, i, a) {
644
644
  switch (n) {
645
645
  case to:
@@ -647,11 +647,11 @@ function no(e, t, n, r, s, i, a) {
647
647
  return !1;
648
648
  e = e.buffer, t = t.buffer;
649
649
  case eo:
650
- return !(e.byteLength != t.byteLength || !i(new Ln(e), new Ln(t)));
650
+ return !(e.byteLength != t.byteLength || !i(new vn(e), new vn(t)));
651
651
  case Wa:
652
652
  case Ha:
653
653
  case Ya:
654
- return Yn(+e, +t);
654
+ return Qn(+e, +t);
655
655
  case za:
656
656
  return e.name == t.name && e.message == t.message;
657
657
  case Qa:
@@ -667,7 +667,7 @@ function no(e, t, n, r, s, i, a) {
667
667
  if (p)
668
668
  return p == t;
669
669
  r |= Xa, a.set(e, t);
670
- var h = lr(o(e), o(t), r, s, i, a);
670
+ var h = cr(o(e), o(t), r, s, i, a);
671
671
  return a.delete(e), h;
672
672
  case Za:
673
673
  if (wt)
@@ -677,7 +677,7 @@ function no(e, t, n, r, s, i, a) {
677
677
  }
678
678
  var ro = 1, so = Object.prototype, io = so.hasOwnProperty;
679
679
  function ao(e, t, n, r, s, i) {
680
- var a = n & ro, o = bn(e), u = o.length, p = bn(t), h = p.length;
680
+ var a = n & ro, o = mn(e), u = o.length, p = mn(t), h = p.length;
681
681
  if (u != h && !a)
682
682
  return !1;
683
683
  for (var d = u; d--; ) {
@@ -707,10 +707,10 @@ function ao(e, t, n, r, s, i) {
707
707
  }
708
708
  return i.delete(e), i.delete(t), I;
709
709
  }
710
- var oo = 1, yn = "[object Arguments]", wn = "[object Array]", nt = "[object Object]", lo = Object.prototype, Pn = lo.hasOwnProperty;
710
+ var oo = 1, wn = "[object Arguments]", Pn = "[object Array]", nt = "[object Object]", lo = Object.prototype, Sn = lo.hasOwnProperty;
711
711
  function co(e, t, n, r, s, i) {
712
- var a = ce(e), o = ce(t), u = a ? wn : ve(e), p = o ? wn : ve(t);
713
- u = u == yn ? nt : u, p = p == yn ? nt : p;
712
+ var a = ce(e), o = ce(t), u = a ? Pn : ve(e), p = o ? Pn : ve(t);
713
+ u = u == wn ? nt : u, p = p == wn ? nt : p;
714
714
  var h = u == nt, d = p == nt, E = u == p;
715
715
  if (E && St(e)) {
716
716
  if (!St(t))
@@ -718,9 +718,9 @@ function co(e, t, n, r, s, i) {
718
718
  a = !0, h = !1;
719
719
  }
720
720
  if (E && !h)
721
- return i || (i = new Ne()), a || tr(e) ? lr(e, t, n, r, s, i) : no(e, t, u, n, r, s, i);
721
+ return i || (i = new Ne()), a || nr(e) ? cr(e, t, n, r, s, i) : no(e, t, u, n, r, s, i);
722
722
  if (!(n & oo)) {
723
- var b = h && Pn.call(e, "__wrapped__"), A = d && Pn.call(t, "__wrapped__");
723
+ var b = h && Sn.call(e, "__wrapped__"), A = d && Sn.call(t, "__wrapped__");
724
724
  if (b || A) {
725
725
  var I = b ? e.value() : e, v = A ? t.value() : t;
726
726
  return i || (i = new Ne()), s(I, v, n, r, i);
@@ -755,24 +755,24 @@ function fo(e, t, n, r) {
755
755
  }
756
756
  return !0;
757
757
  }
758
- function cr(e) {
758
+ function ur(e) {
759
759
  return e === e && !Ve(e);
760
760
  }
761
761
  function po(e) {
762
762
  for (var t = Gt(e), n = t.length; n--; ) {
763
763
  var r = t[n], s = e[r];
764
- t[n] = [r, s, cr(s)];
764
+ t[n] = [r, s, ur(s)];
765
765
  }
766
766
  return t;
767
767
  }
768
- function ur(e, t) {
768
+ function hr(e, t) {
769
769
  return function(n) {
770
770
  return n == null ? !1 : n[e] === t && (t !== void 0 || e in Object(n));
771
771
  };
772
772
  }
773
773
  function Eo(e) {
774
774
  var t = po(e);
775
- return t.length == 1 && t[0][2] ? ur(t[0][0], t[0][1]) : function(n) {
775
+ return t.length == 1 && t[0][2] ? hr(t[0][0], t[0][1]) : function(n) {
776
776
  return n === e || fo(n, e, t);
777
777
  };
778
778
  }
@@ -780,39 +780,39 @@ function No(e, t) {
780
780
  return e != null && t in Object(e);
781
781
  }
782
782
  function To(e, t, n) {
783
- t = rr(t, e);
783
+ t = sr(t, e);
784
784
  for (var r = -1, s = t.length, i = !1; ++r < s; ) {
785
785
  var a = bt(t[r]);
786
786
  if (!(i = e != null && n(e, a)))
787
787
  break;
788
788
  e = e[a];
789
789
  }
790
- return i || ++r != s ? i : (s = e == null ? 0 : e.length, !!s && Ft(s) && qn(a, s) && (ce(e) || Bt(e)));
790
+ return i || ++r != s ? i : (s = e == null ? 0 : e.length, !!s && Ft(s) && Yn(a, s) && (ce(e) || Bt(e)));
791
791
  }
792
792
  function bo(e, t) {
793
793
  return e != null && To(e, t, No);
794
794
  }
795
795
  var mo = 1, Io = 2;
796
796
  function go(e, t) {
797
- return Vt(e) && cr(t) ? ur(bt(e), t) : function(n) {
798
- var r = ir(n, e);
797
+ return Vt(e) && ur(t) ? hr(bt(e), t) : function(n) {
798
+ var r = ar(n, e);
799
799
  return r === void 0 && r === t ? bo(n, e) : $t(t, r, mo | Io);
800
800
  };
801
801
  }
802
- function hr(e) {
802
+ function fr(e) {
803
803
  return function(t) {
804
804
  return t == null ? void 0 : t[e];
805
805
  };
806
806
  }
807
807
  function _o(e) {
808
808
  return function(t) {
809
- return sr(t, e);
809
+ return ir(t, e);
810
810
  };
811
811
  }
812
812
  function Ao(e) {
813
- return Vt(e) ? hr(bt(e)) : _o(e);
813
+ return Vt(e) ? fr(bt(e)) : _o(e);
814
814
  }
815
- function fr(e) {
815
+ function pr(e) {
816
816
  return typeof e == "function" ? e : e == null ? dt : typeof e == "object" ? ce(e) ? go(e[0], e[1]) : Eo(e) : Ao(e);
817
817
  }
818
818
  function Lo(e, t, n, r) {
@@ -832,9 +832,9 @@ function vo(e) {
832
832
  return t;
833
833
  };
834
834
  }
835
- var pr = vo();
835
+ var dr = vo();
836
836
  function yo(e, t) {
837
- return e && pr(e, t, Gt);
837
+ return e && dr(e, t, Gt);
838
838
  }
839
839
  function wo(e, t) {
840
840
  return function(n, r) {
@@ -856,7 +856,7 @@ function So(e, t, n, r) {
856
856
  function Oo(e, t) {
857
857
  return function(n, r) {
858
858
  var s = ce(n) ? Lo : So, i = t ? t() : {};
859
- return s(n, e, fr(r), i);
859
+ return s(n, e, pr(r), i);
860
860
  };
861
861
  }
862
862
  function xo(e) {
@@ -875,13 +875,13 @@ function Uo(e, t, n) {
875
875
  if (!r)
876
876
  return -1;
877
877
  var s = r - 1;
878
- return n !== void 0 && (s = ps(n), s = n < 0 ? Ro(r + s, 0) : ko(s, r - 1)), Bs(e, fr(t), s);
878
+ return n !== void 0 && (s = ps(n), s = n < 0 ? Ro(r + s, 0) : ko(s, r - 1)), Bs(e, pr(t), s);
879
879
  }
880
880
  function Mo(e) {
881
881
  return e && e.length ? e[0] : void 0;
882
882
  }
883
883
  function Ke(e, t) {
884
- return e == null ? e : pr(e, Do(t), Ui);
884
+ return e == null ? e : dr(e, Do(t), Ui);
885
885
  }
886
886
  var he = Oo(function(e, t, n) {
887
887
  e[n ? 0 : 1].push(t);
@@ -892,11 +892,11 @@ function Bo(e) {
892
892
  if (!(e && e.length))
893
893
  return [];
894
894
  var t = 0;
895
- return e = or(e, function(n) {
895
+ return e = lr(e, function(n) {
896
896
  if (xo(n))
897
897
  return t = Fo(n.length, t), !0;
898
- }), Kn(t, function(n) {
899
- return Wn(e, hr(n));
898
+ }), Jn(t, function(n) {
899
+ return Hn(e, fr(n));
900
900
  });
901
901
  }
902
902
  var Rt = $s(Bo), f = /* @__PURE__ */ ((e) => (e.SPACE = "<space>", e.TAB = "<tab>", e.NEWLINE = "<newline>", e.COMMA = "<comma>", e.LPAREN = "<lparen>", e.RPAREN = "<rparen>", e.LBRACE = "<lbrace>", e.RBRACE = "<rbrace>", e.LBRACKET = "<lbracket>", e.RBRACKET = "<rbracket>", e.LANGLE = "<langle>", e.RANGLE = "<rangle>", e.OP = "<op>", e.EOF = "<eof>", e.NUMERIC_LITERAL = "<number>", e.STRING_LITERAL = "<string>", e.COLOR_LITERAL = "<color>", e.FUNCTION_EXPRESSION = "<function-expression>", e.QUOTED_STRING = "<variable>", e.IDENTIFIER = "<identifier>", e.SEMICOLON = "<semicolon>", e.COLON = "<colon>", e.TILDE = "<tilde>", e.SINGLE_LINE_COMMENT = "<single-line-comment>", e.MULTILINE_COMMENT = "<multiline-comment>", e))(f || {});
@@ -933,7 +933,7 @@ function Vo(e) {
933
933
  return !1;
934
934
  }
935
935
  }
936
- function Sn(e) {
936
+ function On(e) {
937
937
  return e !== void 0 && e.kind === "<op>";
938
938
  }
939
939
  class Z {
@@ -944,20 +944,20 @@ class Z {
944
944
  return new Z(t, n, r, s, i);
945
945
  }
946
946
  }
947
- function dr(e) {
947
+ function Er(e) {
948
948
  return e.trailingTrivia.find(({ kind: t }) => t === f.NEWLINE) !== void 0;
949
949
  }
950
- function On(e, t) {
951
- return t.leadingTrivia.find(({ kind: r }) => r === f.NEWLINE) !== void 0 || dr(e);
950
+ function xn(e, t) {
951
+ return t.leadingTrivia.find(({ kind: r }) => r === f.NEWLINE) !== void 0 || Er(e);
952
952
  }
953
953
  function kt(e) {
954
954
  return e.trailingTrivia.find(({ kind: t }) => [f.SPACE, f.TAB].includes(t)) !== void 0;
955
955
  }
956
- function Er(e) {
957
- return e.trailingTrivia.length === 0 ? e.end : Er(F(e.trailingTrivia));
958
- }
959
956
  function Nr(e) {
960
- return e.leadingTrivia.length === 0 ? e.start : Nr(e.leadingTrivia[0]);
957
+ return e.trailingTrivia.length === 0 ? e.end : Nr(F(e.trailingTrivia));
958
+ }
959
+ function Tr(e) {
960
+ return e.leadingTrivia.length === 0 ? e.start : Tr(e.leadingTrivia[0]);
961
961
  }
962
962
  function Co(e) {
963
963
  return [f.SINGLE_LINE_COMMENT, f.MULTILINE_COMMENT].includes(
@@ -981,13 +981,13 @@ class D {
981
981
  constructor(t, n, r) {
982
982
  this.id = t, this.kind = n;
983
983
  const s = r.find((a) => a !== void 0 && !Number.isNaN(a.start));
984
- s ? (this.startPos = s.startPos, this.fullStart = s instanceof Z ? Nr(s) : s.fullStart) : (this.startPos = {
984
+ s ? (this.startPos = s.startPos, this.fullStart = s instanceof Z ? Tr(s) : s.fullStart) : (this.startPos = {
985
985
  offset: NaN,
986
986
  column: NaN,
987
987
  line: NaN
988
988
  }, this.fullStart = NaN);
989
989
  const i = [...r].reverse().find((a) => a !== void 0 && !Number.isNaN(a.end));
990
- i ? (this.endPos = i.endPos, this.fullEnd = i instanceof Z ? Er(i) : i.fullEnd) : (this.endPos = {
990
+ i ? (this.endPos = i.endPos, this.fullEnd = i instanceof Z ? Nr(i) : i.fullEnd) : (this.endPos = {
991
991
  offset: NaN,
992
992
  column: NaN,
993
993
  line: NaN
@@ -1089,7 +1089,7 @@ class B extends D {
1089
1089
  }, i) {
1090
1090
  super(i, "<list-expression>", [
1091
1091
  t,
1092
- ...Tr(n, r),
1092
+ ...br(n, r),
1093
1093
  s
1094
1094
  ]), this.listOpenBracket = t, this.elementList = n, this.commaList = r, this.listCloseBracket = s;
1095
1095
  }
@@ -1103,7 +1103,7 @@ class Ee extends D {
1103
1103
  }, i) {
1104
1104
  super(i, "<tuple-expression>", [
1105
1105
  t,
1106
- ...Tr(n, r),
1106
+ ...br(n, r),
1107
1107
  s
1108
1108
  ]), this.tupleOpenParen = t, this.elementList = n, this.commaList = r, this.tupleCloseParen = s;
1109
1109
  }
@@ -1159,13 +1159,13 @@ class De extends D {
1159
1159
  super(r, "<array>", [t, n]), this.array = t, this.indexer = n;
1160
1160
  }
1161
1161
  }
1162
- function Tr(e, t) {
1162
+ function br(e, t) {
1163
1163
  if (!e || e.length === 0)
1164
1164
  return t || [];
1165
1165
  if (!t || t.length === 0)
1166
1166
  return e || [];
1167
1167
  const [n] = e, [r] = t;
1168
- return (n.start < r.start ? Nn(Rt(e, t)) : Nn(Rt(t, e))).filter(
1168
+ return (n.start < r.start ? Tn(Rt(e, t)) : Tn(Rt(t, e))).filter(
1169
1169
  (s) => s !== null
1170
1170
  );
1171
1171
  }
@@ -1267,7 +1267,7 @@ function jo(e) {
1267
1267
  function Yt(e) {
1268
1268
  return `TablePartial:${e}`;
1269
1269
  }
1270
- function br(e) {
1270
+ function mr(e) {
1271
1271
  return `TablePartialInjection:${e}`;
1272
1272
  }
1273
1273
  function st(e, t) {
@@ -1333,7 +1333,7 @@ class zo {
1333
1333
  return this.id++;
1334
1334
  }
1335
1335
  }
1336
- class mr {
1336
+ class Ir {
1337
1337
  constructor({ symbolTable: t }, n) {
1338
1338
  this.references = [], this.id = n, this.symbolTable = t;
1339
1339
  }
@@ -1348,7 +1348,7 @@ class Yo {
1348
1348
  this.references = [], this.id = n, this.declaration = t;
1349
1349
  }
1350
1350
  }
1351
- class Ir {
1351
+ class gr {
1352
1352
  constructor({ symbolTable: t, declaration: n }, r) {
1353
1353
  this.references = [], this.id = r, this.symbolTable = t, this.declaration = n;
1354
1354
  }
@@ -1393,7 +1393,7 @@ function tl(e) {
1393
1393
  Ht,
1394
1394
  qt,
1395
1395
  Yt,
1396
- br
1396
+ mr
1397
1397
  ].map((t) => t(e));
1398
1398
  }
1399
1399
  function nl(e) {
@@ -1413,7 +1413,7 @@ function rl(e) {
1413
1413
  function Ge(e) {
1414
1414
  return gt(e) || lt(e);
1415
1415
  }
1416
- function xn(e, t) {
1416
+ function Dn(e, t) {
1417
1417
  const n = [], r = Math.min(e.length, t.length);
1418
1418
  for (let s = 0; s < r; s += 1)
1419
1419
  n.push(e[s], t[s]);
@@ -1422,9 +1422,9 @@ function xn(e, t) {
1422
1422
  function qe(e, t) {
1423
1423
  return e >= t.start && e < t.end;
1424
1424
  }
1425
- function gr(e) {
1425
+ function _r(e) {
1426
1426
  var t;
1427
- return e instanceof ne ? `${(t = e.op) == null ? void 0 : t.value}${gr(e.expression)}` : e.expression.literal.value;
1427
+ return e instanceof ne ? `${(t = e.op) == null ? void 0 : t.value}${_r(e.expression)}` : e.expression.literal.value;
1428
1428
  }
1429
1429
  function Ut(e) {
1430
1430
  var t;
@@ -1457,12 +1457,12 @@ class ee {
1457
1457
  function sl(e, t, n) {
1458
1458
  if (!e || !ye(e) || t.length === 0)
1459
1459
  return new x();
1460
- const r = [...t], s = Dn(e).unwrap(), i = r.pop();
1460
+ const r = [...t], s = Rn(e).unwrap(), i = r.pop();
1461
1461
  if (!(i instanceof fe))
1462
1462
  return new x();
1463
1463
  const a = F(r) instanceof B ? r.pop() : void 0;
1464
1464
  if (r.length === 3) {
1465
- const o = Dn(r[1]).value;
1465
+ const o = Rn(r[1]).value;
1466
1466
  return !o || !Mt(o) ? new x() : new M(
1467
1467
  n.create(P, {
1468
1468
  type: s,
@@ -1531,7 +1531,7 @@ function al(e) {
1531
1531
  g(e.literal);
1532
1532
  else throw e instanceof jt ? new Error("This case is handled by the TupleExpressionNode case") : new Error("Unreachable case in markInvalidNode");
1533
1533
  }
1534
- function _r(e) {
1534
+ function Ar(e) {
1535
1535
  return !!(e != null && e.isInvalid);
1536
1536
  }
1537
1537
  function $(...e) {
@@ -1573,13 +1573,13 @@ function ol(e) {
1573
1573
  if (e instanceof B)
1574
1574
  return $(
1575
1575
  e.listOpenBracket,
1576
- ...xn(e.elementList, e.commaList),
1576
+ ...Dn(e.elementList, e.commaList),
1577
1577
  e.listCloseBracket
1578
1578
  );
1579
1579
  if (e instanceof Ee)
1580
1580
  return $(
1581
1581
  e.tupleOpenParen,
1582
- ...xn(e.elementList, e.commaList),
1582
+ ...Dn(e.elementList, e.commaList),
1583
1583
  e.tupleCloseParen
1584
1584
  );
1585
1585
  if (e instanceof re)
@@ -1594,7 +1594,7 @@ function ol(e) {
1594
1594
  if (e instanceof xe) return $(e.partial);
1595
1595
  throw e instanceof jt ? new Error("This case is already handled by TupleExpressionNode") : new Error("Unreachable - no other possible cases");
1596
1596
  }
1597
- function Dn(e) {
1597
+ function Rn(e) {
1598
1598
  return X(e) ? new M(e.expression.variable) : new x();
1599
1599
  }
1600
1600
  function q(e) {
@@ -1765,7 +1765,7 @@ class ll {
1765
1765
  gatherInvalid() {
1766
1766
  let t;
1767
1767
  const n = [], r = [];
1768
- for (t = 0; t < this.tokens.length && _r(this.tokens[t]); t += 1)
1768
+ for (t = 0; t < this.tokens.length && Ar(this.tokens[t]); t += 1)
1769
1769
  r.push(this.tokens[t]);
1770
1770
  let s = this.tokens[t];
1771
1771
  for (s.leadingInvalid = [...r, ...s.leadingInvalid]; t < this.tokens.length; t += 1) {
@@ -2095,7 +2095,7 @@ class hl {
2095
2095
  if (!this.check(f.RBRACE))
2096
2096
  for (g(this.advance()); !this.isAtEnd(); ) {
2097
2097
  const r = this.peek();
2098
- if (this.check(f.RBRACE) || On(this.previous(), r))
2098
+ if (this.check(f.RBRACE) || xn(this.previous(), r))
2099
2099
  break;
2100
2100
  g(r), this.advance();
2101
2101
  }
@@ -2390,7 +2390,7 @@ class hl {
2390
2390
  return n();
2391
2391
  }
2392
2392
  shouldStopExpression() {
2393
- if (this.isAtEnd() || dr(this.previous()))
2393
+ if (this.isAtEnd() || Er(this.previous()))
2394
2394
  return !0;
2395
2395
  const t = this.peek().kind;
2396
2396
  return t === f.RBRACE || t === f.RBRACKET || t === f.RPAREN || t === f.COMMA || t === f.COLON;
@@ -2404,12 +2404,12 @@ class hl {
2404
2404
  for (; !this.isAtEnd(); ) {
2405
2405
  const r = this.peek();
2406
2406
  if (r.kind === f.LPAREN) {
2407
- const { left: s } = Rn(r);
2407
+ const { left: s } = kn(r);
2408
2408
  if (s < t || // When '(' is encountered,
2409
2409
  // consider it part of another expression if
2410
2410
  // it's at the start of a new line
2411
2411
  // and we're currently not having unmatched '(' or '['
2412
- On(this.previous(), r) && !this.contextStack.isWithinGroupExpressionContext() && !this.contextStack.isWithinListExpressionContext())
2412
+ xn(this.previous(), r) && !this.contextStack.isWithinGroupExpressionContext() && !this.contextStack.isWithinListExpressionContext())
2413
2413
  break;
2414
2414
  try {
2415
2415
  n = this.nodeFactory.create(re, {
@@ -2436,8 +2436,8 @@ class hl {
2436
2436
  indexer: s.partialNode
2437
2437
  }), new T(s.token, n, s.handlerContext)) : s;
2438
2438
  }
2439
- } else if (Sn(r)) {
2440
- const s = r, i = Rn(s);
2439
+ } else if (On(r)) {
2440
+ const s = r, i = kn(s);
2441
2441
  if (i.left !== null) {
2442
2442
  if (i.left <= t)
2443
2443
  break;
@@ -2471,7 +2471,7 @@ class hl {
2471
2471
  }
2472
2472
  leftExpression_bp() {
2473
2473
  let t;
2474
- if (Sn(this.peek())) {
2474
+ if (On(this.peek())) {
2475
2475
  const n = {};
2476
2476
  n.op = this.peek();
2477
2477
  const r = El(n.op);
@@ -2656,7 +2656,7 @@ function El(e) {
2656
2656
  const Nl = {
2657
2657
  "(": { left: 14, right: null }
2658
2658
  };
2659
- function Rn(e) {
2659
+ function kn(e) {
2660
2660
  return Nl[e.value] || { left: null, right: null };
2661
2661
  }
2662
2662
  var _ = /* @__PURE__ */ ((e) => (e.Table = "table", e.Enum = "enum", e.Ref = "ref", e.Note = "note", e.Project = "project", e.Indexes = "indexes", e.TableGroup = "tablegroup", e.TablePartial = "tablepartial", e))(_ || {}), N = /* @__PURE__ */ ((e) => (e.Color = "color", e.HeaderColor = "headercolor", e.Note = "note", e.PK = "pk", e.PKey = "primary key", e.Unique = "unique", e.Ref = "ref", e.NotNull = "not null", e.Null = "null", e.Increment = "increment", e.Default = "default", e.Name = "name", e.Type = "type", e.Update = "update", e.Delete = "delete", e))(N || {});
@@ -2708,7 +2708,7 @@ function Je(e) {
2708
2708
  let r;
2709
2709
  if (!X(F(t))) {
2710
2710
  const s = t.pop();
2711
- if (wr(s))
2711
+ if (Pr(s))
2712
2712
  r = s.elementList.map(
2713
2713
  (i) => j(i).unwrap()
2714
2714
  );
@@ -2730,9 +2730,9 @@ function z(e) {
2730
2730
  return X(e) ? new M(e.expression.variable.value) : new x();
2731
2731
  }
2732
2732
  function ct(e) {
2733
- if (kn(e))
2733
+ if (Un(e))
2734
2734
  return e instanceof Te ? new M({ functional: [e], nonFunctional: [] }) : new M({ functional: [], nonFunctional: [e] });
2735
- if (e instanceof Ee && e.elementList.every(kn)) {
2735
+ if (e instanceof Ee && e.elementList.every(Un)) {
2736
2736
  const t = e.elementList.filter(
2737
2737
  (r) => r instanceof Te
2738
2738
  ), n = e.elementList.filter(X);
@@ -2755,7 +2755,7 @@ function V(e) {
2755
2755
  }
2756
2756
  function bl(e) {
2757
2757
  var t;
2758
- return !(e instanceof de) || !Lr((t = e.op) == null ? void 0 : t.value) ? !1 : Je(e.leftExpression).and_then(() => Je(e.rightExpression)).unwrap_or(void 0) !== void 0;
2758
+ return !(e instanceof de) || !vr((t = e.op) == null ? void 0 : t.value) ? !1 : Je(e.leftExpression).and_then(() => Je(e.rightExpression)).unwrap_or(void 0) !== void 0;
2759
2759
  }
2760
2760
  function ml(e) {
2761
2761
  const t = Je(e.leftExpression), n = Je(e.rightExpression);
@@ -2764,10 +2764,10 @@ function ml(e) {
2764
2764
  const { tupleElements: r } = t.unwrap(), { tupleElements: s } = n.unwrap();
2765
2765
  return (r == null ? void 0 : r.length) === (s == null ? void 0 : s.length);
2766
2766
  }
2767
- function kn(e) {
2767
+ function Un(e) {
2768
2768
  return e instanceof H && e.expression instanceof ue || e instanceof Te;
2769
2769
  }
2770
- function Un(e, t) {
2770
+ function Mn(e, t) {
2771
2771
  var s, i, a, o;
2772
2772
  let n = t;
2773
2773
  const r = Xo(e);
@@ -2840,7 +2840,7 @@ class gl {
2840
2840
  return this.declarationNode.parent instanceof P ? [new c(l.INVALID_PROJECT_CONTEXT, "An Enum can only appear top-level", this.declarationNode)] : [];
2841
2841
  }
2842
2842
  validateName(t) {
2843
- return t ? Ar(t) ? [] : [new c(l.INVALID_NAME, "An Enum name must be of the form <enum> or <schema>.<enum>", t)] : [new c(l.NAME_NOT_FOUND, "An Enum must have a name", this.declarationNode)];
2843
+ return t ? Lr(t) ? [] : [new c(l.INVALID_NAME, "An Enum name must be of the form <enum> or <schema>.<enum>", t)] : [new c(l.NAME_NOT_FOUND, "An Enum must have a name", this.declarationNode)];
2844
2844
  }
2845
2845
  validateAlias(t) {
2846
2846
  return t ? [new c(l.UNEXPECTED_ALIAS, "A Ref shouldn't have an alias", t)] : [];
@@ -3212,7 +3212,7 @@ class wl {
3212
3212
  return this.declarationNode.parent instanceof P ? [new c(l.INVALID_TABLE_CONTEXT, "Table must appear top-level", this.declarationNode)] : [];
3213
3213
  }
3214
3214
  validateName(t) {
3215
- return t ? t instanceof De ? [new c(l.INVALID_NAME, "Invalid array as Table name, maybe you forget to add a space between the name and the setting list?", t)] : Ar(t) ? [] : [new c(l.INVALID_NAME, "A Table name must be of the form <table> or <schema>.<table>", t)] : [new c(l.NAME_NOT_FOUND, "A Table must have a name", this.declarationNode)];
3215
+ return t ? t instanceof De ? [new c(l.INVALID_NAME, "Invalid array as Table name, maybe you forget to add a space between the name and the setting list?", t)] : Lr(t) ? [] : [new c(l.INVALID_NAME, "A Table name must be of the form <table> or <schema>.<table>", t)] : [new c(l.NAME_NOT_FOUND, "A Table must have a name", this.declarationNode)];
3216
3216
  }
3217
3217
  validateAlias(t) {
3218
3218
  return t ? Dl(t) ? [] : [new c(l.INVALID_ALIAS, "Table aliases can only contains alphanumeric and underscore unless surrounded by double quotes", t)] : [];
@@ -3238,7 +3238,7 @@ class wl {
3238
3238
  }
3239
3239
  registerElement() {
3240
3240
  const t = [];
3241
- this.declarationNode.symbol = this.symbolFactory.create(Ir, { declaration: this.declarationNode, symbolTable: new Xe() });
3241
+ this.declarationNode.symbol = this.symbolFactory.create(gr, { declaration: this.declarationNode, symbolTable: new Xe() });
3242
3242
  const { name: n, alias: r } = this.declarationNode, s = Y(n);
3243
3243
  if (s.isOk()) {
3244
3244
  const i = [...s.unwrap()], a = i.pop(), o = _t(i, this.publicSymbolTable, this.symbolFactory), u = ot(a);
@@ -3268,7 +3268,7 @@ class wl {
3268
3268
  registerInjection(t) {
3269
3269
  var o, u, p;
3270
3270
  if (!((u = (o = t.partial) == null ? void 0 : o.variable) != null && u.value)) return [];
3271
- const n = (p = t.partial.variable) == null ? void 0 : p.value, r = br(n), s = this.symbolFactory.create(Zo, { declaration: t });
3271
+ const n = (p = t.partial.variable) == null ? void 0 : p.value, r = mr(n), s = this.symbolFactory.create(Zo, { declaration: t });
3272
3272
  t.symbol = s;
3273
3273
  const i = this.declarationNode.symbol.symbolTable, a = i.get(r);
3274
3274
  return a ? [
@@ -3281,7 +3281,7 @@ class wl {
3281
3281
  if (!n.callee)
3282
3282
  return [];
3283
3283
  const r = [];
3284
- n.args.length === 0 && r.push(new c(l.INVALID_COLUMN, "A column must have a type", n.callee)), X(n.callee) || r.push(new c(l.INVALID_COLUMN_NAME, "A column name must be an identifier or a quoted identifier", n.callee)), n.args[0] && !Pr(n.args[0]) && r.push(new c(l.INVALID_COLUMN_TYPE, "Invalid column type", n.args[0]));
3284
+ n.args.length === 0 && r.push(new c(l.INVALID_COLUMN, "A column must have a type", n.callee)), X(n.callee) || r.push(new c(l.INVALID_COLUMN_NAME, "A column name must be an identifier or a quoted identifier", n.callee)), n.args[0] && !Sr(n.args[0]) && r.push(new c(l.INVALID_COLUMN_TYPE, "Invalid column type", n.args[0]));
3285
3285
  const s = n.args.slice(1);
3286
3286
  return r.push(...this.validateFieldSetting(s)), r.push(...this.registerField(n)), r;
3287
3287
  });
@@ -3331,7 +3331,7 @@ class wl {
3331
3331
  break;
3332
3332
  case N.Ref:
3333
3333
  u.forEach((h) => {
3334
- yr(h.value) || s.push(new c(l.INVALID_COLUMN_SETTING_VALUE, "'ref' must be a valid unary relationship", h.value || h.name));
3334
+ wr(h.value) || s.push(new c(l.INVALID_COLUMN_SETTING_VALUE, "'ref' must be a valid unary relationship", h.value || h.name));
3335
3335
  });
3336
3336
  break;
3337
3337
  case N.PKey:
@@ -3371,7 +3371,7 @@ class wl {
3371
3371
  break;
3372
3372
  case N.Default:
3373
3373
  u.length > 1 && s.push(...u.map((h) => new c(l.DUPLICATE_TABLE_SETTING, "'default' can only appear once", h))), u.forEach((h) => {
3374
- vr(h.value) || s.push(new c(
3374
+ yr(h.value) || s.push(new c(
3375
3375
  l.INVALID_TABLE_SETTING,
3376
3376
  "'default' must be a string literal, number literal, function expression, true, false or null",
3377
3377
  h.value || h.name
@@ -3620,7 +3620,7 @@ class xl {
3620
3620
  return t.flatMap((n) => {
3621
3621
  if (!n.callee) return [];
3622
3622
  const r = [];
3623
- n.args.length === 0 && r.push(new c(l.INVALID_COLUMN, "A column must have a type", n.callee)), X(n.callee) || r.push(new c(l.INVALID_COLUMN_NAME, "A column name must be an identifier or a quoted identifier", n.callee)), n.args[0] && !Pr(n.args[0]) && r.push(new c(l.INVALID_COLUMN_TYPE, "Invalid column type", n.args[0]));
3623
+ n.args.length === 0 && r.push(new c(l.INVALID_COLUMN, "A column must have a type", n.callee)), X(n.callee) || r.push(new c(l.INVALID_COLUMN_NAME, "A column name must be an identifier or a quoted identifier", n.callee)), n.args[0] && !Sr(n.args[0]) && r.push(new c(l.INVALID_COLUMN_TYPE, "Invalid column type", n.args[0]));
3624
3624
  const s = n.args.slice(1);
3625
3625
  return r.push(
3626
3626
  ...this.validateFieldSetting(s),
@@ -3673,7 +3673,7 @@ class xl {
3673
3673
  break;
3674
3674
  case N.Ref:
3675
3675
  p.forEach((d) => {
3676
- yr(d.value) || i.push(new c(l.INVALID_COLUMN_SETTING_VALUE, `'${h}' must be a valid unary relationship`, d.value || d.name));
3676
+ wr(d.value) || i.push(new c(l.INVALID_COLUMN_SETTING_VALUE, `'${h}' must be a valid unary relationship`, d.value || d.name));
3677
3677
  });
3678
3678
  break;
3679
3679
  case N.PKey:
@@ -3715,7 +3715,7 @@ class xl {
3715
3715
  break;
3716
3716
  case N.Default:
3717
3717
  p.length > 1 && i.push(...p.map((d) => new c(l.DUPLICATE_COLUMN_SETTING, `'${h}' can only appear once`, d))), p.forEach((d) => {
3718
- vr(d.value) || i.push(new c(
3718
+ yr(d.value) || i.push(new c(
3719
3719
  l.INVALID_COLUMN_SETTING_VALUE,
3720
3720
  `'${h}' must be a string literal, number literal, function expression, true, false or null`,
3721
3721
  d.value || d.name
@@ -3762,7 +3762,7 @@ function ge(e) {
3762
3762
  return Il;
3763
3763
  }
3764
3764
  }
3765
- function Ar(e) {
3765
+ function Lr(e) {
3766
3766
  return !!Y(e).unwrap_or(!1);
3767
3767
  }
3768
3768
  function Dl(e) {
@@ -3783,14 +3783,14 @@ function _t(e, t, n) {
3783
3783
  throw new Error("Expect a symbol table in a schema symbol");
3784
3784
  } else {
3785
3785
  a = new Xe();
3786
- const u = n.create(mr, { symbolTable: a });
3786
+ const u = n.create(Ir, { symbolTable: a });
3787
3787
  r.set(o, u);
3788
3788
  }
3789
3789
  r = a;
3790
3790
  }
3791
3791
  return r;
3792
3792
  }
3793
- function Lr(e) {
3793
+ function vr(e) {
3794
3794
  return e === "-" || e === "<>" || e === ">" || e === "<";
3795
3795
  }
3796
3796
  function At(e) {
@@ -3808,7 +3808,7 @@ function At(e) {
3808
3808
  function J(e) {
3809
3809
  return e === void 0;
3810
3810
  }
3811
- function vr(e) {
3811
+ function yr(e) {
3812
3812
  var t;
3813
3813
  return !!(q(e) || ke(e) || ye(e) && ["true", "false", "null"].includes(e.expression.variable.value.toLowerCase()) || e instanceof ne && Ol.includes((t = e.op) == null ? void 0 : t.value) && ke(e.expression) || e instanceof Te);
3814
3814
  }
@@ -3816,17 +3816,17 @@ function ke(e) {
3816
3816
  var t, n, r;
3817
3817
  return e instanceof ne ? ((t = e.op) == null ? void 0 : t.value) !== "-" && ((n = e.op) == null ? void 0 : n.value) !== "+" ? !1 : ke(e.expression) : e instanceof H && e.expression instanceof je && ((r = e.expression.literal) == null ? void 0 : r.kind) === f.NUMERIC_LITERAL;
3818
3818
  }
3819
- function yr(e) {
3819
+ function wr(e) {
3820
3820
  var n;
3821
- if (!(e instanceof ne) || !Lr((n = e.op) == null ? void 0 : n.value))
3821
+ if (!(e instanceof ne) || !vr((n = e.op) == null ? void 0 : n.value))
3822
3822
  return !1;
3823
3823
  const t = Y(e.expression).unwrap_or(void 0);
3824
3824
  return t !== void 0 && t.length > 0;
3825
3825
  }
3826
- function wr(e) {
3826
+ function Pr(e) {
3827
3827
  return e instanceof Ee && e.elementList.every(X);
3828
3828
  }
3829
- function Pr(e) {
3829
+ function Sr(e) {
3830
3830
  if (!(e instanceof re || Kt(e) || e instanceof H || e instanceof De))
3831
3831
  return !1;
3832
3832
  if (e instanceof re) {
@@ -3859,9 +3859,9 @@ function G(e) {
3859
3859
  }
3860
3860
  return new ee(t, n);
3861
3861
  }
3862
- class Mn {
3862
+ class Fn {
3863
3863
  constructor(t, n) {
3864
- this.ast = t, this.symbolFactory = n, this.publicSchemaSymbol = this.symbolFactory.create(mr, {
3864
+ this.ast = t, this.symbolFactory = n, this.publicSchemaSymbol = this.symbolFactory.create(Ir, {
3865
3865
  symbolTable: new Xe()
3866
3866
  }), this.ast.symbol = this.publicSchemaSymbol, this.ast.symbol.declaration = this.ast;
3867
3867
  }
@@ -3904,7 +3904,7 @@ class _e {
3904
3904
  n instanceof fe ? n.body.forEach((r) => {
3905
3905
  if (r instanceof P) {
3906
3906
  if (!r.type || Re(this.declarationNode).unwrap_or(null) === _.TablePartial && Re(r).unwrap_or(null) === _.Indexes) return;
3907
- const s = Sr(r);
3907
+ const s = Or(r);
3908
3908
  new s(r, this.errors).bind();
3909
3909
  } else r instanceof w ? this.bindSubfield(r) : this.bindPartialInjection(r);
3910
3910
  }) : this.bindSubfield(n);
@@ -3935,7 +3935,7 @@ class _e {
3935
3935
  // or a complex tuple like v1.User.(id, name)
3936
3936
  bindFragments(t, n) {
3937
3937
  if (t.length === 0) return;
3938
- const r = t.length === 1 && t[0] instanceof xe, s = [...n.topSubnamesSymbolKind], { remainingSubnamesSymbolKind: i } = n, a = r ? -1 : t.findIndex((E) => !X(E)), u = a !== -1 && wr(t[a]) ? t[a] : void 0, p = a >= 0 ? s.pop() : void 0, h = t.slice(
3938
+ const r = t.length === 1 && t[0] instanceof xe, s = [...n.topSubnamesSymbolKind], { remainingSubnamesSymbolKind: i } = n, a = r ? -1 : t.findIndex((E) => !X(E)), u = a !== -1 && Pr(t[a]) ? t[a] : void 0, p = a >= 0 ? s.pop() : void 0, h = t.slice(
3939
3939
  0,
3940
3940
  a === -1 ? void 0 : a
3941
3941
  );
@@ -3974,7 +3974,7 @@ class _e {
3974
3974
  resolveIndexStack(t, n) {
3975
3975
  if (t.length === 0)
3976
3976
  throw new Error("Unreachable - An unresolved name must have at least one name component");
3977
- const [r, ...s] = t, i = Un(r.index, this.declarationNode);
3977
+ const [r, ...s] = t, i = Mn(r.index, this.declarationNode);
3978
3978
  if (i === void 0) {
3979
3979
  const { kind: p, name: h } = oe(r.index).unwrap();
3980
3980
  this.logError(r.referrer, `Can not find ${p} '${h}'`, n);
@@ -4009,7 +4009,7 @@ class _e {
4009
4009
  n.forEach((i, a) => {
4010
4010
  var p, h;
4011
4011
  if (!Wo(a)) return;
4012
- const o = Un(Ho(a), this.declarationNode), u = (h = (p = o == null ? void 0 : o.declaration) == null ? void 0 : p.symbol) == null ? void 0 : h.symbolTable;
4012
+ const o = Mn(Ho(a), this.declarationNode), u = (h = (p = o == null ? void 0 : o.declaration) == null ? void 0 : p.symbol) == null ? void 0 : h.symbolTable;
4013
4013
  u && u.forEach((d, E) => {
4014
4014
  n.has(E) || r.set(E, { injectorFieldSymbol: d, injectorDeclaration: i.declaration });
4015
4015
  });
@@ -4191,7 +4191,7 @@ class Cl extends _e {
4191
4191
  }, this.settingList = {};
4192
4192
  }
4193
4193
  }
4194
- function Sr(e) {
4194
+ function Or(e) {
4195
4195
  switch (e.type.value.toLowerCase()) {
4196
4196
  case _.Enum:
4197
4197
  return kl;
@@ -4220,7 +4220,7 @@ class $l {
4220
4220
  resolve(t) {
4221
4221
  return this.ast.body.map((n) => {
4222
4222
  if (!n.type) return null;
4223
- const r = Sr(n), s = new r(n, this.errors);
4223
+ const r = Or(n), s = new r(n, this.errors);
4224
4224
  return s.resolveInjections(t), s;
4225
4225
  }).forEach((n) => n == null ? void 0 : n.bind()), new ee(this.ast, this.errors);
4226
4226
  }
@@ -4239,14 +4239,14 @@ class Xl {
4239
4239
  }
4240
4240
  // Analyzing: Invoking both the validator and binder
4241
4241
  analyze() {
4242
- return new Mn(this.ast, this.symbolFactory).validate().chain((n) => new $l(n).resolve(this.symbolFactory));
4242
+ return new Fn(this.ast, this.symbolFactory).validate().chain((n) => new $l(n).resolve(this.symbolFactory));
4243
4243
  }
4244
4244
  // For invoking the validator only
4245
4245
  validate() {
4246
- return new Mn(this.ast, this.symbolFactory).validate().chain((n) => new ee(n, []));
4246
+ return new Fn(this.ast, this.symbolFactory).validate().chain((n) => new ee(n, []));
4247
4247
  }
4248
4248
  }
4249
- function Fn(e, t) {
4249
+ function Bn(e, t) {
4250
4250
  const { variables: n, tupleElements: r } = Je(e).unwrap();
4251
4251
  return r ? n.length === 0 ? {
4252
4252
  schemaName: t.schemaName,
@@ -4266,7 +4266,7 @@ function Fn(e, t) {
4266
4266
  schemaName: n.pop() || null
4267
4267
  };
4268
4268
  }
4269
- function Or(e) {
4269
+ function xr(e) {
4270
4270
  switch (e) {
4271
4271
  case "<":
4272
4272
  return ["1", "*"];
@@ -4309,7 +4309,7 @@ function Be(e) {
4309
4309
  function et(e) {
4310
4310
  return e.expression.literal.value;
4311
4311
  }
4312
- function xr(e, t) {
4312
+ function Dr(e, t) {
4313
4313
  if (Array.isArray(e)) {
4314
4314
  const s = e.map(({ id: a }) => a).sort().join(","), i = t.map(({ id: a }) => a).sort().join(",");
4315
4315
  return s < i ? `${s}-${i}` : `${i}-${s}`;
@@ -4331,7 +4331,7 @@ function le(e) {
4331
4331
  return n.map((i) => i.slice(s)).join(`
4332
4332
  `);
4333
4333
  }
4334
- function Dr(e) {
4334
+ function Rr(e) {
4335
4335
  if (e) {
4336
4336
  if (q(e))
4337
4337
  return {
@@ -4356,9 +4356,9 @@ function Dr(e) {
4356
4356
  throw new Error("Unreachable");
4357
4357
  }
4358
4358
  }
4359
- function Rr(e) {
4359
+ function kr(e) {
4360
4360
  let t = null;
4361
- e instanceof re && (t = e.argumentList.elementList.map((i) => ke(i) ? gr(i) : q(i) ? V(i).unwrap() : z(i).unwrap()).join(","), e = e.callee);
4361
+ e instanceof re && (t = e.argumentList.elementList.map((i) => ke(i) ? _r(i) : q(i) ? V(i).unwrap() : z(i).unwrap()).join(","), e = e.callee);
4362
4362
  let n = "";
4363
4363
  for (; e instanceof De; )
4364
4364
  n = `[${e.indexer.elementList.map((i) => i.name.expression.literal.value).join(",")}]${n}`, e = e.array;
@@ -4376,7 +4376,7 @@ function Rr(e) {
4376
4376
  args: t
4377
4377
  });
4378
4378
  }
4379
- class kr {
4379
+ class Ur {
4380
4380
  constructor(t, n) {
4381
4381
  this.declarationNode = t, this.env = n, this.table = {
4382
4382
  name: void 0,
@@ -4480,12 +4480,12 @@ class kr {
4480
4480
  var a, o, u, p, h, d, E, b, A;
4481
4481
  const n = [], r = {};
4482
4482
  r.name = j(t.callee).unwrap();
4483
- const s = Rr(t.args[0]);
4483
+ const s = kr(t.args[0]);
4484
4484
  r.type = s.getValue(), n.push(...s.getErrors()), r.token = L(t), r.inline_refs = [];
4485
4485
  const i = t.args.slice(1);
4486
4486
  if (F(i) instanceof B) {
4487
4487
  const I = G(i.pop()).getValue();
4488
- r.pk = !!((a = I[N.PK]) != null && a.length) || !!((o = I[N.PKey]) != null && o.length), r.increment = !!((u = I[N.Increment]) != null && u.length), r.unique = !!((p = I[N.Unique]) != null && p.length), r.not_null = (h = I[N.NotNull]) != null && h.length ? !0 : (d = I[N.Null]) != null && d.length ? !1 : void 0, r.dbdefault = Dr((b = (E = I[N.Default]) == null ? void 0 : E.at(0)) == null ? void 0 : b.value);
4488
+ r.pk = !!((a = I[N.PK]) != null && a.length) || !!((o = I[N.PKey]) != null && o.length), r.increment = !!((u = I[N.Increment]) != null && u.length), r.unique = !!((p = I[N.Unique]) != null && p.length), r.not_null = (h = I[N.NotNull]) != null && h.length ? !0 : (d = I[N.Null]) != null && d.length ? !1 : void 0, r.dbdefault = Rr((b = (E = I[N.Default]) == null ? void 0 : E.at(0)) == null ? void 0 : b.value);
4489
4489
  const v = (A = I[N.Note]) == null ? void 0 : A.at(0);
4490
4490
  r.note = v && {
4491
4491
  value: V(v.value).map(le).unwrap(),
@@ -4582,13 +4582,13 @@ class kr {
4582
4582
  })), [];
4583
4583
  }
4584
4584
  registerInlineRefToEnv(t, n, r, s) {
4585
- const i = xr(t.symbol, n);
4585
+ const i = Dr(t.symbol, n);
4586
4586
  if (this.env.refIds[i])
4587
4587
  return [
4588
4588
  new c(l.CIRCULAR_REF, "References with same endpoints exist", s),
4589
4589
  new c(l.CIRCULAR_REF, "References with same endpoints exist", this.env.refIds[i])
4590
4590
  ];
4591
- const a = Or(r.relation);
4591
+ const a = xr(r.relation);
4592
4592
  return this.env.refIds[i] = s, this.env.ref.set(s, {
4593
4593
  name: null,
4594
4594
  schemaName: null,
@@ -4636,11 +4636,11 @@ class Wl {
4636
4636
  ] : [...this.interpretNote(n[0])];
4637
4637
  }
4638
4638
  interpretNote(t) {
4639
- const n = ir(t, "callee.expression.literal.value", "");
4639
+ const n = ar(t, "callee.expression.literal.value", "");
4640
4640
  return this.note.content = le(n), [];
4641
4641
  }
4642
4642
  }
4643
- class Ur {
4643
+ class Mr {
4644
4644
  constructor(t, n) {
4645
4645
  this.declarationNode = t, this.env = n, this.container = this.declarationNode.parent instanceof P ? this.env.tables.get(this.declarationNode.parent) : void 0, this.ref = {};
4646
4646
  }
@@ -4662,7 +4662,7 @@ class Ur {
4662
4662
  const n = t.callee.op.value, { leftExpression: r, rightExpression: s } = t.callee, i = ut(r), a = ut(s);
4663
4663
  if (Jt(i, a))
4664
4664
  return [new c(l.SAME_ENDPOINT, "Two endpoints are the same", t)];
4665
- const o = xr(i, a);
4665
+ const o = Dr(i, a);
4666
4666
  if (this.env.refIds[o])
4667
4667
  return [
4668
4668
  new c(l.CIRCULAR_REF, "References with same endpoints exist", this.declarationNode),
@@ -4674,22 +4674,22 @@ class Ur {
4674
4674
  const y = (E = (d = v.update) == null ? void 0 : d.at(0)) == null ? void 0 : E.value;
4675
4675
  this.ref.onUpdate = y instanceof ie ? Ce(y).unwrap_or(void 0) : z(y).unwrap_or(void 0), this.ref.color = (b = v.color) != null && b.length ? et((I = (A = v.color) == null ? void 0 : A.at(0)) == null ? void 0 : I.value) : void 0;
4676
4676
  }
4677
- const u = Or(n);
4677
+ const u = xr(n);
4678
4678
  return this.ref.endpoints = [
4679
4679
  {
4680
- ...Fn(r, this.container),
4680
+ ...Bn(r, this.container),
4681
4681
  relation: u[0],
4682
4682
  token: L(r)
4683
4683
  },
4684
4684
  {
4685
- ...Fn(s, this.container),
4685
+ ...Bn(s, this.container),
4686
4686
  relation: u[1],
4687
4687
  token: L(s)
4688
4688
  }
4689
4689
  ], this.env.refIds[o] = this.declarationNode, [];
4690
4690
  }
4691
4691
  }
4692
- class Mr {
4692
+ class Fr {
4693
4693
  constructor(t, n) {
4694
4694
  this.declarationNode = t, this.env = n, this.tableGroup = { tables: [] };
4695
4695
  }
@@ -4756,7 +4756,7 @@ class Mr {
4756
4756
  }, [];
4757
4757
  }
4758
4758
  }
4759
- class Fr {
4759
+ class Br {
4760
4760
  constructor(t, n) {
4761
4761
  this.declarationNode = t, this.env = n, this.enum = { values: [] };
4762
4762
  }
@@ -4780,7 +4780,7 @@ class Fr {
4780
4780
  });
4781
4781
  }
4782
4782
  }
4783
- class Br {
4783
+ class Gr {
4784
4784
  constructor(t, n) {
4785
4785
  this.declarationNode = t, this.env = n, this.tablePartial = {
4786
4786
  name: void 0,
@@ -4854,12 +4854,12 @@ class Br {
4854
4854
  var a, o, u, p, h, d, E, b, A;
4855
4855
  const n = [], r = {};
4856
4856
  r.name = j(t.callee).unwrap();
4857
- const s = Rr(t.args[0]);
4857
+ const s = kr(t.args[0]);
4858
4858
  r.type = s.getValue(), n.push(...s.getErrors()), r.token = L(t), r.inline_refs = [];
4859
4859
  const i = t.args.slice(1);
4860
4860
  if (F(i) instanceof B) {
4861
4861
  const I = G(i.pop()).getValue();
4862
- r.pk = !!((a = I[N.PK]) != null && a.length) || !!((o = I[N.PKey]) != null && o.length), r.increment = !!((u = I[N.Increment]) != null && u.length), r.unique = !!((p = I[N.Unique]) != null && p.length), r.not_null = (h = I[N.NotNull]) != null && h.length ? !0 : (d = I[N.Null]) != null && d.length ? !1 : void 0, r.dbdefault = Dr((b = (E = I[N.Default]) == null ? void 0 : E.at(0)) == null ? void 0 : b.value);
4862
+ r.pk = !!((a = I[N.PK]) != null && a.length) || !!((o = I[N.PKey]) != null && o.length), r.increment = !!((u = I[N.Increment]) != null && u.length), r.unique = !!((p = I[N.Unique]) != null && p.length), r.not_null = (h = I[N.NotNull]) != null && h.length ? !0 : (d = I[N.Null]) != null && d.length ? !1 : void 0, r.dbdefault = Rr((b = (E = I[N.Default]) == null ? void 0 : E.at(0)) == null ? void 0 : b.value);
4863
4863
  const v = (A = I[N.Note]) == null ? void 0 : A.at(0);
4864
4864
  r.note = v && {
4865
4865
  value: V(v.value).map(le).unwrap(),
@@ -4965,19 +4965,19 @@ class Hl {
4965
4965
  const r = n;
4966
4966
  switch ((s = r.type) == null ? void 0 : s.value.toLowerCase()) {
4967
4967
  case "table": {
4968
- const i = new kr(r, this.env).interpret();
4968
+ const i = new Ur(r, this.env).interpret();
4969
4969
  return this.project.tables.push(this.env.tables.get(r)), i;
4970
4970
  }
4971
4971
  case "ref": {
4972
- const i = new Ur(r, this.env).interpret();
4972
+ const i = new Mr(r, this.env).interpret();
4973
4973
  return this.project.refs.push(this.env.ref.get(r)), i;
4974
4974
  }
4975
4975
  case "tablegroup": {
4976
- const i = new Mr(r, this.env).interpret();
4976
+ const i = new Fr(r, this.env).interpret();
4977
4977
  return this.project.tableGroups.push(this.env.tableGroups.get(r)), i;
4978
4978
  }
4979
4979
  case "enum": {
4980
- const i = new Fr(r, this.env).interpret();
4980
+ const i = new Br(r, this.env).interpret();
4981
4981
  return this.project.enums.push(this.env.enums.get(r)), i;
4982
4982
  }
4983
4983
  case "note":
@@ -4986,7 +4986,7 @@ class Hl {
4986
4986
  token: L(r)
4987
4987
  }, [];
4988
4988
  case "tablepartial": {
4989
- const i = new Br(r, this.env).interpret();
4989
+ const i = new Gr(r, this.env).interpret();
4990
4990
  return this.project.tablePartials.push(this.env.tablePartials.get(r)), i;
4991
4991
  }
4992
4992
  default:
@@ -5028,17 +5028,17 @@ class ql {
5028
5028
  const t = this.ast.body.flatMap((n) => {
5029
5029
  switch (Re(n).unwrap_or(void 0)) {
5030
5030
  case _.Table:
5031
- return new kr(n, this.env).interpret();
5031
+ return new Ur(n, this.env).interpret();
5032
5032
  case _.Note:
5033
5033
  return new Wl(n, this.env).interpret();
5034
5034
  case _.Ref:
5035
- return new Ur(n, this.env).interpret();
5036
- case _.TableGroup:
5037
5035
  return new Mr(n, this.env).interpret();
5036
+ case _.TableGroup:
5037
+ return new Fr(n, this.env).interpret();
5038
5038
  case _.TablePartial:
5039
- return new Br(n, this.env).interpret();
5039
+ return new Gr(n, this.env).interpret();
5040
5040
  case _.Enum:
5041
- return new Fr(n, this.env).interpret();
5041
+ return new Br(n, this.env).interpret();
5042
5042
  case _.Project:
5043
5043
  return new Hl(n, this.env).interpret();
5044
5044
  default:
@@ -5106,7 +5106,7 @@ function Lt(e) {
5106
5106
  function Zt(e, t) {
5107
5107
  return e.getOffsetAt(t);
5108
5108
  }
5109
- class Gr {
5109
+ class Vr {
5110
5110
  constructor(t, n = []) {
5111
5111
  this.compiler = t, this.triggerCharacters = n;
5112
5112
  }
@@ -5120,12 +5120,12 @@ class Gr {
5120
5120
  ].find((E) => Co(E) && qe(r, E)))
5121
5121
  return C();
5122
5122
  if (a === void 0)
5123
- return $n();
5123
+ return jn();
5124
5124
  if ([f.STRING_LITERAL, f.QUOTED_STRING].includes(i.kind) && qe(r, i))
5125
5125
  return C();
5126
5126
  const u = this.compiler.container.element(r);
5127
5127
  if (this.compiler.container.scopeKind(r) === k.TOPLEVEL || u instanceof P && u.type && u.type.start <= r && u.type.end >= r)
5128
- return $n();
5128
+ return jn();
5129
5129
  const p = [...this.compiler.container.stack(r)].reverse();
5130
5130
  for (const E of p)
5131
5131
  if (E instanceof ne)
@@ -5134,7 +5134,7 @@ class Gr {
5134
5134
  case "<":
5135
5135
  case "<>":
5136
5136
  case "-":
5137
- return Bn(
5137
+ return Gn(
5138
5138
  this.compiler,
5139
5139
  r,
5140
5140
  E
@@ -5146,13 +5146,13 @@ class Gr {
5146
5146
  case "<":
5147
5147
  case "<>":
5148
5148
  case "-":
5149
- return Bn(
5149
+ return Gn(
5150
5150
  this.compiler,
5151
5151
  r,
5152
5152
  E
5153
5153
  );
5154
5154
  case ".":
5155
- return Vr(
5155
+ return Cr(
5156
5156
  this.compiler,
5157
5157
  r,
5158
5158
  E
@@ -5160,17 +5160,17 @@ class Gr {
5160
5160
  }
5161
5161
  else {
5162
5162
  if (E instanceof ae)
5163
- return Gn(this.compiler, r, E);
5163
+ return Vn(this.compiler, r, E);
5164
5164
  if (E instanceof B)
5165
- return Gn(this.compiler, r, E);
5165
+ return Vn(this.compiler, r, E);
5166
5166
  if (E instanceof Ee)
5167
5167
  return Ql(this.compiler, r);
5168
5168
  if (E instanceof xe)
5169
5169
  return Yl(this.compiler, r);
5170
5170
  if (E instanceof w)
5171
- return Cn(this.compiler, r, E);
5171
+ return $n(this.compiler, r, E);
5172
5172
  if (E instanceof P && (E.bodyColon && r >= E.bodyColon.end || E.body && qe(r, E.body)))
5173
- return Cn(this.compiler, r, void 0);
5173
+ return $n(this.compiler, r, void 0);
5174
5174
  }
5175
5175
  return C();
5176
5176
  }
@@ -5179,7 +5179,7 @@ function Yl(e, t) {
5179
5179
  const n = e.container.element(t);
5180
5180
  return tt(e, t, n, [m.TablePartial]);
5181
5181
  }
5182
- function Bn(e, t, n) {
5182
+ function Gn(e, t, n) {
5183
5183
  const r = e.container.scopeKind(t);
5184
5184
  if ([
5185
5185
  k.REF,
@@ -5223,32 +5223,32 @@ function Ql(e, t) {
5223
5223
  var r;
5224
5224
  switch (e.container.scopeKind(t)) {
5225
5225
  case k.INDEXES:
5226
- return $r(e, t);
5226
+ return jr(e, t);
5227
5227
  case k.REF:
5228
5228
  {
5229
5229
  const s = [...e.container.stack(t)];
5230
5230
  for (; s.length > 0; ) {
5231
5231
  const i = s.pop();
5232
5232
  if (i instanceof de && ((r = i.op) == null ? void 0 : r.value) === ".")
5233
- return Vr(
5233
+ return Cr(
5234
5234
  e,
5235
5235
  t,
5236
5236
  i
5237
5237
  );
5238
5238
  }
5239
5239
  }
5240
- return Cr(e, t);
5240
+ return $r(e, t);
5241
5241
  }
5242
5242
  return C();
5243
5243
  }
5244
- function Gn(e, t, n) {
5244
+ function Vn(e, t, n) {
5245
5245
  const { token: r } = e.container.token(t);
5246
5246
  if ([f.COMMA, f.LBRACKET].includes(r == null ? void 0 : r.kind)) {
5247
- const s = Vn(e, t);
5247
+ const s = Cn(e, t);
5248
5248
  return (r == null ? void 0 : r.kind) === f.COMMA && ht(r, t) ? ft(s) : s;
5249
5249
  }
5250
5250
  if (n.name && n.name.start <= t && n.name.end >= t)
5251
- return Vn(e, t);
5251
+ return Cn(e, t);
5252
5252
  if (n.name instanceof ie) {
5253
5253
  const s = Kl(
5254
5254
  e,
@@ -5259,7 +5259,7 @@ function Gn(e, t, n) {
5259
5259
  }
5260
5260
  return C();
5261
5261
  }
5262
- function Vn(e, t) {
5262
+ function Cn(e, t) {
5263
5263
  const n = e.container.element(t);
5264
5264
  if (n instanceof te) return C();
5265
5265
  const r = e.container.scopeKind(t);
@@ -5388,7 +5388,7 @@ function Kl(e, t, n) {
5388
5388
  }
5389
5389
  return C();
5390
5390
  }
5391
- function Vr(e, t, n) {
5391
+ function Cr(e, t, n) {
5392
5392
  const r = Fe(n).unwrap_or([]);
5393
5393
  if (r.pop(), r.some((i) => !X(i)))
5394
5394
  return C();
@@ -5402,7 +5402,7 @@ function Vr(e, t, n) {
5402
5402
  }))
5403
5403
  });
5404
5404
  }
5405
- function Cn(e, t, n) {
5405
+ function $n(e, t, n) {
5406
5406
  var s;
5407
5407
  switch (e.container.scopeKind(t)) {
5408
5408
  case k.TABLE:
@@ -5415,7 +5415,7 @@ function Cn(e, t, n) {
5415
5415
  case k.ENUM:
5416
5416
  return Jl(e, t, n);
5417
5417
  case k.REF: {
5418
- const i = Cr(e, t);
5418
+ const i = $r(e, t);
5419
5419
  return ((s = e.container.token(t).token) == null ? void 0 : s.kind) === f.COLON && ht(e.container.token(t).token, t) ? ft(i) : i;
5420
5420
  }
5421
5421
  case k.TABLEGROUP:
@@ -5424,7 +5424,7 @@ function Cn(e, t, n) {
5424
5424
  return C();
5425
5425
  }
5426
5426
  }
5427
- function $n() {
5427
+ function jn() {
5428
5428
  return {
5429
5429
  suggestions: ["Table", "TableGroup", "Enum", "Project", "Ref", "TablePartial"].map((e) => ({
5430
5430
  label: e,
@@ -5485,7 +5485,7 @@ function ec(e, t, n) {
5485
5485
  }))
5486
5486
  };
5487
5487
  }
5488
- function Cr(e, t) {
5488
+ function $r(e, t) {
5489
5489
  return tt(e, t, e.container.element(t), [
5490
5490
  m.Schema,
5491
5491
  m.Table,
@@ -5520,7 +5520,7 @@ function tc(e) {
5520
5520
  };
5521
5521
  }
5522
5522
  function nc(e, t) {
5523
- return $r(e, t);
5523
+ return jr(e, t);
5524
5524
  }
5525
5525
  function rc(e, t) {
5526
5526
  return {
@@ -5597,9 +5597,9 @@ function rc(e, t) {
5597
5597
  ]
5598
5598
  };
5599
5599
  }
5600
- function $r(e, t) {
5600
+ function jr(e, t) {
5601
5601
  const n = e.container.element(t), r = n == null ? void 0 : n.parent;
5602
- if (!((r == null ? void 0 : r.symbol) instanceof Ir))
5602
+ if (!((r == null ? void 0 : r.symbol) instanceof gr))
5603
5603
  return C();
5604
5604
  const { symbolTable: s } = r.symbol;
5605
5605
  return Lt({
@@ -5623,7 +5623,7 @@ function en(e, t) {
5623
5623
  const n = [t.callee, ...t.args], r = n.findIndex((s) => e <= s.end);
5624
5624
  return r === -1 ? n.length : r;
5625
5625
  }
5626
- class jr {
5626
+ class Xr {
5627
5627
  constructor(t) {
5628
5628
  this.compiler = t;
5629
5629
  }
@@ -5656,7 +5656,7 @@ class jr {
5656
5656
  return [];
5657
5657
  }
5658
5658
  }
5659
- class Xr {
5659
+ class Wr {
5660
5660
  constructor(t) {
5661
5661
  this.compiler = t;
5662
5662
  }
@@ -5689,9 +5689,9 @@ const ic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5689
5689
  __proto__: null,
5690
5690
  CompletionItemInsertTextRule: U,
5691
5691
  CompletionItemKind: S,
5692
- DBMLCompletionItemProvider: Gr,
5693
- DBMLDefinitionProvider: jr,
5694
- DBMLReferencesProvider: Xr
5692
+ DBMLCompletionItemProvider: Vr,
5693
+ DBMLDefinitionProvider: Xr,
5694
+ DBMLReferencesProvider: Wr
5695
5695
  }, Symbol.toStringTag, { value: "Module" }));
5696
5696
  var k = /* @__PURE__ */ ((e) => (e[e.TABLE = 0] = "TABLE", e[e.ENUM = 1] = "ENUM", e[e.TABLEGROUP = 2] = "TABLEGROUP", e[e.INDEXES = 3] = "INDEXES", e[e.NOTE = 4] = "NOTE", e[e.REF = 5] = "REF", e[e.PROJECT = 6] = "PROJECT", e[e.CUSTOM = 7] = "CUSTOM", e[e.TOPLEVEL = 8] = "TOPLEVEL", e[e.TABLEPARTIAL = 9] = "TABLEPARTIAL", e))(k || {});
5697
5697
  class ac {
@@ -5702,7 +5702,7 @@ class ac {
5702
5702
  ).fill(null), this.nodeIdGenerator = new $o(), this.symbolIdGenerator = new zo(), this.token = {
5703
5703
  invalidStream: this.createQuery(
5704
5704
  6,
5705
- () => this.parse.tokens().filter(_r)
5705
+ () => this.parse.tokens().filter(Ar)
5706
5706
  ),
5707
5707
  // Valid + Invalid tokens (which are guarenteed to be non-trivials) are included in the stream
5708
5708
  flatStream: this.createQuery(
@@ -5889,14 +5889,24 @@ class ac {
5889
5889
  }
5890
5890
  initMonacoServices() {
5891
5891
  return {
5892
- definitionProvider: new jr(this),
5893
- referenceProvider: new Xr(this),
5894
- autocompletionProvider: new Gr(this)
5892
+ definitionProvider: new Xr(this),
5893
+ referenceProvider: new Wr(this),
5894
+ autocompletionProvider: new Vr(this)
5895
5895
  };
5896
5896
  }
5897
5897
  }
5898
5898
  export {
5899
+ c as CompileError,
5900
+ l as CompileErrorCode,
5899
5901
  ac as Compiler,
5902
+ P as ElementDeclarationNode,
5903
+ _ as ElementKind,
5904
+ te as ProgramNode,
5905
+ k as ScopeKind,
5906
+ D as SyntaxNode,
5907
+ Pe as SyntaxNodeKind,
5908
+ Z as SyntaxToken,
5909
+ f as SyntaxTokenKind,
5900
5910
  sc as serialize,
5901
5911
  ic as services
5902
5912
  };