@shopify/create-app
Version:
A CLI tool to create a new Shopify app.
1,568 lines (1,567 loc) • 1.06 MB
JavaScript
import {
__esm,
init_cjs_shims
} from "./chunk-PKR7KJ6P.js";
// ../../node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/plugins/typescript.mjs
function e_(e) {
return e !== void 0 ? e.length : 0;
}
function jn(e, t) {
if (e !== void 0) for (let a = 0; a < e.length; a++) {
let _ = t(e[a], a);
if (_) return _;
}
}
function sy(e, t) {
if (e !== void 0) for (let a = 0; a < e.length; a++) {
let _ = t(e[a], a);
if (_ !== void 0) return _;
}
}
function yd(e, t, a) {
let _ = [];
q.assertEqual(e.length, t.length);
for (let f = 0; f < e.length; f++) _.push(a(e[f], t[f], f));
return _;
}
function Gp(e, t) {
if (e !== void 0) {
for (let a = 0; a < e.length; a++) if (!t(e[a], a)) return !1;
}
return !0;
}
function bm(e, t, a) {
if (e !== void 0) for (let _ = a ?? 0; _ < e.length; _++) {
let f = e[_];
if (t(f, _)) return f;
}
}
function gp(e, t, a) {
if (e === void 0) return -1;
for (let _ = a ?? 0; _ < e.length; _++) if (t(e[_], _)) return _;
return -1;
}
function _y(e, t, a = Xp) {
if (e !== void 0) {
for (let _ = 0; _ < e.length; _++) if (a(e[_], t)) return !0;
}
return !1;
}
function Hr(e, t) {
if (e !== void 0) {
let a = e.length, _ = 0;
for (; _ < a && t(e[_]); ) _++;
if (_ < a) {
let f = e.slice(0, _);
for (_++; _ < a; ) {
let h = e[_];
t(h) && f.push(h), _++;
}
return f;
}
}
return e;
}
function Pp(e, t) {
let a;
if (e !== void 0) {
a = [];
for (let _ = 0; _ < e.length; _++) a.push(t(e[_], _));
}
return a;
}
function vm(e) {
let t = [];
for (let a = 0; a < e.length; a++) {
let _ = e[a];
_ && ($r(_) ? En(t, _) : t.push(_));
}
return t;
}
function Tm(e, t) {
let a;
if (e !== void 0) for (let _ = 0; _ < e.length; _++) {
let f = t(e[_], _);
f && ($r(f) ? a = En(a, f) : a = wn(a, f));
}
return a ?? vt;
}
function oy(e, t) {
let a;
if (e !== void 0) for (let _ = 0; _ < e.length; _++) {
let f = e[_], h = t(f, _);
(a || f !== h || $r(h)) && (a || (a = e.slice(0, _)), $r(h) ? En(a, h) : a.push(h));
}
return a ?? e;
}
function cy(e, t) {
let a = [];
if (e !== void 0) for (let _ = 0; _ < e.length; _++) {
let f = t(e[_], _);
f !== void 0 && a.push(f);
}
return a;
}
function Zt(e, t) {
if (e !== void 0) if (t !== void 0) {
for (let a = 0; a < e.length; a++) if (t(e[a])) return !0;
} else return e.length > 0;
return !1;
}
function Yp(e, t) {
return t === void 0 || t.length === 0 ? e : e === void 0 || e.length === 0 ? t : [...e, ...t];
}
function ly(e, t, a = Xp) {
if (e === void 0 || t === void 0) return e === t;
if (e.length !== t.length) return !1;
for (let _ = 0; _ < e.length; _++) if (!a(e[_], t[_], _)) return !1;
return !0;
}
function wn(e, t) {
return t === void 0 ? e : e === void 0 ? [t] : (e.push(t), e);
}
function Np(e, t) {
return t < 0 ? e.length + t : t;
}
function En(e, t, a, _) {
if (t === void 0 || t.length === 0) return e;
if (e === void 0) return t.slice(a, _);
a = a === void 0 ? 0 : Np(t, a), _ = _ === void 0 ? t.length : Np(t, _);
for (let f = a; f < _ && f < t.length; f++) t[f] !== void 0 && e.push(t[f]);
return e;
}
function uy(e, t, a) {
return _y(e, t, a) ? !1 : (e.push(t), !0);
}
function py(e, t, a) {
return e !== void 0 ? (uy(e, t, a), e) : [t];
}
function fy(e, t) {
return e.length === 0 ? vt : e.slice().sort(t);
}
function Hp(e) {
return e === void 0 || e.length === 0 ? void 0 : e[0];
}
function Ba(e) {
return e === void 0 || e.length === 0 ? void 0 : e[e.length - 1];
}
function dy(e) {
return q.assert(e.length !== 0), e[e.length - 1];
}
function my(e) {
return e !== void 0 && e.length === 1 ? e[0] : void 0;
}
function hy(e, t, a, _, f) {
return yy(e, a(t), a, _, f);
}
function yy(e, t, a, _, f) {
if (!Zt(e)) return -1;
let h = f ?? 0, T = e.length - 1;
for (; h <= T; ) {
let k = h + (T - h >> 1), c = a(e[k], k);
switch (_(c, t)) {
case -1:
h = k + 1;
break;
case 0:
return k;
case 1:
T = k - 1;
break;
}
}
return ~h;
}
function gy(e, t, a, _, f) {
if (e && e.length > 0) {
let h = e.length;
if (h > 0) {
let T = _ === void 0 || _ < 0 ? 0 : _, k = f === void 0 || T + f > h - 1 ? h - 1 : T + f, c;
for (arguments.length <= 2 ? (c = e[T], T++) : c = a; T <= k; ) c = t(c, e[T], T), T++;
return c;
}
}
return a;
}
function Dr(e, t) {
return xm.call(e, t);
}
function by(e) {
let t = [];
for (let a in e) xm.call(e, a) && t.push(a);
return t;
}
function vy() {
let e = /* @__PURE__ */ new Map();
return e.add = Ty, e.remove = xy, e;
}
function Ty(e, t) {
let a = this.get(e);
return a !== void 0 ? a.push(t) : this.set(e, a = [t]), a;
}
function xy(e, t) {
let a = this.get(e);
a !== void 0 && (Ny(a, t), a.length || this.delete(e));
}
function $r(e) {
return Array.isArray(e);
}
function bp(e) {
return $r(e) ? e : [e];
}
function Sy(e, t) {
return e !== void 0 && t(e) ? e : void 0;
}
function Er(e, t) {
return e !== void 0 && t(e) ? e : q.fail(`Invalid cast. The supplied value ${e} did not pass the test '${q.getFunctionName(t)}'.`);
}
function Va(e) {
}
function wy() {
return !0;
}
function bt(e) {
return e;
}
function gd(e) {
let t;
return () => (e && (t = e(), e = void 0), t);
}
function Kn(e) {
let t = /* @__PURE__ */ new Map();
return (a) => {
let _ = `${typeof a}:${a}`, f = t.get(_);
return f === void 0 && !t.has(_) && (f = e(a), t.set(_, f)), f;
};
}
function Xp(e, t) {
return e === t;
}
function $p(e, t) {
return e === t || e !== void 0 && t !== void 0 && e.toUpperCase() === t.toUpperCase();
}
function ky(e, t) {
return Xp(e, t);
}
function Ey(e, t) {
return e === t ? 0 : e === void 0 ? -1 : t === void 0 ? 1 : e < t ? -1 : 1;
}
function Sm(e, t) {
return Ey(e, t);
}
function Ay(e, t, a) {
for (let _ = 0; _ < e.length; _++) t = Math.max(t, a(e[_]));
return t;
}
function t_(e, t, a) {
let _ = Math.max(2, Math.floor(e.length * 0.34)), f = Math.floor(e.length * 0.4) + 1, h;
for (let T of t) {
let k = a(T);
if (k !== void 0 && Math.abs(k.length - e.length) <= _) {
if (k === e || k.length < 3 && k.toLowerCase() !== e.toLowerCase()) continue;
let c = Cy(e, k, f - 0.1);
if (c === void 0) continue;
q.assert(c < f), f = c, h = T;
}
}
return h;
}
function Cy(e, t, a) {
let _ = new Array(t.length + 1), f = new Array(t.length + 1), h = a + 0.01;
for (let k = 0; k <= t.length; k++) _[k] = k;
for (let k = 1; k <= e.length; k++) {
let c = e.charCodeAt(k - 1), W = Math.ceil(k > a ? k - a : 1), y = Math.floor(t.length > a + k ? a + k : t.length);
f[0] = k;
let G = k;
for (let D = 1; D < W; D++) f[D] = h;
for (let D = W; D <= y; D++) {
let R = e[k - 1].toLowerCase() === t[D - 1].toLowerCase() ? _[D - 1] + 0.1 : _[D - 1] + 2, ue = c === t.charCodeAt(D - 1) ? _[D - 1] : Math.min(_[D] + 1, f[D - 1] + 1, R);
f[D] = ue, G = Math.min(G, ue);
}
for (let D = y + 1; D <= t.length; D++) f[D] = h;
if (G > a) return;
let E = _;
_ = f, f = E;
}
let T = _[t.length];
return T > a ? void 0 : T;
}
function Dy(e, t, a) {
let _ = e.length - t.length;
return _ >= 0 && (a ? $p(e.slice(_), t) : e.indexOf(t, _) === _);
}
function Py(e, t) {
e[t] = e[e.length - 1], e.pop();
}
function Ny(e, t) {
return Iy(e, (a) => a === t);
}
function Iy(e, t) {
for (let a = 0; a < e.length; a++) if (t(e[a])) return Py(e, a), !0;
return !1;
}
function ml(e, t, a) {
return a ? $p(e.slice(0, t.length), t) : e.lastIndexOf(t, 0) === 0;
}
function Ip(e) {
return e === void 0 ? void 0 : [e];
}
function Jy(e) {
return e === 47 || e === 92;
}
function jy(e, t) {
return e.length > t.length && Dy(e, t);
}
function ef(e) {
return e.length > 0 && Jy(e.charCodeAt(e.length - 1));
}
function Td(e) {
return e >= 97 && e <= 122 || e >= 65 && e <= 90;
}
function Ry(e, t) {
let a = e.charCodeAt(t);
if (a === 58) return t + 1;
if (a === 37 && e.charCodeAt(t + 1) === 51) {
let _ = e.charCodeAt(t + 2);
if (_ === 97 || _ === 65) return t + 3;
}
return -1;
}
function Uy(e) {
if (!e) return 0;
let t = e.charCodeAt(0);
if (t === 47 || t === 92) {
if (e.charCodeAt(1) !== t) return 1;
let _ = e.indexOf(t === 47 ? Xr : My, 2);
return _ < 0 ? e.length : _ + 1;
}
if (Td(t) && e.charCodeAt(1) === 58) {
let _ = e.charCodeAt(2);
if (_ === 47 || _ === 92) return 3;
if (e.length === 2) return 2;
}
let a = e.indexOf(vd);
if (a !== -1) {
let _ = a + vd.length, f = e.indexOf(Xr, _);
if (f !== -1) {
let h = e.slice(0, a), T = e.slice(_, f);
if (h === "file" && (T === "" || T === "localhost") && Td(e.charCodeAt(f + 1))) {
let k = Ry(e, f + 2);
if (k !== -1) {
if (e.charCodeAt(k) === 47) return ~(k + 1);
if (k === e.length) return ~k;
}
}
return ~(f + 1);
}
return ~e.length;
}
return 0;
}
function o_(e) {
let t = Uy(e);
return t < 0 ? ~t : t;
}
function Nm(e, t, a) {
if (e = c_(e), o_(e) === e.length) return "";
e = hl(e);
let f = e.slice(Math.max(o_(e), e.lastIndexOf(Xr) + 1)), h = t !== void 0 && a !== void 0 ? Im(f, t, a) : void 0;
return h ? f.slice(0, f.length - h.length) : f;
}
function xd(e, t, a) {
if (ml(t, ".") || (t = "." + t), e.length >= t.length && e.charCodeAt(e.length - t.length) === 46) {
let _ = e.slice(e.length - t.length);
if (a(_, t)) return _;
}
}
function By(e, t, a) {
if (typeof t == "string") return xd(e, t, a) || "";
for (let _ of t) {
let f = xd(e, _, a);
if (f) return f;
}
return "";
}
function Im(e, t, a) {
if (t) return By(hl(e), t, a ? $p : ky);
let _ = Nm(e), f = _.lastIndexOf(".");
return f >= 0 ? _.substring(f) : "";
}
function c_(e) {
return e.includes("\\") ? e.replace(Ly, Xr) : e;
}
function qy(e, ...t) {
e && (e = c_(e));
for (let a of t) a && (a = c_(a), !e || o_(a) !== 0 ? e = a : e = Mm(e) + a);
return e;
}
function Fy(e, t) {
let a = o_(e);
a === 0 && t ? (e = qy(t, e), a = o_(e)) : e = c_(e);
let _ = Om(e);
if (_ !== void 0) return _.length > a ? hl(_) : _;
let f = e.length, h = e.substring(0, a), T, k = a, c = k, W = k, y = a !== 0;
for (; k < f; ) {
c = k;
let G = e.charCodeAt(k);
for (; G === 47 && k + 1 < f; ) k++, G = e.charCodeAt(k);
k > c && (T ?? (T = e.substring(0, c - 1)), c = k);
let E = e.indexOf(Xr, k + 1);
E === -1 && (E = f);
let D = E - c;
if (D === 1 && e.charCodeAt(k) === 46) T ?? (T = e.substring(0, W));
else if (D === 2 && e.charCodeAt(k) === 46 && e.charCodeAt(k + 1) === 46) if (!y) T !== void 0 ? T += T.length === a ? ".." : "/.." : W = k + 2;
else if (T === void 0) W - 2 >= 0 ? T = e.substring(0, Math.max(a, e.lastIndexOf(Xr, W - 2))) : T = e.substring(0, W);
else {
let R = T.lastIndexOf(Xr);
R !== -1 ? T = T.substring(0, Math.max(a, R)) : T = h, T.length === a && (y = a !== 0);
}
else T !== void 0 ? (T.length !== a && (T += Xr), y = !0, T += e.substring(c, E)) : (y = !0, W = E);
k = E + 1;
}
return T ?? (f > a ? hl(e) : e);
}
function zy(e) {
e = c_(e);
let t = Om(e);
return t !== void 0 ? t : (t = Fy(e, ""), t && ef(e) ? Mm(t) : t);
}
function Om(e) {
if (!Sd.test(e)) return e;
let t = e.replace(/\/\.\//g, "/");
if (t.startsWith("./") && (t = t.slice(2)), t !== e && (e = t, !Sd.test(e))) return e;
}
function hl(e) {
return ef(e) ? e.substr(0, e.length - 1) : e;
}
function Mm(e) {
return ef(e) ? e : e + Xr;
}
function r(e, t, a, _, f, h, T) {
return { code: e, category: t, key: a, message: _, reportsUnnecessary: f, elidedInCompatabilityPyramid: h, reportsDeprecated: T };
}
function St(e) {
return e >= 80;
}
function Vy(e) {
return e === 32 || St(e);
}
function yl(e, t) {
if (e < t[0]) return !1;
let a = 0, _ = t.length, f;
for (; a + 1 < _; ) {
if (f = a + (_ - a) / 2, f -= f % 2, t[f] <= e && e <= t[f + 1]) return !0;
e < t[f] ? _ = f : a = f + 2;
}
return !1;
}
function eg(e, t) {
return t >= 2 ? yl(e, Xy) : yl(e, Yy);
}
function tg(e, t) {
return t >= 2 ? yl(e, $y) : yl(e, Hy);
}
function jm(e) {
let t = [];
return e.forEach((a, _) => {
t[a] = _;
}), t;
}
function nt(e) {
return ng[e];
}
function Rm(e) {
return Lm.get(e);
}
function wd(e) {
return Jm.get(e);
}
function Um(e) {
let t = [], a = 0, _ = 0;
for (; a < e.length; ) {
let f = e.charCodeAt(a);
switch (a++, f) {
case 13:
e.charCodeAt(a) === 10 && a++;
case 10:
t.push(_), _ = a;
break;
default:
f > 127 && kn(f) && (t.push(_), _ = a);
break;
}
}
return t.push(_), t;
}
function rg(e, t, a, _, f) {
(t < 0 || t >= e.length) && (f ? t = t < 0 ? 0 : t >= e.length ? e.length - 1 : t : q.fail(`Bad line number. Line: ${t}, lineStarts.length: ${e.length} , line map is correct? ${_ !== void 0 ? ly(e, Um(_)) : "unknown"}`));
let h = e[t] + a;
return f ? h > e[t + 1] ? e[t + 1] : typeof _ == "string" && h > _.length ? _.length : h : (t < e.length - 1 ? q.assert(h < e[t + 1]) : _ !== void 0 && q.assert(h <= _.length), h);
}
function Mp(e) {
return e.lineMap || (e.lineMap = Um(e.text));
}
function ig(e, t) {
let a = ag(e, t);
return { line: a, character: t - e[a] };
}
function ag(e, t, a) {
let _ = hy(e, t, bt, Sm, a);
return _ < 0 && (_ = ~_ - 1, q.assert(_ !== -1, "position cannot precede the beginning of the file")), _;
}
function Bm(e, t) {
return ig(Mp(e), t);
}
function qa(e) {
return n_(e) || kn(e);
}
function n_(e) {
return e === 32 || e === 9 || e === 11 || e === 12 || e === 160 || e === 133 || e === 5760 || e >= 8192 && e <= 8203 || e === 8239 || e === 8287 || e === 12288 || e === 65279;
}
function kn(e) {
return e === 10 || e === 13 || e === 8232 || e === 8233;
}
function fi(e) {
return e >= 48 && e <= 57;
}
function vp(e) {
return fi(e) || e >= 65 && e <= 70 || e >= 97 && e <= 102;
}
function nf(e) {
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
}
function qm(e) {
return nf(e) || fi(e) || e === 95;
}
function Tp(e) {
return e >= 48 && e <= 55;
}
function Cr(e, t, a, _, f) {
if (d_(t)) return t;
let h = !1;
for (; ; ) {
let T = e.charCodeAt(t);
switch (T) {
case 13:
e.charCodeAt(t + 1) === 10 && t++;
case 10:
if (t++, a) return t;
h = !!f;
continue;
case 9:
case 11:
case 12:
case 32:
t++;
continue;
case 47:
if (_) break;
if (e.charCodeAt(t + 1) === 47) {
for (t += 2; t < e.length && !kn(e.charCodeAt(t)); ) t++;
h = !1;
continue;
}
if (e.charCodeAt(t + 1) === 42) {
for (t += 2; t < e.length; ) {
if (e.charCodeAt(t) === 42 && e.charCodeAt(t + 1) === 47) {
t += 2;
break;
}
t++;
}
h = !1;
continue;
}
break;
case 60:
case 124:
case 61:
case 62:
if ($i(e, t)) {
t = Ma(e, t), h = !1;
continue;
}
break;
case 35:
if (t === 0 && Fm(e, t)) {
t = zm(e, t), h = !1;
continue;
}
break;
case 42:
if (h) {
t++, h = !1;
continue;
}
break;
default:
if (T > 127 && qa(T)) {
t++;
continue;
}
break;
}
return t;
}
}
function $i(e, t) {
if (q.assert(t >= 0), t === 0 || kn(e.charCodeAt(t - 1))) {
let a = e.charCodeAt(t);
if (t + ul < e.length) {
for (let _ = 0; _ < ul; _++) if (e.charCodeAt(t + _) !== a) return !1;
return a === 61 || e.charCodeAt(t + ul) === 32;
}
}
return !1;
}
function Ma(e, t, a) {
a && a(A.Merge_conflict_marker_encountered, t, ul);
let _ = e.charCodeAt(t), f = e.length;
if (_ === 60 || _ === 62) for (; t < f && !kn(e.charCodeAt(t)); ) t++;
else for (q.assert(_ === 124 || _ === 61); t < f; ) {
let h = e.charCodeAt(t);
if ((h === 61 || h === 62) && h !== _ && $i(e, t)) break;
t++;
}
return t;
}
function Fm(e, t) {
return q.assert(t === 0), rf.test(e);
}
function zm(e, t) {
let a = rf.exec(e)[0];
return t = t + a.length, t;
}
function kl(e, t, a, _, f, h, T) {
let k, c, W, y, G = !1, E = _, D = T;
if (a === 0) {
E = !0;
let R = af(t);
R && (a = R.length);
}
e: for (; a >= 0 && a < t.length; ) {
let R = t.charCodeAt(a);
switch (R) {
case 13:
t.charCodeAt(a + 1) === 10 && a++;
case 10:
if (a++, _) break e;
E = !0, G && (y = !0);
continue;
case 9:
case 11:
case 12:
case 32:
a++;
continue;
case 47:
let ue = t.charCodeAt(a + 1), be = !1;
if (ue === 47 || ue === 42) {
let he = ue === 47 ? 2 : 3, de = a;
if (a += 2, ue === 47) for (; a < t.length; ) {
if (kn(t.charCodeAt(a))) {
be = !0;
break;
}
a++;
}
else for (; a < t.length; ) {
if (t.charCodeAt(a) === 42 && t.charCodeAt(a + 1) === 47) {
a += 2;
break;
}
a++;
}
if (E) {
if (G && (D = f(k, c, W, y, h, D), !e && D)) return D;
k = de, c = a, W = he, y = be, G = !0;
}
continue;
}
break e;
default:
if (R > 127 && qa(R)) {
G && kn(R) && (y = !0), a++;
continue;
}
break e;
}
}
return G && (D = f(k, c, W, y, h, D)), D;
}
function Vm(e, t, a, _) {
return kl(!1, e, t, !1, a, _);
}
function Wm(e, t, a, _) {
return kl(!1, e, t, !0, a, _);
}
function sg(e, t, a, _, f) {
return kl(!0, e, t, !1, a, _, f);
}
function _g(e, t, a, _, f) {
return kl(!0, e, t, !0, a, _, f);
}
function Gm(e, t, a, _, f, h = []) {
return h.push({ kind: a, pos: e, end: t, hasTrailingNewLine: _ }), h;
}
function Lp(e, t) {
return sg(e, t, Gm, void 0, void 0);
}
function og(e, t) {
return _g(e, t, Gm, void 0, void 0);
}
function af(e) {
let t = rf.exec(e);
if (t) return t[0];
}
function Zn(e, t) {
return nf(e) || e === 36 || e === 95 || e > 127 && eg(e, t);
}
function Ar(e, t, a) {
return qm(e) || e === 36 || (a === 1 ? e === 45 || e === 58 : !1) || e > 127 && tg(e, t);
}
function cg(e, t, a) {
let _ = Qi(e, 0);
if (!Zn(_, t)) return !1;
for (let f = Vt(_); f < e.length; f += Vt(_)) if (!Ar(_ = Qi(e, f), t, a)) return !1;
return !0;
}
function sf(e, t, a = 0, _, f, h, T) {
var k = _, c, W, y, G, E, D, R, ue, be = 0, he = 0, de = 0;
Ct(k, h, T);
var O = { getTokenFullStart: () => y, getStartPos: () => y, getTokenEnd: () => c, getTextPos: () => c, getToken: () => E, getTokenStart: () => G, getTokenPos: () => G, getTokenText: () => k.substring(G, c), getTokenValue: () => D, hasUnicodeEscape: () => (R & 1024) !== 0, hasExtendedUnicodeEscape: () => (R & 8) !== 0, hasPrecedingLineBreak: () => (R & 1) !== 0, hasPrecedingJSDocComment: () => (R & 2) !== 0, hasPrecedingJSDocLeadingAsterisks: () => (R & 32768) !== 0, isIdentifier: () => E === 80 || E > 118, isReservedWord: () => E >= 83 && E <= 118, isUnterminated: () => (R & 4) !== 0, getCommentDirectives: () => ue, getNumericLiteralFlags: () => R & 25584, getTokenFlags: () => R, reScanGreaterToken: ct, reScanAsteriskEqualsToken: ar, reScanSlashToken: dt, reScanTemplateToken: qt, reScanTemplateHeadOrNoSubstitutionTemplate: tn, scanJsxIdentifier: Or, scanJsxAttributeValue: Vn, reScanJsxAttributeValue: Ce, reScanJsxToken: sr, reScanLessThanToken: mr, reScanHashToken: hr, reScanQuestionToken: Fn, reScanInvalidIdentifier: Bt, scanJsxToken: zn, scanJsDocToken: L, scanJSDocCommentTextToken: yr, scan: ot, getText: Qe, clearCommentDirectives: st, setText: Ct, setScriptTarget: lt, setLanguageVariant: Mr, setScriptKind: gr, setJSDocParsingMode: Nn, setOnError: Tt, resetTokenState: Wn, setTextPos: Wn, setSkipJsDocLeadingAsterisks: wi, tryScan: He, lookAhead: Te, scanRange: fe };
return q.isDebugging && Object.defineProperty(O, "__debugShowCurrentPositionInText", { get: () => {
let U = O.getText();
return U.slice(0, O.getTokenFullStart()) + "\u2551" + U.slice(O.getTokenFullStart());
} }), O;
function ae(U) {
return Qi(k, U);
}
function Oe(U) {
return U >= 0 && U < W ? ae(U) : -1;
}
function V(U) {
return k.charCodeAt(U);
}
function oe(U) {
return U >= 0 && U < W ? V(U) : -1;
}
function Y(U, K = c, Z, xe) {
if (f) {
let Se = c;
c = K, f(U, Z || 0, xe), c = Se;
}
}
function ft() {
let U = c, K = !1, Z = !1, xe = "";
for (; ; ) {
let Se = V(c);
if (Se === 95) {
R |= 512, K ? (K = !1, Z = !0, xe += k.substring(U, c)) : (R |= 16384, Y(Z ? A.Multiple_consecutive_numeric_separators_are_not_permitted : A.Numeric_separators_are_not_allowed_here, c, 1)), c++, U = c;
continue;
}
if (fi(Se)) {
K = !0, Z = !1, c++;
continue;
}
break;
}
return V(c - 1) === 95 && (R |= 16384, Y(A.Numeric_separators_are_not_allowed_here, c - 1, 1)), xe + k.substring(U, c);
}
function nr() {
let U = c, K;
if (V(c) === 48) if (c++, V(c) === 95) R |= 16896, Y(A.Numeric_separators_are_not_allowed_here, c, 1), c--, K = ft();
else if (!rr()) R |= 8192, K = "" + +D;
else if (!D) K = "0";
else {
D = "" + parseInt(D, 8), R |= 32;
let me = E === 41, Ve = (me ? "-" : "") + "0o" + (+D).toString(8);
return me && U--, Y(A.Octal_literals_are_not_allowed_Use_the_syntax_0, U, c - U, Ve), 9;
}
else K = ft();
let Z, xe;
V(c) === 46 && (c++, Z = ft());
let Se = c;
if (V(c) === 69 || V(c) === 101) {
c++, R |= 16, (V(c) === 43 || V(c) === 45) && c++;
let me = c, Ve = ft();
Ve ? (xe = k.substring(Se, me) + Ve, Se = c) : Y(A.Digit_expected);
}
let we;
if (R & 512 ? (we = K, Z && (we += "." + Z), xe && (we += xe)) : we = k.substring(U, Se), R & 8192) return Y(A.Decimals_with_leading_zeros_are_not_allowed, U, Se - U), D = "" + +we, 9;
if (Z !== void 0 || R & 16) return mn(U, Z === void 0 && !!(R & 16)), D = "" + +we, 9;
{
D = we;
let me = $t();
return mn(U), me;
}
}
function mn(U, K) {
if (!Zn(ae(c), e)) return;
let Z = c, { length: xe } = ht();
xe === 1 && k[Z] === "n" ? Y(K ? A.A_bigint_literal_cannot_use_exponential_notation : A.A_bigint_literal_must_be_an_integer, U, Z - U + 1) : (Y(A.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, Z, xe), c = Z);
}
function rr() {
let U = c, K = !0;
for (; fi(oe(c)); ) Tp(V(c)) || (K = !1), c++;
return D = k.substring(U, c), K;
}
function hn(U, K) {
let Z = We(U, !1, K);
return Z ? parseInt(Z, 16) : -1;
}
function Dn(U, K) {
return We(U, !0, K);
}
function We(U, K, Z) {
let xe = [], Se = !1, we = !1;
for (; xe.length < U || K; ) {
let me = V(c);
if (Z && me === 95) {
R |= 512, Se ? (Se = !1, we = !0) : Y(we ? A.Multiple_consecutive_numeric_separators_are_not_permitted : A.Numeric_separators_are_not_allowed_here, c, 1), c++;
continue;
}
if (Se = Z, me >= 65 && me <= 70) me += 32;
else if (!(me >= 48 && me <= 57 || me >= 97 && me <= 102)) break;
xe.push(me), c++, we = !1;
}
return xe.length < U && (xe = []), V(c - 1) === 95 && Y(A.Numeric_separators_are_not_allowed_here, c - 1, 1), String.fromCharCode(...xe);
}
function ir(U = !1) {
let K = V(c);
c++;
let Z = "", xe = c;
for (; ; ) {
if (c >= W) {
Z += k.substring(xe, c), R |= 4, Y(A.Unterminated_string_literal);
break;
}
let Se = V(c);
if (Se === K) {
Z += k.substring(xe, c), c++;
break;
}
if (Se === 92 && !U) {
Z += k.substring(xe, c), Z += Ot(3), xe = c;
continue;
}
if ((Se === 10 || Se === 13) && !U) {
Z += k.substring(xe, c), R |= 4, Y(A.Unterminated_string_literal);
break;
}
c++;
}
return Z;
}
function Ir(U) {
let K = V(c) === 96;
c++;
let Z = c, xe = "", Se;
for (; ; ) {
if (c >= W) {
xe += k.substring(Z, c), R |= 4, Y(A.Unterminated_template_literal), Se = K ? 15 : 18;
break;
}
let we = V(c);
if (we === 96) {
xe += k.substring(Z, c), c++, Se = K ? 15 : 18;
break;
}
if (we === 36 && c + 1 < W && V(c + 1) === 123) {
xe += k.substring(Z, c), c += 2, Se = K ? 16 : 17;
break;
}
if (we === 92) {
xe += k.substring(Z, c), xe += Ot(1 | (U ? 2 : 0)), Z = c;
continue;
}
if (we === 13) {
xe += k.substring(Z, c), c++, c < W && V(c) === 10 && c++, xe += `
`, Z = c;
continue;
}
c++;
}
return q.assert(Se !== void 0), D = xe, Se;
}
function Ot(U) {
let K = c;
if (c++, c >= W) return Y(A.Unexpected_end_of_text), "";
let Z = V(c);
switch (c++, Z) {
case 48:
if (c >= W || !fi(V(c))) return "\0";
case 49:
case 50:
case 51:
c < W && Tp(V(c)) && c++;
case 52:
case 53:
case 54:
case 55:
if (c < W && Tp(V(c)) && c++, R |= 2048, U & 6) {
let we = parseInt(k.substring(K + 1, c), 8);
return U & 4 && !(U & 32) && Z !== 48 ? Y(A.Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended_as_an_escape_sequence_use_the_syntax_0_instead, K, c - K, "\\x" + we.toString(16).padStart(2, "0")) : Y(A.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, K, c - K, "\\x" + we.toString(16).padStart(2, "0")), String.fromCharCode(we);
}
return k.substring(K, c);
case 56:
case 57:
return R |= 2048, U & 6 ? (U & 4 && !(U & 32) ? Y(A.Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class, K, c - K) : Y(A.Escape_sequence_0_is_not_allowed, K, c - K, k.substring(K, c)), String.fromCharCode(Z)) : k.substring(K, c);
case 98:
return "\b";
case 116:
return " ";
case 110:
return `
`;
case 118:
return "\v";
case 102:
return "\f";
case 114:
return "\r";
case 39:
return "'";
case 34:
return '"';
case 117:
if (c < W && V(c) === 123) {
c -= 2;
let we = Bn(!!(U & 6));
return U & 17 || (R |= 2048, U & 6 && Y(A.Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, K, c - K)), we;
}
for (; c < K + 6; c++) if (!(c < W && vp(V(c)))) return R |= 2048, U & 6 && Y(A.Hexadecimal_digit_expected), k.substring(K, c);
R |= 1024;
let xe = parseInt(k.substring(K + 2, c), 16), Se = String.fromCharCode(xe);
if (U & 16 && xe >= 55296 && xe <= 56319 && c + 6 < W && k.substring(c, c + 2) === "\\u" && V(c + 2) !== 123) {
let we = c, me = c + 2;
for (; me < we + 6; me++) if (!vp(V(me))) return Se;
let Ve = parseInt(k.substring(we + 2, me), 16);
if (Ve >= 56320 && Ve <= 57343) return c = me, Se + String.fromCharCode(Ve);
}
return Se;
case 120:
for (; c < K + 4; c++) if (!(c < W && vp(V(c)))) return R |= 2048, U & 6 && Y(A.Hexadecimal_digit_expected), k.substring(K, c);
return R |= 4096, String.fromCharCode(parseInt(k.substring(K + 2, c), 16));
case 13:
c < W && V(c) === 10 && c++;
case 10:
case 8232:
case 8233:
return "";
default:
return (U & 16 || U & 4 && !(U & 8) && Ar(Z, e)) && Y(A.This_character_cannot_be_escaped_in_a_regular_expression, c - 2, 2), String.fromCharCode(Z);
}
}
function Bn(U) {
let K = c;
c += 3;
let Z = c, xe = Dn(1, !1), Se = xe ? parseInt(xe, 16) : -1, we = !1;
return Se < 0 ? (U && Y(A.Hexadecimal_digit_expected), we = !0) : Se > 1114111 && (U && Y(A.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive, Z, c - Z), we = !0), c >= W ? (U && Y(A.Unexpected_end_of_text), we = !0) : V(c) === 125 ? c++ : (U && Y(A.Unterminated_Unicode_escape_sequence), we = !0), we ? (R |= 2048, k.substring(K, c)) : (R |= 8, kd(Se));
}
function Pn() {
if (c + 5 < W && V(c + 1) === 117) {
let U = c;
c += 2;
let K = hn(4, !1);
return c = U, K;
}
return -1;
}
function Mt() {
if (ae(c + 1) === 117 && ae(c + 2) === 123) {
let U = c;
c += 3;
let K = Dn(1, !1), Z = K ? parseInt(K, 16) : -1;
return c = U, Z;
}
return -1;
}
function ht() {
let U = "", K = c;
for (; c < W; ) {
let Z = ae(c);
if (Ar(Z, e)) c += Vt(Z);
else if (Z === 92) {
if (Z = Mt(), Z >= 0 && Ar(Z, e)) {
U += Bn(!0), K = c;
continue;
}
if (Z = Pn(), !(Z >= 0 && Ar(Z, e))) break;
R |= 1024, U += k.substring(K, c), U += kd(Z), c += 6, K = c;
} else break;
}
return U += k.substring(K, c), U;
}
function $e() {
let U = D.length;
if (U >= 2 && U <= 12) {
let K = D.charCodeAt(0);
if (K >= 97 && K <= 122) {
let Z = Wy.get(D);
if (Z !== void 0) return E = Z;
}
}
return E = 80;
}
function qn(U) {
let K = "", Z = !1, xe = !1;
for (; ; ) {
let Se = V(c);
if (Se === 95) {
R |= 512, Z ? (Z = !1, xe = !0) : Y(xe ? A.Multiple_consecutive_numeric_separators_are_not_permitted : A.Numeric_separators_are_not_allowed_here, c, 1), c++;
continue;
}
if (Z = !0, !fi(Se) || Se - 48 >= U) break;
K += k[c], c++, xe = !1;
}
return V(c - 1) === 95 && Y(A.Numeric_separators_are_not_allowed_here, c - 1, 1), K;
}
function $t() {
return V(c) === 110 ? (D += "n", R & 384 && (D = vb(D) + "n"), c++, 10) : (D = "" + (R & 128 ? parseInt(D.slice(2), 2) : R & 256 ? parseInt(D.slice(2), 8) : +D), 9);
}
function ot() {
for (y = c, R = 0; ; ) {
if (G = c, c >= W) return E = 1;
let U = ae(c);
if (c === 0 && U === 35 && Fm(k, c)) {
if (c = zm(k, c), t) continue;
return E = 6;
}
switch (U) {
case 10:
case 13:
if (R |= 1, t) {
c++;
continue;
} else return U === 13 && c + 1 < W && V(c + 1) === 10 ? c += 2 : c++, E = 4;
case 9:
case 11:
case 12:
case 32:
case 160:
case 5760:
case 8192:
case 8193:
case 8194:
case 8195:
case 8196:
case 8197:
case 8198:
case 8199:
case 8200:
case 8201:
case 8202:
case 8203:
case 8239:
case 8287:
case 12288:
case 65279:
if (t) {
c++;
continue;
} else {
for (; c < W && n_(V(c)); ) c++;
return E = 5;
}
case 33:
return V(c + 1) === 61 ? V(c + 2) === 61 ? (c += 3, E = 38) : (c += 2, E = 36) : (c++, E = 54);
case 34:
case 39:
return D = ir(), E = 11;
case 96:
return E = Ir(!1);
case 37:
return V(c + 1) === 61 ? (c += 2, E = 70) : (c++, E = 45);
case 38:
return V(c + 1) === 38 ? V(c + 2) === 61 ? (c += 3, E = 77) : (c += 2, E = 56) : V(c + 1) === 61 ? (c += 2, E = 74) : (c++, E = 51);
case 40:
return c++, E = 21;
case 41:
return c++, E = 22;
case 42:
if (V(c + 1) === 61) return c += 2, E = 67;
if (V(c + 1) === 42) return V(c + 2) === 61 ? (c += 3, E = 68) : (c += 2, E = 43);
if (c++, be && (R & 32768) === 0 && R & 1) {
R |= 32768;
continue;
}
return E = 42;
case 43:
return V(c + 1) === 43 ? (c += 2, E = 46) : V(c + 1) === 61 ? (c += 2, E = 65) : (c++, E = 40);
case 44:
return c++, E = 28;
case 45:
return V(c + 1) === 45 ? (c += 2, E = 47) : V(c + 1) === 61 ? (c += 2, E = 66) : (c++, E = 41);
case 46:
return fi(V(c + 1)) ? (nr(), E = 9) : V(c + 1) === 46 && V(c + 2) === 46 ? (c += 3, E = 26) : (c++, E = 25);
case 47:
if (V(c + 1) === 47) {
for (c += 2; c < W && !kn(V(c)); ) c++;
if (ue = _n(ue, k.slice(G, c), Qy, G), t) continue;
return E = 2;
}
if (V(c + 1) === 42) {
c += 2;
let me = V(c) === 42 && V(c + 1) !== 47, Ve = !1, Ze = G;
for (; c < W; ) {
let Ye = V(c);
if (Ye === 42 && V(c + 1) === 47) {
c += 2, Ve = !0;
break;
}
c++, kn(Ye) && (Ze = c, R |= 1);
}
if (me && at() && (R |= 2), ue = _n(ue, k.slice(Ze, c), Ky, Ze), Ve || Y(A.Asterisk_Slash_expected), t) continue;
return Ve || (R |= 4), E = 3;
}
return V(c + 1) === 61 ? (c += 2, E = 69) : (c++, E = 44);
case 48:
if (c + 2 < W && (V(c + 1) === 88 || V(c + 1) === 120)) return c += 2, D = Dn(1, !0), D || (Y(A.Hexadecimal_digit_expected), D = "0"), D = "0x" + D, R |= 64, E = $t();
if (c + 2 < W && (V(c + 1) === 66 || V(c + 1) === 98)) return c += 2, D = qn(2), D || (Y(A.Binary_digit_expected), D = "0"), D = "0b" + D, R |= 128, E = $t();
if (c + 2 < W && (V(c + 1) === 79 || V(c + 1) === 111)) return c += 2, D = qn(8), D || (Y(A.Octal_digit_expected), D = "0"), D = "0o" + D, R |= 256, E = $t();
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
return E = nr();
case 58:
return c++, E = 59;
case 59:
return c++, E = 27;
case 60:
if ($i(k, c)) {
if (c = Ma(k, c, Y), t) continue;
return E = 7;
}
return V(c + 1) === 60 ? V(c + 2) === 61 ? (c += 3, E = 71) : (c += 2, E = 48) : V(c + 1) === 61 ? (c += 2, E = 33) : a === 1 && V(c + 1) === 47 && V(c + 2) !== 42 ? (c += 2, E = 31) : (c++, E = 30);
case 61:
if ($i(k, c)) {
if (c = Ma(k, c, Y), t) continue;
return E = 7;
}
return V(c + 1) === 61 ? V(c + 2) === 61 ? (c += 3, E = 37) : (c += 2, E = 35) : V(c + 1) === 62 ? (c += 2, E = 39) : (c++, E = 64);
case 62:
if ($i(k, c)) {
if (c = Ma(k, c, Y), t) continue;
return E = 7;
}
return c++, E = 32;
case 63:
return V(c + 1) === 46 && !fi(V(c + 2)) ? (c += 2, E = 29) : V(c + 1) === 63 ? V(c + 2) === 61 ? (c += 3, E = 78) : (c += 2, E = 61) : (c++, E = 58);
case 91:
return c++, E = 23;
case 93:
return c++, E = 24;
case 94:
return V(c + 1) === 61 ? (c += 2, E = 79) : (c++, E = 53);
case 123:
return c++, E = 19;
case 124:
if ($i(k, c)) {
if (c = Ma(k, c, Y), t) continue;
return E = 7;
}
return V(c + 1) === 124 ? V(c + 2) === 61 ? (c += 3, E = 76) : (c += 2, E = 57) : V(c + 1) === 61 ? (c += 2, E = 75) : (c++, E = 52);
case 125:
return c++, E = 20;
case 126:
return c++, E = 55;
case 64:
return c++, E = 60;
case 92:
let K = Mt();
if (K >= 0 && Zn(K, e)) return D = Bn(!0) + ht(), E = $e();
let Z = Pn();
return Z >= 0 && Zn(Z, e) ? (c += 6, R |= 1024, D = String.fromCharCode(Z) + ht(), E = $e()) : (Y(A.Invalid_character), c++, E = 0);
case 35:
if (c !== 0 && k[c + 1] === "!") return Y(A.can_only_be_used_at_the_start_of_a_file, c, 2), c++, E = 0;
let xe = ae(c + 1);
if (xe === 92) {
c++;
let me = Mt();
if (me >= 0 && Zn(me, e)) return D = "#" + Bn(!0) + ht(), E = 81;
let Ve = Pn();
if (Ve >= 0 && Zn(Ve, e)) return c += 6, R |= 1024, D = "#" + String.fromCharCode(Ve) + ht(), E = 81;
c--;
}
return Zn(xe, e) ? (c++, Lt(xe, e)) : (D = "#", Y(A.Invalid_character, c++, Vt(U))), E = 81;
case 65533:
return Y(A.File_appears_to_be_binary, 0, 0), c = W, E = 8;
default:
let Se = Lt(U, e);
if (Se) return E = Se;
if (n_(U)) {
c += Vt(U);
continue;
} else if (kn(U)) {
R |= 1, c += Vt(U);
continue;
}
let we = Vt(U);
return Y(A.Invalid_character, c, we), c += we, E = 0;
}
}
}
function at() {
switch (de) {
case 0:
return !0;
case 1:
return !1;
}
return he !== 3 && he !== 4 ? !0 : de === 3 ? !1 : Zy.test(k.slice(y, c));
}
function Bt() {
q.assert(E === 0, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'."), c = G = y, R = 0;
let U = ae(c), K = Lt(U, 99);
return K ? E = K : (c += Vt(U), E);
}
function Lt(U, K) {
let Z = U;
if (Zn(Z, K)) {
for (c += Vt(Z); c < W && Ar(Z = ae(c), K); ) c += Vt(Z);
return D = k.substring(G, c), Z === 92 && (D += ht()), $e();
}
}
function ct() {
if (E === 32) {
if (V(c) === 62) return V(c + 1) === 62 ? V(c + 2) === 61 ? (c += 3, E = 73) : (c += 2, E = 50) : V(c + 1) === 61 ? (c += 2, E = 72) : (c++, E = 49);
if (V(c) === 61) return c++, E = 34;
}
return E;
}
function ar() {
return q.assert(E === 67, "'reScanAsteriskEqualsToken' should only be called on a '*='"), c = G + 1, E = 64;
}
function dt(U) {
if (E === 44 || E === 69) {
let K = G + 1;
c = K;
let Z = !1, xe = !1, Se = !1;
for (; ; ) {
let me = oe(c);
if (me === -1 || kn(me)) {
R |= 4;
break;
}
if (Z) Z = !1;
else {
if (me === 47 && !Se) break;
me === 91 ? Se = !0 : me === 92 ? Z = !0 : me === 93 ? Se = !1 : !Se && me === 40 && oe(c + 1) === 63 && oe(c + 2) === 60 && oe(c + 3) !== 61 && oe(c + 3) !== 33 && (xe = !0);
}
c++;
}
let we = c;
if (R & 4) {
c = K, Z = !1;
let me = 0, Ve = !1, Ze = 0;
for (; c < we; ) {
let Ye = V(c);
if (Z) Z = !1;
else if (Ye === 92) Z = !0;
else if (Ye === 91) me++;
else if (Ye === 93 && me) me--;
else if (!me) {
if (Ye === 123) Ve = !0;
else if (Ye === 125 && Ve) Ve = !1;
else if (!Ve) {
if (Ye === 40) Ze++;
else if (Ye === 41 && Ze) Ze--;
else if (Ye === 41 || Ye === 93 || Ye === 125) break;
}
}
c++;
}
for (; qa(oe(c - 1)) || oe(c - 1) === 59; ) c--;
Y(A.Unterminated_regular_expression_literal, G, c - G);
} else {
c++;
let me = 0;
for (; ; ) {
let Ve = Oe(c);
if (Ve === -1 || !Ar(Ve, e)) break;
let Ze = Vt(Ve);
if (U) {
let Ye = wd(Ve);
Ye === void 0 ? Y(A.Unknown_regular_expression_flag, c, Ze) : me & Ye ? Y(A.Duplicate_regular_expression_flag, c, Ze) : ((me | Ye) & 96) === 96 ? Y(A.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, c, Ze) : (me |= Ye, yt(Ye, Ze));
}
c += Ze;
}
U && fe(K, we - K, () => {
yn(me, !0, xe);
});
}
D = k.substring(G, c), E = 14;
}
return E;
}
function yn(U, K, Z) {
var xe = !!(U & 64), Se = !!(U & 96), we = Se || !K, me = !1, Ve = 0, Ze, Ye, Ee, gn = [], rt;
function on(H) {
for (; ; ) {
if (gn.push(rt), rt = void 0, Zr(H), rt = gn.pop(), oe(c) !== 124) return;
c++;
}
}
function Zr(H) {
let le = !1;
for (; ; ) {
let qe = c, ve = oe(c);
switch (ve) {
case -1:
return;
case 94:
case 36:
c++, le = !1;
break;
case 92:
switch (c++, oe(c)) {
case 98:
case 66:
c++, le = !1;
break;
default:
Ue(), le = !0;
break;
}
break;
case 40:
if (c++, oe(c) === 63) switch (c++, oe(c)) {
case 61:
case 33:
c++, le = !we;
break;
case 60:
let xt = c;
switch (c++, oe(c)) {
case 61:
case 33:
c++, le = !1;
break;
default:
Me(!1), cn(62), e < 5 && Y(A.Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later, xt, c - xt), Ve++, le = !0;
break;
}
break;
default:
let Jt = c, ln = M(0);
oe(c) === 45 && (c++, M(ln), c === Jt + 1 && Y(A.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, Jt, c - Jt)), cn(58), le = !0;
break;
}
else Ve++, le = !0;
on(!0), cn(41);
break;
case 123:
c++;
let J = c;
rr();
let mt = D;
if (!we && !mt) {
le = !0;
break;
}
if (oe(c) === 44) {
c++, rr();
let xt = D;
if (mt) xt && Number.parseInt(mt) > Number.parseInt(xt) && (we || oe(c) === 125) && Y(A.Numbers_out_of_order_in_quantifier, J, c - J);
else if (xt || oe(c) === 125) Y(A.Incomplete_quantifier_Digit_expected, J, 0);
else {
Y(A.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, qe, 1, String.fromCharCode(ve)), le = !0;
break;
}
} else if (!mt) {
we && Y(A.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, qe, 1, String.fromCharCode(ve)), le = !0;
break;
}
if (oe(c) !== 125) if (we) Y(A._0_expected, c, 0, "}"), c--;
else {
le = !0;
break;
}
case 42:
case 43:
case 63:
c++, oe(c) === 63 && c++, le || Y(A.There_is_nothing_available_for_repetition, qe, c - qe), le = !1;
break;
case 46:
c++, le = !0;
break;
case 91:
c++, xe ? nn() : Be(), cn(93), le = !0;
break;
case 41:
if (H) return;
case 93:
case 125:
(we || ve === 41) && Y(A.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, c, 1, String.fromCharCode(ve)), c++, le = !0;
break;
case 47:
case 124:
return;
default:
ki(), le = !0;
break;
}
}
}
function M(H) {
for (; ; ) {
let le = Oe(c);
if (le === -1 || !Ar(le, e)) break;
let qe = Vt(le), ve = wd(le);
ve === void 0 ? Y(A.Unknown_regular_expression_flag, c, qe) : H & ve ? Y(A.Duplicate_regular_expression_flag, c, qe) : ve & 28 ? (H |= ve, yt(ve, qe)) : Y(A.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, c, qe), c += qe;
}
return H;
}
function Ue() {
switch (q.assertEqual(V(c - 1), 92), oe(c)) {
case 107:
c++, oe(c) === 60 ? (c++, Me(!0), cn(62)) : (we || Z) && Y(A.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, c - 2, 2);
break;
case 113:
if (xe) {
c++, Y(A.q_is_only_available_inside_character_class, c - 2, 2);
break;
}
default:
q.assert(Ft() || u() || Ie(!0));
break;
}
}
function u() {
q.assertEqual(V(c - 1), 92);
let H = oe(c);
if (H >= 49 && H <= 57) {
let le = c;
return rr(), Ee = wn(Ee, { pos: le, end: c, value: +D }), !0;
}
return !1;
}
function Ie(H) {
q.assertEqual(V(c - 1), 92);
let le = oe(c);
switch (le) {
case -1:
return Y(A.Undetermined_character_escape, c - 1, 1), "\\";
case 99:
if (c++, le = oe(c), nf(le)) return c++, String.fromCharCode(le & 31);
if (we) Y(A.c_must_be_followed_by_an_ASCII_letter, c - 2, 2);
else if (H) return c--, "\\";
return String.fromCharCode(le);
case 94:
case 36:
case 47:
case 92:
case 46:
case 42:
case 43:
case 63:
case 40:
case 41:
case 91:
case 93:
case 123:
case 125:
case 124:
return c++, String.fromCharCode(le);
default:
return c--, Ot(4 | (K ? 8 : 0) | (Se ? 16 : 0) | (H ? 32 : 0));
}
}
function Me(H) {
q.assertEqual(V(c - 1), 60), G = c, Lt(Oe(c), e), c === G ? Y(A.Expected_a_capturing_group_name) : H ? Ye = wn(Ye, { pos: G, end: c, name: D }) : rt?.has(D) || gn.some((le) => le?.has(D)) ? Y(A.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other, G, c - G) : (rt ?? (rt = /* @__PURE__ */ new Set()), rt.add(D), Ze ?? (Ze = /* @__PURE__ */ new Set()), Ze.add(D));
}
function B(H) {
return H === 93 || H === -1 || c >= W;
}
function Be() {
for (q.assertEqual(V(c - 1), 91), oe(c) === 94 && c++; ; ) {
let H = oe(c);
if (B(H)) return;
let le = c, qe = Pt();
if (oe(c) === 45) {
c++;
let ve = oe(c);
if (B(ve)) return;
!qe && we && Y(A.A_character_class_range_must_not_be_bounded_by_another_character_class, le, c - 1 - le);
let J = c, mt = Pt();
if (!mt && we) {
Y(A.A_character_class_range_must_not_be_bounded_by_another_character_class, J, c - J);
continue;
}
if (!qe) continue;
let xt = Qi(qe, 0), Jt = Qi(mt, 0);
qe.length === Vt(xt) && mt.length === Vt(Jt) && xt > Jt && Y(A.Range_out_of_order_in_character_class, le, c - le);
}
}
}
function nn() {
q.assertEqual(V(c - 1), 91);
let H = !1;
oe(c) === 94 && (c++, H = !0);
let le = !1, qe = oe(c);
if (B(qe)) return;
let ve = c, J;
switch (k.slice(c, c + 2)) {
case "--":
case "&&":
Y(A.Expected_a_class_set_operand), me = !1;
break;
default:
J = Xe();
break;
}
switch (oe(c)) {
case 45:
if (oe(c + 1) === 45) {
H && me && Y(A.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, ve, c - ve), le = me, ze(3), me = !H && le;
return;
}
break;
case 38:
if (oe(c + 1) === 38) {
ze(2), H && me && Y(A.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, ve, c - ve), le = me, me = !H && le;
return;
} else Y(A.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, c, 1, String.fromCharCode(qe));
break;
default:
H && me && Y(A.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, ve, c - ve), le = me;
break;
}
for (; qe = oe(c), qe !== -1; ) {
switch (qe) {
case 45:
if (c++, qe = oe(c), B(qe)) {
me = !H && le;
return;
}
if (qe === 45) {
c++, Y(A.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, c - 2, 2), ve = c - 2, J = k.slice(ve, c);
continue;
} else {
J || Y(A.A_character_class_range_must_not_be_bounded_by_another_character_class, ve, c - 1 - ve);
let mt = c, xt = Xe();
if (H && me && Y(A.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, mt, c - mt), le || (le = me), !xt) {
Y(A.A_character_class_range_must_not_be_bounded_by_another_character_class, mt, c - mt);
break;
}
if (!J) break;
let Jt = Qi(J, 0), ln = Qi(xt, 0);
J.length === Vt(Jt) && xt.length === Vt(ln) && Jt > ln && Y(A.Range_out_of_order_in_character_class, ve, c - ve);
}
break;
case 38:
ve = c, c++, oe(c) === 38 ? (c++, Y(A.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, c - 2, 2), oe(c) === 38 && (Y(A.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, c, 1, String.fromCharCode(qe)), c++)) : Y(A.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, c - 1, 1, String.fromCharCode(qe)), J = k.slice(ve, c);
continue;
}
if (B(oe(c))) break;
switch (ve = c, k.slice(c, c + 2)) {
case "--":
case "&&":
Y(A.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, c, 2), c += 2, J = k.slice(ve, c);